Commit graph

12438 commits

Author SHA1 Message Date
Christoph Oelckers
e074c75609 - added a generic TransformRect to the status bar so that the proper transformations can be applied to draw operations that require special parameters not supported by the stock functions. 2017-04-02 12:58:31 +02:00
alexey.lysiuk
4cf3e1be2c Removed obsolete workaround for Apple's GCC 4.x from node builder 2017-04-02 11:51:58 +03:00
alexey.lysiuk
1033976158 Fixed typo in status bar function name
https://mantis.zdoom.org/view.php?id=519
2017-04-02 11:47:10 +03:00
alexey.lysiuk
bb9cd1b159 Removed special initialization of legacy render styles
Workaround for Apple's GCC 4.0.1 is now completely pointless
2017-04-02 11:41:04 +03:00
alexey.lysiuk
5187acd44f Fixed undefined behavior in drawing of status bar graphics
Debug configuration built with Apple's Clang had bogus render styles applied to graphics in status bar
2017-04-02 11:38:59 +03:00
alexey.lysiuk
659f75c84a Avoid duplication of member in OpenGL software framebuffer class 2017-04-02 10:13:25 +03:00
alexey.lysiuk
63f85f6b07 Fixed compilation of Cocoa backend
Use the same member names in framebuffer class for all backends
2017-04-02 10:11:41 +03:00
Magnus Norddahl
4268090738 - switch OpenGLSWFrameBuffer to use m_Lock instead of LockCount 2017-04-02 00:47:18 +02:00
Magnus Norddahl
4a9dffa70d - change subsector gbuffer to use a 8x8 block memory layout to avoid having to clip memory reads and writes 2017-04-01 23:21:06 +02:00
Magnus Norddahl
0ed60b8df6 - fix OpenGLSWFrameBuffer::Begin2D 2017-04-01 22:14:04 +02:00
Christoph Oelckers
3f552ea95f - added loop tag reading to the new streaming music class.
This is somewhat brute-force thanks to the surprising lack of good documentation for the Ogg headers. The only other option would have been some rather bloated library for a function that should be 25-30 lines at most.
2017-04-01 21:40:36 +02:00
Christoph Oelckers
dfd3535e02 - added a dedicated player class for streamed music formats (i.e. MP3, Ogg and Flac)
The idea is to have more control on the game side instead of dealing with these formats in the backend, which was done for FMod because it already had the decoders implemented.
However, with OpenAL this setup makes no sense and only complicates future extensions that can be better handled at a higher level.
2017-04-01 19:47:12 +02:00
Magnus Norddahl
4a0b3c3bab - speed up triangle setup slightly 2017-04-01 16:42:24 +02:00
Christoph Oelckers
553906b186 - fixed: BaseStatusbar::GetAmount returned the default item's amount if the player held none of the given type. This should only be done for MaxAmount. 2017-04-01 13:33:42 +02:00
Christoph Oelckers
7dae43bf7f - fixed: The health chain in Hexen wasn't drawn on the main status bar. Did some reordering to ensure it won't get skipped. 2017-04-01 13:18:19 +02:00
Christoph Oelckers
699d4882d5 - fixed: The ammo display in Doom should not be drawn if the current weapon does not use ammo. 2017-04-01 13:08:45 +02:00
Christoph Oelckers
54764c136d - changed the 2D draw abort check to use a dedicated variable, that gets set in Begin2D and unset at the end of D_Display.
This is really all the extent where 2D draw operations may be allowed. Trying to detect this from other variables is not reliable.
2017-04-01 12:59:58 +02:00
Christoph Oelckers
9dc8933109 - let 'stat think' also print the number of active thinkers. 2017-04-01 12:30:38 +02:00
alexey.lysiuk
36ad485edd Proper default value for GL framebuffer lock in Cocoa backend
No more error when running with +map command line parameter with classic HUD:
> VM execution aborted:  Attempt to draw to screen outside a draw function
> Called from BaseStatusBar.DrawImage [Native]
> Called from DoomStatusBar.DrawFullScreenStuff at gzdoom.pk3:zscript/statusbar/doom_sbar.txt, line 140
> Called from DoomStatusBar.Draw at gzdoom.pk3:zscript/statusbar/doom_sbar.txt, line 41
2017-04-01 13:16:31 +03:00
Christoph Oelckers
e780cd8297 - seems the wrong version of this got committed... 2017-04-01 12:04:31 +02:00
Christoph Oelckers
41f2f61b94 - minor VM optimization: Precalculate a function's frame size when compiling it instead of doing it each time it gets called.
This made up ca. 10% of the 'call' instruction's execution time.
2017-04-01 10:42:47 +02:00
alexey.lysiuk
893607c96c Fixed crash in decals handling caused by reference to undefined class
https://forum.drdteam.org/viewtopic.php?t=7589
2017-04-01 10:36:35 +03:00
alexey.lysiuk
59ae50aecb Fixed compilation warning reported by GCC/Clang
src/gl/textures/gl_texture.cpp:691:25: warning: comparison of integers of different signs: 'unsigned int' and 'int' [-Wsign-compare]
2017-04-01 10:24:05 +03:00
Magnus Norddahl
da6bfe65ff - only calculate gradients once 2017-04-01 04:38:15 +02:00
Magnus Norddahl
6db89a2ce1 - clean up the triangle setup functions 2017-04-01 03:44:45 +02:00
alexey.lysiuk
f48af606df Fixed creation of BaseStatusBar
No more access to memory ouside of class instance
Minimized amount of copy-pasted code

