Commit graph

46 commits

Author SHA1 Message Date
JugadorXEI
2891f60341 Store terrain ID instead of terrain pointer, add new helpers and accomodate for this 2024-05-31 21:15:40 +02:00
Sally Coolatta
7dfa597c7d SRB2 -> DRRR copyright in src, acs, android folder
Be consistent with toaster's recent changes to copyright
2024-04-05 02:08:23 -04:00
James R
dca764e81d R_LoadTexturePwad: fix faulty texture counting
This fixes the game trying to load textures that don't
exist from addons.
2024-03-16 20:47:34 -07:00
James R
7d23dd49af Let base game textures be 4096x4096 max, print developer warning in DEVELOP
- In the future we should make sure no textures exceed
  2048x2048, but this fine for release
- The warning will not show up in release builds
2024-03-09 16:14:54 -08:00
James R
6d7dd8adac Disallow textures >2048 in size, print a console warning 2024-03-09 16:14:13 -08:00
James R
2ee595419c Let texture loading skip some textures
- Set numtextures correctly if textures are skipped (no
  textures are skipped in this commit)
2024-03-09 15:35:08 -08:00
James R
b6241adbe9 Use PU_LEVEL for texture caching
- Some maps may contain very large or very many (animated)
  textures
- Texture sets are not typically shared between maps, so
  each texture allocation may go unused for a long time
  after the map ends
- Keeping these PU_STATIC leads to significant memory
  usage over the program duration
2024-02-08 17:50:38 -08:00
James R
73e032573d TERRAIN: add 'remap' boolean, toggles ENCOREMAP/TWEAKMAP
- Software* + OpenGL support
- *Not supported: R_DrawColumnShadowed_8
  - This has something to do with walls and FOF lights.
    However, I don't see an easy code solution and I don't
    know how to even test this.
2023-12-22 19:02:06 -08:00
James R
03deb45c67 Cache TERRAIN on texture_t
- K_GetTerrainForTextureNum no longer performs a string
  lookup
2023-12-22 19:02:06 -08:00
Eidolon
68a8f2b274 Multithread software drawing 2023-10-14 15:26:52 -05:00
James R.
b2b215e4be R_GenerateTextureBrightmap: install bounds checking on patch columnofs
- Warn if reading past end of patch data (corrupt lump or
  incorrect format).
2023-09-10 20:09:50 -07:00
James R.
717a9e3f97 Add R_GetBrightmapColumn, convert brightmaps to associated texture's column layout
- Ensures that column drawer doesn't read out of bounds
  the brightmap column.
- Refactored code in r_segs.cpp, so it checks
  R_TextureHasBrightmap.
- Added comments for plane brightmaps and sprite
  brightmaps, that these are still error-prone.
