Commit graph

363 commits

Author SHA1 Message Date
Nep2Disk
7aceefa904 Add support for terrain floorClip and RF_ALWAYSONTOP in legacyGL 2025-09-15 20:59:15 -05:00
Eidolon
7febf53ec0 Merge public master 2025-08-23 11:34:18 -05:00
Chearii
19fdf19eb4 Add baked offset parameters 2025-08-23 11:20:14 -05:00
Oni
c2cafcdbfb Merge branch 'hitlagjitter-interp' into 'master'
Interpolate hitlag jitters

See merge request KartKrew/RingRacers!112
2025-08-23 00:24:54 +00:00
Eidolon
6e8fdf7f59 Merge public master 2025-08-18 16:30:49 -05:00
Eidolon
dcef3fd4e9 Merge branch 'fixmodelinitoverflow' into 'master'
Fix buffer overflow in HWR_InitModels

See merge request KartKrew/RingRacers!114
2025-08-18 21:08:48 +00:00
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
toaster
471e11f4b5 HWR_CreateBlendedTexture: Do not operate on colorbrightnesses outside of TC_RAINBOW
This array is uninitialised when that is not being operated upon, and the valid context was only one bracket away, so shift it over
2025-05-18 15:50:34 +01:00
Alug
c07e0452c7 fix overflow due to too small name array size in fscan in model init 2025-05-17 18:25:41 +02:00
luigi budd
2d8c10a694 Interpolate hitlag jitters 2025-05-10 21:33:06 +00:00
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
8f88c29387 SRB2 -> DRRR copyright in hardware folder 2024-04-05 10:00:33 -04:00
James R
1be8e6a762 Legacy GL: models support demo skin silhouettes
Code more closely matches R_GetSpriteTranslation
2024-03-25 04:03:57 -07:00
James R
30b3199e28 Legacy GL: models support TC_BLINK 2024-03-25 04:03:27 -07:00
Lach
8d7cc11346 Typo correction: Lightning -> Lighting 2024-03-09 19:25:43 +11:00
Lach
dd52fb7620 Disable directional lighting on Ark Arrow models 2024-03-09 17:37:54 +11: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
AJ Martinez
47a9cce133 Add shittysigns cheat 2024-03-02 04:27:41 -07:00
SteelT
488386db68 Check for SPR2_SIGN, SPR2_SIGL and SPR2_TALK as well 2024-01-22 22:40:38 -05:00
SteelT
626d39870b Don't allow model rendering on Ring Shooter face overlay 2024-01-22 22:19:13 -05:00
AJ Martinez
fb20f7b036 Merge branch 'opengl-brightmaps' into 'master'
OpenGL BRIGHTMAPs + sprite/model directional lighting

See merge request KartKrew/Kart!1485
2024-01-19 05:14:41 +00:00
Sal
9382031337 OpenGL sprite+model directional light 2024-01-17 12:05:12 -08:00
Sally Coolatta
0f695e203f Use old faster luminance calc for HWR blends
Not accurate to Software's look but can't be assed to fuck around with legacy HWR to implement this as shader.
2024-01-17 13:27:32 -05:00
Sally Coolatta
5067bb854a Split hitlag into its own file 2023-06-30 23:05:40 -07:00
toaster
8d9b42e49b Skin name search-assistive hashing
More opportunities for early rejection in table-wide searches, in anticipation of future work.
- Many circumstances independently implemented string name comparisons. Most of these have been converted to use R_SkinAvailable, with one exception.
    - M_CharacterSelectInit already needs to iterate over the characters, so produce the skin hash independently.
