Commit graph

186 commits

Author SHA1 Message Date
GenericHeroGuy
bcef031c85 WIP affine patch drawing
will probably invert the matrix
2025-12-31 15:40:35 +01:00
Indev
7af70c581a Add itemtimers and lapsplits into list of lua-togglable hud items 2025-12-24 01:41:07 +03:00
GenericHeroGuy
bcb0eb95cc More fastcmp cleanup 2025-12-11 21:58:37 +01:00
Indev
ad58341eb2 Add 'time per frame' argument for hud.setVoteBackground 2025-12-03 12:39:12 -05:00
Indev
83db0b1025 Expose cameras to lua outside of hud hooks 2025-12-01 13:51:21 -05:00
Anonimus
8f4c710fd6 Make the multi-item ALT indicator use separate patches
Minimize hardcode offsets
2025-11-09 00:31:22 -05:00
Anonimus
d10b01e4a3 Display the ALT indicator more consistently in roulettes and item toggles
Doesn't account for unique alt item patches... yet
2025-11-08 20:54:44 -05:00
GenericHeroGuy
2546729b0c Custom item papersprites 2025-11-08 23:46:16 +01:00
NepDisk
bad8786629 Show Stats on the HUD 2025-10-22 17:46:04 -04:00
NepDisk
74973764e2 Update Draft and Timers to support offsets and use stplyrnum more 2025-09-26 21:31:44 -04:00
NepDisk
1edc6b736d Fix Colormap compat 2025-09-11 10:33:13 -04:00
NepDisk
1a9dfea86d Compat for Kart v1 TC modes 2025-09-11 09:46:18 -04:00
NepDisk
07b49c5f9a Don't SHORT() stuff that doesn't need it for HUD code 2025-09-02 15:40:15 -04:00
NepDisk
e052cca8b7 Readd static assert 2025-08-24 11:03:44 -04:00
NepDisk
2f84779d41 Update rest of the existing files to use blankart branding 2025-07-01 00:23:30 -04:00
NepDisk
8e94a8c9fd Vote screen visual refactor port from saturn
Thanks to Alug as per usual
2025-06-26 12:07:22 -04:00
NepDisk
9d864729db Port v.cachePatch second parameter for rotation from Classic
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2662
2025-06-02 11:23:51 -04:00
NepDisk
d8e1083429 Refactor some HUD elements and bring colorized hud support 2025-05-05 17:51:39 -04:00
NepDisk
15deb55e96 Acutally fix this. 2025-04-13 11:20:05 -04:00
NepDisk
f2bb124ab7 Fix TSR in compatmode 2025-04-13 10:50:36 -04:00
NepDisk
56d1ebb490 HUD drawing code clean up and add rings and lives hud toggles for lua 2025-03-14 22:22:25 -04:00
GenericHeroGuy
3928a98d72 Properly fix runaway cliprects so they don't interfere with other hooks 2025-02-22 19:38:35 +01:00
hayaunderscore
3e1e1245ce Expose V_SetClipRect and V_ClearClipRect to lua
Via the `v.setClipRect` and `v.clearClipRect` functions respectively.
2025-02-22 01:49:28 +01:00
NepDisk
0fcf7c7dbd Port small minimap icons and minimap nametags from saturn/snowy, add minimap angle reticle toggle 2025-02-20 20:32:18 -05:00
GenericHeroGuy
0838417ebd Fix v.drawOnMinimap 2025-02-19 01:11:13 +01:00
GenericHeroGuy
e9795f5271 Expose map thumbnails and minimaps to Lua
...

LET'S FUCKING GOOOOOOOOOOOOOOOOOOOOOOOOO
2025-02-12 03:24:11 +01:00
GenericHeroGuy
034d9df183 Fix Lua HUD interpolation 2025-02-09 20:47:49 -05:00
NepDisk
74eb7643fd Animated vote screens support 2025-02-09 18:45:53 -05:00
hayaunderscore
e694b38878 Add lua hud interpolation
by GenericHeroGuy. https://github.com/Indev450/SRB2Kart-Saturn/pull/130
2025-02-09 18:45:53 -05:00
SteelT
14e5796cf2 Support reading PICTURE/MINIMAP/ENCORE/TWEAKMAP lumps from a map resource
This supersedes the header-based method of fetching those lumps.

