Commit graph

158 commits

Author SHA1 Message Date
Christoph Oelckers
21d4aae182 - fixed lookup for tile aliases pointing to non-existent tiles. 2022-12-18 15:19:35 +01:00
Christoph Oelckers
e78fd90f67 - adapted sky code for using texture IDs. 2022-12-18 14:42:27 +01:00
Christoph Oelckers
8dfbbc8220 - migrated floorpicnum and ceilingpicnum to FTextures.
The sky code still needs some work.
2022-12-18 14:32:52 +01:00
Christoph Oelckers
4a306a21dc - split several texture flags off into a surface type value.
Using the same field in the TexExtInfo struct as Blood's surfType.
This frees up a lot of flags for later use.
2022-12-18 13:56:54 +01:00
Christoph Oelckers
1a6f808fca - refactored all access to the fake picanm[] array.
Also use symbolic names in precache calls in Blood.
2022-12-18 13:26:29 +01:00
Christoph Oelckers
e23a5095cb - moved the other tile info tables of Blood to the texExtInfo array as well.
The two fields are easily reusable for the other games so it's a welcome simplification.
2022-12-18 13:23:59 +01:00
Christoph Oelckers
c34756e5f2 - cleanup of voxel init code.
The voxreserve array was never properly set up so it is gone now.
nextvoxid now gets set right before loading .def files.
2022-12-18 13:18:44 +01:00
Christoph Oelckers
8a789b9015 - voxel management cleanup.
Moving the voxel index into the texExtInfo array and removing most of Blood's and SW's special handling.
2022-12-18 13:18:43 +01:00
Christoph Oelckers
6ff91f8ebc - disable the freelist management for discarded tiles.
This does not work as implemented - may be checked out later, but this is not essential.
2022-12-18 13:06:09 +01:00
Christoph Oelckers
20edd800f9 - big texture system refactor.
Finally that quickly slapped together BuildTiles class is gone and replaced with something that better integrates with the underlying texture manager
2022-12-18 13:05:58 +01:00
Christoph Oelckers
3874cf365c - use TEXMAN_ForceLookup where it was missing. 2022-12-11 19:45:38 +01:00
Christoph Oelckers
58db09969c - moved tileForName out of BuildTiles.
Just pulling one change out of the big upcoming refactor commit.
2022-12-11 19:45:18 +01:00
Christoph Oelckers
0bacb05c1b - wrapped hiofs in a getter function.
This makes it a lot easier later to refactor.
2022-12-11 19:45:01 +01:00
Christoph Oelckers
aa58b152ab - use a TArray in BuildTiles for the tile descriptors.
For some reason MSVC wants to put this in the EXE now and the array is quite large.
2022-12-11 19:45:00 +01:00
Christoph Oelckers
f479f995a1 - transitioned all tileLeftOffset and tileTopOffset calls to use the texture manager. 2022-12-11 19:44:01 +01:00
Christoph Oelckers
0869497ecb - rewrote the tile pixel cache to work on texture IDs instead of tile IDs.
This allows using the related checking features with other textures as well.
2022-12-11 19:44:00 +01:00
Christoph Oelckers
4ecb4aacb2 - mark all return values from the texture() getters as const.
This is necessary to evade C++ stupidity which happily allows assignment to non-const struct type return values and won't even warn about it.
As const these will throw an error when that happens.
2022-12-11 19:44:00 +01:00
Christoph Oelckers
63c1630cda - more texture wrappers and minor cleanup. 2022-12-11 19:44:00 +01:00
Christoph Oelckers
e5225e98e0 - migrated SW's portal setup code to texture IDs. 2022-12-11 19:43:59 +01:00
Christoph Oelckers
f4bda94dad - added tileGetTextureID and tested it with Blood's mirror/portal setup code. 2022-12-11 19:43:59 +01:00
Christoph Oelckers
bfef616981 - let tileDelete create a new null texture instead of using the default one.
This is to ensure that marker textures are still unique.
2022-12-11 19:43:59 +01:00
Christoph Oelckers
028cf2daf5 - added access wrappers for getting texture IDs from the map and used that to rid a large chunk of the renderer of direct tilenum access. 2022-12-11 19:43:59 +01:00
Christoph Oelckers
49f87e6227 - got rid of gotpic.
Now everything uses the 'seen' flag in the texture which indicates that the texture was actually used for hardware rendering since the last check.
It's also only the 3 places checking this flag which are responsible for clearing it.
2022-12-11 19:43:58 +01:00
Christoph Oelckers
a0722c55ea - removed canvas hack stuff from Buildtiles after cleaning up the mess in SW. 2022-12-11 19:43:58 +01:00
Christoph Oelckers
51ad64f71e - initialize all special tiles to their intended type before starting the game.
This ensures that we have an immutable mapping of tile number to texture ID now.
2022-12-11 19:43:58 +01:00
Christoph Oelckers
faeb19a485 - do the handling of 90° rotated wall textures in the renderer instead of duplicating the texture.
Aside from less resource use this also works with hires replacement - which the old code was incapable of.
2022-12-11 19:43:58 +01:00
Christoph Oelckers
6a690849e6 - cleanup on the tile management.
* removed the long defunct EDuke32-based map art system. With our move to named textures this will not work anymore so fixing the existing problems would be pointless.
* moving .def related parsing stuff out of buildtiles.cpp.
* some initial refactoring to make the tile store a static, non-modifyable resource after initial setup.
2022-12-11 19:43:58 +01:00
Christoph Oelckers
67e807de26 - exported the tile flag setters to .def. 2022-12-11 18:42:01 +01:00
Christoph Oelckers
5a2819239c - moved Duke's tile flags into the tile manager.
This is so that .def can access them. Later the other games also might make use of this.
2022-12-11 18:42:01 +01:00
Christoph Oelckers
94b91f6ec3 - build.h cleanup
* moved krand and krandf into the games/duke folder because no other game uses them
* moved CVARS to gamefuncs.h.
2022-10-30 16:51:09 +01:00
Christoph Oelckers
a4dd5bb4ce - rewrote the model storage code.
Using proper C++ containers now.
2022-10-27 16:55:54 +02:00
Christoph Oelckers
e71254dfa6 - floatified some parts of the SO interface for consistent use of MAXSO. 2022-10-06 20:50:45 +02:00
Mitchell Richters
03fd5c2ebe - Repair frame timer in tileAnimateOfs() following consolidation in 4f2170655c.
* All games that aren't Blood depend on Build's original 120Hz timer for this, not the playsim's clock.
2022-08-25 21:44:14 +02:00
Christoph Oelckers
738c133d05 - animation precaching cleanup.
No need to handle animations on the,game side. markTileForPrecache already handles this - now also for oscillating animations.
2022-08-05 23:48:43 +02:00
Christoph Oelckers
4f2170655c - animateoffs cleanup and consolidation
This was rewritten based on specs alone - it still doesn’t look that different due to its simplicity.
2022-08-05 23:32:16 +02:00
Christoph Oelckers
c2fc7577db - cleanup of 3D viewport code.
Removes all the hackery that Polymost needed and now uses a sane struct to store the info.
2022-08-05 17:04:45 +02:00
Christoph Oelckers
f194fb6c90 - added a name to tilenum function so that we can define picnums by name in scripted actors. 2022-01-24 00:24:47 +01:00
Christoph Oelckers
747648ce78 - added guards against badly defined skies. 2022-01-22 22:52:45 +01:00
Mitchell Richters
9bbb54fe2e - Replace every line that just contains spaces or tabs with an empty line feed in all files except 3rd party libraries. 2021-12-30 20:30:21 +11:00
Christoph Oelckers
9e14b168bb - addressed more shadowed variables in common code. 2021-12-30 09:57:32 +01:00
Christoph Oelckers
11f41a97d5 - made gotpic a FixedBitArray.
gets rid of some inline garbage.
2021-12-30 09:53:56 +01:00
Christoph Oelckers
c2baa68160 - fixed camera textures breaking in SW when restarting a level.
This was caused by attempting to delete the camera textures when cleaning up the mirror array.
The Build tile manager was not prepared for such a use case and left a broken texture behind.