2023-05-30 12:21:40 +01:00
James R
76112c0321 Support spritexoffset/spriteyoffset for 3D models 2022-10-25 02:36:35 -07:00
X.organic
902fcfa569 Miscellaneous memory bug fixes to make AddressSanitizer happy
# Conflicts:
#	src/d_clisrv.c
#	src/dehacked.c
#	src/hardware/hw_cache.c
#	src/hardware/hw_md2.c
#	src/http-mserv.c
#	src/lua_hudlib_drawlist.c
2022-09-12 16:49:18 +01:00
Sally Coolatta
0a7b437328 Fix offsets for models 2022-08-24 00:46:12 -04:00
Eidolon
f7ec2f182f Uncapped (squashed v2)
Squashed SRB2 2.2 Public uncapped without UDMF merge

Implement interpolation at the renderer level

Instead of interpolating thinkers, we interpolate mobjs inside the
renderer. Further interpolation is TBI.

Place Frame Interpolation in "Experimental" video options header

This seems like an appropriate way to describe the feature for now.

Add smooth level platter under interpolation, `renderdeltatics`

`renderdeltatics` can be used as a standard delta time in any place,
allowing for smooth menus. It will always be equal to `realtics`
when frame interpolation is turned off, producing consistent
framerate behavior everywhere it is used.

Add smooth rendering to save select screen

Add smooth rendering to Record/NiGHTS Attack, F_SkyScroll

Ensure viewsector is accurate to viewx/viewy

This fixes a potential crash in OpenGL when changing between levels.

Ensure + commands get executed before map start

Always have precise_t defined

Fix misc dropshadow issues

Reset view interpolation on level load

Remove unnecessary precipmobj thinker hack

Add reset interpolation state functions

Reset precip interpolation on snap to ceil

Reset mobj interp state on TeleportMove

Only swap view interp state if a tick is run

Run anti-lag chasecam at tic frequency

Fixes jittery and unstable chasecam in high latency netgames

Homogenize mobj interpolations

Add sector plane level interpolations

Add SectorScroll interpolator

Add SideScroll interpolator

Add Polyobj interpolator

Intialize interpolator list at a better time

Delete interpolators associated with thinkers

Interpolate mobj angles and player drawangle

Interpolate HWR_DrawModel

Add functions to handle interpolation

Much less code duplication

P_InitAngle, to fix angle interpolation on spawning objects

Fully fix drop shadows

It used the thing's floorz / ceilingz directly -- that wouldn't account for interpolated coordinates.

Do not speed up underwater/heatwave effect in OpenGL

Closer OpenGL underwater/heatwave effect to Software

Interpolate from time of previous tic

Previously interpolated from last 35th of a second, which
may be offset from game time due to connection lag.

Consider this the proper fix to 6ecac4159a too.

Calculate FPS stuff even if frame is skipped

I decided ultimately to actually keep the frame skip optimization disabled, because I think it is actually a little bit helpful that you can still get accurate rendering perfstats while paused, however if we decide otherwise then we can have this optimization back without making the game act like it's lagging.

Keep rect in memory

Feel better about this than creating one all da time

Lots of FPS stuff

- Disabled VSync, due to the numerous problems it has.
- Instead, added an FPS cap.
- Frame interpolation is now tied to fpscap != 35.
- By default, the FPS cap is set to the monitor's refresh rate.
- Rewrote the FPS counter.

(This also consolidates several more commits ahead of this
fixing various issues. -eid)

Misc changes after Kart cherry-picks

Fix renderdeltatics with new timing data

Update mobj oldstates before all thinkers

Allow FPS cap values

Adjust how FPS cap is checked to improve FPS stability

Fix precip crash from missing vars

Improve the framerate limiter's timing for extreme stable FPS

Handle the sleep at the end of D_SRB2Loop instead of the start

Simplifies logic in the other parts of the loop, and fixes problems with it frequently waiting too long.

Reset mobj interp state on add

Add mobj interpolator on load netgame

Move mobj interpolators to r_fps

Dynamic slope interpolators

I_GetFrameTime to try and improve frame pace

