Commit graph

20208 commits

Author SHA1 Message Date
Eidolon
a6aeb1194f Merge branch 'convert-sdl-i-video' into 'master'
cxx: Convert sdl/i_video.cpp

See merge request KartKrew/Kart!872
2024-12-30 00:00:30 -05:00
NepDisk
941bebec21 Update core folder 2024-12-29 23:55:09 -05:00
James R.
b819d43296 Move HOM removal from R_RenderPlayerView to D_Display
This lets duplicate displayplayers[0] render correctly,
since repeating occurrences of displayplayers[0] won't
clear the screen multiple times.
2024-12-29 17:29:37 -05:00
Sal
bf9e2cf6a6 Sky offsets
Both X and Y offsets work on sky textures now. Old incorrect offset has been removed, so old skies lined up with the horizon special should be set to +16 Y offset.
2024-12-29 16:39:32 -05:00
Eidolon
b73d71abc9 Fix parallel slope plane calculations 2024-12-29 16:37:20 -05:00
James R
b80a69cea1 R_DrawMaskedColumn: do not draw zero length column
- Column would be zero length if there are no visible
  pixels in it.
- Trying to draw such a column results in a negative
  heightmask in R_DrawColumnTemplate and a probable read
  out of bounds.
2024-12-29 16:26:52 -05:00
Eidolon
974a1df0ca Merge branch 'papersprite-papercuts' into 'master'
Mitigations for software papersprite light eval crashes

See merge request KartKrew/Kart!1893
2024-12-29 16:18:38 -05:00
AJ Martinez
5a4cd36e23 Fix stale reference in P_KillMobj (crash) 2024-12-29 16:16:55 -05:00
James R
97b9e7d4fc 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-12-29 16:16:37 -05:00
James R
e90224bcd1 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-12-29 16:16:08 -05:00
James R
2ec9a60029 R_DrawMaskedColumn: set texheight to column length
- In R_DrawColumnTemplate, texheight is used to switch
  between a non-PO2 rasterizer and a more efficient PO2
  rasterizer.
- There is bounds checking on the non-PO2 version (in the
  form of sourcelength) but not on the PO2 version.
- texheight was set to the sprite patch height, which may
  be taller than the column (sourcelength), leading to a
  read out of bounds.
2024-12-29 16:16:02 -05:00
James R
86b8757aee devmode render: display skybox portal, visplane and drawseg counts on HUD
- Skybox portal count moved from console print to HUD
- Displays visplane count and drawseg count
2024-12-29 16:10:12 -05:00
Oni
ac2b3651ae Merge branch 'fix-column-fix' into 'master'
R_DrawColumn_Template: fix non-po2 column drawing

Closes #1033

See merge request KartKrew/Kart!1913
2024-12-29 15:58:35 -05:00
James R.
6191c392e5 Merge branch 'r-draw-column-minor-optimization' into 'master'
R_DrawColumnTemplate: minor optimization for non-power-of-2 textures

See merge request KartKrew/Kart!1854
2024-12-29 15:57:30 -05:00
Oni
5c48744842 Merge branch 'templated-drawing' into 'master'
Use C++ templates for DrawColumn/Span

See merge request KartKrew/Kart!1728
2024-12-29 15:56:33 -05:00
James R
917b549f46 Vissprites: set dc.texheight
Fixes power-of-2 detection in R_DrawColumnTemplate.
2024-12-29 15:52:35 -05:00
NepDisk
976c08d4df Fix vissprite crash 2024-12-29 15:30:50 -05:00
Sally Coolatta
397f79fcbf 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-12-29 15:19:24 -05:00
Sal
e33fa49d5a Merge branch 'memory-tweaks' into 'master'
Hanicef allocator changes, simplified memcpy and fixed alignment