To allow this to function it now resets the texture replacement type when deleting a tile and to avoid creating new camera textures these will now be stored in a cache and recycled later.
2021-12-02 21:40:43 +01:00
Christoph Oelckers
793aaf242c - make upscaling of sky textures depend on the single tile size, not the entire composite texture. 2021-11-29 00:57:10 +01:00
Christoph Oelckers
01abe7b2ac - addressed most unused/uninitialized variable warnings from MSVC. 2021-11-29 00:55:30 +01:00
Christoph Oelckers
dfb18ef9a9 - Duke/RR: Call Bowling lane reset code only when playing RR.
This may alter some tile references which will cause problems with hires replacements in Duke .
2021-07-25 12:43:03 +02:00
Mitchell Richters
d77e143ee8 - allow palette emulation for indexed hightiles. 2021-07-17 07:40:13 +10:00
Christoph Oelckers
3e76f71f02 - support for indexed hightiles. 2021-07-17 07:40:05 +10:00
Christoph Oelckers
e3737d3330 - fixed texture lookup for hightile lookup.
Not all commands had the proper flags to also look in the root folder.
2021-07-13 08:38:24 +02:00
Christoph Oelckers
f0d2aef9d9 - fixed hires replacements for colorized font characters. 2021-06-01 11:29:39 +02:00
Christoph Oelckers
454816299e - reorganized loading of textures.
Due to dependencies on initializing some data in app_init it was not possible to cleanly set up the fonts.
This adds a game-side function for loading the entire palettes before starting with the texture data and another one for loading game-side texture data.
This now allows fully setting up the palettes before starting with the textures and to fully set up the textures before reading the .def files.

All this is needed because to properly initialize, the fonts need to be able to access the fully initialized texture state, including replacements and hires substitutions from the .def files.
2021-06-01 11:05:26 +02:00