(It doesn't feel that much better though.)

Move I_FinishUpdate to D_SRB2Loop to sync screen updates with FPS cap, use timestamps in I_FrameCapSleep to simplify the code

Fix plane interpolation light level flickering

Fix flickering plane interpolation for OpenGL in the exact same way

Funny OpenGL renderer being at least 50% copy-pasted Software code :)

P_SetOrigin & P_MoveOrigin to replace P_TeleportMove

Convert P_TeleportMove use to origin funcs

Revert "P_InitAngle, to fix angle interpolation on spawning objects"

This reverts commit a80c98bd164a2748cbbfad9027b34601185d93f5.

Waypoint polyobjects interpolate z & children

Add interpolation to more moving plane types

Adds interpolation to the following:
- Crumbling platforms
- Mario blocks
- Floatbob platforms (this one works really strangely due to two thinkers, maybe double-check this one?)

Reset overlays interp states each TryRunTics

Interpolate model interpolation (lol)

Use interp tracer pos for GL linkdraw

Papersprite angle interpolation

Makes the ending signpost smooth

Move intermission emerald bounce to ticker

Bring back shadows on polyobjects

Also optimizes the method used so rings can show their shadows too. Using just the subsector is a tad bit imprecise admittedly but any more precise methods get really laggy.

Fix a bunch of ticking in hu_ drawing functions

Revert "Reset overlays interp states each TryRunTics"

This reverts commit a71a216faa20e8751b3bd0157354e8d748940c92.

Move intro ticking out of the drawer

Adjust 1up monitor icon z offsets

Fixes interpolation issues with 1up monitors.

Delta time choose player menu animations

Add drawerlib deltaTime function

Interpolate afterimages further back

Use old sleep in dedicated mode

Clamp cechotimer to 0

Fixes issues with cechos staying on-screen and glitching out
(NiGHTS items for example).

Revert "Remove unnecessary precipmobj thinker hack"

This reverts commit 0e38208620d19ec2ab690740438ac2fc7862a49e.

Fix frame pacing when game lags behind

The frame timestamp should've been made at the start of the frame, not the end.

Fix I_FrameCapSleep not respecting cpusleep

Jonathan Joestar bruh

Allow dedicated to use precise sleep timing again

Instead of only using one old sleep, just enforce framerate cap to match TICRATE.

Make Lua TeleportMove call MoveOrigin

Reset Metal fume interp state on appear

Add interpdebug

Put interpdebug stuff in perfstats instead

Add timescale cvar

Slow the game down to debug animations / interpolation problems! Speed it up if you need to get somewhere quickly while mapping!

Enable timescale outside of DEVELOP builds

It has NETVAR, so it should be fine -- put an end to useful debugging features excluded in multiplayer!

Force interpolation when timescale != 1.0

Reset old_z in MT_LOCKON think

Fixes interpolation artifacting due to spawn pos.

Fix cutscenes in interp

Fix boss1 laser in interp

Interpolate mobj scale

Precalculate refresh rate

Slower PCs can have issue querying mode over and over. This might kinda suck for windowed mode if you have different refresh rate displays but oh well

Fix interp scaling crashing software

Reset interp scale when Lua sets .scale

Disable angle interp on fresh mobjs

Fix interp scale crash for hires sprites

Interp shadow scales

Copy interp state in P_SpawnMobjFromMobj

Fix multiplayer character select

Don't interpolate mobj state if frac = 1.0

Fix Mario block item placement

Interpolate spritescale/offset x/y

Fix offset copies for SpawnMobjFromMobj

THANKS SAL

Add Lua HUD drawlists

Buffers draw calls between tics to ensure hooks
run at the originally intended rate.

Rename drawerlib deltaTime to getDeltaTime

Make renderisnewtic is false between tics

I know what I'm doing! I swear

Completely refactor timing system

Time is now tracked internally in the game using I_GetPreciseTime
and I_UpdateTime. I_Time now pulls from this internal timer. The
system code no longer needs to keep track of time itself.

This significantly improves frame and tic timing in interp mode,
resulting in a much smoother image with essentially no judder at
any framerate.

