Compare commits

...

295 commits

Author SHA1 Message Date
NepDisk
30e0b3ead4 Fix various minor shield issues 2025-07-28 22:52:27 -04:00
NepDisk
da5a45a932 Split shield popping from hnextlist and fix shield ring issues 2025-07-28 22:20:36 -04:00
GenericHeroGuy
bf7abee652 Properly set lastlump when loading skins from compatmode files 2025-07-28 23:48:12 +02:00
NepDisk
d3f261b0d3 Add OpenGL hint to SDL 2025-07-27 12:02:07 -04:00
NepDisk
6b5a9cdd1e Add support for RF_ALWAYSONTOP in OpenGL 2025-07-26 18:22:11 -04:00
NepDisk
6a8bfca4e8 oopsie 2025-07-26 15:54:53 -04:00
NepDisk
208a75e6e8 Add Terrain FloorClip support for OpenGL 2025-07-26 15:29:52 -04:00
NepDisk
a544be6b84 Fix Encore issues in OpenGL
Thanks Alug!
2025-07-26 14:31:34 -04:00
NepDisk
1164c5d569 Fix console framerate issues and Fix Boolean type on windows 2025-07-26 13:37:33 -04:00
NepDisk
9fcc9fa2b5 Update license file 2025-07-26 11:51:39 -04:00
NepDisk
1dd0151434 Split up thirdparty cmakelists and use zlib-ng on windows 2025-07-26 11:46:30 -04:00
NepDisk
e2a3b1f3bb Fix buffer overflow in sendnameandcolor 2025-07-25 21:45:05 -04:00
NepDisk
ad387b52a8 Turn MF2_DONTTRIGGER into MF2_DONTSYNC 2025-07-24 16:47:55 -04:00
NepDisk
ee68cc2b87 Sync Safety flag for spawned mobjs 2025-07-24 16:04:02 -04:00
NepDisk
6ae4e6f7ac Add sounds to items that did not make noise before 2025-07-24 15:40:52 -04:00
NepDisk
ce1217878b Revert Update ping once per second again
This reverts commit 76dc7ccef3.
2025-07-23 10:34:07 -04:00
NepDisk
76dc7ccef3 Update ping once per second again 2025-07-22 20:48:52 -04:00
NepDisk
ba2aecd0a1 Show mindelay to other players port from RR 2025-07-22 20:38:29 -04:00
NepDisk
583d34e98f Sync mindelay setting to server port from RR 2025-07-22 19:01:56 -04:00
NepDisk
24ab3fa171 RR Packetloss display Port 2025-07-22 18:51:59 -04:00
GenericHeroGuy
8bcfa6bb58 Hopefully fix software shadows randomly drawing in front of the player 2025-07-22 18:51:22 +02:00
GenericHeroGuy
3cac6d57e6 Let Kart skins display their turn frames when looking back 2025-07-22 17:22:28 +02:00
NepDisk
b75120cf96 Add ASAN to cmakelists 2025-07-22 11:22:06 -04:00
NepDisk
5fb122ee44 Update TID stuff 2025-07-22 11:19:08 -04:00
NepDisk
56f08d2a28 Fix slopes sending UB down the wire 2025-07-22 00:12:53 -04:00
NepDisk
11e862a583 Add extra toggles to menu 2025-07-21 22:57:26 -04:00
NepDisk
3de68e55a0 oops2 2025-07-21 21:27:39 -04:00
NepDisk
1d2909c1a5 Revert "'''fix''' gremlins by sweeping extra lines"
This breaks grand metropolis sigh

This reverts commit e244c3ece4.
2025-07-21 21:26:39 -04:00
NepDisk
6d6c0f54a5 Hardcode slopeboost
Ported and based on the slopeboost from booststack by indev
2025-07-21 21:12:02 -04:00
NepDisk
2f539c1564 mention these are skins 2025-07-21 17:59:41 -04:00
NepDisk
1118b67932 Mention in console if skin is loaded in compat mode and add 3d model print as well 2025-07-21 17:56:56 -04:00
GenericHeroGuy
06f5f8cb86 Add support for Kart player models
With just a little offcamera dearrowing
2025-07-21 22:24:15 +02:00
NepDisk
e244c3ece4 '''fix''' gremlins by sweeping extra lines 2025-07-21 15:56:03 -04:00
NepDisk
0f893e239a Clamp speed instead of weight in K_TicInversesum
Top right having greater chain time with easier handeling and high speed didnt feel right, so this balances it against speed instead of weight
2025-07-21 13:46:10 -04:00
NepDisk
7a7f6440c8 Revert Legacy GL: models support TC_BLINK
This reverts commit 143f6f880a.
2025-07-21 13:10:21 -04:00
NepDisk
3b29eb4dce Expose face constants 2025-07-21 12:36:57 -04:00
NepDisk
43815ab18c Bring back missing pain sounds 2025-07-21 12:30:58 -04:00
James R
143f6f880a Legacy GL: models support TC_BLINK 2025-07-21 12:26:55 -04:00
GenericHeroGuy
792bb65e9e Add compat for old P_SetScale behavior, fixes Malicious Metropolis 2025-07-21 18:13:37 +02:00
NepDisk
1d31cefa0e oop 2025-07-21 12:01:30 -04:00
NepDisk
4b97ce1485 Revert "use full angle on the spot so drifting doesn't feel delayed"
This reverts commit d940c25818.
2025-07-21 11:59:46 -04:00
NepDisk
e4d6cf3a5f Add support for interp to more stuff 2025-07-21 11:59:02 -04:00
GenericHeroGuy
2592c805c3 Revert the renderer FOF inversion logic to SRB2
Dunno what the point of this was, it breaks fog blocks though
2025-07-21 17:10:44 +02:00
NepDisk
2d2a04b4d3 K_KartLegacyUpdatePosition from saturn and fix laps+1 uses
Description:
"this checked the distance to every single waypoint on the map always and unconditionally, but we dont need the distance unconditionally so only check if we need to
+5fps in techbatics hadal classic timedemo"
2025-07-20 19:19:36 -04:00
NepDisk
580f2da4bf Set SDL2 app name hint
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2697
2025-07-20 18:24:33 -04:00
NepDisk
712e2c6dd7 Fix sector special detection being flakey on Dynslopes 2025-07-20 17:32:25 -04:00
GenericHeroGuy
6fcda4e2a6 Fix polywaypoint_t->continuous being uninitialized
I spent two hours staring at minecarts just for this shit
2025-07-20 22:41:41 +02:00
NepDisk
aa39635f31 Bring back K_JustBumpedException again 2025-07-20 15:25:16 -04:00
NepDisk
3f2006590b Remove unused condition 2025-07-20 15:14:24 -04:00
GenericHeroGuy
c4e034c5be Fix the missing doors and transparency in Final Mall 2025-07-20 20:40:01 +02:00
NepDisk
8293951ce1 Don't skip code if maxstep is < 0 like other SRB2 versions 2025-07-20 14:28:00 -04:00
GenericHeroGuy
50584c2d5e Fix the broken state of linedef types 30-32 and 480-483
Somehow we got SRB2's binary conversion paired with RR's args changes!?
Fixes Motherlode Canyon's minecarts and Final Mall's doors
2025-07-20 18:32:09 +02:00
Alug
3b168b2b55 remove duplicated midtexture blendmode/visability check in ogl
HWR_BlendMidtextureSurface already takes care of that earlier
2025-07-19 17:00:28 +02:00
GenericHeroGuy
b21f70854e Abstract Pack fixes 2025-07-19 02:29:30 +02:00
NepDisk
eb5c5c0041 pw_invulnerability doesn't colorize 2025-07-18 18:24:22 -04:00
GenericHeroGuy
19b8ec4414 Fix Crystal Caverns ripple and ceiling slopes 2025-07-18 23:44:36 +02:00
NepDisk
e62684d113 Actually fix bubbleshield hitem
I love my eyes
2025-07-18 17:36:30 -04:00
NepDisk
ec648f4202 Revert 'Fix bubbleshield crash in battle mode'
This reverts commit 8826b627a6.
2025-07-18 17:33:50 -04:00
NepDisk
49b825f3cf Revert "Only do this check for MT_BUBBLESHIELD"
This reverts commit c87fb9f6ec.
2025-07-18 17:32:03 -04:00
NepDisk
c87fb9f6ec Only do this check for MT_BUBBLESHIELD 2025-07-18 17:17:35 -04:00
NepDisk
d68214a470 Fix driftsound going off in the air 2025-07-18 16:37:55 -04:00
NepDisk
9aa61253ff readd squish painsound 2025-07-18 16:03:09 -04:00
NepDisk
8826b627a6 Fix bubbleshield crash in battle mode 2025-07-18 14:25:23 -04:00
NepDisk
0ae015ba25 Port Alugs zipper fix and allow zipper drift storage 2025-07-18 14:03:22 -04:00
GenericHeroGuy
8f03e233dd Fix broken flat alignment in Metal Harbor 2025-07-18 19:36:41 +02:00
NepDisk
d94fa42ec8 Fix pain sound from regular objects and make bubbleshield do hitem 2025-07-17 18:48:54 -04:00
NepDisk
1155b50cfc Make Hitem dialog a toggle
Not sure how to remove the delay in a netsafe way, so this will do.
2025-07-17 16:33:23 -04:00
NepDisk
1292ad2325 Make reverting netvars a toggle that defaults off and remove CV_NETVAR from local server cvars
For Kart players, its common practice to save replays and or leave the server play with the a server's settings offline for stuff like timeattack or practice which ends up making this feature more annoying then anything. Also removed CV_NETVAR from local server cvars so that people doing the first case don't get listen server settings overwritten just because they wanted to practice offline
2025-07-17 15:56:46 -04:00
NepDisk
868c9c9a87 Mostly fix encore inversion issues with specials 2025-07-17 14:30:22 -04:00
GenericHeroGuy
b051e142c1 Apply colormaps directly to sectors in kart maps, fixes Misty Maze
+ fix encore mapping not applying to fade color (Sunbeam Paradise)
2025-07-17 19:53:11 +02:00
NepDisk
ad2761f365 Adjust bot Object nudging for item changes 2025-07-16 12:55:59 -04:00
NepDisk
c9b16e1301 Allow bots to mash for items now based on useodds 2025-07-16 12:16:37 -04:00
NepDisk
0b1324aed3 Make bots properly use the flameshield rebalance 2025-07-16 11:33:08 -04:00
NepDisk
9ee65fc0e7 Make bots use the same turncode as players: Redone
No more extra ticcmd bits so its less complicated
2025-07-16 10:28:14 -04:00
NepDisk
47a5ed9b4b Update README.md 2025-07-16 02:54:37 +02:00
NepDisk
ab672ff2f3 Fix bot race start boost randomization desync 2025-07-15 20:19:12 -04:00
NepDisk
cb2bbf5145 Make bots and external players transparent again and fix disappear minimap player breaking 2025-07-15 10:14:58 -04:00
NepDisk
245426b816 Fix battle itembox respawning 2025-07-14 21:19:06 -04:00
NepDisk
3f890fa251 Auto recenter spectator camera 2025-07-14 15:33:50 -04:00
GenericHeroGuy
bac259341c bruh
Let's try that again, this time putting the camera in a local...
2025-07-14 16:12:09 +02:00
GenericHeroGuy
76614086c6 Fix that one wadnum check I forgot about 2025-07-14 16:12:09 +02:00
NepDisk
ccd79ca432 Use prefgametype again 2025-07-13 11:10:20 -04:00
NepDisk
6b2770f608 Handle obscure lava edge case
I would convert with args but that overlaps with offroad, so this will do.
2025-07-12 13:30:57 -04:00
NepDisk
2cdf420226 Fix caption interpolation 2025-07-11 23:11:08 -04:00
NepDisk
58e5f7a896 Update hash for fixed sounds 2025-07-11 22:52:30 -04:00
GenericHeroGuy
0ee5f77586 Fix fake floors in Donut Plains disappearing when chasecam is off
Also remove the useless R_PointInSubsector calls
2025-07-07 23:19:30 +02:00
NepDisk
f41bb9f776 Fix minor off-by-one error in faketic calculation 2025-07-07 10:58:53 -04:00
NepDisk
68ddb7e06b Lower MAXPREDICTTICS 2025-07-07 10:48:41 -04:00
NepDisk
760fc6fbb8 Revert 'Remove a useless call to R_FakeFlat'
This reverts commit 5b72c8d30c.
2025-07-07 10:39:49 -04:00
NepDisk
17106089d6 Port over other netcode changes as well 2025-07-07 10:36:51 -04:00
NepDisk
a3bd999c11 Readd clientbackuptics 2025-07-07 10:32:09 -04:00
NepDisk
71c4734b5e Fix spring off for modded springs 2025-07-07 10:30:08 -04:00
NepDisk
5b72c8d30c Remove a useless call to R_FakeFlat 2025-07-06 01:28:09 -04:00
NepDisk
fa31b0759f Add more people to testing credit 2025-07-05 22:00:04 -04:00
NepDisk
1df46f732b Grand Prix Rank Points Hook
Yes this is my own MR lmao https://git.do.srb2.org/KartKrew/RingRacers/-/merge_requests/122
2025-07-05 20:34:41 -04:00
NepDisk
2a0aba3980 Reduce flipover angle side angle for more foward movement and restore mom addition 2025-07-05 20:22:08 -04:00
NepDisk
c412841f3a Nerf flameshield top speed slighty 2025-07-05 10:37:44 -04:00
NepDisk
0f4425df4d Remove Additonal speed and get hit to the side more 2025-07-05 10:36:02 -04:00
NepDisk
9c89b02bad Use flamestore for some flameshield stuff 2025-07-04 10:47:32 -04:00
NepDisk
63c244b381 Entirely remove player iterate loops from getting the dedicated server player
This was very annoying for writing lua and kind of redundent when you can already get the serverplayer from server
2025-07-04 03:05:35 -04:00
NepDisk
6bd5159e83 Remove extra gp scoring points 2025-07-03 23:51:03 -04:00
NepDisk
af6e43dcd8 Improve accuracy of movement code even more 2025-07-03 22:56:59 -04:00
NepDisk
e2edae253f Port HEPII(I) position number scaling 2025-07-03 15:23:38 -04:00
NepDisk
b73533c943 Fix titlecard offset using the wrong splitscreen 2025-07-03 15:02:57 -04:00
NepDisk
b90a29bde0 Fix some interp issues
Horizontal scrolling has been interped but haven't done vertical player ranking scroll interped yet.
2025-07-03 15:01:28 -04:00
NepDisk
feb4819b72 Fix software sprite drawing error from bad copy paste 2025-07-03 10:54:56 -04:00
NepDisk
894b1f05c9 Add configurable minimum shader brightness
https://git.do.srb2.org/Hanicef/SRB2Classic/-/merge_requests/3
2025-07-02 22:15:52 -04:00
NepDisk
0bf360a82e Some cherrypicks from SRB2 Classic's 'Faster software drawing'
-Textures with 0 height are not checked for wraps, this helps speed up multipatch columns.
-A useless call to R_FakeFlat has been removed.
-Slopes now use floats rather than doubles to calculate UV coordinates.
2025-07-02 21:38:35 -04:00
NepDisk
d502c04698 Adjust cmake file 2025-07-02 21:06:02 -04:00
NepDisk
adaba91738 Check if player is local inside aiming frame 2025-07-02 20:49:56 -04:00
NepDisk
a7a16687d0 double fpscounter samples 2025-07-02 20:28:53 -04:00
Sal
cead26d308 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.
2025-07-02 20:13:38 -04:00
NepDisk
09da09d2fd Use angle turn in camera rotation code 2025-07-02 14:19:11 -04:00
NepDisk
d940c25818 use full angle on the spot so drifting doesn't feel delayed 2025-07-02 13:59:10 -04:00
NepDisk
dd76faae4f increase drain rate on flameshield by one again 2025-07-02 13:38:27 -04:00
NepDisk
1d71681637 Apply a little bit of player Mom to flipover 2025-07-02 12:32:16 -04:00
NepDisk
bb9a8c42d7 Clear flametimer with kartgiveitem 2025-07-01 14:35:04 -04:00
NepDisk
ed37cbc871 Fix cluster warnings and fixing tabulation 2025-07-01 14:24:50 -04:00
NepDisk
c01a9d9bde Fix this correctly 2025-07-01 13:50:03 -04:00
NepDisk
04b65c70c4 Fix spinout retaining prev frame speedboost
This would happen because prevspeedboost would be used next frame for speedboost regardless of hit condition
2025-07-01 13:05:37 -04:00
NepDisk
8bbd7dca46 [Ported from SRB2PA] Increase the flat limits
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2669
2025-07-01 12:06:29 -04:00
NepDisk
3290da1e86 Adds console variable that will allow individual demos to desync
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2361
2025-07-01 10:59:22 -04:00
NepDisk
de02aa13fd Add fallback
This could be less safe but it prevents issues with the respawn not being set sometimes
2025-07-01 10:47:08 -04:00
NepDisk
2f84779d41 Update rest of the existing files to use blankart branding 2025-07-01 00:23:30 -04:00
NepDisk
73490f9480 Fix binary conversion for bird slopes 2025-07-01 00:17:31 -04:00
NepDisk
9d244dd89d Add safety for next respawn 2025-07-01 00:08:36 -04:00
NepDisk
c3351ce47c Buff flame a little big 2025-06-30 19:36:45 -04:00
NepDisk
3c07f1c406 remove debug prints 2025-06-30 16:37:29 -04:00
NepDisk
285aeee849 Fix cmake file o3 flag 2025-06-30 16:23:24 -04:00
NepDisk
c95225d382 Fix viewserver crash 2025-06-30 16:19:46 -04:00
NepDisk
8770ddbf82 Fix readd fallthroughs and comment to specfiy that they are 2025-06-30 14:09:46 -04:00
NepDisk
b0057bee1e Fix another set of warnings 2025-06-30 14:02:56 -04:00
NepDisk
107b822f54 Fix GCC output being annoying with ACSVM 2025-06-30 14:00:20 -04:00
NepDisk
2be0f7baa9 Adjust credits to add people 2025-06-30 13:39:47 -04:00
NepDisk
ee0ef71dfa Expose flipover damage stuff to lua 2025-06-30 13:28:22 -04:00
NepDisk
545bdbb97b Don't modulo sent skin info in develop 2025-06-30 13:18:15 -04:00
NepDisk
f004b36dbb Revert 'Merge pull request 'File loading refactor' (#68) from wadstrbuf into blankart-dev'
This reverts commit f72475b557, reversing
changes made to 0c89c85aae.