See merge request KartKrew/Kart!1530
2024-12-29 15:14:36 -05:00
Eidolon
ece92bbbc9 Convert m_misc.c to .cpp 2024-12-29 15:11:39 -05:00
James R
ac6ca8ae27 R_GenerateBlendTables: allocate copy of palette for use in thread
The palette can be freed while this thread is still
running, which means the thread would end up reading from
freed memory.
2024-12-29 14:51:25 -05:00
NepDisk
2a50e4693a Fix noencore map not getting used. 2024-12-29 14:39:06 -05:00
Eidolon
95b98700ae Add encoremap to textures-as-flats 2024-12-29 14:37:35 -05:00
James R
2a4caa9fe6 R_RasterizeFloorSplat: fix encore remap 2024-12-29 14:36:22 -05:00
James R
d062173bfc 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.
2024-12-29 14:31:53 -05:00
toaster
db427af153 HWR_ProjectSprite: Fix messed up encore remap check (resolves #1224) 2024-12-29 14:20:05 -05:00
James R.
08e1dd870e Merge branch 'fix-map-plane-crash' into 'master'
Fix some R_MapPlane crashes in splitscreen; debugrender_visplanes and debugrender_portal; some multithreading crashes

Closes #1032 and #1021

See merge request KartKrew/Kart!1997
2024-12-29 14:15:32 -05:00
NepDisk
4fd99ef3ff Multithreaded Software rendering 2024-12-29 14:14:28 -05:00
Eidolon
fc7e04305b r_things.c -> r_things.cpp 2024-12-29 13:41:57 -05:00
James R
8bd5ca8974 Clean up code duplication around RANGECHECK in r_things.c 2024-12-29 13:40:11 -05:00
NepDisk
e138e8ad52 i_system.c -> cpp 2024-12-29 13:19:05 -05:00
NepDisk
08e30ed2cb Use thirdparty span
thirdparty libs prob shouldn't be included in src
Fix for make later.
2024-12-29 10:26:37 -05:00
NepDisk
9c01e10cde Add SPMC queue + thread pool job executor
This is by Eidolon
2024-12-29 09:27:11 -05:00
James R
d8dcb81b99 CMakeLists.txt: use libfmt from thirdparty/fmt
Now compiles on Ubuntu 22.04, which only has libfmt 8.
I don't know which exact version of libfmt we need but the
one in thirdparty works.

This version of libfmt is header-only.
2024-12-29 09:25:34 -05:00
AJ Martinez
c6f71adf56 License compliance for libwebm, libyuv, libvpx, libxmp, fmt, imgui, tcbrindle span 2024-12-29 09:19:50 -05:00
Eidolon
c42271c72e Add per-frame linear memory allocator 2024-12-29 09:13:37 -05:00
Eidolon
09d661c331 Convert d_main.cpp 2024-12-29 09:05:17 -05:00
NepDisk
b7b9fdabae Fix transparency issues 2024-12-28 09:03:39 -05:00
NepDisk
3b0e62e495 Clean up R_RenderMaskedSegLoop 2024-12-28 08:41:56 -05:00
James R
76aa677901 debugfinishline: highlight deathpits and instakill planes 2024-12-28 08:03:14 -05:00
James R
23cb7b7fa1 Let debugfinishline highlight Respawn Lines too
- Finish Lines now render with black & yellow instead of
  red & white
- Respawn Lines render with red & white
2024-12-28 08:00:46 -05:00
James R
312c4234b0 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
2024-12-28 07:58:41 -05:00
James R
92ca47e9c5 Add debugfinishline, highlight finish line linedefs and black fill solid walls
- Highlight is drawn across the screen at the horizon
  (player's eye level).
- Highlight alternates between red and white for 35 tics
  each.
2024-12-28 07:53:45 -05:00
NepDisk
c68b60a67a Fix direction dot and color 2024-12-27 14:57:48 -05:00
James R
3db50f6b6b Draw MMAPDOT in front of players' facing angles on the minimap 2024-12-27 13:19:39 -05:00
James R
85ce609374 Show waypoints on the minimap, if debugwaypoints is enabled
- Uses in level waypoint colors:
  - Green for player's next waypoint
  - Pink for shortcuts
  - Gray for disabled waypoints
  - Yellow for ego orb
  - Blue for ordinary waypoints
- The player's next waypoint appears slightly larger
2024-12-27 12:23:26 -05:00
NepDisk
6b01a279c9 Port r_main to CPP 2024-12-27 12:16:36 -05:00
James R
47f21b1402 debugrender_visplanes: highlight borders of visplanes 2024-12-27 11:55:07 -05:00
James R
637fe772f4 Add debugrender_portal command
- Fills portals with red
- Draws portals over planes and masked
2024-12-27 11:53:22 -05:00
James R
0f3a8f669b Add cv_debugrender_spriteclip, toggle sprite clipping
This cvar can be used to reveal which sprites are
technically drawn but clipped completely by level
geometry.
2024-12-27 11:52:46 -05:00