Ensure mobj interpolators reset on level load

Ensure view is not interpolated on first frame

Disable sprite offset interpolation (for now)

Refactor timing code even more

System layer is greatly simplified and framecap
logic has been moved internally. I_Sleep now
takes a sleep duration and I_SleepDuration
generically implements a precise sleep with spin
loop.

Adjust spawned mobj z by gravity inversion

Only check VERTICALFLIP for old_z calc

Fix Marathon Mode menu for uncapped

Move screenshot code before timing

Only play emerald hunt sounds on new tics

Restore deleted zofs (fixes signpost sparkles etc)

Revert to before screenUpdate boolean was added

Was done this way for the sake of an older version of uncapped's timing; now that the new timing is much better, I decided it should remain as close to pre-uncapped as it can be.

Run UpdateLevelInterpolators in preticker

Fixes KartKrew/Kart-Public#10

Run UpdateMobjInterpolators in preticker

Reset view interp in preticker

Add per-split player view resets
2022-05-06 22:47:39 -05:00
toaster
982c6d9a2e Merge branch 'boss-code-extras' into 'master'
Extra code changes for boss

See merge request KartKrew/Kart!563
2022-03-22 13:06:15 +00:00
James R
6dd38f001a Fix boss flash in opengl 2022-03-21 13:05:01 -07:00
lachablock
c331bac825 Fix models interpolating to frame 0 from a same-sprite2 FF_SPR2ENDSTATE state 2022-03-18 17:10:32 +00:00
James R
bef9f502ca pedantic: cast to (void*) for printf %p 2022-02-20 03:15:51 -08:00
James R
26d231c43a Only ignore colormap for fullbright 2022-01-20 05:09:39 -08:00
James R
ecc3d031df Ignore colormap when overriding thing brightness 2022-01-20 03:57:58 -08:00
James R
ff70bd0d83 Fix opengl semibright
Adds back 3d models semibright.
2022-01-20 03:52:32 -08:00
Sally Coolatta
ce01b494f4 Add functions to handle interpolation
Much less code duplication
2021-12-24 11:30:19 -05:00
James R
a90520ebdc Do not factor roll and pitch into model rollangle
Those transformations are applied separately so the model
tilts in 3d space.
2021-12-10 00:32:46 -08:00
James R
1ac123246d Model stretching 2021-12-09 22:41:54 -08:00
James R
4f04c0c430 Tilt models 2021-12-09 22:41:54 -08:00
SteelT
d0caa79414 Merge branch 'snapify-hitlag' into 'master'
Snapify Hitlag 2

See merge request KartKrew/Kart!461
2021-12-08 01:53:28 +00:00
Sally Coolatta
4a8222d397 Just set default renderdelta when paused
Supports multiple pause types too
2021-11-30 14:28:27 -05:00
Sally Coolatta
5fea80c61b Apply interp to models, apply sprite world offsets properly 2021-11-29 08:46:56 -05:00
Sally Coolatta
0974d6d1f4 Reduced hitlag jitter
Makes a little easier to parse. I might have gone overboard but I really wanted to test my hunch if Ivo's issue was mostly the fact it jitters so hard :V
2021-11-28 00:08:50 -05:00
Sally Coolatta
cb5ea8b335 Add basic damage hitlag effects
- Invert high contrast greyscale colorization effect for damage hitlag
- Jitter is now also exclusive to damage-related hitlag
- Since jitter is now just tied to a flag, removed the old trick momentum hack
2021-11-27 13:38:45 -05:00
toaster
b3d006b093 structs gunched 2021-04-17 00:27:13 +01:00
James R
08348fcd43 Merge remote-tracking branch 'srb2/next' 2021-04-05 01:26:17 -07:00
toaster
690244825b * Fixed blending in OpenGL.
* Caught a UDMF-only crash for Software (where linedef alpha is low but nonzero).
2021-04-03 19:29:06 +01:00