https://mantis.zdoom.org/view.php?id=511
2017-03-31 12:53:28 +03:00
Christoph Oelckers
5601364aaf - fixed some issues with Set/GetClipRect. 2017-03-30 21:12:39 +02:00
Christoph Oelckers
51d89740e3 - fixed mouse input for scale slider. 2017-03-30 20:12:39 +02:00
Christoph Oelckers
228c57fae3 - fixed: Even SBARINFO needs to call the scripted Init method of the status bar because it initializes some data used by the automap HUD. 2017-03-30 19:00:26 +02:00
Christoph Oelckers
91ac6e30fe - fixed: The automap tried to access a variable before it was initialized.
The fix is not ideal but the way this code is used it cannot be done any better.
2017-03-30 18:51:24 +02:00
Christoph Oelckers
3a1228bf95 - exported the clipping rectangle to scripting and added a statusbar scaling wrapper for it.
- fixed: BaseStatusBar.Fill did not pass its flags parameter to the native function.
2017-03-30 12:13:28 +02:00
Christoph Oelckers
a3ef711d1d - added a special slider type for the scaling options that prints a descriptive text instead of the slider for the special settings.
- fixed the adaptive scale calculation in GetUIScale which had the coordinates mixed up.
2017-03-30 11:30:09 +02:00
Christoph Oelckers
f95c29ad28 cleaned up the scaling options.
- all 5 settings affected by uiscale have been changed to have the exact same semantics: -1, if supported means special scaling, this is available for HUD and status bar, 0 means to use uiscale, any larger value is a direct scaling factor.
- scaling is cut off when the factor is larger than screenwidth/320 or screenheight/200 because anything larger will definitely not fit.
- a lot of code has been cleaned up and consolidated. Especially the message code had an incredible amount of redundancy.
- all scaling options have been moved into a submenu. This menu is not complete, though - it still requires a special menu widget to convey the intended information without confusing the user.
2017-03-30 02:16:23 +02:00
Christoph Oelckers
1dcc017daf - reimplemented the position display, but changed its position a bit upward.
- activated the RenderOverlay event, now that it can be called from the correct spot, i.e. right after the top level HUD messages are drawn. The system's status output will still be drawn on top of them.
2017-03-29 23:51:53 +02:00
Christoph Oelckers
bde73fc530 - added automatic brightmaps.
Everything in the brightmaps/auto directory will automatically be assigned to the same-named texture.
2017-03-29 23:13:11 +02:00
Christoph Oelckers
7011010ff2 - fixed the drain callback.
- changed the effect spawn prevention of the Hexen flame strike weapon and reverted the attempt to fix this in FastProjectile.

