Commit graph

171 commits

Author SHA1 Message Date
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.
7b3010c93d Fix many instances of splitscreen view number if there are duplicate displayplayers
- Avoid iterating displayplayers to find view number and
  prefer R_GetViewNumber.
- Iterate over all matching displayplayers if necessary,
  instead of stopping at the first match.
2023-10-03 21:28:33 -07:00
James R.
afeba341c0 Remove translucenthud cvar, let V_HUDTRANS fade in like V_SLIDEIN
- V_HUDTRANS does not fade if combined with V_SLIDEIN
  (since sliding elements are not supposed to fade).
- If not V_SPLITSCREEN, uses most opaque fade value among
  splitscreen players (since Tally will fade back out for
  specific players).
2023-09-11 18:30:40 -07:00
Sal
0675a4e527 Tally screen 2023-09-09 05:27:55 +00:00
James R
4f60d046ba V_DrawTitleCardString, V_TitleCardStringWidth: add 4P font support 2023-08-26 21:39:18 +01:00
toaster
a536f884ce V_ALLOWLOWERCASE --> V_FORCEUPPERCASE
Content of commit was originally written by Sal, but as a monolithic commit. The author of this commit is chunking it up for easier review.

Simple inversion on the face of things, but with a long tail of consequences, including 19 changed files.

Forced uppercase has been applied in a handful of locations where it was aesthetically imperative. Most menus will follow in another commit, so that that may be reverted if we change the default menu font.
2023-07-12 09:00:29 +01: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
d9b406f4d0 Add TIMER_FONT, rename V_DrawKartString to V_DrawTimerString
Separates timer and FREE PLAY fonts.
2023-04-21 00:34:06 -07:00
Sally Coolatta
996ca9adad Z Voting 2023-04-20 15:55:38 -04:00
James R
08f9628e6c Remove kartminimap, kartcheck, kartcomeback cvars 2022-10-01 17:04:48 -07:00
toaster
1a284ec7c6 Merge branch 'master' of https://git.do.srb2.org/KartKrew/Kart into big-large-map-markers
# Conflicts:
#	src/d_netcmd.c
2022-09-17 13:57:26 +01:00
SteelT
c64f36309a Support reading PICTURE/MINIMAP/ENCORE/TWEAKMAP lumps from a map resource
This supersedes the header-based method of fetching those lumps.
2022-09-12 17:29:15 -04:00
Sally Coolatta
2fddc9f343 Merge branch 'master' into big-large-map-markers 2022-09-10 16:01:02 -04:00
James R
b4d1fade5f Apply b4fa98d2f to lua_hudlib.c
Continued from 544812a45
2022-09-05 11:56:30 -07: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
Sally Coolatta
1115486689 Fix crashes & off-by-one errors 2021-04-09 23:15:44 -04:00
Sally Coolatta
de1f67b72a Use strings in the map header for next level, marathon next, thumbnails, minimaps, encoremaps, and tweakmaps 2021-04-09 21:10:46 -04:00
Sally Coolatta
359cf86efb Merge branch 'master' into big-large-map-markers 2021-04-09 19:49:33 -04: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
James R
8f68a21f2f Fix many instances of G_BuildMapName
Some things are gonna be busted. Fix it later, BYE.
2020-10-31 20:17:12 -07:00
Sally Coolatta
7c2bd0d1c2 Merge remote-tracking branch 'srb2/next' into the-scary-22-merge 2020-10-24 20:50:58 -04:00
Jaime Passos
b4b4738c94 Changes to sprite rendering:
- Added render flags (see r_defs.h)
- Implemented floor splats
- Drop shadow sprite rendering through render flags
2020-10-12 00:13:22 -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
98c6b54994 Improved memory management for patches 2020-09-07 02:23:07 -03:00
GoldenTails
4c2a3e6c77 Expose V_GetStringColormap to Lua via v.getStringColormap(). 2020-09-01 10:47:02 -05:00
Sally Coolatta
0dc21106e5 Lua stuff is done 2020-08-15 07:47:18 -04:00
Sally Coolatta
f9ca40e673 Merge branch 'master' into the-scary-22-merge 2020-08-12 20:59:09 -04:00
Sally Coolatta
b9436ee015 More fixing up
Got tired again, but now it makes it to f_finale
2020-08-11 18:46:00 -04:00
SteelT
0ec506127e Remove duplicate fadeScreen 2020-08-10 23:19:58 -04:00
Jaime Passos
f6a5acc6f3 Remove LUA_PATCH_SAFETY 2020-08-08 14:56:04 -03:00
Sally Coolatta
40558a6824 Merge lua_hudlib.c 2020-08-05 14:07:26 -04:00
Sally Coolatta
390191c85a I swear to god please just push my entire merge 2020-06-03 20:19:47 -04:00
Sally Coolatta
63917ffccc The start of the scary 2.2 merge
All conflicts are left in-tact. We should be collaborating on solving these files one at a time.
2020-05-29 13:43:38 -04:00
SwitchKaze
58cac1fd73 Make colors UINT16, increase color freeslots to 1024 2020-05-23 19:35:36 -05:00
SwitchKaze
afe56667b8 Update to 2.2.4 2020-05-22 16:47:51 -05:00