(G: a LOT of creative liberties... but i'd rather this thing compiles)
2025-02-07 02:41:06 +01:00
GenericHeroGuy
390fa8c30f Assorted Lua fixes, part 1 2025-01-28 02:29:43 +01:00
GenericHeroGuy
f3176ed7d0 Do palette remapping for drawFill and fadeScreen 2025-01-24 18:25:32 +01:00
NepDisk
b56b79db15 Fix lua offset for hud drawables 2024-10-09 11:50:59 -04:00
Sal
1d8475a958 Merge branch 'hooklib-port' into 'master'
Hooklib refactor ported and (mostly) squashed

See merge request KartKrew/Kart!662
2024-07-31 02:30:20 -04:00
toaster
9c0e793088 Incorporate some of the advances from tilttrack.
* Set view context in the player HUD loop inside `ST_overlayDrawer()`.
* The HUD code now gets all interpolated camera data from the view context instead of half-heartedly recreating it.
* Move Lua HUDlib data to the view context system instead of an else ladder.
* View roll support in HUD tracking, because the other changes made this trivial.
* Remove old_viewrollangle as it is now redundant.
2022-05-21 16:51:03 +01:00
toaster
38e6cba181 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart.git into uncapped-absolution
# Conflicts:
#	src/f_finale.c
#	src/sdl/i_video.c
#	src/st_stuff.c
2022-05-21 13:40:20 +01:00
toaster
884064049e * Allocate the "MISSING" patch only once, statically, at first boot via missingpat, and prevent it from being freed.
* Rework HU_UpdatePatch to HU_UpdateOrBlankPatch with a "required" boolean.
    * If desired graphic is not present in resources:
        * If required is true, return `missingpat`.
        * If false, return NULL as before (font compatibility).
    * Add an alias with the previous function signature, so you don't need to add a million `true`s everywhere.
* Remove a ton of irrelevant graphics the game attempts to cache only because of code inherited from vanilla SRB2.
* Remove the unused hudinfo system, also inherited from vanilla SRB2.
2022-05-14 14:56:02 +01:00
Sally Coolatta
d262190faf Fix compiling with da strict settings
Moved from gnu99 to gnu11 because I think unnamed union is reasonable, and will also cause a lot of problems down the road if we ever need changes!!
2022-05-07 07:23:26 -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
Latapostrophe
f2f0a6cbe2 New titlecards 2021-04-30 18:11:36 +02:00
toaster
6f8033ab76 Some preparation for engineering a solution to the rendermode flag/V_*TRANS flag conflict.
* None of the following things (grouped by the fact they fade/slide in) use hardcoded static numbers; they'e now attached to the titlecard ticker.
    * Minimap.
    * All V_HUDTRANS items. (Not add/sub) - this was previously broken entirely
    * FREE PLAY
    * Record Attack Input (no longer slides in at all - needs to be visible from start of play.)
* Fixed a rare case where V_SLIDEIN HUD elements would occasionally jump a step too far.
2021-03-30 22:55:09 +01: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
LJ Sonic
dd1d2314f7 Let Lua toggle the crosshair 2020-12-29 21:36:15 +01:00
James R
1d39ba59ad Merge branch 'dumb-stuff' into 'next'
Fix TC_DASHMODE not accessible to v.getColormap; add missing skin flags

See merge request STJr/SRB2!1273
2020-12-10 15:17:28 -05:00
LJ Sonic
079df8df4d Merge branch 'fix-stacktrace' of https://git.do.srb2.org/STJr/SRB2.git into next
# Conflicts:
#	src/dehacked.c
#	src/dehacked.h
2020-11-29 21:54:15 +01:00
James R
7367acf00d Replace TC macros with an enum that automatically counts up
Also fixes TC_DASHMODE not being accessible to Lua.
2020-11-28 02:19:52 -08:00
Jaime Ita Passos
2170ca3a50 Some interface fixes 2020-11-22 17:22:18 -03:00
Louis-Antoine
05ae84bd09 Fix Lua stacktrace not showing in various situations 2020-11-13 19:12:25 +01:00
Louis-Antoine
4938015253 Replace lua_pop(-1) with lua_settop(0) 2020-11-13 15:31:11 +01:00
Sally Coolatta
7c2bd0d1c2 Merge remote-tracking branch 'srb2/next' into the-scary-22-merge 2020-10-24 20:50:58 -04:00