2023-09-09 21:08:11 -07:00
James R.
599c5dc122 Add R_AllocateDummyTextureBlock, set texture->holes so empty column is always rendered correctly 2023-09-09 20:44:24 -07:00
James R
47411735d0 Single-patch textures: print an error if patch header is missing, cease memory errors 2023-04-22 15:21:23 -07:00
James R
92bf2d0989 Add specialized drawing loop for debugfinishline
- Cache DBGLINE texture
- Draw this texture at horizon (player's eye level)
- Draw this texture at max brightness
- Do not slope skew this texture
- Use R_DrawColumn_Flat_8 to colorize the this texture
2023-03-26 05:27:58 -07:00
James R
04a2bdcda9 DEVELOP: warn about duplicate textures in mainwads
Checks on a background thread since the complexity should
be O(n^2). The specific texture data it checks shouldn't
change after R_LoadTextures so it doesn't need a mutex.
2023-03-13 16:41:26 -07:00
Sally Coolatta
e202f244b9 Allow smaller flat sizes
With mobj scale, smaller flats are pretty reasonable to want to use. Fixes a visual bug in Endless Mine.
2022-09-23 15:25:42 -04:00
Sally Coolatta
559222f991 Stuff for Ivo's texture crunching
- Flats no longer get applied entirely, they are FULLY DEPRECATED NOW
- Uses AASMELLY instead of REDWALL for missing textures
2022-08-28 00:03:22 -04:00
toaster
cd7e125863 Update texturecache user when reallocating
# Conflicts:
#	src/r_textures.c
2022-03-12 18:00:52 +00:00
Sally Coolatta
e4aa53a92e Merge branch 'master' into fast-addfile 2021-12-18 18:21:32 -05:00
James R
4578e6f8f1 Hash name lookup for textures and lumps 2021-12-16 22:10:36 -08:00
James R
a4742c7da7 P_AddWadFile: only load textures in current file 2021-12-16 18:37:09 -08:00
Sally Coolatta
b0317e7120 Merge branch 'master' into brightmap 2021-12-16 13:06:57 -05:00
Sally Coolatta
04c1a9dcb1 Brightmaps on walls 2021-12-16 09:40:14 -05:00
James R
152f4224d9 Read only header bytes when creating textures list
R_LoadTextures was reading in the entirety of every
texture lump, now it only reads the 8 byte PNG header.
This saved more than 1 second for me (1.68 s -> 0.24 s).

PNG still need to be read in entirely to check their
dimensions; I didn't bother looking into optimizing it
since we don't have many PNG textures right now.
2021-12-15 14:08:57 -08:00
James R
2ac9761af0 Free unused texture lumps in R_LoadTextures
PU_CACHE never gets freed automatically and Z_Unlock does
NOTHING.
2021-12-14 23:19:45 -08:00
Sally Coolatta
44ed9fcd4c ZDEBUG is default
- ZDEBUG2 is now ZDEBUG ... although admittedly, it doesn't seem that useful, it just enables some CONS_Debug's ... but now there's a convenient way to enable them now I suppose
- Mostly just means the I_Errors give __FILE__ and __LINE__.
- Also enables a "memdump" command that just prints a bunch of zone memory info.

I don't think any of this should be guarded, so I went ahead and did this.
2021-04-26 14:49:45 -04:00
James R
08348fcd43 Merge remote-tracking branch 'srb2/next' 2021-04-05 01:26:17 -07:00
toaster
40cbc30bff Mammoth commit, sorry.
All my work thus far on solving the drawflag/renderflag/additive/subtractive conundrum.

Outstandng problems:
* Bad additive/subtractive tables means that they appear opaque except under certain conditions.
* No support for FOFs, Polyobjects, or linedefs in OpenGL yet.
* All OpenGL support mostly done blind, may or may not function in practice.

If nothing else, the hard engineering problems are solved and it's just bug hammering...
2021-03-31 22:46:23 +01:00
Jaime Ita Passos
316ecff003 [Software] A few floorsprite fixes
This fixes the texture of the floorsprite sometimes facing the wrong way, since plane rendering can change the view angle.
2021-03-29 23:04:13 -03:00
Jaime Ita Passos
940f134717 Fix a crash in Picture_GetPatchPixel with PICFMT_DOOMPATCH formats 2020-12-14 00:53:42 -03:00
Jaime Passos
b44837324f Merge branch 'next' into patch-stuff-again-2 2020-10-10 17:01:10 -03:00
Jaime Passos
9ad15fd556 Fix PNG issue in OpenGL + optimize PNG sprite loading 2020-10-02 19:48:13 -03:00
Jaime Passos
d18d12fdea Introduce Doom patch format into picture formats
Fixes sprite rotation
2020-08-15 21:52:01 -03:00
Jaime Passos
7bc4af41ab Merge branch 'pictureformats' into patch-stuff-again-2 2020-08-15 20:48:28 -03:00
Jaime Passos
10189ecdc0 Merge branch 'next' of https://git.magicalgirl.moe/STJr/SRB2 into pictureformats 2020-07-21 22:25:00 -03:00
Jaime Passos
1bf1da749e Fix memory leak 2020-05-15 15:45:00 -03:00
Jaime Passos
c69a4f9ced Merge remote-tracking branch 'origin/next' into pictureformats 2020-05-15 01:34:54 -03:00
Jaime Passos
41840f6375 Merge remote-tracking branch 'origin/next' into pictureformats 2020-01-20 16:53:41 -03:00
Jaime Passos
c7eed47340 Provide some cleaner method to generate textures as flats.
R_GenerateTextureAsFlat
2020-01-07 16:51:02 -03:00
Jaime Passos
769c1a4e38 Fix OpenGL 2020-01-07 14:07:14 -03:00
Jaime Passos
e2d0ddfb54 R_GetTextureFlat -> R_GetLevelFlat 2020-01-07 13:27:59 -03:00
Jaime Passos
82998100d3 Move location of R_CheckPowersOfTwo and R_CheckFlatLength 2020-01-07 12:46:46 -03:00
Jaime Passos
fb0d9cdede Move location of R_GetTextureFlat 2020-01-07 12:45:22 -03:00
Jaime Passos
b6ced0884e Organise header files, use R_GetFlat 2020-01-07 12:43:27 -03:00
Jaime Passos
96340ac80c Move texture stuff to its own file 2020-01-07 12:35:10 -03:00