Compare commits

...
Author SHA1 Message Date
Alug fb7f3aba79 delet those 2025-08-03 16:31:13 +02:00
Alug 327f7085f6 idk whats up here with the win libs 2025-08-03 16:30:17 +02:00
Alug 8aef549cfc restore optional freeslot stuff 2025-08-03 16:24:35 +02:00
Alug 8dd268b83e fix conflicts 2025-08-03 16:23:00 +02:00
Alug 5fddc3156b Merge branch 'Saturn-Next' into optional-freeslot-test 2025-08-03 16:22:30 +02:00
Alug b0c217201e move flat cyan check into a function
and also limit it to software renderer only
we dont need this anywhere else, so can save a bit of work
2025-08-03 15:59:57 +02:00
Alug dac7026739 use R_GetFlat here
does the exact same thing
2025-08-03 15:59:23 +02:00
Alug 91a4646f19 dont PU_CACHE our planeflats 2025-08-03 15:51:52 +02:00
Alug eba5965220 move rainbow color calc into K_Rainbowcolor 2025-08-03 14:42:49 +02:00
Alug a9d0e2154b clamp software lightlevels before shifting it
was a little oopsie porting this over
,after shifting we only get 32 lightlevels
decided to clamp this in range aswell, just incase
2025-08-02 19:13:23 +02:00
Alug 16a0953d1d fix the "is valid for C/ObjC but not for C++" warnings
fixes https://github.com/Indev450/SRB2Kart-Saturn/issues/192
2025-08-02 01:54:57 +02:00
Alug 737ae08355 dont need to reinit those ever 2025-08-02 01:01:06 +02:00
Alug 6d83a7e187 remove usefulness and volume from sfxinfo_struct struct
those are unused anyways, hope this doesent break shit lol
2025-08-02 01:00:58 +02:00
Alug 56df9b6af3 who tf needs 999999999 sound channels
:chaobaba:
even 255 are kinda overkill lol
2025-08-02 01:00:51 +02:00
Alug 7f2435d821 add an Accessibility options menu
still a work in progress, feel free to suggest more things to add!
2025-08-01 22:26:00 +02:00
Alug b180f29fd9 readd secbright to menu
into advanced video options menu
2025-08-01 21:27:38 +02:00
Alug 32c85f96a4 remove secbright from menu
need to slot it somewhere else but little too lazy atm
2025-08-01 21:27:35 +02:00
chromaticpipe ec83c60320 Configurable sector brightness in software 2025-08-01 21:27:32 +02:00
chromaticpipe fb4a912dba Clamp the lightlevel at the start of HWR_Lighting()
Allows secbright to work without shaders
2025-08-01 21:27:29 +02:00
James R 123b2aa60b lua_hooklib.c: refactor HUD hook call 2025-08-01 21:04:30 +02:00
Logan Aerl Arias bd82a8db29 Update lauxlib.h
lauxlib.h: mark luaL_error as a REPORT function
2025-08-01 21:04:27 +02:00
Alug 6f71fc17c2 mark this as unlikely
those will never run ever after displaying once
2025-08-01 21:04:24 +02:00
Alug d8c3e9f41c fix windows being unable to link with LTO and openmpt
idk why this works but it does, mirrors how it was before the new makefiles
2025-08-01 17:55:02 +01:00
Alug e10345b4de pass "-g" again for lto and asan on windows
for some weird reason it will omit all debug symbols otherwise, which we need for crashlogs and stuff
2025-08-01 17:31:12 +01:00
Alug 2ab66b113c we dont need cv_samplerate with sdl mixer 2025-08-01 04:51:00 +02:00
Alug f64263cf6f remove some unused stuff s_sound 2025-08-01 04:50:57 +02:00
Alug 55c72f32da rename buffersize to audiobuffersize
buffersize was not a good name lel
2025-08-01 04:50:54 +02:00
Alug 53bc12baad init "lenght" in S_AddSoundFx
seems like this never init this lel
2025-08-01 03:58:41 +02:00
Alug b391e763bc fix gme 2025-08-01 03:56:47 +02:00
Alug 2bae0bdb0f indent deez 2025-07-31 23:34:29 +02:00
Alug d42df54901 fix borderless sometimes not toggling on windows
idk why windoze is like this, but gotta call this after SDL_SetWindowFullscreen here
2025-07-31 23:34:28 +02:00
Alug e6256d448f TEST: banish LUA_Step
checking stuff there never seemed to be any garbage left here
so we can just skip this
2025-07-31 21:23:33 +02:00
Alug ad1a980eb1 memset listener outside the loop S_StartSoundAtVolume
same effect, but we dont need to call it multiple times and can be sure this is never unitialized
2025-07-31 19:55:29 +02:00
Alug 1b50858fa6 add a configurable same sound limit
inspired by dsda-doom
in alot of cases the game may play a crapton of the same sound at once, becoming unbearably loud
2025-07-31 19:42:56 +02:00
Alug 3276bbb7b6 restore mumble postional sounds for displayplayers
we essentially always passed 0 before lol
2025-07-31 19:42:53 +02:00
Alug dc00fa3429 fix passing garbage to mumble outside of levels
this just deadass passed the unitialized listener array into mumble
2025-07-31 19:42:37 +02:00
indev dc9276b73c Make 'visit mb.srb2.org/addons' text fit on default resolution ('& make' bit refers more to wiki than mb anyway) 2025-07-31 13:33:48 +03:00
Alug 271d70d6f3 inline HWR_GetTexturePalette
makes ui draw slightly faster from quick test
should be in hw_glob, but cant include hw_main there Zzz...
2025-07-30 15:29:56 +02:00
Alug e52a6c430b smol changes k_hud
nothing crazy mostly just smol reordering
2025-07-30 14:55:44 +02:00
Alug d77d25acf8 use hypotf for P_SegLengthFloat
well its hypot but for floats lel
2025-07-29 19:21:34 +02:00
Alug 9898809f0a remove erronous HWR_FreeExtraSubsectors call
this will be called from within HWR_CreatePlanePolygons anyways
2025-07-29 18:48:02 +02:00
Alug 48768aa13c fix the rare infinite loop hang in ogl (sunset hill map)
use new doom-legacies PointInSeg and add a selfref check to CutOutSubsecPoly
(somewhat related, but it appears this whole file is able to mess with the actual sector planes outside of rendering, this is not really good since it may actually lead to some super hard to debug desynchs)
2025-07-29 18:40:40 +02:00
Alug b1c01a763f cleanup hw_bsp a little
mostly just get rid of debug bloat that isnt even used
adding some branching hints for the I_errors (never seen any one of them happen tbh lel)
and remove some redundant checks
2025-07-29 18:40:02 +02:00
Alug d9bcd6007c move horizonline check to hw_bsp
to where maps also get checked for portals
should speed up levelload slightly
2025-07-29 15:37:14 +02:00
Alug d1b478b3b1 oop 2025-07-29 02:36:45 +02:00
Alug 14b421f533 camera noclip sec special is effectively unused in kart
its not even in the kart zb config
so mark it with unlikely
2025-07-29 02:35:58 +02:00
Alug 7310a8e4df add slope check here
not necessary but may skip more uneeded checks and stuff
2025-07-29 01:23:01 +02:00
Alug c1c3a7dc78 remove unecessary casts for colormap 2025-07-29 00:48:26 +02:00
chromaticpipe ff10b77414 Fix OpenGL flash palettes ignoring saturation 2025-07-29 00:31:10 +02:00
chromaticpipe 4667c332b4 Fix brightness issues with blend textures in Pallette Rendering 2025-07-29 00:31:07 +02:00
Alug 4a9f6b6a22 we dont need to clamp sprite lightlevels everywhere in ogl
theyre an int32 due to the directional light system stuff and get clamped in HWR_Lighting as a result
2025-07-29 00:31:04 +02:00
indev f1d78243d0 Move setting c++ standard bit below 2025-07-27 19:45:10 +03:00
Alug 6e41c8a2a0 readd std=c++17 to cxxflags 2025-07-27 18:42:16 +02:00
Alug 9c5955feb0 Store last ticcmd in a buffer rather than in netcmd
port of https://codeberg.org/srb2classic/srb2classic/commit/fe663f799e733e9a59a95dfd561e506571838554

testing this, since the faketic calc seems a bit "off" to me
2025-07-27 18:29:55 +02:00
Alug 0764b180f7 fixup! next branch
- remove a bunch of clutter
- Fix AATtree stuff by properly balancing it
- replace getcolumn calc with modulo calc
- use strlcpy for some things
- cache wadfile start and endfolders
2025-07-27 18:28:19 +02:00
Alug b883e4e4fe Merge branch 'Saturn-Testing' into Saturn-Next 2025-07-27 18:21:07 +02:00
Alug f78688b684 Merge pull request #189 from Indev450/mmenucleanup
Cleanup m_menu a bit
2025-07-27 17:18:07 +01:00
Alug 097cd5e2ca Merge remote-tracking branch 'origin/Saturn-Next' into mmenucleanup 2025-07-27 18:17:49 +02:00
Alug cd4836ae99 Merge pull request #187 from Indev450/emotes
Add emotes support
2025-07-27 17:16:23 +01:00
Alug f0acf179c2 Merge pull request #185 from Indev450/fixupnet
Cleanup netcode a bit
2025-07-27 17:16:16 +01:00
Alug 836ad12c40 Merge pull request #180 from Indev450/fixgnu23
Make codebase C23 compliant
2025-07-27 17:16:02 +01:00
Alug a147fa3100 Merge pull request #179 from Indev450/unnestmothink
Unnest mobj thinker stuff + cleanup p_mobj
2025-07-27 17:15:55 +01:00
Alug a68a05a838 fix conflict 2025-07-27 15:18:46 +02:00
Alug 95504547df add mobj islocal field
so we can skip the pushable trigger stuff for local mobjs for synch reasons
very sketchy
2025-07-27 15:17:51 +02:00
Alug ceb2a70664 reduce netbuffer scope even further 2025-07-27 15:17:17 +02:00
Alug 8593a1975c Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-27 15:17:09 +02:00
Alug 48d9b2bc98 reduce netbuffer scope even further 2025-07-26 16:19:13 +02:00
Alug 939bf588b3 Merge branch 'Saturn-Next' into fixupnet 2025-07-26 16:19:09 +02:00
Alug a61b028e97 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-22 17:35:21 +02:00
Alug e29bdd09c5 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-21 19:45:01 +02:00
Alug 74b082760d abuse c++ templates for Hwr_AddSprites
test this, but we can avoid a bunch of branching and functions calls like this when drawdist is inifite
2025-07-21 11:56:00 +02:00
Alug 4460fa608b merge fix 2025-07-21 11:55:39 +02:00
Alug 949192c570 branch hints for nights and 2d stuff
gotta keep em for compat reasons Zzz..
2025-07-21 11:49:49 +02:00
Alug 4fa0ca2304 move a bunch of stuff after early returns
+ add some branching instrincts to stuff

maybe saves a bit of time if we dont need the thing
2025-07-21 11:49:44 +02:00
Alug d9d2f043fa use branch instrincts for P_MobjThinker
based on observations from kart stuff
2025-07-21 11:49:00 +02:00
Alug 1ea51f29c5 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-21 11:48:35 +02:00
Alug b0653416f6 Merge branch 'Saturn-Next' into fixupnet 2025-07-20 17:03:30 +02:00
Alug b4570cbdaa Merge branch 'mmenucleanup' into Saturn-Testing 2025-07-16 20:42:45 +02:00
Alug f2dc344bf8 copy paste oopsie 2025-07-15 19:55:13 +02:00
Alug c0654448f0 oop this was unsigned 2025-07-15 19:18:52 +02:00
Alug 2bf3912633 unmangle localskin menu mess a bit 2025-07-15 19:17:06 +02:00
Alug 4d71fb8409 few more things i missed 2025-07-15 18:59:28 +02:00
Alug 8543a099f4 split m_menu definitions to m_menudefs
idk if this is a good idea lel
2025-07-15 18:59:25 +02:00
Alug 9c6ec02b18 do some cleanup m_menu
gets rid of a bunch of duplicated splitscreen shit
unused srb2 stuff
commented out stuff aswell
we dont need any of this
this is def still far from tidy and itll never be like this
2025-07-15 18:59:22 +02:00
Alug bb9118ee32 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-15 18:57:23 +02:00
Alug 1847aac223 fix windoze for the 50 trillionth time
when do we finally remove windows support?
those two things do absolutely fucking nothing but shit dies without em for whatever reason
2025-07-08 17:06:06 +01:00
Alug 14be968089 fix for non pow2 width textures in software from doom-legacy 2025-07-08 16:52:56 +01:00
Alug 9f678263d0 Merge remote-tracking branch 'origin/Saturn-Next' into Saturn-Testing 2025-07-08 16:52:32 +01:00
Alug cb0667921e oop lmao 2025-07-04 12:07:56 +02:00
Alug 52ab27a825 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-04 11:23:26 +02:00
Alug 38b89093fa Merge remote-tracking branch 'origin/emotes' into Saturn-Testing 2025-07-01 19:22:07 +02:00
Alug 224ce007e1 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-01 19:21:58 +02:00
indev 2800685cfc Merge branch 'Saturn-Next' into emotes 2025-07-01 20:15:44 +03:00
Alug 0241d7fe00 Merge branch 'Saturn-Next' into Saturn-Testing 2025-07-01 15:27:39 +02:00
indev 5d8bb3223f No need for this now 2025-07-01 15:25:48 +03:00
indev 5e1f943a38 Merge branch 'Saturn-Next' into emotes 2025-07-01 15:24:42 +03:00
indev fca7b4a837 Use std::min 2025-07-01 15:15:36 +03:00
Alug 02ce2ff5ec Merge remote-tracking branch 'origin/emotes' into Saturn-Testing 2025-07-01 10:31:58 +02:00
indev d2bab80b29 Add emote suggestions and autocompletion 2025-06-30 16:43:14 +03:00
Alug 667a8bb166 "restrict" macro for c++
since it does not have it, use __restrict instead
2025-06-30 12:18:32 +02:00
Alug 76a18d001f friendship with constexpr started 2025-06-30 12:11:45 +02:00
Alug 78ab90c1a6 "restrict" macro for c++
since it does not have it, use __restrict instead
2025-06-30 12:54:15 +03:00
Alug 45b9aeb85a slightly cleanup addline stuff
no clue why i just didnt do this before lel
2025-06-30 08:17:41 +02:00
Alug d580306b8a fix hw_main compiler warning 2025-06-30 08:17:38 +02:00
indev 102e944fd5 Preview emotes in chat input 2025-06-30 00:28:14 +03:00
Alug 3748896ebc thanks michaelsoft very cool 2025-06-29 10:20:33 +01:00
Alug 79988dea3d this makes no sense lol 2025-06-29 10:13:00 +01:00
Alug 4409a5848f Merge branch 'Saturn-Next' into Saturn-Testing 2025-06-29 12:08:06 +02:00
Alug 07c13636fc ceepeepeefy hw_main, abuse templates for portal stuff
no idea if this is faster at all lmao
2025-06-29 11:49:36 +02:00
Alug 51cc706b1e Merge remote-tracking branch 'origin/emotes' into Saturn-Testing 2025-06-29 11:48:33 +02:00
Alug 54bd31c80a Merge branch 'Saturn-Next' into Saturn-Testing 2025-06-29 11:48:18 +02:00
Alug 61534d7356 Merge branch 'softwarecrap' into Saturn-Testing 2025-06-29 11:48:12 +02:00
indev 9bd4a933cf Check if text is inside chat log box for emotes 2025-06-29 00:30:24 +03:00
indev e233635783 huh? 2025-06-29 00:05:25 +03:00
indev da24ba20c7 Fix emotes having not enough 'background' rendered :chonkbunckle: 2025-06-28 22:39:44 +03:00
indev 74bdabc636 Load emotes from base wads too at boot (so it loads ones from -file wads) 2025-06-28 22:31:33 +03:00
indev 4b129314d3 Right that got removed in the end :chonkbunckle: 2025-06-28 21:04:09 +03:00
indev 3a55972997 Initial emote support 2025-06-28 21:03:15 +03:00
Alug 6e04e4171e fix the goddamn boolean 2025-06-28 19:21:45 +03:00
Alug cccfaaabfd proper init enterprecise 2025-06-19 17:48:12 +02:00
Alug eadbe9c2e5 delet this 2025-06-19 17:47:57 +02:00
Alug 9bbabcee06 delet this 2025-06-19 17:47:42 +02:00
Alug 7ca6fa6772 turn translation colormaps stuff into an enum 2025-06-19 17:44:04 +02:00
Alug 6317e9c510 cleanup colormap translation stuff
needs testing
2025-06-19 17:43:56 +02:00
Alug 0a80985771 check if player is local here 2025-06-19 17:41:49 +02:00
Alug 548d52cc60 simplify R_SetupAimingFrame 2025-06-19 17:41:42 +02:00
Alug 11c6c69a00 Merge branch 'softwarecrap' into Saturn-Testing 2025-06-19 17:41:33 +02:00
Alug 08025d2da3 ok git very cool 2025-06-19 17:41:12 +02:00
Gustaf Alhäll 4169e7bd71 Remove aligned allocation functions 2025-06-19 17:41:09 +02:00
Gustaf Alhäll bfb7a6b08d Fix potential NULL deference if memory runs out during cURL request 2025-06-19 17:41:06 +02:00
Alug 58abb0d4c3 Merge remote-tracking branch 'origin/softwarecrap' into Saturn-Testing 2025-06-19 17:40:42 +02:00
Alug 9658279cb1 Merge branch 'fixupnet' into Saturn-Testing 2025-06-19 17:40:34 +02:00
Alug d1a6394e52 Merge remote-tracking branch 'origin/Saturn-Next' into fixupnet 2025-06-19 15:55:22 +02:00
Alug 6f4e387061 Merge branch 'softwarecrap' into Saturn-Testing 2025-06-12 21:47:29 +02:00
Alug 33ef566fd2 Merge remote-tracking branch 'origin/Saturn-Next' into Saturn-Testing 2025-06-12 21:47:26 +02:00
Alug eeecd954e2 Merge branch 'softwarecrap' into Saturn-Testing 2025-06-12 17:19:38 +02:00
Alug ccb804a4ed Merge branch 'fixupnet' into Saturn-Testing 2025-06-12 17:18:09 +02:00
Alug a21029ee9e Merge branch 'Saturn-Next' into Saturn-Testing 2025-06-12 17:17:54 +02:00
Alug ccc90842a7 move CopyCaretColors to m_misc 2025-06-12 17:10:08 +02:00
Alug dc069d7bb5 unnest HandlePacketFromPlayer
+ some cleanup
2025-06-12 00:53:47 +02:00
Alug f4a827dfc2 fix conflicts 2025-06-12 00:02:55 +02:00
Alug 4f3232b6cc Merge branch 'Saturn-Next' into fixupnet 2025-06-12 00:02:05 +02:00
Alug 7393eb728c Merge branch 'Saturn-Next' into Saturn-Testing 2025-06-07 11:56:17 +02:00
Alug 1e715f8cd7 Merge branch 'newmakefiles' into Saturn-Testing 2025-06-07 11:56:13 +02:00
Alug 7aadc77a69 Merge remote-tracking branch 'origin/luamusicdef' into Saturn-Testing 2025-05-31 19:39:39 +02:00
Alug 27e1406e6d Merge branch 'Saturn-Next' into Saturn-Testing 2025-05-31 17:44:33 +02:00
Alug 796204d376 use memcmp during startup map check
prob not faster just looks a bit better tbh
2025-05-31 17:20:46 +02:00
Alug acabd1a03e Merge branch 'votebgstuff' into Saturn-Testing 2025-05-31 17:13:58 +02:00
Alug c08aae2622 Merge branch 'Saturn-Next' into Saturn-Testing 2025-05-31 17:13:00 +02:00
Alug 3eba512ad4 Merge branch 'newmakefiles' into Saturn-Testing 2025-05-29 19:35:34 +02:00
Alug c99115d552 thanks windoze very cool part 2 2025-05-29 17:27:38 +01:00
Alug bf6c682cc1 thanks windoze very cool 2025-05-29 17:16:51 +01:00
Alug dc2f0b5707 Merge branch 'Saturn-Next' into Saturn-Testing 2025-05-29 18:23:08 +02:00
Alug 9488d98cfd Merge branch 'Saturn-Next' into Saturn-Testing 2025-05-29 12:43:04 +01:00
Alug 906b8165d3 dont use stdbool´s bool type
this badly breaks everything
apparently the code assumes boolean to be an interger type or some shit
2025-05-29 12:41:56 +01:00
Alug 74c8325987 Merge branch 'updatewinlibs' into Saturn-Testing 2025-05-28 22:16:37 +02:00
Alug e30efbfe6c Revert "update lzf to 1.6"
This reverts commit 9899747a7f.
2025-05-28 22:16:30 +02:00
Alug 5d4bb0f5ce Merge branch 'Saturn-Next' into Saturn-Testing 2025-05-28 22:14:17 +02:00
Alug e63777c7d6 remove this
prob wrong assumption, our netcode sucks massive ass
2025-05-28 21:42:29 +02:00
Alug a34ca05bff this is testing lel 2025-05-28 20:45:26 +02:00
Alug af9ffc1f6f forgor the hw state lel 2025-05-28 16:37:37 +01:00
Alug 18816453f4 add wireframe mode for ogl 2025-05-28 18:31:21 +02:00
Alug 1eb8a75058 fix compiler warning bout playeringame 2025-05-28 18:30:26 +02:00
Alug 5abf42fe75 remove crappy memcpy redifine from md5 2025-05-28 18:29:18 +02:00
Alug 1306a233b8 Further improve sleep accuracy on UNIX systems
but not for dedis
https://git.srb2.org/STJr/SRB2/-/merge_requests/2583
2025-05-28 18:28:22 +02:00
Alug 46f8c6b7a5 remove forcing c17 from makefile 2025-05-28 18:26:47 +02:00
Alug face5cf447 Merge branch 'fixgnu23' into Saturn-Testing 2025-05-28 18:26:24 +02:00
Alug 603267b753 fix W_CheckNumForFolderStartPK3 2025-05-28 17:47:29 +02:00
Gustaf Alhäll 7cf3113d67 Fix long names using the wrong hash field 2025-05-28 17:47:25 +02:00
Alug 397fa962b1 Optimize lump searching
https://git.srb2.org/Hanicef/SRB2Classic/-/commit/dc608f084c76cf72de9fc3f3f347752f04acae42
2025-05-28 17:47:22 +02:00
Alug d2637ab71f Merge branch 'newmakefiles' into Saturn-Testing 2025-05-28 17:47:01 +02:00
Alug a6e020adeb Merge branch 'texloadstuff' into Saturn-Testing 2025-05-28 17:46:43 +02:00
Alug d50dcac0c0 Merge branch 'unnestmothink' into Saturn-Testing 2025-05-28 17:46:40 +02:00
Alug dd6bc23a8e Merge branch 'updatewinlibs' into Saturn-Testing 2025-05-28 17:46:35 +02:00
Alug 71575f5cf8 Revert "update sdl_mixer to 2.8.1"
This reverts commit b8ae656968.
2025-05-26 22:11:03 +01:00
Alug 3685502edf Revert "delet tic resending stuff"
This reverts commit 17bc8a4a36.
2025-05-26 18:10:03 +02:00
Alug 9899747a7f update lzf to 1.6 2025-05-26 18:02:21 +02:00
Alug d2a415380d oop we still need libgme.dll 2025-05-26 15:15:46 +01:00
Alug dd7ffd7dfe delet GETTEXT and translation stuff 2025-05-26 14:48:31 +01:00
Alug 770f9af5e1 cleanup some stuff 2025-05-26 14:31:53 +01:00
Alug c2ab5be8b8 Merge remote-tracking branch 'origin/winzlib-ng' into updatewinlibs 2025-05-26 13:21:03 +01:00
Alug b8ae656968 update sdl_mixer to 2.8.1
we can also get rid of a bunch of dlls now
2025-05-26 13:12:43 +01:00
Alug 553b61e1f5 update SDL2 to 2.32.6
also removes a bunch of files we dont need
2025-05-26 12:51:45 +01:00
Alug f87bcef079 try fixing some crash with bogus netxcmds 2025-05-23 16:55:47 +02:00
Alug c3458afe2b unglobalise holepunchpacket aswell 2025-05-23 16:53:42 +02:00
Alug 17bc8a4a36 delet tic resending stuff 2025-05-23 16:51:26 +02:00
Alug b04f017ab6 change ticqueue system to be more like srb 2.2
mostly just renaming lel
2025-05-23 16:51:10 +02:00
Alug 083ddb6396 Refactor netbuffer out of global namespace
https://git.do.srb2.org/Hanicef/SRB2Classic/-/commit/079fd2cef97a9cf22fb5d2b66a9b500914efbc72

+ move some things into functions
2025-05-23 16:48:34 +02:00
Alug c3129742c3 simplify cmpack 2025-05-23 16:44:52 +02:00
Alug 877bd640f3 fix destinationnode check in Processackpak 2025-05-23 16:43:52 +02:00
Alug 3233df9c6c do not resolve ipv4 in curl when using ipv6 2025-05-23 16:43:24 +02:00
Alug 9ad5f5189c split portnum retrieval into own function 2025-05-23 16:43:02 +02:00
Alug c7718dea79 fixup! i_tcp
technically make ipv6 work,, but its disabled by default
2025-05-23 16:40:38 +02:00
Alug 5a0fb59b26 Do not reload every texture when adding a wad (squashed)
port of https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1725#c829d21709a4f5cd81d140271e883bc40dd00b1b
2025-05-23 16:16:10 +02:00
Alug 07c52e6af5 static link this to get rid of stinky extra dll
thx indev <3
2025-03-20 14:45:35 +01:00
Alug 405c566038 import zlib-ng in compat mode 2025-03-20 14:31:02 +01:00
Alug 78780799ea delet zlib from windoze 2025-03-20 14:15:38 +01:00
Alug 82b9457aa7 Merge branch 'Saturn-Testing' into winzlib-ng 2025-03-20 13:37:06 +01:00
Alug 4e6abb39dd Merge remote-tracking branch 'origin/rankingsrefactor' into winzlib-ng 2025-03-20 13:34:51 +01:00
indev 14400097dd Only do lookup for mobjtype and states for drift stars and water trails at map load 2024-07-29 01:04:46 +03:00
indev c44c0e10c1 Lets not compile lua code multiple time each frame x) 2024-07-27 03:28:13 +03:00
indev bbf49db184 Oops 2024-07-25 21:24:29 +03:00
indev 15787a97bb Make water trail not use hardcode freeslots too 2024-07-25 21:17:48 +03:00
indev b76ce23ed2 Make drift stars not use hardcode freeslots 2024-07-25 19:02:39 +03:00
Alug d6c5066bfd let autoload run later to mitigate server join issues
itll now run at a similar place to postautoload
this may hopefully prevent some issuess with freeslotting lua
however sadly this makes menu replacements not work at startup anymore
2024-07-25 16:42:33 +02:00
Alug 60783d7109 fix fail condition 2024-07-23 22:02:54 +02:00
Alug db525f15da make backup of kartconfig before writing to it 2024-07-23 21:48:38 +02:00
Alug f33daf6bee toggle palrendering and fbo off if screen textures are disabled 2024-07-23 20:31:34 +02:00
Alug d13928b394 add cam check here 2024-07-23 20:06:01 +02:00
Alug 5613a0d173 reset tilt when respawning 2024-07-23 20:02:20 +02:00
Alug aa38586f82 simplify this 2024-07-23 19:01:44 +02:00
Alug d2b1ceb641 forgor this 2024-07-23 18:56:51 +02:00
Alug 9dd7e9a25f fix up bird screen tilting
removes old lerp variables that did nothing
properly interpolated viewroll
made it proper adjust to mobjscale
doesent roll view when spectating
general cleanup
2024-07-23 18:54:27 +02:00
Alug 1648273ddd allowjoin now sets saturnjoin to its value use CV_StealthSet to prevent
its only for scripts pretty much so no need to toggle it seperately
2024-07-23 17:45:00 +02:00
Alug 3f90e4f12a add "allowsaturnjoin" cvar to let toggle allowjoin for saturn clients seperately 2024-07-23 17:07:59 +02:00
Alug 2b9d565f0c e 2024-07-23 00:59:15 +02:00
Alug 70af63cc94 add to menu 2024-07-23 00:55:48 +02:00
Alug 64b92881f9 changuer how this works
counter decrements - 1 double the cooldown time
2024-07-22 23:36:13 +02:00
Alug be5ea069ad add gamestateresendattempts
so you can specify how often the game tries to resend gamestate to player in given time
so they dont get stuck in a synch loop
this is gamestateresendattempts value in the time of resynchcooldown *2
2024-07-22 23:09:04 +02:00
Alug 71e9357114 add check here too 2024-07-22 22:20:42 +02:00
Alug e28f86ac32 add "gamestatecooldown" cvar
to be able to change the cooldown between gamestate resends
2024-07-22 22:20:38 +02:00
Alug f97fe4bd65 Test: Restore save_p after P_LoadLevel
P_LoadLevel calls some functions that save gamedata and
unset save_p.

this is kinda hacky but i perhaps will port the redone save buffer sometime
2024-07-22 19:51:56 +02:00
Alug 3d0ac03f06 optimize MT_TUBEWAYPOINT
Store waypoints at map load instead of iterating through the thinker list to find them

https://git.do.srb2.org/STJr/SRB2/-/merge_requests/938
2024-07-22 19:51:44 +02:00
Alug 094132b7d3 Make polyobjects agree with sector lighting/colormap like a FOF. 2024-07-22 19:03:14 +02:00
Alug 51b9c9ae5a prevent potential level load crash 2024-07-22 18:13:06 +02:00
Alug d31941ef13 don't check flippedness in HWR_RotateSpritePolyToAim if the mobj is actually a precipmobj! 2024-07-22 18:08:26 +02:00
Alug 48db826142 2 2024-07-22 12:58:28 +02:00
Alug 32b62d19ff add missing copyright stuff to k_director 2024-07-22 12:57:29 +02:00
Alug e4f2961129 lagless cam test 2024-07-21 23:28:29 +02:00
Alug eba09dfad2 Revert "Free mipmaps before freeing tags"
This reverts commit 2437c5a19a.
2024-07-21 23:25:32 +02:00
Alug d9b72fcae6 whitespace hell 2024-07-21 22:51:36 +02:00
Alug 6f17e7f735 revert this
doesent do anything but complicate stuff lol
2024-07-21 22:46:01 +02:00
Alug 047b82acc0 remove hw_light 2024-07-21 22:38:51 +02:00
Alug 5347039d75 cleanup hw_main 2024-07-21 22:23:21 +02:00
Alug edc8095577 cleanup r_things a little 2024-07-21 22:21:01 +02:00
Alug 06f69723c2 fix this oops 2024-07-21 20:22:10 +02:00
Alug 8218fd4f57 stop yelling clang 2024-07-21 20:07:39 +02:00
Alug 6ee22edac5 smol cleanup
also check for splitscreen and if not dont run a for loop lul
2024-07-21 20:07:23 +02:00
Alug 37215ef1f4 clean director up a little
toggling director now resets cooldown so it switches players immediately
also consolidated condition to be active
and ensure DirectorFollowAttack doesent always run when it doesent need to be
2024-07-21 19:35:17 +02:00
Alug a2eb2222b9 more reference fixes 2024-07-21 17:38:06 +02:00
Alug d63b4d9463 Revert "attempt at mitigating palette bug in ogl"
This reverts commit 3bd85c20bc.
2024-07-21 16:21:56 +02:00
Alug 3bd85c20bc attempt at mitigating palette bug in ogl 2024-07-21 16:10:23 +02:00
indev f70063c7d8 Add director hud indicator 2024-07-21 17:03:27 +03:00
Alug a2f7dd7408 fix cmake 2024-07-21 15:45:53 +02:00
indev 147014d43a Add bind for director toggle 2024-07-21 16:11:33 +03:00
Alug 9460d1e9a1 oops 2024-07-21 15:11:28 +02:00
Alug b3a9a6b59a add stuff for directordebugger i forgor 2024-07-21 15:11:01 +02:00
Alug 69f7d669c8 only update director if consoleplayers specs or in demo playback
dont need to update this ever if we dont even use it lol
2024-07-21 14:42:48 +02:00
Alug 74a68b1462 fix crash if everyone spectates 2024-07-21 14:42:17 +02:00
Alug 006ea90493 port director from RR 2024-07-21 14:20:54 +02:00
Alug aede063266 Merge remote-tracking branch 'origin/absolutehell' into lugstuff 2024-07-20 19:47:37 +02:00
Alug 5aaeff4c5d improve virtual resource management 2024-07-19 22:44:12 +02:00
Alug 5f80d6c18d fix hoop midjoin crash in the dumbest way possible
cant figure out why it crashes so thisll do lol
2024-07-19 22:42:50 +02:00
Alug 7c59c9e6ec fix ScreenCoords on 2 plyr splitscreen and shearing
+ remove non 16:10 hack since that issue was fixed elsewhere
2024-07-19 19:25:05 +02:00
Alug aae83b3235 disable hudoffsets in splitscreen 2024-07-19 18:52:53 +02:00
indev 520165128a Add option to play power items sfx for growmusic and supermusic 2024-07-19 18:17:23 +02:00
Alug 556ced63cf whoopss remove test stuff 2024-07-19 14:39:23 +02:00
Alug 063bf830ff make a packet to tell if a joined client is on saturn
initial stuff
works and seems to be vanilla compatible
needs its own function and other things to be useful
2024-07-19 14:38:38 +02:00
Alug 7fd3bd412c reenable gme music position setting 2024-07-19 12:13:20 +02:00
Alug 47b9508af2 lul 2024-07-19 01:22:36 +02:00
Alug 417c44aad0 lül 2024-07-19 01:20:18 +02:00
Alug 1fefa0a99a remove spriteclipshader crap 2024-07-18 15:23:27 +02:00
Alug 06db4d2b62 add audio buffer size into sound menu 2024-07-18 14:43:05 +02:00
Alug bf7fc12a8d revert this in teleport 2024-07-17 22:19:03 +02:00
Alug 395daf57fa Revert "clean up mapload code a little more"
This reverts commit 79a5d174a5.
2024-07-17 12:26:38 +02:00
indev 97219b7a84 Attempt to fix possible use-after-free for awayviewmobj 2024-07-17 11:56:22 +02:00
Alug 0d5d677eff Skip over empty entries when populating vres, saving memory 2024-07-17 11:56:19 +02:00
Alug 3bd6c99a3b vres_GetMap: Count resources in folders up until next 0-length lump
justs in case the order of stuff may be weird
fixes keepmapmusic crash on some maps
2024-07-17 11:56:17 +02:00
Alug 1d2d8d58db clean up mapload code a little more 2024-07-17 11:56:14 +02:00
indev 9909b002fe Fix linedef 415 executing random text if script lump doesn't have null terminator 2024-07-16 15:46:37 +02:00
Alug ccda1ef104 did not mean to add this lol 2024-07-16 10:43:47 +02:00
Alug 52a882bda2 remove this check 2024-07-15 21:58:07 +02:00
Alug 177c60e857 fix more warnings 2024-07-15 21:43:48 +02:00
Alug 0566b96738 fix some warnings in clang 2024-07-15 21:43:46 +02:00
Alug f72c179f56 fix A_ action protottypes 2024-07-15 21:43:44 +02:00
Alug 0da963c794 Revert "fix some clang warnings"
This reverts commit fea89de037.
2024-07-15 21:43:40 +02:00
Alug 7d885f7100 dont access delayremoved thinkers
uhhh
2024-07-15 14:34:33 +02:00
Alug c1c2f794e3 more mobj reference fixes + cleanup 2024-07-15 13:58:08 +02:00
Alug 8bb1c7a032 Revert "run this in actual fullscreen"
This reverts commit 4a2d6b2241.
2024-07-14 18:03:21 +02:00
Alug 804123afc1 ndef 2024-07-14 17:32:33 +02:00
Alug 8e4f278ce4 this does nothing lol 2024-07-14 17:15:31 +02:00
Alug 3193241b11 shut up 32bit gcc 2024-07-14 16:59:54 +02:00
indev edb44fa6a2 Refactor music name scrolling in music test 2024-07-14 16:59:46 +02:00
Alug 66e9ac3657 Free mipmaps before freeing tags
ŝhould hopefully fix some random Z_free crashes
2024-07-14 16:44:09 +02:00
Alug 87e0796bf4 inline M_Memcpy 2024-07-13 15:55:30 +02:00
Alug 6bc6db3665 also use IFCHANGED macro for levelinterpolators
just looks a bit neater
2024-07-13 15:12:43 +02:00
Alug 2a4aa51373 Revert "smol optimization to HWR_Addline"
This reverts commit e6359663b1.
2024-07-13 14:55:28 +02:00
Alug e15b052570 Revert "shut up gcc"
This reverts commit 17a5c6ed06.
2024-07-13 14:55:26 +02:00
Alug 629e249a12 Revert "dont do this with portals"
This reverts commit f949fa54af.
2024-07-13 14:55:21 +02:00
Alug 86a260bb89 fix NOHW compile 2024-07-13 14:54:55 +02:00
Alug 6ab2de2787 shut up windoze 2024-07-11 10:36:27 +02:00
Alug 8effdc1615 Clean up graphic menus
- Renamed Experimental Options to Advanced Options
- Fixed the tooltips not displaying
- Made it look good again
2024-07-10 19:26:40 +02:00
Alug 561fc2d01a only interpolate pitch and roll when using 3d models
sprites dont need this for now
2024-07-10 18:43:20 +02:00
Alug 3fd9cf573b dont think precip mobj angle ever changes 2024-07-10 18:42:42 +02:00
Alug d7c0bed4eb remove those 2 from experimental video menu
no reason to ever toggle them off
2024-07-10 18:35:04 +02:00
Alug afd1f595e1 remove cv_grfofcut
same story
2024-07-10 18:34:45 +02:00
Alug f47a43df2f remove cv_slopepegfix
same as the other ones
2024-07-10 18:34:13 +02:00
Alug 4385327101 remove cv_fofzfightfix
more bloat
2024-07-10 18:33:25 +02:00
Alug 4e73c05ef9 remove R_Pointtoangle toggle
its bloat, the difference is negigble at best
2024-07-10 18:32:57 +02:00
Alug c01ef035a5 remove cv_mobjssector
idk why it even checks for pointinsubsector
2024-07-10 18:31:46 +02:00
Alug b59c080943 fix IFCHANGED macro 2024-07-10 18:31:39 +02:00
Alug 814c65b290 dont do this with portals 2024-07-10 09:21:58 +02:00
Alug 9f1c1c3f18 dont need to check this in precip 2024-07-10 08:49:19 +02:00
Alug e0df7dfba5 shut up gcc 2024-07-10 07:12:58 +02:00
Alug 220db7212f inline some crap 2024-07-10 07:11:38 +02:00
Alug d59f45a26a smol optimization to HWR_Addline 2024-07-10 06:55:47 +02:00
Alug f88d92ecee change when dynamic slopes run depending on if you joined midgame 2024-07-10 06:21:48 +02:00
Alug c28188b6d8 smol cleanup 2024-07-10 05:50:01 +02:00
Alug 80419748db forgor this 2024-07-10 05:45:06 +02:00
Alug 874e6cd5af fix conflict 2024-07-10 05:26:27 +02:00
Alug cd500fc344 clean up P_SetupLevel a little more 2024-07-10 05:25:31 +02:00
Alug ae7afc5749 Map data lump interface
cleans up code alot and stuff

https://git.do.srb2.org/STJr/SRB2/-/merge_requests/535
2024-07-10 05:25:22 +02:00
indev b0fa94c781 Call ServerJoin hook when consoleplayer becomes available, since it is needed for configs (which what this hook is created for) 2024-07-10 05:23:53 +02:00
indev 9bf717fae9 Add info about ServerJoin into LUASTUFF.md (so i don't forget to do it later) 2024-07-10 05:23:47 +02:00
indev 859c1020e6 Add ServerJoin lua hook, which gets called when client joins a server (listen server hosts joining their server also count) 2024-07-10 05:23:22 +02:00
Alug 9108d64820 mitigate dynamic slope desynchs
Perform dynamic slope thinking before other thinkers.
2024-07-10 05:22:38 +02:00
Alug e9d3c1a421 Fix mobj reference management of player->mo
https://git.do.srb2.org/KartKrew/RingRacers/-/commit/d0719ef5ba86a1da32fed171d74eb76c7254f4f6
2024-07-10 05:21:45 +02:00
Alug f36e069f40 unhack this again 2024-07-09 09:06:11 +02:00
Alug 1f5c7b1d12 more changes to dither
use interger for distance scales
start z factor earlier
rename halfResolution to endResolution
2024-07-09 08:39:38 +02:00
Alug 94ecb9e634 ass 2024-07-08 20:49:05 +02:00
Alug b9db67bc08 more tweaks 2024-07-08 20:42:38 +02:00
Alug c152799295 oops that actually didnt fade out at all lol 2024-07-08 20:42:35 +02:00
Alug f91165857d scale and fade out dither pattern
makes the image a bit cleaner and easier to look at in palrender
2024-07-08 20:42:29 +02:00
Alug 29b93f02f1 crap 2024-07-08 20:42:02 +02:00
Alug f9a6452528 simplify this a little 2024-07-08 20:41:27 +02:00
Alug e7e51957e9 oops this should be min 2024-07-08 20:41:17 +02:00
Alug f8903e7ce7 clean up some net stuff 2024-07-08 20:41:10 +02:00
Alug d3548a4dfb Always use system-specific path seperator
https://git.srb2.org/KartKrew/RingRacers/-/commit/0f16c61d04f42b463db5c8987571fc986ae6ce9f
2024-07-08 20:40:51 +02:00
Alug eca72c6dc6 dont think kart even supports trivial maps
so no need to constantly check for this
2024-07-08 20:40:43 +02:00
NepDisk 6e378f4de6 Leave me alonmg kate 2024-07-03 13:04:45 +02:00
Alug 94ac52d792 Clamp lindex during vissprite light calculation
Mitigates against negative or very large xscale values causing lindex
to evaluate < 0, preventing a potential colormap indexing-related crash.
2024-07-03 13:04:11 +02:00
NepDisk 1f276a7eb6 Fix automap multiplayer crash
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2488
2024-07-03 13:03:12 +02:00
Alug a28a590078 prevent potential crash when trying to kill bananachain 2024-07-03 13:02:53 +02:00
Alug 91d052d25e shut up gcc 2024-07-03 13:02:32 +02:00
Alug 2f6ded132d Zzz... 2024-07-03 13:02:29 +02:00
Alug 51cdc1ce90 forgor 2024-07-03 13:02:26 +02:00
Alug 494fe0b1e7 revert software screen shit 2024-07-03 13:02:20 +02:00
Alug eac5310f5e some crap from asan 2024-07-03 13:02:16 +02:00
Alug 7f4a2f9943 fix some clang warnings 2024-07-03 13:02:11 +02:00
Alug 28a31301d4 forgor this crap 2024-07-03 13:01:49 +02:00
Alug 1c5e575718 remove all the ogl fix toggless 2024-07-03 13:01:44 +02:00
Alug 4a2d6b2241 run this in actual fullscreen
somehow makes xwayland happy
2024-07-03 13:01:11 +02:00
Alug 001baec444 scale dithering a little diff for a little smoother "fade" in pal render 2024-07-03 13:01:06 +02:00
Alug 1b35d4f03b stuff 2024-07-03 13:00:57 +02:00
Alug 75fc8cb766 change dither matrix to 4x4
a little grittier also smol cleanup
2024-07-03 13:00:43 +02:00
indev 28bef8c54f Use a fake 2d array in dither shader so it compiles with older glsl versions (1.20 at least) 2024-07-03 13:00:36 +02:00
indev 787973a3d5 If shader compilation failed, print info log 2024-07-03 13:00:31 +02:00
Alug f0e3ca7c1f add gr_lightdithering to shader
mhhm dithering
2024-07-03 13:00:26 +02:00
Alug 1b837a81ef improve teleport interpolation stuff 2024-07-03 13:00:07 +02:00
Alug b74dd85ef2 small optimization to batching 2024-07-03 13:00:01 +02:00
Alug fc9cc62b12 remove this crap
this doesent work on nix anyways
2024-07-03 12:59:54 +02:00
Alug e665edb652 no need for this 2024-07-03 12:59:30 +02:00
Alug e81cde8753 smoller opitmizations 2024-07-03 12:58:40 +02:00
Alug 4e995436c5 optimize ogl polyobjs slightly 2024-07-03 12:58:13 +02:00
Alug c57154a8e5 prevent crash in hw bsp 2024-07-03 12:58:07 +02:00
Alug 31fbba057a remove this again 2024-07-03 12:57:44 +02:00
Alug 46fa6e7ba4 change the shader z shit again 2024-07-03 12:57:17 +02:00
NepDisk bbb0379813 Allow Users to Connect to Servers While In-Game
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2401/
2024-07-03 12:57:09 +02:00
NepDisk 156b63440e Linux customshader compilation fix
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2418/
2024-07-03 12:56:41 +02:00
Alug 20e062b031 move HWR_LoadLevel to hw_main 2024-07-03 12:56:22 +02:00
Alug c98ebc9f35 Try fix glib preallocating too much space for sound freeslots
idk why git keeps removing credits
but thx indev <3
2024-07-03 12:55:57 +02:00
Alug c6001c7bf6 this should be called on mapload 2024-07-03 12:55:42 +02:00
Alug 2d0945264f oops 2 2024-06-20 21:16:47 +02:00
Alug 3d0981cf7b oops 2024-06-20 21:13:50 +02:00
Alug cce581fa51 these appear to be unused so comment them out
dont need 6 arrays being allocated with MAXSKINS for nothing lul
2024-06-20 16:22:13 +02:00
Alug 2446b804c7 forgor this 2024-06-20 03:00:48 +02:00
Alug 20cdb1c5ec limit localskins to 32
hope this doesent just die lol
2024-06-20 02:42:49 +02:00
Alug 212b184320 Do not access memory on misaligned addresses
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2438
2024-06-17 17:11:20 +02:00
Alug 37e98f342c Revert "fix some interpolation issues"
This reverts commit ccb1aecd01d376b0c0d73bbe4c898e89e35e25d0.
2024-06-17 12:51:42 +02:00
Alug 578f5b85dd Revert "more interp fixes"
This reverts commit 3a1a58bcfc.
2024-06-17 12:51:29 +02:00
Alug 99b1e3f969 Revert "attempt at speeding up sdl_render stuff"
This reverts commit f91d3ccf24.
2024-06-17 12:51:20 +02:00
Alug 8c9ef0e8f3 Merge branch 'lugstuff' of https://github.com/Indev450/SRB2Kart-Saturn into lugstuff 2024-06-16 22:41:45 +02:00
Alug f91d3ccf24 attempt at speeding up sdl_render stuff 2024-06-16 22:41:32 +02:00
Alug 691063983e Revert "Test: kill unused skin sounds freeslotting"
This reverts commit b9b97d0a56.
2024-06-16 21:05:40 +02:00
Alug b912047f68 35/2 != 17 = 17.5 ? 2024-06-16 16:17:24 +02:00
Alug f2ddbf1e68 a 2024-06-15 21:16:25 +02:00
Alug 5cd36e55ab Maybe hopefully fix ogl masterserver crash thing
port from durr
2024-06-14 04:01:30 +02:00
Alug 1cb590ebb8 this does not exist 2024-06-14 03:00:40 +02:00
Alug 280e937844 add missing HAVE_THREADS 2024-06-13 14:47:20 +02:00
Alug 5afb55547d opengles 2 seems to be fastest for me lul 2024-06-12 22:31:47 +02:00
Alug e3c91629db use sdl ogl render instead of software for software mode on nix
oops
2024-06-12 22:31:29 +02:00
Alug 1b0496b1e7 fix some clang warnings 2024-06-12 21:56:27 +02:00
Alug b7369b40cb fix oopsie on titled software wöter 2024-06-12 21:49:20 +02:00
Alug 6567313de6 add back le returns 2024-06-12 20:51:34 +02:00
Alug 5ecf3cc36c lower min audio buffersize to 256 2024-06-12 12:59:23 +02:00
Alug 71e3d89181 move that again 2024-06-11 19:47:51 +02:00
Alug a284ece8e4 e 2024-06-11 12:59:00 +02:00
Alug e73e75e740 dumbass hack 2024-06-11 12:58:25 +02:00
Alug 9bfd61fabc shut up compiler 2024-06-11 12:58:17 +02:00
Alug a2aeaa51e8 change this to int64 cause it fixes the intermission thing on high res
idk why that fixes it tbh but it does
2024-06-11 10:02:23 +02:00
Alug b558c3db98 more interp fixes 2024-06-11 01:35:22 +02:00
Alug 0f70bcbf28 basic frame skipping system 2024-06-11 01:16:35 +02:00
Alug f7c4600007 remove windows timing crap again
it actually made stuff a little wonky so revert that
2024-06-11 01:15:32 +02:00
Alug 8910f073e5 fix encore flipcam with ogl shearing 2024-06-09 22:02:46 +02:00
Alug ea18be1866 more lööp stuff 2024-06-09 18:49:41 +02:00
Alug 0bd687eb15 reset those here ig 2024-06-09 18:49:33 +02:00
Alug 25b74bf3dd e 2024-06-09 18:14:22 +02:00
Alug e4f9ca3f3c add mobj check here 2024-06-09 18:13:17 +02:00
Alug 38a3f403bd add check earlier in p_killmobj 2024-06-09 18:03:58 +02:00
Alug 51dd2030a0 maybe fix the sock_send crash on windoze
often happens with unstable net
2024-06-08 19:24:16 +02:00
Alug 7e31067e6a fix redifinition warning 2024-06-06 18:57:04 +02:00
Alug 9bf06ff30b disable upx on nix by default 2024-06-06 18:53:40 +02:00
Alug 85aa726bb7 fix masterserver ifdef 2024-06-06 18:47:06 +02:00
Alug 3a67ff3afa fix HAVE_CURL 2024-06-06 18:42:32 +02:00
Alug 0a022a4348 Revert "instant update after screen mode change"
This reverts commit 02bd819f7e.
2024-06-05 14:42:30 +02:00
Alug ad24beea5b more minor loop stuff 2024-06-05 14:42:23 +02:00
Alug 9026ae7a16 minor sprite opitmizations 2024-06-05 02:27:18 +02:00
Alug 2fee9b861f high dpi test 2024-06-05 01:40:57 +02:00
Alug b7e2bcf02e lol 2024-06-05 01:40:39 +02:00
Alug d548848b18 Reapply "use shader to prevent sprite floor clipping"
This reverts commit 5ec1ca46e5.
2024-06-05 01:28:09 +02:00
Alug 4c628ea74f Revert "zzz..."
This reverts commit e19db23bb5.
2024-06-05 01:28:06 +02:00
Alug d3ef97f637 test remove all the networking crap from rendering code 2024-06-04 17:11:30 +02:00
Alug 02bd819f7e instant update after screen mode change 2024-06-04 17:11:12 +02:00
Alug ea3b4ddeb0 smol optimization to skin loading 2024-06-04 17:10:24 +02:00
Alug ab3ea7475f think this should be casted to angle_t 2024-06-04 17:08:09 +02:00
Alug b9b97d0a56 Test: kill unused skin sounds freeslotting 2024-06-03 18:47:59 +02:00
Alug e19db23bb5 zzz... 2024-06-03 17:15:16 +02:00
Alug 5ec1ca46e5 Revert "use shader to prevent sprite floor clipping"
This reverts commit ee2ec01eb9.
2024-06-03 17:11:58 +02:00
Alug c2c918fdda Revert "fix le dispoffset"
This reverts commit f977af6a80.
2024-06-03 17:11:55 +02:00
Alug 4627989401 Make sfxinfo_t and state_t use field tables too 2024-06-03 17:02:27 +02:00
indev 9552e09471 Lua_optoption shouldn't change stack state at the end of call now 2024-06-03 17:02:14 +02:00
indev c8fb25066b Fix compilation for some gcc versions 2024-06-03 17:02:10 +02:00
Alug b1cb6d42f4 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-06-03 17:01:22 +02:00
Alug caf7e4a1cf stuffs 2024-06-01 17:03:27 +02:00
Alug 6a5c0223c4 forgor to remove that 2024-06-01 16:31:49 +02:00
Alug 9ff2d66079 fix papersprites in software (hopefully)
lul
2024-06-01 16:29:20 +02:00
Alug 2db2b9309d flexible array stuff for columnofs
hopefully this fixes some crashes or smth
2024-05-31 23:04:26 +02:00
Alug 7a38c15d59 cleanup some super old stuff that did nothing
lul
2024-05-31 22:43:49 +02:00
Alug cb7375f873 theres no value 3 oops
i shouldnt do stuff after waking up at 4 in the morning lol
2024-05-30 19:59:01 +02:00
Alug 41e52f9e88 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-05-30 19:10:03 +02:00
Alug ce7e30a752 smth smth encore magic numbers idk 2024-05-28 22:38:20 +02:00
Alug 3214811fcb casting stuff 2024-05-28 22:22:58 +02:00
Alug edda2a5399 that should be there lul 2024-05-28 22:22:48 +02:00
Alug 926bc8e72c split sprite draw loops
so crap doesent constantly check for papersprites on all sprites
2024-05-28 20:55:03 +02:00
Alug eadffb6be3 make r_fps if else hell a bit more bearable to look at
lol lmao
2024-05-28 20:28:27 +02:00
Alug cf04e8c23c scale precip size with mobjscale 2024-05-28 20:07:12 +02:00
Alug ec5840f840 scale sprite draw distance with mapobjscale 2024-05-28 20:02:54 +02:00
Alug 7dc4a7177d shut up gcc 2024-05-28 01:07:13 +02:00
Alug 3d91de8178 when not using screentextures draw kart bg on intermission screen 2024-05-28 00:52:40 +02:00
Alug 6ea1abfedc draw a black screen instead of "nothing" during wipes on disabled screentextures
should resolve the intense flashing that can occur
2024-05-28 00:52:09 +02:00
Alug 5251482dd7 Optimize field lookups in Lua metatables
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2024#cd5b5ee262bf5129c4d400ad60d006e1fa917c1f
2024-05-27 18:14:59 +02:00
Alug dd73787c8b Revert "optimize precip thinker"
This reverts commit bc382366a1.
2024-05-25 19:54:20 +02:00
Alug 340450a67e Revert "lol"
This reverts commit 0d40989f4c.
2024-05-25 19:54:13 +02:00
Alug 0d40989f4c lol 2024-05-25 19:00:07 +02:00
Alug c640096d9c Merge remote-tracking branch 'ghghghghghg/lua-hudinterpolate-redux' into lugstuff 2024-05-25 17:23:49 +02:00
indev 76081869e3 Store hooks in a table with integer keys instead of registry with string keys 2024-05-25 15:45:20 +02:00
Alug 9156c1b850 use ternary 2024-05-25 15:44:33 +02:00
Alug d78718d8f4 make only player dust be sparkle otherwise normal driftdust 2024-05-25 15:40:22 +02:00
Alug eef1e986a6 add proper check to sparkle lol 2024-05-25 15:28:41 +02:00
Alug 8fa99c34be Revert "ok kill this again ig"
This reverts commit 98c27fe8ef.
2024-05-25 15:07:07 +02:00
Alug a35fbdd1b5 move some cvars to be registerrerd latur in ogl 2024-05-25 14:50:24 +02:00
Alug 0efef78684 Turn of FBO downsampling when you turn off screen textures
fbo downsampling needs those and if theyre disabled youre essentially seeing nothing at all lol
2024-05-25 14:43:52 +02:00
Alug 62ce17cb4c super smol optimization to R_DrawRepeatMaskedColumn
only maths once not twice lul
2024-05-25 14:37:30 +02:00
Alug 6112be232a revert solidcol stuffs i did ages ago apparently lol 2024-05-25 12:57:41 +02:00
Alug c1a9c58eb5 Cull BSP behind a raised floor or lowered ceiling that covers the entire screen
https://git.do.srb2.org/KartKrew/RingRacers/-/commit/7b8a564f69688515319ccd425f2b88ffe8b7b120
2024-05-25 02:02:06 +02:00
Alug 0393588fe8 Only call the Lua API for overridden actions 2024-05-25 01:35:44 +02:00
Alug b7ff0325ea optimize sight checks 2024-05-25 00:08:14 +02:00
Alug c4d39eae25 declare outside of lööp also add const in r_ 2024-05-25 00:01:58 +02:00
Alug 0e88981425 Cache water trail mobjs from qtpie dev
cant really cherry pick so uuuh
2024-05-23 22:23:39 +02:00
Alug ed7fcae33b Merge remote-tracking branch 'ghghghghghg/lua-hudinterpolate-redux' into lugstuff 2024-05-23 20:29:22 +02:00
Alug 8b967fb3b7 change wöter visual thing 2024-05-23 20:16:37 +02:00
Alug 4d68a5dc2b change names to be less basic 2024-05-23 19:25:04 +02:00
Alug ecd6ef40ef allow gamepad dpad to hold scroll shit in menu aaa
absolute arsepain cant wait to see this breaking kek
2024-05-23 19:11:11 +02:00
Alug 0c9dc33ff0 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-05-21 21:15:21 +02:00
Alug 98c27fe8ef ok kill this again ig 2024-05-20 22:46:29 +02:00
Alug 3d490f52b2 a 2024-05-20 22:18:17 +02:00
Alug c78c17d953 funny driftsparkle 2024-05-20 22:18:15 +02:00
Alug ee5d667a24 changes to woter thing 2024-05-20 19:23:46 +02:00
Alug b9653b4ff8 unhack the animated votescreen a little
also make it pause when the game is paused like it was intended originally
2024-05-20 17:18:06 +02:00
Alug 78bcfa8cfa conflict moment 2024-05-20 13:40:47 +02:00
Alug 1f1130efda Merge remote-tracking branch 'origin/Saturn' into lugstuff 2024-05-20 13:39:00 +02:00
Alug 3d7b05d633 forgor this crap 2024-05-15 16:54:41 +02:00
Alug 343bbd8a1a support gcc14 ig 2024-05-13 20:48:32 +02:00
Alug f702df48f5 kept forger to declare this 2024-05-13 20:48:21 +02:00
Alug bc382366a1 optimize precip thinker 2024-05-06 01:18:57 +02:00
Alug c158144b7b Revert "refactor weather stuff"
This reverts commit dc95b2e8d7.
2024-05-06 00:33:38 +02:00
Alug d4337fbc56 Revert "optimize-precip-thinker"
This reverts commit e822d8e7d1.
2024-05-06 00:33:36 +02:00
Alug e822d8e7d1 optimize-precip-thinker 2024-05-06 00:32:57 +02:00
Alug dc95b2e8d7 refactor weather stuff
not netsafe
2024-05-06 00:05:16 +02:00
Alug d226ad38ff Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-05-05 22:02:07 +02:00
Alug 2a160c5247 goddamn synched sound effect aaa 2024-05-05 13:00:14 +02:00
Alug 641a9dc4e2 Revert "follower crap cause i want smol spb"
This reverts commit 1b963c9439.
2024-05-04 01:58:58 +01:00
Alug 7e71af8d25 durr water stuff uhhhhhhh
hope this wont break lmao
2024-04-29 10:12:33 +02:00
Alug 8e33d2e1b2 simplify SOFTLIGHT alot
also should make sure it gets applied everywhere lul
2024-04-29 09:12:44 +02:00
Alug 61118b348c Merge remote-tracking branch 'ghg/lua-hudinterpolate-redux' into lugstuff 2024-04-25 18:41:10 +02:00
Alug 84faff82a2 fix rare precip crash 2024-04-25 17:08:02 +02:00
Alug d6cf7cc06f funny wöter from durr 2024-04-25 16:12:53 +02:00
Alug 0688b94729 update libbacktrace windows lib 2024-04-24 21:26:50 +02:00
Alug 695f53194d inline those 2024-04-24 10:59:09 +02:00
Alug 1b963c9439 follower crap cause i want smol spb
will softcode crap sometime idk
2024-04-23 12:47:18 +02:00
Alug b50d6dd389 Merge remote-tracking branch 'origin/it-cv-bigfloat' into lugstuff 2024-04-22 05:26:51 +02:00
Alug 2afad9490e Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-04-22 05:26:36 +02:00
Alug 812a275add fix some visual issues with fofs 2024-04-22 05:24:49 +02:00
Alug 90ccf7699b a 2024-04-20 22:52:22 +02:00
Alug 31ed12d88a some stuff from ceepeepeecheck 2024-04-20 22:36:23 +02:00
Alug 5a4e44d064 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-04-20 12:34:03 +02:00
Alug 515c67fa3a disable palette rendering if screentextures aint enabled 2024-04-19 06:21:58 +02:00
Alug 81d60165a3 z 2024-04-19 05:08:47 +02:00
Alug cc0fac3546 more things
-Fix a division by zero in BCZ2 Metal Sonic's routine
-Fix a bug where adding the same mod multiple times counted towards the mod limit
and other thigns
2024-04-19 04:49:12 +02:00
Alug d71ad13fcf some smol fixes 2024-04-19 04:22:29 +02:00
Alug 0d13811305 Make FixedRem less laggy by just using the modulo operator. 2024-04-19 03:52:21 +02:00
Alug b69cc4e34a Revert "port thinkerlists + cache and reuse mobjs for the 420th time"
This reverts commit bd8a392882.
2024-04-19 03:38:59 +02:00
Alug caf8f383ad Revert "change a few things"
This reverts commit c5c61f7692.
2024-04-19 03:38:55 +02:00
Alug 7db160a8e2 Revert "i dont understand this crap so ill revert it"
This reverts commit 7e895f82b2.
2024-04-19 03:38:52 +02:00
Alug 202a3d1fb1 Revert "some cleanup"
This reverts commit 332135fc6f.
2024-04-19 03:38:49 +02:00
Alug 332135fc6f some cleanup 2024-04-18 23:10:35 +02:00
Alug 7e895f82b2 i dont understand this crap so ill revert it 2024-04-18 14:14:51 +02:00
Alug c5c61f7692 change a few things 2024-04-18 13:40:27 +02:00
Alug bd8a392882 port thinkerlists + cache and reuse mobjs for the 420th time
i am in pain
2024-04-18 12:07:57 +02:00
Alug 36183e6dc8 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-04-17 05:34:51 +02:00
Alug 5ae4af54da smth smth paranthesis 2024-04-12 21:55:45 +02:00
Alug 620bdd1419 Merge branch 'lugstuff' of https://github.com/Indev450/SRB2Kart-Saturn into lugstuff 2024-04-12 20:41:16 +02:00
Alug c18eacbb81 fix software crash
Zzz...
2024-04-12 20:41:10 +02:00
Alug bb8acc5f51 fkldjnasofjosdfoisfj 2024-04-11 19:48:42 +02:00
Alug d41f4810d7 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-04-11 18:39:58 +02:00
indev 387c4edb3b Fix potential negative array index in V_ThinStringWidth 2024-04-11 18:00:01 +02:00
Alug c3fd7c1a7a grrrr 2024-04-10 18:21:11 +02:00
Alug 94f1ec18de Revert "fix ifdefs"
This reverts commit 5e8e2f4b3a.
2024-04-10 18:19:24 +02:00
Alug e00f8f6cee Revert "Zzz..."
This reverts commit 79b0a9c833.
2024-04-10 18:19:21 +02:00
Alug 79b0a9c833 Zzz... 2024-04-10 18:15:42 +02:00
Alug 5e8e2f4b3a fix ifdefs 2024-04-10 17:59:41 +02:00
Alug f0158dd915 move this to first init too 2024-04-10 17:58:06 +02:00
Alug 10cf251b46 that wasnt the onchange im sleepy 2024-04-10 17:40:35 +02:00
Alug 72231e5658 forgor to remove those Zzz... 2024-04-10 17:32:06 +02:00
Alug c510ff3b1c should throw that into onchange oops 2024-04-10 17:29:08 +02:00
Alug 936e138fee throw stuff into own function, also check on game start 2024-04-10 17:24:03 +02:00
Alug 8325696b55 put those in 1st init 2024-04-10 07:05:38 +02:00
Alug d63f517ae5 simplify this crap 2024-04-10 07:02:03 +02:00
Alug e74df8db90 raise max fpscap 2024-04-10 06:47:45 +02:00
Alug 1a0bf67452 Merge remote-tracking branch 'origin/fborender' into lugstuff 2024-04-09 17:38:44 +02:00
Alug f0df9b399b Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-04-05 17:40:19 +02:00
Alug f9345308ff Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-04-05 01:45:11 +02:00
Alug 6ed7c75448 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-04-04 03:57:32 +02:00
Alug cb71167fb7 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-04-02 16:40:37 +02:00
Alug d4292987cc Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-04-02 16:14:35 +02:00
Alug 5da24a18dc Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-04-02 15:54:06 +02:00
Alug 1cf7b3e697 tf 2024-04-02 03:51:36 +02:00
Alug 3f3672497b Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-04-02 03:49:01 +02:00
Alug 7714304c7a Merge remote-tracking branch 'origin/Saturn' into lugstuff 2024-04-01 19:15:13 +02:00
Alug ff640639b2 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-04-01 03:52:55 +02:00
Alug 0965603c8f Merge remote-tracking branch 'origin/interpjitter' into lugstuff 2024-04-01 03:52:52 +02:00
Alug b8412cec96 Fix minor off-by-one error in faketic calculation 2024-03-31 23:22:26 +02:00
Alug 86b7e192b2 fix this for splitscreen and move to own function 2024-03-30 03:34:38 +01:00
Alug 32b9e6094b Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-03-28 15:07:00 +01:00
Alug 3ff7f3158b why tf is that here 2024-03-28 14:58:44 +01:00
Alug bd83ba8ca9 when the GLENCORE 2024-03-28 13:21:58 +01:00
Alug 785881c90e fixeur compile for qt 2024-03-28 12:23:07 +01:00
Alug 567ccf8a59 use this instead 2024-03-28 08:13:16 +01:00
Alug 11423a6d78 fix highresscale issue on startup in the worst way ever cause CV_NOINIT doesent work for whatever reason 2024-03-28 00:15:44 +01:00
Alug ab6b716e78 Read only header bytes when creating textures list 2024-03-27 21:31:45 +01:00
Alug 7b1be2e34f Ehh this thing is enough tbh 2024-03-27 20:32:14 +01:00
Alug 19d0d247b4 right v6 lul 2024-03-27 18:26:20 +01:00
Alug 1074a9e1d2 Prevent dropped ticcmds due to interp timing jutter
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2046
2024-03-27 18:17:27 +01:00
Alug 0648f384bb kill some stuff that did nothing 2024-03-27 18:13:39 +01:00
Alug 58d72204cc offline play menu pauses game so gib cool vhs effect 2024-03-27 15:51:47 +01:00
Alug 067b4c260f handle async vsync fail better
a
2024-03-27 14:44:02 +01:00
Alug 9e7e4d5fe7 testing smth
yes -1 is valid for this sometimes
2024-03-27 12:11:45 +01:00
Alug 7d9609be76 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-03-27 04:35:47 +01:00
Alug 7e510f8bc5 Merge remote-tracking branch 'origin/texload' into lugstuff 2024-03-26 20:42:39 +01:00
Alug a16e009370 make custom buttons bindable to joyaxis
triggers and such
2024-03-25 21:13:47 +01:00
Alug a021c497b6 forgor to remove this 2024-03-25 17:22:21 +01:00
Alug e77159cb58 remove this too 2024-03-24 20:18:31 +01:00
Alug 36ac353f1f Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-03-24 20:16:27 +01:00
Alug 58122bf023 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-03-24 18:30:21 +01:00
Alug c5da23bb02 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-03-24 16:56:14 +01:00
indev fd45391616 Fix drift sound keep playing when player go off ground 2024-03-24 15:12:02 +01:00
Alug 11dd80e4e7 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-03-24 15:11:53 +01:00
Alug 298f8ef842 Fix crash when passing a long string to v.drawString
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2403
2024-03-24 15:10:14 +01:00
Alug 4c45b9fb85 dfsafsdf 2024-03-23 19:13:14 +01:00
Alug 599cea3238 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-03-23 19:08:59 +01:00
Alug 0c5685e9eb dont need this anymore now 2024-03-23 18:07:58 +01:00
Alug 760b82fd63 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-03-23 18:07:08 +01:00
Alug 340034adf7 this can be just M_PI 2024-03-21 12:52:40 +01:00
Alug d978bfd0db Revert "Add common I_GetSysName function"
This reverts commit f3eedc03e6.
2024-03-21 12:40:44 +01:00
Alug de9f9722ac reapply hacky scaling thing 2024-03-21 12:38:50 +01:00
Alug 4dd9dc03fe ok git 2024-03-21 12:37:58 +01:00
Alug 47fc4aa39a Merge remote-tracking branch 'ghg/hud-uncap' into lugstuff 2024-03-21 12:36:29 +01:00
Alug 84ad608d70 Revert "software sdl windows scaling quality setting"
This reverts commit 7ee6de6b6a.
2024-03-21 12:35:00 +01:00
Alug d4dd0c9992 conflict fix 2024-03-21 12:33:43 +01:00
Alug ac93d027af Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-03-21 12:31:01 +01:00
Alug 190a95584c SFC32 for M_random funcs
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1780
2024-03-19 11:15:23 +01:00
Alug 9ad368e420 e 2024-03-17 23:32:09 +01:00
Alug a524215479 add the note so i dont forger if i wanna update this again 2024-03-17 22:43:05 +01:00
Alug 6104c36455 properly link libopenmpt
one dll instead of 4
2024-03-17 22:37:18 +01:00
Alug a04287c9f6 cute icon 2024-03-17 19:29:40 +01:00
indev 99876e3f73 Fix 'cast to non-matching type' warning 2024-03-17 14:57:02 +01:00
indev f16f498f27 Add include guard for qs22j.h 2024-03-17 14:56:37 +01:00
indev 4f9b5923bd Add snap to top flag for pause gfx 2024-03-15 12:54:06 +01:00
Alug 84476cd51f this didnt work 2024-03-15 11:32:33 +01:00
Alug bf9a6bde82 test this 2024-03-15 11:32:24 +01:00
Alug a6f8f57725 testing smth 2024-03-14 07:44:07 +01:00
Alug 02f4c334f0 mhhm ternaries 2024-03-13 22:06:45 +01:00
Alug 9884b294c6 i want to see more precip thx 2024-03-13 21:55:23 +01:00
Alug 49f22b5790 revert some stuff that broke some stuff 2024-03-13 19:25:14 +01:00
Alug 841270e824 fix ogl precip interpolation 2024-03-13 17:56:08 +01:00
Alug 630ce57303 this looks better lul 2024-03-13 13:18:30 +01:00
Alug 94aed4d1d1 clean up 2024-03-13 10:16:07 +01:00
Alug cdc0ec96a9 forgor menu stuff 2024-03-13 10:07:51 +01:00
Alug 751188bcd8 remove xs_CRoundToInt
while ye, less exact stuff doesent matter too much in the context of doom, it matters more in kart, due to polygon rendering and seg processing being extremely heavy and also generally more complex maps
2024-03-13 10:06:56 +01:00
Alug c0c44d46bc Ensure opaque midtextures always use PF_Masked 2024-03-13 08:48:04 +01:00
Alug 19d8749abf Revert "inline some things"
This reverts commit 0b47c310eccf55871a5bd466f44afa3215cc1322.
2024-03-13 08:35:47 +01:00
Alug c6f9fb2ac2 Revert "optimize "p_pointon" functions"
This reverts commit b9b963f999b902ab7f0f6fae4ec61264e713e15e.
2024-03-13 08:35:44 +01:00
Alug b1cfdfbc14 Revert "optimize fixedhypot"
This reverts commit ae68bd577558f45b81741396a899b7c311f753fc.
2024-03-13 08:35:41 +01:00
Alug 360df11aa6 Revert "LUT for bmapwidth imul instructions."
This reverts commit e45a7f911f0d156b7cc38675bec1a14a2080c367.
2024-03-13 08:35:30 +01:00
Alug d88cc3251f Revert "fix some oopsies"
This reverts commit 578770818ed96e366bbe9ed5ede720de07c0000a.
2024-03-13 08:35:27 +01:00
Alug cd7079da92 Revert "Zzz...."
This reverts commit e05197af882049e555c4116d1e6b4fd5ec4e879d.
2024-03-13 08:35:24 +01:00
Alug 77a0e8213b Revert "Zzz... 2"
This reverts commit bdd32702f9dc3ccbefb6444f1b76329b8ddbc9d7.
2024-03-13 08:35:20 +01:00
Alug 5efa778509 Revert "adjust the pointon funcs again"
This reverts commit b5861b2beeb04b6de1fcbd2088069374658f31ee.
2024-03-13 08:35:12 +01:00
Alug 02e6463fae Revert "P_PointOnDivlineSide stuff"
This reverts commit 1fa738d46448bd716547aa1812e38ec0de2221d1.
2024-03-13 08:35:09 +01:00
Alug b411787fe7 Revert "forgor"
This reverts commit 28950e6a15a3350da9a7441d81e3e043985a6c8d.
2024-03-13 08:34:59 +01:00
Alug 8fd91194a7 hm 2024-03-13 07:36:52 +01:00
Alug 4f85e1d603 revert that part 2024-03-13 07:34:12 +01:00
Alug fae0aeb442 Revert "Revert "forgor""
This reverts commit a1afcbc855.
2024-03-13 07:31:56 +01:00
Alug ec77824a96 Revert "Revert "dont inline those""
This reverts commit ae829375a0.
2024-03-13 07:31:53 +01:00
Alug 4127936eef optimize HWR_AddLine and HWR_ProcessSeg 2024-03-13 07:28:16 +01:00
Alug ae829375a0 Revert "dont inline those"
This reverts commit 2e34de8a125644dd7a0689af28b2076cf4c92e21.
2024-03-13 06:51:26 +01:00
Alug a1afcbc855 Revert "forgor"
This reverts commit e1e3aa899d.
2024-03-13 06:51:21 +01:00
Alug e1e3aa899d forgor 2024-03-13 06:07:59 +01:00
Alug 2644a3bf6e dont inline those 2024-03-13 06:03:19 +01:00
Alug 6b4e81e1ec P_PointOnDivlineSide stuff 2024-03-13 06:00:37 +01:00
Alug c705a0f35a adjust the pointon funcs again 2024-03-13 04:51:48 +01:00
indev b1b3102b31 If game crashes in level, add it to crash report 2024-03-12 18:51:00 +01:00
Alug 2d823d34f9 Fix buffer overrun in I_ClipboardPaste
https://git.do.srb2.org/STJr/SRB2/-/commit/9772bbeda172bc60482f137fc465e12070c76f22
2024-03-12 18:50:55 +01:00
Alug 1bb9fb2c67 cant override crap, thx msys 2024-03-12 18:27:55 +01:00
Alug b90e3ce9da i will add those in compiler flag instead 2024-03-12 18:19:12 +01:00
Alug e04a074a79 Revert "condensetics"
This reverts commit 87001f7e78.
2024-03-12 16:30:00 +01:00
Alug f98c3311af Zzz... 2 2024-03-12 16:21:42 +01:00
Alug 1a8c44af27 Zzz.... 2024-03-12 16:20:32 +01:00
Alug a57089c1a9 fix some oopsies 2024-03-12 16:16:40 +01:00
Alug 87001f7e78 condensetics 2024-03-12 16:06:12 +01:00
Alug 1fbb05c938 LUT for bmapwidth imul instructions. 2024-03-12 15:28:12 +01:00
Alug 3eef9d3b62 inline blockthing iterator aswell 2024-03-12 14:27:15 +01:00
Alug af2adf0134 remove some suff 2024-03-12 14:02:46 +01:00
Alug bbdfee8d33 optimize fixedhypot 2024-03-12 12:58:17 +01:00
Alug 2c4da83502 optimize "p_pointon" functions 2024-03-12 10:47:27 +01:00
Alug 75f2868971 inline some things 2024-03-12 02:13:35 +01:00
Alug 87d9ecc3c8 midi music bros 2024-03-11 23:52:26 +01:00
indev b637943bd9 Add snap to bottom flags for race countdown and level title too 2024-03-11 22:30:45 +01:00
Alug 0514475155 uuuuh 2024-03-11 22:30:37 +01:00
Alug 8cfb39e035 sort grid when opening skin menu instead of everytime a skin is added 2024-03-11 21:01:43 +01:00
Alug a9a7cb7be0 i 2024-03-11 12:58:22 +01:00
Alug f8649a24aa those can all be static 2024-03-11 11:54:32 +01:00
Alug ee5a860e07 more opitmizations stuff 2024-03-11 11:47:05 +01:00
Alug e6f03c1136 can do that directly 2024-03-11 11:22:08 +01:00
Alug 780162f516 optimize hwr_renderbpsnode
actually just make it behave like the software version lol
2024-03-11 11:00:14 +01:00
Alug a6d32d834b make 64 default again 2024-03-11 04:27:52 +01:00
Alug cef3c7f032 remove pseudoangle as its slower 2024-03-11 04:25:41 +01:00
Alug 07f8a532f9 attempt at unfucking renderview 2024-03-11 03:40:13 +01:00
Alug 352adf526a give this a better name lol 2024-03-11 02:22:40 +01:00
Alug df48f9caf9 actually move stuff back to hw_clip lmao 2024-03-11 02:15:34 +01:00
Alug f611053d4f replace server list sorting with qs22j 2024-03-10 20:28:27 +01:00
indev 39011cd93b Snap viewpoint text to bottom 2024-03-10 19:54:20 +01:00
Alug 562cb8cebd clean up stuff a little 2024-03-10 18:50:38 +01:00
Alug 89ae721421 i am in pain 2024-03-10 17:59:24 +01:00
Alug f65f4b32e2 Revert "remove pseudoangle"
This reverts commit c5d6ac63c5.
2024-03-10 15:19:36 +01:00
Alug 303fca6bcc smol adjustment 2024-03-10 04:39:55 +01:00
Alug 4aba159ee8 clean up this mess 2024-03-10 04:25:59 +01:00
Alug 5838e60bf6 fix overflow stuffs 2024-03-10 03:43:21 +01:00
Alug 527e436d57 Revert "stuffs"
This reverts commit 60ede73ff8.
2024-03-09 14:06:18 +01:00
Alug 60ede73ff8 stuffs 2024-03-09 13:43:06 +01:00
Alug 298d5e95fc unfuck thinker crap 2024-03-09 13:34:34 +01:00
Alug e9a68f0b7d forgor 2024-03-09 12:02:20 +01:00
Alug d613cf4d4c sUgGeSt PaReNtHeSeS ArOuNd '&&' 2024-03-09 12:01:18 +01:00
Alug 3487fae95d simplify this crap 2024-03-09 10:51:32 +01:00
Alug 9ee47a071b oops 2024-03-09 10:22:20 +01:00
Alug 3579fc3dea remove this 2024-03-09 10:11:06 +01:00
Alug 921bff19f1 add toggle for old fps counter behaviour
idk people hate the new one so brap
2024-03-09 07:58:14 +01:00
Alug d07420eaeb fix compile for everyone but me lmao 2024-03-09 07:40:38 +01:00
Alug 8028db77d8 implicit declaration of deez nuts 2024-03-09 07:12:56 +01:00
Alug e49a059783 fix dumbass compiler warnings + reformat it a bit 2024-03-09 07:12:18 +01:00
Alug 482b6e6844 use it for other stuff 2024-03-09 07:02:16 +01:00
Alug aa70635919 dont think this should write to relplays 2024-03-09 02:00:40 +01:00
Alug c331b0fa89 e 2024-03-09 01:59:27 +01:00
Alug fe55744de2 a 2024-03-09 00:57:40 +01:00
Alug 15e9d85a14 Revert "Revert "avx destruction idk""
This reverts commit f547020fc5.
2024-03-09 00:54:33 +01:00
Alug 51043b61a1 Revert "cache and reuse mobjs again"
This reverts commit 04455c9625.
2024-03-08 23:43:52 +01:00
Alug 6620d5fb26 faster qsort for rendering 2024-03-08 15:03:58 +01:00
Alug f547020fc5 Revert "avx destruction idk"
This reverts commit 4fdb2174f0.
2024-03-08 11:14:42 +01:00
Alug 89ea473c3b fix shit on party cruiser
well fixing the cullplane broke party cruiser, so im just gonna give it the same parameters as the software version i guess idk
2024-03-08 01:19:25 +01:00
Alug b60d9d0be7 readd this cause i dumb 2024-03-08 01:19:15 +01:00
Alug 4fdb2174f0 avx destruction idk 2024-03-08 00:15:43 +01:00
Alug 06a48584d6 expose this cause i want to use it in local scripts 2024-03-08 00:09:08 +01:00
Alug e9f9c1009d more mobj stuffs 2024-03-07 00:35:26 +01:00
Alug b66ceda525 Revert "attempt at exclusive fullscreen mode"
This reverts commit 19f1d8b847.
2024-03-06 09:27:09 +01:00
Alug 7c9c28f026 Revert "use desktop resolution for stuff"
This reverts commit a54384a579.
2024-03-06 09:27:06 +01:00
Alug 72f0552ef1 Revert "reset windowsize on normal fullscreen mode"
This reverts commit 85c7216eaa.
2024-03-06 09:26:59 +01:00
Alug 877a1f15a9 Revert "multidisplay stuff + only activate framebuffer for downsampling"
This reverts commit 5f58e7b343.
2024-03-06 09:26:46 +01:00
Alug efa2a68805 Revert "Zzz... moment"
This reverts commit 8cec2dab82.
2024-03-06 09:26:43 +01:00
Alug 023209bb76 Revert "only do things here when theres more than one display"
This reverts commit 9eb68bf052.
2024-03-06 09:26:38 +01:00
Alug da5dcde6ee Revert "wait uhhhh"
This reverts commit 875adb17b1.
2024-03-06 09:26:33 +01:00
Alug e92c5e1bf9 Revert "ugh this still takes the wrong display blergh"
This reverts commit 298b4d23e8.
2024-03-06 09:26:30 +01:00
Alug 2b7c4ae76c Revert "ill just uhhhhh use main display stuff for now idk"
This reverts commit a2d0ea9d11.
2024-03-06 09:26:24 +01:00
Alug ea26db2cbd Revert "change things a bit"
This reverts commit 9c42b77879.
2024-03-06 09:26:21 +01:00
Alug b9e3747f99 Revert "forgor"
This reverts commit 4d608b7f37.
2024-03-06 09:26:19 +01:00
Alug 4d608b7f37 forgor 2024-03-06 09:20:21 +01:00
Alug 9c42b77879 change things a bit 2024-03-06 09:19:17 +01:00
Alug a2d0ea9d11 ill just uhhhhh use main display stuff for now idk 2024-03-06 08:07:40 +01:00
Alug 298b4d23e8 ugh this still takes the wrong display blergh 2024-03-06 07:59:31 +01:00
Alug 875adb17b1 wait uhhhh 2024-03-06 07:42:46 +01:00
Alug 9eb68bf052 only do things here when theres more than one display 2024-03-06 07:39:36 +01:00
Alug 8cec2dab82 Zzz... moment 2024-03-06 07:36:28 +01:00
Alug 5f58e7b343 multidisplay stuff + only activate framebuffer for downsampling
idk i hope this shit works lmao
also moved some things in OglSdlSurface so it doesent intialize certain things everytime we change framebuffer shit
2024-03-06 07:26:53 +01:00
Alug 28bb88e9b4 Dynamically allocate space for a state's action field
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1478
2024-03-06 04:39:29 +01:00
Alug 04455c9625 cache and reuse mobjs again
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2200
2024-03-06 04:14:21 +01:00
Alug 9853150e57 Merge remote-tracking branch 'origin/maybemobjcrashfixes' into lugstuff 2024-03-06 00:26:24 +01:00
Alug 85c7216eaa reset windowsize on normal fullscreen mode 2024-03-05 02:15:06 +01:00
Alug a54384a579 use desktop resolution for stuff 2024-03-05 02:02:02 +01:00
Alug 19f1d8b847 attempt at exclusive fullscreen mode 2024-03-05 01:44:10 +01:00
indev 8270b64624 Make custom cvar menu bit wider 2024-03-04 23:52:45 +01:00
indev 81e3810c32 Don't add string cvars (a bit hacky solution) 2024-03-04 21:08:05 +01:00
Alug c266151071 change some numbers uuuuuh 2024-03-04 20:17:18 +01:00
Alug 27d55260e8 remove minmax sliders 2024-03-04 19:45:49 +01:00
Alug 233583657e oops 2024-03-04 19:04:51 +01:00
Alug 7bb1eed249 dont do stuff for anything thats not in normal us ascii or smth 2024-03-04 18:34:09 +01:00
Alug aa85fc3787 dont use it for control setup 2024-03-04 18:13:18 +01:00
Alug c9a88617b1 only use this for text inputs not gameplay 2024-03-04 17:46:45 +01:00
Alug 2f899fdfcc make it even simpler 2024-03-04 05:24:41 +01:00
Alug cdd2b6560e i will just use my compilers memcpy thx 2024-03-04 05:19:54 +01:00
Alug 60f29edbca turn it off completely when your gpu cant use it 2024-03-04 02:51:12 +01:00
Alug 60cffe1ed1 unhack framebuffer functions a little 2024-03-04 02:47:42 +01:00
Alug e77e7d1643 o 2024-03-04 01:13:23 +01:00
Alug 5dc22f502e dont need this 2024-03-04 00:45:14 +01:00
Alug 7a309c1175 when the ;; 2024-03-04 00:13:21 +01:00
Alug 9ce5baad9e fix ogl freelook breaking with shearing enabled
also removed uneeded stuff
2024-03-03 08:40:24 +01:00
Alug a4aa9a76f2 should only do that when rendering stuff 2024-03-03 07:57:46 +01:00
Alug befa25de5c add missing interpolators in mapload 2024-03-03 07:50:02 +01:00
Alug 83175d5c09 bruh
im going insane
2024-03-03 06:45:37 +01:00
Alug d8df8e8778 Revert "Revert "we have functions for that dont check for slopes everywhere""
This reverts commit 09957d0279.
2024-03-03 05:51:35 +01:00
Alug 09957d0279 Revert "we have functions for that dont check for slopes everywhere"
This reverts commit 46da9bf98b.
2024-03-03 05:34:01 +01:00
Alug 9e44985f56 Do not reload every texture when adding a wad
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1725?commit_id=37add34b9c729b21e624e22d64159073c9258e25
2024-03-03 05:18:37 +01:00
Alug b657a84699 Split R_LoadTextures 2024-03-03 04:53:15 +01:00
Alug 5ec7835556 Merge branch 'lugstuff' of https://github.com/Indev450/SRB2Kart-Saturn into lugstuff 2024-03-03 04:34:59 +01:00
Alug 03a864156d fix conflict 2024-03-03 04:34:53 +01:00
Alug c823bf3320 Revert "multithread exec command and some filesearch/add stuff"
This reverts commit 0d7025f714cbef34ca6e92e683561df411fa149a.
2024-03-03 04:32:13 +01:00
Alug 4f4d2f1f4c clean up r_segs 2024-03-03 03:13:46 +01:00
Alug 1bb389052d fix this 2024-03-02 23:36:48 +01:00
Alug 31fdc5bbc1 dont need to check if we dont use it 2024-03-02 22:56:26 +01:00
Alug db3833430d we have functions for that dont check for slopes everywhere
the functions already do it for us anyways
2024-03-02 22:33:34 +01:00
Alug 6d2212d259 move sprite mobj checks first 2024-03-02 21:56:39 +01:00
Alug 912c0e7fc4 check for those i guess 2024-03-02 18:36:34 +01:00
Alug 43d232819a forgor screenspace clipping 2024-03-02 18:25:13 +01:00
Alug 302eaf60b5 GetScreenCoord lua parity 2024-03-02 17:36:59 +01:00
Alug 84535faa90 remove more unused stuff 2024-03-02 15:57:25 +01:00
Alug 8c55d3c705 bruh 2024-03-02 13:23:50 +01:00
Alug ec11b9268f did not mean to commit this lul 2024-03-02 03:33:26 +01:00
Alug a45af4a80c i 2024-03-02 03:18:27 +01:00
Alug df627b6830 a 2024-03-02 03:11:06 +01:00
Alug dfbeaf30ad m 2024-03-02 03:10:47 +01:00
Alug a03f74b125 add this 2024-03-02 03:05:36 +01:00
Alug 1a01f1299c fix compiler complains
those were for coronas code which we dont even have
2024-03-02 02:43:53 +01:00
Alug 91f0cdbaca unhack palrendering screentex stuff 2024-03-02 02:15:28 +01:00
Alug e50bd4125d e 2024-03-02 02:07:54 +01:00
Alug ded2c8a7c8 a 2024-03-02 02:03:22 +01:00
Alug 88ce9fc0a6 more stuffs 2024-03-02 02:02:03 +01:00
Alug 3c713248b3 more shader stuff 2024-03-02 01:53:11 +01:00
Alug 75f3edcd92 shader stuffs 2024-03-02 01:50:35 +01:00
Alug 081a7779a6 make netvars red 2024-03-02 01:32:12 +01:00
Alug 6e995207a6 smh 2024-03-02 01:15:03 +01:00
Alug 3492b77aa0 we dont have IT_CV_FLOATSLIDER so dont even need to check for float 2024-03-02 01:14:36 +01:00
Alug e864901035 Options Menu for custom console variables
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2380#9cc73f4b99ff925448389969b0ade6ba3947fc31
2024-03-02 01:09:10 +01:00
Alug 7ee6de6b6a software sdl windows scaling quality setting 2024-03-01 23:12:23 +01:00
Alug 553b8ccf6b Revert "i am in pain"
This reverts commit e0e75eac33.
2024-03-01 15:26:57 +01:00
Alug bceef0b861 Fix nametag offsets with reverse gravity and flipcam 2024-03-01 15:24:04 +01:00
Alug 53cce6c6bb this does not exist 2024-03-01 02:31:55 +01:00
Alug b95047d09f fix vertical flip driftgauge
and make non flipcam behave like the sg lua version
2024-03-01 01:53:17 +01:00
Alug c6cb4375f5 fix shearing offset with flipcam in K_GetScreenCoords 2024-03-01 01:03:03 +01:00
Alug a07e2b8eda only check for stplayer flipcam
until i figure out a better way to check all of this crap
2024-02-29 23:08:24 +01:00
Alug 98e7002167 z 2024-02-29 16:22:07 +01:00
Alug 3428dde3c6 test 2024-02-29 05:37:21 +01:00
Alug 13d48f982b just make it like this 2024-02-29 00:27:37 +01:00
Alug b2e4dc27e4 give me a little more info on vanilla scoreboard but a bit ugly lul 2024-02-29 00:22:50 +01:00
Alug deddeab049 stimky ugly 2024-02-28 22:31:06 +01:00
Alug c3a6410822 Revert "dont need SEENAMES"
This reverts commit 01172bca77.
2024-02-28 22:06:02 +01:00
Alug c5915091aa kill have_blua 2024-02-28 21:53:59 +01:00
Alug 4401f0659e kill delfile 2024-02-28 18:58:04 +01:00
Alug a0c72d32e8 kill weighted recycling 2024-02-28 18:38:54 +01:00
Alug 1493045ec4 this doesent even exist anymore lmao 2024-02-28 18:33:12 +01:00
Alug 210efb2be7 kill eslope_typeshim 2024-02-28 18:26:54 +01:00
Alug a02fc1de63 kill GL_SHADERS 2024-02-28 18:19:11 +01:00
Alug 7755bfc861 Zzz... 2024-02-28 18:05:24 +01:00
Alug 01172bca77 dont need SEENAMES
esp when we get nametags its obsolete
2024-02-28 17:58:06 +01:00
Alug 143cbc8587 kill polyobjects ifdef 2024-02-28 17:55:47 +01:00
Alug b65f655a8a update libcurl to 7.69.0 2024-02-28 15:23:54 +01:00
Alug ed04c86369 u 2024-02-28 04:53:42 +01:00
Alug c0eaa17eb3 e 2024-02-28 04:51:13 +01:00
Alug 6383a55038 kill hw_trick 2024-02-28 04:47:55 +01:00
Alug 574df60d58 kill eslope 2024-02-28 04:40:03 +01:00
Alug 61ee575cd3 forgor this 2024-02-28 04:11:39 +01:00
Alug bdd963081e OpenGL: Fix linedef type 10 not culling FOFs 2024-02-28 03:50:43 +01:00
Alug 6b908d7a14 missed those 2024-02-27 22:16:52 +01:00
Alug 7d0d70c094 oopsie 2024-02-27 22:11:32 +01:00
Alug e75c5a9248 delete half of srb2 2024-02-27 21:49:31 +01:00
Alug b8ed5f4f1a dont need this anymore 2024-02-27 21:36:57 +01:00
GenericHeroGuy 660d7060e4 Don't return aggregates 2024-02-27 20:24:46 +01:00
Alug 79c5f57714 Merge remote-tracking branch 'origin/joinrefusemessage' into lugstuff 2024-02-27 20:03:47 +01:00
Alug 606d8fbe55 optimize gif palette creation 2024-02-27 20:01:56 +01:00
Alug edfa116a40 a 2024-02-27 18:38:28 +01:00
Alug 55ca0c712f add dynamic gif delay
fixes issues with low framerates, uncapped and stutters
2024-02-27 17:41:40 +01:00
Alug 16bef488ee no idea how that ever got there 2024-02-27 15:52:50 +01:00
Alug 82d784d9f8 Toggle for R_Pointtoangle Ex or 64
Ex may perform better on 32bit clients and some cpus so lets just make it toggable
2024-02-27 15:52:34 +01:00
indev 103fb2dfc1 Don't return NULL when creating MT_NULL mobj, since it is needed in some parts of game 2024-02-27 13:29:20 +01:00
Alug bba3e1810b add this 2024-02-27 05:14:05 +01:00
Alug af5333f63e fix P_PlayerInPain 2024-02-27 05:07:44 +01:00
Alug ea77a5fb53 Fix con_hudlines being off by one, Fix con_hudtime overflow 2024-02-27 05:07:11 +01:00
Alug a4aef0894b fix compile for qt 2024-02-26 23:48:47 +01:00
Alug bab7972518 Put HTTP downloading on a background thread
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2322
2024-02-26 23:37:54 +01:00
Alug 88853a7aee make the menus a little prettier 2024-02-26 22:01:11 +01:00
Alug d3339df853 toggle for showing nametags during spectating 2024-02-26 22:00:53 +01:00
Alug 385614b448 add toggle for showing nametags after you finished a race
off by default to match sg nametags
2024-02-26 21:19:59 +01:00
Alug c47ba80f5d death 2024-02-26 20:58:58 +01:00
Alug 6de0700f49 use V_LocalTransFlag for driftgauge 2024-02-26 20:58:50 +01:00
Alug d9fe52b1a1 use V_LocalTransFlag for nametags 2024-02-26 20:58:39 +01:00
Alug ccfc476ec0 replace SCR_FPSflags with V_LocalTransFlag
so we can actually display hud transparency stuff before the hud appears, since that doesent work with V_HUDTRANS
2024-02-26 20:58:18 +01:00
Alug f518b3c48b e 2024-02-26 20:04:12 +01:00
Alug 81d52db722 Revert "connect loadingscreen should clear menus"
This reverts commit 6b41cf676c.
2024-02-25 23:42:30 +01:00
Alug df9973da99 fix tagsdisplayed counter 2024-02-25 21:32:25 +01:00
Alug ca4c779c66 dont quit addon downloading with the mousewheel lmao 2024-02-25 19:47:52 +01:00
Alug 7897352175 connect loadingscreen should clear menus 2024-02-25 19:42:21 +01:00
Alug e0e75eac33 i am in pain 2024-02-25 19:06:32 +01:00
Alug 31d83dd26e disable driftgauge by default 2024-02-25 18:35:00 +01:00
Alug 698a0b811f disable nametag by default 2024-02-25 18:34:46 +01:00
Alug f69609b403 Merge branch 'lugstuff' of https://github.com/Indev450/SRB2Kart-Saturn into lugstuff 2024-02-25 18:21:12 +01:00
Alug 56259e3476 lua hud disable option for driftgauge 2024-02-25 18:21:03 +01:00
Alug f3dfa53f31 lua hud disable option for nametags 2024-02-25 18:21:03 +01:00
Alug e10d60c08e hud disable option for driftgauge 2024-02-25 18:20:32 +01:00
Alug ad4037351f hud disable option for nametags 2024-02-25 18:20:19 +01:00
NepDisk f9e1da8c9f Add coloring to large numbers 2024-02-25 17:34:12 +01:00
NepDisk 2f05137af7 Fix fillbar 2024-02-25 17:34:08 +01:00
Alug c305e31c2e fix first person splitscreen driftgauge stuff a 2024-02-25 12:21:57 +01:00
Alug a55fabe4f9 k... 2024-02-25 12:12:18 +01:00
Alug c58848b298 add splitscreen to screencoords and fix splitscreen for driftgauge 2024-02-25 12:10:23 +01:00
Alug ede644d3c4 use SleepEX on windows and set the min sleep duration to 16ms 2024-02-25 04:08:25 +01:00
Alug 4ff98e62a9 actually disable it for splitscreen for now
its botched and needs fixing
2024-02-24 20:32:15 +01:00
Alug e87fd2fff6 dont draw driftgauge when not using chasecam 2024-02-24 20:14:52 +01:00
indev 33e8b10579 Don't need for long there, fixed_t is big enough 2024-02-24 20:05:12 +01:00
Alug d11780f62d add -1 check for driftgauge too 2024-02-24 20:05:07 +01:00
Alug 7706aa0bf0 fix conflict 2024-02-24 16:56:28 +01:00
Alug cf96e10552 Revert "Refactor Batching code"
This reverts commit 8d737c96c9.
2024-02-24 16:49:04 +01:00
Alug 1d01e1e6cd Revert "Optimize polygon sorting on batch renderer"
This reverts commit 1687fb9120.
2024-02-24 16:48:14 +01:00
Alug a5c4759662 disable driftgauge in record attack
it actually gives you an advantage over using other clients
record attack should be fair and even
2024-02-24 15:58:47 +01:00
Alug e7ff1d693b fix K_GetScreenCoords y clipping 2024-02-24 15:38:32 +01:00
Alug 9b4354a057 rename all of those to not conflict with mods 2024-02-24 14:46:13 +01:00
Alug 51a46ba92c this aswell 2024-02-23 01:35:49 +01:00
Alug 31c4e0d59f forgor those aswell 2024-02-23 01:27:52 +01:00
Alug 6b246548c3 raise compile time significantly 2024-02-22 23:58:28 +01:00
Alug 57dda3843a use the current not old state
also add dont interp precip angle if it doesent change
2024-02-22 23:45:56 +01:00
Alug b04ac14751 remove redundant check 2024-02-22 23:45:53 +01:00
Alug 5ad8497db2 those too 2024-02-22 22:53:10 +01:00
Alug 672f07a5ee forgor those 2024-02-22 22:46:58 +01:00
Alug aceffafc4e fix ternary hell for palette rendering lightlevels 2024-02-22 21:42:28 +01:00
Alug 891b3183ed dont interpolate unchanging things + remove unused dynslope interp code 2024-02-22 19:55:45 +01:00
Alug 26dd066280 fix conflicts 2024-02-22 01:43:54 +01:00
Alug 157ebdb5fe Merge remote-tracking branch 'ghg/lua-hudstuff' into lugstuff 2024-02-22 01:39:34 +01:00
Alug 1a18839f82 remove R_PointToAngleEx
R_PointToAngle64 does its job better anyways
2024-02-20 21:10:04 +01:00
Alug e7f8e7628f I HATE MENUS I HATE MENUS 2024-02-20 18:42:37 +01:00
Alug 07190571a1 lol 2024-02-20 18:40:01 +01:00
Alug f04d922fca fix warning 2024-02-20 18:17:25 +01:00
Alug 7fa382d4e9 rename driftgauge cvar and fix nametag rendering bug 2024-02-20 18:12:17 +01:00
Alug 97766710c0 e 2024-02-20 17:37:29 +01:00
Alug 994ee060a7 a 2024-02-20 17:36:05 +01:00
NepDisk 589c27fdcf Driftgauge flipcam 2024-02-20 17:35:01 +01:00
NepDisk 37a018fda4 Give these tooltips 2024-02-20 17:34:58 +01:00
NepDisk f49381d1c5 Forgot this lol 2024-02-20 17:34:54 +01:00
Alug 573095bbad Driftgauge 2024-02-20 17:34:49 +01:00
Alug 0fdcc8e288 some fixes 2024-02-20 17:33:24 +01:00
Alug 03d7e26c3d oop 2024-02-20 13:18:23 +01:00
Alug 3a5cd835ad Fix tint equation shader 2024-02-20 13:17:46 +01:00
Alug 47a8f081e9 set currenttex to null if it gets an invalid texture id 2024-02-20 13:17:35 +01:00
Alug ad8d691c11 kill this 2024-02-20 13:16:50 +01:00
NepDisk 8186696e62 Nametag sightofline fix 2024-02-19 20:35:38 +01:00
Alug 183ec22923 Revert "Revert "Linked list for textures""
This reverts commit fe0dabb177.
2024-02-19 20:26:59 +01:00
Alug 5376995350 add max cap to nametagmaxplayers 2024-02-19 19:02:54 +01:00
Alug acb6e30fad dont apply this for players 2024-02-19 18:20:11 +01:00
Alug fe0dabb177 Revert "Linked list for textures"
This reverts commit 7eec58a834.
2024-02-19 12:15:12 +01:00
NepDisk 194ae46ce8 Remove unused functions that were originally added for nametags 2024-02-19 11:14:49 +01:00
NepDisk 2e9f1bfe90 Fix nametag weight offset for small and minimal 2024-02-19 11:14:46 +01:00
Alug a82adc4948 Fix nametag limit 2024-02-19 11:14:41 +01:00
Alug 6440c70a38 Zzz... 2024-02-19 01:57:42 +01:00
Alug 748eb07c9a forgor 2024-02-19 01:57:04 +01:00
Alug 5be2f591d2 ok so this needs to be done for the scaling stuff cool 2024-02-19 01:49:20 +01:00
Alug f2e4950e89 die 2024-02-19 01:26:01 +01:00
Alug 7444c5b826 remove hpmod stuffs since its not netsafe 2024-02-19 01:02:39 +01:00
Alug 5f6cca68cc Nametags Rewrites 2
contains netunsafe stuff but easy to remove
2024-02-19 00:44:07 +01:00
Alug 3d33e5351b bruh 2024-02-19 00:13:42 +01:00
Alug c6e245450d those are not server commands
idk why i threw them there in the first place but those are not needed at all (or even usefull for that matter) for dedicated servers
also moves some stuff to its group
2024-02-19 00:12:11 +01:00
Alug 36854a16b7 Revert "Clean up cvar stuff a little"
This reverts commit 6fe87ab05a.
2024-02-19 00:04:25 +01:00
Alug b4ee8229ee Revert "more stuff"
This reverts commit 150c695979.
2024-02-19 00:03:27 +01:00
Alug cf0a3841e8 Revert "those need to be here for some reason"
This reverts commit 2efaebcf89.
2024-02-19 00:03:16 +01:00
Alug 3ebd2257f8 ok i dont want to the new gamma system
it looks off honestly
2024-02-18 23:47:42 +01:00
Alug 844d1967cc i wanna try the new gamma stuff 2024-02-18 22:29:24 +01:00
Alug dac37f8938 revert those 2024-02-18 22:29:12 +01:00
Alug dd74bc7c2b fuckit make the scale even smoler 2024-02-18 22:29:05 +01:00
Alug 7eec58a834 Linked list for textures 2024-02-18 22:28:52 +01:00
Alug da81998c71 fix up colour cube/saturation/gamma
cleans up things, and fixes it not being applied to 3D models and colourmapped sectors when not in palette rendering mode
also adds a new way of handling gamma which can be used if wanted
2024-02-18 20:43:40 +01:00
Alug d1552e7b71 clean up patch drawers a little
esp for software
2024-02-18 19:45:17 +01:00
Alug c64e10083b Optimize R_StoreWallRange
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2336?commit_id=a04bef7d39f71cfda1fe85b2ca3a820f95612b06
2024-02-17 22:52:12 +01:00
Alug 43e2be58da Revert "add an error message here"
This reverts commit 44b8a8a0d8.
2024-02-17 17:31:14 +01:00
Alug 63b60d2546 those too 2024-02-17 16:11:32 +01:00
Alug 91ddc709eb forgor 2024-02-17 16:09:39 +01:00
Alug 1bcb67ffb9 remove bloat from windows libs + move dlls into dlls folder
+ remove msvc project files since they dont work anyways
2024-02-17 15:59:16 +01:00
Alug 976177c244 Revert "Revert "fix the dumbass compiler warning""
This reverts commit 69d47a5e53.
2024-02-17 11:13:07 +01:00
Alug a37c81a142 Revert "Revert "fix some issues with framebuffer""
This reverts commit 6457847633.
2024-02-17 11:13:04 +01:00
Alug 58de3a35a0 Revert "Revert "Implement framebuffer and renderbuffer objects""
This reverts commit b0f5f4338f.
2024-02-17 11:13:00 +01:00
Alug 44b8a8a0d8 add an error message here
dunno if we can prevent it from crashing, but atleast its a little more informative
2024-02-17 10:42:16 +01:00
Alug b0f5f4338f Revert "Implement framebuffer and renderbuffer objects"
This reverts commit d6d70e1525.
2024-02-17 09:57:38 +01:00
Alug 6457847633 Revert "fix some issues with framebuffer"
This reverts commit fcc810f703.
2024-02-17 09:57:25 +01:00
Alug 69d47a5e53 Revert "fix the dumbass compiler warning"
This reverts commit d0b7f6203c.
2024-02-17 09:57:12 +01:00
NepDisk 02177a7794 Nametags Rewrites 2024-02-17 09:11:27 +01:00
Alug 65c15126f1 larger console buffer for high res 2024-02-17 09:10:24 +01:00
Alug 76c78b8e63 remove all this crap 2024-02-16 15:30:18 +01:00
Alug f63342ff0f lol 2024-02-16 13:35:30 +01:00
Alug e3410cf34c move this 2024-02-16 13:35:25 +01:00
Alug 7a129047e7 i will play this in 8k yes 2024-02-16 09:36:51 +01:00
Alug 343716b7da make this save 2024-02-15 20:22:05 +01:00
Alug 1687fb9120 Optimize polygon sorting on batch renderer 2024-02-14 21:39:31 +01:00
Alug 3e89057c23 Fix dangling pointer in mapthing after removing mobj 2024-02-14 21:39:20 +01:00
Alug 774587efa6 fix inline warnings 2024-02-14 19:43:44 +01:00
Alug 2dc8bf321e do this again 2024-02-14 19:27:25 +01:00
Alug 992813d770 Revert "remove mobj realscales"
This reverts commit 9f45dabd9c.
2024-02-14 19:27:21 +01:00
Alug 46882dee93 Revert "move this, remove interp things, and add some comments"
This reverts commit 47c90f63a8.
2024-02-14 19:27:18 +01:00
Alug 8bbb7b540f Revert "forgor"
This reverts commit e4ec7484aa.
2024-02-14 19:27:14 +01:00
Alug f5f1ab036d Fix segfault when removing mobjs while iterating thinglist 2024-02-14 15:31:06 +01:00
Alug f15d556c05 fix segfaults when damaging mobj with no painstate and when removing source from ShouldDamage 2024-02-14 15:27:15 +01:00
Alug 570a664db8 Use po2 patches to fix mipmaps 2024-02-14 12:50:40 +01:00
Alug 52f69324d9 better savegame errors 2024-02-14 12:19:38 +01:00
Alug ea6016b1ba forgor 2024-02-14 12:00:25 +01:00
Alug 30fcffd63c move this, remove interp things, and add some comments 2024-02-14 11:44:14 +01:00
Alug 50446bbde4 remove mobj realscales
idk those just seem absolutely useless its literally just an alias for mobj scale
2024-02-14 11:42:51 +01:00
Alug b307033aab a? 2024-02-14 05:58:04 +01:00
Alug 3e5985833c Snap to software lightlevel values when using Paletter renderer
bye bye smooth fades, here i come 32 light levels
2024-02-13 16:35:10 +01:00
Alug 8421f02aab e 2024-02-13 12:44:34 +01:00
Alug b6daafec17 Realloc software lookups for current screen res instead of MAXVID define
so the thing just allocs what it needs, so it can perform as good as it can on any resolution
2024-02-13 12:44:05 +01:00
Alug fc058b669e better comment 2024-02-13 11:16:00 +01:00
Alug 99214b98b9 set this to 1440p
also made a new define for use in the png limits so that can stay at 4k. but having both maxvids allocate things for 4k is not a good thing for software renderer, not that anyone would ever want to run it at 4k anyways
2024-02-13 11:15:14 +01:00
Alug ab35a44ed9 more revert 2024-02-13 10:57:36 +01:00
Alug 125b82a5bb forgor 2024-02-13 10:53:38 +01:00
Alug f294ea157f more things 2024-02-13 10:50:11 +01:00
Alug 486ae052ef this stuff too 2024-02-13 10:42:03 +01:00
Alug 53b5442dad bruh 2024-02-13 10:40:42 +01:00
Alug 507c5f75bd revert a few things 2024-02-13 10:39:27 +01:00
Alug 0fb72c579e forgor 2024-02-13 06:16:38 +01:00
Alug c5d6ac63c5 remove pseudoangle 2024-02-13 06:12:32 +01:00
Alug a934c76263 revert this 2024-02-12 14:38:47 +01:00
Alug 0098c3bbc0 update SDL2 to v2.30.0 2024-02-12 14:29:49 +01:00
Alug f3eedc03e6 Add common I_GetSysName function
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2308
2024-02-12 14:23:09 +01:00
Alug 17c71a2528 Change from double to INT64 2024-02-12 14:19:25 +01:00
Alug d2ecbd7c6e Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-02-12 14:14:49 +01:00
Alug 2ce7dc0c37 update zlib to v1.3.1
update zlib to v1.3.1
2024-02-11 16:43:19 +01:00
Alug b648424c18 add stuff to menu 2024-02-11 15:21:20 +01:00
Alug 301754c857 forgor 2024-02-11 15:10:16 +01:00
Alug c9a3c4c9b8 only interpolate those if we use the stuff that uses them 2024-02-11 15:05:58 +01:00
Alug ce0c8b363a only interpolate pitch, roll, slopepitch and sloperoll when using sprite rotation 2024-02-11 14:51:44 +01:00
Alug 9d6c38004c toggable mobj subsector interpolation
honestly couldnt spot any difference at all
but R_PointinSubsector is quite expensive so making a toggle seems cool
2024-02-11 14:51:14 +01:00
Alug 19a58cc8c6 mobj interp optimization 2024-02-11 14:19:08 +01:00
Alug d855c39da2 a 2024-02-11 13:45:48 +01:00
Alug 03f4bfecc1 Dont need this
I_GetPrecise Precision already gets the high res windows time anyways
2024-02-11 13:42:12 +01:00
Alug c8d9e4c7b3 add thiis 2024-02-11 09:22:59 +01:00
Alug cb2b8f2e7c add it here too 2024-02-11 06:38:45 +01:00
Alug 0272dd4c24 oops 2024-02-11 06:29:28 +01:00
Alug 3b327937c2 use Windows High Precision Timer on Windows builds
lul may help with frametime and other stuff
2024-02-11 06:16:45 +01:00
Alug f8f2f17184 Merge remote-tracking branch 'origin/cvarcleanup' into lugstuff 2024-02-09 15:18:17 +01:00
Alug 2efaebcf89 those need to be here for some reason
game complains
2024-02-09 15:12:41 +01:00
Alug 150c695979 more stuff 2024-02-09 15:05:23 +01:00
Alug 6fe87ab05a Clean up cvar stuff a little 2024-02-09 14:42:55 +01:00
Alug f6613a5555 proper check for colourized speedometer patches 2024-02-09 12:35:48 +01:00
Alug 947d5c2739 add achiiro speedometer stuffs 2024-02-09 12:07:34 +01:00
Alug 1544706ff4 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-02-09 10:20:21 +01:00
Alug e121d1a8a1 proper POST request to curl 2024-02-09 10:19:35 +01:00
Alug badbdbf03f Clipping and portal stuff
idk this actually does not break ante station for some reason
2024-02-09 10:19:18 +01:00
Alug 3b5495b53a brap 2024-02-07 11:52:04 +01:00
Alug 545027ae64 use this stuff 2024-02-07 11:40:05 +01:00
Alug 91896433f8 fix menu updating + add default to switch 2024-02-07 11:01:53 +01:00
Alug a60074fc8a fix menu stuff 2024-02-07 10:49:04 +01:00
Alug eb82aa14bb option for small nametags 2024-02-07 10:35:16 +01:00
Alug cb4b640730 why add the same thing twice? 2024-02-07 09:42:16 +01:00
Alug 266d9a3c71 also turn this off 2024-02-07 09:37:01 +01:00
Alug 7a5a704a15 forgor to comment this out 2024-02-07 09:36:37 +01:00
Alug 29ed8de935 Nametags from Chaoskart
https://gitlab.com/Fafabis/kart-chaotic/-/commit/8b4a12e144fbff587ee70c30e7f461900d839650#025e5c90ea9aeb6187b4fe002e0fbb277ef4b33d_7024_7035
2024-02-07 09:35:14 +01:00
Alug 3418cab5de switchable native keyboard input
taken from chaoskart this is completely non invasive
2024-02-07 09:20:36 +01:00
Alug e2ce015d49 fix for opengl sprite shadow colour 2024-02-07 09:15:17 +01:00
indev 0d0ab3f414 If have libbacktrace, write crash reports from I_Error 2024-02-04 19:08:33 +01:00
Alug 22b5bcc7e1 split cache functions
seems to fix a few stutters
2024-02-04 09:21:45 +01:00
indev 34d5d73d7e Fix battle playing wrong ending music sometimes 2024-02-04 08:31:10 +01:00
Alug 7ae4441731 Add cvar gr_maxinterpdist, which allows to control max distance on which mobjs will be interpolated 2024-02-04 08:26:54 +01:00
Alug d0b7f6203c fix the dumbass compiler warning 2024-02-04 07:56:55 +01:00
Alug 3757f3ae57 smol cleanup 2024-02-04 07:46:25 +01:00
Alug 8f9366da5a Zzz... 2024-02-04 07:12:26 +01:00
Alug b8e55f87a9 little portal cleanup 2024-02-04 06:48:58 +01:00
Alug b469f70e02 experimental fast sprite sorting 2024-02-04 06:28:07 +01:00
Alug 6df69b24db Revert "DSDADoom shenanigans"
This reverts commit c7931ca69c.
2024-02-02 16:49:08 +01:00
Alug 0133a5eb23 Revert "do this"
This reverts commit 7f93bc305d.
2024-02-02 16:48:26 +01:00
Alug 86712c2c48 fix compiler warning 2024-02-02 02:59:08 +01:00
Alug 5195caa3c6 Remove Build2DMipmaps and GLU library stuff
gluBuild2DMipmaps is just broken anyways
and it was the only thing used from the GLU library aswell so can remove things in favor of better solutions
having a pc with opengl 1.4 should be a given by now
2024-02-01 22:26:06 +01:00
Alug 684ad38d4b add an I_Error for when opengl is started on unsupported hardware or driver 2024-02-01 19:57:23 +01:00
Alug c6d292a3d7 e 2024-02-01 04:47:55 +01:00
Alug 246414a735 move that where it belongs 2024-02-01 04:42:28 +01:00
Alug 429bcffaf8 dont need to extra check for this actually 2024-02-01 03:48:17 +01:00
Alug d92e7b138c fix sprite roll angles in software for sprites with one rotation frame
ofc only when the rotation stuff is set to rotate everything not just the player
also changes that the shadows only rotate on that setting unless someone wants it and wants really dumb checks for it
2024-02-01 03:46:15 +01:00
Alug cd51ad2a25 remove non working fisheye lens code
remnants of birdhouse, this was never finished nor does it work
2024-02-01 03:26:33 +01:00
Alug 8732825404 fix software shadow rotation in the worst way possible kek 2024-02-01 03:25:58 +01:00
Alug fc37cdcc95 use it for camang 2024-02-01 02:39:27 +01:00
Alug 2435ec9515 Revert "batch this stuff too for portals"
This reverts commit 2df4738af2.
2024-02-01 02:11:21 +01:00
Alug 623fab8ea8 Revert "clean this up a little"
This reverts commit 99c9d921e3ab3ee3fde3dcf141e20323e064902a.
2024-02-01 02:03:23 +01:00
Alug e063345c4b Revert "oops"
This reverts commit 59b6987bf2e9f00bfdf50b268f0ec61e735dfe0e.
2024-02-01 02:03:10 +01:00
Alug 27533a1dcd Revert "replace check"
This reverts commit 36eaaee202c4d1f7e86dd2b24dcfe5573ac2f280.
2024-02-01 02:03:00 +01:00
Alug d232e0e2c6 oops 2024-02-01 01:55:04 +01:00
Alug 0475489e24 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-31 16:58:09 +01:00
Alug 34b35db27f Interpolate polyobjects properly for the software renderer
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2284/
2024-01-31 03:28:00 +01:00
Alug b47bc12e48 change x scale a little 2024-01-30 21:43:44 +01:00
Alug 4d102dcf68 similar scale to old speedo 2024-01-29 23:08:19 +01:00
Alug a8c9663200 ok i can just do it like this lol
now its good finally
2024-01-29 22:23:04 +01:00
Alug 57660cc5af fix 1 pixel gap
i hate maths
2024-01-29 22:13:54 +01:00
Alug c459e918af prep some speedometer stuff 2024-01-29 22:01:16 +01:00
Alug 962abba1b2 Buffer API is OpenGL 1.5, so can be used in STATIC_OPENGL
https://git.do.srb2.org/STJr/SRB2/-/commit/623629b04ab72071e6ea4f0c4a3245e6cde72e2c
2024-01-29 18:19:01 +01:00
Alug 5297d18f92 ugh whyyyy 2024-01-29 18:08:18 +01:00
Alug 7853e48a6f update libopenmpt libs 2024-01-29 18:07:35 +01:00
Alug 303d87f69d update libgme 2024-01-29 15:59:48 +01:00
Alug 9dcdc9500d Revert "bruh wtf"
This reverts commit 493091cd66.
2024-01-29 14:43:12 +01:00
Alug 7723bafff6 replace check 2024-01-29 04:38:26 +01:00
Alug d74a89c6c1 oops 2024-01-29 04:11:21 +01:00
Alug cce443be0b clean this up a little 2024-01-29 04:08:14 +01:00
Alug 81fa3d27bf uuuuuuuhhh 2024-01-29 03:56:43 +01:00
Alug 493091cd66 bruh wtf 2024-01-28 22:07:49 +01:00
Alug c75f5ee961 use this for portal clipping too 2024-01-28 19:33:45 +01:00
Alug 083e0ca2e0 dont need this anymore 2024-01-28 19:19:16 +01:00
Alug 79bd89016c dont need it as an extra file 2024-01-28 19:16:04 +01:00
Alug eca7e38763 Zzz... 2024-01-28 19:15:14 +01:00
Alug b5cbfb970f forgor 2024-01-28 18:58:52 +01:00
Alug 74e1cafd9d this too 2024-01-28 18:57:19 +01:00
Alug ee7381b67d revert this 2024-01-28 18:56:10 +01:00
Alug 7f93bc305d do this 2024-01-26 02:44:37 +01:00
Alug c7931ca69c DSDADoom shenanigans
R_PointToPseudoAngle seems rather promising
2024-01-26 02:28:07 +01:00
Alug 90f06a3289 a little better solution still bad lmao 2024-01-26 00:04:42 +01:00
Alug 0e344a7e02 screw it ill just do this 2024-01-25 23:40:37 +01:00
Alug 3f91a4e908 i want a small hud 2024-01-25 23:04:21 +01:00
Alug fb443c58ab add "Reset All" button to hud offset menu 2024-01-25 23:02:01 +01:00
Alug b233514b58 more offset 2024-01-25 16:48:16 +01:00
Alug 11615171d1 Revert "Optimize polygon sorting on batch renderer"
This reverts commit ad86e7f34a.
2024-01-25 14:57:49 +01:00
Alug 2df4738af2 batch this stuff too for portals 2024-01-25 04:06:54 +01:00
Alug 9e62f5bd52 make the ripple thing toggable for now 2024-01-25 03:46:26 +01:00
Alug 80349ae8ee a 2024-01-25 03:24:32 +01:00
Alug 06d51f2648 only apply fog if it is water only
ugh
2024-01-25 02:59:30 +01:00
Alug fcc810f703 fix some issues with framebuffer 2024-01-25 00:35:31 +01:00
Alug d6d70e1525 Implement framebuffer and renderbuffer objects
wew https://git.do.srb2.org/Lactozilla/SRB2/-/commit/211c3720de8dda8e2a896b6887eb4bbbd991ebbf
2024-01-24 22:35:30 +01:00
Alug e5f79e061c rotating shadows
uuuuhhh
2024-01-24 18:13:50 +01:00
Alug ad3c0a1ffd attempt at fixing some issues
it fixed some things but broke the underwater ripple if the water is on a fof
2024-01-24 17:09:15 +01:00
Alug 2ef935198a more pronounced ripple
eeeh kinda close ig
2024-01-24 03:41:02 +01:00
Alug dc3b9c648a make this a little neater 2024-01-24 03:09:09 +01:00
Alug 2d610d40b6 add better check for colormap stuff
so it only gets applied where it should (i hope)
works on tiled byway tho
2024-01-24 03:00:31 +01:00
Alug d2c686f48b attempt at making ogl water ripple better
well all it does is ripple the floor below the water fof lmao no idea how i would implement this for the walls too
2024-01-24 02:43:27 +01:00
Alug 5cafec3262 uuuh oops dont do it for non transparent fofs 2024-01-24 00:26:36 +01:00
Alug 580c42d167 more offset ugh 2024-01-23 21:33:15 +01:00
Alug dcfec35e57 remove this since its not needed anymore 2024-01-23 21:24:18 +01:00
Alug 701bac6e11 alr add more offset
kinda dumb way but itll do for now until i figure out smth better
2024-01-23 21:21:03 +01:00
Alug 0c46d593d8 attempt at making colormapped translucent fofs more accurate 2024-01-23 18:55:19 +01:00
Alug b867de0667 Zzz... 2024-01-23 15:50:51 +01:00
Alug e207b75c7a Revert "add pMasterPalette"
This reverts commit dfb05b9d39.
2024-01-23 15:49:00 +01:00
Alug fc3df5bfe4 Revert "attempt at unmangling lighttables and colormaps"
This reverts commit 19702daecd.
2024-01-23 06:41:25 +01:00
Alug dfb05b9d39 add pMasterPalette 2024-01-23 05:33:04 +01:00
Alug 19702daecd attempt at unmangling lighttables and colormaps
ugh i hope this doesent break
2024-01-22 23:28:34 +01:00
Alug dde4b4df3b merge conflict moment 2024-01-22 21:32:38 +01:00
Alug c070930a8c Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-22 21:31:04 +01:00
Alug d36b5f7c59 add hw_shaders to cmakelist 2024-01-22 18:41:00 +01:00
Alug 0e517907ce change this 2024-01-22 18:32:13 +01:00
Alug 739e9716ab add toggle for custom shaders
it seems better like this, atleast thats how hannu set it up
2024-01-22 18:25:51 +01:00
Alug 0e5972d895 shaderstate should be set here 2024-01-22 18:15:53 +01:00
Alug 71975658ca split hw_shader files 2024-01-22 18:14:14 +01:00
Alug 6572e29a64 OpenGL shader code rearrangement and shader pre-preprocessor
https://git.do.srb2.org/STJr/SRB2/-/commit/de37df1be04e9d1dfb11083a9585eb6ac1761633?merge_request_iid=1516
wew
2024-01-22 16:57:47 +01:00
indev 41b21c2a0c Fix sound, music, and midi music toggles 2024-01-22 13:48:13 +01:00
Alug 2b19d2e6de Revert "revert this"
This reverts commit 5bce9d5abf.
2024-01-22 13:48:10 +01:00
Alug f99aa3459c e 2024-01-22 13:48:00 +01:00
Alug 5bce9d5abf revert this
this caused sound and music to alyways toggle themselves on after a restart + other issues
2024-01-22 02:55:40 +01:00
Alug abe102649e forgor 2024-01-22 02:52:33 +01:00
Alug 424fcdc63a change some memfree names 2024-01-22 02:46:59 +01:00
Alug a3fd451c74 3D model texture Z_tag 2024-01-22 02:43:55 +01:00
Alug 731fd113d2 more cleanup 2024-01-22 02:34:07 +01:00
Alug c9ca1bda5c Texture buffer for non RGBA to RGBA conversion 2024-01-22 02:09:55 +01:00
Alug 58ea822050 Remove 3Dfx and glide things
gr_rounddown toggle did nothing instead the game always resized textures, now it wont, seems like this makes stutters on mapload less
2024-01-22 01:03:48 +01:00
Alug 671484d6f9 fix merge conflict 2024-01-21 16:41:38 +01:00
Alug e6e74194bc Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-21 16:40:12 +01:00
Alug 04432c8368 simplify this uuh 2024-01-21 15:43:46 +01:00
Alug 6782876c0c i hate this so i just make it a boolean
confused the heck outta me so just do it like this lmao
2024-01-21 15:31:07 +01:00
Alug 4b09e92d7c grr 2024-01-20 17:24:11 +01:00
Alug 3266f64fb9 oops 2024-01-20 17:03:05 +01:00
Alug 2a9886e698 cleanup s_sound a little + fix onchanges 2024-01-20 17:01:48 +01:00
Alug 1319e3a811 make NO_MIDI=0 compile 2024-01-20 16:52:46 +01:00
Alug 6cbb40f874 make some things static + remove cdmusic leftovers 2024-01-20 15:43:42 +01:00
Alug 07fd6a3ad4 make sound precaching useful at all
so it also precaches addon sounds and all
thx indev for help <3
2024-01-20 15:39:25 +01:00
Alug 8891869013 fix issues with sound precaching
adds a check if sounds have been previously loaded already

also makes it useful at all by not freeing soundsfx data on each mapload when its enabled

also adds an onchange so toggling it either caches all sounds again or frees them
2024-01-20 13:58:11 +01:00
Alug 04fc735e12 Merge remote-tracking branch 'origin/morenewpalshader' into lugstuff 2024-01-19 19:37:07 +01:00
Alug 7b9860f1be Merge remote-tracking branch 'origin/morenewpalshader' into lugstuff 2024-01-19 19:25:24 +01:00
Alug 38f26a2bd8 simplify setpalette 2024-01-19 18:07:32 +01:00
Alug a9750f8cff Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-19 12:29:20 +01:00
Alug ad86e7f34a Optimize polygon sorting on batch renderer
again
2024-01-19 02:14:20 +01:00
Alug 496435ef3b dont check for precip in sprite sorting + smol cleanup 2024-01-19 02:14:04 +01:00
Alug 5275b31e7e smol stuffs 2024-01-19 00:39:07 +01:00
Alug e341991703 Add toggle for horizonlines 2024-01-18 20:53:59 +01:00
Alug fb65496507 use fudges from newer paletter shader 2024-01-18 16:49:10 +01:00
Alug abe52ba440 make thundershield follow player offset
this allows the to stay on the player when saltyhopping etc.
2024-01-18 15:21:20 +01:00
Alug ee5d097201 Prevent FOF alpha from wrapping around in OpenGL 2024-01-18 15:07:29 +01:00
Alug 0ea182d04f change this 2024-01-18 14:12:27 +01:00
Alug 8d737c96c9 Refactor Batching code
from Hannu Hanhi
https://git.do.srb2.org/STJr/SRB2/-/commit/707687beea50a2bfcc14638e923ac516195351b1?merge_request_iid=1774
2024-01-17 18:30:53 +01:00
Alug 5c93b90c2e Merge remote-tracking branch 'origin/batching-stuff' into lugstuff 2024-01-17 18:16:06 +01:00
Alug 41bee850da Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-17 14:59:21 +01:00
Alug 416c2a9e9d Merge remote-tracking branch 'origin/planestuff2' into lugstuff 2024-01-17 12:42:59 +01:00
Alug 8fa9fccc79 Revert "use malloc here"
This reverts commit 75d1076bbe.
2024-01-17 12:42:56 +01:00
Alug c5a4071a06 Revert "Move water ripple spanfunc out of r_plane + tilted water support"
This reverts commit 139d937c86.
2024-01-17 12:42:48 +01:00
Alug 930e48ad39 Revert "Plane optimization and cleanup"
This reverts commit db61bfb568.
2024-01-17 12:42:39 +01:00
Alug 868678f321 Revert "Revert "Revert "Fix vibing slope planes"""
This reverts commit 8530b6512c.
2024-01-17 12:42:34 +01:00
Alug 8530b6512c Revert "Revert "Fix vibing slope planes""
This reverts commit 2a5f487e5f.
2024-01-17 12:32:50 +01:00
Alug 2a5f487e5f Revert "Fix vibing slope planes"
This reverts commit 82562bc20d.
2024-01-17 12:31:28 +01:00
Alug 141f6c51dc Revert "optimize plane stuff even more"
This reverts commit 120def9676.
2024-01-17 12:31:24 +01:00
Alug 1fc9492b30 Revert "Use floating point trig in R_SetSlopePlane"
This reverts commit 3555783284.
2024-01-17 12:31:13 +01:00
Alug 65782d3d75 Revert "more changes"
This reverts commit cb6d657c03.
2024-01-17 12:31:08 +01:00
Alug b5cb6dfb9d Revert "forgoer"
This reverts commit f476befc4b.
2024-01-17 12:31:03 +01:00
Alug 6667e4b8bc Revert "forgor R_GetSlopeZAt"
This reverts commit 4a94939d4f.
2024-01-17 12:30:58 +01:00
Alug 5e2492a930 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-17 12:19:30 +01:00
Alug 4f07372e0f (hopefully) fix overflow in R_DrawRepeatMaskedColumn
well this fixes the game hanging in software renderer on Marsh´s Marble Zone
2024-01-17 12:11:32 +01:00
Alug 80a1a97083 Revert "Revert "Revert "Localskins on replays"""
This reverts commit 12059955e5.
2024-01-16 16:44:41 +01:00
Alug 204476c55d Revert "Hopefully fix the localskin replay issues 🙏"
This reverts commit 8fab258778.
2024-01-16 16:44:38 +01:00
hayaunderscore 8fab258778 Hopefully fix the localskin replay issues 🙏 2024-01-16 16:35:39 +01:00
Alug 12059955e5 Revert "Revert "Localskins on replays""
This reverts commit d3e5dfc346.
2024-01-16 16:35:33 +01:00
Alug 3ca1f957ba fix ogl shearing with flipcam 2024-01-16 16:22:30 +01:00
Alug b11362aec1 remove the extra screentex and apply palshader directly to finaltex
theres basically barely any difference, even in the fades theres very little, and it just cost so freaking much performance

however, ill keep the revamped screentex setup as this it allows us to keep the better fadescreen background for menus
2024-01-15 20:12:35 +01:00
Alug 75630df10e readd oldpal
for performance reasons its better
2024-01-15 19:36:37 +01:00
Alug 4d93abb7ac do this a little better 2024-01-15 17:44:07 +01:00
Alug 731943f980 ensure consistent shader state 2024-01-15 16:50:20 +01:00
Alug 265dc1f296 Light table support for HWR_FadeScreenMenuBack 2024-01-15 16:29:01 +01:00
Alug c449ffcc98 remove gr_oldpal for now 2024-01-15 16:23:19 +01:00
Alug 34500d32d0 paletterenderer screentex stuff again
this didnt really work like it shouldve
so ill keep it here for now
2024-01-15 16:17:17 +01:00
Alug d3e5dfc346 Revert "Localskins on replays"
This reverts commit e1f821e121.
2024-01-15 15:51:28 +01:00
Alug 8ed11107eb remove Shader_Load as Shader_SetUniforms literally did the same thing 2024-01-15 15:10:02 +01:00
Alug 2f51108783 fix lighttable batching for new batching and palshader code 2024-01-15 15:09:36 +01:00
Alug 2667a66419 Merge remote-tracking branch 'origin/batching-stuff' into lugstuff 2024-01-15 14:27:10 +01:00
Alug 0fd073f2f0 Merge remote-tracking branch 'origin/batching-stuff' into lugstuff 2024-01-15 14:18:10 +01:00
Alug 840cf4e00a Revert "Revert "Optimize HWR_RenderBatches polygon sorting""
This reverts commit a36e633555.
2024-01-15 14:15:26 +01:00
Alug d5d99f94b7 cap flashpals again
well it often resulted in flashpals that just made stuff so badly visable lmao
2024-01-15 11:38:09 +01:00
Alug dea19e4416 forgor R_GetSlopeZAt 2024-01-15 11:20:54 +01:00
Alug f7612d7398 forgoer 2024-01-15 11:17:19 +01:00
Alug e39182607e more changes 2024-01-15 11:16:16 +01:00
Alug 79f1febbce Use floating point trig in R_SetSlopePlane 2024-01-15 11:10:12 +01:00
Alug 120def9676 optimize plane stuff even more 2024-01-15 11:09:07 +01:00
Alug 82562bc20d Fix vibing slope planes 2024-01-15 10:44:43 +01:00
Alug 1c51361120 Plane optimization and cleanup
sned help

https://git.do.srb2.org/STJr/SRB2/-/commit/c07c80fd9e626f15b4d84d1766f8963e089d295a
2024-01-15 10:40:51 +01:00
Alug c07e79deb7 Move water ripple spanfunc out of r_plane + tilted water support
idk man
2024-01-15 10:18:13 +01:00
Alug 81cb1111b4 use malloc here 2024-01-15 09:36:35 +01:00
Alug 369307181e this can be static 2024-01-15 08:35:45 +01:00
Alug 7881e04e6b Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-15 08:26:13 +01:00
Alug 66a72eb1be Copy Interpolation to Shields and Overlays, Splitscreen Overlays
from https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1992
2024-01-15 08:25:54 +01:00
Alug ad77f11859 Optimize polygon sorting on batch renderer
from https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2253

again lul
2024-01-15 00:31:29 +01:00
Alug 96d177876f Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-14 23:50:14 +01:00
Alug dc7392f86b Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-14 22:57:24 +01:00
Alug 6f6252b6f8 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-14 22:50:11 +01:00
Alug 20b32df2c6 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-14 22:13:42 +01:00
Alug d413d02bf7 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-14 21:38:49 +01:00
Alug 426c0366cc Merge remote-tracking branch 'origin/newpalshader' into lugstuff 2024-01-13 16:12:04 +01:00
Alug d3d3655580 Merge remote-tracking branch 'origin/crash-log-mention' into lugstuff 2024-01-13 12:05:55 +01:00
Alug d4a011ee6d Merge remote-tracking branch 'origin/addfilelocal-load-animdefs' into lugstuff 2024-01-12 13:37:17 +01:00
Alug b08118734e Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-12 13:37:14 +01:00
indev 41ee6de784 Make non-important files still load textures and animdefs 2024-01-12 15:35:24 +03:00
hayaunderscore 139d2e6be8 Localskins on replays 2024-01-12 12:26:21 +01:00
Alug a866461b0a Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-11 18:46:14 +01:00
Alug 6f61331d46 Merge remote-tracking branch 'origin/newpalshader' into lugstuff 2024-01-11 18:46:12 +01:00
Alug 7731ca9fb2 Merge remote-tracking branch 'origin/newpalshader' into lugstuff 2024-01-11 09:53:47 +01:00
Alug 3de0c4f5d8 Merge remote-tracking branch 'origin/newpalshader' into lugstuff 2024-01-11 01:10:04 +01:00
Alug 2e602f8861 Revert "Revert "just show text instead of miscoloured boxes""
This reverts commit 7072a50060.
2024-01-11 00:50:36 +01:00
Alug 1a7d92a082 Revert "Revert "fix some things""
This reverts commit a65e586de5.
2024-01-11 00:50:26 +01:00
Alug 5aa2a0c821 Revert "Revert "Merge remote-tracking branch 'origin/gammastuff' into lugstuff""
This reverts commit a9d7ca3332.
2024-01-11 00:50:17 +01:00
Alug 4f2328b8dc Merge remote-tracking branch 'origin/newpalshader' into lugstuff 2024-01-11 00:47:24 +01:00
Alug e929e524a3 Merge remote-tracking branch 'origin/newpalshader' into lugstuff 2024-01-10 14:18:45 +01:00
Alug e6b9f18d3d Merge remote-tracking branch 'origin/newpalshader' into lugstuff 2024-01-10 14:14:53 +01:00
Alug 7f197ef84e Merge remote-tracking branch 'origin/newpalshader' into lugstuff 2024-01-10 13:52:26 +01:00
Alug a9d7ca3332 Revert "Merge remote-tracking branch 'origin/gammastuff' into lugstuff"
This reverts commit 9aca8438a2, reversing
changes made to c2d37dfb61.
2024-01-10 13:51:51 +01:00
Alug a65e586de5 Revert "fix some things"
This reverts commit 69ffee271d.
2024-01-10 13:51:46 +01:00
Alug 7072a50060 Revert "just show text instead of miscoloured boxes"
This reverts commit fc1a367c2e.
2024-01-10 13:51:43 +01:00
Alug fc1a367c2e just show text instead of miscoloured boxes 2024-01-09 14:27:05 +01:00
Alug 3b376d85d4 fix some things 2024-01-09 14:19:36 +01:00
Alug 9aca8438a2 Merge remote-tracking branch 'origin/gammastuff' into lugstuff 2024-01-09 14:09:56 +01:00
Alug c2d37dfb61 use og values for pal 2024-01-09 13:38:24 +01:00
Alug 3c3bd0f0ea stuff 2024-01-09 13:25:59 +01:00
Alug 958db336b7 change this 2024-01-09 13:23:54 +01:00
Alug 342d570b3b Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-08 09:07:24 +01:00
Alug 67457c25df Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-08 08:54:08 +01:00
Alug a98d46f8a8 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-08 08:51:05 +01:00
Alug b2fca84b15 Zzz... 2024-01-07 08:25:49 +01:00
Alug 2e31169738 use fudge defines + remove wall and floor shader
both are now consilidated ( i have no idea how to spell that) into doom_colormap shader
2024-01-06 08:11:57 +01:00
Alug 4cda2c8093 use srb2´s sky shader
also its finally a defined shader now + move default fragment shader to the top
2024-01-06 08:07:11 +01:00
Alug 73b4e8a988 change this 2024-01-06 04:57:18 +01:00
Alug 82dbfb4379 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-06 01:15:05 +01:00
Alug 0e2ff2390a Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-05 21:56:11 +01:00
Alug 220d5db739 optimize camera mobj z stuff lol
idk wanna see if this does anything
2024-01-05 06:40:16 +01:00
Alug 212d475f50 fix menu fade screen background using wrong things in palshader 2024-01-05 01:23:05 +01:00
Alug b7fbd0433f little changes to palshader
use gl_texture 2 in postprocess like srb2s palshader does it
also disable depthtest for screentextures in palshader mode
2024-01-05 00:53:19 +01:00
Alug d28dd96aa0 revert this 2024-01-05 00:22:13 +01:00
Alug 0e46f91c51 change order of those 2024-01-05 00:21:51 +01:00
Alug d6dabacb05 wöter... 2024-01-04 23:31:55 +01:00
Alug 4363473955 hehe funky colours 2024-01-04 23:11:46 +01:00
Alug 7e5fd4e290 Merge remote-tracking branch 'origin/compilation-warnings-fix' into lugstuff 2024-01-03 20:02:35 +01:00
Alug c30a0cd4f1 Merge remote-tracking branch 'origin/compilation-warnings-fix' into lugstuff 2024-01-03 20:00:34 +01:00
Alug 98d56a38f5 Merge remote-tracking branch 'origin/compilation-warnings-fix' into lugstuff 2024-01-03 19:45:14 +01:00
Alug f26e95e7c9 Merge remote-tracking branch 'origin/compilation-warnings-fix' into lugstuff 2024-01-03 18:24:19 +01:00
Alug f39e1a9b70 wöter 2 2024-01-03 02:24:15 +01:00
Alug 1d5b531ba3 Revert "uuuh refactor batching a little + port Optimize polygon sorting"
This reverts commit d757e82e3f.
2024-01-02 22:21:25 +01:00
Alug a90bd08405 Revert " Avoid batching skybox and horizon lines"
This reverts commit b5fbaaa2b9ae91877c7c6ad3602956d677fa6e0c.
2024-01-02 22:21:21 +01:00
Alug 1cbb726cab Merge branch 'lugstuff' of https://github.com/Indev450/SRB2Kart-Saturn into lugstuff 2024-01-02 22:13:17 +01:00
Alug ce61d00dcf fix inline warnings 2024-01-02 22:13:13 +01:00
indev 2d92b798c6 Fix warnings related to boolean glib getters/setters 2024-01-03 00:10:28 +03:00
Alug cc62164a7c Revert "Revert "Merge remote-tracking branch 'origin/Saturn-Next-EnumLib' into lugstuff""
This reverts commit 142540e263.
2024-01-02 21:08:03 +01:00
Alug af510bce93 inline deez nuts 2024-01-02 21:07:02 +01:00
Alug 4ba60bedcd AAAAAaaa 2024-01-02 20:36:32 +01:00
Alug 583bf26129 wöter 2024-01-02 20:36:14 +01:00
Alug d8c3623141 Avoid batching skybox and horizon lines 2024-01-02 20:35:26 +01:00
Alug 2cd0875da6 lol 2024-01-02 06:19:31 +01:00
Alug 73d0848f7e (hopefully) fix horizonlines 2024-01-02 03:49:32 +01:00
Alug d757e82e3f uuuh refactor batching a little + port Optimize polygon sorting
uhhh https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2253
2024-01-02 01:02:42 +01:00
Alug 007238e7dd Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-02 00:09:27 +01:00
Alug 944e019020 let indev compile this branch uwu 2024-01-01 21:28:03 +01:00
Alug 634f8897b4 Revert "uuuh refactor batching a little + port Optimize polygon sorting"
This reverts commit 7651d31c50.
2024-01-01 21:19:14 +01:00
Alug 7651d31c50 uuuh refactor batching a little + port Optimize polygon sorting
uhhh https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2253
2024-01-01 20:44:19 +01:00
Alug 1702873ab1 Revert "attempt at making water shader ripple more accurate to software"
This reverts commit 8ab37040db.
2024-01-01 18:55:41 +01:00
Alug 44e7d5249c dont pack my memories 2024-01-01 18:30:06 +01:00
Alug 8ab37040db attempt at making water shader ripple more accurate to software 2024-01-01 18:29:04 +01:00
Alug ac203b0ccb Merge remote-tracking branch 'origin/compilation-warnings-fix' into lugstuff 2024-01-01 17:08:31 +01:00
Alug 557546c9c3 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2024-01-01 17:08:18 +01:00
Alug 52a94dbe78 try and make p-speedometer a little less painful to look at 2023-12-31 03:39:24 +01:00
Alug f4ffc19981 lil k_kart cleanup
uh
2023-12-31 03:12:35 +01:00
Alug ac3c117b03 uh 2023-12-31 00:12:11 +01:00
Alug 1ac008ab02 Merge remote-tracking branch 'origin/compilation-warnings-fix' into lugstuff 2023-12-31 00:07:39 +01:00
Alug 58ac86e3bf noone cares about c90 mixed declarations lmao 2023-12-30 21:51:23 +01:00
Alug 1daf06858b Revert "(maybe?) fix net issues on server join"
This reverts commit af40bdb11b.
2023-12-30 21:41:33 +01:00
Alug a4e8ce7f01 Fix most of compilation warnings 2023-12-30 15:55:07 +01:00
Alug ed6e16cdce uuh 2023-12-30 01:20:09 +01:00
Alug 57bb92a36c this didnt work out lmao 2023-12-30 00:55:24 +01:00
Alug 142540e263 Revert "Merge remote-tracking branch 'origin/Saturn-Next-EnumLib' into lugstuff"
This reverts commit 5dab606980, reversing
changes made to 661dfde6af.
2023-12-29 23:24:08 +01:00
Alug 5a17430747 Revert "Merge remote-tracking branch 'origin/moreopengl' into lugstuff"
This reverts commit a6015e4647, reversing
changes made to fcbe95447a.
2023-12-29 22:49:51 +01:00
Alug 23c84a9e96 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2023-12-29 22:49:27 +01:00
Alug 6bb9dcc216 revert that part it stuttered race conditions or somethjing lmao 2023-12-29 15:36:12 +01:00
Alug 1901e4dbdc fuckit idk lmoa 2023-12-29 14:23:29 +01:00
Alug 1657f769da Revert "dont need that"
This reverts commit f274ed3fd8.
2023-12-29 13:11:43 +01:00
Alug c82eb489fe give me all that shit yes 2023-12-29 01:47:27 +01:00
Alug 9f05befd70 i have no idea what im doing lmao 2023-12-29 01:36:33 +01:00
Alug f274ed3fd8 dont need that 2023-12-29 01:35:50 +01:00
Alug f6e027abcb Merge remote-tracking branch 'origin/gl-noencore-effect-fix' into lugstuff 2023-12-27 15:30:13 +01:00
Alug a92114a854 Merge remote-tracking branch 'origin/gl-noencore-effect-fix' into lugstuff 2023-12-27 15:04:36 +01:00
Alug ffb84705d3 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2023-12-27 14:40:50 +01:00
Alug 2f8366b6f9 -flto breaks crashlogs it seems lol 2023-12-24 20:28:57 +01:00
Alug a6f062c126 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2023-12-24 19:41:15 +01:00
Alug 41c24f3bc9 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2023-12-24 19:13:15 +01:00
Alug af40bdb11b (maybe?) fix net issues on server join
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2238?commit_id=d79d22de63c5b84e3e0f4d737af81f74321dd80d

needs alot of testing
2023-12-24 00:15:47 +01:00
Alug 00a69e6aed Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2023-12-23 17:24:07 +01:00
Alug 04b2d784ce Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2023-12-22 20:28:28 +01:00
Alug a5de51b039 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2023-12-21 13:54:33 +01:00
Alug 4a80e9f20f Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2023-12-20 23:06:24 +01:00
Alug 8676769a8f Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2023-12-20 17:53:09 +01:00
Alug 2f8c7a81ca Revert "Merge remote-tracking branch 'origin/thinkercache' into lugstuff"
This reverts commit 760fe392a8, reversing
changes made to 5dab606980.
2023-12-20 08:35:16 +01:00
Alug ac11af6048 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2023-12-20 06:09:25 +01:00
Alug 7c558802a4 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2023-12-20 05:16:05 +01:00
Alug 5a516aa1ad dont need that 2023-12-19 21:52:21 +01:00
Alug 4d1b6ed974 Merge remote-tracking branch 'origin/Saturn-Next' into lugstuff 2023-12-19 20:20:57 +01:00
Alug e8e6bb0499 Revert "test stuff"
This reverts commit 085efaa605.
2023-12-19 19:41:55 +01:00
Alug 58f94666d1 timeout sticker uses wrong patch 2023-12-19 18:58:10 +01:00
Alug 085efaa605 test stuff
very crude, console scream at me if those are botched
most likely not the issue but whatever
2023-12-19 18:57:47 +01:00
Alug 6028e392f0 dont prep shaders if theyre uneeded 2023-12-19 17:34:15 +01:00
Alug fa67dd74a0 huehue 2023-12-19 16:28:51 +01:00
Alug cb734b50c3 bru 2023-12-19 16:24:33 +01:00
Alug 087e58b88b bugger off discord rpc 2023-12-19 16:21:35 +01:00
Alug 78b9d67aaa im not on pentium 4 2023-12-19 16:17:15 +01:00
Alug a6015e4647 Merge remote-tracking branch 'origin/moreopengl' into lugstuff 2023-12-19 16:14:18 +01:00
Alug fcbe95447a Merge remote-tracking branch 'origin/multithreadshit' into lugstuff 2023-12-19 16:13:44 +01:00
Alug 760fe392a8 Merge remote-tracking branch 'origin/thinkercache' into lugstuff 2023-12-19 16:11:54 +01:00
Alug 5dab606980 Merge remote-tracking branch 'origin/Saturn-Next-EnumLib' into lugstuff 2023-12-19 16:11:36 +01:00
indev c265575dfd Fix config 2023-11-16 22:14:18 +03:00
alufolie91 4a1f526ac6 multithread exec command and some filesearch/add stuff
hey it actually improves some things alot
esp the loading addons stage when joining a server
2023-11-16 19:14:48 +01:00
Alug 497b633661 Revert "why did i remove this back then??"
This reverts commit 91ed5c4871.
2023-11-15 09:59:24 +01:00
alufolie91 c7f54a98e0 Merge remote-tracking branch 'origin/Saturn-Next' into moreopengl 2023-11-14 21:16:47 +01:00
alufolie91 7da8c20409 remove that stuff 2023-11-14 21:16:04 +01:00
Alug 116328c7bf attempt at linked list for textures
also changes to caching handling a bit
seems to have helped with stuck colors a bit
2023-11-08 02:50:17 +01:00
Alug bd68fef4a2 Zzzzz... 2023-11-08 00:38:48 +01:00
alufolie91 7759d56ad3 Fix uninitialized reads in PreparePolygon
https://git.do.srb2.org/STJr/SRB2/-/merge_requests/1392
2023-11-08 00:17:42 +01:00
Alug 9c7020a369 GRRRRRR not GLLLLLLLL 2023-11-07 18:23:31 +01:00
alufolie91 f8c1903316 change how mipmap caching works
also a bit of texture conversion
idk
2023-11-07 18:19:40 +01:00
alufolie91 652423ad14 Cache and reuse removed mobjs when spawning mobjs
from https://git.do.srb2.org/STJr/SRB2/-/merge_requests/2200
2023-11-06 12:27:23 +01:00
76 changed files with 6822 additions and 9981 deletions

No files matched your search

+1
View File
@@ -4,6 +4,7 @@
*.plg
*.suo
*.vcproj.*.*.user
*.kate-swp
Win32_LIB_ASM_Debug
Win32_LIB_ASM_Release
*.bsc
+21 -6
View File
@@ -246,13 +246,25 @@ debug_opts=-DNDEBUG
opts+=-O3
ifdef USELTO
# compile with LTO
ifdef MINGW
opts+=-flto=auto -g
libs+=-flto=auto -g
else
opts+=-flto=auto
libs+=-flto=auto
endif
endif
endif
ifdef USEASAN
# compile with asan
ifdef MINGW
opts+=-fsanitize=address -g
libs+=-fsanitize=address -g
else
opts+=-fsanitize=address
libs+=-fsanitize=address
endif
opts+=-fsanitize=address
libs+=-fsanitize=address
endif
@@ -262,8 +274,11 @@ opts+=$(debug_opts)
opts+=$(foreach v,$(passthru_opts),$(if $($(v)),-D$(v)))
opts+=$(WFLAGS) $(CPPFLAGS) $(CFLAGS)
cxxopts:=$(opts) $(CXXFLAGS) -std=c++17
CXXFLAGS+=-std=c++17 # force c17 for c++ since most vpss run older ubuntu versions with old compilers
opts+=$(WFLAGS) $(CFLAGS)
cxxopts:=$(opts) $(CXXFLAGS)
opts+=$(CWFLAGS) # warning flags that shouldnt be passed to c++ compiler
libs+=$(LDFLAGS) -lstdc++ -lpthread
asflags:=$(ASFLAGS) -x assembler-with-cpp
@@ -375,12 +390,12 @@ ifdef Echo_name
@printf '%-20.20s\r' $$<
endif
endif
$(.)$(cc) -MM -MF $$@ -MT $(objdir)/$$*.o $(2) $$<
$(.)$(2) -MM -MF $$@ -MT $(objdir)/$$*.o $(3) $$<
endef
$(eval $(call _recipe,c))
$(eval $(call _recipe,cpp))
$(eval $(call _recipe,s,$(asflags)))
$(eval $(call _recipe,c,$(cc)))
$(eval $(call _recipe,cpp,$(cxx)))
$(eval $(call _recipe,s,$(cc),$(asflags)))
# compiling recipe template
# 1: target file suffix
+2 -3
View File
@@ -6,8 +6,7 @@ passthru_opts+=\
NOHW NOMD5 NOPOSTPROCESSING\
MOBJCONSISTANCY PACKETDROP ZDEBUG\
HAVE_MINIUPNPC\
HAVE_DISCORDRPC DEVELOP\
NOBLUAJIT
HAVE_DISCORDRPC DEVELOP
# build with debugging information
ifdef DEBUGMODE
@@ -98,7 +97,7 @@ opts+=-DHAVE_VALGRIND
endif
default_packages:=\
GME/libgme/LIBGME\
LIBGME/libgme/LIBGME\
OPENMPT/libopenmpt/LIBOPENMPT\
ZLIB/zlib\
+6 -8
View File
@@ -20,10 +20,6 @@ $(foreach v,$(join $(wordlist 2,$(_n),- $(gcc_versions)),\
CXXFLAGS+= -Wno-aggregate-return
# -W -Wno-unused
ifdef GCC150
opts+=-std=gnu17
endif
WFLAGS:=-Wall -Wno-trigraphs
ifndef GCC295
#WFLAGS+=-Wno-packed
@@ -45,7 +41,8 @@ ifdef GCC41
WFLAGS+=-Wshadow
endif
#WFLAGS+=-Wlarger-than-%len%
WFLAGS+=-Wpointer-arith -Wbad-function-cast
WFLAGS+=-Wpointer-arith
CWFLAGS+=-Wbad-function-cast
ifdef GCC45
#WFLAGS+=-Wc++-compat
endif
@@ -75,9 +72,10 @@ endif
endif
#WFLAGS+=-Wstrict-prototypes
ifdef GCC40
WFLAGS+=-Wold-style-definition
CWFLAGS+=-Wold-style-definition
endif
WFLAGS+=-Wmissing-prototypes -Wmissing-declarations
WFLAGS+=-Wmissing-declarations
CWFLAGS+=-Wmissing-prototypes
ifdef GCC40
WFLAGS+=-Wmissing-field-initializers
endif
@@ -88,7 +86,7 @@ endif
#WFLAGS+=-Wpacked
#WFLAGS+=-Wpadded
#WFLAGS+=-Wredundant-decls
WFLAGS+=-Wnested-externs
CWFLAGS+=-Wnested-externs
#WFLAGS+=-Wunreachable-code
WFLAGS+=-Winline
ifdef DEBUGMODE
+1 -1
View File
@@ -66,7 +66,7 @@ $(eval $(call _set,LIBGME))
lib:=../libs/libopenmpt
LIBOPENMPT_opts:=-I$(lib)/inc
LIBOPENMPT_libs:=-L$(lib)/lib/$(x86)/mingw -lopenmpt
LIBOPENMPT_libs:=-L$(lib)/lib/$(x86) -lopenmpt
$(eval $(call _set,LIBOPENMPT))
lib:=../libs/SDL2_mixer/$(mingw)
+1
View File
@@ -29,6 +29,7 @@ m_cond.c
m_fixed.c
m_menu.c
m_textinput.c
m_emotes.cpp
m_misc.c
m_perfstats.c
m_queue.c
+21 -1
View File
@@ -36,6 +36,26 @@ LUALIB_API void (luaL_setn) (lua_State *L, int t, int n);
/* extra error code for `luaL_load' */
#define LUA_ERRFILE (LUA_ERRERR+1)
/* Compiler-specific attributes and other macros */
#ifdef __GNUC__ // __attribute__ ((X))
#if ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 1)) && defined (__MINGW32__) // MinGW, >= GCC 4.1
#if 0 //defined (__USE_MINGW_ANSI_STDIO) && __USE_MINGW_ANSI_STDIO > 0
#define FUNCREPORT __attribute__ ((format(gnu_printf, 2, 3)))
#elif (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 4) // >= GCC 4.4
#define FUNCREPORT __attribute__ ((format(ms_printf, 2, 3)))
#else
#define FUNCREPORT __attribute__ ((format(printf, 2, 3)))
#endif
#else
#define FUNCREPORT __attribute__ ((format(printf, 2, 3)))
#endif
#endif
#ifndef FUNCREPORT
#define FUNCREPORT
#endif
typedef struct luaL_Reg {
const char *name;
@@ -70,7 +90,7 @@ LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname);
LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname);
LUALIB_API void (luaL_where) (lua_State *L, int lvl);
LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...);
LUALIB_API FUNCREPORT int (luaL_error) (lua_State *L, const char *fmt, ...);
LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def,
const char *const lst[]);
+823 -728
View File
File diff suppressed because it is too large. Load diff
+2 -3
View File
@@ -42,8 +42,8 @@ applications may follow different packet versions.
#define VANILLA_GT_MATCH 3
// Networking and tick handling related.
#define BACKUPTICS 32
#define TICQUEUE 512 // more than enough for most timeouts....
#define BACKUPTICS 512 // more than enough for most timeouts....
#define CLIENTBACKUPTICS 32
#define MAXTEXTCMD 256
// No. of tics your controls can be delayed by.
@@ -533,7 +533,6 @@ extern UINT32 serverlistultimatecount;
extern INT32 mapchangepending;
// Points inside doomcom
extern doomdata_t *netbuffer;
extern consvar_t cv_stunserver;
extern consvar_t cv_httpsource;
extern consvar_t cv_kicktime;
+4 -1
View File
@@ -40,6 +40,7 @@
#include "g_game.h"
#include "g_input.h"
#include "hu_stuff.h"
#include "m_emotes.h"
#include "i_sound.h"
#include "i_system.h"
#include "i_time.h"
@@ -927,7 +928,7 @@ void D_SRB2Loop(void)
// consoleplayer -> displayplayers (hear sounds from viewpoint)
S_UpdateSounds(); // move positional sounds
LUA_Step();
//LUA_Step();
#ifdef HAVE_DISCORDRPC
if (!dedicated && renderisnewtic)
@@ -2036,6 +2037,8 @@ void D_SRB2Main(void)
S_InitMusicDefs();
M_InitEmotes();
CONS_Printf("ST_Init(): Init status bar.\n");
ST_Init();
+34 -29
View File
@@ -48,12 +48,6 @@ tic_t connectiontimeout = (10*TICRATE);
/// \brief network packet
doomcom_t *doomcom = NULL;
/// \brief network packet data, points inside doomcom
doomdata_t *netbuffer = NULL;
/// \brief hole punching packet, also points inside doomcom
#ifdef HOLEPUNCH
holepunch_t *holepunchpacket = NULL;
#endif
#ifdef DEBUGFILE
FILE *debugfile = NULL; // put some net info in a file during the game
@@ -209,13 +203,9 @@ static node_t nodes[MAXNETNODES];
// 0 if a = n (mod 256)
// >0 if a > b (mod 256)
// mnemonic: to use it compare to 0: cmpack(a,b)<0 is "a < b" ...
FUNCMATH static INT32 cmpack(UINT8 a, UINT8 b)
FUNCMATH static inline INT32 cmpack(UINT8 a, UINT8 b)
{
register INT32 d = a - b;
if (d >= 127 || d < -128)
return -d;
return d;
return (SINT8)(a - b);
}
/** Sets freeack to a free acknum and copies the netbuffer in the ackpak table
@@ -229,6 +219,8 @@ static boolean GetFreeAcknum(UINT8 *freeack)
node_t *node = &nodes[doomcom->remotenode];
INT32 i, numfreeslot = 0;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
if (cmpack((UINT8)((node->remotefirstack + MAXACKTOSEND) % 256), node->nextacknum) < 0)
{
DEBFILE(va("too fast %d %d\n",node->remotefirstack,node->nextacknum));
@@ -298,6 +290,7 @@ static boolean Processackpak(void)
INT32 i;
boolean goodpacket = true;
node_t *node = &nodes[doomcom->remotenode];
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
// Received an ack return, so remove the ack in the list
if (netbuffer->ackreturn && cmpack(node->remotefirstack, netbuffer->ackreturn) < 0)
@@ -307,7 +300,7 @@ static boolean Processackpak(void)
// Search the ackbuffer and free it
for (i = 0; i < MAXACKPACKETS; i++)
{
if (ackpak[i].acknum && ackpak[i].destinationnode == node - nodes
if (ackpak[i].acknum && ackpak[i].destinationnode == doomcom->remotenode
&& cmpack(ackpak[i].acknum, netbuffer->ackreturn) <= 0)
{
RemoveAck(i);
@@ -423,6 +416,7 @@ void Net_SendAcks(INT32 node)
#ifdef NONET
(void)node;
#else
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
netbuffer->packettype = PT_NOTHING;
M_Memcpy(netbuffer->u.textcmd, nodes[node].acktosend, MAXACKTOSEND);
HSendPacket(node, false, 0, MAXACKTOSEND);
@@ -434,6 +428,8 @@ static void GotAcks(void)
{
INT32 i, j;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
for (j = 0; j < MAXACKTOSEND; j++)
{
if (netbuffer->u.textcmd[j])
@@ -487,6 +483,8 @@ void Net_AckTicker(void)
#ifndef NONET
INT32 i;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
for (i = 0; i < MAXACKPACKETS; i++)
{
const INT32 nodei = ackpak[i].destinationnode;
@@ -542,6 +540,7 @@ void Net_UnAcknowledgePacket(INT32 node)
#ifdef NONET
(void)node;
#else
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
INT32 hm1 = (nodes[node].acktosend_head-1+MAXACKTOSEND) % MAXACKTOSEND;
DEBFILE(va("UnAcknowledge node %d\n", node));
@@ -736,6 +735,7 @@ void Net_CloseConnection(INT32 node)
//
static UINT32 NetbufferChecksum(void)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
UINT32 c = 0x1234567;
const INT32 l = doomcom->datalength - 4;
const UINT8 *buf = (UINT8 *)netbuffer + 4;
@@ -852,6 +852,8 @@ const char *Net_GetPacketName(UINT8 packettype)
static void DebugPrintpacket(const char *header)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
fprintf(debugfile, "%-12s (node %d,ack %d,ackret %d,size %d) type(%d) : %s\n",
header, doomcom->remotenode, netbuffer->ack, netbuffer->ackreturn, doomcom->datalength,
netbuffer->packettype, Net_GetPacketName(netbuffer->packettype));
@@ -1021,6 +1023,7 @@ void Command_Droprate(void)
#ifndef NONET
static boolean ShouldDropPacket(void)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
return (packetdropquantity[netbuffer->packettype])
|| (packetdroprate != 0 && rand() < (((double)RAND_MAX) * (packetdroprate / 100.f))) || packetdroprate == 100;
}
@@ -1032,6 +1035,7 @@ static boolean ShouldDropPacket(void)
//
boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlength)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
doomcom->datalength = (INT16)(packetlength + BASEPACKETSIZE);
if (node == 0) // Packet is to go back to us
@@ -1132,7 +1136,7 @@ boolean HSendPacket(INT32 node, boolean reliable, UINT8 acknum, size_t packetlen
//
boolean HGetPacket(void)
{
//boolean nodejustjoined;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
// Get a packet from self
if (rebound_tail != rebound_head)
@@ -1220,6 +1224,18 @@ static void Internal_FreeNodenum(INT32 nodenum)
(void)nodenum;
}
static char *I_NetSplitAddress(char *host, char **port)
{
boolean v4 = (host[0] != '[');
host = strtok(host, v4 ? ":" : "[]");
if (port)
*port = strtok(NULL, ":");
return host;
}
SINT8 I_NetMakeNode(const char *hostname)
{
SINT8 newnode = -1;
@@ -1227,20 +1243,14 @@ SINT8 I_NetMakeNode(const char *hostname)
if (I_NetMakeNodewPort)
{
char *localhostname = strdup(hostname);
char *t = localhostname;
const char *port;
char *port;
if (!localhostname)
return newnode;
// retrieve portnum from address!
strtok(localhostname, ":");
port = strtok(NULL, ":");
hostname = I_NetSplitAddress(localhostname, &port);
// remove the port in the hostname as we've it already
while ((*t != ':') && (*t != '\0'))
t++;
*t = '\0';
newnode = I_NetMakeNodewPort(localhostname, port);
newnode = I_NetMakeNodewPort(hostname, port);
free(localhostname);
}
return newnode;
@@ -1332,11 +1342,6 @@ boolean D_CheckNetGame(void)
if (doomcom->numnodes > MAXNETNODES)
I_Error("Too many nodes (%d), max:%d", doomcom->numnodes, MAXNETNODES);
netbuffer = (doomdata_t *)(void *)&doomcom->data;
#ifdef HOLEPUNCH
holepunchpacket = (holepunch_t *)(void *)&doomcom->data;
#endif
#ifdef DEBUGFILE
if (M_CheckParm("-debugfile"))
{
+3
View File
@@ -21,6 +21,7 @@
#include "i_system.h"
#include "g_game.h"
#include "hu_stuff.h"
#include "m_emotes.h"
#include "g_input.h"
#include "m_menu.h"
#include "r_local.h"
@@ -912,6 +913,8 @@ void D_RegisterClientCommands(void)
CV_RegisterVar(&cv_keyboardlayout);
CV_RegisterVar(&cv_emotes);
// time attack ghost options are also saved to config
CV_RegisterVar(&cv_ghost_besttime);
CV_RegisterVar(&cv_ghost_bestlap);
+6
View File
@@ -142,6 +142,7 @@ UINT8 *PutFileNeeded(UINT16 firstfile)
{
size_t i;
UINT8 count = 0;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
UINT8 *p_start = netbuffer->packettype == PT_MOREFILESNEEDED ? netbuffer->u.filesneededcfg.files : netbuffer->u.serverinfo.fileneeded;
UINT8 *p = p_start;
char wadfilename[MAX_WADPATH] = "";
@@ -323,6 +324,7 @@ boolean CL_SendRequestFile(void)
#ifdef MORELEGACYDOWNLOADER
boolean firstloop = true;
#endif
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
#ifdef PARANOIA
if (M_CheckParm("-nodownload"))
@@ -451,9 +453,11 @@ tryagain:
// returns false if a requested file was not found or cannot be sent
boolean Got_RequestFilePak(INT32 node)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
char wad[MAX_WADPATH+1];
UINT8 *p = netbuffer->u.textcmd;
UINT8 id;
while (p < netbuffer->u.textcmd + MAXTEXTCMD) // Don't allow hacked client to overflow
{
id = READUINT8(p);
@@ -817,6 +821,7 @@ void SV_FileSendTicker(void)
size_t size;
filetx_t *f;
INT32 packetsent, ram, i, j;
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
if (!filestosend) // No file to send
return;
@@ -945,6 +950,7 @@ void SV_FileSendTicker(void)
void Got_Filetxpak(void)
{
doomdata_t *netbuffer = DOOMCOM_DATA(doomcom);
INT32 filenum = netbuffer->u.filetxpak.fileid;
fileneeded_t *file = &fileneeded[filenum];
char *filename = file->filename;
-1
View File
@@ -1616,7 +1616,6 @@ actionpointer_t actionpointers[] =
{A_BrakLobShot, "A_BRAKLOBSHOT"},
{A_NapalmScatter, "A_NAPALMSCATTER"},
{A_SpawnFreshCopy, "A_SPAWNFRESHCOPY"},
//{A_InvincSparkleRotate, "A_INVINCSPARKLEROTATE"},
{NULL, "NONE"},
+4
View File
@@ -70,7 +70,11 @@ extern "C" {
#include <string.h>
#define _USE_MATH_DEFINES // fixes M_PI errors in r_plane.c for Visual Studio
#ifdef __cplusplus
#include <cmath>
#else
#include <math.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
+1 -1
View File
@@ -575,7 +575,7 @@ extern consvar_t cv_downloading; // allow clients to downloading WADs.
extern consvar_t cv_nettimeout; // SRB2Kart: Advanced server options menu
extern consvar_t cv_jointimeout;
extern consvar_t cv_maxping;
extern ticcmd_t netcmds[TICQUEUE][MAXPLAYERS];
extern ticcmd_t netcmds[BACKUPTICS][MAXPLAYERS];
extern INT32 serverplayer;
extern INT32 adminplayers[MAXPLAYERS];
+11 -10
View File
@@ -365,8 +365,8 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
char searchpath[1024];
size_t *searchpathindex;
dirhandle = (DIR**) malloc(maxsearchdepth * sizeof (DIR*));
searchpathindex = (size_t *) malloc(maxsearchdepth * sizeof (size_t));
dirhandle = (DIR**) malloc(maxsearchdepth * sizeof(DIR*));
searchpathindex = (size_t *) malloc(maxsearchdepth * sizeof(size_t));
strcpy(searchpath,startpath);
searchpathindex[--depthleft] = strlen(searchpath) + 1;
@@ -410,14 +410,14 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
}
// okay, now we actually want searchpath to incorporate d_name
strcpy(&searchpath[searchpathindex[depthleft]],dent->d_name);
strcpy(&searchpath[searchpathindex[depthleft]], dent->d_name);
#if defined(__linux__) || defined(__FreeBSD__)
if (dent->d_type == DT_UNKNOWN && lstat(searchpath,&fsstat) == 0)
if (dent->d_type == DT_UNKNOWN && lstat(searchpath, &fsstat) == 0)
{
if (S_ISDIR(fsstat.st_mode))
dent->d_type = DT_DIR;
else if (S_ISLNK(fsstat.st_mode))
else if (S_ISLNK(fsstat.st_mode))
dent->d_type = DT_LNK;
}
@@ -439,11 +439,12 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
{
searchpathindex[--depthleft] = strlen(searchpath) + 1;
dirhandle[depthleft] = opendir(searchpath);
if (!dirhandle[depthleft])
{
// can't open it... maybe no read-permissions
// go back to previous dir
depthleft++;
// can't open it... maybe no read-permissions
// go back to previous dir
depthleft++;
}
searchpath[searchpathindex[depthleft]-1] = PATHSEP[0];
@@ -455,9 +456,9 @@ filestatus_t filesearch(char *filename, const char *startpath, const UINT8 *want
{
case FS_FOUND:
if (completepath)
strcpy(filename,searchpath);
strcpy(filename, searchpath);
else
strcpy(filename,dent->d_name);
strcpy(filename, dent->d_name);
retval = FS_FOUND;
found = 1;
break;
+2 -2
View File
@@ -1051,7 +1051,7 @@ void G_ConsGhostTic(INT32 playernum)
mobj = NULL;
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
if (th->function != (actionf_p1)P_MobjThinker)
continue;
mobj = (mobj_t *)th;
if (mobj->type == (mobjtype_t)type && mobj->x == x && mobj->y == y && mobj->z == z)
@@ -3701,7 +3701,7 @@ void G_DoPlayMetal(void)
// find metal sonic
for (th = thinkercap.next; th != &thinkercap; th = th->next)
{
if (th->function.acp1 != (actionf_p1)P_MobjThinker)
if (th->function != (actionf_p1)P_MobjThinker)
continue;
mo = (mobj_t *)th;
+1 -3939
View File
File diff suppressed because it is too large. Load diff
-2
View File
@@ -21,8 +21,6 @@ extern "C" {
#include "hw_data.h"
#include "hw_gl.h"
extern boolean currently_batching;
typedef struct
{
FSurfaceInfo surf;// surf also has its own polyflags for some reason, but it seems unused
+208 -136
View File
@@ -48,14 +48,20 @@ typedef struct
// if no portals are found, the portal scanning phase can be skipped while rendering, saving a bit of time.
boolean gl_maphasportals = false;
// Determine on mapload if current map has any Horizonlines present
// so we can avoid rather hot checks in HWR_Subsector
boolean gl_maphashorizonlines = false;
// ==========================================================================
// FLOOR & CEILING CONVEX POLYS GENERATION
// ==========================================================================
//debug counters
#ifdef DEBUG_HWBSP
static INT32 nobackpoly = 0;
static INT32 skipcut = 0;
static INT32 totalsubsecpolys = 0;
#endif
// --------------------------------------------------------------------------
// Polygon fast alloc / free
@@ -96,8 +102,8 @@ static polyvertex_t *fracdivline(fdivline_t *bsp, polyvertex_t *v1,
double frac;
double num;
double den;
double v1x,v1y,v1dx,v1dy;
double v2x,v2y,v2dx,v2dy;
double v1x, v1y, v1dx, v1dy;
double v2x, v2y, v2dx, v2dy;
// a segment of a polygon
v1x = v1->x;
@@ -112,6 +118,7 @@ static polyvertex_t *fracdivline(fdivline_t *bsp, polyvertex_t *v1,
v2dy = bsp->dy;
den = v2dy*v1dx - v2dx*v1dy;
if (fabsf((float)den) < 1.0E-36f) // avoid checking exactly for 0.0
return NULL; // parallel
@@ -119,6 +126,7 @@ static polyvertex_t *fracdivline(fdivline_t *bsp, polyvertex_t *v1,
// (do not accept hit with the extensions)
num = (v2x - v1x)*v2dy + (v1y - v2y)*v2dx;
frac = num / den;
if (frac < 0.0l || frac > 1.0l)
return NULL;
@@ -128,7 +136,6 @@ static polyvertex_t *fracdivline(fdivline_t *bsp, polyvertex_t *v1,
frac = num / den;
bspfrac = (float)frac;
// find the interception point along the partition line
pt.x = (float)(v2x + v2dx*frac);
pt.y = (float)(v2y + v2dy*frac);
@@ -136,37 +143,18 @@ static polyvertex_t *fracdivline(fdivline_t *bsp, polyvertex_t *v1,
return &pt;
}
#define DIVLINE_VERTEX_DIFF 0.45f
// if two vertice coords have a x and/or y difference
// of less or equal than 1 FRACUNIT, they are considered the same
// point. Note: hardcoded value, 1.0f could be anything else.
static boolean SameVertice (polyvertex_t *p1, polyvertex_t *p2)
{
#if 0
float diff;
diff = p2->x - p1->x;
if (diff < -1.5f || diff > 1.5f)
if (fabsf( p2->x - p1->x ) > DIVLINE_VERTEX_DIFF)
return false;
diff = p2->y - p1->y;
if (diff < -1.5f || diff > 1.5f)
if (fabsf( p2->y - p1->y ) > DIVLINE_VERTEX_DIFF)
return false;
#elif 0
if (p1->x != p2->x)
return false;
if (p1->y != p2->y)
return false;
#elif 0
if (fabsf( p2->x - p1->x ) > 1.0E-36f )
return false;
if (fabsf( p2->y - p1->y ) > 1.0E-36f )
return false;
#else
#define DIVLINE_VERTEX_DIFF 0.45f
static const float ep = DIVLINE_VERTEX_DIFF;
if (fabsf( p2->x - p1->x ) > ep )
return false;
if (fabsf( p2->y - p1->y ) > ep )
return false;
#endif
// p1 and p2 are considered the same vertex
return true;
}
@@ -182,22 +170,23 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
poly_t **frontpoly, //return one poly here
poly_t **backpoly) //return the other here
{
INT32 i,j;
INT32 i, j;
polyvertex_t *pv;
INT32 ps = -1,pe = -1;
INT32 nptfront,nptback;
INT32 ps = -1, pe = -1;
INT32 nptfront, nptback;
polyvertex_t vs = {0,0,0};
polyvertex_t ve = {0,0,0};
polyvertex_t lastpv = {0,0,0};
float fracs = 0.0f,frace = 0.0f; //used to tell which poly is on
// the front side of the bsp partition line
INT32 psonline = 0, peonline = 0;
float fracs = 0.0f, frace = 0.0f; //used to tell which poly is on
// the front side of the bsp partition line
INT32 psonline = 0, peonline = 0;
for (i = 0; i < poly->numpts; i++)
{
j = i + 1;
if (j == poly->numpts) j = 0;
if (j == poly->numpts)
j = 0;
// start & end points
pv = fracdivline(bsp, &poly->pts[i], &poly->pts[j]);
@@ -284,7 +273,7 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
return;
}
if (pe <= ps)
if (UNLIKELY(pe <= ps))
I_Error("SplitPoly: invalid splitting line (%d %d)", ps, pe);
// number of points on each side, _not_ counting those
@@ -296,6 +285,7 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
*backpoly = HWR_AllocPoly(2 + nptback);
else
*backpoly = NULL;
if (nptfront > 0)
*frontpoly = HWR_AllocPoly(2 + nptfront);
else
@@ -308,10 +298,12 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
*pv++ = vs;
*pv++ = ve;
i = pe;
do
{
if (++i == poly->numpts)
i = 0;
*pv++ = poly->pts[i];
} while (i != ps && --nptfront);
}
@@ -323,10 +315,12 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
*pv++ = ve;
*pv++ = vs;
i = ps;
do
{
if (++i == poly->numpts)
i = 0;
*pv++ = poly->pts[i];
} while (i != pe && --nptback);
}
@@ -353,36 +347,48 @@ static void SplitPoly (fdivline_t *bsp, //splitting parametric line
static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
{
INT32 i, j;
polyvertex_t *pv;
INT32 nump = 0, ps, pe;
polyvertex_t vs = {0, 0, 0}, ve = {0, 0, 0},
p1 = {0, 0, 0}, p2 = {0, 0, 0};
p1 = {0, 0, 0}, p2 = {0, 0, 0};
float fracs = 0.0f;
fdivline_t cutseg; // x, y, dx, dy as start of node_t struct
poly_t *temppoly;
// for each seg of the subsector
for (; count--; lseg++)
{
//x,y,dx,dy (like a divline)
// x, y, dx, dy (like a divline)
const line_t *line = lseg->linedef;
// portal check
if (!gl_maphasportals && line->special == PORTALSPECIAL && lseg->side == 0)
if (UNLIKELY(!gl_maphasportals && line->special == PORTALSPECIAL && lseg->side == 0))
{
// Find the other side!
INT32 line2 = P_FindSpecialLineFromTag(PORTALSPECIAL, line->tag, -1);
if (line == &lines[line2])
line2 = P_FindSpecialLineFromTag(PORTALSPECIAL, line->tag, line2);
if (line2 >= 0) // found it!
gl_maphasportals = 1;
}
if (!gl_maphashorizonlines && line->special == HORIZONSPECIAL)
gl_maphashorizonlines = true;
if (line->sidenum[1] != 0xffff)
{
if (sides[line->sidenum[0]].sector == sides[line->sidenum[1]].sector)
{
// Segs that are self-ref linedef do not cutout the subsector.
#ifdef DEBUG_HWBSP
CONS_Debug(DBG_RENDER, "CutOutSubsecPoly: self ref line %i\n", line - lines);
#endif
continue;
}
}
p1.x = FIXED_TO_FLOAT(lseg->side ? line->v2->x : line->v1->x);
p1.y = FIXED_TO_FLOAT(lseg->side ? line->v2->y : line->v1->y);
p2.x = FIXED_TO_FLOAT(lseg->side ? line->v1->x : line->v2->x);
@@ -396,6 +402,7 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
// see if it cuts the convex poly
ps = -1;
pe = -1;
for (i = 0; i < poly->numpts; i++)
{
j = i + 1;
@@ -438,6 +445,7 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
ve = vs;
vs = *pv;
}
//found 2nd point
break;
}
@@ -451,25 +459,32 @@ static poly_t *CutOutSubsecPoly(seg_t *lseg, INT32 count, poly_t *poly)
{
// generate FRONT poly
temppoly = HWR_AllocPoly(nump);
pv = temppoly->pts;
*pv++ = vs;
*pv++ = ve;
do
{
if (++ps == poly->numpts)
ps = 0;
*pv++ = poly->pts[ps];
} while (ps != pe);
HWR_FreePoly(poly);
poly = temppoly;
}
//hmmm... maybe we should NOT accept this, but this happens
#ifdef DEBUG_HWBSP
// hmmm... maybe we should NOT accept this, but this happens
// only when the cut is not needed it seems (when the cut
// line is aligned to one of the borders of the poly, and
// only some times..)
else
{
skipcut++;
// I_Error("CutOutPoly: only one point for split line (%d %d) %d", ps, pe, debugpos);
I_Error("CutOutPoly: only one point for split line (%d %d) %d", ps, pe, debugpos);
}
#endif
}
}
return poly;
@@ -492,8 +507,10 @@ static inline void HWR_SubsecPoly(INT32 num, poly_t *poly)
if (poly)
{
poly = CutOutSubsecPoly (lseg,count,poly);
poly = CutOutSubsecPoly(lseg,count,poly);
#ifdef DEBUG_HWBSP
totalsubsecpolys++;
#endif
//extra data for this subsector
extrasubsectors[num].planepoly = poly;
}
@@ -503,8 +520,8 @@ static inline void HWR_SubsecPoly(INT32 num, poly_t *poly)
// search for the segs source of this divline
static inline void SearchDivline(node_t *bsp, fdivline_t *divline)
{
divline->x = FIXED_TO_FLOAT(bsp->x);
divline->y = FIXED_TO_FLOAT(bsp->y);
divline->x = FIXED_TO_FLOAT(bsp->x);
divline->y = FIXED_TO_FLOAT(bsp->y);
divline->dx = FIXED_TO_FLOAT(bsp->dx);
divline->dy = FIXED_TO_FLOAT(bsp->dy);
}
@@ -562,10 +579,12 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b
if (poly && poly->numpts > 2)
{
CONS_Debug(DBG_RENDER, "Adding a new subsector\n");
if (addsubsector == numsubsectors + NEWSUBSECTORS)
if (UNLIKELY(addsubsector == numsubsectors + NEWSUBSECTORS))
I_Error("WalkBSPNode: not enough addsubsectors\n");
else if (addsubsector > 0x7fff)
else if (UNLIKELY(addsubsector > 0x7fff))
I_Error("WalkBSPNode: addsubsector > 0x7fff\n");
*leafnode = (UINT16)((UINT16)addsubsector | NF_SUBSECTOR);
extrasubsectors[addsubsector].planepoly = poly;
addsubsector++;
@@ -587,6 +606,7 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b
}
#endif
}
M_ClearBox(bbox);
poly = extrasubsectors[bspnum & ~NF_SUBSECTOR].planepoly;
@@ -601,12 +621,14 @@ static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *b
SplitPoly(&fdivline, poly, &frontpoly, &backpoly);
poly = NULL;
#ifdef DEBUG_HWBSP
//debug
if (!backpoly)
nobackpoly++;
#endif
// Recursively divide front space.
if (frontpoly)
if (LIKELY(frontpoly))
{
WalkBSPNode(bsp->children[0], frontpoly, &bsp->children[0],bsp->bbox[0]);
@@ -641,53 +663,79 @@ void HWR_FreeExtraSubsectors(void)
#define MAXDIST 1.5f
// BP: can't move vertex: DON'T change polygon geometry! (convex)
//#define MOVEVERTEX
static boolean PointInSeg(polyvertex_t *a,polyvertex_t *v1,polyvertex_t *v2)
// Is vertex va within the seg v1, v2
static boolean PointInSeg(polyvertex_t *va,polyvertex_t *v1,polyvertex_t *v2)
{
register float ax,ay,bx,by,cx,cy,d,norm;
register polyvertex_t *p;
register float ax, ay, bx, by, cx, cy, d, norm;
// check bbox of the seg first
if (v1->x > v2->x)
// check bbox of the seg first (without altering v1, v2)
if (v2->x > v1->x)
{
p = v1;
v1 = v2;
v2 = p;
// check if x within seg box v1..v2
if ((va->x + MAXDIST) < v1->x) return false;
if ((va->x - MAXDIST) > v2->x) return false;
}
else
{
// check if x within seg box v2..v1
if ((va->x + MAXDIST) < v2->x) return false;
if ((va->x - MAXDIST) > v1->x) return false;
}
if (a->x < v1->x-MAXDIST || a->x > v2->x+MAXDIST)
return false;
if (v1->y > v2->y)
if (v2->y > v1->y)
{
p = v1;
v1 = v2;
v2 = p;
// check if x within seg box v1..v2
if ((va->y + MAXDIST) < v1->y) return false;
if ((va->y - MAXDIST) > v2->y) return false;
}
else
{
// check if x within seg box v2..v1
if ((va->y + MAXDIST) < v2->y) return false;
if ((va->y - MAXDIST) > v1->y) return false;
}
if (a->y < v1->y-MAXDIST || a->y > v2->y+MAXDIST)
return false;
// v1 = origine
ax= v2->x-v1->x;
ay= v2->y-v1->y;
norm = hypotf(ax, ay);
// v1 = origin
ax = v2->x-v1->x;
ay = v2->y-v1->y;
norm = hypotf(ax, ay); // length of seg
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wfloat-equal"
if (norm != 0) // yes, this can be exactly 0
#pragma GCC diagnostic pop
{
ax /= norm;
ay /= norm;
ay /= norm; // unit vector along seg, v1->v2
}
bx = a->x-v1->x;
by = a->y-v1->y;
//d = a.b
d =ax*bx+ay*by;
bx = va->x - v1->x;
by = va->y - v1->y; // vector v1->va
// d = (a DOT b), (product of lengths * cosine( angle ))
d = ax*bx+ay*by;
// bound of the seg
if (d < 0 || d > norm)
{
// Also excludes some va within MAXDIST of v1 or v2
return false;
//c = d.1a-b
}
// Cross product.
if (((by * ax) - (bx * ay)) <= 0)
{
// The vertex is to the rightside of the seg, so adding
// it to the polygon would worsen the crack.
return false;
}
// measure the error in vector bx,by as difference squared sum
//c= (d * unit_vector_seg) - b
cx = ax*d-bx;
cy = ay*d-by;
#ifdef MOVEVERTEX
if (cx*cx+cy*cy <= MAXDIST*MAXDIST)
{
@@ -708,7 +756,7 @@ static INT32 numsplitpoly;
static void SearchSegInBSP(INT32 bspnum,polyvertex_t *p,poly_t *poly)
{
poly_t *q;
INT32 j,k;
INT32 j,k;
if (bspnum & NF_SUBSECTOR)
{
@@ -716,47 +764,55 @@ static void SearchSegInBSP(INT32 bspnum,polyvertex_t *p,poly_t *poly)
{
bspnum &= ~NF_SUBSECTOR;
q = extrasubsectors[bspnum].planepoly;
if (poly == q || !q)
return;
for (j = 0; j < q->numpts; j++)
const INT32 numpts = q->numpts;
for (j = 0; j < numpts; j++)
{
k = j+1;
if (k == q->numpts) k = 0;
if (k == numpts)
k = 0;
if (!SameVertice(p, &q->pts[j])
&& !SameVertice(p, &q->pts[k])
&& PointInSeg(p, &q->pts[j],
&q->pts[k]))
&& PointInSeg(p, &q->pts[j], &q->pts[k]))
{
poly_t *newpoly = HWR_AllocPoly(q->numpts+1);
poly_t *newpoly = HWR_AllocPoly(numpts+1);
INT32 n;
for (n = 0; n <= j; n++)
newpoly->pts[n] = q->pts[n];
newpoly->pts[k] = *p;
for (n = k+1; n < newpoly->numpts; n++)
newpoly->pts[n] = q->pts[n-1];
numsplitpoly++;
extrasubsectors[bspnum].planepoly =
newpoly;
extrasubsectors[bspnum].planepoly = newpoly;
HWR_FreePoly(q);
return;
}
}
}
return;
}
if ((FIXED_TO_FLOAT(nodes[bspnum].bbox[0][BOXBOTTOM])-MAXDIST <= p->y) &&
(FIXED_TO_FLOAT(nodes[bspnum].bbox[0][BOXTOP ])+MAXDIST >= p->y) &&
(FIXED_TO_FLOAT(nodes[bspnum].bbox[0][BOXLEFT ])-MAXDIST <= p->x) &&
(FIXED_TO_FLOAT(nodes[bspnum].bbox[0][BOXRIGHT ])+MAXDIST >= p->x))
SearchSegInBSP(nodes[bspnum].children[0],p,poly);
(FIXED_TO_FLOAT(nodes[bspnum].bbox[0][BOXTOP ])+MAXDIST >= p->y) &&
(FIXED_TO_FLOAT(nodes[bspnum].bbox[0][BOXLEFT ])-MAXDIST <= p->x) &&
(FIXED_TO_FLOAT(nodes[bspnum].bbox[0][BOXRIGHT ])+MAXDIST >= p->x))
SearchSegInBSP(nodes[bspnum].children[0], p, poly);
if ((FIXED_TO_FLOAT(nodes[bspnum].bbox[1][BOXBOTTOM])-MAXDIST <= p->y) &&
(FIXED_TO_FLOAT(nodes[bspnum].bbox[1][BOXTOP ])+MAXDIST >= p->y) &&
(FIXED_TO_FLOAT(nodes[bspnum].bbox[1][BOXLEFT ])-MAXDIST <= p->x) &&
(FIXED_TO_FLOAT(nodes[bspnum].bbox[1][BOXRIGHT ])+MAXDIST >= p->x))
SearchSegInBSP(nodes[bspnum].children[1],p,poly);
(FIXED_TO_FLOAT(nodes[bspnum].bbox[1][BOXTOP ])+MAXDIST >= p->y) &&
(FIXED_TO_FLOAT(nodes[bspnum].bbox[1][BOXLEFT ])-MAXDIST <= p->x) &&
(FIXED_TO_FLOAT(nodes[bspnum].bbox[1][BOXRIGHT ])+MAXDIST >= p->x))
SearchSegInBSP(nodes[bspnum].children[1], p, poly);
}
// search for T-intersection problem
@@ -780,13 +836,18 @@ static INT32 SolveTProblem(void)
for (l = 0; l < addsubsector; l++)
{
p = extrasubsectors[l].planepoly;
if (!p)
continue;
for (i = 0; i < p->numpts; i++)
SearchSegInBSP((INT32)numnodes-1, &p->pts[i], p);
}
//CONS_Debug(DBG_RENDER, "numsplitpoly %d\n", numsplitpoly);
#ifdef DEBUG_HWBSP
CONS_Debug(DBG_RENDER, "numsplitpoly %d\n", numsplitpoly);
#endif
return numsplitpoly;
}
@@ -826,29 +887,31 @@ static void AdjustSegs(void)
if (lseg->polyseg)
continue;
if (p) {
for (j = 0; j < p->numpts; j++)
for (j = 0; j < p->numpts; j++)
{
distv1 = p->pts[j].x - FIXED_TO_FLOAT(lseg->v1->x);
tmp = p->pts[j].y - FIXED_TO_FLOAT(lseg->v1->y);
distv1 = distv1*distv1+tmp*tmp;
if (distv1 <= nearv1)
{
distv1 = p->pts[j].x - FIXED_TO_FLOAT(lseg->v1->x);
tmp = p->pts[j].y - FIXED_TO_FLOAT(lseg->v1->y);
distv1 = distv1*distv1+tmp*tmp;
if (distv1 <= nearv1)
{
v1found = j;
nearv1 = distv1;
}
// the same with v2
distv2 = p->pts[j].x - FIXED_TO_FLOAT(lseg->v2->x);
tmp = p->pts[j].y - FIXED_TO_FLOAT(lseg->v2->y);
distv2 = distv2*distv2+tmp*tmp;
if (distv2 <= nearv2)
{
v2found = j;
nearv2 = distv2;
}
v1found = j;
nearv1 = distv1;
}
// the same with v2
distv2 = p->pts[j].x - FIXED_TO_FLOAT(lseg->v2->x);
tmp = p->pts[j].y - FIXED_TO_FLOAT(lseg->v2->y);
distv2 = distv2*distv2+tmp*tmp;
if (distv2 <= nearv2)
{
v2found = j;
nearv2 = distv2;
}
}
if (p && nearv1 <= NEARDIST*NEARDIST)
if (nearv1 <= NEARDIST*NEARDIST)
// share vertice with segs
lseg->pv1 = &(p->pts[v1found]);
else
@@ -863,7 +926,8 @@ static void AdjustSegs(void)
pv->y = FIXED_TO_FLOAT(lseg->v1->y);
lseg->pv1 = pv;
}
if (p && nearv2 <= NEARDIST*NEARDIST)
if (nearv2 <= NEARDIST*NEARDIST)
lseg->pv2 = &(p->pts[v2found]);
else
{
@@ -876,11 +940,15 @@ static void AdjustSegs(void)
// recompute length
{
float x,y;
x = ((polyvertex_t *)lseg->pv2)->x - ((polyvertex_t *)lseg->pv1)->x
+ FIXED_TO_FLOAT(FRACUNIT/2);
y = ((polyvertex_t *)lseg->pv2)->y - ((polyvertex_t *)lseg->pv1)->y
+ FIXED_TO_FLOAT(FRACUNIT/2);
lseg->flength = (float)hypot(x, y);
const polyvertex_t *pv1 = (polyvertex_t *)lseg->pv1;
const polyvertex_t *pv2 = (polyvertex_t *)lseg->pv2;
x = pv2->x - pv1->x + 0.5f;
y = pv2->y - pv1->y + 0.5f;
lseg->flength = hypotf(x, y);
// BP: debug see this kind of segs
//if (nearv2 > NEARDIST*NEARDIST || nearv1 > NEARDIST*NEARDIST)
// lseg->length = 1;
@@ -906,29 +974,29 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
I_FinishUpdate(); // page flip or blit buffer
#endif
// reset the portal flag
gl_maphasportals = 0;
// reset the portal and horizonline flag
gl_maphasportals = gl_maphashorizonlines = 0;
// find min/max boundaries of map
//CONS_Debug(DBG_RENDER, "Looking for boundaries of map...\n");
#ifdef DEBUG_HWBSP
CONS_Debug(DBG_RENDER, "Looking for boundaries of map...\n");
#endif
M_ClearBox(rootbbox);
for (i = 0;i < numvertexes; i++)
M_AddToBox(rootbbox, vertexes[i].x, vertexes[i].y);
//CONS_Debug(DBG_RENDER, "Generating subsector polygons... %d subsectors\n", numsubsectors);
#ifdef DEBUG_HWBSP
CONS_Debug(DBG_RENDER, "Generating subsector polygons... %d subsectors\n", numsubsectors);
#endif
HWR_FreeExtraSubsectors();
// allocate extra data for each subsector present in map
totsubsectors = numsubsectors + NEWSUBSECTORS;
extrasubsectors = calloc(totsubsectors, sizeof (*extrasubsectors));
if (extrasubsectors == NULL)
if (UNLIKELY(extrasubsectors == NULL))
I_Error("couldn't malloc extrasubsectors totsubsectors %s\n", sizeu1(totsubsectors));
// allocate table for back to front drawing of subsectors
/*gl_drawsubsectors = (INT16 *)malloc(sizeof (*gl_drawsubsectors) * totsubsectors);
if (!gl_drawsubsectors)
I_Error("couldn't malloc gl_drawsubsectors\n");*/
// number of the first new subsector that might be added
addsubsector = numsubsectors;
@@ -952,17 +1020,21 @@ void HWR_CreatePlanePolygons(INT32 bspnum)
WalkBSPNode(bspnum, rootp, NULL,rootbbox);
i = SolveTProblem();
//CONS_Debug(DBG_RENDER, "%d point divides a polygon line\n",i);
#ifdef DEBUG_HWBSP
CONS_Debug(DBG_RENDER, "%d point divides a polygon line\n",i);
#endif
AdjustSegs();
#ifdef DEBUG_HWBSP
//debug debug..
//if (nobackpoly)
// CONS_Debug(DBG_RENDER, "no back polygon %u times\n",nobackpoly);
if (nobackpoly)
CONS_Debug(DBG_RENDER, "no back polygon %u times\n",nobackpoly);
//"(should happen only with the deep water trick)"
//if (skipcut)
// CONS_Debug(DBG_RENDER, "%u cuts were skipped because of only one point\n",skipcut);
if (skipcut)
CONS_Debug(DBG_RENDER, "%u cuts were skipped because of only one point\n",skipcut);
//CONS_Debug(DBG_RENDER, "done: %u total subsector convex polygons\n", totalsubsecpolys);
CONS_Debug(DBG_RENDER, "done: %u total subsector convex polygons\n", totalsubsecpolys);
#endif
}
#endif //HWRENDER
-6
View File
@@ -38,12 +38,6 @@ INT32 textureformat = GL_TEXFMT_P_8; // use chromakey for hole
RGBA_t mapPalette[256] = {0}; // the palette for the currently loaded level or menu etc.
// Returns a pointer to the palette which should be used for caching textures.
RGBA_t *HWR_GetTexturePalette(void)
{
return HWR_ShouldUsePaletteRendering() ? mapPalette : pLocalPalette;
}
static INT32 format2bpp(GLTextureFormat_t format)
{
switch (format)
+18 -6
View File
@@ -610,7 +610,7 @@ void HWR_FadeScreenMenuBack(UINT16 color, UINT8 strength)
}
else // Do TRANSMAP** fade.
{
RGBA_t *palette = HWR_GetTexturePalette();
const RGBA_t *palette = HWR_GetTexturePalette();
Surf.PolyColor.rgba = palette[color&0xFF].rgba;
if (HWR_ShouldUsePaletteRendering())
@@ -794,7 +794,7 @@ void HWR_drawAMline(const fline_t *fl, INT32 color)
{
F2DCoord v1, v2;
RGBA_t color_rgba;
RGBA_t *palette = HWR_GetTexturePalette();
const RGBA_t *palette = HWR_GetTexturePalette();
color_rgba = palette[color&0xFF];
@@ -815,7 +815,7 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
FOutVector v[4];
FSurfaceInfo Surf;
float fx, fy, fw, fh, fwait = 0;
RGBA_t *palette = HWR_GetTexturePalette();
RGBA_t *palette;
if (wh < 0)
return; // consistency w/ software
@@ -860,11 +860,13 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
if (fx >= vid.width || fy >= vid.height)
return;
if (fx < 0)
{
fw += fx;
fx = 0;
}
if (fy < 0)
{
fh += fy;
@@ -873,11 +875,13 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
if (fw <= 0 || fh <= 0)
return;
if (fx + fw > vid.width)
{
fwait = fw - (fvw- fx);
fw = fvw - fx;
}
if (fy + fh > vid.height)
fh = fvh - fy;
@@ -899,6 +903,8 @@ void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color)
v[0].t = v[1].t = 0.0f;
v[2].t = v[3].t = 1.0f;
palette = HWR_GetTexturePalette();
Surf.PolyColor = palette[color&0xFF];
GL_DrawPolygon(&Surf, v, 4,
@@ -913,7 +919,6 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
FOutVector v[4];
FSurfaceInfo Surf;
float fx, fy, fw, fh;
RGBA_t *palette = HWR_GetTexturePalette();
if (w < 0 || h < 0)
return; // consistency w/ software
@@ -937,6 +942,7 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
if (x == 0 && y == 0 && w == BASEVIDWIDTH && h == BASEVIDHEIGHT)
{
RGBA_t *palette = HWR_GetTexturePalette();
RGBA_t rgbaColour = palette[color&0xFF];
FRGBAFloat clearColour;
clearColour.red = (float)rgbaColour.s.red / 255;
@@ -967,6 +973,7 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
else if (!(options & V_SNAPTOTOP))
fy += (fvh - (FLOATBASEVIDHEIGHT * dupy)) / 2;
}
if (options & V_SPLITSCREEN)
fy += (FLOATBASEVIDHEIGHT * dupy)/2;
if (options & V_HORZSCREEN)
@@ -976,11 +983,13 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
if (fx >= vid.width || fy >= vid.height)
return;
if (fx < 0)
{
fw += fx;
fx = 0;
}
if (fy < 0)
{
fh += fy;
@@ -989,8 +998,10 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
if (fw <= 0 || fh <= 0)
return;
if (fx + fw > vid.width)
fw = fvw - fx;
if (fy + fh > vid.height)
fh = fvh - fy;
@@ -1026,12 +1037,13 @@ void HWR_DrawFill(INT32 x, INT32 y, INT32 w, INT32 h, INT32 color)
FOutVector v[4];
FSurfaceInfo Surf;
float fx, fy, fw, fh;
UINT8 alphalevel = ((color & V_ALPHAMASK) >> V_ALPHASHIFT);
RGBA_t *palette = HWR_GetTexturePalette();
if (w < 0 || h < 0)
return; // consistency w/ software
const UINT8 alphalevel = ((color & V_ALPHAMASK) >> V_ALPHASHIFT);
const RGBA_t *palette = HWR_GetTexturePalette();
// 3--2
// | /|
// |/ |
+3 -1
View File
@@ -60,6 +60,9 @@ void HWR_FreeExtraSubsectors(void);
// --------
// hw_cache.c
// --------
extern RGBA_t mapPalette[256];
void HWR_InitMapTextures(void);
void HWR_LoadMapTextures(size_t pnumtextures);
void HWR_FreeMapTextures(void);
@@ -85,7 +88,6 @@ void HWR_ClearAllTextures(void);
void HWR_FreeColormapCache(void);
void HWR_UnlockCachedPatch(GLPatch_t *gpatch);
RGBA_t *HWR_GetTexturePalette(void);
void HWR_SetPalette(RGBA_t *palette);
void HWR_SetMapPalette(void);
UINT32 HWR_CreateLightTable(UINT8 *lighttable);
+60 -77
View File
@@ -14,8 +14,6 @@
#ifdef HWRENDER
#include <algorithm>
#define _USE_MATH_DEFINES
#include <cmath>
#include "../doomstat.h"
#include "../doomdef.h"
@@ -99,8 +97,6 @@ line_t *gl_linedef;
sector_t *gl_frontsector;
sector_t *gl_backsector;
static boolean gl_maphashorizonlines = false;
// values for the far clipping plane
static constexpr float clipping_distances[] = {1024.0f, 2048.0f, 4096.0f, 6144.0f, 8192.0f, 12288.0f, 16384.0f};
// values for bsp culling
@@ -132,7 +128,17 @@ static void HWR_AddTransparentFloor(lumpnum_t lumpnum, extrasubsector_t *xsub, b
static void HWR_AddTransparentWall(FOutVector *wallVerts, FSurfaceInfo *pSurf, INT32 texnum, boolean noencore, FBITFIELD blend, boolean fogwall, INT32 lightlevel, extracolormap_t *wallcolormap);
static void HWR_AddTransparentPolyobjectFloor(lumpnum_t lumpnum, polyobj_t *polysector, boolean isceiling, fixed_t fixedheight, INT32 lightlevel, INT32 alpha, sector_t *FOFSector, FBITFIELD blend, extracolormap_t *planecolormap);
static void HWR_AddSprites(sector_t *sec);
namespace
{
enum class AddSpritesType
{
kNoLimitDist,
kLimitDist,
};
template<AddSpritesType> static void HWR_AddSprites(sector_t *);
}
static void HWR_ProjectSprite(mobj_t *thing);
static void HWR_AddPrecipitationSprites(void);
static void HWR_ProjectPrecipitationSprite(precipmobj_t *thing);
@@ -174,7 +180,6 @@ static void CV_glpalettedepth_OnChange(void);
static CV_PossibleValue_t glscreentextures_cons_t[] = {{0, "Off"}, {1, "Wipes Only"}, {2, "All"}, {0, NULL}};
static CV_PossibleValue_t glfakecontrast_cons_t[] = {{0, "Off"}, {1, "Standard"}, {2, "Smooth"}, {0, NULL}};
static CV_PossibleValue_t glshaders_cons_t[] = {{0, "Off"}, {1, "On"}, {2, "Ignore custom shaders"}, {0, NULL}};
static CV_PossibleValue_t secbright_cons_t[] = {{0, "MIN"}, {255, "MAX"}, {0, NULL}};
static CV_PossibleValue_t glfiltermode_cons_t[]= {{HWD_SET_TEXTUREFILTER_POINTSAMPLED, "Nearest"},
{HWD_SET_TEXTUREFILTER_BILINEAR, "Bilinear"}, {HWD_SET_TEXTUREFILTER_TRILINEAR, "Trilinear"},
@@ -219,7 +224,6 @@ consvar_t cv_glslopecontrast = {"gr_slopecontrast", "Off", CV_SAVE, CV_OnOff, NU
consvar_t cv_glshaders = {"gr_shaders", "On", CV_CALL|CV_SAVE, glshaders_cons_t, CV_glshaders_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_gllightdither = {"gr_lightdithering", "Off", CV_CALL|CV_SAVE, CV_OnOff, CV_gllightdithering_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_glsecbright = {"secbright", "0", CV_SAVE, secbright_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_glfiltermode = {"gr_filtermode", "Nearest", CV_CALL|CV_SAVE, glfiltermode_cons_t, CV_filtermode_OnChange, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_glanisotropicmode = {"gr_anisotropicmode", "1", CV_CALL|CV_SAVE, glanisotropicmode_cons_t, CV_anisotropic_OnChange, 0, NULL, NULL, 0, 0, NULL};
@@ -409,6 +413,9 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col
tint_color.rgba = (colormap != NULL) ? (UINT32)colormap->rgba : GL_DEFAULTMIX;
fade_color.rgba = (colormap != NULL) ? (UINT32)colormap->fadergba : GL_DEFAULTFOG;
// Clamp the light level, since it can sometimes go out of the 0-255 range from animations
light_level = CLAMP(SOFTLIGHT(light_level), cv_secbright.value, 255);
// Crappy backup coloring if you can't do shaders
if (!HWR_UseShader())
{
@@ -446,9 +453,6 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col
poly_color.s.blue = (UINT8)blue;
}
// Clamp the light level, since it can sometimes go out of the 0-255 range from animations
light_level = CLAMP(SOFTLIGHT(light_level), cv_glsecbright.value, 255);
// in palette rendering mode, this is not needed since it properly takes the changes to the palette itself
if (!HWR_ShouldUsePaletteRendering())
{
@@ -704,7 +708,8 @@ static void HWR_RenderPlane(subsector_t *subsector, extrasubsector_t *xsub, bool
for (i = 0, v3d = planeVerts; i < (INT32)nrPlaneVerts; i++,v3d++,pv++)
SETUP3DVERT(v3d, pv->x, pv->y);
lightlevel = HWR_CalcSlopeLight(lightlevel, slope, gl_frontsector, (FOFsector != NULL));
if (slope)
lightlevel = HWR_CalcSlopeLight(lightlevel, slope, gl_frontsector, (FOFsector != NULL));
HWR_Lighting(&Surf, lightlevel, planecolormap, P_SectorUsesDirectionalLighting(gl_frontsector));
@@ -3026,7 +3031,7 @@ static void HWR_Subsector(size_t num)
// rendering heights for bottom and top planes
// yes there were functions for this stuff, no idea why it wasnt used but bleh
bottomCullHeight = P_GetFFloorBottomZAt(rover, viewx, viewy);
topCullHeight = P_GetFFloorTopZAt(rover, viewx, viewy);
topCullHeight = P_GetFFloorTopZAt(rover, viewx, viewy);
if (gl_frontsector->cullheight)
{
@@ -3166,7 +3171,10 @@ doaddline:
{
// draw sprites first, coz they are clipped to the solidsegs of
// subsectors more 'in front'
HWR_AddSprites(gl_frontsector);
if (cv_drawdist.value || current_bsp_culling_distance)
HWR_AddSprites<AddSpritesType::kLimitDist>(gl_frontsector);
else
HWR_AddSprites<AddSpritesType::kNoLimitDist>(gl_frontsector);
//Hurdler: at this point validcount must be the same, but is not because
// gl_frontsector doesn't point anymore to sub->sector due to
@@ -3522,7 +3530,7 @@ static void HWR_DrawSpriteShadow(gl_vissprite_t *spr, patch_t *gpatch, GLPatch_t
// This is expecting a pointer to an array containing 4 wallVerts for a sprite
static void HWR_RotateSpritePolyToAim(gl_vissprite_t *spr, FOutVector *wallVerts, const boolean precip, const boolean papersprite)
{
if (!cv_glspritebillboarding.value || !spr || !spr->mobj || !wallVerts || papersprite)
if (!cv_glspritebillboarding.value || papersprite)
{
return;
}
@@ -3762,7 +3770,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
continue;
if (!lightset)
lightlevel = static_cast<INT32>(CLAMP(*list[i-1].lightlevel, 0, 255));
lightlevel = static_cast<INT32>(*list[i-1].lightlevel);
colormap = list[i-1].extra_colormap;
break;
@@ -3781,7 +3789,7 @@ static void HWR_SplitSprite(gl_vissprite_t *spr, const boolean papersprite)
{
if (!lightset)
{
lightlevel = static_cast<INT32>(CLAMP(*list[i].lightlevel, 0, 255));
lightlevel = static_cast<INT32>(*list[i].lightlevel);
HWR_ObjectLightLevelPost(spr, sector, &lightlevel, false);
}
@@ -3988,7 +3996,7 @@ static void HWR_DrawSprite(gl_vissprite_t *spr)
if (!lightset)
{
lightlevel = static_cast<INT32>(CLAMP(sector->lightlevel, 0, 255));
lightlevel = static_cast<INT32>(sector->lightlevel);
HWR_ObjectLightLevelPost(spr, sector, &lightlevel, false);
}
@@ -4089,7 +4097,7 @@ static void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
// colormap test
sector_t *sector = sprmo->subsector->sector;
UINT8 lightlevel = 255;
INT32 lightlevel = 255;
extracolormap_t *colormap = sector->extra_colormap;
if (sector->numlights)
@@ -4099,7 +4107,7 @@ static void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
light = R_GetPlaneLight(sector, sprmo->z + sprmo->height, false); // Always use the light at the top instead of whatever I was doing before
if (!(sprmo->frame & FF_FULLBRIGHT))
lightlevel = static_cast<UINT8>(CLAMP(*sector->lightlist[light].lightlevel, 0, 255));
lightlevel = static_cast<INT32>(*sector->lightlist[light].lightlevel);
if (sector->lightlist[light].extra_colormap)
colormap = sector->lightlist[light].extra_colormap;
@@ -4107,7 +4115,7 @@ static void HWR_DrawPrecipitationSprite(gl_vissprite_t *spr)
else
{
if (!(sprmo->frame & FF_FULLBRIGHT))
lightlevel = static_cast<UINT8>(CLAMP(sector->lightlevel, 0, 255));
lightlevel = static_cast<INT32>(sector->lightlevel);
if (sector->extra_colormap)
colormap = sector->extra_colormap;
@@ -4528,6 +4536,10 @@ static void HWR_DrawSprites(void)
// HWR_AddSprites
// During BSP traversal, this adds sprites by sector.
// --------------------------------------------------------------------------
namespace
{
template <AddSpritesType Type>
static void HWR_AddSprites(sector_t *sec)
{
mobj_t *thing;
@@ -4543,22 +4555,29 @@ static void HWR_AddSprites(sector_t *sec)
// Well, now it will be done.
sec->validcount = validcount;
limit_dist = cv_drawdist.value;
if (current_bsp_culling_distance)
if constexpr (Type == AddSpritesType::kLimitDist)
{
// Use the smaller setting
if (limit_dist)
limit_dist = std::min(current_bsp_culling_distance/mapobjectscale, limit_dist);
else
limit_dist = current_bsp_culling_distance/mapobjectscale;
limit_dist = cv_drawdist.value;
if (current_bsp_culling_distance)
{
// Use the smaller setting
if (limit_dist)
limit_dist = std::min(current_bsp_culling_distance/mapobjectscale, limit_dist);
else
limit_dist = current_bsp_culling_distance/mapobjectscale;
}
}
// Handle all things in sector.
for (thing = sec->thinglist; thing; thing = thing->snext)
{
if (!R_ThingWithinDist(thing, limit_dist))
continue;
// reduce branching in this rather tight loop
if constexpr (Type == AddSpritesType::kLimitDist)
{
if (!R_ThingWithinDist(thing, limit_dist))
continue;
}
if (!R_ThingVisible(thing))
continue;
@@ -4566,6 +4585,7 @@ static void HWR_AddSprites(sector_t *sec)
HWR_ProjectSprite(thing);
}
}
}
// --------------------------------------------------------------------------
// HWR_AddPrecipitationSprites
@@ -4949,24 +4969,24 @@ static void HWR_ProjectSprite(mobj_t *thing)
vis->mobj = thing;
//Hurdler: 25/04/2000: now support colormap in hardware mode
if ((vis->mobj->flags & MF_BOSS) && (vis->mobj->flags2 & MF2_FRET) && (leveltime & 1)) // Bosses "flash"
if (UNLIKELY((vis->mobj->flags & MF_BOSS) && (vis->mobj->flags2 & MF2_FRET) && (leveltime & 1))) // Bosses "flash"
{
if (vis->mobj->type == MT_CYBRAKDEMON)
vis->colormap = static_cast<UINT8*>(R_GetTranslationColormap(TC_ALLWHITE, SKINCOLOR_NONE, GTC_CACHE));
vis->colormap = R_GetTranslationColormap(TC_ALLWHITE, SKINCOLOR_NONE, GTC_CACHE);
else if (vis->mobj->type == MT_METALSONIC_BATTLE)
vis->colormap = static_cast<UINT8*>(R_GetTranslationColormap(TC_METALSONIC, SKINCOLOR_NONE, GTC_CACHE));
vis->colormap = R_GetTranslationColormap(TC_METALSONIC, SKINCOLOR_NONE, GTC_CACHE);
else
vis->colormap = static_cast<UINT8*>(R_GetTranslationColormap(TC_BOSS, SKINCOLOR_NONE, GTC_CACHE));
vis->colormap = R_GetTranslationColormap(TC_BOSS, SKINCOLOR_NONE, GTC_CACHE);
}
else if (thing->color)
{
// New colormap stuff for skins Tails 06-07-2002
if (thing->colorized)
vis->colormap = static_cast<UINT8*>(R_GetTranslationColormap(TC_RAINBOW, static_cast<skincolors_t>(thing->color), GTC_CACHE));
vis->colormap = R_GetTranslationColormap(TC_RAINBOW, static_cast<skincolors_t>(thing->color), GTC_CACHE);
else if (thing->skin && thing->sprite == SPR_PLAY) // This thing is a player!
vis->colormap = static_cast<UINT8*>(R_GetLocalTranslationColormap(static_cast<skin_t*>(thing->skin), static_cast<skin_t*>(thing->localskin), static_cast<skincolors_t>(thing->color), GTC_CACHE, thing->skinlocal));
vis->colormap = R_GetLocalTranslationColormap(static_cast<skin_t*>(thing->skin), static_cast<skin_t*>(thing->localskin), static_cast<skincolors_t>(thing->color), GTC_CACHE, thing->skinlocal);
else
vis->colormap = static_cast<UINT8*>(R_GetTranslationColormap(TC_DEFAULT, static_cast<skincolors_t>(thing->color), GTC_CACHE));
vis->colormap = R_GetTranslationColormap(TC_DEFAULT, static_cast<skincolors_t>(thing->color), GTC_CACHE);
}
else
{
@@ -5725,42 +5745,7 @@ void HWR_RenderPlayerView(void)
HWR_RenderFrame(player, false);
}
// Determine on mapload if current map has any Horizonlines present
// so we can avoid rather hot checks in HWR_Subsector
static void HWR_CheckForHorizonLines(void)
{
size_t i;
INT32 h;
gl_maphashorizonlines = false;
if (!cv_glhorizonlines.value)
return;
for (i = 0; i < numsubsectors; i++)
{
subsector_t *subsec = &subsectors[i];
// sector checked already?
if (subsec->validcount == validcount)
continue;
subsec->validcount = validcount;
seg_t *line = &segs[subsec->firstline];
for (h = 0; h < subsec->numlines; h++, line++)
{
if (line->linedef->special != HORIZONSPECIAL)
continue;
gl_maphashorizonlines = true;
break;
}
}
}
void HWR_LoadLevel(boolean reloadinggamestate)
void HWR_LoadLevel(void)
{
HWR_CreatePlanePolygons((INT32)numnodes - 1);
@@ -5768,9 +5753,6 @@ void HWR_LoadLevel(boolean reloadinggamestate)
HWR_ClearSkyDome();
HWR_BuildSkyDome();
if (!reloadinggamestate)
HWR_CheckForHorizonLines();
if (HWR_ShouldUsePaletteRendering())
HWR_SetMapPalette();
}
@@ -5844,7 +5826,6 @@ void HWR_AddCommands(void)
CV_RegisterVar(&cv_glshaders);
CV_RegisterVar(&cv_gllightdither);
CV_RegisterVar(&cv_glsecbright);
CV_RegisterVar(&cv_glfiltermode);
CV_RegisterVar(&cv_glanisotropicmode);
@@ -6040,6 +6021,8 @@ static void HWR_DoPostProcessor(player_t *player)
Surf.PolyColor.s.alpha = 0xc0; // match software mode
V_CubeApply(&Surf.PolyColor.s.red, &Surf.PolyColor.s.green, &Surf.PolyColor.s.blue);
GL_DrawPolygon(&Surf, v, 4, PF_Modulated|PF_Translucent|PF_NoTexture|PF_NoDepthTest);
}
+7 -1
View File
@@ -175,6 +175,7 @@ void HWR_ProcessSeg(void); // Sort of like GLWall::Process in GZDoom
// hw_bsp.c
void HWR_CreatePlanePolygons(INT32 bspnum);
extern boolean gl_maphasportals;
extern boolean gl_maphashorizonlines;
// Console variables
extern CV_PossibleValue_t glanisotropicmode_cons_t[];
@@ -198,7 +199,6 @@ extern consvar_t cv_glslopecontrast;
extern consvar_t cv_glshaders;
extern consvar_t cv_gllightdither;
extern consvar_t cv_glsecbright;
extern consvar_t cv_glfiltermode;
extern consvar_t cv_glanisotropicmode;
@@ -233,6 +233,12 @@ FUNCINLINE static ATTRINLINE boolean HWR_PalRenderFlashpal(void)
return (cv_glflashpal.value && HWR_ShouldUsePaletteRendering());
}
// Returns a pointer to the palette which should be used for caching textures.
FUNCINLINE static ATTRINLINE RGBA_t *HWR_GetTexturePalette(void)
{
return HWR_ShouldUsePaletteRendering() ? mapPalette : pLocalPalette;
}
#ifdef __cplusplus
}// extern "C"
#endif
+7 -6
View File
@@ -695,6 +695,7 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
UINT16 w = gpatch->width, h = gpatch->height;
UINT32 size = w*h;
RGBA_t *image, *blendimage, *cur, blendcolor;
RGBA_t *palette = HWR_GetTexturePalette();
UINT8 translation[17]; // First the color index
UINT8 cutoff[17]; // Brightness cutoff before using the next color
UINT8 translen = 0;
@@ -702,7 +703,7 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
UINT8 colorbrightnesses[17];
UINT8 color_match_lookup[256]; // optimization attempt
blendcolor = V_GetColor(0); // initialize
blendcolor = palette[0]; // initialize
memset(translation, 0, sizeof(translation));
memset(cutoff, 0, sizeof(cutoff));
@@ -781,7 +782,7 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
for (i = 0; i < translen; i++) // moved from inside the loop to here
{
RGBA_t tempc = V_GetColor(translation[i]);
RGBA_t tempc = palette[translation[i]];
SETBRIGHTNESS(colorbrightnesses[i], tempc.s.red, tempc.s.green, tempc.s.blue); // store brightnesses for comparison
}
// generate lookup table for color brightness matching
@@ -958,11 +959,11 @@ static void HWR_CreateBlendedTexture(patch_t *gpatch, patch_t *blendgpatch, GLMi
mul = cutoff[firsti] - brightness;
}
blendcolor = V_GetColor(translation[firsti]);
blendcolor = palette[translation[firsti]];
if (mul > 0) // If it's 0, then we only need the first color.
{
nextcolor = V_GetColor(translation[secondi]);
nextcolor = palette[translation[secondi]];
// Find difference between points
r = (INT32)(nextcolor.s.red - blendcolor.s.red);
@@ -1150,7 +1151,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
light = R_GetPlaneLight(sector, spr->mobj->z + spr->mobj->height, false); // Always use the light at the top instead of whatever I was doing before
if (!(spr->mobj->frame & FF_FULLBRIGHT))
lightlevel = *sector->lightlist[light].lightlevel > 255 ? 255 : *sector->lightlist[light].lightlevel;
lightlevel = *sector->lightlist[light].lightlevel;
if (sector->lightlist[light].extra_colormap)
colormap = sector->lightlist[light].extra_colormap;
@@ -1158,7 +1159,7 @@ void HWR_DrawMD2(gl_vissprite_t *spr)
else
{
if (!(spr->mobj->frame & FF_FULLBRIGHT))
lightlevel = sector->lightlevel > 255 ? 255 : sector->lightlevel;
lightlevel = sector->lightlevel;
if (sector->extra_colormap)
colormap = sector->extra_colormap;
+1 -2
View File
@@ -2031,8 +2031,7 @@ void GL_SetTexture(GLMipmap_t *pTexInfo)
{
if (pTexInfo->downloaded != tex_downloaded)
{
if (!currently_batching)
pglBindTexture(GL_TEXTURE_2D, pTexInfo->downloaded);
pglBindTexture(GL_TEXTURE_2D, pTexInfo->downloaded);
tex_downloaded = pTexInfo->downloaded;
}
}
+15 -3
View File
@@ -110,13 +110,21 @@ HMS_on_read (char *s, size_t _1, size_t n, void *userdata)
buffer = userdata;
if (n >= (size_t)( buffer->end - buffer->needle ))
while (n >= (size_t)( buffer->end - buffer->needle ))
{
/* resize to next multiple of buffer size */
blocks = ( n / DEFAULT_BUFFER_SIZE + 1 );
buffer->end += ( blocks * DEFAULT_BUFFER_SIZE );
buffer->buffer = realloc(buffer->buffer, buffer->end);
void *tmp = realloc(buffer->buffer, buffer->end);
if (tmp == NULL)
{
// not enough memory to read it, bail
free(buffer->buffer);
buffer->buffer = NULL;
return 0;
}
buffer->buffer = tmp;
}
memcpy(&buffer->buffer[buffer->needle], s, n);
@@ -220,7 +228,11 @@ HMS_connect (const char *format, ...)
curl_easy_setopt(curl, CURLOPT_URL, url);
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, (long)CURL_IPRESOLVE_V4);
#ifdef HAVE_IPV6
if (!M_CheckParm("-ipv6"))
#endif
curl_easy_setopt(curl, CURLOPT_IPRESOLVE, (long)CURL_IPRESOLVE_V4);
curl_easy_setopt(curl, CURLOPT_TIMEOUT, (long)cv_masterserver_timeout.value);
curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, HMS_on_read);
+100 -16
View File
@@ -17,6 +17,7 @@
#include "m_menu.h" // gametype_cons_t
#include "m_cond.h" // emblems
#include "m_emotes.h"
#include "d_clisrv.h"
@@ -94,6 +95,9 @@ static textinput_t w_chat;
static boolean headsupactive = false;
boolean hu_showscores; // draw rankings
static char hu_tick;
static tic_t hu_emoteanim = 0;
#define MAXEMOTESUGGESTIONS 8
static emote_t *emote_suggestions[MAXEMOTESUGGESTIONS] = {0};
static huddrawlist_h luahuddrawlist_scores;
@@ -1106,6 +1110,7 @@ void HU_Ticker(void)
return;
hu_tick++;
hu_emoteanim++;
hu_tick &= 7; // currently only to blink chat input cursor
if (PLAYER1INPUTDOWN(gc_scores))
@@ -1399,7 +1404,7 @@ boolean HU_Responder(event_t *ev)
&& ev->data1 != gamecontrol[0][gc_talkkey][1]))
return false;
M_TextInputHandle(&w_chat, c);
M_TextInputHandleEmotes(&w_chat, c, emote_suggestions, MAXEMOTESUGGESTIONS);
if (c == KEY_ENTER)
{
@@ -1439,6 +1444,8 @@ boolean HU_Responder(event_t *ev)
#ifndef NONET
#define HU_DrawEmote(x, y, emote, flags) M_DrawEmote((x), (y), (emote), hu_emoteanim, (flags))
// Precompile a wordwrapped string to any given width.
// This is a muuuch better method than V_WORDWRAP.
// again stolen and modified a bit from video.c, don't mind me, will need to rearrange this one day.
@@ -1450,6 +1457,8 @@ static char *CHAT_WordWrap(INT32 x, INT32 w, INT32 option, const char *string)
size_t slen;
char *newstring = Z_StrDup(string);
INT32 spacewidth = (vid.width < 640) ? 8 : 4, charwidth = (vid.width < 640) ? 8 : 4;
emote_t *emote = NULL;
int emotelen = 0;
slen = strlen(string);
x = 0;
@@ -1471,7 +1480,12 @@ static char *CHAT_WordWrap(INT32 x, INT32 w, INT32 option, const char *string)
c = toupper(c);
c -= HU_FONTSTART;
if (c < 0 || c >= HU_FONTSIZE || !hu_font[c])
if ((emote = M_VerifyEmote(string+i, &emotelen)))
{
chw = EMOTEWIDTH;
i += emotelen-1; // Will be incremented on next loop iteration, hence -1
}
else if (c < 0 || c >= HU_FONTSIZE || !hu_font[c])
{
chw = spacewidth;
lastusablespace = i;
@@ -1493,7 +1507,6 @@ static char *CHAT_WordWrap(INT32 x, INT32 w, INT32 option, const char *string)
return newstring;
}
// 30/7/18: chaty is now the distance at which the lowest point of the chat will be drawn if that makes any sense.
INT16 chatx = 13, chaty = 169; // let's use this as our coordinates, shh
@@ -1526,6 +1539,8 @@ static void HU_drawMiniChat(void)
char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i-1]);
size_t j = 0;
INT32 linescount = 0;
emote_t *emote = NULL;
int emotelen = 0;
while(msg[j]) // iterate through msg
{
@@ -1550,6 +1565,11 @@ static void HU_drawMiniChat(void)
++j;
}
else if ((emote = M_VerifyEmote(msg+j, &emotelen)))
{
dx += EMOTEWIDTH - charwidth;
j += emotelen;
}
else
{
j++;
@@ -1595,6 +1615,8 @@ static void HU_drawMiniChat(void)
size_t j = 0;
char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_mini[i]); // get the current message, and word wrap it.
UINT8 *colormap = NULL;
emote_t *emote = NULL;
int emotelen = 0;
while(msg[j]) // iterate through msg
{
@@ -1621,6 +1643,16 @@ static void HU_drawMiniChat(void)
++j;
}
else if ((emote = M_VerifyEmote(msg+j, &emotelen)))
{
if (cv_chatbacktint.value) // on request of wolfy
V_DrawFillConsoleMap(x + dx + 2, y+dy, EMOTEWIDTH, charheight, 239|V_SNAPTOBOTTOM|V_SNAPTOLEFT);
HU_DrawEmote(x+dx+2, y+dy, emote, V_SNAPTOBOTTOM|V_SNAPTOLEFT|transflag);
dx += EMOTEWIDTH - charwidth;
j += emotelen;
}
else
{
if (cv_chatbacktint.value) // on request of wolfy
@@ -1698,6 +1730,9 @@ static void HU_drawChatLog(INT32 offset)
INT32 j = 0;
char *msg = CHAT_WordWrap(x+2, boxw-(charwidth*2), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, chat_log[i]); // get the current message, and word wrap it.
UINT8 *colormap = NULL;
emote_t *emote = NULL;
int emotelen = 0;
while(msg[j]) // iterate through msg
{
if (msg[j] < HU_FONTSTART) // don't draw
@@ -1719,6 +1754,15 @@ static void HU_drawChatLog(INT32 offset)
++j;
}
else if ((emote = M_VerifyEmote(msg+j, &emotelen)))
{
if ((y+dy+2 >= chat_topy) && (y+dy < (chat_bottomy)))
{
HU_DrawEmote(x+dx+2, y+dy, emote, V_SNAPTOBOTTOM|V_SNAPTOLEFT);
dx += EMOTEWIDTH - charwidth;
}
j += emotelen;
}
else
{
if ((y+dy+2 >= chat_topy) && (y+dy < (chat_bottomy)))
@@ -1844,7 +1888,7 @@ static void HU_DrawChat(void)
typelines = 1;
if ((w_chat.cursor == 0 || w_chat.length == 0) && hu_tick < 4)
V_DrawChatCharacter(chatx+2+c+charwidth*w_chat.cursor, y+1, '_'|V_SNAPTOBOTTOM|V_SNAPTOLEFT|t, !cv_allcaps.value, NULL);
V_DrawChatCharacter(chatx+2+c, y+1, '_'|V_SNAPTOBOTTOM|V_SNAPTOLEFT|t, !cv_allcaps.value, NULL);
if (w_chat.select != w_chat.cursor)
{
@@ -1855,30 +1899,40 @@ static void HU_DrawChat(void)
while (w_chat_buf[i])
{
boolean skippedline = false;
if (w_chat.cursor == (i+1))
emote_t *emote = NULL;
int emotelen = 0;
int drawwidth = charwidth; // if we've drawn emote, selection needs to account for that
if ((emote = M_VerifyEmote(w_chat_buf+i, &emotelen)))
{
HU_DrawEmote(chatx + c + 2, y-1, emote, V_SNAPTOBOTTOM|V_SNAPTOLEFT|t);
c += EMOTEWIDTH - charwidth;
i += emotelen-1;
drawwidth = EMOTEWIDTH;
}
else if (w_chat_buf[i] >= HU_FONTSTART) //Hurdler: isn't it better like that?
V_DrawChatCharacter(chatx + c + 2, y, w_chat_buf[i] | V_SNAPTOBOTTOM|V_SNAPTOLEFT | t, !cv_allcaps.value, NULL);
// Draw selection
if (i >= select_start && i < select_end)
V_DrawFill(chatx + c + 2 - (drawwidth-charwidth), y-1, drawwidth, charheight, 103|V_TRANSLUCENT|V_SNAPTOBOTTOM|V_SNAPTOLEFT|t);
++i;
if (w_chat.cursor == i)
{
INT32 cursorx = (c+charwidth < boxw-charwidth) ? (chatx + 2 + c+charwidth) : (chatx+1); // we may have to go down.
INT32 cursory = (cursorx != chatx+1) ? (y) : (y+charheight);
if (hu_tick < 4)
V_DrawChatCharacter(cursorx, cursory+1, '_' |V_SNAPTOBOTTOM|V_SNAPTOLEFT|t, !cv_allcaps.value, NULL);
if (cursorx == chatx+1 && saylen == i) // a weirdo hack
if (cursorx == chatx+1 && saylen == i-1) // a weirdo hack
{
typelines += 1;
skippedline = true;
}
}
//Hurdler: isn't it better like that?
if (w_chat_buf[i] >= HU_FONTSTART)
V_DrawChatCharacter(chatx + c + 2, y, w_chat_buf[i] | V_SNAPTOBOTTOM|V_SNAPTOLEFT | t, !cv_allcaps.value, NULL);
// Draw selection
if (i >= select_start && i < select_end)
V_DrawFill(chatx + c + 2, y-1, charwidth, charheight, 103|V_TRANSLUCENT|V_SNAPTOBOTTOM|V_SNAPTOLEFT|t);
++i;
c += charwidth;
if (c > boxw-(charwidth*2) && !skippedline)
{
@@ -1888,6 +1942,36 @@ static void HU_DrawChat(void)
}
}
if (emote_suggestions[0])
{
// A bit of copy-paste from /pm code :p
INT32 suggesty = chaty - charheight - 1;
size_t longest_suggestion_length = 0;
for (i = 0; i < MAXEMOTESUGGESTIONS && emote_suggestions[i]; ++i)
{
longest_suggestion_length = max(longest_suggestion_length, strlen(emote_suggestions[i]->name));
}
#ifdef NETSPLITSCREEN
if (splitscreen)
{
suggesty -= BASEVIDHEIGHT/2;
if (splitscreen > 1)
suggesty += 16;
}
else
#endif
suggesty -= (cv_kartspeedometer.value ? 16 : 0);
for (i = 0; i < MAXEMOTESUGGESTIONS && emote_suggestions[i]; ++i)
{
V_DrawFillConsoleMap(chatx + boxw + 2, suggesty - (7*i), (longest_suggestion_length+2)*4 + EMOTEWIDTH, 6, 239|V_SNAPTOBOTTOM|V_SNAPTOLEFT);
V_DrawSmallString(chatx + boxw + 4 + EMOTEWIDTH, suggesty - (7*i), V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE, va(":%s:", emote_suggestions[i]->name));
HU_DrawEmote(chatx + boxw + 2, suggesty - i*7, emote_suggestions[i], V_SNAPTOBOTTOM|V_SNAPTOLEFT);
}
}
// handle /pm list. It's messy, horrible and I don't care.
if (strnicmp(w_chat_buf, "/pm", 3) == 0 && vid.width >= 400 && !teamtalk) // 320x200 unsupported kthxbai
{
+4 -4
View File
@@ -82,6 +82,8 @@ typedef struct
char data[MAXPACKETLENGTH];
} ATTRPACK doomcom_t;
#define DOOMCOM_DATA(d) (doomdata_t *)&(d)->data
#ifdef HOLEPUNCH
typedef struct
{
@@ -89,6 +91,8 @@ typedef struct
INT32 addr;
INT16 port;
} ATTRPACK holepunch_t;
#define HOLEPUNCH_DATA(d) (holepunch_t *)&(d)->data
#endif
#if defined(_MSC_VER)
@@ -97,10 +101,6 @@ typedef struct
extern doomcom_t *doomcom;
#ifdef HOLEPUNCH
extern holepunch_t *holepunchpacket;
#endif
/** \brief return packet in doomcom struct
*/
extern boolean (*I_NetGet)(void);
+4 -3
View File
@@ -43,8 +43,9 @@ extern UINT8 sound_started;
/** \brief info of samplerate
*/
#if defined(HAVE_SDL) && SOUND==SOUND_SDL
extern consvar_t cv_samplerate;
//extern consvar_t cv_rndsoundpitch;
#endif
/** \brief The I_GetSfx function
@@ -83,7 +84,7 @@ void I_ShutdownSound(void);
\return sfx handle
*/
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel);
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, INT32 channel);
/** \brief Stops a sound channel.
@@ -114,7 +115,7 @@ boolean I_SoundIsPlaying(INT32 handle);
\return void
*/
void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep, UINT8 pitch);
void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep);
/** \brief The I_SetSfxVolume function
+77 -21
View File
@@ -371,8 +371,16 @@ static inline void I_UPnP_rem(const char *port, const char * servicetype)
static const char *SOCK_AddrToStr(mysockaddr_t *sk)
{
static char s[64]; // 255.255.255.255:65535 or IPv6:65535
static char s[64]; // 255.255.255.255:65535 or
// [ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff]:65535
#ifdef HAVE_NTOP
#ifdef HAVE_IPV6
int v6 = (sk->any.sa_family == AF_INET6);
#else
int v6 = 0;
#endif
void *addr;
int e = 0; // save error code so it can't be modified later code and avoid calling WSAGetLastError() more then once
@@ -387,14 +395,20 @@ static const char *SOCK_AddrToStr(mysockaddr_t *sk)
if(addr == NULL)
sprintf(s, "No address");
else if(inet_ntop(sk->any.sa_family, addr, s, sizeof (s)) == NULL)
else if(inet_ntop(sk->any.sa_family, addr, &s[v6], sizeof (s) - v6) == NULL)
{
e = errno;
sprintf(s, "Unknown family type, error #%u: %s", e, strerror(e));
}
#ifdef HAVE_IPV6
else if(sk->any.sa_family == AF_INET6 && sk->ip6.sin6_port != 0)
strcat(s, va(":%d", ntohs(sk->ip6.sin6_port)));
else if(sk->any.sa_family == AF_INET6)
{
s[0] = '[';
strcat(s, "]");
if (sk->ip6.sin6_port != 0)
strcat(s, va(":%d", ntohs(sk->ip6.sin6_port)));
}
#endif
else if(sk->any.sa_family == AF_INET && sk->ip4.sin_port != 0)
strcat(s, va(":%d", ntohs(sk->ip4.sin_port)));
@@ -486,10 +500,30 @@ static time_t SOCK_GetUnbanTime(size_t ban)
}
#ifndef NONET
#ifdef HAVE_IPV6
static boolean SOCK_cmpipv6(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask)
{
UINT8 bitmask;
I_Assert(mask <= 128);
if (mask == 0)
mask = 128;
if (memcmp(&a->ip6.sin6_addr.s6_addr, &b->ip6.sin6_addr.s6_addr, mask / 8) != 0)
return false;
if (mask % 8 == 0)
return true;
bitmask = 255 << (mask % 8);
return (a->ip6.sin6_addr.s6_addr[mask / 8] & bitmask) == (b->ip6.sin6_addr.s6_addr[mask / 8] & bitmask);
}
#endif
static boolean SOCK_cmpaddr(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask)
{
UINT32 bitmask = INADDR_NONE;
if (a->any.sa_family != b->any.sa_family)
return false;
if (mask && mask < 32)
bitmask = htonl((UINT32)(-1) << (32 - mask));
@@ -498,13 +532,14 @@ static boolean SOCK_cmpaddr(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask)
&& (b->ip4.sin_port == 0 || (a->ip4.sin_port == b->ip4.sin_port));
#ifdef HAVE_IPV6
else if (b->any.sa_family == AF_INET6)
return memcmp(&a->ip6.sin6_addr, &b->ip6.sin6_addr, sizeof(b->ip6.sin6_addr))
return SOCK_cmpipv6(a, b, mask)
&& (b->ip6.sin6_port == 0 || (a->ip6.sin6_port == b->ip6.sin6_port));
#endif
else
return false;
}
// This is a hack. For some reason, nodes aren't being freed properly.
// This goes through and cleans up what nodes were supposed to be freed.
/** \warning This function causes the file downloading to stop if someone joins.
@@ -620,6 +655,7 @@ is_external_address (UINT32 p)
static boolean hole_punch(ssize_t c)
{
holepunch_t *holepunchpacket = HOLEPUNCH_DATA(doomcom);
/* See ../doc/Holepunch-Protocol.txt */
if (cv_rendezvousserver.string[0] &&
@@ -659,6 +695,7 @@ static boolean SOCK_Get(void)
fromlen = (socklen_t)sizeof(fromaddress);
c = recvfrom(mysockets[n], (char *)&doomcom->data, MAXPACKETLENGTH, 0,
(void *)&fromaddress, &fromlen);
if (c > 0)
{
#ifdef USE_STUN
@@ -868,11 +905,11 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
unsigned long trueval = true;
#endif
mysockaddr_t straddr;
struct sockaddr_in sin;
socklen_t len = sizeof(sin);
socklen_t len = sizeof(straddr);
if (s == (SOCKET_TYPE)ERRSOCKET)
return (SOCKET_TYPE)ERRSOCKET;
#ifdef USE_WINSOCK
{ // Alam_GBC: disable the new UDP connection reset behavior for Win2k and up
#ifdef USE_WINSOCK2
@@ -892,14 +929,12 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
}
#endif
straddr.any = *addr;
memcpy(&straddr, addr, addrlen);
I_OutputMsg("Binding to %s\n", SOCK_AddrToStr(&straddr));
if (family == AF_INET)
{
mysockaddr_t tmpaddr;
tmpaddr.any = *addr ;
if (tmpaddr.ip4.sin_addr.s_addr == htonl(INADDR_ANY))
if (straddr.ip4.sin_addr.s_addr == htonl(INADDR_ANY))
{
opt = true;
opts = (socklen_t)sizeof(opt);
@@ -924,7 +959,7 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
#ifdef HAVE_IPV6
else if (family == AF_INET6)
{
if (memcmp(addr, &in6addr_any, sizeof(in6addr_any)) == 0) //IN6_ARE_ADDR_EQUAL
if (memcmp(&straddr.ip6.sin6_addr, &in6addr_any, sizeof(in6addr_any)) == 0) //IN6_ARE_ADDR_EQUAL
{
opt = true;
opts = (socklen_t)sizeof(opt);
@@ -939,7 +974,7 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
// make it IPv6 ony
opt = true;
opts = (socklen_t)sizeof(opt);
rc = setsockopt(s, SOL_SOCKET, IPV6_V6ONLY, (char *)&opt, opts);
rc = setsockopt(s, IPPROTO_IPV6, IPV6_V6ONLY, (char *)&opt, opts);
if (rc <= -1)
{
e = errno;
@@ -969,7 +1004,7 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
inet_pton(AF_INET6, IPV6_MULTICAST_ADDRESS, &maddr.ipv6mr_multiaddr);
maddr.ipv6mr_interface = 0;
rc = setsockopt(s, SOL_SOCKET, IPV6_JOIN_GROUP, (const char *)&maddr, sizeof(maddr));
rc = setsockopt(s, IPPROTO_IPV6, IPV6_JOIN_GROUP, (const char *)&maddr, sizeof(maddr));
if (rc <= -1)
{
e = errno;
@@ -1032,7 +1067,7 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
CONS_Printf(M_GetText("Network system buffer set to: %dKb\n"), opt>>10);
}
rc = getsockname(s, (struct sockaddr *)&sin, &len);
rc = getsockname(s, &straddr.any, &len);
if (rc != 0)
{
e = errno;
@@ -1040,7 +1075,14 @@ static SOCKET_TYPE UDP_Bind(int family, struct sockaddr *addr, socklen_t addrlen
I_OutputMsg("getsockname failed: #%u, %s\n", e, strerror(e));
}
else
current_port = (UINT16)ntohs(sin.sin_port);
{
if (family == AF_INET)
current_port = (UINT16)ntohs(straddr.ip4.sin_port);
#ifdef HAVE_IPV6
else if (family == AF_INET6)
current_port = (UINT16)ntohs(straddr.ip6.sin6_port);
#endif
}
return s;
}
@@ -1121,6 +1163,7 @@ static boolean UDP_Socket(void)
I_freeaddrinfo(ai);
}
}
#ifdef HAVE_IPV6
if (b_ipv6)
{
@@ -1319,12 +1362,13 @@ static boolean SOCK_GetAddr(struct sockaddr_in *sin, const char *address, const
{
struct my_addrinfo *ai = NULL, *runp, hints;
int gaie;
size_t i;
if (!port || !port[0])
port = DEFAULTPORT;
memset (&hints, 0x00, sizeof (hints));
hints.ai_flags = 0;
hints.ai_flags = AI_ADDRCONFIG;
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_DGRAM;
hints.ai_protocol = IPPROTO_UDP;
@@ -1343,10 +1387,19 @@ static boolean SOCK_GetAddr(struct sockaddr_in *sin, const char *address, const
{
while (runp != NULL)
{
if (sendto(mysockets[0], NULL, 0, 0, runp->ai_addr, runp->ai_addrlen) == 0)
break;
// test ip address of server
for (i = 0; i < mysocketses; ++i)
{
if (runp->ai_addr->sa_family == myfamily[i])
{
break;
}
}
runp = runp->ai_next;
if (i >= mysocketses)
runp = runp->ai_next;
else
break;
}
}
@@ -1390,6 +1443,8 @@ static void rendezvous(int size)
tic_t tic = I_GetTime();
holepunch_t *holepunchpacket = HOLEPUNCH_DATA(doomcom);
if (tic != refreshtic)
{
if (SOCK_GetAddr(&rzv.ip4, host, (port ? port : "7777"), false))
@@ -1415,6 +1470,7 @@ static void rendezvous(int size)
static void SOCK_RequestHolePunch(INT32 node)
{
mysockaddr_t * addr = &clientaddress[node];
holepunch_t *holepunchpacket = HOLEPUNCH_DATA(doomcom);
holepunchpacket->addr = addr->ip4.sin_addr.s_addr;
holepunchpacket->port = addr->ip4.sin_port;
@@ -1736,7 +1792,7 @@ boolean I_InitTcpNetwork(void)
// server address only in ip
if (serverhostname[0])
{
{
CONS_Printf("SERVERNAME: %s\n", serverhostname);
COM_BufAddText("connect \"");
COM_BufAddText(serverhostname);
+1 -1
View File
@@ -2563,7 +2563,7 @@ state_t states[NUMSTATES] =
{SPR_KINV, FF_FULLBRIGHT|2, 1, NULL, 0, 0, S_KARTINVULN_LARGE3}, // S_KARTINVULN_LARGE2
{SPR_KINV, FF_FULLBRIGHT|5, 1, NULL, 0, 0, S_KARTINVULN_LARGE4}, // S_KARTINVULN_LARGE3
{SPR_KINV, FF_FULLBRIGHT|6, 1, NULL, 0, 0, S_KARTINVULN_LARGE5}, // S_KARTINVULN_LARGE4
{SPR_KINV, FF_FULLBRIGHT|7, 1, NULL, 0, 0, S_NULL}, // S_KARTINVULN_LARGE5
{SPR_KINV, FF_FULLBRIGHT|7, 1, NULL, 0, 0, S_NULL}, // S_KARTINVULN_LARGE5
{SPR_KINF, FF_FULLBRIGHT|FF_TRANS90, 1, NULL, 0, 0, S_INVULNFLASH2}, // S_INVULNFLASH1
{SPR_NULL, FF_FULLBRIGHT|FF_TRANS90, 1, NULL, 0, 0, S_INVULNFLASH3}, // S_INVULNFLASH2
+27 -38
View File
@@ -1315,14 +1315,6 @@ static void K_drawKartStats(void)
flags = V_SNAPTOBOTTOM|V_SNAPTOLEFT;
UINT8 splitnum = 0;
for (; splitnum < MAXSPLITSCREENPLAYERS; ++splitnum)
{
if (stplyrnum == splitnum)
break;
}
if (!LUA_HudEnabled(hud_statdisplay))
return;
@@ -1362,7 +1354,7 @@ static void K_drawKartStats(void)
// If we are in 2-player splitscreen, for player 1 we move hud to up and remove snapping
// to bottom
if (splitnum == 0)
if (stplyrnum == 0)
{
y /= 2;
flags = V_SNAPTOLEFT;
@@ -1375,28 +1367,28 @@ static void K_drawKartStats(void)
}
else
{
if (splitnum == 0 || splitnum == 2) // If we are P1 or P3...
if (stplyrnum == 0 || stplyrnum == 2) // If we are P1 or P3...
{
// ye i just align it to position number lol
x = POSI_X + 19;
y = POSI_Y - 6;
flags = V_SNAPTOLEFT|((splitnum == 2) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P3 to the bottom.
flags = V_SNAPTOLEFT|((stplyrnum == 2) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P3 to the bottom.
}
else // else, that means we're P2 or P4.
{
x = POSI2_X - 75;
y = POSI2_Y - 6;
flags = V_SNAPTORIGHT|((splitnum == 3) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P4 to the bottom
flags = V_SNAPTORIGHT|((stplyrnum == 3) ? V_SPLITSCREEN|V_SNAPTOBOTTOM : 0); // flip P4 to the bottom
}
}
flags |= V_HUDTRANS;
skin_t *fakeskin;
fakeskin = K_GetPlayerSkin(stplyr);
if (!splitscreen)
{
skin_t *fakeskin;
fakeskin = K_GetPlayerSkin(stplyr);
// Skin name
if (K_IsHighResolution()) // V_DrawSmallString becomes a mess at low resolutions lel
{
@@ -1707,7 +1699,7 @@ static void K_drawKartItem(void)
switch (stplyr->kartstuff[k_itemblinkmode])
{
case 2:
localcolor = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
localcolor = K_RainbowColor();
break;
case 1:
localcolor = SKINCOLOR_RED;
@@ -1812,6 +1804,7 @@ void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, UI
if (!mode)
{
splitflags = V_HUDTRANS|K_calcSplitFlags(V_SNAPTOTOP|V_SNAPTORIGHT);
if (cv_timelimit.value && timelimitintics > 0)
{
if (drawtime >= timelimitintics)
@@ -2175,9 +2168,7 @@ static boolean K_drawKartPositionFaces(void)
if (!playeringame[rankplayer[i]])
continue;
if (player->spectator)
continue;
if (!player->mo)
if (player->spectator || !player->mo)
continue;
const UINT8 mocolor = player->mo->color;
@@ -2186,9 +2177,10 @@ static boolean K_drawKartPositionFaces(void)
if (mocolor)
{
colormap = R_GetTranslationColormap(player->skin, mocolor, GTC_CACHE);
if (player->mo->colorized)
colormap = R_GetTranslationColormap(TC_RAINBOW, mocolor, GTC_CACHE);
else
colormap = R_GetTranslationColormap(player->skin, mocolor, GTC_CACHE);
if (K_UseHighResPortraits())
V_DrawSmallMappedPatch(FACE_X, Y, V_HUDTRANS|V_SNAPTOLEFT, R_GetSkinFaceWant(player), colormap);
@@ -2217,8 +2209,10 @@ static boolean K_drawKartPositionFaces(void)
else
{
INT32 pos = player->kartstuff[k_position];
if (pos < 0 || pos > MAXPLAYERS)
pos = 0;
// Draws the little number over the face
V_DrawScaledPatch(FACE_X-5, Y+10, V_HUDTRANS|V_SNAPTOLEFT, kp_facenum[pos]);
}
@@ -2244,6 +2238,7 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I
//I_Assert(scorelines <= 9); -- not today bitch, kart fixed it up
V_DrawFill(1-duptweak, 26, dupadjust-2, 1, 0); // Draw a horizontal line because it looks nice!
if (scorelines > 8)
{
V_DrawFill(160, 26, 1, 147, 0); // Draw a vertical line to separate the two sides.
@@ -3168,7 +3163,7 @@ static void K_drawDriftGauge(void)
SKINCOLOR_SALMON,
};
static UINT8 driftrainbow[18] = {
static const UINT8 driftrainbow[18] = {
0, 31, 47, 63, 79, 95, 111, 119, 127, 143, 159, 175, 183, 191, 199, 207, 223, 247
};
@@ -3274,7 +3269,6 @@ skipcrap:
}
// right, also draw a cool number
//SG_DrawPaddedNum(v, basex + (dup*32), basey, driftcharge*100 / driftval, 3, "PINGN", V_NOSCALESTART|V_OFFSET|drifttrans, cmap)
if (cv_driftgaugestyle.value == 3)
V_DrawPaddedTallColorNum(basex + (dup*32), basey, V_NOSCALESTART|V_OFFSET|drifttrans, driftcharge*100 / driftval, 3, cmap);
else
@@ -3283,10 +3277,10 @@ skipcrap:
break;
case 4:
{
cmap = R_GetTranslationColormap(TC_RAINBOW, driftskins[driftlevel],GTC_CACHE);
if (driftcharge >= driftval*4)
cmap = R_GetTranslationColormap(TC_RAINBOW, 1 + leveltime % (MAXSKINCOLORS-1),GTC_CACHE);
else
cmap = R_GetTranslationColormap(TC_RAINBOW, driftskins[driftlevel],GTC_CACHE);
V_DrawPaddedTallColorNum(basex + (dup*16), basey, V_NOSCALESTART|V_OFFSET|drifttrans, driftcharge*100 / driftval, 3, cmap);
}
@@ -3305,6 +3299,7 @@ static fixed_t K_FindCheckX(fixed_t px, fixed_t py, angle_t ang, fixed_t mx, fix
range *= gamespeed+1;
dist = abs(R_PointToDist2(px, py, mx, my));
if (dist > range)
return -BASEVIDWIDTH;
@@ -3404,17 +3399,14 @@ static void K_drawKartPlayerCheck(void)
UINT8 *colormap;
INT32 x;
const INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM);
if (!stplyr->mo || stplyr->spectator)
return;
if (stplyr->awayviewtics)
if (!stplyr->mo || stplyr->spectator || stplyr->awayviewtics)
return;
if (camspin[0])
return;
const INT32 splitflags = K_calcSplitFlags(V_SNAPTOBOTTOM);
for (i = 0; i < MAXPLAYERS; i++)
{
UINT8 pnum = 0;
@@ -3532,7 +3524,7 @@ static void K_drawKartMinimapHead(mobj_t *mo, INT32 x, INT32 y, INT32 flags)
skin = K_GetMobjSkin(mo);
minimaphead = (skinlocal ? localfacemmapprefix : facemmapprefix)[K_GetMobjSkinNum(skin, skinlocal)];
amnumxpos = (FixedMul(lerp(mo->old_x, mo->x), minimapinfo.zoom) - minimapinfo.offs_x);
amnumxpos = (FixedMul(lerp(mo->old_x, mo->x), minimapinfo.zoom) - minimapinfo.offs_x);
amnumypos = -(FixedMul(lerp(mo->old_y, mo->y), minimapinfo.zoom) - minimapinfo.offs_y);
if (encoremode)
@@ -3965,7 +3957,7 @@ static void K_drawBattleFullscreen(void)
}
}
if (netgame && !stplyr->spectator && timeinmap > 113) // FREE PLAY?
if (netgame && cv_showfreeplay.value && !stplyr->spectator && timeinmap > 113) // FREE PLAY?
{
UINT8 i;
@@ -4106,7 +4098,7 @@ static void K_drawKartFirstPerson(void)
// drift sparks!
if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dsthree))
colmap = R_GetTranslationColormap(TC_RAINBOW, (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1))), GTC_CACHE);
colmap = R_GetTranslationColormap(TC_RAINBOW, K_RainbowColor(), GTC_CACHE);
else if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dstwo))
colmap = R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_KETCHUP, GTC_CACHE);
else if ((leveltime & 1) && (stplyr->kartstuff[k_driftcharge] >= dsone))
@@ -4386,10 +4378,6 @@ static void K_drawLapStartAnim(void)
void K_drawKartFreePlay(UINT32 flashtime)
{
// no splitscreen support because it's not FREE PLAY if you have more than one player in-game
if (!cv_showfreeplay.value)
return;
if ((flashtime % TICRATE) < TICRATE/2)
return;
@@ -4503,6 +4491,7 @@ static void K_drawCheckpointDebugger(void)
V_DrawString(8, 184, 0, va("Checkpoint: %d / %d (Can finish)", stplyr->starpostnum, numstarposts));
else
V_DrawString(8, 184, 0, va("Checkpoint: %d / %d (Skip: %d)", stplyr->starpostnum, numstarposts, ((numstarposts/2) + stplyr->starpostnum)));
V_DrawString(8, 192, 0, va("Waypoint dist: Prev %d, Next %d", stplyr->kartstuff[k_prevcheck], stplyr->kartstuff[k_nextcheck]));
}
@@ -4765,7 +4754,7 @@ void K_drawKartHUD(void)
V_DrawScaledPatch(BASEVIDWIDTH/2 - (kp_yougotem->width/2), 32, V_HUDTRANS, kp_yougotem);
// Draw FREE PLAY.
if (isfreeplay && !stplyr->spectator && timeinmap > 113)
if (isfreeplay && cv_showfreeplay.value && !stplyr->spectator && timeinmap > 113)
{
if (LUA_HudEnabled(hud_freeplay))
K_drawKartFreePlay(leveltime);
+113 -44
View File
@@ -484,6 +484,15 @@ UINT8 colortranslations[MAXTRANSLATIONS][16] = {
{120, 120, 96, 96, 97, 98, 98, 99, 81, 81, 69, 71, 73, 75, 77, 79}, // SKINCOLOR_CSUPER5
};
//
// Gives you a color to use for rainbow effects (like invincibility).
// Return: Skincolor value.
//
UINT8 K_RainbowColor(void)
{
return (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
}
// Define for getting accurate color brightness readings according to how the human eye sees them.
// https://en.wikipedia.org/wiki/Relative_luminance
// 0.2126 to red
@@ -551,26 +560,41 @@ void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor)
*/
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color, boolean local)
{
INT32 i;
INT32 starttranscolor;
INT32 i, starttranscolor;
// Handle a couple of simple special cases
if (skinnum == TC_BOSS
|| skinnum == TC_ALLWHITE
|| skinnum == TC_METALSONIC
|| skinnum == TC_BLINK
|| color == SKINCOLOR_NONE)
if (skinnum < TC_DEFAULT)
{
for (i = 0; i < NUM_PALETTE_ENTRIES; i++)
switch (skinnum)
{
if (skinnum == TC_ALLWHITE)
dest_colormap[i] = 0;
else if (skinnum == TC_BLINK)
dest_colormap[i] = colortranslations[color][3];
else
dest_colormap[i] = (UINT8)i;
case TC_ALLWHITE:
memset(dest_colormap, 0, NUM_PALETTE_ENTRIES * sizeof(UINT8));
return;
case TC_RAINBOW:
if (color >= MAXTRANSLATIONS)
I_Error("Invalid skin color #%hu.", (UINT16)color);
if (color != SKINCOLOR_NONE)
{
K_RainbowColormap(dest_colormap, color);
return;
}
break;
case TC_BLINK:
if (color >= MAXTRANSLATIONS)
I_Error("Invalid skin color #%hu.", (UINT16)color);
if (color != SKINCOLOR_NONE)
{
memset(dest_colormap, colortranslations[color][3], NUM_PALETTE_ENTRIES * sizeof(UINT8));
return;
}
break;
default:
break;
}
for (i = 0; i < NUM_PALETTE_ENTRIES; i++)
dest_colormap[i] = (UINT8)i;
// White!
if (skinnum == TC_BOSS)
dest_colormap[31] = 0;
@@ -579,14 +603,25 @@ void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color, bo
return;
}
else if (skinnum == TC_RAINBOW)
else if (color == SKINCOLOR_NONE)
{
K_RainbowColormap(dest_colormap, color);
for (i = 0; i < NUM_PALETTE_ENTRIES; i++)
dest_colormap[i] = (UINT8)i;
return;
}
if (color >= MAXTRANSLATIONS)
I_Error("Invalid skin color #%hu.", (UINT16)color);
if (skinnum < 0 && skinnum > TC_DEFAULT)
I_Error("Invalid translation colormap index %d.", skinnum);
starttranscolor = (skinnum != TC_DEFAULT) ? K_GetSkinArray(local)[skinnum].starttranscolor : DEFAULT_STARTTRANSCOLOR;
if (starttranscolor >= NUM_PALETTE_ENTRIES)
I_Error("Invalid startcolor #%d.", starttranscolor);
// Fill in the entries of the palette that are fixed
for (i = 0; i < starttranscolor; i++)
dest_colormap[i] = (UINT8)i;
@@ -619,36 +654,46 @@ UINT8 K_GetKartColorByName(const char *name)
return 0;
}
//
// returns the players skinnumber
// accounts for localskins
//
INT32 K_GetSkinNum(player_t *player)
{
return player->localskin ? (player->localskin - 1) : player->skin;
}
//
// returns the mobj skinnumber
// accounts for localskins
//
INT32 K_GetMobjSkinNum(const skin_t *skin, boolean local)
{
return skin - K_GetSkinArray(local);
}
//
// returns the players skinnumber
// accounts for localskins
//
skin_t *K_GetMobjSkin(const mobj_t *mobj)
{
return mobj->localskin ? mobj->localskin : mobj->skin;
}
//
// returns the skin array to use
// accounts for localskins
//
skin_t *K_GetSkinArray(boolean local)
{
return local ? localskins : skins;
}
//
// returns the players skin
// accounts for localskins
//
skin_t *K_GetPlayerSkin(player_t *player)
{
return &K_GetSkinArray(player->skinlocal)[K_GetSkinNum(player)];
@@ -1586,7 +1631,7 @@ static UINT8 K_CheckOffroadCollide(mobj_t *mo)
// we will do essentially the same checks as above instead of bothering with top/bottom height of the FOF.
// Reminder that an FOF's floor is its bottom, silly!
if ( ((s2->flags & SF_FLIPSPECIAL_FLOOR) && mo->z == cel) // "floor" check
if ( ((s2->flags & SF_FLIPSPECIAL_FLOOR) && mo->z == cel) // "floor" check
|| ((s2->flags & SF_FLIPSPECIAL_CEILING) && (mo->z + mo->height) == flr) ) // "ceiling" check.
for (i = 2; i < 5; i++) // check for sector special
@@ -1670,10 +1715,10 @@ static void K_SpawnDashDustRelease(player_t *player)
I_Assert(player->mo != NULL);
I_Assert(!P_MobjWasRemoved(player->mo));
if (!P_IsObjectOnGround(player->mo))
if (!player->speed && !player->kartstuff[k_startboost])
return;
if (!player->speed && !player->kartstuff[k_startboost])
if (!P_IsObjectOnGround(player->mo))
return;
travelangle = player->mo->angle;
@@ -1903,11 +1948,11 @@ static void K_PlayGenericCombatSound(mobj_t *source, mobj_t *other, sfxenum_t sf
boolean alwaysHear = false;
if (other != NULL && P_MobjWasRemoved(other) == false && other->player != NULL)
if (cv_kartvoices.value && !P_MobjWasRemoved(other) && other->player != NULL)
{
alwaysHear = P_IsDisplayPlayer(other->player);
if (cv_kartvoices.value)
S_StartSound(alwaysHear ? NULL : source, skin->soundsid[S_sfx[sfx_id].skinsound]);
}
K_RegularVoiceTimers(source->player);
}
@@ -1929,7 +1974,7 @@ void K_PlayAttackTaunt(mobj_t *source)
void K_PlayBoostTaunt(mobj_t *source)
{
sfxenum_t pick = P_RandomKey(2); // Gotta roll the RNG every time this is called for sync reasons
boolean tasteful = (!source->player || !source->player->kartstuff[k_tauntvoices]);
const boolean tasteful = (!source->player || !source->player->kartstuff[k_tauntvoices]);
if (cv_kartvoices.value && (tasteful || cv_kartvoices.value == 2))
S_StartSound(source, sfx_kbost1+pick);
@@ -1942,8 +1987,6 @@ void K_PlayBoostTaunt(mobj_t *source)
void K_PlayOvertakeSound(mobj_t *source)
{
boolean tasteful = (!source->player || !source->player->kartstuff[k_voices]);
if (!G_RaceGametype()) // Only in race
return;
@@ -1951,6 +1994,8 @@ void K_PlayOvertakeSound(mobj_t *source)
if (leveltime < starttime+(10*TICRATE))
return;
const boolean tasteful = (!source->player || !source->player->kartstuff[k_voices]);
if (cv_kartvoices.value && (tasteful || cv_kartvoices.value == 2))
S_StartSound(source, sfx_kslow);
@@ -2186,6 +2231,7 @@ fixed_t K_GetKartSpeed(player_t *player, boolean doboostpower)
if (doboostpower)
return FixedMul(finalspeed, player->kartstuff[k_boostpower]+player->kartstuff[k_speedboost]);
return finalspeed;
}
@@ -2222,10 +2268,14 @@ fixed_t K_3dKartMovement(player_t *player, boolean onground, fixed_t forwardmove
{
fixed_t accelmax = 4000;
fixed_t newspeed, oldspeed, finalspeed;
fixed_t p_speed = K_GetKartSpeed(player, true);
fixed_t p_accel = K_GetKartAccel(player);
fixed_t p_speed, p_accel;
if (!onground) return 0; // If the player isn't on the ground, there is no change in speed
// If the player isn't on the ground, there is no change in speed
if (!onground)
return 0;
p_speed = K_GetKartSpeed(player, true);
p_accel = K_GetKartAccel(player);
// ACCELCODE!!!1!11!
oldspeed = R_PointToDist2(0, 0, player->rmomx, player->rmomy); // FixedMul(P_AproxDistance(player->rmomx, player->rmomy), player->mo->scale);
@@ -2329,6 +2379,7 @@ void K_SpinPlayer(player_t *player, mobj_t *source, INT32 type, mobj_t *inflicto
if (P_MobjWasRemoved(player->mo))
return; // mobj was removed (in theory that shouldn't happen)
if (shouldForce == 1)
force = true;
else if (shouldForce == 2)
@@ -2469,8 +2520,10 @@ void K_SquishPlayer(player_t *player, mobj_t *source, mobj_t *inflictor)
// PS: Inflictor is unused for all purposes here and is actually only ever relevant to Lua. It may be nil too.
boolean force = false; // Used to check if Lua ShouldSquish should get us damaged reguardless of flashtics or heck knows what.
UINT8 shouldForce = LUA_HookShouldSquish(player, inflictor, source);
if (P_MobjWasRemoved(player->mo))
return; // mobj was removed (in theory that shouldn't happen)
if (shouldForce == 1)
force = true;
else if (shouldForce == 2)
@@ -2583,6 +2636,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b
if (P_MobjWasRemoved(player->mo))
return; // mobj was removed (in theory that shouldn't happen)
if (shouldForce == 1)
force = true;
else if (shouldForce == 2)
@@ -2668,6 +2722,7 @@ void K_ExplodePlayer(player_t *player, mobj_t *source, mobj_t *inflictor) // A b
player->powers[pw_flashing] = K_GetKartFlashing(player);
upgoer = (18*mapobjectscale*P_MobjFlip(player->mo));
if (player->mo->eflags & MFE_UNDERWATER)
upgoer = (117 * upgoer) / 200;
@@ -3048,7 +3103,7 @@ static UINT16 K_DriftSparkColor(player_t *player, INT32 charge)
if (charge >= K_GetKartDriftSparkValue(player)*4)
{
color = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
color = K_RainbowColor();
}
else if (charge >= K_GetKartDriftSparkValue(player)*2)
{
@@ -3540,11 +3595,14 @@ void K_SpawnSparkleTrail(mobj_t *mo)
fixed_t newz = mo->z + mo->momz + (P_RandomRange(0, mo->height>>FRACBITS)<<FRACBITS);
sparkle = P_SpawnMobj(newx, newy, newz, MT_SPARKLETRAIL);
K_FlipFromObject(sparkle, mo);
P_SetTarget(&sparkle->target, mo);
sparkle->destscale = mo->destscale;
P_SetScale(sparkle, mo->scale);
sparkle->color = mo->color;
if (cv_playerblendeffects.value && mo->player && K_SpeedLinesShouldBlend(mo->player))
@@ -3603,7 +3661,6 @@ void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent)
void K_DriftDustHandling(mobj_t *spawner)
{
angle_t anglediff;
const INT16 spawnrange = spawner->radius>>FRACBITS;
if (!P_IsObjectOnGround(spawner) || leveltime % 2 != 0)
return;
@@ -3640,6 +3697,8 @@ void K_DriftDustHandling(mobj_t *spawner)
if (anglediff > ANGLE_180)
anglediff = InvAngle(anglediff);
const INT16 spawnrange = spawner->radius>>FRACBITS;
if (anglediff > ANG10*4) // Trying to turn further than 40 degrees
{
fixed_t spawnx = P_RandomRange(-spawnrange, spawnrange)<<FRACBITS;
@@ -3899,9 +3958,8 @@ static mobj_t *K_ThrowKartItem(player_t *player, boolean missile, mobjtype_t map
void K_PuntMine(mobj_t *thismine, mobj_t *punter)
{
angle_t fa = R_PointToAngle2(0, 0, punter->momx, punter->momy) >> ANGLETOFINESHIFT;
fixed_t z = 30*mapobjectscale + punter->momz;
fixed_t spd;
angle_t fa;
fixed_t z, spd;
mobj_t *mine;
if (P_MobjWasRemoved(thismine))
@@ -3936,6 +3994,9 @@ void K_PuntMine(mobj_t *thismine, mobj_t *punter)
if (P_MobjWasRemoved(mine))
return;
fa = R_PointToAngle2(0, 0, punter->momx, punter->momy) >> ANGLETOFINESHIFT;
z = 30*mapobjectscale + punter->momz;
spd = K_GetProjectileSpeed();
mine->flags |= MF_NOCLIPTHING;
@@ -4147,8 +4208,10 @@ static void K_DoShrink(player_t *user)
{
if (!playeringame[i] || players[i].spectator || !players[i].mo)
continue;
if (&players[i] == user)
continue;
if (players[i].kartstuff[k_position] < user->kartstuff[k_position])
{
//P_FlashPal(&players[i], PAL_NUKE, 10);
@@ -5033,6 +5096,7 @@ player_t *K_FindJawzTarget(mobj_t *actor, player_t *source)
// Find the angle, see who's got the best.
thisang = actor->angle - R_PointToAngle2(actor->x, actor->y, player->mo->x, player->mo->y);
if (thisang > ANGLE_180)
thisang = InvAngle(thisang);
@@ -5229,10 +5293,11 @@ static void K_UpdateEngineSounds(player_t *player, ticcmd_t *cmd)
static void K_UpdateInvincibilitySounds(player_t *player)
{
INT32 sfxnum = sfx_None;
const boolean localplayer = P_IsLocalPlayer(player);
if (player->mo->health > 0)
{
const boolean localplayer = P_IsLocalPlayer(player);
if (player->kartstuff[k_growshrinktimer] > 0 && (!localplayer || cv_growmusic.value == 2)) // Prioritize Grow
sfxnum = cv_kartinvinsfx.value ? sfx_alarmg : sfx_kgrow;
else if (player->kartstuff[k_invincibilitytimer] > 0 && (!localplayer || cv_supermusic.value == 2))
@@ -5325,7 +5390,7 @@ static UINT8 K_GetSpeedLineColor(player_t *player, boolean colorSpeed)
else if (player->kartstuff[k_driftboost] <= 50)
speedcolor = SKINCOLOR_RASPBERRY;
else if (player->kartstuff[k_driftboost] <= 125)
speedcolor = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
speedcolor = K_RainbowColor();
if (cv_coloredspeedlines.value == 2)
speedcolor = (leveltime & 1) ? playercolor : speedcolor;
@@ -5772,7 +5837,7 @@ boolean K_CheckPlayersRespawnColliding(INT32 playernum, fixed_t x, fixed_t y)
static INT16 K_GetKartDriftValue(player_t *player, fixed_t countersteer)
{
INT16 basedrift, driftangle;
fixed_t driftweight = player->kartweight*14; // 12
fixed_t driftweight;
// If they aren't drifting or on the ground this doesn't apply
if (player->kartstuff[k_drift] == 0 || !P_IsObjectOnGround(player->mo))
@@ -5783,6 +5848,8 @@ static INT16 K_GetKartDriftValue(player_t *player, fixed_t countersteer)
return -266*player->kartstuff[k_drift]; // Drift has ended and we are tweaking their angle back a bit
}
driftweight = player->kartweight*14; // 12
//basedrift = 90*player->kartstuff[k_drift]; // 450
//basedrift = 93*player->kartstuff[k_drift] - driftweight*3*player->kartstuff[k_drift]/10; // 447 - 303
basedrift = 83*player->kartstuff[k_drift] - (driftweight - 14)*player->kartstuff[k_drift]/5; // 415 - 303
@@ -5793,6 +5860,9 @@ static INT16 K_GetKartDriftValue(player_t *player, fixed_t countersteer)
INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue)
{
fixed_t p_topspeed, p_curspeed, p_maxspeed;
fixed_t adjustangle;
if (player->spectator)
return turnvalue;
@@ -5811,10 +5881,10 @@ INT16 K_GetKartTurnValue(player_t *player, INT16 turnvalue)
return turnvalue;
}
fixed_t p_topspeed = K_GetKartSpeed(player, false);
fixed_t p_curspeed = min(player->speed, p_topspeed * 2);
fixed_t p_maxspeed = p_topspeed * 3;
fixed_t adjustangle = FixedDiv((p_maxspeed>>16) - (p_curspeed>>16), (p_maxspeed>>16) + player->kartweight);
p_topspeed = K_GetKartSpeed(player, false);
p_curspeed = min(player->speed, p_topspeed * 2);
p_maxspeed = p_topspeed * 3;
adjustangle = FixedDiv((p_maxspeed>>16) - (p_curspeed>>16), (p_maxspeed>>16) + player->kartweight);
turnvalue = FixedMul(turnvalue, adjustangle); // Weight has a small effect on turning
@@ -6216,7 +6286,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
K_KartUpdatePosition(player);
if (!player->exiting)
if (LIKELY(!player->exiting))
{
if (player->kartstuff[k_oldposition] < player->kartstuff[k_position]) // But first, if you lost a place,
{
@@ -6796,10 +6866,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground)
K_KartDrift(player, onground);
if ((!player->kartstuff[k_aizdriftstrat]) || (!P_IsObjectOnGround(player->mo)) || (player->kartstuff[k_drift]))
if (player->sliproll && ((!player->kartstuff[k_aizdriftstrat]) || (!P_IsObjectOnGround(player->mo)) || (player->kartstuff[k_drift])))
{
if (player->sliproll && (player->sliproll > 0))
player->sliproll -= (4*ANG1);
player->sliproll -= (4*ANG1);
}
// funneh Saturn sprite stuff
+1
View File
@@ -19,6 +19,7 @@ extern "C" {
extern UINT8 colortranslations[MAXTRANSLATIONS][16];
extern const char *KartColor_Names[MAXSKINCOLORS];
extern const UINT8 KartColor_Opposite[MAXSKINCOLORS*2];
UINT8 K_RainbowColor(void);
void K_RainbowColormap(UINT8 *dest_colormap, UINT8 skincolor);
void K_GenerateKartColormap(UINT8 *dest_colormap, INT32 skinnum, UINT8 color, boolean local);
UINT8 K_GetKartColorByName(const char *name);
+12 -6
View File
@@ -393,6 +393,16 @@ FUNCINLINE static ATTRINLINE boolean prepare_string_hook
return false;
}
static boolean prepare_hud_hook
(
Hook_State * hook,
int hook_type
){
return init_hook_type(hook, 0,
hook_type, 0, NULL,
hudHookIds[hook_type].numHooks);
}
FUNCINLINE static ATTRINLINE void init_hook_call
(
Hook_State * hook,
@@ -663,20 +673,16 @@ int LUA_HookTiccmd(player_t *player, ticcmd_t *cmd, int hook_type)
void LUA_HookHUD(int hook_type, huddrawlist_h list)
{
const hook_t * map = &hudHookIds[hook_type];
Hook_State hook;
if (map->numHooks > 0)
if (prepare_hud_hook(&hook, hook_type))
{
start_hook_stack();
begin_hook_values(&hook);
LUA_SetHudHook(hook_type, list);
hud_running = true; // local hook
hud_interpcounter = 0;
hud_interpolate = hud_interpstring = hud_interplatch = false;
init_hook_call(&hook, 1, res_hud);
call_mapped(&hook, map);
call_mapped(&hook, &hudHookIds[hook_type]);
lua_settop(gL, 0); // destroy le stack!! >:3
hud_running = false;
+65 -14
View File
@@ -366,7 +366,18 @@ void LUA_DumpFile(const char *filename)
}
#endif
fixed_t LUA_EvalMath(const char *word)
static void createMathLibState(void)
{
mL = lua_newstate(LUA_Alloc, NULL);
lua_atpanic(mL, LUA_Panic);
// open only enum lib
lua_pushcfunction(mL, LUA_EnumLib);
lua_pushboolean(mL, true);
lua_call(mL, 1, 0);
}
fixed_t LUA_EvalMathEx(const char *word, const char **error)
{
char buf[1024], *b;
const char *p;
@@ -375,15 +386,7 @@ fixed_t LUA_EvalMath(const char *word)
// make a new state so SOC can't interefere with scripts
// allocate state
if (mL == NULL)
{
mL = lua_newstate(LUA_Alloc, NULL);
lua_atpanic(mL, LUA_Panic);
// open only enum lib
lua_pushcfunction(mL, LUA_EnumLib);
lua_pushboolean(mL, true);
lua_call(mL, 1, 0);
}
createMathLibState();
// change ^ into ^^ for Lua.
strcpy(buf, "return ");
@@ -394,6 +397,9 @@ fixed_t LUA_EvalMath(const char *word)
if (*p == '^')
*b++ = '^';
}
// length of word is zero!?
if (p == word)
return 0;
*b = '\0';
// eval string.
@@ -409,7 +415,7 @@ fixed_t LUA_EvalMath(const char *word)
p += 3; // "1: "
}
CONS_Alert(CONS_WARNING, "%s\n", p);
if (error) *error = p;
}
else
res = lua_tointeger(mL, -1);
@@ -417,6 +423,51 @@ fixed_t LUA_EvalMath(const char *word)
return res;
}
fixed_t LUA_EvalMath(const char *word)
{
const char *error = NULL;
fixed_t res = LUA_EvalMathEx(word, &error);
if (error)
CONS_Alert(CONS_WARNING, "%s\n", error);
return res;
}
// A hack to prevent lua from crashing game if constant doesn't exist
static int lua_get_constant(lua_State *L)
{
lua_pushvalue(mL, LUA_GLOBALSINDEX);
lua_pushvalue(L, 1);
lua_gettable(L, -2);
return 1;
}
fixed_t LUA_GetConstant(const char *word)
{
if (mL == NULL)
createMathLibState();
fixed_t res = 0;
lua_pushcfunction(mL, lua_get_constant);
lua_pushstring(mL, word);
if (lua_pcall(mL, 1, 1, 0) == 0)
{
if (lua_isnumber(mL, -1))
res = lua_tointeger(mL, -1);
}
else
{
// Pop error message
lua_pop(mL, 1);
}
return res;
}
void LUA_InvalidateMathlibCache(const char *name)
{
// No state => no cache => nothing to invalidate :3
@@ -1189,7 +1240,7 @@ static void UnArchiveTables(UINT8 **p, boolean network)
}
}
void LUA_Step(void)
/*void LUA_Step(void)
{
if (!gL)
return;
@@ -1200,7 +1251,7 @@ void LUA_Step(void)
lua_settop(gL, 0);
lua_gc(gL, LUA_GCSTEP, 1);
}
}
}*/
void LUA_Archive(savebuffer_t *save, boolean network)
{
@@ -1212,7 +1263,7 @@ void LUA_Archive(savebuffer_t *save, boolean network)
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] && i > 0) // NEVER skip player 0, this is for dedi servs.
if (!playeringame[i] && i > 0) // NEVER skip player 0, this is for dedi servs.
continue;
// all players in game will be archived, even if they just add a 0.
ArchiveExtVars(&save->p, &players[i], "player");
+11 -4
View File
@@ -10,6 +10,9 @@
/// \file lua_script.h
/// \brief Lua scripting basics
#ifndef LUA_SCRIPT_H
#define LUA_SCRIPT_H
#include "m_fixed.h"
#include "doomtype.h"
#include "d_player.h"
@@ -45,7 +48,9 @@ void LUA_LoadLump(UINT16 wad, UINT16 lump);
#ifdef LUA_ALLOW_BYTECODE
void LUA_DumpFile(const char *filename);
#endif
fixed_t LUA_EvalMathEx(const char *word, const char **error);
fixed_t LUA_EvalMath(const char *word);
fixed_t LUA_GetConstant(const char *word);
// Need better name for this ;-;
void LUA_InvalidateMathlibCache(const char *name);
@@ -55,7 +60,7 @@ void LUA_InvalidateUserdata(void *data);
void LUA_InvalidateLevel(void);
void LUA_InvalidateMapthings(void);
void LUA_InvalidatePlayer(player_t *player);
void LUA_Step(void);
//void LUA_Step(void);
void LUA_Archive(savebuffer_t *save, boolean network);
void LUA_UnArchive(savebuffer_t *save, boolean network);
@@ -75,7 +80,7 @@ void COM_Lua_f(void);
#define LUA_Deprecated(L,this_func,use_instead)\
{\
static UINT8 seen = 0;\
if (!seen) {\
if (UNLIKELY(!seen)) {\
seen = 1;\
CONS_Alert(CONS_WARNING,"\"%s\" is deprecated and will be removed.\nUse \"%s\" instead.\n", this_func, use_instead);\
}\
@@ -84,7 +89,7 @@ void COM_Lua_f(void);
#define LUA_LogDeprecated(L,this_func,use_instead)\
{\
static UINT8 seen = 0;\
if (!seen) {\
if (UNLIKELY(!seen)) {\
seen = 1;\
CON_LogMessage(va("\"%s\" is deprecated and will be removed.\nUse \"%s\" instead.\n", this_func, use_instead));\
}\
@@ -95,8 +100,10 @@ void COM_Lua_f(void);
#define LUA_UsageWarning(L, warningmsg)\
{\
static UINT8 seen = 0;\
if (!seen) {\
if (UNLIKELY(!seen)) {\
seen = 1;\
CONS_Alert(CONS_WARNING,"%s\n", warningmsg);\
}\
}
#endif/*LUA_SCRIPT_H*/
+51 -34
View File
@@ -20,17 +20,17 @@
typedef struct aatree_node_s
{
INT32 level;
INT32 key;
void* value;
INT32 key;
INT32 depth;
void *value;
struct aatree_node_s *left, *right;
} aatree_node_t;
struct aatree_s
{
aatree_node_t *root;
UINT32 flags;
aatree_node_t *root;
UINT32 flags;
};
aatree_t *M_AATreeAlloc(UINT32 flags)
@@ -56,40 +56,48 @@ void M_AATreeFree(aatree_t *aatree)
Z_Free(aatree);
}
static aatree_node_t *M_AATreeSkew(aatree_node_t *node)
static aatree_node_t *M_AATreeRotateRight(aatree_node_t *node)
{
if (node && node->left && node->left->level == node->level)
{
// Not allowed: horizontal left-link. Reverse the
// horizontal link and hook the orphan back in.
aatree_node_t *oldleft = node->left;
node->left = oldleft->right;
oldleft->right = node;
return oldleft;
}
// No change needed.
return node;
aatree_node_t *newnode = node->left;
aatree_node_t *tmp = newnode->right;
newnode->right = node;
node->left = tmp;
return newnode;
}
static aatree_node_t *M_AATreeSplit(aatree_node_t *node)
static aatree_node_t *M_AATreeRotateLeft(aatree_node_t *node)
{
if (node && node->right && node->right->right && node->level == node->right->right->level)
aatree_node_t *newnode = node->right;
aatree_node_t *tmp = newnode->left;
newnode->left = node;
node->right = tmp;
return newnode;
}
static aatree_node_t *M_AATreeRebalance(aatree_node_t *node)
{
INT32 balance;
if (node->left == NULL && node->right == NULL)
return node;
if (node->left == NULL)
balance = -node->right->depth;
else if (node->right == NULL)
balance = node->left->depth;
else
{
// Not allowed: two consecutive horizontal right-links.
// The middle one becomes the new root at this point,
// with suitable adjustments below.
I_Assert(node->left->key < node->right->key);
balance = node->left->depth - node->right->depth;
}
aatree_node_t *oldright = node->right;
node->right = oldright->left;
oldright->left = node;
oldright->level++;
return oldright;
if (balance > 1)
{
return M_AATreeRotateRight(node);
}
else if (balance < -1)
{
return M_AATreeRotateLeft(node);
}
// No change needed.
return node;
}
@@ -99,11 +107,11 @@ static aatree_node_t *M_AATreeSet_Node(aatree_node_t *node, UINT32 flags, INT32
{
// Nothing here, so just add where we are
node = Z_Malloc(sizeof (aatree_node_t), PU_STATIC, NULL);
node->level = 1;
node->key = key;
if (value && (flags & AATREE_ZUSER)) Z_SetUser(value, &node->value);
else node->value = value;
node->left = node->right = NULL;
node->depth = 1;
}
else
{
@@ -117,8 +125,17 @@ static aatree_node_t *M_AATreeSet_Node(aatree_node_t *node, UINT32 flags, INT32
else node->value = value;
}
node = M_AATreeSkew(node);
node = M_AATreeSplit(node);
node = M_AATreeRebalance(node);
if (node->left == NULL && node->right == NULL)
node->depth = 1;
else if (node->left == NULL)
node->depth = node->right->depth + 1;
else if (node->right == NULL)
node->depth = node->left->depth + 1;
else if (node->left->depth > node->right->depth)
node->depth = node->left->depth + 1;
else
node->depth = node->right->depth + 1;
}
return node;
+262
View File
@@ -0,0 +1,262 @@
#include <map>
#include <string>
#include <sstream>
#include <cstring>
#include "m_emotes.h"
extern "C" {
#include "w_wad.h"
#include "z_zone.h"
#include "hu_stuff.h"
#include "v_video.h"
}
consvar_t cv_emotes = {"emotes", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};;
static std::map<std::string, emote_t> emotes;
// TODO - Would be really nice to generalize soc-like file parsing and not reimplement it 100 times :)))))
void M_LoadEmotes(UINT16 wadnum)
{
UINT16 lumpnum = W_CheckNumForNamePwad("EMOTES", wadnum, 0);
if (lumpnum == INT16_MAX)
return;
char *lump = static_cast<char*>(W_CacheLumpNumPwad(wadnum, lumpnum, PU_CACHE));
size_t size = W_LumpLengthPwad(wadnum, lumpnum);
std::istringstream file(std::string(lump, size));
std::string line;
emote_t *emote = nullptr;
std::string emote_name;
// Just smol lambda to remove all the trailing chars we might not want
auto trim = [](std::string &str) {
str.erase(0, str.find_first_not_of(" \t\n\r\f\v"));
str.erase(str.find_last_not_of(" \t\n\r\f\v")+1);
};
int numemotes = 0;
int linenum = 0;
while (std::getline(file, line))
{
++linenum;
trim(line);
if (line.empty())
continue;
size_t split = line.find('=');
// Didn't find the =, means we're about to parse `Emote <name>`
if (split == line.npos)
{
split = line.find(' ');
if (split == line.npos)
{
CONS_Alert(CONS_WARNING, "EMOTES: Unrecognized line. (file %s, line %d)\n", wadfiles[wadnum]->filename, linenum);
continue;
}
if (strnicmp(line.c_str(), "emote", 5))
{
CONS_Alert(CONS_WARNING, "EMOTES: 'Emote' expected. (file %s, line %d)\n", wadfiles[wadnum]->filename, linenum);
continue;
}
emote_name = line.substr(split+1);
if (emote_name.find_first_of(" \t\n\r\f\v:") != emote_name.npos)
{
CONS_Alert(CONS_WARNING, "EMOTES: Emote name cannot contain spaces or ':' symbols. (file %s, line %d)\n", wadfiles[wadnum]->filename, linenum);
continue;
}
if (emote_name.size() > MAXEMOTENAME)
{
CONS_Alert(CONS_WARNING, "EMOTES: Emote name is too long, truncating. (file %s, line %d)\n", wadfiles[wadnum]->filename, linenum);
emote_name = emote_name.substr(0, MAXEMOTENAME);
}
emote = &emotes[emote_name];
strlcpy(emote->name, emote_name.c_str(), MAXEMOTENAME);
emote->timeperframe = 1;
emote->numframes = 0;
std::memset(emote->frames, 0, sizeof(emote->frames));
++numemotes;
}
else if (emote)
{
std::string field = line.substr(0, split);
std::string value = line.substr(split+1);
trim(field);
trim(value);
if (stricmp(field.c_str(), "frames") == 0)
{
UINT8 numframes = 0;
auto copy_frame = [&] {
if (numframes == MAXEMOTEFRAMES)
{
CONS_Alert(CONS_WARNING, "EMOTES: Too many frames. (file %s, line %d)", wadfiles[wadnum]->filename, linenum);
return false;
}
size_t list_split = value.find(',');
std::string framelumpname = value.substr(0, list_split);
trim(framelumpname);
if (list_split == value.npos)
value = "";
else
value = value.substr(list_split+1, value.npos);
// End of list of frames
if (framelumpname.size() == 0)
return false;
if (framelumpname.size() > 8)
{
CONS_Alert(CONS_WARNING, "EMOTES: Frame %d name is too long. (file %s, line %d)", numframes, wadfiles[wadnum]->filename, linenum);
framelumpname = framelumpname.substr(0, 8);
}
std::strncpy(emote->frames[numframes], framelumpname.c_str(), framelumpname.size()+1);
++numframes;
return true;
};
while (copy_frame()) {}
if (numframes == 0)
{
CONS_Alert(CONS_WARNING, "EMOTES: Expected list of frames. (file %s, line %d)", wadfiles[wadnum]->filename, linenum);
}
emote->numframes = numframes;
}
else if (stricmp(field.c_str(), "timeperframe") == 0)
{
emote->timeperframe = std::stoi(value);
if (emote->timeperframe <= 0)
{
emote->timeperframe = 1;
CONS_Alert(CONS_WARNING, "EMOTES: Bad value for 'timeperframe'. (file %s, line %d)", wadfiles[wadnum]->filename, linenum);
}
}
else
{
CONS_Alert(CONS_WARNING, "EMOTES: Unrecognized field '%s'. (file %s, line %d)", field.c_str(), wadfiles[wadnum]->filename, linenum);
}
}
else
{
CONS_Alert(CONS_WARNING, "EMOTES: Unrecognized line. (file %s, line %d)\n", wadfiles[wadnum]->filename, linenum);
}
}
CONS_Printf("Added %d emotes\n", numemotes);
}
void M_InitEmotes(void)
{
UINT16 i;
for (i = 0; i < numwadfiles; i++)
M_LoadEmotes(i);
}
emote_t *M_FindEmote(const char *name, int len, int skip)
{
if (!cv_emotes.value)
return nullptr;
char query[MAXEMOTENAME+1] = {0};
std::strncpy(query, name, std::min(len, MAXEMOTENAME));
for (auto &pair: emotes)
{
if (pair.first.rfind(query, 0, std::min(len, MAXEMOTENAME)) != 0)
continue;
if (skip > 0)
{
--skip;
continue;
}
return &pair.second;
}
return nullptr;
}
emote_t *M_VerifyEmote(const char *name, int *emotelen)
{
if (*name != ':')
return nullptr;
if (!cv_emotes.value)
return nullptr;
const char *p = name+1; // skip ':'
emote_t *match = nullptr;
while (*p && (p - name) < MAXEMOTENAME)
{
if (*p == ':')
{
std::string checkname = std::string(name+1, (p-name)-1);
auto it = emotes.find(checkname);
if (it != emotes.end())
match = &it->second;
break;
}
++p;
}
if (match && emotelen)
*emotelen = p-name+1;
return match;
}
void M_DrawEmote(INT32 x, INT32 y, emote_t *emote, tic_t anim, INT32 flags)
{
if (emote->numframes == 0)
return;
const char *lumpname = emote->frames[(anim/emote->timeperframe) % emote->numframes];
patch_t *emotepatch = (patch_t*)W_CachePatchName(lumpname, PU_CACHE);
const int CHARHEIGHT = 6;
fixed_t scale = FRACUNIT;
x *= FRACUNIT;
y *= FRACUNIT;
if (emotepatch->width > EMOTEWIDTH)
scale = (FRACUNIT/emotepatch->width)*EMOTEWIDTH;
else if (emotepatch->width < EMOTEWIDTH)
x += (EMOTEWIDTH-emotepatch->width)*FRACUNIT/2;
y -= (scale*emotepatch->height-CHARHEIGHT*FRACUNIT)/2;
V_DrawFixedPatch(x, y, scale, flags, emotepatch, NULL);
}
+48
View File
@@ -0,0 +1,48 @@
#ifndef __M_EMOTES__
#define __M_EMOTES__
#ifdef __cplusplus
extern "C" {
#endif
#include "doomdef.h"
#include "command.h"
extern consvar_t cv_emotes;
#define MAXEMOTENAME 32
#define MAXEMOTEFRAMES 32
#define EMOTEWIDTH 6
typedef struct emote_s {
char name[MAXEMOTENAME+1];
char frames[MAXEMOTEFRAMES][9];
UINT8 numframes;
tic_t timeperframe;
} emote_t;
// Reads and adds emotes from EMOTES lump, with syntax similar to soc
void M_LoadEmotes(UINT16 wadnum);
// Load emotes from all base wads
void M_InitEmotes(void);
// Finds first matching emote, ignoring first few matches
emote_t *M_FindEmote(const char *name, int len, int skips);
// If first character is not ':', instantly returns null
// Starts from ':' character, goes until it finds ':' or end of string
// If end of string is found, or closing ':' is found but resulting emote name doesn't exist,
// it returns null, otherwise it returns emote and stores into *emotelen how much characters
// needs to be skipped to get past emote name
emote_t *M_VerifyEmote(const char *name, int *emotelen);
// Draw the emote, anim should be some kind of timer ticking every game tic
// for animated emotes
void M_DrawEmote(INT32 x, INT32 y, emote_t *emote, tic_t anim, INT32 flags);
#ifdef __cplusplus
} // extern "C"
#endif
#endif // __M_EMOTES__
+288 -3596
View File
File diff suppressed because it is too large. Load diff
+2946
View File
File diff suppressed because it is too large. Load diff
+44
View File
@@ -2294,6 +2294,50 @@ void M_MkdirEach(const char *path, int start, int mode)
M_MkdirEachUntil(path, start, -1, mode);
}
// Hashes some message using FNV-1a
#define FNV1A_OFFSET_BASIS 0x811C9DC5
#define FNV1A_PRIME 0x01000193
UINT32 FNV1a_Hash(const char *message, size_t size)
{
UINT32 hash = FNV1A_OFFSET_BASIS;
for (size_t i = 0; i < size; i++)
{
hash ^= message[i];
hash *= FNV1A_PRIME;
}
return hash;
}
UINT32 FNV1a_HashString(const char *message)
{
UINT32 hash = FNV1A_OFFSET_BASIS;
while (*message)
{
hash ^= *message;
hash *= FNV1A_PRIME;
message++;
}
return hash;
}
UINT32 FNV1a_HashLowercaseString(const char *message)
{
UINT32 hash = FNV1A_OFFSET_BASIS;
while (*message)
{
hash ^= tolower(*message);
hash *= FNV1A_PRIME;
message++;
}
return hash;
}
#ifdef __cplusplus
} // extern "C"
+5
View File
@@ -124,6 +124,11 @@ const char * M_Ftrim (double);
// counting bits, for weapon ammo code, usually
FUNCMATH UINT8 M_CountBits(UINT32 num, UINT8 size);
// Hashes some message using FNV-1a
UINT32 FNV1a_Hash(const char *message, size_t size);
UINT32 FNV1a_HashString(const char *message);
UINT32 FNV1a_HashLowercaseString(const char *message);
#include "w_wad.h"
extern char configfile[MAX_WADPATH];
+169 -5
View File
@@ -130,6 +130,82 @@ static void M_TextInputPaste(textinput_t *input)
M_TextInputAddString(input, paste);
}
static void M_TextInputLeft(textinput_t *input, boolean emotes)
{
// Just do it simple way if possible
if (!emotes || input->cursor < 2 || input->buffer[input->cursor-1] != ':')
{
if (input->cursor != 0)
--input->cursor;
return;
}
// Otherwise we need to check if we have to skip emote
size_t start = input->cursor-2;
while (input->buffer[start] != ':')
{
// We reached start of string and didn't find ':' symbol, thats definitely not an emote
// so just do it simple way
if (start == 0)
{
M_TextInputLeft(input, false);
return;
}
--start;
}
int emotelen = 0;
if (M_VerifyEmote(input->buffer+start, &emotelen))
input->cursor -= emotelen; // also skip the :
else
M_TextInputLeft(input, false); // Not a valid emote, do the simple thing
}
static void M_TextInputRight(textinput_t *input, boolean emotes)
{
// Just do it simple way if possible
if (!emotes || input->cursor == input->length || input->buffer[input->cursor] != ':')
{
if (input->cursor < input->length)
++input->cursor;
return;
}
int emotelen = 0;
if (M_VerifyEmote(input->buffer+input->cursor, &emotelen))
input->cursor += emotelen; // Also skip the :
else
M_TextInputRight(input, false); // Not a valid emote, do the simple thing
}
// Check if we're inside a valid emote
static boolean M_TextInputCheckEmote(textinput_t *input)
{
int start = input->cursor;
// Definitely not an emote
if (start == 0)
return false;
// Might be closing :, need to skip it just in case
if (input->buffer[start] == ':')
--start;
while (input->buffer[start] != ':')
{
// No ':' found, definitely not inside emote
if (start == 0)
return false;
--start;
}
// Found what may be emote start, now we can check
return M_VerifyEmote(input->buffer+start, NULL) != NULL;
}
void M_TextInputInit(textinput_t *input, char *buffer, size_t buffer_size)
{
input->buffer = buffer;
@@ -156,7 +232,7 @@ void M_TextInputSetString(textinput_t *input, const char *c)
input->cursor = input->select = input->length = strlen(c);
}
boolean M_TextInputHandle(textinput_t *input, INT32 key)
static boolean M_TextInputHandleBase(textinput_t *input, INT32 key, boolean emotes)
{
if (key == KEY_LSHIFT || key == KEY_RSHIFT
|| key == KEY_LCTRL || key == KEY_RCTRL
@@ -241,16 +317,14 @@ boolean M_TextInputHandle(textinput_t *input, INT32 key)
if (key == KEY_LEFTARROW)
{
if (input->cursor != 0)
--input->cursor;
M_TextInputLeft(input, emotes);
if (!shiftdown)
input->select = input->cursor;
return true;
}
else if (key == KEY_RIGHTARROW)
{
if (input->cursor < input->length)
++input->cursor;
M_TextInputRight(input, emotes);
if (!shiftdown)
input->select = input->cursor;
return true;
@@ -320,6 +394,96 @@ boolean M_TextInputHandle(textinput_t *input, INT32 key)
return true;
}
// Just an alias, more or less
boolean M_TextInputHandle(textinput_t *input, INT32 key)
{
return M_TextInputHandleBase(input, key, false);
}
boolean M_TextInputHandleEmotes(textinput_t *input, INT32 key, emote_t *suggestions[], int maxsuggestions)
{
boolean ret = M_TextInputHandleBase(input, key, true);
// After this handled key we ended up inside an emote, lets fix that
if (M_TextInputCheckEmote(input))
M_TextInputToWordEnd(input, !shiftdown);
// Always clear the first entry
suggestions[0] = NULL;
// For autocomplete
int emotestart = 0;
// Try find suggestions for emote names
for (int i = input->cursor-1; i >= 0 && input->cursor-i <= MAXEMOTENAME; --i)
{
// Space can't be part of emote name
if (isspace(input->buffer[i]))
break;
// Found a :, try suggest emotes
if (input->buffer[i] == ':')
{
emotestart = i+1;
// ...But only if we typed at least something
if ((int)input->cursor-(i-1) < 3)
break;
for (int skip = 0; skip < maxsuggestions; ++skip)
{
suggestions[skip] = M_FindEmote(input->buffer+i+1, input->cursor-i-1, skip);
// No more suggestions
if (!suggestions[skip])
break;
}
// In any case, we found what we wanted, can exit the loop now
break;
}
}
// If we suggest emotes, try autocomplete
if (key == '\t' && suggestions[0])
{
int pos = (input->cursor-emotestart);
boolean autocomplete = true;
while (autocomplete)
{
// Check if current character matches for all suggestions
char c = suggestions[0]->name[pos];
// End of string reached
if (!c)
break;
for (int i = 1; i < maxsuggestions && suggestions[i]; ++i)
{
if (suggestions[i]->name[pos] != c)
{
autocomplete = false;
break;
}
}
++pos;
if (autocomplete)
M_TextInputAddChar(input, c);
}
// This was the only suggestion, finish autocomplete with a ':' and clear suggestions
if (maxsuggestions == 1 || !suggestions[1])
{
M_TextInputAddChar(input, ':');
suggestions[0] = NULL;
}
}
return ret;
}
void M_DrawTextInputScroll(INT32 x, INT32 y, textinput_t *input, INT32 flags, INT32 MAXINPUTWIDTH)
{
if (renderisnewtic)
+5
View File
@@ -2,6 +2,7 @@
#define __M_TEXTINPUT__
#include "doomtype.h"
#include "m_emotes.h" // M_VerifyEmote, M_FindEmote
typedef struct textinput_s {
size_t cursor;
@@ -22,6 +23,10 @@ void M_TextInputSetString(textinput_t *input, const char *c);
boolean M_TextInputHandle(textinput_t *input, INT32 key);
// Does everything same as M_TextInputHandle, but also handles emotes in input string
// If currently typing something that looks like an existing emote, return suggestions for it
boolean M_TextInputHandleEmotes(textinput_t *input, INT32 key, emote_t *suggestions[], int maxsuggestions);
#define M_DrawTextInput(x, y, input, flags) M_DrawTextInputScroll((x), (y), (input), (flags), ((input)->buffer_size-1)*8)
void M_DrawTextInputScroll(INT32 x, INT32 y, textinput_t *input, INT32 flags, INT32 MAXINPUTWIDTH);
+4
View File
@@ -30,7 +30,11 @@ typedef union
typedef struct
{
msg_header_t header;
#ifndef HAVE_IPV6
char ip[16];
#else
char ip[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"];
#endif
char port[8];
char contact[32];
char version[8]; // format is: x.yy.z (like 1.30.2 or 1.31)
+3 -2
View File
@@ -250,7 +250,7 @@ boolean P_Move(mobj_t *actor, fixed_t speed)
I_Assert(movedir < NUMDIRS);
tryx = actor->x + FixedMul(speed*xspeed[movedir], actor->scale);
if (twodlevel || actor->flags2 & MF2_TWOD)
if (UNLIKELY(twodlevel || actor->flags2 & MF2_TWOD))
tryy = actor->y;
else
tryy = actor->y + FixedMul(speed*yspeed[movedir], actor->scale);
@@ -481,6 +481,7 @@ boolean P_LookForPlayers(mobj_t *actor, boolean allaround, boolean tracer, fixed
if (!allaround)
{
an = R_PointToAngle2(actor->x, actor->y, player->mo->x, player->mo->y) - actor->angle;
if (an > ANGLE_90 && an < ANGLE_270)
{
dist = P_AproxDistance(player->mo->x - actor->x, player->mo->y - actor->y);
@@ -4387,7 +4388,7 @@ void A_MouseThink(void *thing)
|| (actor->eflags & MFE_VERTICALFLIP && actor->z + actor->height == actor->ceilingz))
&& !actor->reactiontime)
{
if (twodlevel || actor->flags2 & MF2_TWOD)
if (UNLIKELY(twodlevel || actor->flags2 & MF2_TWOD))
{
if (P_RandomChance(FRACUNIT/2))
actor->angle += ANGLE_180;
+14 -13
View File
@@ -587,7 +587,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
special->momx = special->momy = special->momz = 0;
P_GivePlayerRings(player, 1);
if ((maptol & TOL_NIGHTS) && special->type != MT_FLINGRING)
if (UNLIKELY((maptol & TOL_NIGHTS) && special->type != MT_FLINGRING))
P_DoNightsScore(player);
break;
@@ -599,7 +599,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
special->momx = special->momy = 0;
P_GivePlayerRings(player, 1);
if ((maptol & TOL_NIGHTS) && special->type != MT_FLINGCOIN)
if (UNLIKELY((maptol & TOL_NIGHTS) && special->type != MT_FLINGCOIN))
P_DoNightsScore(player);
break;
case MT_BLUEBALL:
@@ -615,7 +615,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
else
special->scalespeed = 4*FRACUNIT/5;
if (maptol & TOL_NIGHTS)
if (UNLIKELY(maptol & TOL_NIGHTS))
P_DoNightsScore(player);
break;
case MT_AUTOPICKUP:
@@ -832,6 +832,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
if (player->bumpertime < TICRATE/4)
{
S_StartSound(toucher, special->info->seesound);
if (player->pflags & PF_NIGHTSMODE)
{
player->bumpertime = TICRATE/2;
@@ -1226,9 +1227,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck)
return; // SRB2kart - don't need bubbles mucking with the player
if ((player->powers[pw_shield] & SH_NOSTACK) == SH_ELEMENTAL)
return;
if (maptol & TOL_NIGHTS)
if (UNLIKELY(maptol & TOL_NIGHTS))
return;
if (mariomode)
if (UNLIKELY(mariomode))
return;
else if (toucher->eflags & MFE_VERTICALFLIP)
{
@@ -2352,11 +2353,11 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da
if (player->exiting)
return false;
if (!(target->player->pflags & (PF_NIGHTSMODE|PF_NIGHTSFALL)) && (maptol & TOL_NIGHTS))
if (UNLIKELY(!(target->player->pflags & (PF_NIGHTSMODE|PF_NIGHTSFALL)) && (maptol & TOL_NIGHTS)))
return false;
}
if (player->pflags & PF_NIGHTSMODE) // NiGHTS damage handling
if (UNLIKELY(player->pflags & PF_NIGHTSMODE)) // NiGHTS damage handling
{
if (!force)
{
@@ -2601,7 +2602,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
ns = FixedMul(((i*FRACUNIT)/16)+2*FRACUNIT, mo->scale);
mo->momx = FixedMul(FINECOSINE(fa),ns);
if (!(twodlevel || (player->mo->flags2 & MF2_TWOD)))
if (LIKELY(!(twodlevel || (player->mo->flags2 & MF2_TWOD))))
mo->momy = FixedMul(FINESINE(fa),ns);
P_SetObjectMomZ(mo, 8*FRACUNIT, false);
@@ -2625,7 +2626,7 @@ void P_PlayerRingBurst(player_t *player, INT32 num_rings)
ns = FixedMul(momxy, mo->scale);
mo->momx = FixedMul(FINECOSINE(fa),ns);
if (!(twodlevel || (player->mo->flags2 & MF2_TWOD)))
if (LIKELY(!(twodlevel || (player->mo->flags2 & MF2_TWOD))))
mo->momy = FixedMul(FINESINE(fa),ns);
ns = momz;
@@ -2732,7 +2733,7 @@ void P_PlayerWeaponPanelBurst(player_t *player)
ns = FixedMul(3*FRACUNIT, mo->scale);
mo->momx = FixedMul(FINECOSINE(fa),ns);
if (!(twodlevel || (player->mo->flags2 & MF2_TWOD)))
if (LIKELY(!(twodlevel || (player->mo->flags2 & MF2_TWOD))))
mo->momy = FixedMul(FINESINE(fa),ns);
P_SetObjectMomZ(mo, 4*FRACUNIT, false);
@@ -2816,7 +2817,7 @@ void P_PlayerWeaponAmmoBurst(player_t *player)
ns = FixedMul(2*FRACUNIT, mo->scale);
mo->momx = FixedMul(FINECOSINE(fa), ns);
if (!(twodlevel || (player->mo->flags2 & MF2_TWOD)))
if (LIKELY(!(twodlevel || (player->mo->flags2 & MF2_TWOD))))
mo->momy = FixedMul(FINESINE(fa),ns);
P_SetObjectMomZ(mo, 3*FRACUNIT, false);
@@ -2932,7 +2933,7 @@ void P_PlayerEmeraldBurst(player_t *player, boolean toss)
momx = FixedMul(FINECOSINE(fa), ns);
if (!(twodlevel || (player->mo->flags2 & MF2_TWOD)))
if (LIKELY(!(twodlevel || (player->mo->flags2 & MF2_TWOD))))
momy = FixedMul(FINESINE(fa),ns);
else
momy = 0;
@@ -2989,7 +2990,7 @@ void P_PlayerFlagBurst(player_t *player, boolean toss)
{
angle_t fa = P_RandomByte()*FINEANGLES/256;
flag->momx = FixedMul(FINECOSINE(fa), FixedMul(6*FRACUNIT, player->mo->scale));
if (!(twodlevel || (player->mo->flags2 & MF2_TWOD)))
if (LIKELY(!(twodlevel || (player->mo->flags2 & MF2_TWOD))))
flag->momy = FixedMul(FINESINE(fa), FixedMul(6*FRACUNIT, player->mo->scale));
}
+9 -9
View File
@@ -140,7 +140,7 @@ boolean P_DoSpring(mobj_t *spring, mobj_t *object)
if (object->player && object->player->spectator)
return false;
if (object->player && (object->player->pflags & PF_NIGHTSMODE))
if (UNLIKELY(object->player && (object->player->pflags & PF_NIGHTSMODE)))
{
/*Someone want to make these work like bumpers?*/
return false;
@@ -335,7 +335,7 @@ static boolean PIT_CheckThing(mobj_t *thing)
#ifdef SEENAMES
// Do name checks all the way up here
// So that NOTHING ELSE can see MT_NAMECHECK because it is client-side.
if (tmthing->type == MT_NAMECHECK)
if (UNLIKELY(tmthing->type == MT_NAMECHECK))
{
// Ignore things that aren't players, ignore spectators, ignore yourself.
// (also don't bother to check that tmthing->target->player is non-NULL because we're not actually using it here.)
@@ -361,8 +361,8 @@ static boolean PIT_CheckThing(mobj_t *thing)
return true;
// Don't collide with your buddies while NiGHTS-flying.
if (tmthing->player && thing->player && (maptol & TOL_NIGHTS)
&& ((tmthing->player->pflags & PF_NIGHTSMODE) || (thing->player->pflags & PF_NIGHTSMODE)))
if (UNLIKELY(tmthing->player && thing->player && (maptol & TOL_NIGHTS)
&& ((tmthing->player->pflags & PF_NIGHTSMODE) || (thing->player->pflags & PF_NIGHTSMODE))))
return true;
blockdist = thing->radius + tmthing->radius;
@@ -2004,7 +2004,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
mapcampointer = thiscam;
if (GETSECSPECIAL(newsec->special, 4) == 12)
if (UNLIKELY(GETSECSPECIAL(newsec->special, 4) == 12))
{ // Camera noclip on entire sector.
tmfloorz = tmdropoffz = thiscam->z;
tmceilingz = tmdrpoffceilz = thiscam->z + thiscam->height;
@@ -2045,10 +2045,10 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || UNLIKELY(GETSECSPECIAL(rover->master->frontsector->special, 4) == 12))
continue;
topheight = P_CameraGetFOFTopZ(thiscam, newsec, rover, x, y, NULL);
topheight = P_CameraGetFOFTopZ(thiscam, newsec, rover, x, y, NULL);
bottomheight = P_CameraGetFOFBottomZ(thiscam, newsec, rover, x, y, NULL);
delta1 = thiscam->z - (bottomheight
@@ -2120,7 +2120,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam)
// We're inside it! Yess...
polysec = po->lines[0]->backsector;
if (GETSECSPECIAL(polysec->special, 4) == 12)
if (UNLIKELY(GETSECSPECIAL(polysec->special, 4) == 12))
{ // Camera noclip polyobj.
plink = (polymaplink_t *)(plink->link.next);
continue;
@@ -3183,7 +3183,7 @@ stairstep:
P_HitSlideLine(bestslideline); // clip the moves
if ((twodlevel || (mo->flags2 & MF2_TWOD)) && mo->player)
if (UNLIKELY((twodlevel || (mo->flags2 & MF2_TWOD)) && mo->player))
{
mo->momx = tmxmove;
tmymove = 0;
+2 -2
View File
@@ -366,7 +366,7 @@ void P_CameraLineOpening(line_t *linedef)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || UNLIKELY(GETSECSPECIAL(rover->master->frontsector->special, 4) == 12))
continue;
topheight = P_CameraGetFOFTopZ(mapcampointer, front, rover, tmx, tmy, linedef);
@@ -394,7 +394,7 @@ void P_CameraLineOpening(line_t *linedef)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_RENDERALL) || !(rover->flags & FF_EXISTS) || UNLIKELY(GETSECSPECIAL(rover->master->frontsector->special, 4) == 12))
continue;
topheight = P_CameraGetFOFTopZ(mapcampointer, back, rover, tmx, tmy, linedef);
+56 -44
View File
@@ -371,7 +371,7 @@ static boolean P_SetPrecipMobjState(precipmobj_t *mobj, statenum_t state)
//
boolean P_WeaponOrPanel(mobjtype_t type)
{
if (type >= MT_BOUNCERING && type <= MT_GRENADEPICKUP)
if (UNLIKELY(type >= MT_BOUNCERING && type <= MT_GRENADEPICKUP)) // doubt those get used at all in kart tbh
return true;
return false;
@@ -461,6 +461,7 @@ void P_ExplodeMissile(mobj_t *mo)
boolean P_InsideANonSolidFFloor(mobj_t *mobj, ffloor_t *rover)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_EXISTS))
return false;
@@ -891,7 +892,7 @@ static void P_PlayerFlip(mobj_t *mo)
G_GhostAddFlip((INT32) (mo->player - players));
// Flip aiming to match!
if (mo->player->pflags & PF_NIGHTSMODE) // NiGHTS doesn't use flipcam
if (UNLIKELY(mo->player->pflags & PF_NIGHTSMODE)) // NiGHTS doesn't use flipcam
{
if (mo->tracer)
mo->tracer->eflags ^= MFE_VERTICALFLIP;
@@ -989,7 +990,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo)
//|| (mo->player->charability == CA_FLY && (mo->player->powers[pw_tailsfly]
// || (mo->state >= &states[S_PLAY_SPC1] && mo->state <= &states[S_PLAY_SPC4]))))
// gravityadd = gravityadd/3; // less gravity while flying/gliding
if (mo->player->climbing || (mo->player->pflags & PF_NIGHTSMODE))
if (UNLIKELY(mo->player->climbing || (mo->player->pflags & PF_NIGHTSMODE)))
return 0;
if (!(mo->flags2 & MF2_OBJECTFLIP) != !(mo->player->powers[pw_gravityboots])) // negated to turn numeric into bool - would be double negated, but not needed if both would be
@@ -1607,7 +1608,7 @@ void P_XYMovement(mobj_t *mo)
// Check the gravity status.
P_CheckGravity(mo, false);
if (player && !moved && player->pflags & PF_NIGHTSMODE && mo->target)
if (UNLIKELY(player && !moved && player->pflags & PF_NIGHTSMODE && mo->target))
{
angle_t fa;
@@ -1652,7 +1653,7 @@ void P_XYMovement(mobj_t *mo)
if (player && player->homing) // no friction for homing
return;
if (player && player->pflags & PF_NIGHTSMODE)
if (UNLIKELY(player && player->pflags & PF_NIGHTSMODE))
return; // no friction for NiGHTS players
if ((mo->type == MT_BIGTUMBLEWEED || mo->type == MT_LITTLETUMBLEWEED)
@@ -1735,9 +1736,6 @@ static void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motyp
if (!(rover->flags & FF_EXISTS))
continue;
topheight = P_GetFOFTopZ(mo, sector, rover, mo->x, mo->y, NULL);
bottomheight = P_GetFOFBottomZ(mo, sector, rover, mo->x, mo->y, NULL);
if (mo->player && P_CheckSolidLava(mo, rover)) // only the player should be affected
;
else if (motype != 0 && rover->flags & FF_SWIMMABLE) // "scenery" only
@@ -1747,6 +1745,10 @@ static void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motyp
else if (!((rover->flags & FF_BLOCKPLAYER && mo->player) // solid to players?
|| (rover->flags & FF_BLOCKOTHERS && !mo->player))) // solid to others?
continue;
topheight = P_GetFOFTopZ(mo, sector, rover, mo->x, mo->y, NULL);
bottomheight = P_GetFOFBottomZ(mo, sector, rover, mo->x, mo->y, NULL);
if (rover->flags & FF_QUICKSAND)
{
switch (motype)
@@ -1770,6 +1772,7 @@ static void P_AdjustMobjFloorZ_FFloors(mobj_t *mo, sector_t *sector, UINT8 motyp
delta1 = mo->z - (bottomheight + ((topheight - bottomheight)/2));
delta2 = thingtop - (bottomheight + ((topheight - bottomheight)/2));
if (topheight > mo->floorz && abs(delta1) < abs(delta2)
&& !(rover->flags & FF_REVERSEPLATFORM)
&& ((P_MobjFlip(mo)*mo->momz >= 0) || (!(rover->flags & FF_PLATFORM)))) // In reverse gravity, only clip for FOFs that are intangible from their bottom (the "top" you're falling through) if you're coming from above ("below" in your frame of reference)
@@ -1803,7 +1806,7 @@ static void P_AdjustMobjFloorZ_PolyObjs(mobj_t *mo, subsector_t *subsec)
thingtop = mo->z + mo->height;
while(po)
while (po)
{
if (!P_MobjInsidePolyobj(po, mo) || !(po->flags & POF_SOLID))
{
@@ -1855,6 +1858,7 @@ static void P_RingZMovement(mobj_t *mo)
mo->momz += mo->pmomz;
mo->eflags &= ~MFE_APPLYPMOMZ;
}
mo->z += mo->momz;
// clip movement
@@ -1925,6 +1929,7 @@ static boolean P_ZMovement(mobj_t *mo)
mo->momz += mo->pmomz;
mo->eflags &= ~MFE_APPLYPMOMZ;
}
mo->z += mo->momz;
if (mo->standingslope)
@@ -2209,7 +2214,7 @@ static boolean P_ZMovement(mobj_t *mo)
|| mo->type == MT_CANNONBALLDECOR
|| mo->type == MT_FALLINGROCK)
{
if (maptol & TOL_NIGHTS)
if (UNLIKELY(maptol & TOL_NIGHTS))
mom.z = -FixedDiv(mom.z, 10*FRACUNIT);
else
mom.z = -FixedMul(mom.z, FixedDiv(17*FRACUNIT,20*FRACUNIT));
@@ -2349,9 +2354,9 @@ static boolean P_ZMovement(mobj_t *mo)
mo->momz = -mo->momz;
else
// Flags bounce
if (mo->type == MT_REDFLAG || mo->type == MT_BLUEFLAG)
if (UNLIKELY(mo->type == MT_REDFLAG || mo->type == MT_BLUEFLAG))
{
if (maptol & TOL_NIGHTS)
if (UNLIKELY(maptol & TOL_NIGHTS))
mo->momz = -FixedDiv(mo->momz, 10*FRACUNIT);
else
mo->momz = -FixedMul(mo->momz, FixedDiv(17*FRACUNIT,20*FRACUNIT));
@@ -2418,7 +2423,7 @@ static void P_PlayerZMovement(mobj_t *mo)
else
mo->z = mo->floorz;
if (mo->player->pflags & PF_NIGHTSMODE)
if (UNLIKELY(mo->player->pflags & PF_NIGHTSMODE))
{
// bounce off floor if you were flying towards it
if ((mo->eflags & MFE_VERTICALFLIP && mo->player->flyangle > 0 && mo->player->flyangle < 180)
@@ -2608,7 +2613,7 @@ nightsdone:
else
mo->z = mo->ceilingz - mo->height;
if (mo->player->pflags & PF_NIGHTSMODE)
if (UNLIKELY(mo->player->pflags & PF_NIGHTSMODE))
{
// bounce off ceiling if you were flying towards it
if ((mo->eflags & MFE_VERTICALFLIP && mo->player->flyangle > 180 && mo->player->flyangle <= 359)
@@ -2653,7 +2658,7 @@ nightsdone:
}
// hit the ceiling
if (mariomode)
if (UNLIKELY(mariomode))
S_StartSound(mo, sfx_mario1);
if (!mo->player->climbing)
@@ -3114,8 +3119,6 @@ static boolean P_CameraCheckHeat(camera_t *thiscam)
if (!thiscam || !thiscam->subsector)
return false;
halfheight = thiscam->z + (thiscam->height >> 1);
// see if we are in water
sector = thiscam->subsector->sector;
@@ -3126,6 +3129,8 @@ static boolean P_CameraCheckHeat(camera_t *thiscam)
{
ffloor_t *rover;
halfheight = thiscam->z + (thiscam->height >> 1);
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
@@ -3152,8 +3157,6 @@ static boolean P_CameraCheckWater(camera_t *thiscam)
if (!thiscam || !thiscam->subsector)
return false;
halfheight = thiscam->z + (thiscam->height >> 1);
// see if we are in water
sector = thiscam->subsector->sector;
@@ -3161,6 +3164,8 @@ static boolean P_CameraCheckWater(camera_t *thiscam)
{
ffloor_t *rover;
halfheight = thiscam->z + (thiscam->height >> 1);
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_SWIMMABLE) || rover->flags & FF_BLOCKOTHERS)
@@ -3489,15 +3494,18 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
}
else
{
if (!(mobj->player->pflags & PF_NIGHTSMODE)) // "jumping" is used for drilling
if (LIKELY(!(mobj->player->pflags & PF_NIGHTSMODE))) // "jumping" is used for drilling
mobj->player->jumping = 0;
mobj->player->pflags &= ~PF_JUMPED;
if (mobj->player->secondjump || mobj->player->powers[pw_tailsfly])
{
mobj->player->secondjump = 0;
mobj->player->powers[pw_tailsfly] = 0;
P_SetPlayerMobjState(mobj, S_KART_WALK1); // SRB2kart - was S_PLAY_RUN1
}
mobj->eflags &= ~MFE_JUSTHITFLOOR;
}
@@ -4185,7 +4193,7 @@ static void P_Boss3Thinker(mobj_t *mobj)
// Move Boss4's sectors by delta.
static boolean P_Boss4MoveCage(fixed_t delta)
{
const UINT16 tag = 65534;
static const UINT16 tag = 65534;
INT32 snum;
sector_t *sector;
for (snum = sectors[tag%numsectors].firsttag; snum != -1; snum = sector->nexttag)
@@ -4234,7 +4242,7 @@ static void P_Boss4PinchSpikeballs(mobj_t *mobj, angle_t angle, fixed_t fz)
// Destroy cage FOFs.
static void P_Boss4DestroyCage(void)
{
const UINT16 tag = 65534;
static const UINT16 tag = 65534;
INT32 snum, next;
size_t a;
sector_t *sector, *rsec;
@@ -5403,8 +5411,6 @@ static void P_GimmeAxisXYPos(mobj_t *closestaxis, degenmobj_t *mobj)
static void P_MoveHoop(mobj_t *mobj)
{
const fixed_t fuse = (mobj->fuse*mobj->extravalue2);
const angle_t fa = mobj->movedir*(FINEANGLES/mobj->extravalue1);
TVector v;
TVector *res;
fixed_t finalx, finaly, finalz;
@@ -5414,6 +5420,9 @@ static void P_MoveHoop(mobj_t *mobj)
if (!mobj->target) /// \todo DEBUG ME! Target was P_RemoveMobj'd at some point, and therefore no longer valid!
return;
const fixed_t fuse = (mobj->fuse*mobj->extravalue2);
const angle_t fa = mobj->movedir*(FINEANGLES/mobj->extravalue1);
x = mobj->target->x;
y = mobj->target->y;
z = mobj->target->z+mobj->target->height/2;
@@ -6955,7 +6964,7 @@ static boolean P_MobjDeadThink(mobj_t *mobj)
if (mobj->flags2 & MF2_AMBUSH)
{
mobj->colorized = true;
mobj->color = (1 + (leveltime % (MAXSKINCOLORS-1)));
mobj->color = K_RainbowColor();
mobj->frame |= FF_FULLBRIGHT;
}
else
@@ -7797,7 +7806,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
P_SetScale(mobj, (mobj->destscale = mobj->target->scale));
if (mobj->target->player->kartstuff[k_driftcharge] >= K_GetKartDriftSparkValue(mobj->target->player)*4)
mobj->color = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
mobj->color = K_RainbowColor();
else if (mobj->target->player->kartstuff[k_driftcharge] >= K_GetKartDriftSparkValue(mobj->target->player)*2)
mobj->color = SKINCOLOR_KETCHUP;
else if (mobj->target->player->kartstuff[k_driftcharge] >= K_GetKartDriftSparkValue(mobj->target->player))
@@ -8496,7 +8505,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
if (mobj->flags2 & MF2_AMBUSH)
{
mobj->colorized = true;
mobj->color = (1 + (leveltime % (MAXSKINCOLORS-1)));
mobj->color = K_RainbowColor();
mobj->frame |= FF_FULLBRIGHT;
}
else
@@ -8967,7 +8976,7 @@ void P_MobjThinker(mobj_t *mobj)
I_Assert(mobj != NULL);
I_Assert(!P_MobjWasRemoved(mobj));
if (mobj->flags & MF_NOTHINK)
if (UNLIKELY(mobj->flags & MF_NOTHINK))
return;
// Remove dead target/tracer.
@@ -8986,11 +8995,12 @@ void P_MobjThinker(mobj_t *mobj)
tmfloorthing = tmhitthing = NULL;
const sector_t *sec1 = mobj->subsector ? mobj->subsector->sector : NULL;
// 970 allows ANY mobj to trigger a linedef exec
if (UNLIKELY(!mobj->islocal && sec1 && GETSECSPECIAL(sec1->special, 2) == 8)) // BEWARE: islocal does not exist in vanilla
{
sector_t *sec2;
sec2 = P_ThingOnSpecial3DFloor(mobj);
if (sec2 && GETSECSPECIAL(sec2->special, 2) == 1)
P_LinedefExecute(sec2->tag, mobj, sec2);
@@ -9054,7 +9064,7 @@ void P_MobjThinker(mobj_t *mobj)
if (mobj->flags2 & MF2_FIRING && mobj->target && mobj->health > 0)
P_FiringThink(mobj);
if (mobj->flags & MF_AMBIENT)
if (UNLIKELY(mobj->flags & MF_AMBIENT))
{
if (leveltime % mobj->health)
return;
@@ -9104,7 +9114,7 @@ void P_MobjThinker(mobj_t *mobj)
|| mobj->type == MT_FLINGEMERALD
|| mobj->type == MT_BIGTUMBLEWEED
|| mobj->type == MT_LITTLETUMBLEWEED
|| mobj->type == MT_CANNONBALLDECOR
|| mobj->type == MT_CANNONBALLDECOR)
|| mobj->type == MT_FALLINGROCK)
{
P_TryMove(mobj, mobj->x, mobj->y, true); // Sets mo->standingslope correctly
@@ -9195,6 +9205,9 @@ void P_PushableThinker(mobj_t *mobj)
I_Assert(mobj != NULL);
I_Assert(!P_MobjWasRemoved(mobj));
if (!mobj)
return;
sec = mobj->subsector->sector;
if (GETSECSPECIAL(sec->special, 2) == 1 && mobj->z == sec->floorheight)
@@ -9211,9 +9224,6 @@ void P_PushableThinker(mobj_t *mobj)
if (mobj->flags & MF_PUSHABLE && !(mobj->momx || mobj->momy))
P_TryMove(mobj, mobj->x, mobj->y, true);
if (!mobj)
return;
if (mobj->fuse == 1) // it would explode in the MobjThinker code
{
mobj_t *spawnmo;
@@ -9982,6 +9992,7 @@ static precipmobj_t *P_SpawnPrecipMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype
else
{
const INT32 special = GETSECSPECIAL(mobj->subsector->sector->special, 1);
if (special == 7 || special == 6 || mobj->subsector->sector->floorpic == skyflatnum)
mobj->precipflags |= PCF_PIT;
}
@@ -10313,9 +10324,11 @@ void P_PrecipitationEffects(void)
P_SpawnLightningFlash(ss); // Spawn a quick flash thinker
}
const mobj_t *pmo = players[displayplayers[0]].mo;
// Local effects from here on out!
// If we're not in game fully yet, we don't worry about them.
if (!playeringame[displayplayers[0]] || !players[displayplayers[0]].mo)
if (!playeringame[displayplayers[0]] || !pmo)
return;
if (sound_disabled)
@@ -10324,7 +10337,7 @@ void P_PrecipitationEffects(void)
if (!sounds_rain && !sounds_thunder)
return; // no need to calculate volume at ALL
if (players[displayplayers[0]].mo->subsector->sector->ceilingpic == skyflatnum)
if (pmo->subsector->sector->ceilingpic == skyflatnum)
volume = 255; // Sky above? We get it full blast.
else
{
@@ -10335,7 +10348,7 @@ void P_PrecipitationEffects(void)
// Essentially check in a 1024 unit radius of the player for an outdoor area.
#define RADIUSSTEP (64*FRACUNIT)
#define SEARCHRADIUS (16*RADIUSSTEP)
yl = yh = players[displayplayers[0]].mo->y;
yl = yh = pmo->y;
yl -= SEARCHRADIUS;
while (yl < INT32_MIN)
yl += RADIUSSTEP;
@@ -10343,7 +10356,7 @@ void P_PrecipitationEffects(void)
while (yh > INT32_MAX)
yh -= RADIUSSTEP;
xl = xh = players[displayplayers[0]].mo->x;
xl = xh = pmo->x;
xl -= SEARCHRADIUS;
while (xl < INT32_MIN)
xl += RADIUSSTEP;
@@ -10359,20 +10372,19 @@ void P_PrecipitationEffects(void)
if (R_PointInSubsectorFast((fixed_t)x, (fixed_t)y)->sector->ceilingpic != skyflatnum) // Found the outdoors!
continue;
newdist = S_CalculateSoundDistance(players[displayplayers[0]].mo->x, players[displayplayers[0]].mo->y, 0, (fixed_t)x, (fixed_t)y, 0);
newdist = S_CalculateSoundDistance(pmo->x, pmo->y, 0, (fixed_t)x, (fixed_t)y, 0);
if (newdist < closedist)
closedist = newdist;
}
volume = 255 - (closedist>>(FRACBITS+2));
volume = CLAMP(volume, 0, 255);
}
#undef RADIUSSTEP
volume = CLAMP(volume, 0, 255);
if (sounds_rain)
S_StartSoundAtVolume(players[displayplayers[0]].mo, sfx_rainin, volume);
S_StartSoundAtVolume(pmo, sfx_rainin, volume);
if (!sounds_thunder)
return;
@@ -10380,7 +10392,7 @@ void P_PrecipitationEffects(void)
if (effects_lightning && lightningStrike && volume)
{
// Large, close thunder sounds to go with our lightning.
S_StartSoundAtVolume(players[displayplayers[0]].mo, sfx_litng1 + M_RandomKey(4), volume);
S_StartSoundAtVolume(pmo, sfx_litng1 + M_RandomKey(4), volume);
}
else if (thunderchance < 20)
{
@@ -10388,7 +10400,7 @@ void P_PrecipitationEffects(void)
if (volume < 80)
volume = 80;
S_StartSoundAtVolume(players[displayplayers[0]].mo, sfx_athun1 + M_RandomKey(2), volume);
S_StartSoundAtVolume(pmo, sfx_athun1 + M_RandomKey(2), volume);
}
}
+36 -34
View File
@@ -34,6 +34,7 @@
#include "r_fps.h" // R_ResetViewInterpolation in level load
#include "s_sound.h"
#include "m_emotes.h"
#include "st_stuff.h"
#include "w_wad.h"
#include "z_zone.h"
@@ -411,7 +412,7 @@ static inline float P_SegLengthFloat(seg_t *seg)
dx = FIXED_TO_FLOAT(seg->v2->x - seg->v1->x);
dy = FIXED_TO_FLOAT(seg->v2->y - seg->v1->y);
return (float)hypot(dx, dy);
return hypotf(dx, dy);
}
#endif
@@ -649,6 +650,27 @@ size_t P_PrecacheLevelFlats(void)
return flatmem;
}
// check if our flat contains cyan pixels
// not sure if this is the best way to do it but it works
static void P_CheckCyanFlat(levelflat_t *levelflat)
{
// only need this for software
if (rendermode != render_soft)
return;
const UINT8 *flat = R_GetFlat(levelflat->lumpnum);
const size_t size = W_LumpLength(levelflat->lumpnum);
for (size_t steppy = 0; steppy < size; steppy++)
{
if (flat[steppy] == TRANSPARENTPIXEL)
{
levelflat->cyan = true;
break;
}
}
}
// help function for P_LoadSectors, find a flat in the active wad files,
// allocate an id for it, and set the levelflat (to speedup search)
//
@@ -660,7 +682,7 @@ INT32 P_AddLevelFlat(const char *flatname, levelflat_t *levelflat)
// first scan through the already found flats
//
for (i = 0; i < numlevelflats; i++, levelflat++)
if (strnicmp(levelflat->name,flatname,8) == 0)
if (strnicmp(levelflat->name, flatname, 8) == 0)
break;
// that flat was already found in the level, return the id
@@ -674,20 +696,7 @@ INT32 P_AddLevelFlat(const char *flatname, levelflat_t *levelflat)
levelflat->lumpnum = R_GetFlatNumForName(flatname);
levelflat->baselumpnum = LUMPERROR;
// check if our flat contains cyan pixels
// not sure if this is the best way to do it but it works
{
const UINT8 *flat = (UINT8 *)W_CacheLumpNum(levelflat->lumpnum, PU_LEVEL);
size_t size = W_LumpLength(levelflat->lumpnum);
for (size_t steppy = 0; steppy < size; steppy++)
{
if (flat[steppy] == TRANSPARENTPIXEL)
{
levelflat->cyan = true;
break;
}
}
}
P_CheckCyanFlat(levelflat);
#ifndef ZDEBUG
CONS_Debug(DBG_SETUP, "flat #%03d: %s\n", atoi(sizeu1(numlevelflats)), levelflat->name);
@@ -734,20 +743,7 @@ INT32 P_AddLevelFlatRuntime(const char *flatname)
levelflat->lumpnum = R_GetFlatNumForName(flatname);
levelflat->baselumpnum = LUMPERROR;
// check if our flat contains cyan pixels
// not sure if this is the best way to do it but it works
{
const UINT8 *flat = (UINT8 *)W_CacheLumpNum(levelflat->lumpnum, PU_LEVEL);
size_t size = W_LumpLength(levelflat->lumpnum);
for (size_t steppy = 0; steppy < size; steppy++)
{
if (flat[steppy] == TRANSPARENTPIXEL)
{
levelflat->cyan = true;
break;
}
}
}
P_CheckCyanFlat(levelflat);
#ifndef ZDEBUG
CONS_Debug(DBG_SETUP, "flat #%03d: %s\n", atoi(sizeu1(numlevelflats)), levelflat->name);
@@ -2572,6 +2568,7 @@ static void P_InitMinimapInfo(void)
lumpnum_t lumpnum;
fixed_t a;
fixed_t b;
node_t *bsp = &nodes[numnodes-1];
minimapinfo.minimap_pic = NULL;
@@ -3008,9 +3005,8 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate)
#ifdef HWRENDER // not win32 only 19990829 by Kin
if (rendermode == render_opengl)
{
HWR_FreeExtraSubsectors();
// Create plane polygons.
HWR_LoadLevel(reloadinggamestate);
HWR_LoadLevel();
}
#endif
@@ -3071,7 +3067,7 @@ boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate)
if (!fromnetsave) // uglier hack
{ // to make a newly loaded level start on the second frame.
INT32 buf = gametic % TICQUEUE;
INT32 buf = gametic % BACKUPTICS;
for (i = 0; i < MAXPLAYERS; i++)
{
@@ -3337,6 +3333,11 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
//
S_LoadMusicDefs(wadnum);
//
// look for emotes
//
M_LoadEmotes(wadnum);
// TODO: Experimental SPRTINFO support, test first
R_LoadSpriteInfoLumps(wadnum, wadfiles[wadnum]->numlumps);
@@ -3347,7 +3348,8 @@ UINT16 P_PartialAddWadFile(const char *wadfilename, boolean local)
// Only exists to make sure there's no way to overwrite partadd_stage externally
// unless you really push yourself.
SINT8 P_PartialAddGetStage(void) {
SINT8 P_PartialAddGetStage(void)
{
return partadd_stage;
}
+1 -1
View File
@@ -68,7 +68,7 @@ void P_SetupLevelSky(INT32 skynum, boolean global);
boolean P_SetupLevel(boolean fromnetsave, boolean reloadinggamestate);
#ifdef HWRENDER
void HWR_LoadLevel(boolean reloadinggamestate);
void HWR_LoadLevel(void);
#endif
boolean P_AddWadFile(const char *wadfilename, boolean local);
+3 -3
View File
@@ -3913,7 +3913,7 @@ DoneSection2:
player->kartstuff[k_lapanimation] = 80;
if (player->pflags & PF_NIGHTSMODE)
if (UNLIKELY(player->pflags & PF_NIGHTSMODE))
player->drillmeter += 48*20;
if (netgame && player->laps >= (UINT8)cv_numlaps.value)
@@ -7103,7 +7103,7 @@ static inline boolean PIT_PushThing(mobj_t *thing)
return false;
// Allow this to affect pushable objects at some point?
if (thing->player && (!(thing->flags & (MF_NOGRAVITY | MF_NOCLIP)) || thing->player->pflags & PF_NIGHTSMODE))
if (thing->player && (!(thing->flags & (MF_NOGRAVITY | MF_NOCLIP)) || UNLIKELY(thing->player->pflags & PF_NIGHTSMODE)))
{
INT32 dist;
INT32 speed;
@@ -7134,7 +7134,7 @@ static inline boolean PIT_PushThing(mobj_t *thing)
// Written with bits and pieces of P_HomingAttack
if ((speed > 0) && (P_CheckSight(thing, tmpusher->source)))
{
if (!(thing->player->pflags & PF_NIGHTSMODE))
if (LIKELY(!(thing->player->pflags & PF_NIGHTSMODE)))
{
// only push wrt Z if health & 1 (mapthing has ambush flag)
if (tmpusher->source->health & 1)
+47 -27
View File
@@ -190,7 +190,7 @@ void Command_CountMobjs_f(void)
void P_InitThinkers(void)
{
thinkercap.prev = thinkercap.next = &thinkercap;
precipcap.prev = precipcap.next = &precipcap;
precipcap.prev = precipcap.next = &precipcap;
waypointcap = NULL;
}
@@ -461,6 +461,9 @@ static inline void P_RunThinkers(void)
}
}
// Controller rumble!
// this keeps track of a bunch of things
// and makes your controller rumble accordingly
static void P_DeviceRumbleTick(void)
{
UINT8 i;
@@ -472,27 +475,31 @@ static void P_DeviceRumbleTick(void)
for (i = 0; i <= splitscreen; i++)
{
UINT16 low = 0;
UINT16 high = 0;
if (!cv_usejoystick[i].value || !cv_rumble[i].value)
{
continue;
}
player_t *player = ((i == 0) ? &players[consoleplayer] : &players[displayplayers[i]]);
if (player->spectator || !player->mo)
{
continue;
}
if (camera[i].freecam)
{
continue;
}
if (player->exiting)
UINT16 low = 0, high = 0;
UINT16 lenght = 57; // in ms
const player_t *player = ((i == 0) ? &players[consoleplayer] : &players[displayplayers[i]]);
// allow lua to do some crap for spectators
if (player->spectator || !player->mo)
{
continue;
}
// reset the rumble if you exit or are ded lel
if (player->exiting ||
player->playerstate == PST_DEAD ||
player->kartstuff[k_respawn] > 1)
{
G_PlayerDeviceRumble(i, low, high, 0);
continue;
@@ -501,15 +508,17 @@ static void P_DeviceRumbleTick(void)
if (player->kartstuff[k_spinouttimer])
{
//low = high = FRACUNIT / 6;
low = high = FixedMul((FRACUNIT / 4), (FixedDiv(player->kartstuff[k_spinouttimer], (3*TICRATE / 2))));
low = high = FixedMul((FRACUNIT / 4), (FixedDiv(player->kartstuff[k_spinouttimer], (3*TICRATE / 2)))); // try do some some kinda fadeout
}
else if (player->kartstuff[k_sneakertimer] > (sneakertime-(TICRATE/2)))
{
low = high = FRACUNIT / 8;
}
else if ((player->kartstuff[k_offroad])
&& P_IsObjectOnGround(player->mo) && player->speed != 0)
&& player->speed != 0
&& P_IsObjectOnGround(player->mo))
{
// weaken this depending on if you got hyu or invinc
if (player->kartstuff[k_hyudorotimer])
{
high = FRACUNIT / 128;
@@ -524,7 +533,8 @@ static void P_DeviceRumbleTick(void)
}
}
else if ((player->kartstuff[k_bananadrag] > TICRATE)
&& P_IsObjectOnGround(player->mo) && player->speed != 0)
&& player->speed != 0
&& P_IsObjectOnGround(player->mo))
{
if (leveltime & 1) // this is actually funny lel
high = FRACUNIT / 64;
@@ -541,7 +551,7 @@ static void P_DeviceRumbleTick(void)
continue;
}
G_PlayerDeviceRumble(i, low, high, 57);
G_PlayerDeviceRumble(i, low, high, lenght);
}
}
@@ -556,7 +566,11 @@ void P_RunChaseCameras(void)
player_t *p = &players[displayplayers[i]];
camera_t *cam = &camera[i];
if (cv_verticallook[i].value && leveltime > starttime && p->mo && p->kartstuff[k_respawn] == 0 && p->kartstuff[k_throwdir] != 0)
if (cv_verticallook[i].value &&
leveltime > starttime
&& p->mo
&& p->kartstuff[k_respawn] == 0
&& p->kartstuff[k_throwdir] != 0)
{
if (p->speed < 6 * p->mo->scale && abs(cam->dpad_y_held) < 2*TICRATE)
cam->dpad_y_held += p->kartstuff[k_throwdir];
@@ -599,6 +613,11 @@ static void P_RunQuakes(void)
--quake.time;
}
// Reset our Sprite scales and offsets
// at the start of our tic
// this is just to make things simpler
// as we dont have to reset it ourselves after use
// done at the start so lua can still overwrite everything
static inline void P_ResetSpriteStuff(void)
{
thinker_t *th;
@@ -735,8 +754,10 @@ void P_Ticker(boolean run)
PS_START_TIMING(ps_playerthink_time);
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !P_MobjWasRemoved(players[i].mo))
P_PlayerThink(&players[i]);
if (!playeringame[i] || P_MobjWasRemoved(players[i].mo))
continue;
P_PlayerThink(&players[i]);
}
PS_STOP_TIMING(ps_playerthink_time);
}
@@ -757,8 +778,10 @@ void P_Ticker(boolean run)
// Run any "after all the other thinkers" stuff
for (i = 0; i < MAXPLAYERS; i++)
{
if (playeringame[i] && !P_MobjWasRemoved(players[i].mo))
P_PlayerAfterThink(&players[i]);
if (!playeringame[i] || P_MobjWasRemoved(players[i].mo))
continue;
P_PlayerAfterThink(&players[i]);
}
// Apply rumble to local players
@@ -837,12 +860,12 @@ void P_Ticker(boolean run)
if (demo.recording)
{
INT32 axis = JoyAxis(AXISLOOKBACK, 1);
G_WriteAllGhostTics();
if (cv_recordmultiplayerdemos.value)
{
const INT32 axis = JoyAxis(AXISLOOKBACK, 1);
if (demo.savemode == DSM_NOTSAVING || demo.savemode == DSM_WILLAUTOSAVE)
if (demo.savebutton && demo.savebutton + 3*TICRATE < leveltime && (InputDown(gc_lookback, 1) || (cv_usejoystick[0].value && axis > 0)))
demo.savemode = DSM_TITLEENTRY;
@@ -958,10 +981,7 @@ void P_PreTicker(INT32 frames)
// Run any "after all the other thinkers" stuff
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i])
continue;
if (P_MobjWasRemoved(players[i].mo))
if (!playeringame[i] || P_MobjWasRemoved(players[i].mo))
continue;
P_PlayerAfterThink(&players[i]);
+38 -36
View File
@@ -73,7 +73,7 @@ void P_Thrust(mobj_t *mo, angle_t angle, fixed_t move)
mo->momx += FixedMul(move, FINECOSINE(angle));
if (!(twodlevel || (mo->flags2 & MF2_TWOD)))
if (LIKELY(!(twodlevel || (mo->flags2 & MF2_TWOD))))
mo->momy += FixedMul(move, FINESINE(angle));
}
@@ -90,7 +90,7 @@ void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move)
mo->momx = FixedMul(move, FINECOSINE(angle));
if (!(twodlevel || (mo->flags2 & MF2_TWOD)))
if (LIKELY(!(twodlevel || (mo->flags2 & MF2_TWOD))))
mo->momy = FixedMul(move,FINESINE(angle));
}
@@ -498,9 +498,9 @@ void P_PlayLivesJingle(player_t *player)
if (player && !P_IsLocalPlayer(player))
return;
if (use1upSound)
if (UNLIKELY(use1upSound))
S_StartSound(NULL, sfx_oneup);
else if (mariomode)
else if (UNLIKELY(mariomode))
S_StartSound(NULL, sfx_marioa);
else
{
@@ -528,7 +528,7 @@ void P_PlayRinglossSound(mobj_t *source, mobj_t *damager)
S_StartSound(NULL, sfx);
}
else
S_StartSound(source, (mariomode) ? sfx_mario8 : sfx_khurt1 + key);
S_StartSound(source, UNLIKELY(mariomode) ? sfx_mario8 : sfx_khurt1 + key);
}
else
S_StartSound(source, sfx_slip);
@@ -1287,13 +1287,14 @@ boolean P_InQuicksand(mobj_t *mo) // Returns true if you are in quicksand
{
sector_t *sector = mo->subsector->sector;
fixed_t topheight, bottomheight;
fixed_t flipoffset = ((mo->eflags & MFE_VERTICALFLIP) ? (mo->height/2) : 0);
fixed_t flipoffset;
if (sector->ffloors)
{
ffloor_t *rover;
flipoffset = ((mo->eflags & MFE_VERTICALFLIP) ? (mo->height/2) : 0);
for (rover = sector->ffloors; rover; rover = rover->next)
{
if (!(rover->flags & FF_EXISTS))
@@ -1640,7 +1641,7 @@ static void P_CheckInvincibilityTimer(player_t *player)
if (!player->powers[pw_invulnerability] && !player->kartstuff[k_invincibilitytimer])
return;
player->mo->color = (UINT8)(1 + (leveltime % (MAXSKINCOLORS-1)));
player->mo->color = K_RainbowColor();
// Resume normal music stuff.
if (player->powers[pw_invulnerability] == 1 || player->kartstuff[k_invincibilitytimer] == 1)
@@ -1682,6 +1683,7 @@ static void P_DoBubbleBreath(player_t *player)
bubble = P_SpawnMobj(player->mo->x, player->mo->y, zh, MT_SMALLBUBBLE);
else if (P_RandomChance(3*FRACUNIT/256))
bubble = P_SpawnMobj(player->mo->x, player->mo->y, zh, MT_MEDIUMBUBBLE);
if (bubble)
{
bubble->threshold = 42;
@@ -1689,8 +1691,8 @@ static void P_DoBubbleBreath(player_t *player)
P_SetScale(bubble, bubble->destscale);
}
if (player->pflags & PF_NIGHTSMODE) // NiGHTS Super doesn't spawn flight bubbles
return;
//if (player->pflags & PF_NIGHTSMODE) // NiGHTS Super doesn't spawn flight bubbles
//return;
}
//
@@ -2159,7 +2161,7 @@ static void P_MovePlayer(player_t *player)
}
// note: don't unset stasis here
if (!player->spectator && G_TagGametype())
if (UNLIKELY(!player->spectator && G_TagGametype()))
{
// If we have stasis already here, it's because it's forced on us
// by a linedef executor or what have you
@@ -2219,7 +2221,7 @@ static void P_MovePlayer(player_t *player)
player->lturn_max[leveltime%MAXPREDICTTICS] = player->rturn_max[leveltime%MAXPREDICTTICS] = 0;
}
if (leveltime >= starttime)
if (LIKELY(leveltime >= starttime))
{
// KART: Don't directly apply angleturn! It may have been either A) forged by a malicious client, or B) not be a smooth turn due to a player dropping frames.
// Instead, turn the player only up to the amount they're supposed to turn accounting for latency. Allow exactly 1 extra turn unit to try to keep old replays synced.
@@ -2258,7 +2260,7 @@ static void P_MovePlayer(player_t *player)
P_3dMovement(player);
}
if (maptol & TOL_2D)
if (UNLIKELY(maptol & TOL_2D)) // psure this doesent even work at all
runspd = FixedMul(runspd, 2*FRACUNIT/3);
/////////////////////////
@@ -2319,10 +2321,10 @@ static void P_MovePlayer(player_t *player)
// Drifting sound
// Start looping the sound now.
if (leveltime % 50 == 0 && onground && player->kartstuff[k_drift] != 0)
if (onground && leveltime % 50 == 0 && player->kartstuff[k_drift] != 0)
S_StartSound(player->mo, sfx_drift);
// Leveltime being 50 might take a while at times. We'll start it up once, isntantly.
else if (!S_SoundPlaying(player->mo, sfx_drift) && onground && player->kartstuff[k_drift] != 0)
else if (onground && !S_SoundPlaying(player->mo, sfx_drift) && player->kartstuff[k_drift] != 0)
S_StartSound(player->mo, sfx_drift);
// Ok, we'll stop now.
else if (player->kartstuff[k_drift] == 0 || !onground)
@@ -2347,7 +2349,7 @@ static void P_MovePlayer(player_t *player)
P_SetPlayerMobjState(player->mo, S_KART_STND1); // SRB2kart - was S_PLAY_STND
}
if (player->gotflag) // If you can't glide, then why the heck would you be gliding?
if (UNLIKELY(player->gotflag)) // If you can't glide, then why the heck would you be gliding?
{
player->pflags &= ~PF_GLIDING;
player->glidetime = 0;
@@ -2708,8 +2710,8 @@ boolean P_LookForEnemies(player_t *player)
player->mo->z-mo->z) > FixedMul(RING_DIST, player->mo->scale))
continue; // out of range
if ((twodlevel || player->mo->flags2 & MF2_TWOD)
&& abs(player->mo->y-mo->y) > player->mo->radius)
if (UNLIKELY((twodlevel || player->mo->flags2 & MF2_TWOD)
&& abs(player->mo->y-mo->y) > player->mo->radius))
continue; // not in your 2d plane
if (mo->type == MT_PLAYER) // Don't chase after other players!
@@ -3514,7 +3516,7 @@ static boolean P_CheckNoclipCameraPosition(player_t *player, camera_t *thiscam,
for (rover = newsubsec->sector->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
if (!(rover->flags & FF_BLOCKOTHERS) || !(rover->flags & FF_EXISTS) || !(rover->flags & FF_RENDERALL) || UNLIKELY(GETSECSPECIAL(rover->master->frontsector->special, 4) == 12))
continue;
topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);
@@ -3579,7 +3581,7 @@ static boolean P_CheckNoclipCameraPosition(player_t *player, camera_t *thiscam,
// We're inside it! Yess...
polysec = po->lines[0]->backsector;
if (GETSECSPECIAL(polysec->special, 4) == 12)
if (UNLIKELY(GETSECSPECIAL(polysec->special, 4) == 12))
{ // Camera noclip polyobj.
plink = (polymaplink_t *)(plink->link.next);
continue;
@@ -3635,7 +3637,7 @@ static boolean P_CheckNoclipCameraPosition(player_t *player, camera_t *thiscam,
for (rover = newsubsec->sector->ffloors; rover; rover = rover->next)
{
fixed_t topheight, bottomheight;
if ((rover->flags & FF_BLOCKOTHERS) && (rover->flags & FF_RENDERALL) && (rover->flags & FF_EXISTS) && GETSECSPECIAL(rover->master->frontsector->special, 4) == 12)
if (UNLIKELY((rover->flags & FF_BLOCKOTHERS) && (rover->flags & FF_RENDERALL) && (rover->flags & FF_EXISTS) && GETSECSPECIAL(rover->master->frontsector->special, 4) == 12))
{
topheight = P_CameraGetFOFTopZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);
bottomheight = P_CameraGetFOFBottomZ(thiscam, newsubsec->sector, rover, midx, midy, NULL);
@@ -4081,7 +4083,7 @@ boolean P_SpectatorJoinGame(player_t *player)
// Team changing in Team Match and CTF
// Pressing fire assigns you to a team that needs players if allowed.
// Partial code reproduction from p_tick.c autobalance code.
else if (G_GametypeHasTeams())
else if (UNLIKELY(G_GametypeHasTeams()))
{
INT32 changeto = 0;
INT32 z, numplayersred = 0, numplayersblue = 0;
@@ -4323,10 +4325,10 @@ static INT32 Quaketilt(player_t *player)
if (abs(delta) > ANGLE_90)
delta = (INT32)(( moma + ANGLE_180 ) - player->mo->angle );
const boolean sliptiding = player->kartstuff[k_drift] ? 0 : player->kartstuff[k_aizdriftstrat];
if (P_IsObjectOnGround(player->mo))
{
const boolean sliptiding = player->kartstuff[k_drift] ? 0 : player->kartstuff[k_aizdriftstrat];
if (sliptiding)
{
tilt = ANGLE_45;
@@ -4479,8 +4481,8 @@ void P_PlayerThink(player_t *player)
{
seenplayer = NULL;
if (cv_seenames.value && cv_allowseenames.value &&
!(G_TagGametype() && (player->pflags & PF_TAGIT)))
if (UNLIKELY(cv_seenames.value && cv_allowseenames.value &&
!(G_TagGametype() && (player->pflags & PF_TAGIT))))
{
mobj_t *mo = P_SpawnNameFinder(player->mo, MT_NAMECHECK);
@@ -4769,8 +4771,8 @@ void P_PlayerThink(player_t *player)
}
// Even if not NiGHTS, pull in nearby objects when walking around as John Q. Elliot.
if (!objectplacing && !((netgame || multiplayer) && player->spectator)
&& maptol & TOL_NIGHTS && (!(player->pflags & PF_NIGHTSMODE) || player->powers[pw_nights_helper]))
if (UNLIKELY(!objectplacing && !((netgame || multiplayer) && player->spectator)
&& maptol & TOL_NIGHTS && (!(player->pflags & PF_NIGHTSMODE) || player->powers[pw_nights_helper])))
{
thinker_t *th;
mobj_t *mo2;
@@ -4835,7 +4837,7 @@ void P_PlayerThink(player_t *player)
player->pflags &= ~PF_FULLSTASIS;
if (player->onconveyor == 1)
player->cmomy = player->cmomx = 0;
player->cmomy = player->cmomx = 0;
P_DoBubbleBreath(player); // Spawn Sonic's bubbles
P_CheckInvincibilityTimer(player); // Spawn Invincibility Sparkles
@@ -4872,7 +4874,7 @@ void P_PlayerThink(player_t *player)
#endif
// check for use
if (!(player->pflags & PF_NIGHTSMODE))
if (LIKELY(!(player->pflags & PF_NIGHTSMODE)))
{
if (cmd->buttons & BT_BRAKE)
player->pflags |= PF_USEDOWN;
@@ -5044,6 +5046,11 @@ void P_PlayerAfterThink(player_t *player)
P_PlayerInSpecialSector(player);
#endif
if (player->playerstate == PST_DEAD)
{
return;
}
for (i = 0; i <= splitscreen; i++)
{
if (player == &players[displayplayers[i]])
@@ -5053,12 +5060,7 @@ void P_PlayerAfterThink(player_t *player)
}
}
if (player->playerstate == PST_DEAD)
{
return;
}
if (player->pflags & PF_NIGHTSMODE)
if (UNLIKELY(player->pflags & PF_NIGHTSMODE))
{
player->powers[pw_gravityboots] = 0;
}
+1 -3
View File
@@ -484,9 +484,7 @@ UINT8 *R_GetColumn(fixed_t tex, INT32 col)
// Odd width texture, cannot just mask.
// Sometime gets colnum = -1 or = width, even without tiling.
// Test LostCiv, Map 20, crates.
col = ( col < 0 ) ?
texwidth - (((-col - 1) % texwidth) + 1)
: col % texwidth;
col = ((col % texwidth) + texwidth) % texwidth;
}
if (!data)
+4
View File
@@ -151,6 +151,7 @@ static CV_PossibleValue_t fov_cons_t[] = {{MINFOV*FRACUNIT, "MIN"}, {MAXFOV*FRAC
static CV_PossibleValue_t translucenthud_cons_t[] = {{0, "MIN"}, {10, "MAX"}, {0, NULL}};
static CV_PossibleValue_t maxportals_cons_t[] = {{0, "MIN"}, {12, "MAX"}, {0, NULL}}; // lmao rendering 32 portals, you're a card
static CV_PossibleValue_t homremoval_cons_t[] = {{0, "No"}, {1, "Yes"}, {2, "Flash"}, {0, NULL}};
static CV_PossibleValue_t secbright_cons_t[] = {{0, "MIN"}, {255, "MAX"}, {0, NULL}};
static void R_SetFov(fixed_t playerfov);
@@ -201,6 +202,8 @@ consvar_t cv_ripplewater = {"waterripples", "On", CV_SAVE, CV_OnOff, NULL, 0
// Okay, whoever said homremoval causes a performance hit should be shot.
consvar_t cv_homremoval = {"homremoval", "Yes", CV_SAVE, homremoval_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_secbright = {"r_secbright", "0", CV_SAVE, secbright_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
consvar_t cv_maxportals = {"maxportals", "2", CV_SAVE, maxportals_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
// cap fov, fov too high tears software apart.
@@ -1558,6 +1561,7 @@ void R_RegisterEngineStuff(void)
CV_RegisterVar(&cv_skybox);
CV_RegisterVar(&cv_ffloorclip);
CV_RegisterVar(&cv_spriteclip);
CV_RegisterVar(&cv_secbright);
CV_RegisterVar(&cv_softcyancut);
for (i = 0; i < MAXSPLITSCREENPLAYERS; i++)
+6
View File
@@ -197,9 +197,15 @@ extern consvar_t cv_tailspickup;
extern consvar_t cv_maxinterpdist;
extern consvar_t cv_playerfade;
extern consvar_t cv_ripplewater;
extern consvar_t cv_secbright;
extern consvar_t cv_randomdirlight;
static inline INT32 R_GetSoftLightlevel(INT32 llevel)
{
return CLAMP(llevel, cv_secbright.value, 255) >> LIGHTSEGSHIFT;
}
// Called by startup code.
void R_Init(void);
+8 -8
View File
@@ -1059,7 +1059,7 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle
#else
if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2))
#endif
light = (pl->lightlevel >> LIGHTSEGSHIFT);
light = R_GetSoftLightlevel(pl->lightlevel);
else
light = LIGHTLEVELS-1;
}
@@ -1111,16 +1111,17 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle
#else
if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2))
#endif
light = (pl->lightlevel >> LIGHTSEGSHIFT);
light = R_GetSoftLightlevel(pl->lightlevel);
else
light = LIGHTLEVELS-1;
}
else if (pl->ffloor->flags & FF_FOG)
{
spanfunctype = SPANDRAWFUNC_FOG;
light = (pl->lightlevel >> LIGHTSEGSHIFT);
light = R_GetSoftLightlevel(pl->lightlevel);
}
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
else
light = R_GetSoftLightlevel(pl->lightlevel);
if (pl->ffloor->flags & FF_RIPPLE && cv_ripplewater.value)
{
@@ -1172,7 +1173,8 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle
}
}
}
else light = (pl->lightlevel >> LIGHTSEGSHIFT);
else
light = R_GetSoftLightlevel(pl->lightlevel);
}
ds->currentplane = pl;
@@ -1180,7 +1182,7 @@ void R_DrawSinglePlane(drawspandata_t* ds, visplane_t *pl, boolean allow_paralle
levelflat = &levelflats[pl->picnum];
// Get the texture
ds->source = (UINT8 *)W_CacheLumpNum(levelflat->lumpnum, PU_STATIC); // Stay here until Z_ChangeTag
ds->source = R_GetFlat(levelflat->lumpnum);
if (ds->source == NULL)
return;
@@ -1385,8 +1387,6 @@ using the palette colors.
}
}
#endif
Z_ChangeTag(ds->source, PU_CACHE);
}
void R_PlaneBounds(visplane_t *plane)
+10 -11
View File
@@ -209,11 +209,11 @@ static void R_RenderMaskedSegLoop(drawcolumndata_t* dc, drawseg_t *drawseg, INT3
rlight->flags = static_cast<ffloortype_e>(light->flags);
if (rlight->flags & FF_FOG || (rlight->extra_colormap && rlight->extra_colormap->fog))
lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
lightnum = R_GetSoftLightlevel(rlight->lightlevel);
else if (R_CheckColumnFunc(COLDRAWFUNC_FUZZY))
lightnum = LIGHTLEVELS - 1;
else
lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
lightnum = R_GetSoftLightlevel(rlight->lightlevel);
if (rlight->extra_colormap && rlight->extra_colormap->fog)
;
@@ -227,7 +227,7 @@ static void R_RenderMaskedSegLoop(drawcolumndata_t* dc, drawseg_t *drawseg, INT3
{
if ((R_CheckColumnFunc(COLDRAWFUNC_FUZZY) == false)
|| (frontsector->extra_colormap && frontsector->extra_colormap->fog))
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
lightnum = R_GetSoftLightlevel(frontsector->lightlevel);
else
lightnum = LIGHTLEVELS - 1;
@@ -764,9 +764,9 @@ void R_RenderThickSideRange(drawseg_t *drawseg, INT32 x1, INT32 x2, ffloor_t *pf
// Check if the current light effects the colormap/lightlevel
if (pfloor->flags & FF_FOG)
rlight->lightnum = (pfloor->master->frontsector->lightlevel >> LIGHTSEGSHIFT);
rlight->lightnum = R_GetSoftLightlevel(pfloor->master->frontsector->lightlevel);
else
rlight->lightnum = (rlight->lightlevel >> LIGHTSEGSHIFT);
rlight->lightnum = R_GetSoftLightlevel(rlight->lightlevel);
if (pfloor->flags & FF_FOG || rlight->flags & FF_FOG || (rlight->extra_colormap && rlight->extra_colormap->fog))
;
@@ -782,14 +782,13 @@ void R_RenderThickSideRange(drawseg_t *drawseg, INT32 x1, INT32 x2, ffloor_t *pf
{
// Get correct light level!
if ((frontsector->extra_colormap && frontsector->extra_colormap->fog))
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
lightnum = R_GetSoftLightlevel(frontsector->lightlevel);
else if (fog)
lightnum = (pfloor->master->frontsector->lightlevel >> LIGHTSEGSHIFT);
lightnum = R_GetSoftLightlevel(pfloor->master->frontsector->lightlevel);
else if (fuzzy)
lightnum = LIGHTLEVELS-1;
else
lightnum = R_FakeFlat(frontsector, &tempsec, &templight, &templight, false)
->lightlevel >> LIGHTSEGSHIFT;
lightnum = R_GetSoftLightlevel(R_FakeFlat(frontsector, &tempsec, &templight, &templight, false)->lightlevel);
if (pfloor->flags & FF_FOG || (frontsector->extra_colormap && frontsector->extra_colormap->fog))
;
@@ -1385,7 +1384,7 @@ static void R_RenderSegLoop(drawcolumndata_t* dc)
for (i = 0; i < dc->numlights; i++)
{
INT32 lightnum;
lightnum = (dc->lightlist[i].lightlevel >> LIGHTSEGSHIFT);
lightnum = R_GetSoftLightlevel(dc->lightlist[i].lightlevel);
if (dc->lightlist[i].extra_colormap)
;
@@ -2443,7 +2442,7 @@ void R_StoreWallRange(INT32 start, INT32 stop)
// use different light tables
// for horizontal / vertical / diagonal
// OPTIMIZE: get rid of LIGHTSEGSHIFT globally
lightnum = (frontsector->lightlevel >> LIGHTSEGSHIFT);
lightnum = R_GetSoftLightlevel(frontsector->lightlevel);
if (P_ApplyLightOffset(lightnum, frontsector))
lightnum += curline->lightOffset;
+3 -3
View File
@@ -1061,7 +1061,7 @@ static void R_SplitSprite(vissprite_t *sprite)
if (!(sector->lightlist[i].caster->flags & FF_NOSHADE))
{
INT32 lightnum = (*sector->lightlist[i].lightlevel >> LIGHTSEGSHIFT);
INT32 lightnum = R_GetSoftLightlevel(*sector->lightlist[i].lightlevel);
if (lightnum < 0)
spritelights = scalelight[0];
@@ -1660,7 +1660,7 @@ static void R_ProjectSprite(mobj_t *thing)
lightnum = thing->subsector->sector->lightlevel;
}
lightnum = (lightnum + R_ThingLightLevel(thing)) >> LIGHTSEGSHIFT;
lightnum = R_GetSoftLightlevel(lightnum + R_ThingLightLevel(thing));
if (maplighting.directional && P_SectorUsesDirectionalLighting(thing->subsector->sector))
{
@@ -2057,7 +2057,7 @@ void R_AddSprites(sector_t *sec, INT32 lightlevel)
{
if (sec->heightsec == -1) lightlevel = sec->lightlevel;
lightnum = (lightlevel >> LIGHTSEGSHIFT);
lightnum = R_GetSoftLightlevel(lightlevel);
if (lightnum < 0)
spritelights = scalelight[0];
+80 -68
View File
@@ -34,7 +34,7 @@
#include "lua_hook.h" // MusicChange hook
#include "lua_hud.h" // LUA_HudEnabled(hud_musiccredit)
static boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *vol, INT32 *sep, INT32 *pitch, sfxinfo_t *sfxinfo);
static boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *vol, INT32 *sep, sfxinfo_t *sfxinfo);
static void SetChannelsNum(void);
static void Command_Tunes_f(void);
static void Command_RestartAudio_f(void);
@@ -59,10 +59,12 @@ static void AmigaType_OnChange(void);
#endif
#endif
#if defined(HAVE_SDL) && SOUND==SOUND_SDL
consvar_t cv_samplerate = {"samplerate", "44100", 0, CV_Unsigned, NULL, 22050, NULL, NULL, 0, 0, NULL}; //Alam: For easy hacking?
#endif
static CV_PossibleValue_t audbuffersize_cons_t[] = {{256, "256"}, {512, "512"}, {1024, "1024"}, {2048, "2048"}, {4096, "4096"}, {0, NULL}};
consvar_t cv_audbuffersize = {"buffersize", "2048", CV_SAVE, audbuffersize_cons_t, BufferSize_OnChange, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t audbuffersize_cons_t[] = {{128, "128"}, {256, "256"}, {512, "512"}, {1024, "1024"}, {2048, "2048"}, {4096, "4096"}, {0, NULL}};
consvar_t cv_audbuffersize = {"audiobuffersize", "2048", CV_SAVE, audbuffersize_cons_t, BufferSize_OnChange, 0, NULL, NULL, 0, 0, NULL};
// stereo reverse
consvar_t stereoreverse = {"stereoreverse", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -79,7 +81,11 @@ consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_co
#endif
// number of channels available
consvar_t cv_numChannels = {"snd_channels", "64", CV_SAVE|CV_CALL, CV_Unsigned, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t numChannels_cons_t[] = {{0, "MIN"}, {255, "MAX"}, {0, NULL}};
consvar_t cv_numChannels = {"snd_channels", "64", CV_SAVE|CV_CALL, numChannels_cons_t, SetChannelsNum, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t samesoundlimit_cons_t[] = {{0, "MIN"}, {64, "MAX"}, {0, NULL}};
consvar_t cv_samesoundlimit = {"samesoundlimit", "0", CV_SAVE, samesoundlimit_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
//consvar_t cv_resetmusic = {"resetmusic", "No", CV_SAVE|CV_NOSHOWHELP, CV_YesNo, NULL, 0, NULL, NULL, 0, 0, NULL};
@@ -274,7 +280,9 @@ void S_RegisterSoundStuff(void)
CV_RegisterVar(&stereoreverse);
CV_RegisterVar(&precachesound);
#if defined(HAVE_SDL) && SOUND==SOUND_SDL
CV_RegisterVar(&cv_samplerate);
#endif
//CV_RegisterVar(&cv_resetmusic);
CV_RegisterVar(&cv_gamesounds);
CV_RegisterVar(&cv_gamedigimusic);
@@ -282,6 +290,8 @@ void S_RegisterSoundStuff(void)
CV_RegisterVar(&cv_gamemidimusic);
#endif
CV_RegisterVar(&cv_samesoundlimit);
// bird music stuff
CV_RegisterVar(&cv_playmusicifunfocused);
CV_RegisterVar(&cv_playsoundifunfocused);
@@ -324,9 +334,6 @@ static void SetChannelsNum(void)
Z_Free(channels);
channels = NULL;
if (cv_numChannels.value == 999999999) //Alam_GBC: OH MY ROD!(ROD rimmiced with GOD!)
CV_StealthSet(&cv_numChannels,cv_numChannels.defaultvalue);
if (cv_numChannels.value)
channels = (channel_t *)Z_Calloc(cv_numChannels.value * sizeof (channel_t), PU_STATIC, NULL);
numofchannels = (channels ? cv_numChannels.value : 0);
@@ -427,6 +434,25 @@ static INT32 S_ScaleVolumeWithSplitscreen(INT32 volume)
return FixedDiv(volume * FRACUNIT, root) / FRACUNIT;
}
static boolean S_CheckSameSoundLimit(sfxenum_t sfx_id)
{
INT32 cnum, scount = 0;
if (!cv_samesoundlimit.value)
return true;
for (cnum = 0; cnum < numofchannels; cnum++)
if ((size_t)(channels[cnum].sfxinfo - S_sfx) == (size_t)sfx_id)
scount++;
//CONS_Printf("same sound count: %d for sfx: %d\n", scount, sfx_id);
if (scount >= cv_samesoundlimit.value)
return false;
return true;
}
void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
{
const mobj_t *origin = (const mobj_t *)origin_p;
@@ -434,7 +460,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
INT32 initial_volume;
sfxinfo_t *sfx;
INT32 sep, pitch, priority, cnum;
INT32 sep, cnum;
boolean anyListeners = false;
boolean itsUs = false;
INT32 i;
@@ -449,13 +475,16 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
if (sfx_id == sfx_None)
return;
initial_volume = (origin ? S_ScaleVolumeWithSplitscreen(volume) : volume);
// reached same sound limit?
if (!S_CheckSameSoundLimit(sfx_id))
return;
memset(listener, 0, sizeof(listener));
for (i = 0; i <= splitscreen; i++)
{
player_t *player = &players[displayplayers[i]];
memset(&listener[i], 0, sizeof (listener[i]));
listenmobj[i] = NULL;
if (player->awayviewtics)
@@ -471,11 +500,6 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
{
itsUs = true;
}
}
for (i = 0; i <= splitscreen; i++)
{
player_t *player = &players[displayplayers[i]];
if (camera[i].chase && !player->awayviewtics)
{
@@ -514,9 +538,9 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
sfx = &S_sfx[sfx_id];
}
initial_volume = (origin ? S_ScaleVolumeWithSplitscreen(volume) : volume);
// Initialize sound parameters
pitch = NORM_PITCH;
priority = NORM_PRIORITY;
sep = NORM_SEP;
i = 0; // sensible default
@@ -554,7 +578,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
if (listenmobj[i])
{
audible = S_AdjustSoundParams(listenmobj[i], origin, &volume, &sep, &pitch, sfx);
audible = S_AdjustSoundParams(listenmobj[i], origin, &volume, &sep, sfx);
}
if (!audible)
@@ -574,12 +598,6 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
sfx->data = I_GetSfx(sfx);
}
// increase the usefulness
if (sfx->usefulness++ < 0)
{
sfx->usefulness = -1;
}
// Avoid channel reverse if surround
if (reverse)
{
@@ -598,7 +616,7 @@ void S_StartSoundAtVolume(const void *origin_p, sfxenum_t sfx_id, INT32 volume)
channels[cnum].sfxinfo = sfx;
channels[cnum].origin = origin;
channels[cnum].volume = initial_volume;
channels[cnum].handle = I_StartSound(sfx_id, volume, sep, pitch, priority, cnum);
channels[cnum].handle = I_StartSound(sfx_id, volume, sep, cnum);
}
}
@@ -607,7 +625,7 @@ void S_StartSound(const void *origin, sfxenum_t sfx_id)
if (S_SoundDisabled())
return;
if (mariomode) // Sounds change in Mario mode!
if (UNLIKELY(mariomode)) // Sounds change in Mario mode!
{
switch (sfx_id)
{
@@ -630,7 +648,8 @@ void S_StartSound(const void *origin, sfxenum_t sfx_id)
break;
}
}
if (maptol & TOL_XMAS) // Some sounds change for xmas
if (UNLIKELY(maptol & TOL_XMAS)) // Some sounds change for xmas
{
switch (sfx_id)
{
@@ -677,7 +696,7 @@ static INT32 actualmidimusicvolume;
void S_UpdateSounds(void)
{
INT32 cnum, volume, sep, pitch;
INT32 cnum, volume, sep;
boolean audible = false;
channel_t *c;
INT32 i;
@@ -687,14 +706,16 @@ void S_UpdateSounds(void)
// Update sound/music volumes, if changed manually at console
if (actualsfxvolume != cv_soundvolume.value)
S_SetSfxVolume (cv_soundvolume.value);
S_SetSfxVolume(cv_soundvolume.value);
if (actualdigmusicvolume != cv_digmusicvolume.value)
S_SetDigMusicVolume (cv_digmusicvolume.value);
S_SetDigMusicVolume(cv_digmusicvolume.value);
#ifndef NO_MIDI
if (actualmidimusicvolume != cv_midimusicvolume.value)
S_SetMIDIMusicVolume (cv_midimusicvolume.value);
S_SetMIDIMusicVolume(cv_midimusicvolume.value);
#endif
memset(listener, 0, sizeof(listener));
// We're done now, if we're not in a level.
if (gamestate != GS_LEVEL)
{
@@ -714,7 +735,6 @@ void S_UpdateSounds(void)
{
player_t *player = &players[displayplayers[i]];
memset(&listener[i], 0, sizeof (listener[i]));
listenmobj[i] = NULL;
if (player->awayviewtics)
@@ -725,15 +745,6 @@ void S_UpdateSounds(void)
{
listenmobj[i] = player->mo;
}
}
#ifndef NOMUMBLE
I_UpdateMumble(players[consoleplayer].mo, listener[0]);
#endif
for (i = 0; i <= splitscreen; i++)
{
player_t *player = &players[displayplayers[i]];
if (camera[i].chase && !player->awayviewtics)
{
@@ -751,6 +762,10 @@ void S_UpdateSounds(void)
}
}
#ifndef NOMUMBLE
I_UpdateMumble(players[consoleplayer].mo, listener[0]);
#endif
for (cnum = 0; cnum < numofchannels; cnum++)
{
c = &channels[cnum];
@@ -761,7 +776,6 @@ void S_UpdateSounds(void)
{
// initialize parameters
volume = c->volume; // 8 bits internal volume precision
pitch = NORM_PITCH;
sep = NORM_SEP;
// check non-local sounds for distance clipping
@@ -817,13 +831,13 @@ void S_UpdateSounds(void)
{
audible = S_AdjustSoundParams(
listenmobj[i], c->origin,
&volume, &sep, &pitch,
&volume, &sep,
c->sfxinfo
);
}
if (audible)
I_UpdateSoundParams(c->handle, volume, sep, pitch);
I_UpdateSoundParams(c->handle, volume, sep);
else
S_StopChannel(cnum);
}
@@ -876,8 +890,6 @@ static void S_StopChannel(INT32 cnum)
if (cnum != i && c->sfxinfo == channels[i].sfxinfo)
break;
// degrade usefulness of sound data
c->sfxinfo->usefulness--;
c->sfxinfo = 0;
}
@@ -918,8 +930,7 @@ fixed_t S_CalculateSoundDistance(fixed_t sx1, fixed_t sy1, fixed_t sz1, fixed_t
// If the sound is not audible, returns a 0.
// Otherwise, modifies parameters and returns 1.
//
boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *vol, INT32 *sep, INT32 *pitch,
sfxinfo_t *sfxinfo)
static boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32 *vol, INT32 *sep, sfxinfo_t *sfxinfo)
{
const boolean reverse = (stereoreverse.value ^ encoremode);
@@ -928,8 +939,6 @@ boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32
listener_t listensource;
INT32 i;
(void)pitch;
if (!listener)
return false;
@@ -962,13 +971,16 @@ boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32
else
{
// Essentially check in a 1024 unit radius of the player for an outdoor area.
yl = listensource.y - 1024*FRACUNIT;
yh = listensource.y + 1024*FRACUNIT;
xl = listensource.x - 1024*FRACUNIT;
xh = listensource.x + 1024*FRACUNIT;
approx_dist = 1024*FRACUNIT;
for (y = yl; y <= yh; y += FRACUNIT*64)
for (x = xl; x <= xh; x += FRACUNIT*64)
#define RADIUSSTEP (64*FRACUNIT)
#define SEARCHRADIUS (16*RADIUSSTEP)
yl = listensource.y - SEARCHRADIUS;
yh = listensource.y + SEARCHRADIUS;
xl = listensource.x - SEARCHRADIUS;
xh = listensource.x + SEARCHRADIUS;
approx_dist = SEARCHRADIUS;
#undef SEARCHRADIUS
for (y = yl; y <= yh; y += RADIUSSTEP)
for (x = xl; x <= xh; x += RADIUSSTEP)
{
if (R_PointInSubsectorFast(x, y)->sector->ceilingpic == skyflatnum)
{
@@ -980,6 +992,7 @@ boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32
}
}
}
#undef RADIUSSTEP
}
}
else
@@ -990,14 +1003,14 @@ boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32
// Ring loss, deaths, etc, should all be heard louder.
if (sfxinfo->pitch & SF_X8AWAYSOUND)
approx_dist = FixedDiv(approx_dist,8*FRACUNIT);
approx_dist = FixedDiv(approx_dist, 8*FRACUNIT);
// Combine 8XAWAYSOUND with 4XAWAYSOUND and get.... 32XAWAYSOUND?
if (sfxinfo->pitch & SF_X4AWAYSOUND)
approx_dist = FixedDiv(approx_dist,4*FRACUNIT);
approx_dist = FixedDiv(approx_dist, 4*FRACUNIT);
if (sfxinfo->pitch & SF_X2AWAYSOUND)
approx_dist = FixedDiv(approx_dist,2*FRACUNIT);
approx_dist = FixedDiv(approx_dist, 2*FRACUNIT);
if (approx_dist > S_CLIPPING_DIST)
return false;
@@ -1030,7 +1043,7 @@ boolean S_AdjustSoundParams(const mobj_t *listener, const mobj_t *source, INT32
if (approx_dist >= S_CLOSE_DIST)
{
// distance effect
INT32 n = (15 * ((S_CLIPPING_DIST - approx_dist)>>FRACBITS));
const INT32 n = (15 * ((S_CLIPPING_DIST - approx_dist)>>FRACBITS));
*vol = FixedMul(*vol * FRACUNIT / 255, n) / S_ATTENUATOR;
}
@@ -1146,7 +1159,6 @@ void S_InitSfxChannels(INT32 sfxVolume)
// Note that sounds have not been cached (yet).
for (i = 1; i < NUMSFX; i++)
{
S_sfx[i].usefulness = -1; // for I_GetSfx()
S_sfx[i].lumpnum = LUMPERROR;
}
@@ -1906,12 +1918,12 @@ void S_SetMusicVolume(INT32 digvolume, INT32 seqvolume)
}
}
void S_SetRestoreMusicFadeInCvar (consvar_t *cv)
void S_SetRestoreMusicFadeInCvar(consvar_t *cv)
{
music_refade_cv = cv_birdmusic.value ? cv : 0;
}
int S_GetRestoreMusicFadeIn (void)
int S_GetRestoreMusicFadeIn(void)
{
if (music_refade_cv && cv_fading.value)
return music_refade_cv->value;
@@ -2020,7 +2032,6 @@ void S_KeepMusic(void)
if (oldmap == gamemap && oldencore == encoremode)
{
const boolean musicchanged = S_CheckMusicException();
resumekeepmusic = (musicchanged && keepmusic.resume);
keepmapmusic = (!musicchanged || resumekeepmusic);
}
@@ -2187,6 +2198,7 @@ static void Command_Tunes_f(void)
mapmusic.name, (mapmusic.flags & MUSIC_TRACKMASK));
return;
}
if (!strcasecmp(tunearg, "-none"))
{
S_StopMusic();
@@ -2205,6 +2217,7 @@ static void Command_Tunes_f(void)
CONS_Alert(CONS_NOTICE, M_GetText("Valid music slots are 1 to 1035.\n"));
return;
}
if (!tunenum && strlen(tunearg) > 6) // This is automatic -- just show the error just in case
CONS_Alert(CONS_NOTICE, M_GetText("Music name too long - truncated to six characters.\n"));
@@ -2214,12 +2227,11 @@ static void Command_Tunes_f(void)
if (tunenum)
snprintf(mapmusic.name, 7, "%sM", G_BuildMapName(tunenum));
else
strncpy(mapmusic.name, tunearg, 7);
strlcpy(mapmusic.name, tunearg, sizeof(mapmusic.name));
if (argc > 4)
position = (UINT32)atoi(COM_Argv(4));
mapmusic.name[6] = 0;
mapmusic.flags = (track & MUSIC_TRACKMASK);
mapmusic.position = position;
mapmusic.resume = 0;
@@ -2246,7 +2258,7 @@ static void Command_RestartAudio_f(void)
I_StartupSound();
I_InitMusic();
// These must be called or no sound and music until manually set.
// These must be called or no sound and music until manually set.
I_SetSfxVolume(cv_soundvolume.value);
#ifdef NO_MIDI
+2
View File
@@ -32,6 +32,8 @@ extern consvar_t stereoreverse;
extern consvar_t cv_soundvolume, cv_digmusicvolume;//, cv_midimusicvolume;
extern consvar_t cv_numChannels;
extern consvar_t cv_samesoundlimit;
extern consvar_t cv_audbuffersize;
//extern consvar_t cv_resetmusic;
extern consvar_t cv_gamedigimusic;
+14 -5
View File
@@ -1806,13 +1806,22 @@ void I_SleepDuration(precise_t duration)
{
#if defined(__linux__) || defined(__FreeBSD__) || defined(__HAIKU__)
UINT64 precision = I_GetPrecisePrecision();
struct timespec ts = {
precise_t dest = I_GetPreciseTime() + duration;
precise_t slack = (precision / 5000); // 0.2 ms slack
if (duration > slack)
{
duration -= slack;
struct timespec ts = {
.tv_sec = static_cast<__time_t>(duration / precision),
.tv_nsec = static_cast<__syscall_slong_t>(duration * 1000000000 / precision % 1000000000),
};
int status;
do status = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts);
while (status == EINTR);
};
int status;
do status = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts);
while (status == EINTR);
}
// busy-wait the rest
while (((INT64)dest - (INT64)I_GetPreciseTime()) > 0);
#elif defined (MIN_SLEEP_DURATION_MS)
UINT64 precision = I_GetPrecisePrecision();
INT32 sleepvalue = cv_sleep.value;
+2
View File
@@ -1361,6 +1361,7 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen)
{
wasfullscreen = SDL_FALSE;
SDL_SetWindowFullscreen(window, 0);
I_SetBorderlessWindow();
}
// Reposition window only in windowed mode
@@ -1380,6 +1381,7 @@ static void SDLSetMode(INT32 width, INT32 height, SDL_bool fullscreen)
if (fullscreen)
{
SDL_SetWindowFullscreen(window, SDL_WINDOW_FULLSCREEN_DESKTOP);
I_SetBorderlessWindow();
}
}
+2 -5
View File
@@ -528,14 +528,12 @@ void I_FreeSfx(sfxinfo_t *sfx)
sfx->lumpnum = LUMPERROR;
}
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, UINT8 pitch, UINT8 priority, INT32 channel)
INT32 I_StartSound(sfxenum_t id, UINT8 vol, UINT8 sep, INT32 channel)
{
UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127
INT32 handle = Mix_PlayChannel(channel, S_sfx[id].data, 0);
Mix_Volume(handle, volume);
Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff));
(void)pitch; // Mixer can't handle pitch
(void)priority; // priority and channel management is handled by SRB2...
return handle;
}
@@ -549,12 +547,11 @@ boolean I_SoundIsPlaying(INT32 handle)
return Mix_Playing(handle);
}
void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep, UINT8 pitch)
void I_UpdateSoundParams(INT32 handle, UINT8 vol, UINT8 sep)
{
UINT8 volume = (((UINT16)vol + 1) * (UINT16)sfx_volume) / 62; // (256 * 31) / 62 == 127
Mix_Volume(handle, volume);
Mix_SetPanning(handle, min((UINT16)(0xff-sep)<<1, 0xff), min((UINT16)(sep)<<1, 0xff));
(void)pitch;
}
void I_SetSfxVolume(UINT8 volume)
+1 -1
View File
@@ -1079,7 +1079,7 @@ void I_StartupSound(void)
{
#ifndef HAVE_MIXER
#ifndef NO_MIDI
midi_disabled =
midi_disabled =
#endif
digital_disabled = true;
#endif
+888 -891
View File
File diff suppressed because it is too large. Load diff
-8
View File
@@ -78,9 +78,6 @@ struct sfxinfo_struct
// pitch if a link
INT32 pitch;
// volume if a link
INT32 volume;
// sound data
void *data;
@@ -91,11 +88,6 @@ struct sfxinfo_struct
// 0 up to (NUMSKINSOUNDS-1), -1 = not skin specifc
INT32 skinsound;
// this is checked every second to see if sound
// can be thrown out (if 0, then decrement, if -1,
// then throw out, if > 0, then it is in use)
INT32 usefulness;
// lump number of sfx
lumpnum_t lumpnum;
};
+75 -47
View File
@@ -126,6 +126,10 @@ void W_Shutdown(void)
Z_Free(wad->lumpinfo[wad->numlumps].longname);
Z_Free(wad->lumpinfo[wad->numlumps].fullname);
}
M_AATreeFree(wad->startfolders);
M_AATreeFree(wad->endfolders);
Z_Free(wad->lumpinfo);
Z_Free(wad);
}
@@ -338,6 +342,11 @@ static void W_InvalidateLumpnumCache(void)
memset(lumpnumcache, 0, sizeof (lumpnumcache));
}
UINT32 W_HashLumpName(const char *name)
{
return FNV1a_HashLowercaseString(name);
}
/** Detect a file type.
* \todo Actually detect the wad/pkzip headers and whatnot, instead of just checking the extensions.
*/
@@ -362,11 +371,24 @@ static lumpinfo_t* ResGetLumpsStandalone (FILE* handle, UINT16* numlumps, const
fseek(handle, 0, SEEK_END);
lumpinfo->size = ftell(handle);
fseek(handle, 0, SEEK_SET);
strlcpy(lumpinfo->name, lumpname, 9);
// Allocate the lump's full and long name.
lumpinfo->fullname = Z_StrDup(lumpname);
lumpinfo->longname = Z_StrDup(lumpname);
strlcpy(lumpinfo->name, lumpname, sizeof(lumpinfo->name));
lumpinfo->namelength = strlen(lumpinfo->name);
lumpinfo->hash.name = W_HashLumpName(lumpname);
// Allocate the lump's long name.
lumpinfo->longname = Z_Malloc((lumpinfo->namelength + 1) * sizeof(char), PU_STATIC, NULL);
strcpy(lumpinfo->longname, lumpname);
lumpinfo->longname[lumpinfo->namelength] = '\0';
lumpinfo->longnamelength = lumpinfo->namelength;
lumpinfo->hash.longname = lumpinfo->hash.name;
// Allocate the lump's full name.
lumpinfo->fullname = Z_Malloc((lumpinfo->namelength + 1) * sizeof(char), PU_STATIC, NULL);
strcpy(lumpinfo->fullname, lumpname);
lumpinfo->fullname[lumpinfo->namelength] = '\0';
lumpinfo->fullnamelength = lumpinfo->namelength;
lumpinfo->hash.fullname = lumpinfo->hash.name;
*numlumps = 1;
return lumpinfo;
@@ -454,16 +476,22 @@ static lumpinfo_t* ResGetLumpsWad (FILE* handle, UINT16* nlmp, const char* filen
lump_p->compression = CM_NOCOMPRESSION;
memset(lump_p->name, 0x00, 9);
strncpy(lump_p->name, fileinfo->name, 8);
lump_p->namelength = strlen(lump_p->name);
lump_p->hash.name = W_HashLumpName(lump_p->name);
// Allocate the lump's long name.
lump_p->longname = Z_Malloc(9 * sizeof(char), PU_STATIC, NULL);
strncpy(lump_p->longname, fileinfo->name, 8);
lump_p->longname[8] = '\0';
lump_p->longnamelength = lump_p->namelength;
lump_p->hash.longname = lump_p->hash.name;
// Allocate the lump's full name.
lump_p->fullname = Z_Malloc(9 * sizeof(char), PU_STATIC, NULL);
strncpy(lump_p->fullname, fileinfo->name, 8);
lump_p->fullname[8] = '\0';
lump_p->fullnamelength = lump_p->namelength;
lump_p->hash.fullname = lump_p->hash.name;
}
free(fileinfov);
*nlmp = numlumps;
@@ -656,12 +684,18 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
memset(lump_p->name, '\0', 9); // Making sure they're initialized to 0. Is it necessary?
strncpy(lump_p->name, trimname, min(8, dotpos - trimname));
lump_p->namelength = strlen(lump_p->name);
lump_p->hash.name = W_HashLumpName(lump_p->name);
lump_p->longname = Z_Calloc(dotpos - trimname + 1, PU_STATIC, NULL);
strlcpy(lump_p->longname, trimname, dotpos - trimname + 1);
lump_p->longnamelength = strlen(lump_p->longname);
lump_p->hash.longname = W_HashLumpName(lump_p->longname);
lump_p->fullname = (char*)(Z_Calloc(SHORT(zentry->namelen) + 1, PU_STATIC, NULL));
strncpy(lump_p->fullname, fullname, SHORT(zentry->namelen));
lump_p->fullnamelength = zentry->namelen;
lump_p->hash.fullname = W_HashLumpName(lump_p->fullname);
switch(SHORT(zentry->compression))
{
@@ -817,6 +851,8 @@ UINT16 W_InitFile(const char *filename, boolean local)
fseek(handle, 0, SEEK_END);
wadfile->filesize = (unsigned)ftell(handle);
wadfile->type = type;
wadfile->startfolders = M_AATreeAlloc(0);
wadfile->endfolders = M_AATreeAlloc(0);
// already generated, just copy it over
M_Memcpy(&wadfile->md5sum, &md5sum, 16);
@@ -872,7 +908,6 @@ UINT16 W_InitFile(const char *filename, boolean local)
return wadfile->numlumps;
}
/** Tries to load a series of files.
* All files are wads unless they have an extension of ".soc" or ".lua".
*
@@ -976,6 +1011,8 @@ UINT16 W_CheckNumForNamePwad(const char *name, UINT16 wad, UINT16 startlump)
{
UINT16 i;
static char uname[9];
UINT32 hash;
size_t namelen;
if (!TestValidLump(wad,0))
return INT16_MAX;
@@ -983,6 +1020,8 @@ UINT16 W_CheckNumForNamePwad(const char *name, UINT16 wad, UINT16 startlump)
memset(uname, 0, sizeof uname);
strncpy(uname, name, sizeof(uname)-1);
strupr(uname);
namelen = strlen(uname);
hash = W_HashLumpName(uname);
//
// scan forward
@@ -993,7 +1032,9 @@ UINT16 W_CheckNumForNamePwad(const char *name, UINT16 wad, UINT16 startlump)
{
lumpinfo_t *lump_p = wadfiles[wad]->lumpinfo + startlump;
for (i = startlump; i < wadfiles[wad]->numlumps; i++, lump_p++)
if (memcmp(lump_p->name, uname, sizeof(uname) - 1) == 0)
if (lump_p->namelength == namelen
&& lump_p->hash.name == hash
&& !memcmp(lump_p->name, uname, sizeof(uname) - 1))
return i;
}
@@ -1010,13 +1051,12 @@ UINT16 W_CheckNumForNamePwad(const char *name, UINT16 wad, UINT16 startlump)
UINT16 W_CheckNumForLongNamePwad(const char *name, UINT16 wad, UINT16 startlump)
{
UINT16 i;
static char uname[256 + 1];
if (!TestValidLump(wad,0))
return INT16_MAX;
strlcpy(uname, name, sizeof uname);
strupr(uname);
size_t namelen = strlen(name);
UINT32 hash = W_HashLumpName(name);
//
// scan forward
@@ -1027,7 +1067,9 @@ UINT16 W_CheckNumForLongNamePwad(const char *name, UINT16 wad, UINT16 startlump)
{
lumpinfo_t *lump_p = wadfiles[wad]->lumpinfo + startlump;
for (i = startlump; i < wadfiles[wad]->numlumps; i++, lump_p++)
if (!strcmp(lump_p->longname, uname))
if (lump_p->longnamelength == namelen
&& lump_p->hash.longname == hash
&& !stricmp(lump_p->longname, name))
return i;
}
@@ -1051,6 +1093,12 @@ UINT16 W_CheckNumForFolderStartPK3(const char *name, UINT16 wad, UINT16 startlum
INT32 i;
lumpinfo_t *lump_p = wadfiles[wad]->lumpinfo + startlump;
name_length = strlen(name);
UINT32 hash = quickncasehash(name, name_length);
void *val = M_AATreeGet(wadfiles[wad]->startfolders, hash);
if (val != NULL)
return (uintptr_t)val;
for (i = startlump; i < wadfiles[wad]->numlumps; i++, lump_p++)
{
if (strnicmp(name, lump_p->fullname, name_length) == 0)
@@ -1058,10 +1106,16 @@ UINT16 W_CheckNumForFolderStartPK3(const char *name, UINT16 wad, UINT16 startlum
/* SLADE is special and puts a single directory entry. Skip that. */
if (strlen(lump_p->fullname) == name_length)
i++;
break;
M_AATreeSet(wadfiles[wad]->startfolders, hash, (void *)(uintptr_t)i);
return i;
}
}
return i;
M_AATreeSet(wadfiles[wad]->startfolders, hash, (void *)INT16_MAX);
return INT16_MAX;
}
// In a PK3 type of resource file, it looks for the next lumpinfo entry that doesn't share the specified pathfile.
@@ -1072,11 +1126,20 @@ UINT16 W_CheckNumForFolderEndPK3(const char *name, UINT16 wad, UINT16 startlump)
INT32 i;
lumpinfo_t *lump_p = wadfiles[wad]->lumpinfo + startlump;
size_t name_length = strlen(name);
UINT32 hash = quickncasehash(name, name_length);
void *val = M_AATreeGet(wadfiles[wad]->endfolders, hash);
if (val != NULL)
return (uintptr_t)val;
for (i = startlump; i < wadfiles[wad]->numlumps; i++, lump_p++)
{
if (strnicmp(name, lump_p->fullname, name_length))
break;
}
M_AATreeSet(wadfiles[wad]->endfolders, hash, (void *)(uintptr_t)i);
return i;
}
@@ -1201,41 +1264,6 @@ lumpnum_t W_CheckNumForLongName(const char *name)
}
}
// Look for valid map data through all added files in descendant order.
// Get a map marker for WADs, and a standalone WAD file lump inside PK3s.
// TODO: Make it search through cache first, maybe...?
lumpnum_t W_CheckNumForMap(const char *name)
{
UINT16 lumpNum, end;
UINT32 i;
for (i = numwadfiles - 1; i < numwadfiles; i--)
{
if (wadfiles[i]->type == RET_WAD)
{
for (lumpNum = 0; lumpNum < wadfiles[i]->numlumps; lumpNum++)
if (!strncmp(name, (wadfiles[i]->lumpinfo + lumpNum)->name, 8))
return (i<<16) + lumpNum;
}
else if (wadfiles[i]->type == RET_PK3)
{
lumpNum = W_CheckNumForFolderStartPK3("maps/", i, 0);
if (lumpNum != INT16_MAX)
end = W_CheckNumForFolderEndPK3("maps/", i, lumpNum);
else
continue;
// Now look for the specified map.
for (; lumpNum < end; lumpNum++)
if (!strnicmp(name, (wadfiles[i]->lumpinfo + lumpNum)->name, 8))
{
const char *extension = strrchr(wadfiles[i]->lumpinfo[lumpNum].fullname, '.');
if (!(extension && stricmp(extension, ".wad")))
return (i<<16) + lumpNum;
}
}
}
return LUMPERROR;
}
//
// W_GetNumForName
//
+17 -1
View File
@@ -22,6 +22,8 @@ extern "C" {
#include "hardware/hw_data.h"
#endif
#include "m_aatree.h"
#ifdef __GNUG__
#pragma interface
#endif
@@ -75,8 +77,19 @@ typedef struct
char name[9]; // filelump_t name[] e.g. "LongEntr"
char *longname; // e.g. "LongEntryName"
char *fullname; // e.g. "Folder/Subfolder/LongEntryName.extension"
size_t namelength; // length of name
size_t longnamelength; // length of longname
size_t fullnamelength; // length of fullname
size_t size; // real (uncompressed) size
compmethod compression; // lump compression method
struct {
UINT32 name; // hash of name
UINT32 longname; // hash of longname
UINT32 fullname; // hash of fullname
} hash;
} lumpinfo_t;
// =========================================================================
@@ -131,6 +144,8 @@ typedef struct wadfile_s
#ifdef ROTSPRITE
lumpcache_t *rotcache; // Cache rotsprites for rotating patches.
#endif
aatree_t *startfolders;
aatree_t *endfolders;
UINT16 numlumps; // this wad's number of resources
FILE *handle;
UINT32 filesize; // for network
@@ -167,6 +182,8 @@ INT32 W_AddAutoloadedLocalFiles(char **filenames);
#define W_FileHasFolders(wadfile) ((wadfile)->type == RET_PK3)
UINT32 W_HashLumpName(const char *name);
const char *W_CheckNameForNumPwad(UINT16 wad, UINT16 lump);
const char *W_CheckNameForNum(lumpnum_t lumpnum);
@@ -180,7 +197,6 @@ UINT16 W_CheckNumForFullNamePK3(const char *name, UINT16 wad, UINT16 startlump);
UINT16 W_CheckNumForFolderStartPK3(const char *name, UINT16 wad, UINT16 startlump);
UINT16 W_CheckNumForFolderEndPK3(const char *name, UINT16 wad, UINT16 startlump);
lumpnum_t W_CheckNumForMap(const char *name);
lumpnum_t W_CheckNumForName(const char *name);
lumpnum_t W_CheckNumForLongName(const char *name);
lumpnum_t W_GetNumForName(const char *name); // like W_CheckNumForName but I_Error on LUMPERROR