This cannot be fixed in the base class, which was doing everything right. It's the flame missile that was doing undefined things by stopping its movement without clearing its missile flag. This cannot work because missiles are given some minimal forced velocity to ensure collision detection and any attempt to address this without clearing the missile flag is doomed to fail.
2017-03-29 22:50:13 +02:00
Christoph Oelckers
3f9ad55432 - allow multiple expressions in 'for' iteration part. 2017-03-29 22:18:52 +02:00
Christoph Oelckers
b38934b532 - fixed declaration of ACS getters for status bar.
- fixed some uninitialized variables in font print code.
2017-03-29 21:54:11 +02:00
Christoph Oelckers
01b095c911 - added colorization for untranslated fonts. This uses the light color of the vertices. The software rendered 2D code will ignore this infomation.
- added a virtual OnRetrun method to menus.
2017-03-29 21:22:05 +02:00
Christoph Oelckers
d36f656caf - added a callback for when damage is drained from a target. 2017-03-29 20:25:54 +02:00
Christoph Oelckers
356144a537 - fixed: The player menu was not able to set the new name because the security check did not account for the text enter menu being present. 2017-03-29 20:11:58 +02:00
Christoph Oelckers
9d1031f0ba - fixed ForcedScale handling in SBARINFO.
Due to the setup it would miss setting it when changing between HUDs.
2017-03-29 20:01:57 +02:00
Christoph Oelckers
401a1e80e8 - fixes typo in actionspecials.h. 2017-03-29 19:24:56 +02:00
Christoph Oelckers
1d4ab0cc2a - implemented proper scaling for the status bar itself.
This allows using the UI scale or its own value, like all other scaling values.
In addition there is a choice between preserving equal pixel size or aspect ratio because the squashed non-corrected versions tend to look odd, but since proper scaling requires ununiform pixel sizes it is an option.

- changed how status bar sizes are being handled.

This has to recalculate all scaling and positioning factors, which can cause problems if the drawer leaves with some temporary values that do not reflect the status bar as a whole.
Changed it so that the status bar stores the base values and restores them after drawing is complete.
2017-03-29 19:23:40 +02:00
Christoph Oelckers
87479d3c2f -use the proper functions to calculate the position of the popup screen in Strife. 2017-03-29 14:28:46 +02:00
Christoph Oelckers
7ba6860102 - scriptified the automap HUD and made it obey hud_scale instead of always being fully scaled. 2017-03-29 14:20:22 +02:00
Christoph Oelckers
2f06c09681 - fixed map name display on the automap HUD
This would cut off overlong names and the handling for status bars with protruding elements was far too simplistic and worse, making assumptions based on game mode.
It now uses a virtual function to query the status bar itself for returning this information so it can be overridden and uses V_BreakLines to split the text if it is wider than the display.
2017-03-29 10:36:16 +02:00
Christoph Oelckers
fabf8451e7 - use Fill to draw Strife's health bars. 2017-03-29 02:24:04 +02:00
Christoph Oelckers
598523a1de - moved all coordinate adjustment for the status bar mode into one function and use this function in all places where status bar related coordinate adjustments need to be performed, also in SBARINFO.
- fixed unscaled status bar placement.
- fixed inventory count display for Doom status bar.
2017-03-29 01:59:03 +02:00
Christoph Oelckers
914c829f79 - added Floor/Ceiling_MoveToValueAndCrush action specials. 2017-03-29 01:25:02 +02:00