Commit graph

26 commits

Author SHA1 Message Date
Eidolon
a4d304a1f5 Update copyright years to 2025 2025-02-13 15:32:26 -06:00
bitten2up
cfacbd91be Fix implicit casts of int expecting 4-byte width
This fixes the issue with certain compilers that have int set to
different sizes by either explicitly casting or setting templates
manually
2024-05-03 17:53:53 +00: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
3e225f97a2 Render errored holey textures as TRANSERx 2024-02-11 17:10:09 -08:00
James R
38c9c5f9a7 devmode render: show a list of errored holey textures on the HUD
Holey textures (textures with transparent pixels) cannot
be used on upper/lower textures or on 1-sided linedefs. If
the game tries to render this, the texture name will
appear on the HUD if devmode render is turned on.
2024-02-11 17:10:09 -08:00
James R
27b4013c18 R_DrawColumn_Template: fix non-po2 column drawing
- Fix for efd017085
- To preserve tutti-frutti fix, offset drawing with
  texheight, but detect po2 with sourcelength
2024-02-09 19:46:45 -08:00
James R
f9b66ad969 R_RenderMaskedSegLoop, R_RenderThickSideRange: set dc.colormap above first FOF
How lightlists work:

- Each FOF casts a shadow beneath it.
- Draw the column above each FOF with colormap set from
  the previous FOF.
- Then set colormap from the current FOF, so the next FOF
  is bathed in the current FOF's shadow.

What broke:

- Colormap was not set when drawing the column above the
  first FOF.

This commit:

- Before iterating lightlists, set colormap to base sector
  lighting.
- De-duplicate some code by using lambdas.
2024-02-05 19:04:23 -08:00
James R
9bb6031a4e R_StoreWallRange: do not render textures with holes
- Holey textures are ones where the column height may not
  match the texture height.
- R_DrawColumn cannot cope with this directly and it may
  lead to a read out bounds.
- Transparency would not render for true wall textures
  anyway since these are not masked midtextures, so just
  don't render the texture in this case.
2024-02-05 19:04:23 -08:00
Eidolon
6648e55972 Prevent overflow when scaling textures
Fixes KartKrew/Kart#844 which is caused by scaling the texheight by a
spryscale that is too large, triggering arithmetic overflow before the
overflow check even occurs. This is a performance hit, but should not be
very intense with release optimizations.

Instead, we use saturating arithmetic using the same integer promotion
technique as before, but checking in both directions, and also checking
for the multiplication before the addition.

There is an optimization opportunity here and anywhere that overflow
checks are used, by using compiler intrinsics which check the overflow
flag bit on the CPU instead of using integer promotion.
2024-01-28 12:57:00 -06:00
Eidolon
26017c4fdd Clamp patch column post drawing bounds
Prevents segfaults when drawing patches in certain configurations
2024-01-12 18:32:06 -06:00
Sally Coolatta
cc2c19bcff Fix brightmaps on midtextures not working
Fixes Lost Colony (again)
2024-01-11 01:50:46 -08:00
Sally Coolatta
24132a9dcd Use C++ templates for DrawColumn/Span
Two reasons:
- Makes it more straight-forward to add brightmaps to the non-power-of-two rendering functions.
- Made it easier to split off brightmap rendering. Hopefully improves performance, but I haven't thoroughly tested this.
2024-01-11 01:50:46 -08:00
James R
dae4454055 Use untranslated texture for checking R_TextureCanRemap
- Handles animated textures correctly
2023-12-22 19:02:07 -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
Eidolon
68a8f2b274 Multithread software drawing 2023-10-14 15:26:52 -05:00
James R
5415674034 debugfinishline: highlight deathpits and instakill planes 2023-10-04 20:17:31 -07:00
Eidolon
689f5b8365 Tracy instrument software BSP traversal and render 2023-09-18 16:19:31 -05: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
70294e62bd Automatically disable directional lighting if the sector has no sky 2023-08-11 01:41:49 -07:00
James R
b94f64e82f Fix misc -Wmaybe-uninitialized
These only show up for me ifdef TESTERS, for some reason.
2023-08-08 15:29:30 -07:00
James R
46406931c1 Toggle all manner of directional lighting with MSF_FLATLIGHTING 2023-07-27 17:49:45 -07:00
James R
4e984fbcff Software: fix directional lighting on two-sided midtextures
blame c53ae816c1
2023-04-27 13:19:35 -07:00
toaster
a2362c8bae Merge branch 'misc-debug' into 'master'
Misc. debug features

See merge request KartKrew/Kart!1158
2023-04-11 16:11:18 +00:00
James R
9c80d53f54 R_StoreWallRange: remove duplicated closed door checks 2023-04-08 21:24:11 +01:00
James R
fc865f9aad R_RenderSegLoop: move column drawing code to generic R_DrawWallColumn function 2023-04-08 21:24:11 +01:00
James R
9cc9b73021 Convert r_segs.c to r_segs.cpp 2023-04-08 21:24:11 +01:00
Renamed from src/r_segs.c (Browse further)