Commit graph

481 commits

Author SHA1 Message Date
alexey.lysiuk
c46dcd03a3 - fixed a few dangling pointers on traveling between levels
https://forum.zdoom.org/viewtopic.php?t=69747
2020-09-06 17:14:15 +03:00
Rachael Alexanderson
2c57d5e768 - fix crash in nullptr access to DFrameBuffer object 'screen' if it is uninitialized 2020-06-14 15:33:26 -04:00
Christoph Oelckers
80b5a66635 - fixed bad range check in shadowmap code.
Since the last refactoring this only counts lights, not occupied entries in the array, but the check wasn't adjusted for that.
2020-06-12 15:07:13 +02:00
Christoph Oelckers
2196b4fb04 - moved the frame rate drawer out of DFrameBuffer.
Too much of this is not shareable and all it consists of are drawing operations on the 2D drawer.
2020-04-27 23:53:26 +02:00
Christoph Oelckers
ba0b42465d - changed shadowmap setup so that the AABB tree is owned and controlled by the map, not the renderer.
Needed to properly separate game logic from backend implementation, the shadowmap had both in the same object thanks to the old setup.
2020-04-26 18:54:43 +02:00
Christoph Oelckers
f7dd16ba16 - test skyboxes with dynamic_cast and scale them properly. 2020-04-19 10:57:55 +02:00
Christoph Oelckers
f8ac9a2662 - moved DObject and core parts of the VM to 'common'.
# Conflicts:
#	src/common/objects/dobject.h
2020-04-11 20:20:51 +02:00
Christoph Oelckers
f8e9cb8fbc - major dependency reduction of the texture system. 2020-04-11 20:20:37 +02:00
Christoph Oelckers
be24023722 - split animation management out of the texture manager into a separate class. 2020-04-11 20:20:36 +02:00
Christoph Oelckers
4af96bab47 - some cleanup on music code.
* change the license of the main file because there is no more id-based code here licensed under the GPL.
* moved VM interface definition out of the implementation.
* moved idmus CCMD out of implementation because it is dependent on Doom level definitions.
* moved s_music.cpp into the music folder with the rest of the music code.
2020-04-11 20:19:54 +02:00
Christoph Oelckers
ac610d87e5 - merged FPalette and PaletteContainer. 2020-04-11 20:19:53 +02:00
Christoph Oelckers
05d8856fe0 - moved file system implementation to 'common'. 2020-04-11 14:00:20 +02:00
Christoph Oelckers
6996d54a23 - moved more code to 'common'.
This is all low level utilities with no dependencies on game logic. Having this in a separate directory makes sharing with Raze a lot easier.
2020-04-11 14:00:12 +02:00
Christoph Oelckers
cf757ba834 - made the translation container a class.
This also splits off some Doom-specific implementation details into higher level headers.
2020-04-11 14:00:11 +02:00
Christoph Oelckers
520a96033b - minimalized the interface to the translation tables to a small set of functions.
Now the internals can be refactored without affecting all using code.
2020-04-11 14:00:10 +02:00
Christoph Oelckers
0a7344e432 - abstract the external translation interface.
The translation table array now only gets accessed from within r_translate.cpp.
2020-04-11 14:00:10 +02:00
alexey.lysiuk
e9a7dcd17b - precache switch textures from ANIMATED lump
For example, SW1SKULL and SW2SKULL switches are animated in TNT: Evilution
Their frames are defined in ANIMATED lump which is old BOOM binary format
Textures other than base were not cached because the corresponding switch definitions (in ANIMDEFS lump) have one frame only and BOOM style animations were not taken into account

