Commit graph

52 commits

Author SHA1 Message Date
Eidolon
892a6b8620 Merge public master 2025-08-12 16:49:14 -05:00
Eidolon
255570cfca Dynamically allocate skins
This avoids an issue where the skins array takes up a fixed, but large
amount of memory at runtime. On x86_64 linux, that array is roughly 80
megabytes in memory, most of which is unused when the game is unmodded.
Instead, we treat `skins` as a dynamically resizing array, and it is an
array-of-pointers into separate allocated `skin_t`.

This is based on Lactozilla's skin limit MR for SRB2, but I've rewritten
it because RR has diverged quite a bit.

This was verified to check every access of `skins` by using clangd's
find-all-references function. However, I have only tested plain skins,
not Lua addons, so that could afford some extra checking.
2025-08-12 15:33:00 -05:00
Eidolon
cb7f437e60 Merge public master 2025-02-13 15:48:11 -06:00
Eidolon
a4d304a1f5 Update copyright years to 2025 2025-02-13 15:32:26 -06:00
Eidolon
1ee5547bb2 Allocate imgbuf on-demand in Picture_PatchConvert
This static var requires a 64 megabyte .bss section value which
is allocated on application startup. Depending on the particulars of the
operating system's virtual memory implementation, this may result in
dynamic page allocation for the span, or a full upfront allocation.
Either way, it doesn't need to be like this, we can just dynamically
allocate the buffer instead.

This may save up to 64MiB of runtime memory usage.
2024-12-13 10:55:22 -06: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
toaster
7f0df71558 R_SkinAvailableEX
- Most R_SkinAvailable calls should be returning index into demo.skinlist (same numerical value as when demo was recorded), for demo sync
- A handful of general things permit exception for this
- Expose `replaynumskins` (calculated as `(demo.playback ? demo.numskins : numskins)`) to Lua
    - There's *always* more that can be done for this, but this is the minimum spec that can at least be somewhat stable
2024-03-05 13:21:38 -08:00
James R
48d1b72ac7 SPRTINFO: print warnings instead of I_Error (don't crash the game) 2023-08-31 05:22:13 -07:00
James R
a9469c8ffb Check return value of png_get_tRNS before using trans
png_get_tRNS may not set pointers if it fails.
2023-02-10 18:37:49 -08:00
James R
9c8d6dfaa6 Add BrightMap support to SPRTINFO 2022-12-05 13:14:50 -08:00
James R
0912ebaaa3 Update and extend R_ParseSpriteInfo for default pivot
- Set default pivot with DEFAULT block
- Use wildcard star (*) with Sprite/Sprite2Info/Skin to
iterate over all sprites and/or skins
2022-09-21 14:15:28 -07:00
James R
58bc3294fa Refactor R_ParseSpriteInfo
Splits up the function, thus makes me want to kill myself
less.
2022-09-21 12:30:29 -07:00
Jaime Ita Passos
4563722695 tRNS chunk fix
Fixes a faulty check not properly detecting the presence of a tRNS chunk.
2022-03-18 13:56:01 +00:00
Jaime Ita Passos
96edcff902 Optimize Picture_GetPatchPixel 2022-03-18 13:55:04 +00:00
James R
bef9f502ca pedantic: cast to (void*) for printf %p 2022-02-20 03:15:51 -08:00
Sally Coolatta
9d7ec0ab8f Merge SRB2 next
Probably doesn't compile yet, but I got rid of all of the conflicts for anyone who wants to take a stab at it.
2021-02-27 05:18:36 -05:00
Jaime Ita Passos
940f134717 Fix a crash in Picture_GetPatchPixel with PICFMT_DOOMPATCH formats 2020-12-14 00:53:42 -03:00
Jaime Ita Passos
be274a4fa9 Merge branch 'next' into spritestuff2 2020-11-19 00:52:43 -03:00
Sally Coolatta
fed0ed98de Add R_SpriteRotationAngle function
Gets the rotation angle for the mobj's sprite. Meant for pitch & roll later, but that part is if'd out currently and just returns mobj->rollangle
2020-10-30 15:54:58 -04:00
Jaime Passos
53a5e75855 Correctly return the output patch's size in Picture_PatchConvert 2020-10-13 19:16:25 -03:00
Jaime Passos
e23929a899 Refactor patch rotation 2020-10-10 18:43:26 -03:00
Jaime Passos
b44837324f Merge branch 'next' into patch-stuff-again-2 2020-10-10 17:01:10 -03:00
Jaime Passos
e746a1ecba Only check the tRNS (trans) chunk if the image is still palettized 2020-10-10 14:17:53 -03:00
Jaime Passos
8dcc415202 Compare the PNG's palette with the game's palette instead of assuming they are the same 2020-10-10 14:17:42 -03:00
Jaime Passos
f75aa6cd18 Use leftoffset and topoffset, not loffs and toffs 2020-10-02 20:40:42 -03:00
Jaime Passos
9ad15fd556 Fix PNG issue in OpenGL + optimize PNG sprite loading 2020-10-02 19:48:13 -03:00
Jaime Passos
a8d3510958 Attempt to use the PNG image's palette, if it is present 2020-09-10 03:16:21 -03:00
Jaime Passos
15eb91be69 Use color look-up table for PNG conversion 2020-09-10 02:10:31 -03:00
Jaime Passos
98c6b54994 Improved memory management for patches 2020-09-07 02:23:07 -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
c69a4f9ced Merge remote-tracking branch 'origin/next' into pictureformats 2020-05-15 01:34:54 -03:00
Jaime Passos
81a57d5fac Merge remote-tracking branch 'origin/next' into pictureformats 2020-03-07 20:43:16 -03:00
Jaime Passos
a6472c2ffb Merge remote-tracking branch 'origin/next' into pictureformats 2020-01-10 04:11:26 -03:00
Jaime Passos
e459a44848 Fix shadowed declarations 2020-01-07 20:07:35 -03:00
Jaime Passos
c85c1550c3 Fix Picture_GetPatchPixel 2020-01-07 20:05:40 -03:00
Jaime Passos
058ad19433 Fix patch generation 2020-01-07 20:05:33 -03:00
Jaime Passos
f39368dfb0 use enum for bpp 2020-01-07 20:04:18 -03:00
Jaime Passos
9c66740e2b AA trees are not needed at all for rotated patches 2020-01-07 16:10:38 -03:00
Jaime Passos
3b29ec3fbc Merge remote-tracking branch 'origin/next' into pictureformats 2020-01-07 16:10:25 -03:00
Jaime Passos
e2d0ddfb54 R_GetTextureFlat -> R_GetLevelFlat 2020-01-07 13:27:59 -03:00
Jaime Passos
96340ac80c Move texture stuff to its own file 2020-01-07 12:35:10 -03:00
Jaime Passos
d18b0dcde8 How did I mess this up? 2020-01-06 22:08:51 -03:00
Jaime Passos
d9b64c14c6 Missing check 2020-01-06 21:16:33 -03:00
Jaime Passos
a24607a452 Don't force 16bpp if the bit depth was already higher! 2020-01-06 21:02:25 -03:00
Jaime Passos
fd2340d802 Make error messages consistent 2020-01-06 20:42:46 -03:00
Jaime Passos
c4e082d56e Fix patch conversion 2020-01-06 20:39:38 -03:00
Jaime Passos
66dedc3730 Initialise 2020-01-06 20:20:05 -03:00
Jaime Passos
385a6cf3c3 Cleanup, NOW 2020-01-06 20:16:48 -03:00