Sorry Generic this branch is really cool but it needs more work. I shouldn't have merged it too early...
2025-06-30 01:45:01 -04:00
NepDisk
b91f4c4133 Revert "Fix DSradio bug in chat for clang users"
This reverts commit e2524356da.
2025-06-30 01:45:01 -04:00
NepDisk
7c214d8730 Revert "questionable MAXLUMPLENGTH bump"
This reverts commit b2b37df918.
2025-06-30 01:45:01 -04:00
Anonimus
82221e947f Attempt to make legacy cluster distancing more effective 2025-06-30 00:49:50 -04:00
NepDisk
74ad3c0065 Make flameshield use DMG_FLIPOVER and cleanup 2025-06-29 20:47:58 -04:00
NepDisk
4eeb3a5d2a Merge pull request 'Add an alternative Invincibility type' (#69) from Anonimus/blankart:invincerework into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/69
2025-06-30 01:06:14 +02:00
NepDisk
fd4e128641 Account for PRECIP_NONE 2025-06-29 16:48:21 -04:00
NepDisk
51e530f861 Fix weather not properly getting read from SOC 2025-06-29 16:37:10 -04:00
NepDisk
47d16f3243 [PATCH] Fix precip getting stuck to the ground sometimes
Thanks Alug
2025-06-29 15:58:31 -04:00
NepDisk
b2b37df918 questionable MAXLUMPLENGTH bump
Sorry in advance Generic....

I don't know how much this will harm things but it fixes issues with mupak loading
2025-06-29 15:34:55 -04:00
NepDisk
d9bfb3c192 Rename freeroam to nocountdown and clean up some relatedcode
Also yes no skipping introtime now
2025-06-29 14:30:21 -04:00
NepDisk
969c161d3f Up comeback time to v1 value 2025-06-29 11:57:10 -04:00
NepDisk
af4f28cb2f fix battle win animation 2025-06-29 11:55:14 -04:00
Anonimus
efba636d96 Update main.pk3 hash 2025-06-29 02:19:27 -04:00
Anonimus
207e5011dc Add a cancel system to Alt Invincibility
Can be cancelled now, similarly to Grow
2025-06-29 01:30:21 -04:00
Anonimus
b81fcaf7c7 Add Denny to the 'Item Design' credits
Assisted with development and design of Alt Invincibility.
2025-06-29 01:30:19 -04:00
Anonimus
7c31ca0483 More changes to Alt Invincibility
Bottlenecker has been heavily buffed (8-tic deficit to invince timer at full strength)
The cluster now specifically only tracks losing players, and in the case that no new cluster point is found, instead reads from the last cluster player
Invincibility "hogs the item box" like Grow does, and (currently) can't be cancelled to prevent chaining
Maximum time limit has been buffed to 35 seconds
2025-06-29 01:30:17 -04:00
Anonimus
cac6bbdd41 Update the credits again
Adds 'Item Programming', 'Item Design', and 'Design Support' sections, with the respective people in each.
2025-06-29 01:30:15 -04:00
Anonimus
5e15f7a68a Update Alternative Invincibility
Invincibility now begins to get affected by offroad as it runs out
A "bottlenecker" begins to kick in as an invincible player closes in on the cluster, causing their invincibility to expire at an increasing rate
Prevent Invincibility from being rolled at extremely close cluster distances, to prevent the potential for rolling it as a "dud" item
2025-06-29 01:30:14 -04:00
Anonimus
1e05aa8308 Add Rim and Luna to the credits
Nep, please... My name...
2025-06-29 01:30:12 -04:00
Anonimus
c07ccf475f Add toggle for legacy Invincibility
Also adds customizable time values for Alternative
2025-06-29 01:30:10 -04:00
Anonimus
f2acaab98b Zero-out cluster distance in 1P 2025-06-29 01:30:07 -04:00
Anonimus
4603a24628 Unique Invincibility odds
Also preventing lower Invincibility times from overriding a higher one.
2025-06-29 01:30:06 -04:00
Anonimus
99056a47fa Tie Invincibility to clustering, implement new visual
* Invincibility's time limit is now directly tied to a player's distance from the cluster.
* The visual for Invincibility has been reworked to being an additive layer over the player, fading out as you run out of Invincibility.
2025-06-29 01:30:04 -04:00
Anonimus
6788db93b4 Add clustering
Using a DBSCAN-based algorithm, this gathers "player clusters" to determine the most packed area in the race.
2025-06-29 01:30:02 -04:00
Anonimus
27ea5021b4 Add Flipover damage, change Invincibility interactions 2025-06-29 01:30:00 -04:00
NepDisk
83bf2d59c5 Revert 'Fix camera hitch during first few tics of level'
This reverts commit 0c89c85aae.
2025-06-29 01:13:54 -04:00
NepDisk
005f2989f7 Account for the fact brightmaps can return NULL 2025-06-29 01:09:27 -04:00
chromaticpipe
0c1891aa36 Fix level interpolators jittering during objectplac 2025-06-28 23:44:50 -04:00
NepDisk
6983e6bcd3 Properly invalidate other player lua data 2025-06-28 23:41:50 -04:00
NepDisk
e456d59c0e Dont always call R_PointInSubsector if thing has not moved in P_CheckPosition
https://github.com/Indev450/SRB2Kart-Saturn/pull/148
2025-06-28 23:28:26 -04:00
NepDisk
e2524356da Fix DSradio bug in chat for clang users 2025-06-28 22:58:55 -04:00
NepDisk
6ac11da6e4 Try to fix issues with clients locking up due to never receiving acks back in case of dropped packets
https://github.com/Indev450/SRB2Kart-Saturn/pull/151
2025-06-28 22:53:20 -04:00
NepDisk
7acf64fba8 Fix 2P FINISH text scrolling
448781bdd9
2025-06-28 18:51:44 -04:00
NepDisk
0a5038c189 Port fancy roulette and interp addtions from saturn 2025-06-28 18:48:59 -04:00
NepDisk
f72475b557 Merge pull request 'File loading refactor' (#68) from wadstrbuf into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/68
2025-06-28 23:57:54 +02:00
NepDisk
0c89c85aae Fix camera hitch during first few tics of level 2025-06-28 17:47:05 -04:00
GenericHeroGuy
76daf2f0e0 Fix music names longer than 6 chars not being truncated anymore 2025-06-27 23:33:59 +02:00
GenericHeroGuy
92c59ddbcb Merge branch 'blankart-dev' into wadstrbuf 2025-06-27 18:46:47 +02:00
GenericHeroGuy
d6299d8394 Fix segfault when filename lacks extension
and don't mix up fullname with longname
2025-06-27 18:01:32 +02:00
GenericHeroGuy
be35926843 Add W_CheckNumForMarkers, clean up lump validation
Fixes many cases of invalid startlumps, so validation is now actually done
only when PARANOIA is defined
The W_CheckNumFor* functions allow startlump == numlumps, to make iteration
less frustrating
2025-06-27 17:44:34 +02:00
NepDisk
7ea321de32 Drift feel improvements
Should make it feel closer to v1
2025-06-27 10:23:07 -04:00
NepDisk
8721883013 Merge pull request 'Some software renderer improvements' (#66) from softwarestuff into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/66
2025-06-27 13:57:12 +02:00
NepDisk
45170bb65c Fix weird snapping on net jitters 2025-06-27 07:55:35 -04:00
Alug
b2b0ec19d6 draw black background during blan intro screen
prevents white border on higher resolutions
2025-06-27 13:13:11 +02:00
Alug
7c6838c98e use M_Random
P_ rng functions dont have a seed before loading any level yet so this always returned 3 :blobcatpats:
2025-06-27 13:07:58 +02:00
Alug
c8ef0fb705 allow threaded render for maskedlist planes
since sky synchronizuation issues are fixed, this no longer causes any issues and gives a nice speed bump in some occasions
2025-06-27 12:49:01 +02:00
Alug
f30d472ad2 dont render precip in skyboxes!
is really ugly and was never intended, and half the time this would make splashes appear through walls and crap lol
2025-06-27 12:29:56 +02:00
Alug
5df0ddde31 remove erronous mask preparation stuff
R_RenderViewpoint already handles this for us
2025-06-27 11:59:20 +02:00
Alug
258912b685 remove obsolute timing stuff from r_main 2025-06-27 11:53:22 +02:00
Alug
1fb300d355 Small cleanup r_portals 2025-06-27 11:50:12 +02:00
Alug
76fc2b21d7 Fix software sky threading synchronization issues
By splitting sky drawing from plane drawing, so both dont step on each other during drawing

this also marginally improves performance
2025-06-27 11:47:53 +02:00
NepDisk
24715a611d Properly setup encore levelselect input 2025-06-26 17:26:02 -04:00
GenericHeroGuy
286dfc7a43 Add strbuf_append_m to simplify lumpname reading 2025-06-26 22:59:08 +02:00
NepDisk
39295111e0 Update hash and put little easteregg 2025-06-26 16:36:51 -04:00
NepDisk
e1905d85cf Port Saturn menu additions 2025-06-26 15:57:49 -04:00
GenericHeroGuy
4c93f0eae7 Operation: Gotta Go Fast 2025-06-26 21:38:52 +02:00
NepDisk
e450f21ddf Fix battle offsets applying to custom offsets on ring meter 2025-06-26 14:25:21 -04:00
NepDisk
02fa20bc11 Update hash for fixed brightmaps 2025-06-26 14:13:51 -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
11e29d5afa Port Saturn's VoteBG scaling code
Thanks to Alug and Indev as per usual
2025-06-26 11:13:37 -04:00
NepDisk
7226fd120e I'm never calling you again
This causes buffer overflow sometimes due to not being resized.
2025-06-26 10:00:37 -04:00
GenericHeroGuy
edae0b45ad Do I have news for you! 2025-06-26 01:55:56 +02:00
GenericHeroGuy
91636209ff And finally... W_CheckNumForNamePwad 2025-06-26 01:45:45 +02:00
GenericHeroGuy
24de618653 Remove W_CheckNumForName
NOW long menuitem patches are supported lol
Staff ghosts support long map names now
The runsoc command and linedef special 415 support longnames now
2025-06-26 01:27:28 +02:00
NepDisk
ea07280348 Fix larger RR size mapthumbnails not scaling during voting 2025-06-25 19:06:32 -04:00
GenericHeroGuy
146ac557ba Remove W_GetNumForName
Still no longnames for sounds/music, but that's a story for another day
2025-06-26 00:18:20 +02:00
GenericHeroGuy
d37b987acb Remove W_CachePatchName, everything's safe
Menu headerpics, menuitem patches and old-style map thumbnails/minimaps now
support longnames
2025-06-25 23:42:36 +02:00
GenericHeroGuy
5aaa72e10a Sanitize bgname and ttname 2025-06-25 23:26:32 +02:00
NepDisk
36fdc9a37d Don't make windows users listen to the short loop forever 2025-06-25 17:20:04 -04:00
GenericHeroGuy
e987c96651 Sanitize textprompts and cutscenes 2025-06-25 22:49:42 +02:00
GenericHeroGuy
2ff383a248 Replace shortname functions with stubs, and some trivial caller replacements 2025-06-25 22:20:07 +02:00
Alug
3fbacbbca2 dont compare our floatangle to ANGLE_180
smol oops
2025-06-25 21:39:35 +02:00
GenericHeroGuy
7aae6775e6 Use LUMPERROR instead of INT16_MAX, and MAX_WADFILES instead of UINT16_MAX
The 32768th lump of a file works now lol
2025-06-25 17:47:57 +02:00
GenericHeroGuy
684ded7647 Formally deprecate the shortname functions
and make TestValidLump actually work
2025-06-25 14:57:37 +02:00
GenericHeroGuy
4a3ae30984 Switch to xxHash for hashing lump data
And shrink lumpinfo_t to a nice, round 32 bytes. We don't support 64-bit
file sizes anyway
2025-06-25 02:09:59 +02:00
GenericHeroGuy
4ffd4621e4 Let's clean this shit up properly
lumpinfo_t is now private. Wanna iterate thru lumps? Use the W_* functions
2025-06-25 00:43:46 +02:00
Sky Dusk
ffde1365a5 Remove format whitelist for read only Lua IO and allow more formats. 2025-06-24 12:15:20 -04:00
NepDisk
d4f0336ede Shut up dedicated 2025-06-24 11:42:21 -04:00
NepDisk
6fa3c4f751 Fix dedi crash due to invalid pstartmap value 2025-06-24 10:54:34 -04:00
NepDisk
3da0b4ce0c Add waterpaneltime to be neysynched
I always forget something...
2025-06-24 10:48:58 -04:00
NepDisk
02196b622c Allow reading and writing *time variables from SOC and Lua
This should also for simple edits such as extending hyudoro length without janky lua scripts
2025-06-24 10:44:48 -04:00
NepDisk
fec3c19bd0 Fix Windows Clang compile 2025-06-24 07:51:33 -04:00
GenericHeroGuy
927f30e51f Aww yeah, string buffers baby! 2025-06-24 01:05:56 +02:00
NepDisk
e5f8c4c990 Update hash and disable nofilehash 2025-06-23 13:20:12 -04:00
GenericHeroGuy
2c5c65062c shut 2025-06-23 19:13:10 +02:00
NepDisk
6bdcd0f608 Merge pull request 'SOC Menus 2: Back with a vengeance' (#64) from socmenus2 into blankart-dev
Reviewed-on: https://codeberg.org/NepDisk/blankart/pulls/64
2025-06-23 19:05:15 +02:00
GenericHeroGuy
e7f8d1102b Rename menu drawers to use the MD_ prefix 2025-06-23 18:58:46 +02:00
GenericHeroGuy
35c4239078 Hashes and copyrights 2025-06-23 18:52:58 +02:00
GenericHeroGuy
884c8c7387 Add an automatic offset for string cvars
Also rename getheight because that name sucks
2025-06-23 18:48:23 +02:00
GenericHeroGuy
b019271cc0 PRRRRRROMOTION 2025-06-23 17:56:30 +02:00
GenericHeroGuy
4be55967f4 ASan kakkoii desu 2025-06-23 17:29:56 +02:00
NepDisk
6b8144134d Add expert support to viewserver 2025-06-23 00:09:36 -04:00
NepDisk
3ec3320774 Merge branch 'blankart-dev' into socmenus2 2025-06-23 00:07:35 -04:00
GenericHeroGuy
3a98364bf8 Use get_number for menu coordinates 2025-06-23 01:08:13 +02:00
NepDisk
1c4c734cfb Bind drift to space in menus 2025-06-22 17:53:43 -04:00
GenericHeroGuy
e66cc9c5be Make sticker a style, use mapnames instead of numbers for thumbnail items 2025-06-22 22:44:59 +02:00
GenericHeroGuy
a87d76ed13 Fix scrolling, and uhhhh things related to switching to relative offsets 2025-06-22 22:12:11 +02:00
NepDisk
a3367858b8 Add expert speed 2025-06-22 11:13:00 -04:00
GenericHeroGuy
83cfe66219 Fix menuitem memory leaks 2025-06-22 01:02:23 +02:00
NepDisk
b7bdd2ff6f Remove SRVMS3 2025-06-21 12:44:47 -04:00
GenericHeroGuy
ef7d5ec03f Softcode, and add offsets to drawfills for recreating M_DrawTextBox 2025-06-21 02:42:53 +02:00
GenericHeroGuy
af4cb5573b Add drawfill item type and clean up item flags 2025-06-21 02:01:55 +02:00
GenericHeroGuy
44666c339a Merge remote-tracking branch 'origin/viewserver2' into socmenus2 2025-06-21 00:14:09 +02:00
NepDisk
d34a40601c Fix palette getting reset on resynch 2025-06-20 14:30:56 -04:00
NepDisk
018c008f79 Fold mapthumbnail into IT_PATCH block 2025-06-20 12:26:02 -04:00
NepDisk
1d600210fa softcode mapthumbnail drawing 2025-06-20 12:03:37 -04:00
NepDisk
875f1d44b2 More clean up and softcoding 2025-06-20 10:30:55 -04:00
NepDisk
2830abb7d0 Clean up viewserver code a small bit
This also makes the cheats command show what cvars are active for easy checking
2025-06-19 19:36:02 -04:00
NepDisk
7534f7de3b Merge branch 'socmenus2' into viewserver2 2025-06-19 18:50:17 -04:00
NepDisk
eb90f3bece Merge branch 'blankart-dev' into socmenus2 2025-06-19 15:41:34 -04:00
NepDisk
17b799bb01 Add Linux toolchain file I've been using 2025-06-19 15:40:46 -04:00
NepDisk
db66b00ec0 Merge branch 'blankart-dev' into socmenus2 2025-06-19 13:05:47 -04:00
NepDisk
f64b79260e Fix blendmodes on HWR_DrawFill not working
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2670
2025-06-19 01:01:28 -04:00
NepDisk
3f34bc68d3 viewserver2 refactoring
This now takes advantage of regular menu drawing with styles and an enter routine instead of hardcoded v_draw*string calles
2025-06-18 20:09:44 -04:00
GenericHeroGuy
271eaeef6f Fix going back, fix replay hut segfaulting 2025-06-17 23:21:40 +02:00
NepDisk
7852dfbf3a Merge branch 'socmenus2' into viewserver2 2025-06-17 17:03:16 -04:00
GenericHeroGuy
666b9f4582 Softcode background/scroll/fade, clean up effects logic
Oh and the config save in M_ClearMenus actually works now lmao
2025-06-17 22:23:28 +02:00
GenericHeroGuy
23fb99cc9e Refactor menu tree iterators to use menustack, fix menu music 2025-06-17 18:20:02 +02:00
GenericHeroGuy
99d44c9954 Call F_MenuPresTicker correctly 2025-06-17 02:33:22 +02:00
GenericHeroGuy
ca7caf3dd5 Various changes between 2018-11-16 and 2018-11-20 2025-06-17 02:15:11 +02:00
GenericHeroGuy
205d1401f6 Start reviving menupres stuff
I may or may not regret this
2025-06-17 00:53:42 +02:00
GenericHeroGuy
11b9cd993d Expanded styles (ITF_THIN2 and IT_RIGHT), rename CvarSlider to Slider 2025-06-16 21:11:14 +02:00
NepDisk
e340a7f1e6 Merge branch 'socmenus2' into viewserver2 2025-06-15 12:36:44 -04:00
GenericHeroGuy
955da518ca Replace TextHeader and TextWhite with styles 2025-06-15 18:06:52 +02:00
GenericHeroGuy
8ded7ad542 More styles, more softcoding, patches actually usable now! 2025-06-15 17:19:21 +02:00
NepDisk
d96c16b157 Fix skynum skyboxes being broken in clang due to undefined behaviour 2025-06-14 16:59:48 -04:00
NepDisk
38495d4449 Fix some clang warnings 2025-06-14 16:46:49 -04:00
NepDisk
e8bafe7fc5 Add kartdebugshrink and remove NOSHOWHELP from kart vars 2025-06-14 08:09:28 -04:00
NepDisk
1947eb6277 Remove GS_CONTINUING and GS_GAMEEND 2025-06-13 10:25:52 -04:00
Oni
3eff2ef292 Merge branch 'dont-rewrite-the-past' into 'master'
Don't rewrite the past if we might still need to send it

See merge request KartKrew/Kart!1333
2025-06-13 09:46:30 -04:00
toaster
30e63490cd Merge branch 'max-errors' into 'master'
CMakeLists.txt: add -fmax-errors=5 for GNU

See merge request KartKrew/Kart!1357
2025-06-13 09:42:05 -04:00
NepDisk
de5434ea23 Add support for using custom SDL2 mappings 2025-06-13 09:40:57 -04:00
James R
1553224270 D_SRB2Main: set music volume on init :) 2025-06-13 09:36:40 -04:00
Oni
3d475504e3 Merge branch 'reset-command' into 'master'
Add 'reset' command to reset a cvar to its default value

See merge request KartKrew/Kart!1382
2025-06-13 09:34:46 -04:00
GenericHeroGuy
e276709d0c A whole lot of refactoring and updates to cvars
cvar items now use their argument to specify the amount to add for each key
press, replacing IT_CV_INTEGERSTEP
cvar items are automatically displayed as strings if they don't have
PossibleValues, replacing IT_CV_STRING
2025-06-12 22:21:49 +02:00
NepDisk
614506381d Make Ring Burnout sound Only play for local players 2025-06-12 10:58:33 -04:00
GenericHeroGuy
f30ddcfad2 Three(!?) new methods for placing menu items
Relative: changes the coordinates relative to the current ones
Temporary relative: displaces the coordinates temporarily
Overlay: draws at absolute coordinates, no clipping

Along with custom cursor offsets and Item Styles(tm), this eliminates
M_DrawControl
2025-06-12 16:54:43 +02:00
NepDisk
6a122b0600 Implement ring spam nerf
Less impactful in vanilla + rings. With Chaining and Stacking on however this makes a big difference since it prevents you from having a large stack count forever if you can keep chugging rings
2025-06-11 19:02:06 -04:00
GenericHeroGuy
fd48ecd4ca Make the camera options work again 2025-06-09 23:26:56 +02:00
NepDisk
41e3d9b285 Fix broken MS menu 2025-06-09 17:05:50 -04:00
GenericHeroGuy
f14e5f2f56 Softcode server list page and sound options 2025-06-09 22:53:54 +02:00
NepDisk
7c712836f3 Refactor and rework viewserver
Thanks to the srb2 classic team and luigi budd for the original version
2025-06-09 15:43:40 -04:00
GenericHeroGuy
56edab2480 Remove a TON of special-case menu code
You can now combine submenu/cvar/call to allow for more complex behavior,
without the need for keyhandlers. All those dummy menuitems relying on
keyhandlers now use cvars, like everything else does.

Yes, several things are still hardcoded, but player setup no longer
needs its own miniature menu system :^)
2025-06-08 17:15:17 +02:00
GenericHeroGuy
acb2cb752e Factor out item drawing into a separate function 2025-06-07 22:47:08 +02:00
GenericHeroGuy
2252c16acb Rewritten scrolling and coordinate logic 2025-06-07 21:01:29 +02:00
GenericHeroGuy
d18ebe8827 The five-for-one menu drawing special! 2025-06-07 13:58:01 +02:00
GenericHeroGuy
df30f44c35 nice job dumbass 2025-06-06 02:23:43 +02:00
GenericHeroGuy
e9d764eaa6 Move keyhandler from menuitems to menu (and clean up event handling)
Also make empty menus work
2025-06-06 02:16:21 +02:00
GenericHeroGuy
1a0285d193 Let keyhandlers pass through events
Hooray, keyhandlers no longer eat your entire keyboard!
2025-06-05 22:29:51 +02:00
GenericHeroGuy
e6dc870b2b Wire up and start using enterroutines 2025-06-05 19:47:08 +02:00
GenericHeroGuy
5a0a889cd1 Menu functions now return INT32
Just my best guess what everything should return. Doesn't matter right now
2025-06-05 19:47:08 +02:00
NepDisk
8288eaf733 Port Saturn Tooltips 2025-06-04 21:35:24 -04:00
GenericHeroGuy
a8b8510188 Menu flags rework
As I found out the hard way, shit's still hardcoded...
So now, hidden/grayed out/secret are completely separate flags rather than
being baked into the other status fields!
Lots of cleanup and refactoring along the way...

You can now change an item from a call to a submenu without segfaulting
due to hardcode messing with the flags :^)
Also, completely blank items now default to being non-interactible, much
more sensible than defaulting to call
2025-06-04 21:41:05 +02:00
GenericHeroGuy
12dfdd2f11 Remove Pandora's Box and Emblem Hints 2025-06-03 19:16:12 +02:00
GenericHeroGuy
e680b12eac Remove character descriptions 2025-06-03 18:58:09 +02:00
GenericHeroGuy
308d2efb31 Deduplicate a bunch of routines 2025-06-03 18:48:35 +02:00
GenericHeroGuy
231b067af1 Pass argument for IT_CALL
and fix server list softlock
2025-06-03 17:01:25 +02:00
GenericHeroGuy
c3fe4fb71e Coordinates, arguments, tooltips, string buffers 2025-06-03 16:01:19 +02:00
888 changed files with 95764 additions and 86567 deletions

View file

@ -1639,9 +1639,9 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org>
https://www.libsdl.org/projects/SDL_mixer/
- zlib
Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler
https://zlib.net
- zlib-ng
Copyright (C) 1995-2024 Jean-loup Gailly and Mark Adler
https://github.com/zlib-ng/zlib-ng
--------------------------------------------------------------------------------
This software is provided 'as-is', without any express or implied

View file

@ -22,8 +22,8 @@ This is still in active development and things are going to change. If you find
- Many features ported from Saturn
## Optional Gameplay Features
- Rings (Based on how they were in v2 Indev)
- New items (Such as the Flame Shield and the Bubble Shield)
- Rings (Based on how they were in v2 Indev and then further rebalanced)
- New items (Such as the as a rebalanced Flame Shield and a rebalanced Bubble Shield)
- 4 tier drifts (Blue, Red, Purple, Rainbow)
- Boost Stacking
- Boost Chaining

View file

@ -4,7 +4,11 @@ if(("${CMAKE_COMPILER_IS_GNUCC}" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND
target_link_options(SRB2SDL2 PRIVATE "-Wl,--disable-dynamicbase")
if("${SRB2_CONFIG_STATIC_STDLIB}")
# On MinGW with internal libraries, link the standard library statically
target_link_options(SRB2SDL2 PRIVATE -Wl,--add-stdcall-alias -static-libgcc -static-libstdc++ -static -lpthread)
if(CMAKE_LINKER_TYPE STREQUAL "LLD")
target_link_options(SRB2SDL2 PRIVATE -Wl, -static-libgcc -static-libstdc++ -static -lpthread)
else()
target_link_options(SRB2SDL2 PRIVATE -Wl,--add-stdcall-alias -static-libgcc -static-libstdc++ -static -lpthread)
endif()
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
target_link_libraries(SRB2SDL2 PRIVATE Threads::Threads)
@ -25,10 +29,10 @@ target_sources(SRB2SDL2 PRIVATE comptime.c md5.c config.h.in)
### Configuration
set(SRB2_CONFIG_DEV_BUILD OFF CACHE BOOL
"Compile a development build of SRB2Kart.")
set(SRB2_CONFIG_SKIP_COMPTIME OFF CACHE BOOL
"Skip Comptime rebuild.")
if(NOT SRB2_CONFIG_SKIP_COMPTIME)
# This updates the modification time for comptime.c at the
# end of building so when the build system is ran next time,
@ -55,7 +59,10 @@ add_custom_target(_SRB2_reconf ALL
)
add_dependencies(SRB2SDL2 _SRB2_reconf)
if(SRB2_CONFIG_ASAN)
target_compile_options(SRB2SDL2 PRIVATE -fsanitize=address)
target_link_options(SRB2SDL2 PRIVATE -fsanitize=address)
endif()
add_subdirectory(blua)
add_subdirectory(blan)
@ -117,11 +124,13 @@ target_compile_definitions(SRB2SDL2 PRIVATE -DHAVE_THREADS)
if(${SRB2_CONFIG_HAVE_ZLIB})
if(${SRB2_CONFIG_USE_INTERNAL_LIBRARIES})
set(ZLIB_FOUND ON)
set(ZLIB_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/zlib)
set(ZLIB_COMPAT ON)
set(WITH_GTEST OFF)
set(ZLIB_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/zlib-ng)
if(${SRB2_SYSTEM_BITS} EQUAL 64)
set(ZLIB_LIBRARIES "-L${CMAKE_SOURCE_DIR}/thirdparty/zlib/win32 -lz64")
set(ZLIB_LIBRARIES "-L${CMAKE_SOURCE_DIR}/thirdparty/zlib-ng/win32 -lz64")
else() # 32-bit
set(ZLIB_LIBRARIES "-L${CMAKE_SOURCE_DIR}/thirdparty/zlib/win32 -lz32")
set(ZLIB_LIBRARIES "-L${CMAKE_SOURCE_DIR}/thirdparty/zlib-ng/win32 -lz32")
endif()
else()
find_package(ZLIB)
@ -210,7 +219,11 @@ if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STRE
target_compile_options(SRB2SDL2 PRIVATE -mno-ms-bitfields)
endif()
target_compile_options(SRB2SDL2 PRIVATE -O3)
if (${CMAKE_BUILD_TYPE} MATCHES Debug)
else()
target_compile_options(SRB2SDL2 PRIVATE -O3)
endif()
# Compiler warnings configuration
target_compile_options(SRB2SDL2 PRIVATE
@ -237,7 +250,7 @@ target_compile_options(SRB2SDL2 PRIVATE
-Wnested-externs
-Wformat-y2k
-Wformat-security
$<$<VERSION_LESS:$<C_COMPILER_VERSION>,2.9.5>:
-Wno-div-by-zero
-Wendif-labels
@ -328,6 +341,11 @@ target_compile_options(SRB2SDL2 PRIVATE
$<$<AND:$<COMPILE_LANGUAGE:C>,$<C_COMPILER_ID:MSVC>>:
/Wv:19.20.27004.0
>
# GNU
$<$<C_COMPILER_ID:GNU>:
-fmax-errors=5
>
)
if(SRB2_CONFIG_ERRORMODE)
target_compile_options(SRB2SDL2 PRIVATE

View file

@ -122,6 +122,7 @@ k_bheap.c
k_bot.cpp
k_botitem.cpp
k_botsearch.cpp
k_cluster.cpp
k_grandprix.c
k_boss.c
k_hud.c

View file

@ -9,7 +9,9 @@
// Thread classes.
//
//-----------------------------------------------------------------------------
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#include "Thread.hpp"
#include "Array.hpp"

View file

@ -9,7 +9,9 @@
// Thread execution.
//
//-----------------------------------------------------------------------------
#ifdef __GNUC__
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#include "Thread.hpp"
#include "Array.hpp"

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -37,6 +37,15 @@
// Allow scripters to write files of these types to SRB2's folder
static const char *whitelist[] = {
".bmp",
".png",
".obj",
".json",
".yaml",
".xml",
".csv",
".soc",
".cfg",
".csv",
".dat",
@ -176,7 +185,7 @@ void MakePathDirs(char *path)
}
static int CheckFileName(lua_State *L, const char *filename)
static int CheckFileName(lua_State* L, const char* filename, boolean extensioncheck)
{
int length = strlen(filename);
boolean pass = false;
@ -188,12 +197,21 @@ static int CheckFileName(lua_State *L, const char *filename)
return pushresult(L,0,filename);
}
for (i = 0; i < (sizeof (whitelist) / sizeof(const char *)); i++)
if (!stricmp(&filename[length - strlen(whitelist[i])], whitelist[i]))
{
pass = true;
break;
}
if (extensioncheck)
{
for (i = 0; i < (sizeof(whitelist) / sizeof(const char*)); i++)
if (!stricmp(&filename[length - strlen(whitelist[i])], whitelist[i]))
{
pass = true;
break;
}
}
else
{
pass = true;
}
if (strstr(filename, "./")
|| strstr(filename, "..") || strchr(filename, ':')
|| filename[0] == '/'
@ -214,7 +232,10 @@ static int io_openlocal (lua_State *L) {
luafiletransfer_t *filetransfer;
int checkresult;
checkresult = CheckFileName(L, filename);
// Decision was made for normal reading (binary + text) to have no whitelist restrictions
boolean readcheck = (strchr(mode, 'w') != NULL) || (strchr(mode, 'a') != NULL) || (strchr(mode, '+') != NULL);
checkresult = CheckFileName(L, filename, readcheck);
if (checkresult)
return checkresult;
@ -240,11 +261,10 @@ static int io_open (lua_State *L) {
const char *mode = luaL_optstring(L, 2, "r");
int checkresult;
checkresult = CheckFileName(L, filename);
checkresult = CheckFileName(L, filename, false);
if (checkresult)
return checkresult;
if (lua_isfunction(L,3))
{
luaL_checktype(L, 3, LUA_TFUNCTION);

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -57,6 +57,7 @@ static void COM_Toggle_f(void);
static void COM_Add_f(void);
static void COM_Choose_f(void);
static void COM_ChooseWeighted_f(void);
static void COM_Reset_f(void);
static void CV_EnforceExecVersion(void);
@ -64,8 +65,8 @@ static boolean CV_Command(void);
consvar_t *CV_FindVar(const char *name);
static const char *CV_StringValue(const char *var_name);
static consvar_t *consvar_vars; // list of registered console variables
static UINT16 consvar_number_of_netids = 0;
consvar_t *consvar_vars; // list of registered console variables
UINT16 consvar_number_of_netids = 0;
static char com_token[1024];
static char *COM_Parse(char *data);
@ -84,9 +85,12 @@ CV_PossibleValue_t kartspeed_cons_t[] = {
{KARTSPEED_EASY, "Easy"},
{KARTSPEED_NORMAL, "Normal"},
{KARTSPEED_HARD, "Hard"},
{KARTSPEED_EXPERT, "Expert"},
{0, NULL}
};
consvar_t cv_resetnetvars = CVAR_INIT ("resetnetvars", "Off", CV_SAVE, CV_OnOff, NULL);
// Filter consvars by EXECVERSION
// First implementation is 2 (1.0.2), so earlier configs default at 1 (1.0.0)
// Also set CV_HIDEN during runtime, after config is loaded
@ -354,6 +358,7 @@ void COM_Init(void)
COM_AddCommand("add", COM_Add_f);
COM_AddCommand("choose", COM_Choose_f);
COM_AddCommand("chooseweighted", COM_ChooseWeighted_f);
COM_AddCommand("reset", COM_Reset_f);
RegisterNetXCmd(XD_NETVAR, Got_NetVar);
}
@ -1219,6 +1224,36 @@ static void COM_ChooseWeighted_f(void)
}
}
static void COM_Reset_f(void)
{
size_t i;
if (COM_Argc() < 2)
{
CONS_Printf(M_GetText("reset <cvar1> [cvar2] [...]: Resets a cvar to its default value\n"));
return;
}
for (i = 1; i < COM_Argc(); ++i)
{
consvar_t *cvar = CV_FindVar(COM_Argv(i));
if (!cvar)
{
CONS_Alert(CONS_NOTICE, M_GetText("%s is not a cvar\n"), COM_Argv(i));
continue;
}
CV_Set(cvar, cvar->defaultvalue);
// Sometimes a cvar cannot be changed, e.g. CV_NETVAR without admin privilege.
if (!stricmp(cvar->string, cvar->defaultvalue))
{
CONS_Printf("%s = %s\n", cvar->name, cvar->string);
}
}
}
// =========================================================================
// VARIABLE SIZE BUFFERS
// =========================================================================
@ -1842,7 +1877,7 @@ void CV_SaveVars(UINT8 **p, boolean in_demo)
static void CV_LoadVars(UINT8 **p,
consvar_t *(*got)(UINT8 **p, char **ret_value, boolean *ret_stealth))
{
const boolean store = (client || demo.playback);
const boolean store = cv_resetnetvars.value && (client || demo.playback);
consvar_t *cvar;
UINT16 count;
@ -1884,6 +1919,12 @@ void CV_RevertNetVars(void)
{
consvar_t * cvar;
if (!cv_resetnetvars.value)
{
// Sorry bud, not today.
return;
}
for (cvar = consvar_vars; cvar; cvar = cvar->next)
{
if (cvar->revert.v.string != NULL)
@ -2108,19 +2149,28 @@ void CV_AddValue(consvar_t *var, INT32 increment)
if (!increment)
return;
if (var == &cv_forceskin) // Special handling.
if (var == &cv_forceskin || var == &cv_chooseskin) // Special handling.
{
INT32 oldvalue = var->value;
INT32 min = var == &cv_forceskin ? -1 : 0;
newvalue = oldvalue;
do
{
newvalue += increment;
if (newvalue < -1)
newvalue = (numskins - 1);
if (newvalue < min)
newvalue = numskins-1;
else if (newvalue >= numskins)
newvalue = -1;
} while ((oldvalue != newvalue)
&& !(R_SkinUsable(-1, newvalue)));
newvalue = min;
} while (oldvalue != newvalue && !R_SkinUsable(-1, newvalue));
}
else if (var == &cv_playercolor[0] || var == &cv_playercolor[1] || var == &cv_playercolor[2] || var == &cv_playercolor[3] || var == &cv_dummycolor)
{
// Special case for the playercolor variable, used only directly from the menu
newvalue = var->value;
if (increment > 0) // Going up!
newvalue = M_GetColorAfter(newvalue);
else if (increment < 0) // Going down!
newvalue = M_GetColorBefore(newvalue);
}
else
newvalue = var->value + increment;
@ -2184,59 +2234,9 @@ void CV_AddValue(consvar_t *var, INT32 increment)
if (var->PossibleValue[max].value == var->value)
currentindice = max;
// The following options will NOT handle netsyncing.
if (var == &cv_chooseskin)
{
// Special case for the chooseskin variable, used only directly from the menu
newvalue = var->value - 1;
do
{
if (increment > 0) // Going up!
{
newvalue++;
if (newvalue == MAXSKINS)
newvalue = 0;
}
else if (increment < 0) // Going down!
{
newvalue--;
if (newvalue == -1)
newvalue = MAXSKINS-1;
}
} while (var->PossibleValue[newvalue].strvalue == NULL);
var->value = newvalue + 1;
var->string = var->PossibleValue[newvalue].strvalue;
var->func();
return;
}
else if (var == &cv_playercolor[0] || var == &cv_playercolor[1] || var == &cv_playercolor[2] || var == &cv_playercolor[3])
{
// Special case for the playercolor variable, used only directly from the menu
if (increment > 0) // Going up!
{
newvalue = var->value + 1;
if (newvalue > numskincolors-1)
newvalue = 1;
var->value = newvalue;
var->string = var->PossibleValue[var->value].strvalue;
var->func();
return;
}
else if (increment < 0) // Going down!
{
newvalue = var->value - 1;
if (newvalue < 1)
newvalue = numskincolors-1;
var->value = newvalue;
var->string = var->PossibleValue[var->value].strvalue;
var->func();
return;
}
}
if ((var == &cv_kartspeed || var == &cv_kartbattlespeed) && !M_SecretUnlocked(SECRET_HARDSPEED))
{
max = (M_SecretUnlocked(SECRET_HARDSPEED) ? 4 : 3);
max = (M_SecretUnlocked(SECRET_HARDSPEED) ? 5 : 3);
}
#ifdef PARANOIA
if (currentindice == -1)

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -168,6 +168,9 @@ struct consvar_t //NULL, NULL, 0, NULL, NULL |, 0, NULL, NULL, 0, 0, NULL
#define CVAR_INIT( ... ) \
{ __VA_ARGS__, 0, NULL, NULL, {0, {NULL}}, 0U, (char)0, NULL }
extern consvar_t *consvar_vars; // list of registered console variables
extern UINT16 consvar_number_of_netids;
extern CV_PossibleValue_t CV_OnOff[];
extern CV_PossibleValue_t CV_YesNo[];
extern CV_PossibleValue_t CV_Signed[];
@ -179,11 +182,18 @@ extern CV_PossibleValue_t CV_Natural[];
#define KARTSPEED_EASY 0
#define KARTSPEED_NORMAL 1
#define KARTSPEED_HARD 2
#define KARTGP_MASTER 3 // Not a speed setting, gives the hardest speed with maxed out bots
#define KARTSPEED_EXPERT 3
#define KARTGP_MASTER 4 // Not a speed setting, gives hard speed with maxed out bots
#define KARTGP_NIGHTMARE 5 // Not a speed setting, gives expert speed with maxed out bots
extern CV_PossibleValue_t kartspeed_cons_t[];
// Invincibility types.
#define KARTINVIN_LEGACY 0
#define KARTINVIN_ALTERN 1
extern consvar_t cv_execversion;
extern consvar_t cv_resetnetvars;
void CV_InitFilterVar(void);
void CV_ToggleExecVersion(boolean enable);

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -93,6 +93,7 @@ INT32 serverplayer = 0;
char motd[254], server_context[8]; // Message of the Day, Unique Context (even without Mumble support)
UINT8 playerconsole[MAXPLAYERS];
plrinfo playerinfo[MAXPLAYERS];
// Server specific vars
UINT8 playernode[MAXPLAYERS];
@ -112,11 +113,11 @@ static tic_t joindelay = 0;
UINT16 pingmeasurecount = 1;
UINT32 realpingtable[MAXPLAYERS]; //the base table of ping where an average will be sent to everyone.
UINT32 playerpingtable[MAXPLAYERS]; //table of player latency values.
UINT32 playerpacketlosstable[MAXPLAYERS];
UINT32 playerdelaytable[MAXPLAYERS]; // mindelay values.
static tic_t lowest_lag;
boolean server_lagless;
static CV_PossibleValue_t mindelay_cons_t[] = {{0, "MIN"}, {30, "MAX"}, {0, NULL}};
consvar_t cv_mindelay = CVAR_INIT ("mindelay", "0", CV_SAVE, mindelay_cons_t, NULL);
SINT8 nodetoplayer[MAXNETNODES];
SINT8 nodetoplayer2[MAXNETNODES]; // say the numplayer for this node if any (splitscreen)
@ -124,6 +125,7 @@ SINT8 nodetoplayer3[MAXNETNODES]; // say the numplayer for this node if any (spl
SINT8 nodetoplayer4[MAXNETNODES]; // say the numplayer for this node if any (splitscreen == 3)
UINT8 playerpernode[MAXNETNODES]; // used specialy for splitscreen
boolean nodeingame[MAXNETNODES]; // set false as nodes leave game
boolean receivedplayerinfo = false;
tic_t servermaxping = 20; // server's max delay, in frames. Defaults to 20
static tic_t nettics[MAXNETNODES]; // what tic the client have received
@ -154,6 +156,8 @@ static boolean cl_redownloadinggamestate = false;
static UINT8 localtextcmd[MAXSPLITSCREENPLAYERS][MAXTEXTCMD];
static tic_t neededtic;
SINT8 servernode = 0; // the number of the server node
SINT8 joinnode = 0; // used for CL_VIEWSERVER
char connectedservername[MAXSERVERNAME+1];
/// \brief do we accept new players?
/// \todo WORK!
@ -185,7 +189,7 @@ ticcmd_t netcmds[BACKUPTICS][MAXPLAYERS];
static textcmdtic_t *textcmds[TEXTCMD_HASH_SIZE] = {NULL};
consvar_t cv_showjoinaddress = CVAR_INIT ("showjoinaddress", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL);
consvar_t cv_showjoinaddress = CVAR_INIT ("showjoinaddress", "Off", CV_SAVE, CV_OnOff, NULL);
static CV_PossibleValue_t playbackspeed_cons_t[] = {{1, "MIN"}, {10, "MAX"}, {0, NULL}};
consvar_t cv_playbackspeed = CVAR_INIT ("playbackspeed", "1", 0, playbackspeed_cons_t, NULL);
@ -541,27 +545,6 @@ void ReadLmpExtraData(UINT8 **demo_pointer, INT32 playernum)
static INT16 Consistancy(void);
typedef enum
{
CL_SEARCHING,
CL_CHECKFILES,
CL_DOWNLOADFILES,
CL_DOWNLOADFAILED,
CL_ASKJOIN,
CL_LOADFILES,
CL_SETUPFILES,
CL_WAITJOINRESPONSE,
CL_DOWNLOADSAVEGAME,
CL_CONNECTED,
CL_ABORTED,
CL_ASKFULLFILELIST,
CL_CONFIRMCONNECT,
#ifdef HAVE_CURL
CL_PREPAREHTTPFILES,
CL_DOWNLOADHTTPFILES,
#endif
} cl_mode_t;
static void GetPackets(void);
static cl_mode_t cl_mode = CL_SEARCHING;
@ -572,6 +555,28 @@ char http_source[MAX_MIRROR_LENGTH];
static UINT16 cl_lastcheckedfilecount = 0; // used for full file list
void ChangeServMusic(const char* musname, boolean fallback, boolean keepPos)
{
if (S_MusicExists(musname))
if (keepPos)
S_ChangeMusicEx(musname,0,true, S_GetMusicPosition(), 0,0);
else
S_ChangeMusicInternal(musname,true);
else if (fallback)
S_ChangeMusicInternal("BLANCD",true);
}
// Let external code read and modify this stuff.
INT32 GetClientMode(void)
{
return cl_mode;
}
void ChangeClientMode(INT32 mode)
{
cl_mode = mode;
}
//
// CL_DrawConnectionStatus
//
@ -589,6 +594,7 @@ static inline void CL_DrawConnectionStatus(void)
#ifdef HAVE_CURL
&& cl_mode != CL_DOWNLOADHTTPFILES
#endif
&& cl_mode != CL_VIEWSERVER
)
{
INT32 i, animtime = ((ccstime / 4) & 15) + 16;
@ -703,6 +709,14 @@ static inline void CL_DrawConnectionStatus(void)
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24, MENUCAPS|V_20TRANS|V_MONOSPACE,
va(" %2u/%2u Files",loadcompletednum,fileneedednum));
}
else if (cl_mode == CL_VIEWSERVER)
{
if (receivedplayerinfo && !menustack[0])
{
M_StartControlPanel();
M_EnterMenu(MN_VIEWSERVER, true, 0);
}
}
else if (lastfilenum != -1)
{
INT32 dldlength;
@ -970,7 +984,7 @@ static void SV_SendServerInfo(INT32 node, tic_t servertime)
{
//strncpy(netbuffer->u.serverinfo.maptitle, (char *)mapheaderinfo[gamemap-1]->lvlttl, sizeof netbuffer->u.serverinfo.maptitle);
// set up the levelstring
if (netbuffer->u.serverinfo.iszone || (mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
if (!netbuffer->u.serverinfo.iszone || (mapheaderinfo[gamemap-1]->levelflags & LF_NOZONE))
{
if (mapheaderinfo[gamemap-1]->actnum[0])
snprintf(netbuffer->u.serverinfo.maptitle,
@ -1043,20 +1057,16 @@ static void SV_SendPlayerInfo(INT32 node)
for (i = 0; i < MSCOMPAT_MAXPLAYERS; i++)
{
if (i >= MAXPLAYERS)
{
netbuffer->u.playerinfo[i].num = 255; // Master Server compat
continue;
}
if (!playeringame[i])
if (i >= MAXPLAYERS || playernode[i] == UINT8_MAX || !playeringame[i])
{
netbuffer->u.playerinfo[i].num = 255; // This slot is empty.
continue;
}
netbuffer->u.playerinfo[i].num = i;
strncpy(netbuffer->u.playerinfo[i].name, (const char *)&player_names[i], MAXPLAYERNAME+1);
memset(netbuffer->u.playerinfo[i].name, 0x00, sizeof(netbuffer->u.playerinfo[i].name));
memcpy(netbuffer->u.playerinfo[i].name, player_names[i], sizeof(player_names[i]));
netbuffer->u.playerinfo[i].name[MAXPLAYERNAME] = '\0';
//fetch IP address
@ -1080,11 +1090,7 @@ static void SV_SendPlayerInfo(INT32 node)
netbuffer->u.playerinfo[i].score = LONG(players[i].score);
netbuffer->u.playerinfo[i].timeinserver = SHORT((UINT16)(players[i].jointime / TICRATE));
netbuffer->u.playerinfo[i].skin = (UINT16)(players[i].skin
#ifdef DEVELOP // it's safe to do this only because PLAYERINFO isn't read by the game itself
% 3
#endif
);
netbuffer->u.playerinfo[i].skin = (UINT16)(players[i].skin);
// Extra data
netbuffer->u.playerinfo[i].data = 0; //players[i].skincolor;
@ -1357,8 +1363,7 @@ static void CL_ReloadReceivedSavegame(void)
CL_LoadReceivedSavegame(true);
if (neededtic < gametic)
neededtic = gametic;
neededtic = max(neededtic, gametic);
maketic = neededtic;
for (i = 0; i <= r_splitscreen; i++)
@ -1412,6 +1417,7 @@ static void SL_ClearServerList(INT32 connectedserver)
serverlist[i].node = 0;
}
serverlistcount = 0;
M_UpdateNumServerPages();
}
static UINT32 SL_SearchServer(INT32 node)
@ -1452,6 +1458,7 @@ static void SL_InsertServer(serverinfo_pak* info, SINT8 node)
return;/* that's a different mod */
i = serverlistcount++;
M_UpdateNumServerPages();
}
serverlist[i].info = *info;
@ -1603,6 +1610,7 @@ static boolean CL_FinishedFileList(void)
"Press ACCEL to continue or BRAKE to cancel.\n\n"
), M_ConfirmConnect, MM_EVENTHANDLER);
cl_mode = CL_CONFIRMCONNECT;
ChangeServMusic(SERVMUS_2, true,true);
}
else
cl_mode = CL_LOADFILES;
@ -1672,6 +1680,7 @@ static boolean CL_FinishedFileList(void)
Z_Free(downloadsize);
cl_mode = CL_CONFIRMCONNECT;
ChangeServMusic(SERVMUS_2, true,true);
}
#ifdef HAVE_CURL
else
@ -1771,7 +1780,8 @@ static boolean CL_ServerConnectionSearchTicker(tic_t *asksent)
return true;
}
cl_mode = CL_CHECKFILES;
cl_mode = cv_serverinfoscreen.value ? CL_VIEWSERVER : CL_CHECKFILES;
ChangeServMusic(SERVMUS_1, true,false);
}
else
{
@ -1816,7 +1826,10 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
case CL_ASKFULLFILELIST:
if (cl_lastcheckedfilecount == UINT16_MAX) // All files retrieved
cl_mode = CL_CHECKFILES;
{
cl_mode = cv_serverinfoscreen.value ? CL_VIEWSERVER : CL_CHECKFILES;
ChangeServMusic(SERVMUS_1, true,false);
}
else if (fileneedednum != cl_lastcheckedfilecount || I_GetTime() >= *asksent)
{
if (CL_AskFileList(fileneedednum))
@ -1916,18 +1929,19 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
}
break;
case CL_ASKJOIN:
if (firstconnectattempttime + NEWTICRATE*300 < I_GetTime() && !server)
if (cv_connectawaittime.value && firstconnectattempttime + NEWTICRATE*60*cv_connectawaittime.value < I_GetTime() && !server)
{
CONS_Printf(M_GetText("5 minute wait time exceeded.\n"));
CONS_Printf("%d minute wait time exceeded.\n", cv_connectawaittime.value);
CONS_Printf(M_GetText("Network game synchronization aborted.\n"));
D_QuitNetGame();
CL_Reset();
D_StartTitle();
M_StartMessage(M_GetText(
"5 minute wait time exceeded.\n"
M_StartMessage(va(
"%d minute wait time exceeded.\n"
"You may retry connection.\n"
"\n"
"Press ESC\n"
"Press ESC\n",
cv_connectawaittime.value
), NULL, MM_NOTHING);
return false;
}
@ -2002,8 +2016,15 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
else
continue;
if (key == KEY_ESCAPE || G_ControlBoundToKey(0, gc_brake, key, true))
cl_mode = CL_ABORTED;
if (cl_mode == CL_VIEWSERVER && menustack[0])
{
M_Responder(ev);
}
else
{
if (key == KEY_ESCAPE || G_ControlBoundToKey(0, gc_brake, key, true))
cl_mode = CL_ABORTED;
}
}
}
@ -2031,6 +2052,7 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
{
if (cl_mode != CL_DOWNLOADFILES && cl_mode != CL_DOWNLOADSAVEGAME)
{
F_MenuPresTicker(true); // title sky
F_TitleScreenTicker(true);
F_TitleScreenDrawer();
}
@ -2073,6 +2095,7 @@ static void CL_ConnectToServer(void)
sprintf(tmpsave, "%s" PATHSEP TMPSAVENAME, srb2home);
lastfilenum = -1;
receivedplayerinfo = false;
cl_mode = CL_SEARCHING;
@ -3325,7 +3348,7 @@ static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {MAXPLAYERS, "MAX"}
consvar_t cv_maxplayers = CVAR_INIT ("maxplayers", "8", CV_SAVE|CV_CALL, maxplayers_cons_t, Joinable_OnChange);
static CV_PossibleValue_t joindelay_cons_t[] = {{1, "MIN"}, {3600, "MAX"}, {0, "Off"}, {0, NULL}};
consvar_t cv_joindelay = CVAR_INIT ("joindelay", "10", CV_SAVE|CV_NETVAR, joindelay_cons_t, NULL);
consvar_t cv_joindelay = CVAR_INIT ("joindelay", "10", CV_SAVE, joindelay_cons_t, NULL);
// Here for dedicated servers
static CV_PossibleValue_t discordinvites_cons_t[] = {{0, "Admins Only"}, {1, "Everyone"}, {0, NULL}};
@ -3333,17 +3356,22 @@ consvar_t cv_discordinvites = CVAR_INIT ("discordinvites", "Everyone", CV_SAVE|C
static CV_PossibleValue_t resynchattempts_cons_t[] = {{1, "MIN"}, {20, "MAX"}, {0, "No"}, {0, NULL}};
consvar_t cv_resynchattempts = CVAR_INIT ("resynchattempts", "2", CV_SAVE|CV_NETVAR, resynchattempts_cons_t, NULL);
consvar_t cv_blamecfail = CVAR_INIT ("blamecfail", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL);
consvar_t cv_resynchattempts = CVAR_INIT ("resynchattempts", "2", CV_SAVE, resynchattempts_cons_t, NULL);
consvar_t cv_blamecfail = CVAR_INIT ("blamecfail", "Off", CV_SAVE, CV_OnOff, NULL);
// max file size to send to a player (in kilobytes)
static CV_PossibleValue_t maxsend_cons_t[] = {{0, "MIN"}, {51200, "MAX"}, {0, NULL}};
consvar_t cv_maxsend = CVAR_INIT ("maxsend", "51200", CV_SAVE|CV_NETVAR, maxsend_cons_t, NULL);
consvar_t cv_noticedownload = CVAR_INIT ("noticedownload", "Off", CV_SAVE|CV_NETVAR, CV_OnOff, NULL);
consvar_t cv_maxsend = CVAR_INIT ("maxsend", "51200", CV_SAVE, maxsend_cons_t, NULL);
consvar_t cv_noticedownload = CVAR_INIT ("noticedownload", "Off", CV_SAVE, CV_OnOff, NULL);
// Speed of file downloading (in packets per tic)
static CV_PossibleValue_t downloadspeed_cons_t[] = {{1, "MIN"}, {300, "MAX"}, {0, NULL}};
consvar_t cv_downloadspeed = CVAR_INIT ("downloadspeed", "32", CV_SAVE|CV_NETVAR, downloadspeed_cons_t, NULL);
consvar_t cv_downloadspeed = CVAR_INIT ("downloadspeed", "32", CV_SAVE, downloadspeed_cons_t, NULL);
static CV_PossibleValue_t connectawaittime_cons_t[] = {{1, "MIN"}, {60, "MAX"}, {0, "Inf"}, {0, NULL}};
consvar_t cv_connectawaittime = CVAR_INIT ("connectawaittime", "5", CV_SAVE, connectawaittime_cons_t, NULL);
consvar_t cv_serverinfoscreen = CVAR_INIT ("serverinfoscreen", "On", CV_SAVE, CV_OnOff, NULL);
static void Got_AddPlayer(UINT8 **p, INT32 playernum);
static void Got_RemovePlayer(UINT8 **p, INT32 playernum);
@ -3465,6 +3493,8 @@ void SV_ResetServer(void)
pingmeasurecount = 1;
memset(realpingtable, 0, sizeof realpingtable);
memset(playerpingtable, 0, sizeof playerpingtable);
memset(playerpacketlosstable, 0, sizeof playerpacketlosstable);
memset(playerdelaytable, 0, sizeof playerdelaytable);
ClearAdminPlayers();
Schedule_Clear();
@ -4270,6 +4300,16 @@ static void HandleServerInfo(SINT8 node)
SL_InsertServer(&netbuffer->u.serverinfo, node);
}
static void HandlePlayerInfo(SINT8 node)
{
(void)node;
for (INT32 i = 0; i < MAXPLAYERS; i++)
{
playerinfo[i] = netbuffer->u.playerinfo[i];
}
receivedplayerinfo = true;
}
static void PT_WillResendGamestate(void)
{
char tmpsave[256];
@ -4331,31 +4371,7 @@ static void HandlePacketFromAwayNode(SINT8 node)
switch (netbuffer->packettype)
{
case PT_ASKINFOVIAMS:
#if 0
if (server && serverrunning)
{
INT32 clientnode;
if (ms_RoomId < 0) // ignore if we're not actually on the MS right now
{
Net_CloseConnection(node); // and yes, close connection
return;
}
clientnode = I_NetMakeNode(netbuffer->u.msaskinfo.clientaddr);
if (clientnode != -1)
{
SV_SendServerInfo(clientnode, (tic_t)LONG(netbuffer->u.msaskinfo.time));
SV_SendPlayerInfo(clientnode); // Send extra info
Net_CloseConnection(clientnode);
// Don't close connection to MS...
}
else
Net_CloseConnection(node); // ...unless the IP address is not valid
}
else
Net_CloseConnection(node); // you're not supposed to get it, so ignore it
#else
Net_CloseConnection(node);
#endif
break;
case PT_TELLFILESNEEDED:
@ -4536,6 +4552,10 @@ static void HandlePacketFromAwayNode(SINT8 node)
case PT_CLIENTCMD:
break; // This is not an "unknown packet"
case PT_PLAYERINFO:
HandlePlayerInfo(node);
break;
case PT_SERVERTICS:
// Do not remove my own server (we have just get a out of order packet)
if (node == servernode)
@ -4659,7 +4679,8 @@ static void HandlePacketFromPlayer(SINT8 node)
// If we already received a ticcmd for this tic, just submit it for the next one.
tic_t faketic = maketic;
if (!!(netcmds[maketic % BACKUPTICS][netconsole].flags & TICCMD_RECEIVED))
if ((!!(netcmds[maketic % BACKUPTICS][netconsole].flags & TICCMD_RECEIVED))
&& (maketic - firstticstosend < BACKUPTICS - 1))
faketic++;
// Copy ticcmd
@ -4941,8 +4962,8 @@ static void HandlePacketFromPlayer(SINT8 node)
txtpak = (UINT8 *)&netbuffer->u.serverpak.cmds[netbuffer->u.serverpak.numslots
* netbuffer->u.serverpak.numtics];
if (realend > gametic + BACKUPTICS)
realend = gametic + BACKUPTICS;
if (realend > gametic + CLIENTBACKUPTICS)
realend = gametic + CLIENTBACKUPTICS;
cl_packetmissed = realstart > neededtic;
if (realstart <= neededtic && realend > neededtic)
@ -4999,10 +5020,16 @@ static void HandlePacketFromPlayer(SINT8 node)
{
UINT8 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i])
playerpingtable[i] = (tic_t)netbuffer->u.pingtable[i];
{
playerpingtable[i] = (tic_t)netbuffer->u.netinfo.pingtable[i];
playerpacketlosstable[i] = netbuffer->u.netinfo.packetloss[i];
playerdelaytable[i] = netbuffer->u.netinfo.delay[i];
}
}
servermaxping = (tic_t)netbuffer->u.pingtable[MAXPLAYERS];
servermaxping = (tic_t)netbuffer->u.netinfo.pingtable[MAXPLAYERS];
}
break;
@ -5084,9 +5111,6 @@ static void GetPackets(void)
continue;
}
if (netbuffer->packettype == PT_PLAYERINFO)
continue; // We do nothing with PLAYERINFO, that's for the MS browser.
// Packet received from someone already playing
if (nodeingame[node])
HandlePacketFromPlayer(node);
@ -5387,11 +5411,8 @@ static void SV_SendTics(void)
if (nodeingame[n])
{
// assert supposedtics[n]>=nettics[n]
realfirsttic = supposedtics[n];
lasttictosend = maketic;
if (lasttictosend - nettics[n] >= BACKUPTICS)
lasttictosend = nettics[n] + BACKUPTICS-1;
realfirsttic = max(supposedtics[n], firstticstosend);
lasttictosend = min(maketic, nettics[n] + CLIENTBACKUPTICS);
if (realfirsttic >= lasttictosend)
{
@ -5407,8 +5428,8 @@ static void SV_SendTics(void)
continue;
DEBFILE(va("Sent %d anyway\n", realfirsttic));
}
if (realfirsttic < firstticstosend)
realfirsttic = firstticstosend;
realfirsttic = max(realfirsttic, firstticstosend);
// compute the length of the packet and cut it if too large
packsize = BASESERVERTICSSIZE;
@ -5482,7 +5503,8 @@ static void SV_SendTics(void)
supposedtics[n] = lasttictosend-doomcom->extratics;
else
supposedtics[n] = lasttictosend;
if (supposedtics[n] < nettics[n]) supposedtics[n] = nettics[n];
supposedtics[n] = max(supposedtics[n], nettics[n]);
}
// node 0 is me!
supposedtics[0] = maketic;
@ -5531,6 +5553,8 @@ static void SV_Maketic(void)
for (i = 0; i < MAXPLAYERS; i++)
{
packetloss[i][maketic%PACKETMEASUREWINDOW] = false;
if (!playeringame[i])
continue;
@ -5558,6 +5582,9 @@ static void SV_Maketic(void)
*ticcmd = *prevticcmd;
ticcmd->flags &= ~TICCMD_RECEIVED;
}
// packetloss[i][leveltime%PACKETMEASUREWINDOW] = (cmd->flags & TICCMD_RECEIVED) ? false : true;
packetloss[i][maketic%PACKETMEASUREWINDOW] = true;
}
}
@ -5630,7 +5657,6 @@ boolean TryRunTics(tic_t realtics)
if (ticking)
{
{
boolean tickInterp = true;
// run the count * tics
while (neededtic > gametic)
@ -5659,19 +5685,8 @@ boolean TryRunTics(tic_t realtics)
P_PostLoadLevel();
}
boolean run = (gametic % NEWTICRATERATIO) == 0;
if (run && tickInterp)
{
// Update old view state BEFORE ticking so resetting
// the old interpolation state from game logic works.
R_UpdateViewInterpolation();
tickInterp = false; // do not update again in sped-up tics
}
G_Ticker(run);
G_Ticker((gametic % NEWTICRATERATIO) == 0);
}
if (Playing() && netgame && (gametic % TICRATE == 0))
{
Schedule_Run();
@ -5710,7 +5725,7 @@ static INT32 pingtimeout[MAXPLAYERS];
static inline void PingUpdate(void)
{
INT32 i;
INT32 i, j;
boolean laggers[MAXPLAYERS];
UINT8 numlaggers = 0;
memset(laggers, 0, sizeof(boolean) * MAXPLAYERS);
@ -5767,20 +5782,30 @@ static inline void PingUpdate(void)
{
//CONS_Printf("player %d - total pings: %d\n", i, realpingtable[i]);
netbuffer->u.pingtable[i] = realpingtable[i] / pingmeasurecount;
netbuffer->u.netinfo.pingtable[i] = realpingtable[i] / pingmeasurecount;
//server takes a snapshot of the real ping for display.
//otherwise, pings fluctuate a lot and would be odd to look at.
playerpingtable[i] = realpingtable[i] / pingmeasurecount;
realpingtable[i] = 0; //Reset each as we go.
UINT32 lost = 0;
for (j = 0; j < PACKETMEASUREWINDOW; j++)
{
if (packetloss[i][j])
lost++;
}
netbuffer->u.netinfo.packetloss[i] = lost;
netbuffer->u.netinfo.delay[i] = playerdelaytable[i];
}
// send the server's maxping as last element of our ping table. This is useful to let us know when we're about to get kicked.
netbuffer->u.pingtable[MAXPLAYERS] = cv_maxping.value;
netbuffer->u.netinfo.pingtable[MAXPLAYERS] = cv_maxping.value;
//send out our ping packets
for (i = 0; i < MAXNETNODES; i++)
if (nodeingame[i])
HSendPacket(i, true, 0, sizeof(INT32) * (MAXPLAYERS+1));
HSendPacket(i, true, 0, sizeof(netinfo_pak));
pingmeasurecount = 0; //Reset count
}
@ -5796,7 +5821,7 @@ static void UpdatePingTable(void)
if (server)
{
if (Playing() && !(gametime % 35)) // update once per second.
if (Playing() && !(gametime % 8)) // Value chosen based on _my vibes man_
PingUpdate();
fastest = 0;
@ -5806,55 +5831,42 @@ static void UpdatePingTable(void)
{
if (playeringame[i] && playernode[i] > 0)
{
if (! server_lagless && playernode[i] > 0 && !players[i].spectator)
{
lag = GetLag(playernode[i]);
realpingtable[i] += lag;
// TicsToMilliseconds can't handle pings over 1000ms lol
realpingtable[i] += GetLag(playernode[i]);
if (!players[i].spectator)
{
lag = playerpingtable[i];
if (! fastest || lag < fastest)
fastest = lag;
}
else
{
// TicsToMilliseconds can't handle pings over 1000ms lol
realpingtable[i] += GetLag(playernode[i]);
}
}
}
// Don't gentleman below your mindelay
if (fastest < (tic_t)cv_mindelay.value)
fastest = (tic_t)cv_mindelay.value;
pingmeasurecount++;
if (server_lagless)
lowest_lag = 0;
else
{
lowest_lag = fastest;
if (fastest)
lag = fastest;
else
lag = GetLag(0);
// Don't gentleman below your mindelay
if (lowest_lag < (tic_t)cv_mindelay.value)
lowest_lag = (tic_t)cv_mindelay.value;
lag = ( realpingtable[0] + lag );
pingmeasurecount++;
switch (playerpernode[0])
{
case 4:
realpingtable[nodetoplayer4[0]] = lag;
/*FALLTHRU*/
case 3:
realpingtable[nodetoplayer3[0]] = lag;
/*FALLTHRU*/
case 2:
realpingtable[nodetoplayer2[0]] = lag;
/*FALLTHRU*/
case 1:
realpingtable[nodetoplayer[0]] = lag;
}
switch (playerpernode[0])
{
case 4:
playerdelaytable[nodetoplayer4[0]] = lowest_lag;
/*FALLTHRU*/
case 3:
playerdelaytable[nodetoplayer3[0]] = lowest_lag;
/*FALLTHRU*/
case 2:
playerdelaytable[nodetoplayer2[0]] = lowest_lag;
/*FALLTHRU*/
case 1:
playerdelaytable[nodetoplayer[0]] = lowest_lag;
}
}
else // We're a client, handle mindelay on the way out.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -43,6 +43,7 @@ applications may follow different packet versions.
// Networking and tick handling related.
#define BACKUPTICS 512 // more than enough for most timeouts....
#define CLIENTBACKUPTICS 32
#define MAXTEXTCMD 512
// No. of tics your controls can be delayed by.
@ -342,6 +343,13 @@ struct filesneededconfig_pak
UINT8 files[MAXFILENEEDED]; // is filled with writexxx (byteptr.h)
} ATTRPACK;
struct netinfo_pak
{
UINT32 pingtable[MAXPLAYERS+1];
UINT32 packetloss[MAXPLAYERS+1];
UINT32 delay[MAXPLAYERS+1];
} ATTRPACK;
//
// Network packet data
//
@ -375,7 +383,7 @@ struct doomdata_t
plrconfig playerconfig[MAXPLAYERS]; // (up to) 528 bytes(?)
INT32 filesneedednum; // 4 bytes
filesneededconfig_pak filesneededcfg; // ??? bytes
UINT32 pingtable[MAXPLAYERS+1]; // 68 bytes
netinfo_pak netinfo; // Don't believe their lies
} u; // This is needed to pack diff packet types data together
} ATTRPACK;
@ -403,6 +411,10 @@ extern consvar_t cv_kicktime;
extern consvar_t cv_showjoinaddress;
extern consvar_t cv_playbackspeed;
extern consvar_t cv_connectawaittime;
extern consvar_t cv_serverinfoscreen;
#define BASEPACKETSIZE offsetof(doomdata_t, u)
#define FILETXHEADER offsetof(filetx_pak, data)
#define BASESERVERTICSSIZE offsetof(doomdata_t, u.serverpak.cmds[0])
@ -446,6 +458,8 @@ extern tic_t jointimeout;
extern UINT16 pingmeasurecount;
extern UINT32 realpingtable[MAXPLAYERS];
extern UINT32 playerpingtable[MAXPLAYERS];
extern UINT32 playerpacketlosstable[MAXPLAYERS];
extern UINT32 playerdelaytable[MAXPLAYERS];
extern tic_t servermaxping;
extern boolean server_lagless;
@ -471,6 +485,28 @@ void SendNetXCmdForPlayer(UINT8 playerid, netxcmd_t id, const void *param, size_
#define SendNetXCmd(id, param, nparam) SendNetXCmdForPlayer(0, id, param, nparam) // Shortcut for P1
void SendKick(UINT8 playernum, UINT8 msg);
typedef enum
{
CL_SEARCHING,
CL_CHECKFILES,
CL_DOWNLOADFILES,
CL_DOWNLOADFAILED,
CL_ASKJOIN,
CL_LOADFILES,
CL_SETUPFILES,
CL_WAITJOINRESPONSE,
CL_DOWNLOADSAVEGAME,
CL_CONNECTED,
CL_ABORTED,
CL_ASKFULLFILELIST,
CL_CONFIRMCONNECT,
CL_VIEWSERVER,
#ifdef HAVE_CURL
CL_PREPAREHTTPFILES,
CL_DOWNLOADHTTPFILES,
#endif
} cl_mode_t;
// Create any new ticcmds and broadcast to other players.
void NetKeepAlive(void);
void NetUpdate(void);
@ -530,6 +566,16 @@ extern char motd[254], server_context[8];
extern UINT8 playernode[MAXPLAYERS];
/* consoleplayer of this player (splitscreen) */
extern UINT8 playerconsole[MAXPLAYERS];
extern plrinfo playerinfo[MAXPLAYERS];
extern SINT8 joinnode;
#define SERVMUS_1 "SRVMS1"
#define SERVMUS_2 "SRVMS2"
void ChangeServMusic(const char* musname, boolean fallback, boolean keepPos);
INT32 GetClientMode(void);
void ChangeClientMode(INT32 mode);
INT32 D_NumPlayers(void);
boolean D_IsPlayerHumanAndGaming(INT32 player_number);

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -86,8 +86,8 @@
#define ASSET_HASH_TEXTURES_KART 0xb4211b2f32b6a291
#define ASSET_HASH_CHARS_KART 0x1e68a3e01aa5c68b
#define ASSET_HASH_MAPS_KART 0x38558ed00da41ce9
#define ASSET_HASH_MAIN_PK3 0x41568cadaf608e27
#define ASSET_HASH_MAPPATCH_PK3 0x36ef622b54d98871
#define ASSET_HASH_MAIN_PK3 0x4bc55baaa1e5719e
#define ASSET_HASH_MAPPATCH_PK3 0xb6597d7c9f236846
#define ASSET_HASH_BONUSCHARS_KART 0x60e6f13d822a7461
#ifdef USE_PATCH_FILE
#define ASSET_HASH_PATCH_PK3 0x0000000000000000
@ -457,19 +457,20 @@ static bool D_Display(void)
if (gamestate == GS_TITLESCREEN && wipegamestate != GS_INTRO)
wipedefindex = wipe_timeattack_toblack;
if (wipetypepre < 0)
if (wipetypepre < 0 || !F_WipeExists(wipetypepre))
wipetypepre = wipedefs[wipedefindex];
if (rendermode != render_none)
{
// Fade to black first
if (!(gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction)) // fades to black on its own timing, always
if ((wipegamestate == FORCEWIPE ||
!(gamestate == GS_LEVEL || (gamestate == GS_TITLESCREEN && titlemapinaction))) // fades to black on its own timing, always
&& wipetypepre != UINT8_MAX)
{
F_WipeStartScreen();
F_WipeColorFill(31);
F_WipeEndScreen();
F_RunWipe(wipetypepre, gamestate != GS_TIMEATTACK);
F_RunWipe(wipetypepre, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN);
ranwipe = true;
}
@ -483,7 +484,7 @@ static bool D_Display(void)
}
else //dedicated servers
{
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK);
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN);
ranwipe = true;
wipegamestate = gamestate;
}
@ -557,20 +558,12 @@ static bool D_Display(void)
HU_Drawer();
break;
case GS_GAMEEND:
F_GameEndDrawer();
break;
case GS_EVALUATION:
F_GameEvaluationDrawer();
HU_Erase();
HU_Drawer();
break;
case GS_CONTINUING:
//F_ContinueDrawer();
break;
case GS_CREDITS:
F_CreditDrawer();
HU_Erase();
@ -671,14 +664,14 @@ static bool D_Display(void)
// and input during wipe tends to mess things up
wipedefindex += WIPEFINALSHIFT;
if (wipetypepost < 0)
if (wipetypepost < 0 || !F_WipeExists(wipetypepost))
wipetypepost = wipedefs[wipedefindex];
if (rendermode != render_none)
{
F_WipeEndScreen();
F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN);
F_RunWipe(wipetypepost, gamestate != GS_TIMEATTACK && gamestate != GS_TITLESCREEN);
ranwipe = true;
}
@ -900,7 +893,9 @@ void D_SRB2Loop(void)
{
renderdeltatics = FLOAT_TO_FIXED(deltatics);
if (!(paused || P_AutoPause()) && !hu_stopped)
const boolean lagging = ((deltatics >= 1.0) || hu_stopped);
if (!(paused || P_AutoPause()) && !lagging)
{
rendertimefrac = g_time.timefrac;
}
@ -909,7 +904,14 @@ void D_SRB2Loop(void)
rendertimefrac = FRACUNIT;
}
rendertimefrac_unpaused = g_time.timefrac;
if (!lagging)
{
rendertimefrac_unpaused = g_time.timefrac;
}
else
{
rendertimefrac_unpaused = FRACUNIT;
}
}
else
{
@ -918,9 +920,24 @@ void D_SRB2Loop(void)
rendertimefrac_unpaused = FRACUNIT;
}
if ((interp || doDisplay) && !frameskip)
if (interp || doDisplay)
{
ranwipe = D_Display();
if (!frameskip)
{
ranwipe = D_Display();
}
else if (frameskip)
{
// always update console and hud
// otherwise it may take minutes to open it
CON_Drawer();
if (gamestate == GS_LEVEL)
{
ST_Drawer();
HU_Drawer();
}
}
}
// Only take screenshots after drawing.
@ -949,7 +966,7 @@ void D_SRB2Loop(void)
// Fully completed frame made.
finishprecise = I_GetPreciseTime();
// Use the time before sleep for frameskip calculations:
// Use the time before sleep for frameskip calculations:
// post-sleep time is literally being intentionally wasted
deltasecs = (double)((INT64)(finishprecise - enterprecise)) / I_GetPrecisePrecision();
deltatics = deltasecs * NEWTICRATE;
@ -1062,7 +1079,7 @@ void D_StartTitle(void)
//demosequence = -1;
G_SetGametype(GT_RACE); // SRB2kart
paused = false;
F_InitMenuPresValues();
F_InitMenuPresValues(true);
// clear cmd building stuff
memset(gamekeydown, 0, sizeof(gamekeydown));
@ -1245,7 +1262,7 @@ void D_SRB2Main(void)
{
INT32 p;
INT32 pstartmap = 0;
INT32 pstartmap = 1;
boolean autostart = false;
/* break the version string into version numbers, for netplay */
@ -1428,12 +1445,9 @@ void D_SRB2Main(void)
// adapt tables to SRB2's needs, including extra slots for dehacked file support
P_ResetData(15);
// initiate menu metadata before SOCcing them
M_InitMenuPresTables();
// init title screen display params
if (M_GetUrlProtocolArg() || M_CheckParm("-connect"))
F_InitMenuPresValues();
F_InitMenuPresValues(true);
//---------------------------------------------------- READY TIME
// we need to check for dedicated before initialization of some subsystems
@ -1445,10 +1459,6 @@ void D_SRB2Main(void)
// Setup default unlockable conditions
M_SetupDefaultConditionSets();
// Setup character tables
// Have to be done here before files are loaded
M_InitCharacterTables();
D_RegisterServerCommands();
D_RegisterClientCommands(); // be sure that this is called before D_CheckNetGame
R_RegisterEngineStuff();
@ -1548,11 +1558,11 @@ void D_SRB2Main(void)
I_Error("modifiedgame set during startup!");
CONS_Printf("W_InitMultipleFiles(): Adding external PWADs.\n");
// HACK: Refer to https://git.do.srb2.org/KartKrew/RingRacers/-/merge_requests/29#note_61574
partadd_earliestfile = numwadfiles;
W_InitMultipleFiles(startuppwads, true);
// Only search for pwad maps and reload graphics if we actually have a pwad added
if (startuppwads[0] != NULL)
{
@ -1638,6 +1648,7 @@ void D_SRB2Main(void)
I_StartupSound();
I_InitMusic();
S_InitSfxChannels(cv_soundvolume.value);
S_InitMusicVolume();
}
CON_SetLoadingProgress(LOADED_SINITSFXCHANNELS);
@ -1682,7 +1693,7 @@ void D_SRB2Main(void)
// Start up a "minor" grand prix session
memset(&grandprixinfo, 0, sizeof(struct grandprixinfo));
grandprixinfo.gamespeed = KARTSPEED_NORMAL;
grandprixinfo.gamespeed = KARTSPEED_HARD;
grandprixinfo.encore = false;
grandprixinfo.masterbots = false;
@ -1840,11 +1851,16 @@ void D_SRB2Main(void)
const char *sskill = M_GetNextParm();
const char *masterstr = "Master";
const char *nightmarestr = "NIGHTMARE";
if (!strcasecmp(masterstr, sskill))
{
newskill = KARTGP_MASTER;
}
else if (!strcasecmp(nightmarestr, sskill))
{
newskill = KARTGP_NIGHTMARE;
}
else
{
for (j = 0; kartspeed_cons_t[j].strvalue; j++)
@ -1859,7 +1875,7 @@ void D_SRB2Main(void)
if (!kartspeed_cons_t[j].strvalue) // reached end of the list with no match
{
j = atoi(sskill); // assume they gave us a skill number, which is okay too
if (j >= KARTSPEED_EASY && j <= KARTGP_MASTER)
if (j >= KARTSPEED_EASY && j <= KARTGP_NIGHTMARE)
newskill = (INT16)j;
}
}
@ -1871,6 +1887,11 @@ void D_SRB2Main(void)
grandprixinfo.masterbots = true;
newskill = KARTSPEED_HARD;
}
else if (newskill == KARTGP_NIGHTMARE)
{
grandprixinfo.masterbots = true;
newskill = KARTSPEED_EXPERT;
}
grandprixinfo.gamespeed = newskill;
}
@ -1878,6 +1899,10 @@ void D_SRB2Main(void)
{
newskill = KARTSPEED_HARD;
}
else if (newskill == KARTGP_NIGHTMARE)
{
newskill = KARTSPEED_EXPERT;
}
if (newskill != -1)
CV_SetValue(&cv_kartspeed, newskill);
@ -1901,7 +1926,7 @@ void D_SRB2Main(void)
}
else if (M_CheckParm("-skipintro"))
{
F_InitMenuPresValues();
F_InitMenuPresValues(true);
F_StartTitleScreen();
}
else

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -105,6 +105,8 @@ static INT32 retransmit = 0, duppacket = 0;
static INT32 sendackpacket = 0, getackpacket = 0;
INT32 ticruned = 0, ticmiss = 0;
boolean packetloss[MAXPLAYERS][PACKETMEASUREWINDOW];
// globals
INT32 getbps, sendbps;
float lostpercent, duppercent, gamelostpercent;
@ -324,11 +326,18 @@ static void RemoveAck(INT32 i)
Net_CloseConnection(node);
}
typedef enum
{
GPACK_OK = 0,
GPACK_DUPLICATE,
GPACK_OUTOFORDER,
} goodpacket_e;
// We have got a packet, proceed the ack request and ack return
static boolean Processackpak(void)
static int Processackpak(void)
{
INT32 i;
boolean goodpacket = true;
int goodpacket = GPACK_OK;
netnode_t *node = &nodes[doomcom->remotenode];
// Received an ack return, so remove the ack in the list
@ -353,7 +362,7 @@ static boolean Processackpak(void)
{
DEBFILE(va("Discard(1) ack %d (duplicated)\n", ack));
duppacket++;
goodpacket = false; // Discard packet (duplicate)
goodpacket = GPACK_DUPLICATE; // Discard packet (duplicate)
}
else
{
@ -363,10 +372,10 @@ static boolean Processackpak(void)
{
DEBFILE(va("Discard(2) ack %d (duplicated)\n", ack));
duppacket++;
goodpacket = false; // Discard packet (duplicate)
goodpacket = GPACK_DUPLICATE; // Discard packet (duplicate)
break;
}
if (goodpacket)
if (goodpacket == GPACK_OK)
{
// Is a good packet so increment the acknowledge number,
// Then search for a "hole" in the queue
@ -427,12 +436,13 @@ static boolean Processackpak(void)
else // Buffer full discard packet, sender will resend it
{ // We can admit the packet but we will not detect the duplication after :(
DEBFILE("no more freeackret\n");
goodpacket = false;
goodpacket = GPACK_OUTOFORDER;
}
}
}
}
}
// return values: 0 = ok, 1 = duplicate, 2 = out of order
return goodpacket;
}
@ -1125,6 +1135,7 @@ boolean HGetPacket(void)
while(true)
{
//nodejustjoined = I_NetGet();
int goodpacket;
I_NetGet();
if (doomcom->remotenode == -1) // No packet received
@ -1170,8 +1181,15 @@ boolean HGetPacket(void)
}*/
// Proceed the ack and ackreturn field
if (!Processackpak())
goodpacket = Processackpak();
if (goodpacket != GPACK_OK)
{
// resend the ACK in case the previous ACK didn't reach the client.
// prevents the client's netbuffer from locking up.
if (goodpacket == GPACK_DUPLICATE)
Net_SendAcks(doomcom->remotenode);
continue; // discarded (duplicated)
}
// A packet with just ackreturn
if (netbuffer->packettype == PT_NOTHING)

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -22,6 +22,8 @@
extern "C" {
#endif
#include "doomdef.h"
// Max computers in a game
// 127 is probably as high as this can go, because
// SINT8 is used for nodes sometimes >:(
@ -40,6 +42,9 @@ boolean Net_GetNetStat(void);
extern INT32 getbytes;
extern INT64 sendbytes; // Realtime updated
#define PACKETMEASUREWINDOW (TICRATE*2)
extern boolean packetloss[MAXPLAYERS][PACKETMEASUREWINDOW];
extern SINT8 nodetoplayer[MAXNETNODES];
extern SINT8 nodetoplayer2[MAXNETNODES]; // Say the numplayer for this node if any (splitscreen)
extern SINT8 nodetoplayer3[MAXNETNODES]; // Say the numplayer for this node if any (splitscreen == 2)

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -153,7 +153,9 @@ static void KartPurpleDrift_OnChange(void);
static void KartStacking_OnChange(void);
static void KartChaining_OnChange(void);
static void KartSlipdash_OnChange(void);
static void KartSlopeBoost_OnChange(void);
static void KartItemBreaker_OnChange(void);
static void KartInvinType_OnChange(void);
static void Schedule_OnChange(void);
@ -457,20 +459,23 @@ consvar_t cv_kartstacking_accelstack = CVAR_INIT ("kartstacking_accelstack", "Of
consvar_t cv_kartstacking_sneaker_easyspeedboost = CVAR_INIT ("vanillaboost_sneaker_easyspeedboost", "0.8317", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_sneaker_normalspeedboost = CVAR_INIT ("vanillaboost_sneaker_normalspeedboost", "0.5", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_sneaker_hardspeedboost = CVAR_INIT ("vanillaboost_sneaker_hardspeedboost", "0.2756", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_sneaker_expertspeedboost = CVAR_INIT ("vanillaboost_sneaker_expertspeedboost", "0.25", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_sneaker_accelboost = CVAR_INIT ("vanillaboost_sneaker_accelboost", "8.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_sneaker_maxgrade = CVAR_INIT ("vanillaboost_sneaker_maxgrade", "3", CV_NETVAR|CV_CHEAT, CV_Natural, NULL);
consvar_t cv_kartstacking_sneaker_stackable = CVAR_INIT ("vanillaboost_sneaker_stackable", "On", CV_NETVAR, CV_OnOff, NULL);
consvar_t cv_kartstacking_invincibility_speedboost = CVAR_INIT ("vanillaboost_invincibility_speedboost", "0.375", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_invincibility_accelboost = CVAR_INIT ("vanillaboost_invincibility_accelboost", "3.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_invincibility_legacyspeedboost = CVAR_INIT ("vanillaboost_invincibility_legacyspeedboost", "0.375", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_invincibility_legacyaccelboost = CVAR_INIT ("vanillaboost_invincibility_legacyaccelboost", "3.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_invincibility_alternatespeedboost = CVAR_INIT ("vanillaboost_invincibility_alternatespeedboost", "0.68", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_invincibility_alternateaccelboost = CVAR_INIT ("vanillaboost_invincibility_alternateaccelboost", "3.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_invincibility_stackable = CVAR_INIT ("vanillaboost_invincibility_stackable", "Off", CV_NETVAR, CV_OnOff, NULL);
consvar_t cv_kartstacking_grow_speedboost = CVAR_INIT ("vanillaboost_grow_speedboost", "0.2", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_grow_accelboost = CVAR_INIT ("vanillaboost_grow_accelboost", "0", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_grow_stackable = CVAR_INIT ("vanillaboost_grow_stackable", "Off", CV_NETVAR, CV_OnOff, NULL);
consvar_t cv_kartstacking_flame_speedval = CVAR_INIT ("vanillaboost_flame_speedval", "0.85", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_flame_accelboost = CVAR_INIT ("vanillaboost_flame_accelboost", "3.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_flame_speedval = CVAR_INIT ("vanillaboost_flame_speedval", "0.90", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_flame_accelboost = CVAR_INIT ("vanillaboost_flame_accelboost", "6.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_flame_stackable = CVAR_INIT ("vanillaboost_flame_stackable", "Off", CV_NETVAR, CV_OnOff, NULL);
consvar_t cv_kartstacking_start_speedboost = CVAR_INIT ("vanillaboost_start_speedboost", "0.25", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
@ -483,7 +488,14 @@ consvar_t cv_kartstacking_drift_stackable = CVAR_INIT ("vanillaboost_drift_stack
consvar_t cv_kartstacking_ring_speedboost = CVAR_INIT ("vanillaboost_ring_speedboost", "0.2", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_ring_accelboost = CVAR_INIT ("vanillaboost_ring_accelboost", "4.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_ring_stackable = CVAR_INIT ("vanillaboost_ring_stackable", "On", CV_NETVAR, CV_OnOff, NULL);
consvar_t cv_kartstacking_ring_stackable = CVAR_INIT ("vanillaboost_ring_stackable", "On", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
consvar_t cv_kartstacking_slope_decay = CVAR_INIT ("vanillaboost_slope_decay", "0.004", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_slope_brakemod = CVAR_INIT ("vanillaboost_slope_brakemod", "0.01", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_slope_speedboost_max = CVAR_INIT ("vanillaboost_slope_speedboost_max", "3.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_slope_speedboost_cap = CVAR_INIT ("vanillaboost_slope_speedboost_cap", "1.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_slope_accelboost = CVAR_INIT ("vanillaboost_slope_accelboost", "3.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartstacking_slope_stackable = CVAR_INIT ("vanillaboost_slope_stackable", "On", CV_NETVAR, CV_OnOff, NULL);
consvar_t cv_kartchaining = CVAR_INIT ("kartchaining", "No", CV_NETVAR|CV_CALL|CV_NOINIT, CV_YesNo, KartChaining_OnChange);
consvar_t cv_kartchainingoffroad = CVAR_INIT ("kartchaining_chainoffroad", "No", CV_NETVAR, CV_YesNo, NULL);
@ -502,6 +514,21 @@ consvar_t cv_kartbumpspring = CVAR_INIT ("kartbumpspring", "No", CV_NETVAR, CV_Y
consvar_t cv_kartslipdash = CVAR_INIT ("kartslipdash", "No", CV_NETVAR|CV_CALL|CV_NOINIT, CV_YesNo, KartSlipdash_OnChange);
consvar_t cv_kartslopeboost = CVAR_INIT ("kartslopeboost", "No", CV_NETVAR|CV_CALL|CV_NOINIT, CV_YesNo, KartSlopeBoost_OnChange);
// Invincibility modifiers
static CV_PossibleValue_t invintype_cons_t[] = {{0, "Legacy"}, {1, "Alternative"}, {0, NULL}};
consvar_t cv_kartinvintype = CVAR_INIT ("kartinvintype", "Legacy", CV_NETVAR|CV_CALL, invintype_cons_t, KartInvinType_OnChange);
// How far the player must be from the cluster to begin frequently rolling Invincibility.
static CV_PossibleValue_t invindist_cons_t[] = {{1, "MIN"}, {32000, "MAX"}, {0, NULL}};
consvar_t cv_kartinvindist = CVAR_INIT ("kartinvindist", "8400", CV_NETVAR|CV_CHEAT, invindist_cons_t, NULL);
consvar_t cv_kartinvindistmul = CVAR_INIT ("kartinvindistmul", "0.54", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartinvin_maxtime = CVAR_INIT ("kartinvin_maxtime", "35.0", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
consvar_t cv_kartinvin_midtime = CVAR_INIT ("kartinvin_midtime", "23.333", CV_NETVAR|CV_CHEAT|CV_FLOAT, CV_Unsigned, NULL);
static CV_PossibleValue_t kartdebugitem_cons_t[] =
{
#define FOREACH( name, n ) { n, #name }
@ -509,9 +536,10 @@ static CV_PossibleValue_t kartdebugitem_cons_t[] =
#undef FOREACH
{0}
};
consvar_t cv_kartdebugitem = CVAR_INIT ("kartdebugitem", "0", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugitem_cons_t, NULL);
consvar_t cv_kartdebugitem = CVAR_INIT ("kartdebugitem", "NONE", CV_NETVAR|CV_CHEAT, kartdebugitem_cons_t, NULL);
static CV_PossibleValue_t kartdebugamount_cons_t[] = {{1, "MIN"}, {255, "MAX"}, {0, NULL}};
consvar_t cv_kartdebugamount = CVAR_INIT ("kartdebugamount", "1", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugamount_cons_t, NULL);
consvar_t cv_kartdebugamount = CVAR_INIT ("kartdebugamount", "1", CV_NETVAR|CV_CHEAT, kartdebugamount_cons_t, NULL);
consvar_t cv_kartdebugshrink = CVAR_INIT ("kartdebugshrink", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
#ifdef DEVELOP
#define VALUE "Yes"
#else
@ -519,24 +547,26 @@ consvar_t cv_kartdebugamount = CVAR_INIT ("kartdebugamount", "1", CV_NETVAR|CV_C
#endif
#undef VALUE
consvar_t cv_kartdebugdistribution = CVAR_INIT ("kartdebugdistribution", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebughuddrop = CVAR_INIT ("kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebugdistribution = CVAR_INIT ("kartdebugdistribution", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
consvar_t cv_kartdebughuddrop = CVAR_INIT ("kartdebughuddrop", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
static CV_PossibleValue_t kartdebugwaypoint_cons_t[] = {{0, "Off"}, {1, "Forwards"}, {2, "Backwards"}, {0, NULL}};
consvar_t cv_kartdebugwaypoints = CVAR_INIT ("kartdebugwaypoints", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugwaypoint_cons_t, NULL);
consvar_t cv_kartdebuglap = CVAR_INIT ("kartdebuglap", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, kartdebugwaypoint_cons_t, NULL);
consvar_t cv_kartdebugbot = CVAR_INIT ("kartdebugbot", "Off", CV_NETVAR|CV_CHEAT|CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebugwaypoints = CVAR_INIT ("kartdebugwaypoints", "Off", CV_NETVAR|CV_CHEAT, kartdebugwaypoint_cons_t, NULL);
consvar_t cv_kartdebuglap = CVAR_INIT ("kartdebuglap", "Off", CV_NETVAR|CV_CHEAT, kartdebugwaypoint_cons_t, NULL);
consvar_t cv_kartdebugbot = CVAR_INIT ("kartdebugbot", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
consvar_t cv_kartdebugcluster = CVAR_INIT ("kartdebugcluster", "Off", CV_NETVAR|CV_CHEAT, CV_OnOff, NULL);
consvar_t cv_kartdebugcheckpoint = CVAR_INIT ("kartdebugcheckpoint", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebugnodes = CVAR_INIT ("kartdebugnodes", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebugcolorize = CVAR_INIT ("kartdebugcolorize", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebugdirector = CVAR_INIT ("kartdebugdirector", "Off", CV_NOSHOWHELP, CV_OnOff, NULL);
consvar_t cv_kartdebugcheckpoint = CVAR_INIT ("kartdebugcheckpoint", "Off", 0, CV_OnOff, NULL);
consvar_t cv_kartdebugnodes = CVAR_INIT ("kartdebugnodes", "Off", 0, CV_OnOff, NULL);
consvar_t cv_kartdebugcolorize = CVAR_INIT ("kartdebugcolorize", "Off", 0, CV_OnOff, NULL);
consvar_t cv_kartdebugdirector = CVAR_INIT ("kartdebugdirector", "Off", 0, CV_OnOff, NULL);
static CV_PossibleValue_t votetime_cons_t[] = {{10, "MIN"}, {3600, "MAX"}, {0, NULL}};
consvar_t cv_votetime = CVAR_INIT ("votetime", "20", CV_NETVAR, votetime_cons_t, NULL);
consvar_t cv_gravity = CVAR_INIT ("gravity", "0.8", CV_RESTRICT|CV_FLOAT|CV_CALL, NULL, Gravity_OnChange); // change DEFAULT_GRAVITY if you change this
consvar_t cv_soundtest = CVAR_INIT ("soundtest", "0", CV_CALL, NULL, SoundTest_OnChange);
static CV_PossibleValue_t soundtest_cons_t[] = {{0, "MIN"}, {NUMSFX, "MAX"}, {0, NULL}};
consvar_t cv_soundtest = CVAR_INIT ("soundtest", "0", CV_CALL, soundtest_cons_t, SoundTest_OnChange);
static CV_PossibleValue_t minitimelimit_cons_t[] = {{15, "MIN"}, {9999, "MAX"}, {0, NULL}};
consvar_t cv_countdowntime = CVAR_INIT ("countdowntime", "30", CV_NETVAR|CV_CHEAT, minitimelimit_cons_t, NULL);
@ -583,7 +613,7 @@ consvar_t cv_maxping = CVAR_INIT ("maxdelay", "20", CV_SAVE, CV_Unsigned, NULL);
consvar_t cv_lagless = CVAR_INIT ("lagless", "On", CV_SAVE|CV_NETVAR|CV_CALL, CV_OnOff, Lagless_OnChange);
static CV_PossibleValue_t pingtimeout_cons_t[] = {{8, "MIN"}, {120, "MAX"}, {0, NULL}};
consvar_t cv_pingtimeout = CVAR_INIT ("maxdelaytimeout", "10", CV_SAVE|CV_NETVAR, pingtimeout_cons_t, NULL);
consvar_t cv_pingtimeout = CVAR_INIT ("maxdelaytimeout", "10", CV_SAVE, pingtimeout_cons_t, NULL);
// show your ping on the HUD next to framerate. Defaults to warning only (shows up if your ping is > maxping)
static CV_PossibleValue_t showping_cons_t[] = {{0, "Off"}, {1, "Always"}, {2, "Warning"}, {0, NULL}};
@ -1005,6 +1035,8 @@ void D_RegisterClientCommands(void)
COM_AddCommand("timedemo", Command_Timedemo_f);
COM_AddCommand("stopdemo", Command_Stopdemo_f);
COM_AddCommand("playintro", Command_Playintro_f);
CV_RegisterVar(&cv_resyncdemo);
CV_RegisterVar(&cv_resetnetvars);
COM_AddCommand("resetcamera", Command_ResetCamera_f);
@ -1169,6 +1201,7 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_renderview);
CV_RegisterVar(&cv_vhseffect);
CV_RegisterVar(&cv_shittyscreen);
CV_RegisterVar(&cv_votebgscaling);
CV_RegisterVar(&cv_renderer);
CV_RegisterVar(&cv_scr_depth);
CV_RegisterVar(&cv_scr_width);
@ -1227,6 +1260,9 @@ void D_RegisterClientCommands(void)
COM_AddCommand("listskins", Command_ListSkins);
CV_RegisterVar(&cv_connectawaittime);
CV_RegisterVar(&cv_serverinfoscreen);
}
/**
@ -1608,7 +1644,7 @@ static void SendNameAndColor(UINT8 n)
const INT32 playernum = g_localplayers[n];
player_t *player = &players[playernum];
char buf[MAXPLAYERNAME+9];
char buf[MAXPLAYERNAME+12];
char *p;
if (splitscreen < n)
@ -1883,7 +1919,11 @@ void WeaponPref_Send(UINT8 ssplayer)
if (cv_flipcam[ssplayer].value)
prefs |= WP_FLIPCAM;
SendNetXCmdForPlayer(ssplayer, XD_WEAPONPREF, &prefs, 1);
UINT8 buf[2];
buf[0] = prefs;
buf[1] = cv_mindelay.value;
SendNetXCmdForPlayer(ssplayer, XD_WEAPONPREF, buf, sizeof buf);
}
void WeaponPref_Save(UINT8 **cp, INT32 playernum)
@ -1934,6 +1974,13 @@ static void Got_WeaponPref(UINT8 **cp,INT32 playernum)
{
WeaponPref_Parse(cp, playernum);
UINT8 mindelay = READUINT8(*cp);
if (server)
{
for (UINT8 i = 0; i < G_LocalSplitscreenPartySize(playernum); ++i)
playerdelaytable[G_LocalSplitscreenPartyMember(playernum, i)] = mindelay;
}
// SEE ALSO g_demo.c
demo_extradata[playernum] |= DXD_WEAPONPREF;
}
@ -2812,11 +2859,11 @@ void D_SetupVote(void)
hellpick = 1;
if (i == 2) // sometimes a different gametype
m = G_RandMap(G_TOLFlag(secondgt), prevmap, ((secondgt != gametype) ? 2 : 0), 0, true, votebuffer);
m = G_RandMap(G_TOLFlag(secondgt), prevmap, ((secondgt != gametype) ? 2 : 0), 0, votebuffer);
else if (i >= VOTEROWS) // unknown-random and formerly force-unknown MAP HELL
m = G_RandMap(G_TOLFlag(gt), prevmap, 0, hellpick, (i < VOTEROWSADDSONE), votebuffer);
m = G_RandMap(G_TOLFlag(gt), prevmap, 0, hellpick, votebuffer);
else
m = G_RandMap(G_TOLFlag(gt), prevmap, 0, 0, true, votebuffer);
m = G_RandMap(G_TOLFlag(gt), prevmap, 0, 0, votebuffer);
if (i < VOTEROWS)
votebuffer[min(i, 2)] = m; // min() is a dumb workaround for gcc 4.4 array-bounds error
WRITEUINT16(p, m);
@ -3136,6 +3183,7 @@ static void Command_Map_f(void)
if (option_skill)
{
const char *masterstr = "Master";
const char *nightmarestr = "NIGHTMARE";
const char *skillname = COM_Argv(option_skill + 1);
INT32 newskill = -1;
INT32 j;
@ -3144,6 +3192,10 @@ static void Command_Map_f(void)
{
newskill = KARTGP_MASTER;
}
else if (!strcasecmp(nightmarestr, skillname))
{
newskill = KARTGP_NIGHTMARE;
}
else
{
for (j = 0; kartspeed_cons_t[j].strvalue; j++)
@ -3158,7 +3210,7 @@ static void Command_Map_f(void)
if (!kartspeed_cons_t[j].strvalue) // reached end of the list with no match
{
INT32 num = atoi(COM_Argv(option_skill + 1)); // assume they gave us a skill number, which is okay too
if (num >= KARTSPEED_EASY && num <= KARTGP_MASTER)
if (num >= KARTSPEED_EASY && num <= KARTGP_NIGHTMARE)
newskill = (INT16)num;
}
}
@ -3170,6 +3222,11 @@ static void Command_Map_f(void)
grandprixinfo.gamespeed = KARTSPEED_HARD;
grandprixinfo.masterbots = true;
}
else if (newskill == KARTGP_NIGHTMARE)
{
grandprixinfo.gamespeed = KARTSPEED_EXPERT;
grandprixinfo.masterbots = true;
}
else
{
grandprixinfo.gamespeed = newskill;
@ -3341,7 +3398,7 @@ static void Command_RandomMap(void)
oldmapnum = -1;
}
newmapnum = G_RandMap(G_TOLFlag(newgametype), oldmapnum, 0, 0, false, NULL) + 1;
newmapnum = G_RandMap(G_TOLFlag(newgametype), oldmapnum, 0, 0, NULL) + 1;
D_MapChange(newmapnum, newgametype, newencoremode, newresetplayers, 0, false, false);
}
@ -3386,7 +3443,7 @@ static void Command_Pause(void)
}
else if (modeattacking) // in time attack, pausing restarts the map
{
M_ModeAttackRetry(0); // directly call from m_menu;
MR_ModeAttackRetry(0); // directly call from m_menu;
return;
}
@ -6107,7 +6164,17 @@ static void Command_Cheats_f(void)
if (CV_CheatsEnabled())
{
consvar_t *cvar;
CONS_Printf(M_GetText("At least one CHEAT-marked variable has been changed -- Cheats are enabled.\n"));
for (cvar = consvar_vars; cvar; cvar = cvar->next)
{
if ((cvar->flags & CV_CHEAT) && strcmp(cvar->defaultvalue, cvar->string))
{
CONS_Printf("%s: Default Value: %s Current Value:%s\n", cvar->name, cvar->defaultvalue, cvar->string);
}
}
if (server || (IsPlayerAdmin(consoleplayer)))
CONS_Printf(M_GetText("Type CHEATS OFF to reset all cheat variables to default.\n"));
}
@ -7030,7 +7097,7 @@ static void KartFrantic_OnChange(void)
static void KartSpeed_OnChange(void)
{
if (!M_SecretUnlocked(SECRET_HARDSPEED) && cv_kartspeed.value == KARTSPEED_HARD)
if (!M_SecretUnlocked(SECRET_HARDSPEED) && (cv_kartspeed.value == KARTSPEED_HARD || cv_kartspeed.value == KARTSPEED_EXPERT))
{
CONS_Printf(M_GetText("You haven't earned this yet.\n"));
CV_StealthSet(&cv_kartspeed, cv_kartspeed.defaultvalue);
@ -7055,7 +7122,7 @@ static void KartSpeed_OnChange(void)
static void KartBattleSpeed_OnChange(void)
{
if (!M_SecretUnlocked(SECRET_HARDSPEED) && cv_kartbattlespeed.value == KARTSPEED_HARD)
if (!M_SecretUnlocked(SECRET_HARDSPEED) && ((cv_kartbattlespeed.value == KARTSPEED_HARD) || (cv_kartbattlespeed.value == KARTSPEED_EXPERT)))
{
CONS_Printf(M_GetText("You haven't earned this yet.\n"));
CV_StealthSet(&cv_kartspeed, cv_kartspeed.defaultvalue);
@ -7265,6 +7332,39 @@ static void KartSlipdash_OnChange(void)
}
}
static void KartSlopeBoost_OnChange(void)
{
if (K_CanChangeRules() == false)
{
return;
}
if (!K_SlopeBoostActive() && cv_kartslopeboost.value)
{
if (leveltime < starttime)
{
slopeboostactive = true;
CONS_Printf(M_GetText("Slopeboost has been turned \"On\".\n"));
}
else
{
CONS_Printf(M_GetText("Slopeboost will be turned \"On\" Next Round.\n"));
}
}
else if (K_SlopeBoostActive() && !cv_kartslopeboost.value)
{
if (leveltime < starttime)
{
slopeboostactive = false;
CONS_Printf(M_GetText("Slopeboost has been turned \"Off\".\n"));
}
else
{
CONS_Printf(M_GetText("Slopeboost will be turned \"Off\" next round.\n"));
}
}
}
static void KartItemBreaker_OnChange(void)
{
if (K_CanChangeRules() == false)
@ -7287,6 +7387,24 @@ static void KartItemBreaker_OnChange(void)
}
}
static void KartInvinType_OnChange(void)
{
if (K_CanChangeRules() == false)
{
return;
}
if (leveltime < starttime)
{
CONS_Printf(M_GetText("Invincibility type has been changed to \"%s\".\n"), cv_kartinvintype.string);
invintype = (UINT8)cv_kartinvintype.value;
}
else
{
CONS_Printf(M_GetText("Invincibility type will be changed to \"%s\" next round.\n"), cv_kartinvintype.string);
}
}
static void Schedule_OnChange(void)
{
size_t i;

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -133,12 +133,15 @@ extern consvar_t cv_kartstacking_accelstack;
extern consvar_t cv_kartstacking_sneaker_easyspeedboost;
extern consvar_t cv_kartstacking_sneaker_normalspeedboost;
extern consvar_t cv_kartstacking_sneaker_hardspeedboost;
extern consvar_t cv_kartstacking_sneaker_expertspeedboost;
extern consvar_t cv_kartstacking_sneaker_accelboost;
extern consvar_t cv_kartstacking_sneaker_maxgrade;
extern consvar_t cv_kartstacking_sneaker_stackable;
extern consvar_t cv_kartstacking_invincibility_speedboost;
extern consvar_t cv_kartstacking_invincibility_accelboost;
extern consvar_t cv_kartstacking_invincibility_legacyspeedboost;
extern consvar_t cv_kartstacking_invincibility_legacyaccelboost;
extern consvar_t cv_kartstacking_invincibility_alternatespeedboost;
extern consvar_t cv_kartstacking_invincibility_alternateaccelboost;
extern consvar_t cv_kartstacking_invincibility_stackable;
extern consvar_t cv_kartstacking_flame_speedval;
@ -161,6 +164,13 @@ extern consvar_t cv_kartstacking_ring_speedboost;
extern consvar_t cv_kartstacking_ring_accelboost;
extern consvar_t cv_kartstacking_ring_stackable;
extern consvar_t cv_kartstacking_slope_decay;
extern consvar_t cv_kartstacking_slope_brakemod;
extern consvar_t cv_kartstacking_slope_speedboost_max;
extern consvar_t cv_kartstacking_slope_speedboost_cap;
extern consvar_t cv_kartstacking_slope_accelboost;
extern consvar_t cv_kartstacking_slope_stackable;
extern consvar_t cv_kartchaining;
extern consvar_t cv_kartchainingoffroad;
@ -170,14 +180,21 @@ extern consvar_t cv_kartpurpledrift;
extern consvar_t cv_kartbumpspark;
extern consvar_t cv_kartbumpspring;
extern consvar_t cv_kartslipdash;
extern consvar_t cv_kartslopeboost;
extern consvar_t cv_kartinvintype;
extern consvar_t cv_kartinvindist;
extern consvar_t cv_kartinvindistmul;
extern consvar_t cv_kartinvin_maxtime;
extern consvar_t cv_kartinvin_midtime;
extern consvar_t cv_encorevotes;
extern consvar_t cv_votetime;
extern consvar_t cv_kartdebugitem, cv_kartdebugamount, cv_kartdebugdistribution, cv_kartdebughuddrop;
extern consvar_t cv_kartdebugshrink;
extern consvar_t cv_kartdebugcheckpoint, cv_kartdebugnodes, cv_kartdebugcolorize, cv_kartdebugdirector;
extern consvar_t cv_kartdebugwaypoints, cv_kartdebuglap, cv_kartdebugbot;
extern consvar_t cv_kartdebugwaypoints, cv_kartdebuglap, cv_kartdebugbot, cv_kartdebugcluster;
extern consvar_t cv_itemfinder;

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -110,6 +110,8 @@ typedef enum
PF_SHRINKME = 1<<25, // "Shrink me" cheat preference
PF_SHRINKACTIVE = 1<<26, // "Shrink me" cheat is in effect. (Can't be disabled mid-race)
PF_JUSTFLIPPED = 1<<27, // Just got flipped over, handle the bump interaction.
// up to 1<<29 is free
PF_ATTACKDOWN = 1<<30, // For lua compat, don't use!
PF_SLIDING = 1<<31, // For lua compat, don't use!
@ -605,6 +607,7 @@ struct player_t
UINT8 positiondelay; // Used for position number, so it can grow when passing/being passed
UINT32 distancetofinish;
UINT32 distancetofinishprev;
UINT32 distancefromcluster;
waypoint_t *currentwaypoint;
waypoint_t *nextwaypoint;
UINT16 bigwaypointgap;
@ -619,12 +622,17 @@ struct player_t
UINT16 flashing;
UINT16 spinouttimer; // Spin-out from a banana peel or oil slick (was "pw_bananacam")
UINT8 spinouttype; // Determines the mode of spinout/wipeout, see kartspinoutflags_t
UINT16 flipovertimer; // Flipped over by a player using Invincibility.
angle_t flipoverangle; // Movement angle for a flipped-over player.
UINT8 instashield; // Instashield no-damage animation timer
UINT8 wipeoutslow; // Timer before you slowdown when getting wiped out
UINT8 justbumped; // Prevent players from endlessly bumping into each other
boolean noclip; // Fix Grow breaking the "noclip" cheat. Also applies noclip as a bonus.
SINT8 drift; // (-5 to 5) - Drifting Left or Right, plus a bigger counter = sharper turn
SINT8 driftlock; // Prevents you from using drift angle for x tics. Used for zipper fix.
fixed_t driftcharge; // Charge your drift so you can release a burst of speed
UINT8 driftboost; // (0 to 125) - Boost you get from drifting
tic_t driftsparkGrowTimer;
@ -675,6 +683,7 @@ struct player_t
UINT8 pickuprings; // Number of rings being picked up before added to the counter (prevents rings from being deleted forever over 20)
UINT8 ringdelay; // (0 to 3) - 3 tic delay between every ring usage
UINT16 ringboost; // Ring boost timer
UINT16 ringtime; // The current Ring boost timer if it wasn't capped. Used for spam prevention measures.
UINT16 superring; // Spawn rings on top of you every tic!
UINT8 nextringaward; // When should we spawn our next superring ring?
UINT8 ringvolume; // When consuming lots of rings, lower the sound a little.
@ -698,12 +707,21 @@ struct player_t
UINT16 chaintimer; // Stores current chain timer length.
UINT8 boostcharge; // Charge during race start
fixed_t slopeboost; // Handle slopeboost speed
fixed_t prevslopeboost; // Last frame slopeboost speed
fixed_t slopeaccel; // Handle slopeboost accel
INT16 growshrinktimer; // > 0 = Big, < 0 = small
INT16 growcancel; // Duration of grow canceling
INT16 squishedtimer; // Duration of being squished
UINT16 rocketsneakertimer; // Rocket Sneaker duration timer
UINT16 invincibilitytimer; // Invincibility timer
INT16 growshrinktimer; // > 0 = Big, < 0 = small
INT16 growcancel; // Duration of grow canceling
INT16 squishedtimer; // Duration of being squished
UINT16 rocketsneakertimer; // Rocket Sneaker duration timer
UINT16 invincibilitytimer; // Invincibility timer
UINT16 maxinvincibilitytime; // (Alternate) Initial time for Invincibility, used for the item bar.
UINT16 invincibilitybottleneck; // (Alternate) Prevents breakaways by gradienting towards a heavier decrement.
INT16 invincibilitycancel; // (Alternate) Duration of Invincibility canceling.
UINT8 eggmanexplode; // Fake item recieved, explode in a few seconds
SINT8 eggmanblame; // (-1 to 15) - Fake item recieved, who set this fake

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -21,7 +21,7 @@
extern "C" {
#endif
#define MAXPREDICTTICS 30
#define MAXPREDICTTICS 12
// Button/action code definitions.
typedef enum

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -190,200 +190,6 @@ void clear_levels(void)
COM_BufAddText("exitgame"); // Command_ExitGame_f() but delayed
}
static boolean findFreeSlot(INT32 *num)
{
// Send the character select entry to a free slot.
while (*num < MAXSKINS && (description[*num].used))
*num = *num+1;
// No more free slots. :(
if (*num >= MAXSKINS)
return false;
// Redesign your logo. (See M_DrawSetupChoosePlayerMenu in m_menu.c...)
description[*num].picname[0] = '\0';
description[*num].nametag[0] = '\0';
description[*num].displayname[0] = '\0';
description[*num].oppositecolor = SKINCOLOR_NONE;
description[*num].tagtextcolor = SKINCOLOR_NONE;
description[*num].tagoutlinecolor = SKINCOLOR_NONE;
// Found one! ^_^
return (description[*num].used = true);
}
// Reads a player.
// For modifying the character select screen
void readPlayer(MYFILE *f, INT32 num)
{
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
char *word;
char *word2;
char *displayname = ZZ_Alloc(MAXLINELEN+1);
INT32 i;
boolean slotfound = false;
#define SLOTFOUND \
if (!slotfound && (slotfound = findFreeSlot(&num)) == false) \
goto done;
displayname[MAXLINELEN] = '\0';
do
{
if (myfgets(s, MAXLINELEN, f))
{
if (s[0] == '\n')
break;
for (i = 0; i < MAXLINELEN-3; i++)
{
char *tmp;
if (s[i] == '=')
{
tmp = &s[i+2];
strncpy(displayname, tmp, SKINNAMESIZE);
break;
}
}
word = strtok(s, " ");
if (word)
strupr(word);
else
break;
if (fastcmp(word, "PLAYERTEXT"))
{
char *playertext = NULL;
SLOTFOUND
for (i = 0; i < MAXLINELEN-3; i++)
{
if (s[i] == '=')
{
playertext = &s[i+2];
break;
}
}
if (playertext)
{
strcpy(description[num].notes, playertext);
strcat(description[num].notes, myhashfgets(playertext, sizeof (description[num].notes), f));
}
else
strcpy(description[num].notes, "");
// For some reason, cutting the string did not work above. Most likely due to strcpy or strcat...
// It works down here, though.
{
INT32 numline = 0;
for (i = 0; (size_t)i < sizeof(description[num].notes)-1; i++)
{
if (numline < 20 && description[num].notes[i] == '\n')
numline++;
if (numline >= 20 || description[num].notes[i] == '\0' || description[num].notes[i] == '#')
break;
}
}
description[num].notes[strlen(description[num].notes)-1] = '\0';
description[num].notes[i] = '\0';
continue;
}
word2 = strtok(NULL, " = ");
if (word2)
strupr(word2);
else
break;
if (word2[strlen(word2)-1] == '\n')
word2[strlen(word2)-1] = '\0';
i = atoi(word2);
if (fastcmp(word, "PICNAME"))
{
SLOTFOUND
strncpy(description[num].picname, word2, 8);
}
// new character select
else if (fastcmp(word, "DISPLAYNAME"))
{
SLOTFOUND
// replace '#' with line breaks
// (also remove any '\n')
{
char *cur = NULL;
// remove '\n'
cur = strchr(displayname, '\n');
if (cur)
*cur = '\0';
// turn '#' into '\n'
cur = strchr(displayname, '#');
while (cur)
{
*cur = '\n';
cur = strchr(cur, '#');
}
}
// copy final string
strncpy(description[num].displayname, displayname, SKINNAMESIZE);
}
else if (fastcmp(word, "OPPOSITECOLOR") || fastcmp(word, "OPPOSITECOLOUR"))
{
SLOTFOUND
description[num].oppositecolor = (UINT16)get_number(word2);
}
else if (fastcmp(word, "NAMETAG") || fastcmp(word, "TAGNAME"))
{
SLOTFOUND
strncpy(description[num].nametag, word2, 8);
}
else if (fastcmp(word, "TAGTEXTCOLOR") || fastcmp(word, "TAGTEXTCOLOUR"))
{
SLOTFOUND
description[num].tagtextcolor = (UINT16)get_number(word2);
}
else if (fastcmp(word, "TAGOUTLINECOLOR") || fastcmp(word, "TAGOUTLINECOLOUR"))
{
SLOTFOUND
description[num].tagoutlinecolor = (UINT16)get_number(word2);
}
else if (fastcmp(word, "STATUS"))
{
/*
You MAY disable previous entries if you so desire...
But try to enable something that's already enabled and you will be sent to a free slot.
Because of this, you are allowed to edit any previous entries you like, but only if you
signal that you are purposely doing so by disabling and then reenabling the slot.
*/
if (i && !slotfound && (slotfound = findFreeSlot(&num)) == false)
goto done;
description[num].used = (!!i);
}
else if (fastcmp(word, "SKINNAME"))
{
// Send to free slot.
SLOTFOUND
strlcpy(description[num].skinname, word2, sizeof description[num].skinname);
strlwr(description[num].skinname);
}
else
deh_warning("readPlayer %d: unknown word '%s'", num, word);
}
} while (!myfeof(f)); // finish when the line is empty
#undef SLOTFOUND
done:
Z_Free(displayname);
Z_Free(s);
}
// TODO: Figure out how to do undolines for this....
// TODO: Warnings for running out of freeslots
void readfreeslots(MYFILE *f)
@ -1280,8 +1086,13 @@ void readlevelheader(MYFILE *f, char * name)
deh_strlcpy(mapheaderinfo[num]->skytexture, word2,
sizeof(mapheaderinfo[num]->skytexture), va("Level header %d: sky texture", num));
else if (fastcmp(word, "SKYNUM"))
deh_strlcpy(mapheaderinfo[num]->skytexture, va("SKY%s", word2),
{
char namebuf[9];
sprintf(namebuf, "SKY%.5s", word2);
deh_strlcpy(mapheaderinfo[num]->skytexture, namebuf,
sizeof(mapheaderinfo[num]->skytexture), va("Level header %d: sky texture", num));
}
else if (fastcmp(word, "PRECUTSCENENUM"))
mapheaderinfo[num]->precutscenenum = (UINT8)i;
else if (fastcmp(word, "CUTSCENENUM"))
@ -2038,8 +1849,6 @@ static struct { const char *name; consvar_t *var; } HIDDENVARS[] = {
{ "DUMMYGPCUP", &cv_dummygpcup },
{ "NEXTMAP", &cv_nextmap },
{ "NEWGAMETYPE", &cv_newgametype },
{ "DUMMYRINGS", &cv_dummyrings },
{ "DUMMYLIVES", &cv_dummylives },
{ "DUMMYMENUPLAYER", &cv_dummymenuplayer },
{ "DUMMYTEAM", &cv_dummyteam },
{ "DUMMYSPECTATE", &cv_dummyspectate },
@ -2049,11 +1858,57 @@ static struct { const char *name; consvar_t *var; } HIDDENVARS[] = {
{ "DUMMYATTACKINGCHAINING", &cv_dummyattackingchaining },
{ "DUMMYATTACKINGSLIPDASH", &cv_dummyattackingslipdash },
{ "DUMMYATTACKINGPURPLEDRIFT", &cv_dummyattackingpurpledrift },
{ "DUMMYATTACKINGSLOPEBOOST", &cv_dummyattackingslopeboost },
{ "DUMMYSTAFF", &cv_dummystaff },
{ "DUMMYMULTIPLAYER", &cv_dummymultiplayer },
{ "DUMMYIP", &cv_dummyip },
{ "DUMMYNAME", &cv_dummyname },
{ "DUMMYFOLLOWER", &cv_dummyfollower },
{ "DUMMYCOLOR", &cv_dummycolor },
{ "DUMMYSERVERPAGE", &cv_dummyserverpage },
{ NULL, NULL }
};
#define WARN(str, ...) deh_warning("MenuItem " ITEMNAMEFMT ": " str, menuitem->itemname, __VA_ARGS__)
#define WARN0(str) deh_warning("MenuItem " ITEMNAMEFMT ": " str, menuitem->itemname)
// parses an item style in the form of "<font>-SMALL-<align>-<highlight>-STICKER"
// each component is optional, and the style cannot be written in arbitrary order
// returns IT_HIDDEN if style is invalid
static menuitemflags_t parsestyle(const char *p)
{
menuitemflags_t style = 0;
// yeah yeah, macro hell, but it's more economical than 100 entries in a table
#define STYLE(string, flag) \
(!strncmp(p, string, sizeof(string)-1)) { \
style |= flag; \
p += sizeof(string)-1; \
if (*p == '\0') return style; \
if (*p++ != '-') return IT_HIDDEN; \
}
if STYLE("THIN2", ITF_THIN2)
else if STYLE("THIN", ITF_THIN)
else if STYLE("HEADER", ITF_HEADER|ITH_HIGHLIGHT)
else if STYLE("PATCH", ITF_PATCH)
else if STYLE("MAPTHUMBNAIL", ITF_THUMBNAIL)
else if STYLE("FILL", ITF_FILL)
if STYLE("SMALL", IT_SMALL)
if STYLE("CENTER", IT_CENTER)
else if STYLE("RIGHT", IT_RIGHT)
if STYLE("HIGHLIGHT", ITH_HIGHLIGHT)
else if STYLE("RECOMMENDEDHIGHLIGHT", ITH_RECOMMEND)
else if STYLE("WARNINGHIGHLIGHT", ITH_WARNING)
if STYLE("STICKER", IT_STICKER)
return IT_HIDDEN;
#undef STYLE
}
#define WARN(str, ...) deh_warning("MenuItem %s: " str, strbuf_get(menunames, menuitem->info.nameofs), __VA_ARGS__)
#define WARN0(str) deh_warning("MenuItem %s: " str, strbuf_get(menunames, menuitem->info.nameofs))
static void readmenuitem(MYFILE *f, menuitem_t *menuitem)
{
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
@ -2061,9 +1916,7 @@ static void readmenuitem(MYFILE *f, menuitem_t *menuitem)
char *word2;
char *tmp;
UINT16 status = 0;
boolean actionset = false;
boolean textset = false;
menuitemflags_t status = 0;
// taking quite possibly the only opportunity i'll ever get
// to avoid three tabs of indentation...
@ -2095,58 +1948,71 @@ static void readmenuitem(MYFILE *f, menuitem_t *menuitem)
word2 = tmp += 2;
//strupr(word2);
if (fastcmp(word, "PATCH"))
if (fastcmp(word, "X"))
{
menuitem->patch = Z_StrDup(word2);
menuitem->x = get_number(word2);
}
else if (fastncmp(word, "TEXT", 4))
else if (fastcmp(word, "OFSX"))
{
UINT16 flags = IT_STRING;
if (fastcmp(word+4, "HEADER"))
flags = IT_HEADER;
else if (fastcmp(word+4, "SECRET"))
flags = IT_SECRET;
else if (fastcmp(word+4, "WHITE"))
flags = IT_WHITESTRING;
else if (fastcmp(word+4, "DISABLED"))
flags = IT_DISABLED;
else if (fastcmp(word+4, "2"))
flags = IT_STRING2;
else if (word[4])
{
WARN("unknown word '%s'", word);
continue;
}
if (textset)
{
WARN0("text already set!");
continue;
}
textset = true;
status |= flags;
menuitem->x = get_number(word2);
status |= IT_OFSX;
}
else if (fastcmp(word, "Y"))
{
menuitem->y = get_number(word2);
}
else if (fastcmp(word, "OFSY"))
{
menuitem->y = get_number(word2);
status |= IT_OFSY;
}
else if (fastcmp(word, "OVERLAY"))
{
status |= IT_OVERLAY;
}
else if (fastcmp(word, "TEMPOFFSET"))
{
status |= IT_TEMPORARY;
}
else if (fastcmp(word, "ARGUMENT"))
{
menuitem->argument = get_number(word2);
}
else if (fastcmp(word, "TEXT"))
{
if (menuitem->text)
Z_Free(menuitem->text);
menuitem->text = Z_StrDup(word2);
}
else if (fastncmp(word, "CVAR", 4))
else if (fastcmp(word, "PATCH"))
{
UINT16 flags = IT_CVAR;
if (fastcmp(word+4, "SLIDER"))
flags |= IT_CV_SLIDER;
else if (fastcmp(word+4, "STRING"))
flags |= IT_CV_STRING;
else if (fastcmp(word+4, "INTEGER"))
flags |= IT_CV_INTEGERSTEP;
else if (word[4])
if (menuitem->patch)
Z_Free(menuitem->patch);
menuitem->patch = Z_StrDup(word2);
}
else if (fastcmp(word, "TOOLTIP"))
{
if (menuitem->tooltip)
Z_Free(menuitem->tooltip);
menuitem->tooltip = Z_StrDup(word2);
}
else if (fastcmp(word, "STYLE"))
{
menuitemflags_t style = 0;
if (status & IT_STYLE)
{
WARN("unknown word '%s'", word);
continue;
}
if (actionset)
{
WARN0("action already set!");
WARN0("style already set!");
continue;
}
strupr(word2);
style = parsestyle(word2);
if (style == IT_HIDDEN)
WARN("unknown style '%s'", word2);
else
status |= style;
}
else if (fastcmp(word, "CVAR") || fastcmp(word, "SLIDER"))
{
consvar_t *cvar = CV_FindVar(word2);
if (!cvar)
for (size_t i = 0; HIDDENVARS[i].name; i++)
@ -2160,79 +2026,49 @@ static void readmenuitem(MYFILE *f, menuitem_t *menuitem)
WARN("unable to find cvar '%s'", word2);
continue;
}
actionset = true;
status |= flags;
menuitem->itemaction.cvar = cvar;
status |= IT_INTERACT;
if (word[0] == 'S')
status |= IT_SLIDER;
menuitem->cvar = cvar;
}
else if (fastcmp(word, "SUBMENU"))
{
if (actionset)
{
WARN0("action already set!");
continue;
}
menutype_t mn = get_menutype(word2);
if (mn == MAXMENUTYPES)
{
WARN("unknown menu '%s'", word2);
continue;
}
actionset = true;
status |= IT_SUBMENU;
menuitem->itemaction.submenu = mn;
status |= IT_INTERACT;
menuitem->submenu = mn;
}
else if (fastncmp(word, "CALL", 4) || fastcmp(word, "KEYHANDLER") || fastcmp(word, "ARROWS"))
else if (fastcmp(word, "CALL") || fastcmp(word, "ARROWS"))
{
UINT16 flags;
if (word[0] == 'C')
{
flags = IT_CALL;
if (fastcmp(word+4, "NOTMODIFIED"))
flags |= IT_CALL_NOTMODIFIED;
else if (word[4])
{
WARN("unknown word '%s'", word);
continue;
}
}
else if (word[0] == 'K')
flags = IT_KEYHANDLER;
else if (word[0] == 'A')
flags = IT_ARROWS;
else
I_Error("bruh"); // i should probably just make "CALL" the stem for all of these
if (actionset)
{
WARN0("action already set!");
continue;
}
void (*routine)(INT32) = get_menuroutine(word2);
menufunc_f *routine = get_menuroutine(word2);
if (!routine)
{
WARN("unknown call routine '%s'", word2);
continue;
}
actionset = true;
status |= flags;
menuitem->itemaction.routine = routine;
}
else if (fastcmp(word, "ALPHAKEY") || fastcmp(word, "Y"))
{
menuitem->alphaKey = get_number(word2);
status |= IT_INTERACT;
if (word[0] == 'A')
status |= IT_ARROWS;
menuitem->routine = routine;
}
else
WARN("unknown word '%s'", word);
}
while (!myfeof(f)); // finish when the line is empty
menuitem->status = status;
if (status)
menuitem->status = status;
Z_Free(s);
}
#undef WARN
#undef WARN0
#define WARN(str, ...) deh_warning("Menu %s: " str, DEH_MenutypeName(num), __VA_ARGS__)
#define WARN0(str) deh_warning("Menu %s: " str, DEH_MenutypeName(num))
void readmenu(MYFILE *f, INT32 num)
{
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
@ -2269,30 +2105,23 @@ void readmenu(MYFILE *f, INT32 num)
{
// ...or get the word after the space. yay special syntax!
word2 = strchr(s, ' ');
if (word2)
if (!word2 || *word2 == '\0' || word2[1] == ' ') // trailing space(s) after MenuItem doesn't count
{
*word2++ = '\0';
if (*word2 == '\0' || *word2 == ' ') // trailing space(s) after MenuItem doesn't count
word2 = NULL;
else
strupr(word2);
WARN0("missing name for menuitem");
continue;
}
*word2++ = '\0';
strupr(word2);
strupr(word);
if (fastcmp(word, "MENUITEM"))
{
if (word2 && strlen(word2) > ITEMNAMELEN)
{
WARN("item name %s is too long (max %d characters)", word2, ITEMNAMELEN);
continue;
}
menuitem_t *item = word2 ? M_CheckMenuItem(num, word2) : NULL;
menuitem_t *item = M_CheckMenuItem(num, word2);
if (item == NULL)
{
menudef->menuitems = Z_Realloc(menudef->menuitems, sizeof(menuitem_t)*(menudef->numitems+1), PU_STATIC, NULL);
item = menudef->menuitems + menudef->numitems++;
strncpy(item->itemname, word2 ? word2 : "", ITEMNAMELEN);
item->text = "";
DEH_Link(word2, &item->info, &menunames);
}
readmenuitem(f, item);
}
@ -2310,152 +2139,154 @@ void readmenu(MYFILE *f, INT32 num)
if (fastcmp(word, "BACKGROUNDNAME"))
{
strncpy(menupres[num].bgname, word2, 8);
strncpy(menudefs[num].bgname, word2, 8);
titlechanged = true;
}
else if (fastcmp(word, "HIDEBACKGROUND"))
{
menupres[num].bghide = (boolean)(value || word2[0] == 'T' || word2[0] == 'Y');
menudefs[num].bghide = (boolean)(value || word2[0] == 'T' || word2[0] == 'Y');
titlechanged = true;
}
else if (fastcmp(word, "BACKGROUNDCOLOR"))
{
menupres[num].bgcolor = get_number(word2);
menudefs[num].bgcolor = get_number(word2);
titlechanged = true;
}
else if (fastcmp(word, "HIDETITLEPICS") || fastcmp(word, "HIDEPICS") || fastcmp(word, "TITLEPICSHIDE"))
{
// true by default, except MM_MAIN
menupres[num].hidetitlepics = (boolean)(value || word2[0] == 'T' || word2[0] == 'Y');
menudefs[num].hidetitlepics = (boolean)(value || word2[0] == 'T' || word2[0] == 'Y');
titlechanged = true;
}
else if (fastcmp(word, "TITLEPICSMODE"))
{
if (fastcmp(word2, "USER"))
menupres[num].ttmode = TTMODE_USER;
menudefs[num].ttmode = TTMODE_USER;
else if (fastcmp(word2, "HIDE") || fastcmp(word2, "HIDDEN") || fastcmp(word2, "NONE"))
{
menupres[num].ttmode = TTMODE_USER;
menupres[num].ttname[0] = 0;
menupres[num].hidetitlepics = true;
menudefs[num].ttmode = TTMODE_USER;
menudefs[num].ttname[0] = 0;
menudefs[num].hidetitlepics = true;
}
else if (fastcmp(word2, "KART"))
menupres[num].ttmode = TTMODE_KART;
menudefs[num].ttmode = TTMODE_KART;
titlechanged = true;
}
else if (fastcmp(word, "TITLEPICSSCALE"))
{
// Don't handle Alacroix special case here; see Maincfg section.
menupres[num].ttscale = max(1, min(8, (UINT8)get_number(word2)));
menudefs[num].ttscale = max(1, min(8, (UINT8)get_number(word2)));
titlechanged = true;
}
else if (fastcmp(word, "TITLEPICSNAME"))
{
strncpy(menupres[num].ttname, word2, 9);
strncpy(menudefs[num].ttname, word2, 9);
titlechanged = true;
}
else if (fastcmp(word, "TITLEPICSX"))
{
menupres[num].ttx = (INT16)get_number(word2);
menudefs[num].ttx = (INT16)get_number(word2);
titlechanged = true;
}
else if (fastcmp(word, "TITLEPICSY"))
{
menupres[num].tty = (INT16)get_number(word2);
menudefs[num].tty = (INT16)get_number(word2);
titlechanged = true;
}
else if (fastcmp(word, "TITLEPICSLOOP"))
{
menupres[num].ttloop = (INT16)get_number(word2);
menudefs[num].ttloop = (INT16)get_number(word2);
titlechanged = true;
}
else if (fastcmp(word, "TITLEPICSTICS"))
{
menupres[num].tttics = (UINT16)get_number(word2);
menudefs[num].tttics = (UINT16)get_number(word2);
titlechanged = true;
}
else if (fastcmp(word, "TITLESCROLLSPEED") || fastcmp(word, "TITLESCROLLXSPEED")
|| fastcmp(word, "SCROLLSPEED") || fastcmp(word, "SCROLLXSPEED"))
{
menupres[num].titlescrollxspeed = get_number(word2);
menudefs[num].titlescrollxspeed = get_number(word2);
titlechanged = true;
}
else if (fastcmp(word, "TITLESCROLLYSPEED") || fastcmp(word, "SCROLLYSPEED"))
{
menupres[num].titlescrollyspeed = get_number(word2);
menudefs[num].titlescrollyspeed = get_number(word2);
titlechanged = true;
}
else if (fastcmp(word, "MUSIC"))
{
strncpy(menupres[num].musname, word2, 7);
menupres[num].musname[6] = 0;
strncpy(menudefs[num].musname, word2, 7);
menudefs[num].musname[6] = 0;
titlechanged = true;
}
else if (fastcmp(word, "MUSICTRACK"))
{
menupres[num].mustrack = ((UINT16)value - 1);
menudefs[num].mustrack = ((UINT16)value - 1);
titlechanged = true;
}
else if (fastcmp(word, "MUSICLOOP"))
{
// true by default except MM_MAIN
menupres[num].muslooping = (value || word2[0] == 'T' || word2[0] == 'Y');
menudefs[num].muslooping = (value || word2[0] == 'T' || word2[0] == 'Y');
titlechanged = true;
}
else if (fastcmp(word, "NOMUSIC"))
{
menupres[num].musstop = (value || word2[0] == 'T' || word2[0] == 'Y');
menudefs[num].musstop = (value || word2[0] == 'T' || word2[0] == 'Y');
titlechanged = true;
}
else if (fastcmp(word, "IGNOREMUSIC"))
{
menupres[num].musignore = (value || word2[0] == 'T' || word2[0] == 'Y');
menudefs[num].musignore = (value || word2[0] == 'T' || word2[0] == 'Y');
titlechanged = true;
}
else if (fastcmp(word, "FADESTRENGTH"))
{
// one-based, <= 0 means use default value. 1-32
menupres[num].fadestrength = get_number(word2)-1;
menudefs[num].fadestrength = (get_number(word2) - 1) % 32;
titlechanged = true;
}
else if (fastcmp(word, "NOENTERBUBBLE"))
{
menupres[num].enterbubble = !(value || word2[0] == 'T' || word2[0] == 'Y');
menudefs[num].enterbubble = !(value || word2[0] == 'T' || word2[0] == 'Y');
titlechanged = true;
}
else if (fastcmp(word, "NOEXITBUBBLE"))
{
menupres[num].exitbubble = !(value || word2[0] == 'T' || word2[0] == 'Y');
menudefs[num].exitbubble = !(value || word2[0] == 'T' || word2[0] == 'Y');
titlechanged = true;
}
else if (fastcmp(word, "ENTERTAG"))
{
menupres[num].entertag = get_number(word2);
menudefs[num].entertag = get_number(word2);
titlechanged = true;
}
else if (fastcmp(word, "EXITTAG"))
{
menupres[num].exittag = get_number(word2);
menudefs[num].exittag = get_number(word2);
titlechanged = true;
}
else if (fastcmp(word, "ENTERWIPE"))
{
menupres[num].enterwipe = get_number(word2);
menudefs[num].enterwipe = get_number(word2);
titlechanged = true;
}
else if (fastcmp(word, "EXITWIPE"))
{
menupres[num].exitwipe = get_number(word2);
menudefs[num].exitwipe = get_number(word2);
titlechanged = true;
}
// MENUDEF STARTS HERE
else if (fastcmp(word, "HEADERPIC"))
{
if (menudef->headerpic)
Z_Free(menudef->headerpic);
menudef->headerpic = Z_StrDup(word2);
}
else if (fastcmp(word, "DRAWROUTINE"))
{
void (*drawer)(void) = get_menudrawer(word2);
menudrawer_f *drawer = get_menudrawer(word2);
if (drawer == NULL)
{
WARN("unknown draw routine '%s'", word2);
@ -2465,15 +2296,37 @@ void readmenu(MYFILE *f, INT32 num)
}
else if (fastcmp(word, "X"))
{
menudef->x = value;
menudef->x = get_number(word2);
}
else if (fastcmp(word, "Y"))
{
menudef->y = value;
menudef->y = get_number(word2);
}
else if (fastcmp(word, "SCROLLHEIGHT"))
{
menudef->scrollheight = get_number(word2);
}
else if (fastcmp(word, "CURSOROFFSET"))
{
menudef->cursoroffset = get_number(word2);
}
else if (fastcmp(word, "LINEHEIGHT"))
{
menudef->lineheight = get_number(word2);
}
else if (fastcmp(word, "ENTERROUTINE"))
{
menufunc_f *routine = get_menuroutine(word2);
if (!routine)
{
WARN("unknown enter routine '%s'", word2);
continue;
}
menudef->enterroutine = routine;
}
else if (fastcmp(word, "QUITROUTINE"))
{
void (*routine)(INT32) = get_menuroutine(word2);
menufunc_f *routine = get_menuroutine(word2);
if (!routine)
{
WARN("unknown quit routine '%s'", word2);
@ -2481,14 +2334,29 @@ void readmenu(MYFILE *f, INT32 num)
}
menudef->quitroutine = routine;
}
else if (fastcmp(word, "KEYHANDLER"))
{
menufunc_f *routine = get_menuroutine(word2);
if (!routine)
{
WARN("unknown key handler '%s'", word2);
continue;
}
menudef->keyhandler = routine;
}
else
WARN("unknown word '%s'", word);
}
} while (!myfeof(f)); // finish when the line is empty
// default line height
if (!menudef->lineheight)
menudef->lineheight = 8;
Z_Free(s);
}
#undef WARN
#undef WARN0
void readframe(MYFILE *f, INT32 num)
{
@ -3342,6 +3210,47 @@ void readmaincfg(MYFILE *f)
{
ammoremovaltics = get_number(word2);
}
// BlanKart: Easy ways to set these for balance purposes
else if (fastcmp(word, "HYUDOROTIME"))
{
hyudorotime = get_number(word2);
}
else if (fastcmp(word, "STEALTIME"))
{
stealtime = get_number(word2);
}
else if (fastcmp(word, "WATERPANELTIME"))
{
waterpaneltime = get_number(word2);
}
else if (fastcmp(word, "SNEAKERTIME"))
{
sneakertime = get_number(word2);
}
else if (fastcmp(word, "BUBBLETIME"))
{
bubbletime = get_number(word2);
}
else if (fastcmp(word, "COMEBACKTIME"))
{
comebacktime = get_number(word2);
}
else if (fastcmp(word, "GREASETICS"))
{
greasetics = get_number(word2);
}
else if (fastcmp(word, "WIPEOUTSLOWTIME"))
{
wipeoutslowtime = get_number(word2);
}
else if (fastcmp(word, "WANTEDREDUCE"))
{
wantedreduce = get_number(word2);
}
else if (fastcmp(word, "WANTEDFREQUENCY"))
{
wantedfrequency = get_number(word2);
}
else if (fastcmp(word, "INTROTOPLAY"))
{
introtoplay = (UINT8)get_number(word2);
@ -3357,10 +3266,6 @@ void readmaincfg(MYFILE *f)
if (creditscutscene > 128)
creditscutscene = 128;
}
else if (fastcmp(word, "USEBLACKROCK"))
{
useBlackRock = (UINT8)(value || word2[0] == 'T' || word2[0] == 'Y');
}
else if (fastcmp(word, "LOOPTITLE"))
{
looptitle = (value || word2[0] == 'T' || word2[0] == 'Y');
@ -3585,14 +3490,6 @@ void readwipes(MYFILE *f)
else if (fastcmp(pword, "FINAL"))
wipeoffset = wipe_voting_final;
}
else if (fastncmp(word, "CONTINUING_", 11))
{
pword = word + 11;
if (fastcmp(pword, "TOBLACK"))
wipeoffset = wipe_continuing_toblack;
else if (fastcmp(pword, "FINAL"))
wipeoffset = wipe_continuing_final;
}
else if (fastncmp(word, "TITLESCREEN_", 12))
{
pword = word + 12;
@ -3627,14 +3524,6 @@ void readwipes(MYFILE *f)
else if (fastcmp(pword, "FINAL"))
wipeoffset = wipe_evaluation_final;
}
else if (fastncmp(word, "GAMEEND_", 8))
{
pword = word + 8;
if (fastcmp(pword, "TOBLACK"))
wipeoffset = wipe_gameend_toblack;
else if (fastcmp(pword, "FINAL"))
wipeoffset = wipe_gameend_final;
}
else if (fastncmp(word, "ENCORE_", 7))
{
pword = word + 7;
@ -4215,7 +4104,7 @@ menutype_t get_menutype(const char *word)
return i;
}
void (*get_menuroutine(const char *word))(INT32)
menufunc_f *get_menuroutine(const char *word)
{ // Returns the value of MR_ enumerations
size_t i;
if (fastncmp("MR_",word,3))
@ -4227,7 +4116,7 @@ void (*get_menuroutine(const char *word))(INT32)
return NULL;
}
void (*get_menudrawer(const char *word))(void)
menudrawer_f *get_menudrawer(const char *word)
{ // Returns the value of MD_ enumerations
size_t i;
if (fastncmp("MD_",word,3))
@ -4254,18 +4143,19 @@ void (*get_menudrawer(const char *word))(void)
}*/
preciptype_t get_precip(const char *word)
{ // Returns the value of PRECIP_ enumerations
preciptype_t i;
{
// Returns the value of PRECIP_ enumerations
if (*word >= '0' && *word <= '9')
return atoi(word);
if (fastncmp("PRECIP_",word,4))
word += 7; // take off the PRECIP_
for (i = 0; i < MAXPRECIP; i++)
if (fastncmp("PRECIP_",word,7))
{
if (precipprops[i].name == NULL)
break;
if (fasticmp(word, precipprops[i].name))
return i;
fixed_t eval = LUA_EvalMath(word);
if (eval)
return eval;
if (fasticmp("PRECIP_NONE",word))
return PRECIP_NONE;
}
deh_warning("Couldn't find weather type named 'PRECIP_%s'",word);
return PRECIP_NONE;

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -57,8 +57,8 @@ spritenum_t get_sprite(const char *word);
playersprite_t get_sprite2(const char *word);
sfxenum_t get_sfx(const char *word);
menutype_t get_menutype(const char *word);
void (*get_menuroutine(const char *word))(INT32);
void (*get_menudrawer(const char *word))(void);
menufunc_f *get_menuroutine(const char *word);
menudrawer_f *get_menudrawer(const char *word);
//INT16 get_gametype(const char *word);
//powertype_t get_power(const char *word);
skincolornum_t get_skincolor(const char *word);
@ -84,7 +84,6 @@ void readlight(MYFILE *f, INT32 num);
void readskincolor(MYFILE *f, INT32 num, boolean mainfile);
void readthing(MYFILE *f, INT32 num);
void readfreeslots(MYFILE *f);
void readPlayer(MYFILE *f, INT32 num);
void clear_levels(void);
void clear_conditionsets(void);

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -257,7 +257,7 @@ const char *const MOBJFLAG2_LIST[] = {
"JUSTATTACKED", // can be pushed by other moving mobjs
"FIRING", // turret fire
"SUPERFIRE", // Firing something with Super Sonic-stopping properties. Or, if mobj has MF_MISSILE, this is the actual fire from it.
"\x01", // free: 1<<20 (name un-matchable)
"DONTSYNC", // Prevents this mobj from triggering stuff or being sent. Used for sync safety on toggle effects.
"STRONGBOX", // Flag used for "strong" random monitors.
"OBJECTFLIP", // Flag for objects that always have flipped gravity.
"SKULLFLY", // Special handling: skull in flight.
@ -392,7 +392,7 @@ const char *const GAMETYPERULE_LIST[] = {
"\x01",
"LIVES",
"SPECIALBOTS",
"FREEROAM",
"NOCOUNTDOWN",
"ENCORE",
NULL
};
@ -674,133 +674,110 @@ const char *const HUDITEMS_LIST[] = {
};
struct menu_routine_s const MENU_ROUTINES[] = {
{ "SINGLEPLAYERMENU", &M_SinglePlayerMenu },
{ "OPTIONS", &M_Options },
{ "ADDONS", &M_Addons },
{ "QUITSRB2", &M_QuitSRB2 },
{ "STATISTICS", &M_Statistics },
{ "HANDLELEVELSTATS", &M_HandleLevelStats },
{ "REPLAYHUT", &M_ReplayHut },
{ "QUITREPLAYHUT", &M_QuitReplayHut },
{ "HANDLEREPLAYHUTLIST", &M_HandleReplayHutList },
{ "GRANDPRIXTEMP", &M_GrandPrixTemp },
{ "TIMEATTACK", &M_TimeAttack },
{ "ITEMBREAKER", &M_ItemBreaker },
{ "STARTGRANDPRIX", &M_StartGrandPrix },
{ "QUITTIMEATTACKMENU", &M_QuitTimeAttackMenu },
{ "CHOOSETIMEATTACK", &M_ChooseTimeAttack },
{ "SETGUESTREPLAY", &M_SetGuestReplay },
{ "REPLAYTIMEATTACK", &M_ReplayTimeAttack },
{ "SRB2KARTPRESET", &M_SRB2KartPreset },
{ "TECHPRESET", &M_TechPreset },
{ "BLANKARTPRESET", &M_BlanKartPreset },
{ "HANDLESTAFFREPLAY", &M_HandleStaffReplay },
{ "SETUPMULTIHANDLER", &M_SetupMultiHandler },
{ "HANDLESETUPMULTIPLAYER", &M_HandleSetupMultiPlayer },
{ "QUITMULTIPLAYERMENU", &M_QuitMultiPlayerMenu },
{ "STARTSERVERMENU", &M_StartServerMenu },
{ "STARTOFFLINESERVERMENU", &M_StartOfflineServerMenu },
{ "STARTSERVER", &M_StartServer },
{ "CONNECTMENUMODCHECKS", &M_ConnectMenuModChecks },
{ "HANDLECONNECTIP", &M_HandleConnectIP },
{ "CANCELCONNECT", &M_CancelConnect },
{ "SETUP1PCONTROLSMENU", &M_Setup1PControlsMenu },
{ "SETUP2PCONTROLSMENU", &M_Setup2PControlsMenu },
{ "SETUP3PCONTROLSMENU", &M_Setup3PControlsMenu },
{ "SETUP4PCONTROLSMENU", &M_Setup4PControlsMenu },
{ "HANDLESERVERPAGE", &M_HandleServerPage },
{ "REFRESH", &M_Refresh },
{ "CONNECT", &M_Connect },
{ "VIDEOMODEMENU", &M_VideoModeMenu },
{ "SINGLEPLAYERMENU", &MR_SinglePlayerMenu },
{ "OPTIONS", &MR_Options },
{ "ADDONS", &MR_Addons },
{ "QUITADDONS", &MR_QuitAddons },
{ "QUITSRB2", &MR_QuitSRB2 },
{ "STATISTICS", &MR_Statistics },
{ "HANDLELEVELSTATS", &MR_HandleLevelStats },
{ "REPLAYHUT", &MR_ReplayHut },
{ "QUITREPLAYHUT", &MR_QuitReplayHut },
{ "HANDLEREPLAYHUTLIST", &MR_HandleReplayHutList },
{ "GRANDPRIXTEMP", &MR_GrandPrixTemp },
{ "TIMEATTACK", &MR_TimeAttack },
{ "STARTGRANDPRIX", &MR_StartGrandPrix },
{ "QUITTIMEATTACKMENU", &MR_QuitTimeAttackMenu },
{ "CHOOSETIMEATTACK", &MR_ChooseTimeAttack },
{ "SETGUESTREPLAY", &MR_SetGuestReplay },
{ "REPLAYTIMEATTACK", &MR_ReplayTimeAttack },
{ "TIMEATTACKPRESET", &MR_TimeAttackPreset },
{ "REPLAYSTAFF", &MR_ReplayStaff },
{ "CONNECTIP", &MR_ConnectIP },
{ "QUITMULTIPLAYERMENU", &MR_QuitMultiPlayerMenu },
{ "STARTSERVERMENU", &MR_StartServerMenu },
{ "STARTSERVER", &MR_StartServer },
{ "CONNECTMENUMODCHECKS", &MR_ConnectMenuModChecks },
{ "CANCELCONNECT", &MR_CancelConnect },
{ "SETUPCONTROLSMENU", &MR_SetupControlsMenu },
{ "HANDLECONTROLSMENU", &MR_HandleControlsMenu },
{ "REFRESH", &MR_Refresh },
{ "CONNECT", &MR_Connect },
{ "VIDEOMODEMENU", &MR_VideoModeMenu },
#ifdef HWRENDER
{ "OPENGLOPTIONSMENU", &M_OpenGLOptionsMenu },
{ "OPENGLOPTIONSMENU", &MR_OpenGLOptionsMenu },
#endif
{ "HANDLEVIDEOMODE", &M_HandleVideoMode },
{ "HANDLESOUNDTEST", &M_HandleSoundTest },
{ "MUSICTEST", &M_MusicTest },
{ "SCREENSHOTOPTIONS", &M_ScreenshotOptions },
{ "ADDONSOPTIONS", &M_AddonsOptions },
{ "ERASEDATA", &M_EraseData },
{ "MANUAL", &M_Manual },
{ "CREDITS", &M_Credits },
{ "BLANCREDITS", &M_BlanCredits },
{ "HANDLEADDONS", &M_HandleAddons },
{ "SELECTABLECLEARMENUS", &M_SelectableClearMenus },
{ "MODEATTACKRETRY", &M_ModeAttackRetry },
{ "MODEATTACKENDGAME", &M_ModeAttackEndGame },
{ "PANDORASBOX", &M_PandorasBox },
{ "EMBLEMHINTS", &M_EmblemHints },
{ "RETRY", &M_Retry },
{ "ENDGAME", &M_EndGame },
{ "MAPCHANGE", &M_MapChange },
{ "SETUPMULTIPLAYER", &M_SetupMultiPlayer },
{ "SETUPMULTIPLAYER2", &M_SetupMultiPlayer2 },
{ "SETUPMULTIPLAYER3", &M_SetupMultiPlayer3 },
{ "SETUPMULTIPLAYER4", &M_SetupMultiPlayer4 },
{ "CONFIRMSPECTATE", &M_ConfirmSpectate },
{ "CONFIRMENTERGAME", &M_ConfirmEnterGame },
{ "EXITPANDORASBOX", &M_ExitPandorasBox },
{ "GETALLEMERALDS", &M_GetAllEmeralds },
{ "DESTROYROBOTS", &M_DestroyRobots },
{ "ULTIMATECHEAT", &M_UltimateCheat },
{ "CONFIRMTEAMSCRAMBLE", &M_ConfirmTeamScramble },
{ "CONFIRMTEAMCHANGE", &M_ConfirmTeamChange },
{ "CONFIRMSPECTATECHANGE", &M_ConfirmSpectateChange },
{ "CHANGELEVEL", &M_ChangeLevel },
{ "HUTSTARTREPLAY", &M_HutStartReplay },
{ "PLAYBACKREWIND", &M_PlaybackRewind },
{ "PLAYBACKPAUSE", &M_PlaybackPause },
{ "PLAYBACKFASTFORWARD", &M_PlaybackFastForward },
{ "PLAYBACKADVANCE", &M_PlaybackAdvance },
{ "PLAYBACKSETVIEWS", &M_PlaybackSetViews },
{ "PLAYBACKADJUSTVIEW", &M_PlaybackAdjustView },
{ "PLAYBACKTOGGLEFREECAM", &M_PlaybackToggleFreecam },
{ "PLAYBACKQUIT", &M_PlaybackQuit },
{ "HANDLEIMAGEDEF", &M_HandleImageDef },
{ "HANDLEMUSICTEST", &M_HandleMusicTest },
{ "SETUP1PJOYSTICKMENU", &M_Setup1PJoystickMenu },
{ "SETUP2PJOYSTICKMENU", &M_Setup2PJoystickMenu },
{ "SETUP3PJOYSTICKMENU", &M_Setup3PJoystickMenu },
{ "SETUP4PJOYSTICKMENU", &M_Setup4PJoystickMenu },
{ "RESETCONTROLS", &M_ResetControls },
{ "CHANGECONTROL", &M_ChangeControl },
{ "ASSIGNJOYSTICK", &M_AssignJoystick },
{ "HANDLEMONITORTOGGLES", &M_HandleMonitorToggles },
{ "RESTARTAUDIO", &M_RestartAudio },
{ "HANDLEVIDEOMODE", &MR_HandleVideoMode },
{ "PLAYSOUND", &MR_PlaySound },
{ "MUSICTEST", &MR_MusicTest },
{ "QUITMUSICTEST", &MR_QuitMusicTest },
{ "SCREENSHOTOPTIONS", &MR_ScreenshotOptions },
{ "ADDONSOPTIONS", &MR_AddonsOptions },
{ "ERASEDATA", &MR_EraseData },
{ "CREDITS", &MR_Credits },
{ "BLANCREDITS", &MR_BlanCredits },
{ "HANDLEADDONS", &MR_HandleAddons },
{ "SELECTABLECLEARMENUS", &MR_SelectableClearMenus },
{ "GOBACK", &MR_GoBack },
{ "MODEATTACKRETRY", &MR_ModeAttackRetry },
{ "MODEATTACKENDGAME", &MR_ModeAttackEndGame },
{ "RETRY", &MR_Retry },
{ "ENDGAME", &MR_EndGame },
{ "MAPCHANGE", &MR_MapChange },
{ "SETUPMULTIPLAYER", &MR_SetupMultiPlayer },
{ "CONFIRMSPECTATE", &MR_ConfirmSpectate },
{ "CONFIRMENTERGAME", &MR_ConfirmEnterGame },
{ "CONFIRMTEAMSCRAMBLE", &MR_ConfirmTeamScramble },
{ "CONFIRMTEAMCHANGE", &MR_ConfirmTeamChange },
{ "CONFIRMSPECTATECHANGE", &MR_ConfirmSpectateChange },
{ "CHANGELEVEL", &MR_ChangeLevel },
{ "HUTSTARTREPLAY", &MR_HutStartReplay },
{ "PLAYBACKREWIND", &MR_PlaybackRewind },
{ "PLAYBACKPAUSE", &MR_PlaybackPause },
{ "PLAYBACKFASTFORWARD", &MR_PlaybackFastForward },
{ "PLAYBACKADVANCE", &MR_PlaybackAdvance },
{ "PLAYBACKSETVIEWS", &MR_PlaybackSetViews },
{ "PLAYBACKADJUSTVIEW", &MR_PlaybackAdjustView },
{ "PLAYBACKTOGGLEFREECAM", &MR_PlaybackToggleFreecam },
{ "PLAYBACKQUIT", &MR_PlaybackQuit },
{ "HANDLEIMAGEDEF", &MR_HandleImageDef },
{ "HANDLEMUSICTEST", &MR_HandleMusicTest },
{ "SETUPJOYSTICKMENU", &MR_SetupJoystickMenu },
{ "RESETCONTROLS", &MR_ResetControls },
{ "CHANGECONTROL", &MR_ChangeControl },
{ "ASSIGNJOYSTICK", &MR_AssignJoystick },
{ "HANDLEMONITORTOGGLES", &MR_HandleMonitorToggles },
{ "RESTARTAUDIO", &MR_RestartAudio },
{ "ENTERVIEWSERVER", &MR_EnterViewServer },
{ "QUITVIEWSERVER", &MR_QuitViewServer },
{ "HANDLEVIEWSERVER", &MR_HandleViewServer },
{ "CAMERASETUP", &MR_CameraSetup },
#ifdef HAVE_DISCORDRPC
{ "HANDLEDISCORDREQUESTS", &M_HandleDiscordRequests },
{ "HANDLEDISCORDREQUESTS", &MR_HandleDiscordRequests },
#endif
{ NULL, NULL }
};
struct menu_drawer_s const MENU_DRAWERS[] = {
{ "DRAWGENERICMENU", &M_DrawGenericMenu },
{ "DRAWGENERICSCROLLMENU", &M_DrawGenericScrollMenu },
{ "DRAWCENTEREDMENU", &M_DrawCenteredMenu },
{ "DRAWPAUSEMENU", &M_DrawPauseMenu },
{ "DRAWCHECKLIST", &M_DrawChecklist },
{ "DRAWLEVELSTATS", &M_DrawLevelStats },
{ "DRAWREPLAYHUT", &M_DrawReplayHut },
{ "DRAWTIMEATTACKMENU", &M_DrawTimeAttackMenu },
{ "DRAWMPMAINMENU", &M_DrawMPMainMenu },
{ "DRAWSETUPMULTIPLAYERMENU", &M_DrawSetupMultiPlayerMenu },
{ "DRAWSERVERMENU", &M_DrawServerMenu },
{ "DRAWVIDEOMENU", &M_DrawVideoMenu },
{ "DRAWVIDEOMODE", &M_DrawVideoMode },
{ "DRAWSKYROOM", &M_DrawSkyRoom },
{ "DRAWHUDOPTIONS", &M_DrawHUDOptions },
{ "DRAWADDONS", &M_DrawAddons },
{ "DRAWEMBLEMHINTS", &M_DrawEmblemHints },
{ "DRAWREPLAYSTARTMENU", &M_DrawReplayStartMenu },
{ "DRAWPLAYBACKMENU", &M_DrawPlaybackMenu },
{ "DRAWIMAGEDEF", &M_DrawImageDef },
{ "DRAWMUSICTEST", &M_DrawMusicTest },
{ "DRAWCONTROL", &M_DrawControl },
{ "DRAWJOYSTICK", &M_DrawJoystick },
{ "DRAWMONITORTOGGLES", &M_DrawMonitorToggles },
{ "DRAWCONNECTMENU", &M_DrawConnectMenu },
{ "DRAWGENERICMENU", &MD_DrawGenericMenu },
{ "DRAWCHECKLIST", &MD_DrawChecklist },
{ "DRAWLEVELSTATS", &MD_DrawLevelStats },
{ "DRAWREPLAYHUT", &MD_DrawReplayHut },
{ "DRAWTIMEATTACKMENU", &MD_DrawTimeAttackMenu },
{ "DRAWMPMAINMENU", &MD_DrawMPMainMenu },
{ "DRAWSETUPMULTIPLAYERMENU", &MD_DrawSetupMultiPlayerMenu },
{ "DRAWVIDEOMODE", &MD_DrawVideoMode },
{ "DRAWADDONS", &MD_DrawAddons },
{ "DRAWREPLAYSTARTMENU", &MD_DrawReplayStartMenu },
{ "DRAWPLAYBACKMENU", &MD_DrawPlaybackMenu },
{ "DRAWIMAGEDEF", &MD_DrawImageDef },
{ "DRAWMUSICTEST", &MD_DrawMusicTest },
{ "DRAWJOYSTICK", &MD_DrawJoystick },
{ "DRAWMONITORTOGGLES", &MD_DrawMonitorToggles },
{ "DRAWCONNECTMENU", &MD_DrawConnectMenu },
{ "DRAWVIEWSERVER", &MD_DrawViewServer },
#ifdef HAVE_DISCORDRPC
{ "DRAWDISCORDREQUESTS", &M_DrawDiscordRequests },
{ "DRAWDISCORDREQUESTS", &MD_DrawDiscordRequests },
#endif
{ NULL, NULL }
};
@ -1062,6 +1039,7 @@ struct int_const_s const INT_CONST[] = {
{"DMG_SQUISH",DMG_SQUISH},
{"DMG_VOLTAGE",DMG_VOLTAGE},
{"DMG_KARMA",DMG_KARMA},
{"DMG_FLIPOVER",DMG_FLIPOVER},
//// Death types
{"DMG_INSTAKILL",DMG_INSTAKILL},
{"DMG_DEATHPIT",DMG_DEATHPIT},
@ -1429,12 +1407,10 @@ struct int_const_s const INT_CONST[] = {
{"GS_NULL",GS_NULL},
{"GS_LEVEL",GS_LEVEL},
{"GS_INTERMISSION",GS_INTERMISSION},
{"GS_CONTINUING",GS_CONTINUING},
{"GS_TITLESCREEN",GS_TITLESCREEN},
{"GS_TIMEATTACK",GS_TIMEATTACK},
{"GS_CREDITS",GS_CREDITS},
{"GS_EVALUATION",GS_EVALUATION},
{"GS_GAMEEND",GS_GAMEEND},
{"GS_INTRO",GS_INTRO},
{"GS_CUTSCENE",GS_CUTSCENE},
{"GS_DEDICATEDSERVER",GS_DEDICATEDSERVER},
@ -1547,6 +1523,7 @@ struct int_const_s const INT_CONST[] = {
{"KARTSPEED_EASY", KARTSPEED_EASY},
{"KARTSPEED_NORMAL", KARTSPEED_NORMAL},
{"KARTSPEED_HARD", KARTSPEED_HARD},
{"KARTSPEED_EXPERT", KARTSPEED_EXPERT},
// Custom client features exposed to lua
{"FEATURE_INTERMISSIONHUD",1}, // This is to trick kart luas that look for this since its already here.
@ -1587,5 +1564,11 @@ struct int_const_s const INT_CONST[] = {
{"TRF_REMAP",TRF_REMAP},
{"TRF_BYPASSBOOST", TRF_BYPASSBOOST},
// facepatches
{"FACE_RANK", FACE_RANK},
{"FACE_WANTED", FACE_WANTED},
{"FACE_MINIMAP", FACE_MINIMAP},
{"NUMFACES", NUMFACES},
{NULL,0}
};

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -59,12 +59,12 @@ struct actionpointer_t
struct menu_routine_s {
const char *name;
void (*routine)(INT32);
menufunc_f *routine;
};
struct menu_drawer_s {
const char *name;
void (*drawer)(void);
menudrawer_f *drawer;
};
struct int_const_s {

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -176,6 +176,34 @@ static void ignorelines(MYFILE *f)
Z_Free(s);
}
static void ignoremenulines(MYFILE *f)
{
char *s = Z_Malloc(MAXLINELEN, PU_STATIC, NULL);
char *tmp;
do
{
if (myfgets(s, MAXLINELEN, f))
{
if (s[0] == '\n')
break;
// First remove trailing newline, if there is one
tmp = strchr(s, '\n');
if (tmp)
*tmp = '\0';
tmp = strchr(s, '#');
if (tmp)
*tmp = '\0';
if (s == tmp)
continue; // Skip comment lines, but don't break.
ignorelines(f);
}
} while (!myfeof(f));
Z_Free(s);
}
void DEH_Link(const char *name, dehinfo_t *info, strbuf_t **buf)
{
info->namehash = HASH32(name, strlen(name));
@ -407,15 +435,6 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
readfollower(f);
continue;
}
// sigh... menu hack
else if (fastcmp(word, "DISCORDONLY"))
{
#ifdef HAVE_DISCORDRPC
continue;
#else
break;
#endif
}
word2 = strtok(NULL, " ");
if (word2) {
@ -427,18 +446,7 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
else
i = 0;
if (fastcmp(word, "CHARACTER"))
{
if (i >= 0 && i < 32)
readPlayer(f, i);
else
{
deh_warning("Character %d out of range (0 - 31)", i);
ignorelines(f);
}
continue;
}
else if (fastcmp(word, "EMBLEM"))
if (fastcmp(word, "EMBLEM"))
{
if (!mainfile && !gamedataadded)
{
@ -645,7 +653,10 @@ static void DEH_LoadDehackedFile(MYFILE *f, boolean mainfile)
else if (fastcmp(word, "MENU"))
{
if (dedicated)
{
ignoremenulines(f);
continue; // dedis don't need menus, silly!
}
if (i == 0 && word2[0] != '0') // If word2 isn't a number
i = get_menutype(word2); // find a huditem by name

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2 KART
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2018-2020 by Sally "TehRealSalt" Cochenour.
// Copyright (C) 2018-2020 by Kart Krew.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2 KART
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2018-2020 by Sally "TehRealSalt" Cochenour.
// Copyright (C) 2018-2020 by Kart Krew.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -104,6 +104,7 @@ extern "C" {
// Special Hashing.
//#define NOMD5
//#define NOFILEHASH
//#define NOVERIFYIWADS
// Uncheck this to compile debugging code
//#define RANGECHECK

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -508,7 +508,7 @@ enum GameTypeRules
GTR_SPECIALBOTS = 1<<21, // Bot difficulty gets stronger between rounds, and the rival system is enabled.
// Misc
GTR_FREEROAM = 1<<22, // Disables Countdown timer and control lock at the start of levels.
GTR_NOCOUNTDOWN = 1<<22, // Disables Countdown timer and control lock at the start of levels.
GTR_ENCORE = 1<<23, // Enable Encore mode.
// free: to and including 1<<31
@ -609,6 +609,7 @@ extern tic_t battleexittime;
extern INT32 hyudorotime;
extern INT32 stealtime;
extern INT32 sneakertime;
extern INT32 waterpaneltime;
extern INT32 itemtime;
extern INT32 bubbletime;
extern INT32 comebacktime;
@ -620,7 +621,6 @@ extern INT32 wantedfrequency;
extern UINT8 introtoplay;
extern UINT8 creditscutscene;
extern UINT8 useBlackRock;
extern UINT8 use1upSound;
extern UINT8 maxXtraLife; // Max extra lives from rings
@ -662,6 +662,7 @@ extern INT32 cheats;
// SRB2kart
extern UINT8 numlaps;
extern UINT8 gamespeed;
extern UINT8 invintype;
extern boolean franticitems;
extern boolean encoremode, prevencoremode;
extern boolean comeback;

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -163,7 +163,7 @@ extern "C" {
#ifndef _WIN32
typedef int32_t boolean;
#else
#define BOOL boolean
#define boolean BOOL
#endif
#ifndef __cplusplus

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2014-2020 by Sonic Team Junior.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -337,16 +337,16 @@ static void F_IntroDrawScene(void)
{
background = W_CachePatchName("KARTKREW", PU_CACHE);
highres = true;
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0);
}
if (intro_scenenum == 1)
{
background = W_CachePatchName("BLANKART", PU_CACHE);
highres = false;
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31);
}
V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 0);
if (background)
{
if (highres)
@ -465,7 +465,9 @@ void F_IntroTicker(void)
}
if (finalecount == 80)
{
sfxenum_t rsound = skins[1].soundsid[SKSKWIN];
char chars[5][10] = {"tails", "chao", "aiai", "sakura"};
SINT8 random = M_RandomRange(0, 3);
sfxenum_t rsound = skins[R_SkinAvailable(chars[random])].soundsid[SKSKWIN];
S_StartSound(NULL, sfx_flgcap);
S_StartSound(NULL, rsound);
}
@ -478,7 +480,7 @@ void F_IntroTicker(void)
// check for skipping
if (keypressed)
keypressed = false;
if (animtimer > 0)
animtimer--;
}
@ -912,24 +914,54 @@ static const char *blancredits[] = {
"\1Support Programming",
"\"hayaunderscore\" aka \"DeltaKaynx\"",
"\"WumboSpasm\"",
"\"Anonimous\"",
"\"Anonimus\"",
"",
"\1Item Programming",
"\"NepDisk\"",
"\"Anonimus\"",
"",
"\1External Programming",
"\"Hanicef\"",
"\"Lactozilla\"",
"\"xyzzy\"",
"\"SuperJustinBros\"",
"SRB2Classic Team",
"\"luigi budd\"",
"",
"\1Ring Racers Programming",
"Kart Krew Dev",
"\"JugadorXEI\"",
"\"Kimberly\"",
"",
"\1Item Design",
"\"NepDisk\"",
"\"Anonimus\"",
"\"Denny\" aka \"shephoron\"",
"",
"\1Design Support",
"\"Rim Jobless\"",
"\"luna\"",
"\"Denny\" aka \"shephoron\"",
"\"White Mage (guy who picked up controller)\"",
"",
"\1New Graphics Creation",
"\"Spee\"",
"\"Jin\"",
"\"NepDisk\"",
"",
"\1Testing",
"\"NepDisk\"",
"\"Alug\"",
"\"Indev\"",
"\"GenericHeroGuy\"",
"\"Sunflower\" aka \"AnimeSonic\"",
"\"JonUD\"",
"\"luna\"",
"\"swift\"",
"\"Denny\" aka \"shephoron\"",
"\"Rim Jobless\"",
"\"White Mage (guy who picked up controller)\"",
"",
"\1Special Thanks",
"\"Sunflower\" aka \"AnimeSonic\"",
"Sunflower's Garden",
@ -1067,13 +1099,6 @@ void F_BlanCreditTicker(void)
void F_StartGameEvaluation(void)
{
// Credits option in secrets menu
if (cursaveslot == -2)
{
F_StartGameEnd();
return;
}
G_SetGamestate(GS_EVALUATION);
// Just in case they're open ... somehow
@ -1084,6 +1109,9 @@ void F_StartGameEvaluation(void)
CON_ToggleOff();
finalecount = 0;
G_SetGamestate(GS_TITLESCREEN);
S_StopMusic();
}
void F_GameEvaluationDrawer(void)
@ -1093,12 +1121,6 @@ void F_GameEvaluationDrawer(void)
void F_GameEvaluationTicker(void)
{
if (++finalecount > 10*TICRATE)
{
F_StartGameEnd();
return;
}
if (finalecount == 5*TICRATE)
{
if (netgame || multiplayer) // modify this when we finally allow unlocking stuff in 2P
@ -1127,51 +1149,18 @@ void F_GameEvaluationTicker(void)
}
}
// ==========
// GAME END
// ==========
void F_StartGameEnd(void)
{
G_SetGamestate(GS_GAMEEND);
gameaction = ga_nothing;
paused = false;
CON_ToggleOff();
S_StopSounds();
// In case menus are still up?!!
M_ClearMenus(true);
timetonext = TICRATE;
}
//
// F_GameEndDrawer
//
void F_GameEndDrawer(void)
{
// this function does nothing
}
//
// F_GameEndTicker
//
void F_GameEndTicker(void)
{
if (timetonext > 0)
timetonext--;
else
D_StartTitle();
}
// ==============
// TITLE SCREEN
// ==============
void F_InitMenuPresValues(void)
void F_InitMenuPresValues(boolean title)
{
menuanimtimer = 0;
if (title)
{
menuanimtimer = 0;
LUA_HUD_DestroyDrawList(luahuddrawlist_title);
luahuddrawlist_title = LUA_HUD_CreateDrawList();
}
// Set defaults for presentation values
strncpy(curbgname, "TITLESKY", 9);
@ -1179,7 +1168,7 @@ void F_InitMenuPresValues(void)
curbgcolor = -1;
curbgxspeed = titlescrollxspeed;
curbgyspeed = titlescrollyspeed;
curbghide = false;
curbghide = true;
curhidepics = hidetitlepics;
curttmode = ttmode;
@ -1191,12 +1180,9 @@ void F_InitMenuPresValues(void)
curtttics = tttics;
// Find current presentation values
//M_SetMenuCurBackground((gamestate == GS_TIMEATTACK) ? "RECATTBG" : "TITLESKY");
//M_SetMenuCurFadeValue(16);
//M_SetMenuCurTitlePics();
LUA_HUD_DestroyDrawList(luahuddrawlist_title);
luahuddrawlist_title = LUA_HUD_CreateDrawList();
M_SetMenuCurBackground();
M_SetMenuCurFadeValue();
M_SetMenuCurTitlePics();
}
//
@ -1325,7 +1311,7 @@ void F_StartTitleScreen(void)
{
ttuser_count = 0;
finalecount = 0;
wipetypepost = menupres[MN_MAIN].enterwipe;
wipetypepost = menudefs[MN_MAIN].enterwipe;
}
else
wipegamestate = GS_TITLESCREEN;
@ -1378,8 +1364,8 @@ void F_StartTitleScreen(void)
camera[0].height = 0;
// Run enter linedef exec for MN_MAIN, since this is where we start
if (menupres[MN_MAIN].entertag)
P_LinedefExecute(menupres[MN_MAIN].entertag, players[displayplayers[0]].mo, NULL);
if (menudefs[MN_MAIN].entertag)
P_LinedefExecute(menudefs[MN_MAIN].entertag, players[displayplayers[0]].mo, NULL);
wipegamestate = prevwipegamestate;
}
@ -1447,7 +1433,7 @@ void F_TitleScreenDrawer(void)
if (finalecount >= 20)
V_DrawSmallScaledPatch(84, 87, 0, ttkart);
else if (finalecount >= 10)
V_DrawSciencePatch((84<<FRACBITS) - 18*(((20 - finalecount)<<FRACBITS) - rendertimefrac), 87<<FRACBITS, 0, ttkart, FRACUNIT/2);
V_DrawSciencePatch((84<<FRACBITS) - 18*(((20 - finalecount)<<FRACBITS) - R_GetMenuUncap()), 87<<FRACBITS, 0, ttkart, FRACUNIT/2);
}
else if (finalecount < 52)
{
@ -1463,8 +1449,8 @@ void F_TitleScreenDrawer(void)
F_TitleBGScroll(5);
V_DrawSciencePatch(0, -40*FixedDiv(((finalecount % 70)<<FRACBITS) + rendertimefrac, 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTOLEFT, ttcheckers, FRACUNIT);
V_DrawSciencePatch(280<<FRACBITS, -(40<<FRACBITS) + 40*FixedDiv(((finalecount % 70)<<FRACBITS) + rendertimefrac, 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTORIGHT, ttcheckers, FRACUNIT);
V_DrawSciencePatch(0, -40*FixedDiv(((finalecount % 70)<<FRACBITS) + R_GetMenuUncap(), 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTOLEFT, ttcheckers, FRACUNIT);
V_DrawSciencePatch(280<<FRACBITS, -(40<<FRACBITS) + 40*FixedDiv(((finalecount % 70)<<FRACBITS) + R_GetMenuUncap(), 70<<FRACBITS), V_SNAPTOTOP|V_SNAPTORIGHT, ttcheckers, FRACUNIT);
if (transval)
V_DrawFadeScreen(0, 10 - transval);
@ -1529,8 +1515,6 @@ void F_MenuPresTicker(boolean run)
// (no longer) De-Demo'd Title Screen
void F_TitleScreenTicker(boolean run)
{
F_MenuPresTicker(true); // title sky
if (run)
{
finalecount++;
@ -1542,10 +1526,7 @@ void F_TitleScreenTicker(boolean run)
else if (finalecount == 50)
{
// Now start the music
if (menupres[MN_MAIN].musname[0])
S_ChangeMusic(menupres[MN_MAIN].musname, menupres[MN_MAIN].mustrack, menupres[MN_MAIN].muslooping);
else
S_ChangeMusicInternal("titles", looptitle);
M_ChangeMenuMusic();
S_StartSound(NULL, sfx_s23c);
}
}
@ -1645,7 +1626,7 @@ void F_TitleScreenTicker(boolean run)
// prevent console spam if failed
demoIdleLeft = demoIdleTime;
mapnum = G_RandMap(TOL_RACE, -2, 2, 0, false, NULL);
mapnum = G_RandMap(TOL_RACE, -2, 2, 0, NULL);
if (mapnum == 0) // gotta have ONE
{
return;

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -26,6 +26,9 @@ extern "C" {
//
// FINALE
//
// HACK for menu fading while titlemapinaction; skips the level check
#define FORCEWIPE -2
// Called by main loop.
boolean F_IntroResponder(event_t *ev);
@ -33,7 +36,6 @@ boolean F_CutsceneResponder(event_t *ev);
boolean F_CreditResponder(event_t *ev);
// Called by main loop.
void F_GameEndTicker(void);
void F_IntroTicker(void);
void F_TitleScreenTicker(boolean run);
void F_CutsceneTicker(void);
@ -41,7 +43,6 @@ void F_TitleDemoTicker(void);
void F_TextPromptTicker(void);
// Called by main loop.
void F_GameEndDrawer(void);
void F_IntroDrawer(void);
void F_TitleScreenDrawer(void);
void F_SkyScroll(INT32 scrollxspeed, INT32 scrollyspeed, const char *patchname);
@ -73,7 +74,6 @@ void F_EndTextPrompt(boolean forceexec, boolean noexec);
boolean F_GetPromptHideHudAll(void);
boolean F_GetPromptHideHud(fixed_t y);
void F_StartGameEnd(void);
void F_StartIntro(void);
void F_StartTitleScreen(void);
void F_StartCredits(void);
@ -134,7 +134,7 @@ extern UINT16 curtttics;
#define TITLEBACKGROUNDACTIVE (curfadevalue >= 0 || curbgname[0])
void F_InitMenuPresValues(void);
void F_InitMenuPresValues(boolean title);
void F_MenuPresTicker(boolean run);
//
@ -153,6 +153,8 @@ extern INT32 lastwipetic;
void F_WipeStartScreen(void);
void F_WipeEndScreen(void);
void F_RunWipe(UINT8 wipetype, boolean drawMenu);
tic_t F_GetWipeLength(UINT8 wipetype);
boolean F_WipeExists(UINT8 wipetype);
void F_WipeStageTitle(void);
#define F_WipeColorFill(c) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, c)
@ -164,12 +166,10 @@ enum
wipe_level_toblack,
wipe_intermission_toblack,
wipe_voting_toblack,
wipe_continuing_toblack,
wipe_titlescreen_toblack,
wipe_timeattack_toblack,
wipe_credits_toblack,
wipe_evaluation_toblack,
wipe_gameend_toblack,
wipe_intro_toblack,
wipe_ending_toblack,
wipe_cutscene_toblack,
@ -182,12 +182,10 @@ enum
wipe_level_final,
wipe_intermission_final,
wipe_voting_final,
wipe_continuing_final,
wipe_titlescreen_final,
wipe_timeattack_final,
wipe_credits_final,
wipe_evaluation_final,
wipe_gameend_final,
wipe_intro_final,
wipe_ending_final,
wipe_cutscene_final,

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -56,12 +56,10 @@ UINT8 wipedefs[NUMWIPEDEFS] = {
0, // wipe_level_toblack
0, // wipe_intermission_toblack
0, // wipe_voting_toblack,
0, // wipe_continuing_toblack
0, // wipe_titlescreen_toblack
0, // wipe_timeattack_toblack
99, // wipe_credits_toblack
0, // wipe_evaluation_toblack
0, // wipe_gameend_toblack
UINT8_MAX, // wipe_intro_toblack (hardcoded)
99, // wipe_ending_toblack (hardcoded)
99, // wipe_cutscene_toblack (hardcoded)
@ -72,12 +70,10 @@ UINT8 wipedefs[NUMWIPEDEFS] = {
UINT8_MAX, // wipe_level_final
0, // wipe_intermission_final
0, // wipe_voting_final
0, // wipe_continuing_final
0, // wipe_titlescreen_final
0, // wipe_timeattack_final
99, // wipe_credits_final
0, // wipe_evaluation_final
0, // wipe_gameend_final
99, // wipe_intro_final (hardcoded)
99, // wipe_ending_final (hardcoded)
99 // wipe_cutscene_final (hardcoded)
@ -423,3 +419,52 @@ void F_RunWipe(UINT8 wipetype, boolean drawMenu)
WipeInAction = false;
#endif
}
/** Returns tic length of wipe
* One lump equals one tic
*/
tic_t F_GetWipeLength(UINT8 wipetype)
{
#ifdef NOWIPE
(void)wipetype;
return 0;
#else
static char lumpname[10] = "FADEmmss";
lumpnum_t lumpnum;
UINT8 wipeframe;
if (wipetype > 99)
return 0;
for (wipeframe = 0; wipeframe < 100; wipeframe++)
{
sprintf(&lumpname[4], "%.2hu%.2hu", (UINT16)wipetype, (UINT16)wipeframe);
lumpnum = W_CheckNumForName(lumpname);
if (lumpnum == LUMPERROR)
return --wipeframe;
}
return --wipeframe;
#endif
}
/** Does the specified wipe exist?
*/
boolean F_WipeExists(UINT8 wipetype)
{
#ifdef NOWIPE
(void)wipetype;
return false;
#else
static char lumpname[10] = "FADEmm00";
lumpnum_t lumpnum;
if (wipetype > 99)
return false;
sprintf(&lumpname[4], "%.2hu00", (UINT16)wipetype);
lumpnum = W_CheckNumForName(lumpname);
return !(lumpnum == LUMPERROR);
#endif
}

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1999-2018 by Sonic Team Junior.
// Copyright (C) 2019 by Kart Krew.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1999-2018 by Sonic Team Junior.
// Copyright (C) 2019 by Kart Krew.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -62,6 +62,7 @@ static CV_PossibleValue_t netdemosyncquality_cons_t[] = {{1, "MIN"}, {35, "MAX"}
consvar_t cv_netdemosyncquality = CVAR_INIT ("netdemo_syncquality", "1", CV_SAVE, netdemosyncquality_cons_t, NULL);
consvar_t cv_netdemosize = CVAR_INIT ("netdemo_size", "6", CV_SAVE, CV_Natural, NULL);
consvar_t cv_resyncdemo = CVAR_INIT("resyncdemo", "On", 0, CV_OnOff, NULL);
boolean nodrawers; // for comparative timing purposes
boolean noblit; // for comparative timing purposes
@ -1167,11 +1168,14 @@ void G_ConsGhostTic(INT32 playernum)
CONS_Alert(CONS_WARNING, "Demo playback has desynced (player %s)!\n", player_names[playernum]);
demosynced = false;
P_UnsetThingPosition(testmo);
testmo->x = oldghost[playernum].x;
testmo->y = oldghost[playernum].y;
P_SetThingPosition(testmo);
testmo->z = oldghost[playernum].z;
if (cv_resyncdemo.value)
{
P_UnsetThingPosition(testmo);
testmo->x = oldghost[playernum].x;
testmo->y = oldghost[playernum].y;
P_SetThingPosition(testmo);
testmo->z = oldghost[playernum].z;
}
if (abs(testmo->z - testmo->floorz) < 4*FRACUNIT)
testmo->z = testmo->floorz; // Sync players to the ground when they're likely supposed to be there...
@ -4026,7 +4030,7 @@ boolean G_CheckDemoStatus(void)
if (timedemo_quit)
COM_ImmedExecute("quit");
else if (modeattacking)
M_ModeAttackEndGame(0);
MR_ModeAttackEndGame(0);
else
D_StartTitle();
}

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -29,6 +29,7 @@ extern UINT8 *demo_p;
// ======================================
extern consvar_t cv_recordmultiplayerdemos, cv_netdemosyncquality, cv_netdemosize;
extern consvar_t cv_resyncdemo;
extern tic_t demostarttime;

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -240,9 +240,10 @@ tic_t battleexittime = 8*TICRATE;
INT32 hyudorotime = 7*TICRATE;
INT32 stealtime = TICRATE/2;
INT32 sneakertime = TICRATE + (TICRATE/3);
INT32 waterpaneltime = TICRATE*2;
INT32 itemtime = 8*TICRATE;
INT32 bubbletime = TICRATE/2;
INT32 comebacktime = 3*TICRATE;
INT32 comebacktime = 10*TICRATE;
INT32 bumptime = 6;
INT32 greasetics = 3*TICRATE;
INT32 wipeoutslowtime = 20;
@ -254,7 +255,6 @@ UINT8 maxXtraLife = 2; // Max extra lives from rings
UINT8 introtoplay;
UINT8 creditscutscene;
UINT8 useBlackRock = 1;
// Emerald locations
mobj_t *hunt1;
@ -282,6 +282,7 @@ INT32 cheats; //for multiplayer cheat commands
// Cvars that we don't want changed mid-game
UINT8 numlaps; // Removed from Cvar hell
UINT8 gamespeed; // Game's current speed (or difficulty, or cc, or etc); 0 for easy, 1 for normal, 2 for hard
UINT8 invintype; // How Invincibility functions. 0 for Legacy/Vanilla, 1 for Alternative.
boolean encoremode = false; // Encore Mode currently enabled?
boolean prevencoremode;
boolean franticitems; // Frantic items currently enabled?
@ -423,6 +424,9 @@ consvar_t cv_resetspecialmusic = CVAR_INIT ("resetspecialmusic", "Yes", CV_SAVE,
consvar_t cv_resume = CVAR_INIT ("resume", "Yes", CV_SAVE, CV_YesNo, NULL);
static CV_PossibleValue_t mindelay_cons_t[] = {{0, "MIN"}, {30, "MAX"}, {0, NULL}};
consvar_t cv_mindelay = CVAR_INIT ("mindelay", "0", CV_SAVE|CV_CALL, mindelay_cons_t, weaponPrefChange);
consvar_t cv_kickstartaccel[MAXSPLITSCREENPLAYERS] = {
CVAR_INIT ("kickstartaccel", "Off", CV_SAVE|CV_CALL, CV_OnOff, weaponPrefChange),
CVAR_INIT ("kickstartaccel2", "Off", CV_SAVE|CV_CALL, CV_OnOff, weaponPrefChange2),
@ -466,14 +470,15 @@ SINT8 G_RecordPresetIndex(void)
boolean chaining = cv_dummyattackingchaining.value;
boolean slipdash = cv_dummyattackingslipdash.value;
boolean purpledrift = cv_dummyattackingpurpledrift.value;
boolean slopeboost = cv_dummyattackingslopeboost.value;
if (!rings && !stacking && !chaining && !slipdash && !purpledrift)
if (!rings && !stacking && !chaining && !slipdash && !purpledrift && !slopeboost)
return RP_KART;
if (stacking && chaining && !rings && !slipdash && !purpledrift)
if (stacking && chaining && slopeboost && !rings && !slipdash && !purpledrift)
return RP_TECH;
if (rings && stacking && chaining && slipdash && purpledrift)
if (rings && stacking && chaining && slipdash && purpledrift && slopeboost)
return RP_BLAN;
return RP_CUST;
@ -592,14 +597,14 @@ static void G_UpdateRecordReplays(void)
parts = M_PathParts(gpath);
M_MkdirEachUntil(gpath, parts - 4, parts - 1, 0755);
snprintf(lastdemo, 255, "%s-%s-%s-last.lmp", gpath, cv_chooseskin.string, gamemode);
snprintf(lastdemo, 255, "%s-%s-%s-last.lmp", gpath, skins[cv_chooseskin.value].name, gamemode);
if (FIL_FileExists(lastdemo))
{
UINT8 *buf;
size_t len = FIL_ReadFile(lastdemo, &buf);
snprintf(bestdemo, 255, "%s-%s-%s-time-best.lmp", gpath, cv_chooseskin.string, gamemode);
snprintf(bestdemo, 255, "%s-%s-%s-time-best.lmp", gpath, skins[cv_chooseskin.value].name, gamemode);
if (!FIL_FileExists(bestdemo) || G_CmpDemoTime(bestdemo, lastdemo) & 1)
{ // Better time, save this demo.
if (FIL_FileExists(bestdemo))
@ -610,7 +615,7 @@ static void G_UpdateRecordReplays(void)
if (modeattacking == ATTACKING_TIME)
{
snprintf(bestdemo, 255, "%s-%s-%s-lap-best.lmp", gpath, cv_chooseskin.string, gamemode);
snprintf(bestdemo, 255, "%s-%s-%s-lap-best.lmp", gpath, skins[cv_chooseskin.value].name, gamemode);
if (!FIL_FileExists(bestdemo) || G_CmpDemoTime(bestdemo, lastdemo) & (1<<1))
{ // Better lap time, save this demo.
if (FIL_FileExists(bestdemo))
@ -702,7 +707,7 @@ void G_SetGameModified(boolean silent, boolean major)
// If in record attack recording, cancel it.
if (modeattacking)
M_ModeAttackEndGame(0);
MR_ModeAttackEndGame(0);
else if (marathonmode)
Command_ExitGame_f();
}
@ -768,6 +773,47 @@ INT32 G_MapNumber(const char * name)
#endif
}
/** Returns the map number from level title.
*
* \param name Map name;
* \return Map number.
* \sa G_BuildMapName, nextmapspecial_t
*/
INT32 G_LevelTitleToMapNum(const char * leveltitle)
{
INT32 map;
char levelname[48];
for (map = 0; map < nummapheaders; ++map)
{
sprintf(levelname, "%s", mapheaderinfo[map]->lvlttl);
if (!strcasecmp(leveltitle, levelname))
{
return map;
}
sprintf(levelname, "%s %s", mapheaderinfo[map]->lvlttl, mapheaderinfo[map]->actnum);
if (!strcasecmp(leveltitle, levelname))
{
return map;
}
sprintf(levelname, "%s %s", mapheaderinfo[map]->lvlttl, mapheaderinfo[map]->zonttl);
if (!strcasecmp(leveltitle, levelname))
{
return map;
}
sprintf(levelname, "%s %s %s", mapheaderinfo[map]->lvlttl, mapheaderinfo[map]->zonttl, mapheaderinfo[map]->actnum);
if (!strcasecmp(leveltitle, levelname))
{
return map;
}
}
return INT32_MIN;
}
// convert kart map number to native map number
INT16 G_KartMapToNative(INT16 mapnum)
{
@ -1004,14 +1050,12 @@ static void G_HandleAxisDeadZone(UINT8 splitnum, joystickvector2_t *joystickvect
INT32 localaiming[MAXSPLITSCREENPLAYERS];
angle_t localangle[MAXSPLITSCREENPLAYERS];
// Turning was removed from G_BuildTiccmd to prevent easy client hacking.
// This brings back the camera prediction that was lost.
static void G_DoAnglePrediction(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer, player_t *player)
static void G_DoCameraTurn(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer, player_t *player)
{
UINT8 viewnum = G_PartyPosition(g_localplayers[ssplayer-1]);
if (player->mo)
cmd->angle = K_GetKartTurnValue(player, cmd->turning);
cmd->angle = K_GetKartTurnValue(player, cmd->angle);
cmd->angle *= realtics;
@ -1111,6 +1155,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
if (joystickvector.xaxis != 0)
{
cmd->turning -= (tspeed * KART_FULLTURN) / JOYAXISRANGE;
cmd->angle -= (tspeed * KART_FULLTURN) / JOYAXISRANGE;
side += (joystickvector.xaxis * 4) / JOYAXISRANGE;
}
@ -1119,6 +1164,7 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
{
INT32 mousex = gamekeydown[0][KEY_MOUSEMOVE+3] - gamekeydown[0][KEY_MOUSEMOVE+2];
cmd->turning -= (mousex * 8) * (encoremode ? -1 : 1);
cmd->angle -= (mousex * 8) * (encoremode ? -1 : 1);
}
if (spectating || objectplacing) // SRB2Kart: spectators need special controls
@ -1275,12 +1321,17 @@ void G_BuildTiccmd(ticcmd_t *cmd, INT32 realtics, UINT8 ssplayer)
else if (cmd->turning < -KART_FULLTURN)
cmd->turning = -KART_FULLTURN;
if (cmd->angle > KART_FULLTURN)
cmd->angle = KART_FULLTURN;
else if (cmd->angle < -KART_FULLTURN)
cmd->angle = -KART_FULLTURN;
if (cmd->throwdir > KART_FULLTURN)
cmd->throwdir = KART_FULLTURN;
else if (cmd->throwdir < -KART_FULLTURN)
cmd->throwdir = -KART_FULLTURN;
G_DoAnglePrediction(cmd, realtics, ssplayer, player);
G_DoCameraTurn(cmd, realtics, ssplayer, player);
// Reset away view if a command is given.
if ((cmd->forwardmove || cmd->sidemove || cmd->buttons)
@ -1605,15 +1656,6 @@ boolean G_Responder(event_t *ev)
return true;
}
}
else if (gamestate == GS_CONTINUING)
{
return true;
}
// Demo End
else if (gamestate == GS_GAMEEND)
{
return true;
}
else if (gamestate == GS_INTERMISSION || gamestate == GS_VOTING || gamestate == GS_EVALUATION)
if (HU_Responder(ev))
{
@ -2224,20 +2266,12 @@ void G_Ticker(boolean run)
HU_Ticker();
break;
case GS_GAMEEND:
if (run)
F_GameEndTicker();
break;
case GS_EVALUATION:
if (run)
F_GameEvaluationTicker();
HU_Ticker();
break;
case GS_CONTINUING:
break;
case GS_CREDITS:
if (run)
F_CreditTicker();
@ -2254,6 +2288,7 @@ void G_Ticker(boolean run)
if (titlemapinaction)
P_Ticker(run);
F_MenuPresTicker(run);
F_TitleScreenTicker(run);
break;
@ -2548,7 +2583,7 @@ void G_PlayerReborn(INT32 player, boolean betweenmaps)
starpostnum = players[player].starpostnum;
starposttime = players[player].starposttime;
prevcheck = players[player].prevcheck;
prevcheck = players[player].nextcheck;
nextcheck = players[player].nextcheck;
lastsafelap = players[player].lastsafelap;
lastsafestarpost = players[player].lastsafestarpost;
bigwaypointgap = players[player].bigwaypointgap;
@ -3753,11 +3788,11 @@ static INT32 TOLMaps(UINT8 pgametype)
* has those flags.
* \author Graue <graue@oceanbase.org>
*/
static INT16 *okmaps = NULL;
INT16 G_RandMap(UINT32 tolflags, INT16 pprevmap, UINT8 ignorebuffer, UINT8 maphell, boolean callagainsoon, INT16 *extbuffer)
INT16 G_RandMap(UINT32 tolflags, INT16 pprevmap, UINT8 ignorebuffer, UINT8 maphell, INT16 *extbuffer)
{
UINT32 numokmaps = 0;
INT16 ix, bufx;
INT16 *okmaps = NULL;
UINT16 extbufsize = 0;
boolean usehellmaps; // Only consider Hell maps in this pick
@ -3899,12 +3934,9 @@ tryagain:
ix = okmaps[M_RandomKey(numokmaps)];
}
if (!callagainsoon)
{
//CONS_Printf("(freeing okmaps)\n");
Z_Free(okmaps);
okmaps = NULL;
}
//CONS_Printf("(freeing okmaps)\n");
Z_Free(okmaps);
okmaps = NULL;
return ix;
}
@ -4171,7 +4203,7 @@ static INT16 G_GetNextMap(boolean advancemap)
}
else if (cv_advancemap.value == 2) // Go to random map.
{
newmap = G_RandMap(G_TOLFlag(gametype), curmap, 0, 0, false, NULL);
newmap = G_RandMap(G_TOLFlag(gametype), curmap, 0, 0, NULL);
}
else if (nextmap >= NEXTMAP_SPECIAL) // Loop back around
{
@ -4299,7 +4331,7 @@ void G_AfterIntermission(void)
G_StopDemo();
if (demo.inreplayhut)
M_ReplayHut(0);
M_EnterMenu(MN_MISC_REPLAYHUT, true, 0);
else
D_StartTitle();
@ -4310,7 +4342,7 @@ void G_AfterIntermission(void)
if (modeattacking) // End the run.
{
M_ModeAttackEndGame(0);
MR_ModeAttackEndGame(0);
return;
}

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -100,6 +100,7 @@ void weaponPrefChange4(void);
const char *G_BuildMapName(INT32 map);
INT32 G_MapNumber(const char *mapname);
INT32 G_LevelTitleToMapNum(const char * leveltitle);
INT16 G_KartMapToNative(INT16 mapnum);
INT16 G_NativeMapToKart(INT16 mapnum);
@ -274,7 +275,7 @@ FUNCMATH INT32 G_TicsToMilliseconds(tic_t tics);
UINT32 G_TOLFlag(INT32 pgametype);
INT16 G_GetFirstMapOfGametype(UINT8 pgametype);
INT16 G_RandMap(UINT32 tolflags, INT16 pprevmap, UINT8 ignorebuffer, UINT8 maphell, boolean callagainsoon, INT16 *extbuffer);
INT16 G_RandMap(UINT32 tolflags, INT16 pprevmap, UINT8 ignorebuffer, UINT8 maphell, INT16 *extbuffer);
void G_AddMapToBuffer(INT16 map);
#ifdef __cplusplus

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -28,14 +28,12 @@ typedef enum
GS_LEVEL, // Playing, in a level.
GS_INTERMISSION, // Gazing at the intermission screen.
GS_VOTING, // SRB2Kart: MP voting screen
GS_CONTINUING, // continue screen
GS_TITLESCREEN, // title screen
GS_TIMEATTACK, // time attack menu
GS_CREDITS, // credit sequence
GS_EVALUATION, // Evaluation at the end of a game.
GS_GAMEEND, // game end sequence - "did you get all those chaos emeralds?"
// Hardcoded fades or other fading methods
GS_INTRO, // introduction

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2001 by DooM Legacy Team.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2001 by DooM Legacy Team.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2001 by DooM Legacy Team.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2020 by Sonic Team Junior.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2020 by Sonic Team Junior.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -28,6 +28,7 @@
#include "../r_draw.h"
#include "../r_patch.h"
#include "../r_main.h"
#include "../r_bsp.h"
#include "../r_picformats.h"
#include "../p_setup.h"
#include "../p_setup.h" // levelflats
@ -743,7 +744,7 @@ void HWR_FreeMapTextures(void)
{
size_t i;
for (i = 0; i < gl_numtextures; i++)
for (i = 0; i < gl_numtextures*2; i++)
{
FreeMapTexture(&gl_textures[i]);
FreeMapTexture(&gl_flats[i]);
@ -764,10 +765,9 @@ void HWR_FreeMapTextures(void)
static void HWR_PrecacheLevelFlats(void)
{
levelflat_t levelflat;
size_t i;
size_t i, j;
// special case for encore
#ifdef GLENCORE
if (encoremode)
{
// go through all sectors to determine if it should be remapped for encore
@ -784,17 +784,16 @@ static void HWR_PrecacheLevelFlats(void)
// gotta check sector floor and ceiling
for (j = 0; j < 2; j++)
{
const boolean ceiling = (j == 1);
const boolean ceiling = (j == 0);
INT32 pic = ceiling ? sec->ceilingpic : sec->floorpic;
levelflat = levelflats[pic];
HWR_GetLevelFlat(&levelflat, R_NoEncore(sec, ceiling));
HWR_GetLevelFlat(&levelflat, R_NoEncore(sec, &levelflat, ceiling));
}
}
}
else
#endif
{
// on non encore we have it simple
// just load every flat in the level
@ -820,11 +819,7 @@ static void HWR_PrecacheLevelTextures(void)
for (i = 0; i < numlines; i++)
{
line_t *line = &lines[i];
#ifdef GLENCORE
const int noencoremap = ((line->flags & ML_TFERLINE) ? 2 : 1);
#else
const int noencoremap = 1;
#endif
// line checked already?
if (line->validcount == validcount)
@ -874,7 +869,7 @@ static void HWR_PrecacheLevelTextures(void)
HWR_GetTexture(anim->basepic+h, false);
}
}
#ifdef GLENCORE
if (texpresent & 2)
{
for (h = 1; h < anim->numpics; h++)
@ -882,7 +877,6 @@ static void HWR_PrecacheLevelTextures(void)
HWR_GetTexture(anim->basepic+h, true);
}
}
#endif
}
// Sky texture is always present.
@ -901,12 +895,11 @@ static void HWR_PrecacheLevelTextures(void)
{
HWR_GetTexture(i, false);
}
#ifdef GLENCORE
if (texpresent & 2)
{
HWR_GetTexture(i, true);
}
#endif
}
free(texturepresent);
}
@ -999,8 +992,8 @@ void HWR_LoadMapTextures(size_t pnumtextures)
HWR_FreeMapTextures();
gl_numtextures = pnumtextures;
gl_textures = calloc(gl_numtextures, sizeof(*gl_textures));
gl_flats = calloc(gl_numtextures, sizeof(*gl_flats));
gl_textures = calloc(gl_numtextures, sizeof (*gl_textures)*2); // *2 - 1 for encore-remapped texture and another for noencore texture (unused when not in encore)
gl_flats = calloc(gl_numtextures, sizeof(*gl_flats)*2);
if (gl_textures == NULL || gl_flats == NULL)
I_Error("HWR_LoadMapTextures: ran out of memory for OpenGL textures");
@ -1032,11 +1025,7 @@ GLMapTexture_t *HWR_GetTexture(INT32 tex, boolean noencoremap)
I_Error("HWR_GetTexture: tex >= numtextures\n");
#endif
#ifdef GLENCORE
grtex = &gr_textures[tex*2 + (encoremap && !noencore ? 0 : 1)];
#else
grtex = &gl_textures[tex];
#endif
grtex = &gl_textures[tex*2 + (encoremap && !noencoremap ? 0 : 1)];
// Generate texture if missing from the cache
if (!grtex->mipmap.data && !grtex->mipmap.downloaded)
@ -1187,11 +1176,7 @@ void HWR_GetLevelFlat(levelflat_t *levelflat, boolean noencoremap)
return;
}
#ifdef GLENCORE
GLMapTexture_t *grtex = &gr_flats[texturenum*2 + (encoremap && !noencore ? 0 : 1)];
#else
GLMapTexture_t *grtex = &gl_flats[texturenum];
#endif
GLMapTexture_t *grtex = &gl_flats[texturenum*2 + (encoremap && !noencoremap ? 0 : 1)];
GLMipmap_t *grMipmap = &grtex->mipmap;
if (!grMipmap->data && !grMipmap->downloaded)

View file

@ -335,7 +335,7 @@ angle_t gld_FrustumAngle(angle_t tiltangle)
// but at least it doesn't overestimate too much...
clipfov = atan(1 / projMatrix[0]) * 360 / M_PI; // use the actual view of the scene
floatangle = 2.0f + (45.0f + (tilt / 1.9f)) * clipfov / 90.0f;
if (floatangle >= ANGLE_180)
if (floatangle >= 180.0)
return 0xffffffff;
a1 = (angle_t)(ANG1 * (int)floatangle);
return a1;

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2005 by Sonic Team Junior.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -1116,9 +1116,11 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color, UINT32
void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
{
FOutVector v[4];
FBITFIELD flags;
FSurfaceInfo Surf;
float fx, fy, fw, fh;
UINT8 alphalevel = ((color & V_ALPHAMASK) >> V_ALPHASHIFT);
UINT8 blendmode = ((color & V_BLENDMASK) >> V_BLENDSHIFT);
// 3--2
// | /|
@ -1198,6 +1200,8 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
Surf.PolyColor = V_GetColor(color);
flags = HWR_GetBlendModeFlag(blendmode+1)|PF_Modulated|PF_NoDepthTest|PF_NoTexture;
if (alphalevel)
{
if (alphalevel == 13) Surf.PolyColor.s.alpha = softwaretranstogl_lo[st_translucency]; // V_HUDTRANSHALF
@ -1208,7 +1212,7 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
}
HWD.pfnDrawPolygon(&Surf, v, 4,
PF_Modulated|PF_NoTexture|PF_NoDepthTest|PF_Translucent);
flags);
}
#ifdef HAVE_PNG

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -295,7 +295,7 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col
}
// Clamp the light level, since it can sometimes go out of the 0-255 range from animations
light_level = min(max(light_level, 0), 255);
light_level = min(max(light_level, cv_glsecbright.value), 255);
V_CubeApply(&tint_color.s.red, &tint_color.s.green, &tint_color.s.blue);
V_CubeApply(&fade_color.s.red, &fade_color.s.green, &fade_color.s.blue);
@ -1527,31 +1527,6 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
wallVerts[1].y = FIXED_TO_FLOAT(l);
}
// set alpha for transparent walls
// ooops ! this do not work at all because render order we should render it in backtofront order
if (gl_linedef->blendmode && gl_linedef->blendmode != AST_FOG)
{
if (gl_linedef->alpha >= 0 && gl_linedef->alpha < FRACUNIT)
blendmode = HWR_SurfaceBlend(gl_linedef->blendmode, R_GetLinedefTransTable(gl_linedef->alpha), &Surf);
else
blendmode = HWR_GetBlendModeFlag(gl_linedef->blendmode);
}
else if (gl_linedef->alpha >= 0 && gl_linedef->alpha < FRACUNIT)
blendmode = HWR_TranstableToAlpha(R_GetLinedefTransTable(gl_linedef->alpha), &Surf);
else
blendmode = PF_Masked;
if (gl_curline->polyseg && gl_curline->polyseg->translucency > 0)
{
if (gl_curline->polyseg->translucency >= NUMTRANSMAPS) // wall not drawn
{
Surf.PolyColor.s.alpha = 0x00; // This shouldn't draw anything regardless of blendmode
blendmode = PF_Masked;
}
else
blendmode = HWR_TranstableToAlpha(gl_curline->polyseg->translucency, &Surf);
}
// Render midtextures on two-sided lines with a z-buffer offset.
// This will cause the midtexture appear on top, if a FOF overlaps with it.
blendmode |= PF_Decal;
@ -1731,7 +1706,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERSIDES))
continue;
if (rover->fofflags & FOF_INVERTSIDES && (mapnamespace == MNS_SRB2KART || !(rover->fofflags & FOF_ALLSIDES)))
if (!(rover->fofflags & FOF_ALLSIDES) && rover->fofflags & FOF_INVERTSIDES)
continue;
SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
@ -1891,7 +1866,7 @@ static void HWR_ProcessSeg(void) // Sort of like GLWall::Process in GZDoom
if (!(rover->fofflags & FOF_EXISTS) || !(rover->fofflags & FOF_RENDERSIDES))
continue;
if (!(rover->fofflags & FOF_ALLSIDES || (mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_INVERTSIDES)))
if (!(rover->fofflags & FOF_ALLSIDES || rover->fofflags & FOF_INVERTSIDES))
continue;
SLOPEPARAMS(*rover->t_slope, high1, highslope1, *rover->topheight)
@ -2239,7 +2214,7 @@ static void HWR_AddLine(seg_t * line)
angle2 = R_PointToAngle64(v2x, v2y);
// PrBoom: Back side, i.e. backface culling - read: endAngle >= startAngle!
if (angle2 - angle1 < ANGLE_180 || !gl_curline->linedef)
if (angle2 - angle1 < ANGLE_180)
return;
// PrBoom: use REAL clipping math YAYYYYYYY!!!
@ -2749,7 +2724,7 @@ static void HWR_Subsector(size_t num)
if (centerHeight <= locCeilingHeight &&
centerHeight >= locFloorHeight &&
((dup_viewz < cullHeight && ((mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
((dup_viewz < cullHeight && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(dup_viewz > cullHeight && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
if (rover->fofflags & FOF_FOG)
@ -2797,7 +2772,7 @@ static void HWR_Subsector(size_t num)
if (centerHeight >= locFloorHeight &&
centerHeight <= locCeilingHeight &&
((dup_viewz > cullHeight && ((mapnamespace != MNS_SRB2KART && rover->fofflags & FOF_BOTHPLANES) || !(rover->fofflags & FOF_INVERTPLANES))) ||
((dup_viewz > cullHeight && (rover->fofflags & FOF_BOTHPLANES || !(rover->fofflags & FOF_INVERTPLANES))) ||
(dup_viewz < cullHeight && (rover->fofflags & FOF_BOTHPLANES || rover->fofflags & FOF_INVERTPLANES))))
{
if (rover->fofflags & FOF_FOG)
@ -3410,7 +3385,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
}
// push it toward the camera to mitigate floor-clipping sprites
if (!R_ThingIsPaperSprite(spr->mobj)) // but not for papersprites
if (!R_ThingIsPaperSprite(spr->mobj) && !(spr->mobj->terrain && spr->mobj->terrain->floorClip)) // but not for papersprites or for floorclip
{
// Let dispoffset work first since this adjust each vertex
HWR_RotateSpritePolyToAim(spr, baseWallVerts, false);
@ -3465,6 +3440,11 @@ static void HWR_SplitSprite(gl_vissprite_t *spr)
return; // cap
blend = HWR_SurfaceBlend(blendmode, trans, &Surf);
// if sprite has PF_ALWAYSONTOP, draw on top of everything.
if (cv_debugrender_spriteclip.value || spr->mobj->renderflags & RF_ALWAYSONTOP)
blend |= PF_NoDepthTest;
if (!trans && !blendmode)
{
// BP: i agree that is little better in environement but it don't
@ -3869,7 +3849,7 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
float sprdist = 0.0f, distfact = 0.0f;
size_t i;
if (!splat && !R_ThingIsPaperSprite(spr->mobj))
if (!splat && !R_ThingIsPaperSprite(spr->mobj) && !(spr->mobj->terrain && spr->mobj->terrain->floorClip))
{
// Let dispoffset work first since this adjust each vertex
HWR_RotateSpritePolyToAim(spr, wallVerts, false);
@ -3962,6 +3942,11 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
return; // cap
blend = HWR_SurfaceBlend(blendmode, trans, &Surf);
// if sprite has PF_ALWAYSONTOP, draw on top of everything.
if (cv_debugrender_spriteclip.value || spr->mobj->renderflags & RF_ALWAYSONTOP)
blend |= PF_NoDepthTest;
if (!trans && !blendmode)
{
// BP: i agree that is little better in environement but it don't
@ -4894,7 +4879,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
spr_topoffset = spritecachedinfo[lumpoff].topoffset;
#ifdef ROTSPRITE
spriterotangle = R_SpriteRotationAngle(thing, NULL);
spriterotangle = R_SpriteRotationAngle(thing, NULL, &interp);
if (spriterotangle != 0
&& !(splat && !(thing->renderflags & RF_NOSPLATROLLANGLE)))
@ -5016,6 +5001,9 @@ static void HWR_ProjectSprite(mobj_t *thing)
x1 = tr_x + x1 * rightcos;
x2 = tr_x - x2 * rightcos;
if (thing->terrain && thing->terrain->floorClip)
spr_topoffset -= thing->terrain->floorClip;
if (vflip)
{
gz = FIXED_TO_FLOAT(interp.z + thing->height) - (FIXED_TO_FLOAT(spr_topoffset) * this_yscale);
@ -6152,10 +6140,12 @@ static CV_PossibleValue_t glfiltermode_cons_t[]= {{HWD_SET_TEXTUREFILTER_POINTSA
{HWD_SET_TEXTUREFILTER_MIXED3, "Nearest_Mipmap"},
{0, NULL}};
CV_PossibleValue_t glanisotropicmode_cons_t[] = {{1, "MIN"}, {16, "MAX"}, {0, NULL}};
static CV_PossibleValue_t glsecbright_cons_t[] = {{0, "MIN"}, {255, "MAX"}, {0, NULL}};
consvar_t cv_glshaders = CVAR_INIT ("gr_shaders", "On", CV_SAVE, glshaders_cons_t, NULL);
consvar_t cv_glallowshaders = CVAR_INIT ("gr_allowclientshaders", "On", CV_NETVAR, CV_OnOff, NULL);
consvar_t cv_fovchange = CVAR_INIT ("gr_fovchange", "Off", CV_SAVE, CV_OnOff, NULL);
consvar_t cv_glsecbright = CVAR_INIT("gr_secbright", "0", CV_SAVE, glsecbright_cons_t, NULL);
#ifdef ALAM_LIGHTING
consvar_t cv_gldynamiclighting = CVAR_INIT ("gr_dynamiclighting", "On", CV_SAVE, CV_OnOff, NULL);
@ -6217,6 +6207,7 @@ void HWR_AddCommands(void)
CV_RegisterVar(&cv_glspritebillboarding);
CV_RegisterVar(&cv_glshearing);
CV_RegisterVar(&cv_glshaders);
CV_RegisterVar(&cv_glsecbright);
CV_RegisterVar(&cv_glallowshaders);
CV_RegisterVar(&cv_glfiltermode);

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -99,6 +99,7 @@ extern consvar_t cv_glcoronasize;
#endif
extern consvar_t cv_glshaders, cv_glallowshaders;
extern consvar_t cv_glsecbright;
extern consvar_t cv_glmodels;
// SRB2Kart: We don't like these options.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.
@ -96,14 +96,14 @@ static void md2_freeModel (model_t *model)
// load model
//
// Hurdler: the current path is the Legacy.exe path
static model_t *md2_readModel(const char *filename)
static model_t *md2_readModel(const char *filename, modeltype_t modeltype)
{
//Filename checking fixed ~Monster Iestyn and Golden
if (FIL_FileExists(va("%s"PATHSEP"%s", srb2home, filename)))
return LoadModel(va("%s"PATHSEP"%s", srb2home, filename), PU_STATIC);
return LoadModel(va("%s"PATHSEP"%s", srb2home, filename), PU_STATIC, modeltype);
if (FIL_FileExists(va("%s"PATHSEP"%s", srb2path, filename)))
return LoadModel(va("%s"PATHSEP"%s", srb2path, filename), PU_STATIC);
return LoadModel(va("%s"PATHSEP"%s", srb2path, filename), PU_STATIC, modeltype);
return NULL;
}
@ -577,11 +577,13 @@ addskinmodel:
{
if (stricmp(skinname, skins[s].name) == 0)
{
boolean iscompatskin = wadfiles[skins[s].wadnum]->compatmode;
md2_playermodels[s].skin = s;
md2_playermodels[s].scale = scale;
md2_playermodels[s].offset = offset;
md2_playermodels[s].notfound = false;
strcpy(md2_playermodels[s].filename, filename);
CONS_Printf("Added 3D model for skin '%s' %s\n", skins[s].name, iscompatskin ? "in compatibility mode" : "");
goto modelfound;
}
}
@ -641,11 +643,13 @@ void HWR_AddPlayerModel(int skin) // For skins that were added after startup
if (stricmp(skinname, skins[skin].name) == 0)
{
boolean iscompatskin = wadfiles[skins[skin].wadnum]->compatmode;
md2_playermodels[skin].skin = skin;
md2_playermodels[skin].scale = scale;
md2_playermodels[skin].offset = offset;
md2_playermodels[skin].notfound = false;
strcpy(md2_playermodels[skin].filename, filename);
CONS_Printf("Added 3D model for skin '%s' %s\n", skins[skin].name, iscompatskin ? "in compatibility mode" : "");
goto playermodelfound;
}
}
@ -1391,6 +1395,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
spriteframe_t *sprframe;
INT32 mod;
interpmobjstate_t interp;
modeltype_t modeltype = MODELTYPE_SPRITE;
if (R_UsingFrameInterpolation() && !paused)
{
@ -1439,6 +1444,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
{
md2 = &md2_playermodels[(skin_t*)spr->mobj->skin-skins];
md2->skin = (skin_t*)spr->mobj->skin-skins;
modeltype = wadfiles[((skin_t*)spr->mobj->skin)->wadnum]->compatmode ? MODELTYPE_OLDPLAYER : MODELTYPE_PLAYER;
}
else
{
@ -1481,7 +1487,7 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
{
//CONS_Debug(DBG_RENDER, "Loading model... (%s)", sprnames[spr->mobj->sprite]);
sprintf(filename, "models/%s", md2->filename);
md2->model = md2_readModel(filename);
md2->model = md2_readModel(filename, modeltype);
if (md2->model)
{
@ -1657,8 +1663,12 @@ boolean HWR_DrawModel(gl_vissprite_t *spr)
p.angley = FIXED_TO_FLOAT(anglef);
}
// drift frame unrotation hack...
if (modeltype == MODELTYPE_OLDPLAYER && (spr2 == SPR2_DRRN || spr2 == SPR2_DRLN))
p.angley += spr2 == SPR2_DRRN ? 45.0f : -45.0f;
{
fixed_t anglef = AngleFixed(R_ModelRotationAngle(spr->mobj, NULL));
fixed_t anglef = AngleFixed(R_SpriteRotationAngle(spr->mobj, NULL, &interp));
p.rollangle = 0.0f;

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -11,6 +11,7 @@
#include "../doomtype.h"
#include "../info.h"
#include "../z_zone.h"
#include "../r_skins.h"
#include "hw_model.h"
#include "hw_md2load.h"
#include "hw_md3load.h"
@ -145,7 +146,7 @@ tag_t *GetTagByName(model_t *model, char *name, int frame)
// convert it to the
// internal format.
//
model_t *LoadModel(const char *filename, int ztag)
model_t *LoadModel(const char *filename, int ztag, modeltype_t modeltype)
{
model_t *model;
@ -198,7 +199,7 @@ model_t *LoadModel(const char *filename, int ztag)
Optimize(model);
GeneratePolygonNormals(model, ztag);
LoadModelSprite2(model);
LoadModelSprite2(model, modeltype);
if (!model->spr2frames)
LoadModelInterpolationSettings(model);
@ -241,7 +242,7 @@ void HWR_ReloadModels(void)
for (s = 0; s < MAXSKINS; s++)
{
if (md2_playermodels[s].model)
LoadModelSprite2(md2_playermodels[s].model);
LoadModelSprite2(md2_playermodels[s].model, wadfiles[skins[s].wadnum]->compatmode ? MODELTYPE_OLDPLAYER : MODELTYPE_PLAYER);
}
for (i = 0; i < NUMSPRITES; i++)
@ -255,7 +256,7 @@ void LoadModelInterpolationSettings(model_t *model)
{
INT32 i;
INT32 numframes = model->meshes[0].numFrames;
char *framename = model->framenames;
const char *framename = model->framenames;
if (!framename)
return;
@ -264,7 +265,7 @@ void LoadModelInterpolationSettings(model_t *model)
memcpy(&interpolation_flag, framename + offset, 2); \
model->interpolate[i] = (!memcmp(interpolation_flag, MODEL_INTERPOLATION_FLAG, 2));
for (i = 0; i < numframes; i++)
for (i = 0; i < numframes; i++, framename += 16)
{
int offset = (strlen(framename) - 4);
char interpolation_flag[3];
@ -283,87 +284,84 @@ void LoadModelInterpolationSettings(model_t *model)
offset--;
GET_OFFSET;
}
framename += 16;
}
#undef GET_OFFSET
}
void LoadModelSprite2(model_t *model)
void LoadModelSprite2(model_t *model, modeltype_t modeltype)
{
INT32 i;
modelspr2frames_t *spr2frames = NULL;
INT32 numframes = model->meshes[0].numFrames;
char *framename = model->framenames;
const char *framename = model->framenames;
if (modeltype != MODELTYPE_PLAYER && modeltype != MODELTYPE_OLDPLAYER)
return;
if (!framename)
return;
for (i = 0; i < numframes; i++)
for (i = 0; i < numframes; i++, framename += 16)
{
char prefix[6];
char name[5];
char interpolation_flag[3];
char framechars[4];
UINT8 frame = 0;
const char *name;
const char *framechars;
UINT8 frame;
UINT8 spr2idx;
boolean interpolate = false;
boolean interpolate;
boolean super;
memset(&prefix, 0x00, 6);
memset(&name, 0x00, 5);
memset(&interpolation_flag, 0x00, 3);
memset(&framechars, 0x00, 4);
if (strlen(framename) >= 9)
if (modeltype == MODELTYPE_OLDPLAYER)
{
boolean super;
char *modelframename = framename;
memcpy(&prefix, modelframename, 5);
modelframename += 5;
memcpy(&name, modelframename, 4);
modelframename += 4;
// Oh look
memcpy(&interpolation_flag, modelframename, 2);
if (!memcmp(interpolation_flag, MODEL_INTERPOLATION_FLAG, 2))
{
interpolate = true;
modelframename += 2;
}
memcpy(&framechars, modelframename, 3);
size_t j;
spr2idx = SPR2_KART;
if (!spr2frames)
spr2frames = (modelspr2frames_t*)Z_Calloc(sizeof(modelspr2frames_t)*NUMPLAYERSPRITES*2, PU_STATIC, NULL);
if ((super = (!memcmp(prefix, "SUPER", 5))) || (!memcmp(prefix, "SPR2_", 5)))
{
spr2idx = 0;
while (spr2idx < free_spr2)
// i don't care, just iterate the whole array for every model frame
for (j = 0; j < sizeof(kart2spr2)/sizeof(*kart2spr2); j++)
if (kart2spr2[j][0] == i)
{
if (!memcmp(spr2names[spr2idx], name, 4))
{
if (!spr2frames)
spr2frames = (modelspr2frames_t*)Z_Calloc(sizeof(modelspr2frames_t)*NUMPLAYERSPRITES*2, PU_STATIC, NULL);
if (super)
spr2idx |= FF_SPR2SUPER;
if (framechars[0])
{
frame = atoi(framechars);
if (spr2frames[spr2idx].numframes < frame+1)
spr2frames[spr2idx].numframes = frame+1;
}
else
{
frame = spr2frames[spr2idx].numframes;
spr2frames[spr2idx].numframes++;
}
spr2frames[spr2idx].frames[frame] = i;
spr2frames[spr2idx].interpolate = interpolate;
break;
}
spr2idx++;
spr2idx = kart2spr2[j][1];
spr2frames[spr2idx].frames[spr2frames[spr2idx].numframes++] = i;
}
}
if (spr2idx == SPR2_KART) // excess frame?
spr2frames[spr2idx].frames[spr2frames[spr2idx].numframes++] = i;
continue;
}
framename += 16;
if (strlen(framename) < 9 || !((super = !memcmp(framename, "SUPER", 5)) || !memcmp(framename, "SPR2_", 5)))
continue;
name = framename + 5;
// Oh look
interpolate = !memcmp(framename + 9, MODEL_INTERPOLATION_FLAG, 2);
framechars = framename + (interpolate ? 11 : 9);
for (spr2idx = 0; spr2idx < free_spr2; spr2idx++)
if (!memcmp(spr2names[spr2idx], name, 4))
break;
if (spr2idx == free_spr2)
continue; // not found
if (!spr2frames)
spr2frames = (modelspr2frames_t*)Z_Calloc(sizeof(modelspr2frames_t)*NUMPLAYERSPRITES*2, PU_STATIC, NULL);
if (super)
spr2idx |= FF_SPR2SUPER;
if (framechars[0])
{
frame = atoi(framechars);
if (spr2frames[spr2idx].numframes < frame+1)
spr2frames[spr2idx].numframes = frame+1;
}
else
{
frame = spr2frames[spr2idx].numframes;
spr2frames[spr2idx].numframes++;
}
spr2frames[spr2idx].frames[frame] = i;
spr2frames[spr2idx].interpolate = interpolate;
}
if (model->spr2frames)

View file

@ -91,6 +91,13 @@ typedef struct
boolean interpolate;
} modelspr2frames_t;
typedef enum
{
MODELTYPE_SPRITE,
MODELTYPE_PLAYER, // this model uses sprite2!
MODELTYPE_OLDPLAYER, // regular sprite translated to sprite2
} modeltype_t;
typedef struct model_s
{
int maxNumFrames;
@ -104,9 +111,10 @@ typedef struct model_s
char *mdlFilename;
boolean unloaded;
modeltype_t modeltype;
char *framenames;
boolean interpolate[256];
UINT8 interpolate[256];
modelspr2frames_t *spr2frames;
// the max_s and max_t values that the uvs are currently adjusted to
@ -125,11 +133,11 @@ extern model_t *modelHead;
void HWR_ReloadModels(void);
tag_t *GetTagByName(model_t *model, char *name, int frame);
model_t *LoadModel(const char *filename, int ztag);
model_t *LoadModel(const char *filename, int ztag, modeltype_t modeltype);
void UnloadModel(model_t *model);
void Optimize(model_t *model);
void LoadModelInterpolationSettings(model_t *model);
void LoadModelSprite2(model_t *model);
void LoadModelSprite2(model_t *model, modeltype_t modeltype);
void GenerateVertexNormals(model_t *model);
void GeneratePolygonNormals(model_t *model, int ztag);
void CreateVBOTiny(mesh_t *mesh, tinyframe_t *frame);

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2005 by Sonic Team Junior.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2020 by Sonic Team Junior.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2020 by James R.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -922,7 +922,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum)
// Handles key input and string input
//
static inline boolean HU_keyInChatString(char *s, char ch)
/*static inline boolean HU_keyInChatString(char *s, char ch)
{
size_t l;
@ -983,7 +983,7 @@ static inline boolean HU_keyInChatString(char *s, char ch)
return false; // did not eat key
return true; // ate the key
}
}*/
//
//
@ -2142,7 +2142,6 @@ void HU_Drawer(void)
if (!( Playing() || demo.playback )
|| gamestate == GS_INTERMISSION || gamestate == GS_CUTSCENE
|| gamestate == GS_CREDITS || gamestate == GS_EVALUATION
|| gamestate == GS_GAMEEND
|| gamestate == GS_VOTING || gamestate == GS_WAITINGPLAYERS
|| gamestate == GS_BLANCREDITS
) // SRB2kart
@ -2310,14 +2309,27 @@ Ping_gfx_color (int lag)
return SKINCOLOR_MAGENTA;
}
static int
PL_gfx_color (int pl)
{
if (pl <= 2)
return 72;
else if (pl <= 4)
return 54;
else if (pl <= 6)
return 35;
else
return 181;
}
static const UINT8 *
Ping_gfx_colormap (UINT32 lag, boolean gentleman)
Ping_gfx_colormap (UINT32 ping, boolean gentleman)
{
const UINT8 *colormap = NULL;
colormap = R_GetTranslationColormap(TC_RAINBOW, Ping_gfx_color(lag), GTC_CACHE);
colormap = R_GetTranslationColormap(TC_RAINBOW, Ping_gfx_color(ping), GTC_CACHE);
if (servermaxping && lag > servermaxping && hu_tick < 4)
if (servermaxping && ping > servermaxping && hu_tick < 4)
{
// flash ping red if too high
colormap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_RASPBERRY, GTC_CACHE);
@ -2330,41 +2342,52 @@ Ping_gfx_colormap (UINT32 lag, boolean gentleman)
return colormap;
}
//
// HU_drawPing
//
void HU_drawPing(INT32 x, INT32 y, UINT32 lag, INT32 flags, boolean offline)
static UINT32
Ping_conversion (UINT32 lag)
{
INT32 measureid = cv_pingmeasurement.value ? 1 : 0;
INT32 gfxnum; // gfx to draw
boolean drawlocal = (offline && cv_mindelay.value && lag <= (tic_t)cv_mindelay.value);
if (!server && lag <= (tic_t)cv_mindelay.value)
{
lag = cv_mindelay.value;
drawlocal = true;
}
gfxnum = Ping_gfx_num(lag);
if (measureid == 1)
V_DrawScaledPatch(x+11 - pingmeasure[measureid]->width, y+9, flags, pingmeasure[measureid]);
V_DrawScaledPatch(x+2, y, flags, pinggfx[gfxnum]);
if (cv_pingmeasurement.value)
{
lag = (INT32)(lag * (1000.00f / TICRATE));
}
x = V_DrawPingNum(x + (measureid == 1 ? 11 - pingmeasure[measureid]->width : 10), y+9, flags, lag, Ping_gfx_colormap(lag,drawlocal));
return lag;
}
//
// HU_drawPing
//
void HU_drawPing(INT32 x, INT32 y, UINT32 ping, UINT32 mindelay, UINT32 pl, INT32 flags)
{
INT32 measureid = cv_pingmeasurement.value ? 1 : 0;
INT32 gfxnum; // gfx to draw
UINT32 lag = max(ping, mindelay);
gfxnum = Ping_gfx_num(ping);
if (pl)
{
V_DrawFill(
-pinggfx[gfxnum]->leftoffset + x + 2 - 1,
-pinggfx[gfxnum]->topoffset + y - 1,
pinggfx[gfxnum]->width + 2,
pinggfx[gfxnum]->height + 2,
PL_gfx_color(pl) | flags
);
}
if (measureid == 1)
V_DrawScaledPatch(x+11 - pingmeasure[measureid]->width, y+11, flags, pingmeasure[measureid]);
V_DrawScaledPatch(x+2, y, flags, pinggfx[gfxnum]);
x = V_DrawPingNum(x + (measureid == 1 ? 11 - pingmeasure[measureid]->width : 10), y+11, flags, Ping_conversion(lag), Ping_gfx_colormap(ping, ping <= lag));
if (measureid == 0)
V_DrawScaledPatch(x+1 - pingmeasure[measureid]->width, y+9, flags, pingmeasure[measureid]);
V_DrawScaledPatch(x+1 - pingmeasure[measureid]->width, y+11, flags, pingmeasure[measureid]);
}
void
HU_drawMiniPing (INT32 x, INT32 y, UINT32 lag, INT32 flags)
HU_drawMiniPing (INT32 x, INT32 y, UINT32 ping, UINT32 lag, INT32 flags)
{
patch_t *patch;
INT32 w = BASEVIDWIDTH;
@ -2377,16 +2400,10 @@ HU_drawMiniPing (INT32 x, INT32 y, UINT32 lag, INT32 flags)
w /= 2;
}
// This looks kinda dumb, but basically:
// Servers with mindelay set modify the ping table.
// Clients with mindelay unset don't, because they can't.
// Both are affected by mindelay, but a client's lag value is pre-adjustment.
if (server && cv_mindelay.value && (tic_t)cv_mindelay.value <= lag)
patch = pinglocal[1];
else if (!server && cv_mindelay.value && (tic_t)cv_mindelay.value >= lag)
patch = pinglocal[1];
if (ping <= lag)
patch = pinglocal[1]; // stone shoe
else
patch = mping[Ping_gfx_num(lag)];
patch = mping[Ping_gfx_num(ping)];
if (( flags & V_SNAPTORIGHT ))
x += ( w - SHORT (patch->width) );

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -132,8 +132,8 @@ void HU_Drawer(void);
char HU_dequeueChatChar(void);
void HU_Erase(void);
void HU_clearChatChars(void);
void HU_drawPing(INT32 x, INT32 y, UINT32 ping, INT32 flags, boolean offline); // Lat': Ping drawer for scoreboard.
void HU_drawMiniPing(INT32 x, INT32 y, UINT32 ping, INT32 flags);
void HU_drawPing(INT32 x, INT32 y, UINT32 ping, UINT32 mindelay, UINT32 pl, INT32 flags);
void HU_drawMiniPing (INT32 x, INT32 y, UINT32 ping, UINT32 lag, INT32 flags);
INT32 HU_CreateTeamScoresTbl(playersort_t *tab, UINT32 dmtotals[]);

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2011-2020 by Sonic Team Junior.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2011-2020 by Sonic Team Junior.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1998-2000 by DooM Legacy Team.
// Copyright (C) 1999-2020 by Sonic Team Junior.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2020 by James R.
//

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.
@ -220,8 +220,9 @@ void P_ResetData(INT32 flags)
if (init)
{
memset(menudefs, 0, sizeof(menudefs));
M_InitMenuPresTables();
for (i = 0; i < MAXMENUTYPES; i++)
menudefs[i].drawroutine = M_DrawGenericMenu;
menudefs[i].drawroutine = MD_DrawGenericMenu;
nummenutypes = MN_FIRSTFREESLOT;

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 1993-1996 by id Software, Inc.
// Copyright (C) 1998-2000 by DooM Legacy Team.

View file

@ -42,10 +42,7 @@ _(OP_GAMEHUD)
_(OP_OFFSET)
_(OP_CAMERA)
_(OP_P1CAMERA)
_(OP_P2CAMERA)
_(OP_P3CAMERA)
_(OP_P4CAMERA)
_(OP_CAMERASETUP)
_(OP_GAME)
_(OP_BLANKARTGAME)
@ -72,13 +69,12 @@ _(SP_LEVELSTATS)
_(SR_UNLOCKCHECKLIST)
_(MISC_REPLAYHUT)
_(MISC_REPLAYSTART)
_(SR_PANDORA)
_(SR_EMBLEMHINT)
// Addons (Part of MISC, but let's make it our own)
_(AD_MAIN)
// MISC
_(VIEWSERVER)
_(HELP)
_(SPAUSE)
_(MPAUSE)

View file

@ -843,9 +843,6 @@ _(requst)
_(syfail)
_(itfree)
_(dbgsal)
_(typri1)
_(typri2)
_(eggspr)
// Chaining Sound
_(bstchn)
@ -853,6 +850,9 @@ _(bstchn)
// Low Ring Sound
_(ringlw)
// Flip Over Sound
_(flipos)
// Shout message sound effect
_(sysmsg)

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2 KART
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2018-2020 by Sean "Sryder" Ryder
// Copyright (C) 2018-2020 by Kart Krew

View file

@ -1,4 +1,4 @@
// SONIC ROBO BLAST 2 KART
// BLANKART
//-----------------------------------------------------------------------------
// Copyright (C) 2018-2020 by Sean "Sryder" Ryder
// Copyright (C) 2018-2020 by Kart Krew

Some files were not shown because too many files have changed in this diff Show more