https://forum.zdoom.org/viewtopic.php?t=66652
2019-12-23 13:11:06 +01:00
Christoph Oelckers
f7f51e1964 - fixed: The dynamic lights must be initialized before the first frame is ticked.
Otherwise they only show up after the first frame.
2019-10-17 00:11:38 +02:00
Christoph Oelckers
2e7af1338c - the big cleanup of the exit cleanup is done!
atterm is gone and only a few system-side functions use atexit.
All game side cleanup is performed in D_DoomMain now.
2019-10-07 20:28:55 +02:00
Christoph Oelckers
86ab366958 - some reformatting on exit code, mainly to make searching for the content easier. 2019-10-01 19:06:28 +02:00
hdr88
554eb1c813 Add current, max and average velocity as stat (#912)
* Add current, max and average velocity as stat
2019-08-28 20:33:07 +02:00
Christoph Oelckers
66db894866 - split off all music code from s_sound.cpp 2019-08-23 17:15:19 +02:00
Christoph Oelckers
7346288bf5 - moved some more files. 2019-07-14 21:09:49 +02:00
Christoph Oelckers
2766303cfc - consolidated the 3 atterm implementations.
Each platform had its own copy. Why?
2019-06-10 12:01:01 +02:00
Christoph Oelckers
aa550310f6 - allow the language table to supersede the title patches, if appropriate
For the Doom IWADs the provided font looks almost identical to the characters used on the title patches. So, for any level name that got replaced in some language, it will now check if the retrieved name comes from the default table, and if not, ignore the title patch and print the name with the specified font.

This also required removing the 'en' label from the default table,  because with this present, the text would always be picked from 'en' instead of 'default'. Since 'en' and 'default' had the same contents, in any English locale the 'default' table was never hit, so this won't make any difference for the texts being chosen.

Last but not least, wminfo has been made a local variable in G_DoCompleted. There were two places where this was accessed from outside the summary screen or its setup code, and both were incorrect.
2019-02-15 00:29:24 +01:00
Christoph Oelckers
f38060d01b - fixed: The static event manager never got a link to the primary level. 2019-02-06 15:40:49 +01:00
Christoph Oelckers
26acd564fb - restored order of destruction of interpolations and thinkers, which got accidentally reversed. 2019-02-04 16:27:57 +01:00
Christoph Oelckers
9f7fe203fc - had to fix a few things. 2019-02-02 17:29:13 +01:00
Christoph Oelckers
66eb4e5048 - separation of static and map-local event handlers into separate lists.
Having everything lumped together made this a maintenance hassle because it affected how the level has to be stored.
This hasn't been tested yet, so it may not work as intended!
2019-02-02 16:43:11 +01:00
Christoph Oelckers
484485f3cf - made the event manager an object so it can be instantiated multiple times. 2019-02-02 10:46:34 +01:00
Christoph Oelckers
45dc9a7b47 - renamed the level variables.
currentUILevel is now primaryLevel.
For ZScript, currentVMLevel was added. This is also exported as 'level' and will change as needed.
This also means that no breaking deprecations will be needed in the future, because in order to sandbox a level only 4 variables need to be handled: level, players, playeringame and consoleplayer.
The remaining global variables are not relevant for the level state.

The static 'level' has been mostly removed from the code except some places that still need work.
2019-02-02 00:25:51 +01:00
Christoph Oelckers
d358e401ee - removed all access to the consoleplayer variable from the play code
There is one exception in ACS for a net arbitrator check.
Aside from this the bot_observer CVAR was also removed. This was never implemented properly and could stomp upon custom player settings.
2019-02-01 17:02:10 +01:00
Christoph Oelckers
e3eaa5964d - removed v_video.h include from portals.h
This has no business in a play related file which also made no use of it.
2019-02-01 00:30:21 +01:00
Christoph Oelckers
f6a91e1722 - moved the I_Error prototypes to doomerrors.h to avoid having to include the low level system header for this. 2019-01-31 19:38:04 +01:00
Christoph Oelckers
1dcdfec733 - Unload behavior with the map, not outside. 2019-01-31 17:58:18 +01:00
Christoph Oelckers
64ac6dbc6e - moved thinker storage into FLevelLocals. 2019-01-30 19:09:21 +01:00
Christoph Oelckers
3b4ded5694 - refactored the thinker list.
This was an unorganized set of static members in DThinker but has now been regrouped into something more structured.
2019-01-30 02:15:48 +01:00
Christoph Oelckers
8bbdee5c28 - redirect most references to the global players array through FLevelLocals.
The Map loader may not access any global state at all - everything it can touch must be exchangable.
Furthermore, if we want to sandbox each level, there may be no direct access to any kind of global state whatsoever from the play code.
2019-01-30 01:15:32 +01:00
Christoph Oelckers
ebdb2643c4 - moved UDMF custom properties into FLevelLocals. 2019-01-30 00:47:20 +01:00
Christoph Oelckers
6451b7d592 - moved the combined compatibility flags into FLevelLocals. 2019-01-29 19:28:22 +01:00
Christoph Oelckers
3c565c9e86 - moved the static sky variables into FLevelLocals and removed the redundant ones for the texture ID. 2019-01-29 04:44:44 +01:00
Christoph Oelckers
68667e5eaa - moved particle storage into FLevelLocals.
- moved parts of the render setup out of the separate render functions.

Things like particle and polyobject linking were duplicated several times for rendering different things in different renderers.
These things only need to be set up once before the renderer is started so it makes a lot more sense to consolidate them into one place outside the actual rendering code.
2019-01-29 01:09:02 +01:00
Christoph Oelckers
50d59e99cb - moved sound sequence head of list into FLevelLocals. 2019-01-28 23:53:40 +01:00
Christoph Oelckers
3364988680 - moved the interpolator into FLevelLocals and refactored its use to happen outside the renderers.
There is no need to do this deep inside the renderer where it required code duplication and made it problematic to execute on multiple levels.
This is now being done before and after the top level call into the renderer in d_main.cpp.
This also serializes the interpolator itself to avoid problems with the Serialize functions adding the interpolations into the list which can only work with a single global instance.
2019-01-28 18:26:14 +01:00
Christoph Oelckers
41e576bbb5 - removed the intermediate P_SpawnPlayer inline 2019-01-28 03:02:25 +01:00
Christoph Oelckers
66695ac6a0 - made most of the player spawn spot handliing functions members of FLevelLocals. 2019-01-28 02:44:05 +01:00
Christoph Oelckers
d941dea005 - added a level iterator for operations that need to make changes to all open levels.
Since currently there is only one level, this will obvciously only run once on that level for the time being.

This is mainly used for CCMDs and CVARs which either print some diagnostics or change some user-settable configuration.
2019-01-28 02:41:29 +01:00
Christoph Oelckers
648e472744 - handled approx. half of all cases where the address of level is taken. 2019-01-28 00:55:21 +01:00
Christoph Oelckers
b4a95ccaa9 - roughly 50 more, mostly search and replace. 2019-01-27 19:16:14 +01:00
Christoph Oelckers
8323524014 - give thinkers a 'level' member and change linking to the chain to happen outside the constructor. 2019-01-27 01:49:20 +01:00