Compare commits

...

157 Commits

Author SHA1 Message Date
James R de37af7d1d Merge remote-tracking branch 'srb2-pub/next' into srb2-merge 2019-10-07 18:25:52 -07:00
James R 34bddc1ce7 Merge remote-tracking branch 'origin/master' into next 2019-10-07 18:19:48 -07:00
James R 91d3f7e2cc Merge branch 'fix-fixedrem' into 'next'
Make FixedRem less laggy by just using the modulo operator.

See merge request STJr/SRB2!503
2019-10-07 21:16:33 -04:00
James R b32a0315eb Merge branch 'fix-MF_NOCLIPTHING' into 'next'
Fix MF_NOCLIPTHING

See merge request STJr/SRB2!467
2019-10-07 21:14:49 -04:00
James R 88615f58cf Merge branch 'lua-error-print-fix' into 'master'
Lua: Fix some errors not working properly.

See merge request STJr/SRB2!510
2019-10-07 21:09:00 -04:00
Alam Ed Arias bf28a7f5bc Merge branch 'master' into next 2019-09-20 12:32:32 -04:00
Alam Ed Arias 92779487a4 avoid the source code from getting the wrong EOL 2019-09-20 12:32:18 -04:00
James R 4eae79bdb4 Fix NOHW compiling 2019-09-18 10:55:46 -07:00
James R 5ef48c186f Fallthroughs 2019-09-18 10:53:19 -07:00
James R 03a590ad98 fallthru is not FALLTHRU
(Case matters.)
2019-09-18 10:51:57 -07:00
James R fc2f130a70 Merge remote-tracking branch 'srb2-pub/master' into srb2-merge 2019-09-18 10:46:42 -07:00
Alam Ed Arias 062f0278bc Merge branch 'master' into next 2019-09-17 14:20:48 -04:00
Alam Ed Arias 78075ecd89 Fix FALLTHRU for Win32 console interface code 2019-09-17 14:18:27 -04:00
GoldenTails 14cd7a5a0c Merge branch 'master' into fix-fixedrem 2019-09-07 12:19:13 -05:00
Alam Ed Arias 028996915d Merge branch 'master' into next 2019-08-29 19:28:02 -04:00
Alam Ed Arias dadec1196b Warn on implicit fallthrough 2019-08-29 19:27:52 -04:00
Steel Titanium 13d627ee7f Remove extra whitespace 2019-08-24 18:29:56 -04:00
Monster Iestyn 964693d542 Merge branch 'master' into next 2019-08-24 23:28:38 +01:00
Steel Titanium 08808e2200 I don't even know how this happened 2019-08-24 18:27:07 -04:00
Steel Titanium 9f7613ef6d Typecast p to INT16
Since the enum type is implementation-defined, and could be either signed or unsigned.
2019-08-24 18:22:18 -04:00
Monster Iestyn 7a199748b9 Merge branch 'based-files' into 'master'
Compare the file name only for real

See merge request STJr/SRB2!511
2019-08-24 15:51:11 -04:00
Monster Iestyn 7090413417 Merge branch 'calling-all-lua-consvars' into 'next'
Calling all Lua consvars

See merge request STJr/SRB2!509
2019-08-24 15:50:43 -04:00
James R e5071bb605 Compare the file name only for real
CL_SendRequestFile prepends the path for each file.
2019-08-23 11:00:05 -07:00
GoldenTails 74de804817 Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2 into fix-fixedrem 2019-08-22 06:27:00 -05:00
Steel Titanium 7731bf6b09 Use correct integer format 2019-08-21 21:25:45 -04:00
Steel Titanium 6ef9ee5467 true not TRUE 2019-08-20 15:43:59 -04:00
Monster Iestyn 2dd5f1abe3 Fixes for lib_cvRegisterVar (the Lua version of CV_RegisterVar):
* Make sure the consvar's properties are all initialised to zeros as defaults
* Error if the consvar is not given a name
* Error if the consvar has CV_CALL but no call function
* Error if the consvar has CV_NOINIT but not CV_CALL
2019-08-20 18:18:29 +01:00
James R 4c5ad4bb42 I alway manage to fuck up a merge. Yes, it's true! 2019-08-20 10:05:32 -07:00
James R ed6dcf0b84 Merge remote-tracking branch 'srb2-pub/master' into srb2-merge 2019-08-19 15:29:34 -07:00
GoldenTails ac7db85149 Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2 into fix-fixedrem 2019-08-17 21:17:38 -05:00
Monster Iestyn c50831f875 Merge branch '2.1.25-prep' into 'next'
Update version to 2.1.25

See merge request STJr/SRB2!507
2019-08-17 14:07:04 -04:00
Monster Iestyn 9a4a90c9cb Merge branch 'netcode-exploits' into 'next'
Fix an exploit where players could steal the final hash of a login

See merge request STJr/SRB2!508
2019-08-17 14:05:20 -04:00
James R 9c1fa867fa Include md5.h 2019-08-17 10:34:19 -07:00
James R c1ba72ead8 Remove a printf 2019-08-17 10:33:33 -07:00
James R 19dd9a3c14 Kart discrepancies 2019-08-17 10:33:14 -07:00
Monster Iestyn 0949406b9c Update MD5 for patch.dta 2019-08-17 18:15:23 +01:00
Monster Iestyn 450ea0cc43 Disable the level end music fade code for now, because we discovered it causes freezes sometimes. 2019-08-16 23:19:43 +01:00
Monster Iestyn e52a314ddb Update version to 2.1.25 2019-08-16 20:14:01 +01:00
Monster Iestyn 99f04f1d89 Merge branch 'polyobj-crush-fix-mi' into 'next'
PolyObject crush hotfix

See merge request STJr/SRB2!506
2019-08-16 12:04:56 -04:00
Monster Iestyn ae9ecef592 Use P_MobjInsidePolyobj instead of P_MobjTouchingPolyobj, so that you can be crushed by the polyobject's middle rather than just its edges 2019-08-16 14:54:01 +01:00
Monster Iestyn 392cb89ff4 Merge branch 'polyobj-fixes-backport' into 'next'
PolyObject fixes backport

See merge request STJr/SRB2!505
2019-08-15 13:51:46 -04:00
Monster Iestyn bbefc3b7f4 After looking at the FOF part of P_LineOpening for a while I now realise many of these variables aren't even necessary, so I removed them all.
(Naturally I did the same to the camera equivalent)

# Conflicts:
#	src/p_maputl.c
2019-08-15 14:30:10 +01:00
Monster Iestyn cda81cc166 Edit a lot of the rest of the polyobject-related code in P_LineOpening to make more sense and be more optimised.
* If you collide with a line belonging to a polyobject, you should NEVER have to care about any FOFs that might be present in either sector of the linedef. This could lead to colliding with ghostly FOFs that aren't actually there or something dumb, if someone decided to give either of the polyobject's control sectors FOFs for some reason. We don't want that, obviously.
* Polyobjects without POF_CLIPPLANE apparently are supposed to have a top and bottom "physical" height of value INT32_MAX and _MIN respectively, according to P_CheckPosition ...let's be consistent with this.
* Finally, there is no more need for that back = front nonsense hack anymore with my changes made.

# Conflicts:
#	src/p_maputl.c
2019-08-15 14:28:06 +01:00
Monster Iestyn c8d1dd3be8 P_LineOpening: set int32 max/min as defaults for opentop, openbottom etc if a linedef you touched belongs to a polyobjetc. the only thing that really matters in this scenario is the polyobject itself after all!
# Conflicts:
#	src/p_maputl.c
2019-08-15 14:25:02 +01:00
Monster Iestyn 27dd99ae72 Remove commented out P_CheckSector calls and add extra comments explaining the situation 2019-08-15 14:21:19 +01:00
Monster Iestyn 8fa54c1ab4 Modify P_CheckSector with a modified version of Sal's attempted proper fix for polyobjects crushing, so that we only need to check the polyobject's control sector directly in the waypoints code.
This time I've definitely fixed that teleport to ground issue I'm pretty sure, I don't get it in my tests at least.
2019-08-15 14:20:52 +01:00
James R d9e29f15cd Merge remote-tracking branch 'srb2-pub/master' into srb2-merge 2019-08-11 18:07:18 -07:00
GoldenTails aa165f4f19 Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2 into fix-fixedrem 2019-08-10 19:48:19 -05:00
Alam Ed Arias 81b294eec1 Merge branch 'master' into next 2019-08-08 23:18:31 -04:00
Alam Ed Arias 0c2b300294 Appveyor: other way around, the Mingw32 is at 9.1 2019-08-08 23:05:24 -04:00
Alam Ed Arias 33c0b825a7 Appveyor: the Mingw64 is 9.1, the Mingw32 is still 7.3 2019-08-08 23:02:03 -04:00
Alam Ed Arias 268b5a09d9 Disable address-of-packed-member warning 2019-08-08 22:47:33 -04:00
Alam Ed Arias eacf89e309 Makefile: GCC80 does not exist 2019-08-08 22:34:09 -04:00
Alam Ed Arias b773b61b8c Revert "Try to compile with AppVeyor's GCC 9.1.0"
This reverts commit 749c2753e4.
2019-08-08 22:31:18 -04:00
Alam Ed Arias 749c2753e4 Try to compile with AppVeyor's GCC 9.1.0 2019-08-08 22:19:22 -04:00
Alam Ed Arias 5a79a446df Tested to be compile with Mingw64 9.1.0 2019-08-08 21:25:46 -04:00
Alam Ed Arias d5cc3ce48d Makefile: support GCC 9.1 2019-08-08 20:27:57 -04:00
Alam Ed Arias 07f89fd6b5 Makefile: stop building with DWARF v2 debugging info 2019-08-08 18:43:42 -04:00
Alam Ed Arias 963d2f5da3 Merge branch 'master' into next 2019-07-29 18:05:33 -04:00
Alam Ed Arias 66f84efd02 SDL2: fixed compiling mixer interface with MSVC 2019-07-29 17:56:35 -04:00
Monster Iestyn 6eaf7625a9 Merge branch 'master' into next 2019-07-16 18:26:46 +01:00
Monster Iestyn 3e708e62e8 Merge branch 'fix-gme-free' into 'master'
Fix crash with GME sounds when being freed

See merge request STJr/SRB2!504
2019-07-16 13:25:51 -04:00
James R 91502f1499 Don't send login final hashes to everyone
Someone thought it was a good fucking idea to make logins NetXCmds. NetXCmds
are sent to everyone however. Thankfully logins are two passes. And the second
pass uses a salt based on the playernum. Therefore, in order to actually make
use of the final hash, you'd have to be the same playernum as who originally
sent it. Still a stupid exploit.

P.S. The netcode is LOL XD by VincyTM -Telos
2019-07-15 16:14:00 -07:00
Steel Titanium 4e839596a1
Fix crash with GME sounds when being freed 2019-07-14 14:55:04 -04:00
GoldenTails cfc9e23c43 Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2 into fix-fixedrem 2019-07-08 08:45:24 -05:00
GoldenTails e9771cd7d0 Make FixedRem less laggy by just using the modulo operator. 2019-07-08 08:39:31 -05:00
Monster Iestyn 3a9ce483f5 Merge branch 'master' into next
# Conflicts:
#	src/r_data.c
2019-06-28 23:24:36 +01:00
Steel Titanium 2c906e9c29 Merge branch 'jimita-unfuck-awayview' into 'next'
unfuck awayview

See merge request STJr/SRB2!493
2019-06-28 18:21:52 -04:00
Steel Titanium 47eb711097 Merge branch 'public-musicplus-feature-endoflevel' into 'next'
Fade out music at end of level, before intermission

See merge request STJr/SRB2!472
2019-06-28 18:21:07 -04:00
Steel Titanium f7357a02ae Merge branch 'pk3-folders-are-not-textures-backport' into 'next'
Pk3 folders are not textures!

See merge request STJr/SRB2!502
2019-06-28 18:18:53 -04:00
Steel Titanium 016f1fe533 Merge branch 'morememoryshenanigans' into 'master'
More Memory Shenanigans

See merge request STJr/SRB2!501
2019-06-28 18:18:14 -04:00
Monster Iestyn 826e8e1aaf Fixed goofups I missed back 3 months ago 2019-06-23 17:51:58 +01:00
Monster Iestyn d9ca8b45d3 Saving work so far, UNTESTED
# Conflicts:
#	src/r_data.c
2019-06-23 17:51:36 +01:00
Sryder 8a778a4070 Simply truncate the per-map COLORMAP lump instead of not reading it at all.
Keep the warning though.
2019-06-23 15:02:32 +01:00
Sryder 5f339fc2a9 Don't overlap strncpy in WAD file load 2019-06-23 14:52:49 +01:00
Sryder bb9b1b3b1f Change COLORMAP lump size check to be exact
A lower size could technically be valid, but could easily run into strange issues.
2019-06-23 13:49:39 +01:00
Sryder bc254d9cf7 Kill Texture SOC feature.
As far as I know it's basically unused, and the strstr is inherently unsafe because there's no guarantee that a patch's contents are NULL terminated.
2019-06-23 13:48:29 +01:00
Sryder 45922f80d1 Don't read from a per-map COLORMAP if it is too big.
Could this be changed to only read the first so many bytes?
2019-06-23 12:47:20 +01:00
Monster Iestyn c9456e141d Merge branch 'master' into next 2019-06-22 22:42:13 +01:00
Monster Iestyn 755e4a8b2c Merge branch 'make-credits-great-again' into 'next'
Prevent just anyone from skipping credits but allow admins

See merge request STJr/SRB2!478
2019-06-22 16:13:04 -04:00
Monster Iestyn 1af969d579 Merge branch 'pk3_leak' into 'master'
Pk3 Leaks

See merge request STJr/SRB2!500
2019-06-22 15:56:52 -04:00
Sryder13 8444379d53 Free the zentries 2019-06-22 00:52:28 +01:00
Sryder13 83da71f809 Merge branch 'master' into pk3_leak 2019-06-22 00:28:14 +01:00
Sryder13 dcd4995eb3 Remember to end inflating 2019-06-22 00:19:34 +01:00
Monster Iestyn f84c898040 Merge branch 'master' into next 2019-06-21 22:10:32 +01:00
Monster Iestyn fb182369f6 Merge branch 'stand(alone)-lump-comedy' into 'master'
Stand(alone) lump comedy

See merge request STJr/SRB2!499
2019-06-21 17:06:23 -04:00
Monster Iestyn 04215b732e Merge branch 'fof-slopes-level-load-fix' into 'next'
FOF slopes level load fix

See merge request STJr/SRB2!498
2019-06-21 17:05:54 -04:00
Monster Iestyn bc2804d383 Fix the clearly accidental duplication of lumpinfo's memory allocation in ResGetLumpsStandalone 2019-06-20 13:24:54 +01:00
Monster Iestyn 62ed90b252 fix type mismatch by typecasting 2019-06-17 20:54:06 +01:00
Monster Iestyn 1638fad75e Part 2 of fix, make sure copied slopes also pass on hasslope status to attached target sectors for FOFs
Also fix whitespace to use tab-style spaces instead of regular spaces, ew
2019-06-17 19:00:04 +01:00
Monster Iestyn 50e8f13c03 Fix FOF slopes briefly glitching on level load in software mode, by ensuring the FOFs' target sectors have hasslope set on creation 2019-06-17 18:46:51 +01:00
Monster Iestyn 96b12f098b Merge branch 'apng-opengl' into 'master'
opengl apng fix

See merge request STJr/SRB2!497
2019-06-14 13:29:13 -04:00
Jaime Passos c591633733 Update m_misc.c 2019-06-14 14:13:41 -03:00
Steel Titanium bfa7325295 Merge branch '2.1.24-prep' into 'next'
Update version to 2.1.24

See merge request STJr/SRB2!495
2019-06-08 17:08:34 -04:00
Monster Iestyn f5d883bd12 Merge branch 'next' into 2.1.24-prep
# Conflicts:
#	debian-template/control
#	debian/changelog
2019-06-07 23:18:31 +01:00
Alam Ed Arias ea08ba3fba Merge branch 'master' into next 2019-06-07 18:07:32 -04:00
Alam Ed Arias 83b8a98df4 Merge branch 'gme-msvc' into 'master'
Add GME to MSVC 10 solution

See merge request STJr/SRB2!448
2019-06-07 18:06:51 -04:00
Steel Titanium c0c1e5416f Merge branch 'next' into 2.1.24-prep 2019-06-07 18:02:09 -04:00
Alam Ed Arias 3edf73f181 Merge branch 'travis-deployer' into 'master'
Deploy OS X and Debian packages from Travis-CI

See merge request STJr/SRB2!449
2019-06-07 17:57:29 -04:00
Steel Titanium 3c08ee1313 Merge branch 'master' into travis-deployer
# Conflicts:
#	.travis.yml
2019-06-07 16:56:19 -04:00
Steel Titanium e1d025cd2b Merge branch 'jimita-flashpals-on-screenshots' into 'next'
Flashpals on screenshots

See merge request STJr/SRB2!492
2019-06-07 16:37:59 -04:00
Steel Titanium eb99ad0437 Merge branch 'more-limits' into 2.1.24-prep 2019-06-07 11:28:43 -04:00
Monster Iestyn 6f6d912fa6 Update version to 2.1.24 2019-06-07 15:48:33 +01:00
Steel Titanium d4dac52766 Upped freeslots limit 2019-06-03 15:23:48 -04:00
Steel Titanium 34ce368895 Merge branch 'next' into jimita-unfuck-awayview 2019-05-25 19:47:45 -04:00
Steel Titanium dc273d3f23 Merge branch 'next' into jimita-flashpals-on-screenshots 2019-05-25 19:37:17 -04:00
Monster Iestyn 600a373739 Merge branch 'master' into next 2019-05-13 16:07:30 +01:00
Monster Iestyn 2a9019c15e Merge branch 'archiveworld-sigsegv-fix' into 'next'
Fix SIGSEGV from sending lindefs/sidedefs in savegame due to duplicated lines.

See merge request STJr/SRB2!490
2019-05-13 07:02:48 -04:00
Alam Ed Arias addf2bb3c4 Fix NONET build 2019-05-13 01:51:36 -04:00
Steel Titanium 8a14427420 Merge branch 'perpetual-modifier-updates' into 'master'
Set modifiers in a non-reactive manner

See merge request STJr/SRB2!456
2019-05-13 00:36:06 -04:00
Steel Titanium 06961a8f5e Merge branch 'no-frameskip' into 'next'
Don't skip frames when connecting or paused

See merge request STJr/SRB2!489
2019-05-13 00:35:11 -04:00
Steel Titanium cad65ad5e9 Properly fix crash due to duplicated lines. 2019-05-13 00:23:43 -04:00
Steel Titanium 4e0cc2505a Revert "Check that lumps are okay"
This reverts commit 7ac0a8b4d2.
2019-05-13 00:20:39 -04:00
James R 7ac0a8b4d2 Check that lumps are okay 2019-05-08 20:30:19 -04:00
Monster Iestyn f0e16cad32 Merge branch 'master' into next 2019-05-08 16:31:05 +01:00
Monster Iestyn 8ea9d0e95c Merge branch 'alias_recursion_hotfix_2' into 'master'
Alias recursion hotfix 2

See merge request STJr/SRB2!482
2019-05-08 11:25:15 -04:00
wolfy852 8f05d75926 Don't skip frames when connecting or paused 2019-05-08 09:39:45 -05:00
Monster Iestyn 797ca99f42 Detect infinite alias self-recursion mixed with other commands, such as in the case of `alias a "echo test; a"; a`.
(Unfortunately, this does not work if "wait" is used instead of "echo", but oh well)
2019-04-14 16:39:14 +01:00
James R d00cc7cddb Prevent just anyone from skipping credits but allow admins
exitlevel works too
2019-03-25 16:19:40 -07:00
Jimita 6e4b42fc97
Merge branch 'next' into flashpals-on-screenshots 2019-03-15 16:38:33 -03:00
mazmazz f18103a473 Declare exitfadestarted properly 2019-03-15 11:01:41 -04:00
mazmazz 587a51a957 Fix end-of-level fading for cv_playersforexit
(Code in p_user.c was from 2.2, where cv_playersforexit has different values so that the player exit check works differently)
2019-03-15 03:47:30 -04:00
mazmazz a1ccb8512d Merge branch 'public-gl-next' into public-musicplus-feature-endoflevel 2019-03-15 02:07:53 -04:00
mazmazz e098d6a8b8 Merge branch 'public-musicplus-feature-interfadeout' into public-musicplus-feature-endoflevel 2019-03-15 01:09:12 -04:00
mazmazz ba77dfd546 Merge branch 'public-musicplus-feature-interfadeout' into public-musicplus-feature-endoflevel 2019-03-15 01:01:24 -04:00
mazmazz b5fc27c545 Implement MUSICINTERFADEOUT level header 2019-03-15 01:00:50 -04:00
mazmazz 773f9dc2ba Merge remote-tracking branch 'public-gl/next' into public-musicplus-feature-endoflevel 2019-03-15 00:39:26 -04:00
Jimita the Cat 0186f6784b a 2019-03-06 21:40:38 -03:00
Steel Titanium 34645238d4 Fix MF_NOCLIPTHING 2019-03-03 20:08:11 -05:00
james 356249dade Set modifiers in a non-reactive manner 2019-01-17 16:47:01 -08:00
Jimita 424b2b1aaf
Merge branch 'next' into flashpals-on-screenshots 2019-01-16 05:59:05 -02:00
mazmazz 2592f42a17 Remove unnecessary version info call 2019-01-05 19:56:27 -05:00
mazmazz 20879f1f40 Remove zlib from release brew packages
(it was never in the original travis script)
2019-01-05 19:49:25 -05:00
mazmazz 17cde328c1 Use standard OSX brew bottles to speed up test buildbots 2019-01-05 19:43:37 -05:00
mazmazz 9ef7d2e6ba OS X set CFLAGS+="-march=core2" for compatible binaries with old Macs 2019-01-05 19:34:39 -05:00
mazmazz 0834dbc194 * Add homebrew tap mazmazz/srb2
* Use sdl2_mixer from mazmazz/srb2 due to removed options from homebrew-core
* Use `brew install --build-bottle` to build compatible libraries for old Macs
2019-01-05 19:20:58 -05:00
mazmazz 97f8448b72 Don't terminate in after_success because it halts the log abruptly 2019-01-05 10:17:33 -05:00
mazmazz abaa8730a5 Revised comments 2019-01-05 09:54:45 -05:00
mazmazz 578a4fe80d Merge remote-tracking branch 'public-gl/master' into travis-deployer 2019-01-05 09:08:34 -05:00
Marco Z 882355d24b Specify HAVE_LIBGME, paths, and depends only for Win32/x64 MSVC 2019-01-04 21:18:55 -05:00
Marco Z 09ed8bd046 Add LibGME to DD vc10 project 2019-01-04 20:43:45 -05:00
Marco Z 88c4a54cea Add GME to VC10 SRB2SDL project 2019-01-04 20:43:42 -05:00
mazmazz ac7b29eb2d Add __DPL_ACTIVE condition to optional asset download 2019-01-02 20:48:46 -05:00
mazmazz 9b3174c4f4 Correct asset directory for travis 2019-01-02 18:38:02 -05:00
Jimita the Cat c3d69a8a04 Merge branch 'flashpals-on-screenshots' of https://github.com/monster-psychic-cat/SRB2 into flashpals-on-screenshots 2019-01-02 01:02:14 -03:00
Jimita the Cat 892e650712 dumb 2019-01-02 01:01:57 -03:00
Jimita 8fdff96733
Merge branch 'next' into flashpals-on-screenshots 2019-01-02 01:55:59 -02:00
Jimita the Cat e765b9400c Add support for flashpals in screenshots 2019-01-02 00:41:52 -03:00
mazmazz 4d4b048ead Don't download individual asset files; support only archives 2018-12-31 19:11:01 -05:00
mazmazz 78fa72514f Implement deployer scripts for Travis -- OSX and Linux package building 2018-12-30 15:22:50 -05:00
mazmazz 0bc6b2e4d8 Merge branch 'public-musicplus-core' into public-musicplus-feature-endoflevel 2018-09-19 19:56:54 -04:00
mazmazz be5555d393 Merge branch 'public-musicplus-core' into public-musicplus-feature-endoflevel 2018-09-19 19:32:52 -04:00
mazmazz 75558c40a2 Merge branch 'public-musicplus-core' into public-musicplus-feature-endoflevel 2018-09-19 18:55:01 -04:00
mazmazz 481c0d7623 EndOfLevel: 2.1 _clear -> lclear music in y_inter 2018-09-18 23:32:00 -04:00
mazmazz b057b2932d EndOfLevel: 2.1 dehacked setup fix 2018-09-18 23:28:39 -04:00
mazmazz 1dd47e850b EndOfLevel: Check player->exiting > 0 && <= TICRATE, fixes start-of-level fading in 2.1
Braces in y_inter.c
2018-09-18 23:27:00 -04:00
mazmazz d542c2440d musicplus-feature-endoflevel 2.2 -> 2.1 backport 2018-09-18 15:50:12 -04:00
50 changed files with 635 additions and 441 deletions

9
.gitattributes vendored
View File

@ -1,3 +1,12 @@
#Source code
/src/*.c text=auto
/src/*.h text=auto
/src/*.s text=auto
/src/*.m text=auto
/src/*.xpm text=auto
/src/Makefile text=auto
/src/Make*.cfg text=auto
/src/CMakeLists.txt text=auto
# Windows EOL
*.cs -crlf -whitespace
*.mk -crlf -whitespace

View File

@ -92,8 +92,8 @@ before_build:
- ccache -V
- ccache -s
- if [%NOUPX%] == [1] ( set "NOUPX=NOUPX=1" ) else ( set "NOUPX=" )
- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 GCC72=1 NOOBJDUMP=1 %NOUPX%"
- if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1" ) else ( set "MINGW_FLAGS=MINGW=1" )
- set "SRB2_MFLAGS=-C src WARNINGMODE=1 CCACHE=1 GCC73=1 NOOBJDUMP=1 %NOUPX%"
- if [%X86_64%] == [1] ( set "MINGW_FLAGS=MINGW64=1 X86_64=1" ) else ( set "MINGW_FLAGS=MINGW=1 GCC91=1" )
- set "SRB2_MFLAGS=%SRB2_MFLAGS% %MINGW_FLAGS% %CONFIGURATION%=1"
build_script:

16
libs/libgme.props Normal file
View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Platform)' == 'Win32' OR '$(Platform)' == 'x64'">
<IncludePath>$(SolutionDir)libs\gme\include;$(IncludePath)</IncludePath>
<LibraryPath Condition="'$(Platform)' == 'Win32'">$(SolutionDir)libs\gme\win32;$(LibraryPath)</LibraryPath>
<LibraryPath Condition="'$(Platform)' == 'x64'">$(SolutionDir)libs\gme\win64;$(LibraryPath)</LibraryPath>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Platform)' == 'Win32' OR '$(Platform)' == 'x64'">
<Link>
<AdditionalDependencies>libgme.dll.a;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

View File

@ -7,11 +7,19 @@
# and other things
#
ifdef GCC81
GCC80=1
ifdef GCC91
GCC83=1
endif
ifdef GCC80
ifdef GCC83
GCC82=1
endif
ifdef GCC82
GCC81=1
endif
ifdef GCC81
GCC72=1
endif
@ -146,6 +154,9 @@ ifdef GCC43
endif
endif
WFLAGS+=-Wsign-compare
ifdef GCC91
WFLAGS+=-Wno-error=address-of-packed-member
endif
ifdef GCC45
WFLAGS+=-Wlogical-op
endif
@ -186,6 +197,9 @@ ifndef GCC295
endif
endif
WFLAGS+=-Wformat-y2k
ifdef GCC71
WFLAGS+=-Wno-error=format-overflow=2
endif
WFLAGS+=-Wformat-security
ifndef GCC29
#WFLAGS+=-Winit-self
@ -220,11 +234,10 @@ ifdef GCC61
WFLAGS+=-Wno-tautological-compare -Wno-error=tautological-compare
endif
ifdef GCC71
WFLAGS+=-Wno-error=implicit-fallthrough
WFLAGS+=-Wno-implicit-fallthrough
WFLAGS+=-Wimplicit-fallthrough=4
WFLAGS+=-Wno-error=format-truncation
endif
ifdef GCC80
ifdef GCC81
WFLAGS+=-Wno-error=format-overflow
WFLAGS+=-Wno-error=stringop-truncation
WFLAGS+=-Wno-error=stringop-overflow

View File

@ -532,7 +532,6 @@ static void COM_ExecuteString(char *ptext)
{
if (!stricmp(com_argv[0], cmd->name)) //case insensitive now that we have lower and uppercase!
{
recursion = 0;
cmd->function();
return;
}
@ -544,10 +543,7 @@ static void COM_ExecuteString(char *ptext)
if (!stricmp(com_argv[0], a->name))
{
if (recursion > MAX_ALIAS_RECURSION)
{
CONS_Alert(CONS_WARNING, M_GetText("Alias recursion cycle detected!\n"));
recursion = 0;
}
else
{
char buf[1024];
@ -581,13 +577,12 @@ static void COM_ExecuteString(char *ptext)
recursion++;
COM_BufInsertText(buf);
recursion--;
}
return;
}
}
recursion = 0;
// check cvars
// Hurdler: added at Ebola's request ;)
// (don't flood the console in software mode with bad gr_xxx command)

View File

@ -1112,17 +1112,7 @@ boolean CON_Responder(event_t *ev)
else if (key == KEY_KPADSLASH)
key = '/';
// same capslock code as hu_stuff.c's HU_responder. Check there for details.
if ((key >= 'a' && key <= 'z') || (key >= 'A' && key <= 'Z'))
{
if (shiftdown ^ capslock)
key = shiftxform[key];
}
else
{
if (shiftdown)
key = shiftxform[key];
}
key = CON_ShiftChar(key);
// enter a char into the command prompt
if (key < 32 || key > 127)

View File

@ -47,6 +47,7 @@
#include "lua_script.h"
#include "lua_hook.h"
#include "k_kart.h"
#include "md5.h"
#ifdef CLIENT_LOADINGSCREEN
// cl loading screen
@ -124,6 +125,9 @@ UINT8 hu_resynching = 0;
// kart, true when a player is connecting or disconnecting so that the gameplay has stopped in its tracks
UINT8 hu_stopped = 0;
UINT8 adminpassmd5[16];
boolean adminpasswordset = false;
// Client specific
static ticcmd_t localcmds;
static ticcmd_t localcmds2;
@ -1240,6 +1244,7 @@ static inline void CL_DrawConnectionStatus(void)
case CL_ASKDOWNLOADFILES:
case CL_WAITDOWNLOADFILESRESPONSE:
cltext = M_GetText("Waiting to download files...");
/* FALLTHRU */
default:
cltext = M_GetText("Connecting to server...");
break;
@ -4229,6 +4234,7 @@ static void HandlePacketFromPlayer(SINT8 node)
XBOXSTATIC INT32 netconsole;
XBOXSTATIC tic_t realend, realstart;
XBOXSTATIC UINT8 *pak, *txtpak, numtxtpak;
XBOXSTATIC UINT8 finalmd5[16];/* Well, it's the cool thing to do? */
FILESTAMP
txtpak = NULL;
@ -4477,6 +4483,32 @@ FILESTAMP
textcmd[0] += (UINT8)netbuffer->u.textcmd[0];
}
break;
case PT_LOGIN:
if (client)
break;
#ifndef NOMD5
if (doomcom->datalength < 16)/* ignore partial sends */
break;
if (!adminpasswordset)
{
CONS_Printf(M_GetText("Password from %s failed (no password set).\n"), player_names[netconsole]);
break;
}
// Do the final pass to compare with the sent md5
D_MD5PasswordPass(adminpassmd5, 16, va("PNUM%02d", netconsole), &finalmd5);
if (!memcmp(netbuffer->u.md5sum, finalmd5, 16))
{
CONS_Printf(M_GetText("%s passed authentication.\n"), player_names[netconsole]);
COM_BufInsertText(va("promote %d\n", netconsole)); // do this immediately
}
else
CONS_Printf(M_GetText("Password from %s failed.\n"), player_names[netconsole]);
#endif
break;
case PT_NODETIMEOUT:
case PT_CLIENTQUIT:
if (client)
@ -5567,3 +5599,29 @@ tic_t GetLag(INT32 node)
{
return gametic - nettics[node];
}
void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt, void *dest)
{
#ifdef NOMD5
(void)buffer;
(void)len;
(void)salt;
memset(dest, 0, 16);
#else
XBOXSTATIC char tmpbuf[256];
const size_t sl = strlen(salt);
if (len > 256-sl)
len = 256-sl;
memcpy(tmpbuf, buffer, len);
memmove(&tmpbuf[len], salt, sl);
//strcpy(&tmpbuf[len], salt);
len += strlen(salt);
if (len < 256)
memset(&tmpbuf[len],0,256-len);
// Yes, we intentionally md5 the ENTIRE buffer regardless of size...
md5_buffer(tmpbuf, 256, dest);
#endif
}

View File

@ -97,6 +97,8 @@ typedef enum
PT_TELLFILESNEEDED, // Client, to server: "what other files do I need starting from this number?"
PT_MOREFILESNEEDED, // Server, to client: "you need these (+ more on top of those)"
PT_LOGIN, // Login attempt from the client.
PT_PING, // Packet sent to tell clients the other client's latency to server.
NUMPACKETTYPE
} packettype_t;
@ -464,6 +466,7 @@ typedef struct
filetx_pak filetxpak; // 139 bytes
clientconfig_pak clientcfg; // 153 bytes
joinchallenge_pak joinchallenge; // 17 bytes
UINT8 md5sum[16];
serverinfo_pak serverinfo; // 1024 bytes
serverrefuse_pak serverrefuse; // 65025 bytes (somehow I feel like those values are garbage...)
askinfo_pak askinfo; // 61 bytes
@ -600,6 +603,11 @@ void D_ResetTiccmds(void);
tic_t GetLag(INT32 node);
UINT8 GetFreeXCmdSize(void);
void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt, void *dest);
extern UINT8 hu_resynching;
extern UINT8 hu_stopped; // kart, true when the game is stopped for players due to a disconnecting or connecting player
extern UINT8 adminpassmd5[16];
extern boolean adminpasswordset;
#endif

View File

@ -180,39 +180,11 @@ void D_PostEvent_end(void) {};
#endif
// modifier keys
// Now handled in I_OsPolling
UINT8 shiftdown = 0; // 0x1 left, 0x2 right
UINT8 ctrldown = 0; // 0x1 left, 0x2 right
UINT8 altdown = 0; // 0x1 left, 0x2 right
boolean capslock = 0; // gee i wonder what this does.
//
// D_ModifierKeyResponder
// Sets global shift/ctrl/alt variables, never actually eats events
//
static inline void D_ModifierKeyResponder(event_t *ev)
{
if (ev->type == ev_keydown || ev->type == ev_console) switch (ev->data1)
{
case KEY_LSHIFT: shiftdown |= 0x1; return;
case KEY_RSHIFT: shiftdown |= 0x2; return;
case KEY_LCTRL: ctrldown |= 0x1; return;
case KEY_RCTRL: ctrldown |= 0x2; return;
case KEY_LALT: altdown |= 0x1; return;
case KEY_RALT: altdown |= 0x2; return;
case KEY_CAPSLOCK: capslock = !capslock; return;
default: return;
}
else if (ev->type == ev_keyup) switch (ev->data1)
{
case KEY_LSHIFT: shiftdown &= ~0x1; return;
case KEY_RSHIFT: shiftdown &= ~0x2; return;
case KEY_LCTRL: ctrldown &= ~0x1; return;
case KEY_RCTRL: ctrldown &= ~0x2; return;
case KEY_LALT: altdown &= ~0x1; return;
case KEY_RALT: altdown &= ~0x2; return;
default: return;
}
}
//
// D_ProcessEvents
@ -226,9 +198,6 @@ void D_ProcessEvents(void)
{
ev = &events[eventtail];
// Set global shift/ctrl/alt down variables
D_ModifierKeyResponder(ev); // never eats events
// Screenshots over everything so that they can be taken anywhere.
if (M_ScreenshotResponder(ev))
continue; // ate the event

View File

@ -34,13 +34,13 @@
#include "p_spec.h"
#include "m_cheat.h"
#include "d_clisrv.h"
#include "d_net.h"
#include "v_video.h"
#include "d_main.h"
#include "m_random.h"
#include "f_finale.h"
#include "filesrch.h"
#include "mserv.h"
#include "md5.h"
#include "z_zone.h"
#include "lua_script.h"
#include "lua_hook.h"
@ -48,6 +48,7 @@
#include "m_anigif.h"
#include "k_kart.h" // SRB2kart
#include "y_inter.h"
#include "md5.h"
#ifdef NETGAME_DEVMODE
#define CV_RESTRICT CV_NETVAR
@ -167,7 +168,6 @@ static void Command_Clearscores_f(void);
// Remote Administration
static void Command_Changepassword_f(void);
static void Command_Login_f(void);
static void Got_Login(UINT8 **cp, INT32 playernum);
static void Got_Verification(UINT8 **cp, INT32 playernum);
static void Got_Removal(UINT8 **cp, INT32 playernum);
static void Command_Verify_f(void);
@ -557,7 +557,6 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_dummyjoinpassword);
COM_AddCommand("joinpassword", Command_ChangeJoinPassword_f);
COM_AddCommand("password", Command_Changepassword_f);
RegisterNetXCmd(XD_LOGIN, Got_Login);
COM_AddCommand("login", Command_Login_f); // useful in dedicated to kick off remote admin
COM_AddCommand("promote", Command_Verify_f);
RegisterNetXCmd(XD_VERIFIED, Got_Verification);
@ -3666,36 +3665,7 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum)
// Attempts to make password system a little sane without
// rewriting the entire goddamn XD_file system
//
#include "md5.h"
static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt, void *dest)
{
#ifdef NOMD5
(void)buffer;
(void)len;
(void)salt;
memset(dest, 0, 16);
#else
XBOXSTATIC char tmpbuf[256];
const size_t sl = strlen(salt);
if (len > 256-sl)
len = 256-sl;
memcpy(tmpbuf, buffer, len);
memmove(&tmpbuf[len], salt, sl);
//strcpy(&tmpbuf[len], salt);
len += strlen(salt);
if (len < 256)
memset(&tmpbuf[len],0,256-len);
// Yes, we intentionally md5 the ENTIRE buffer regardless of size...
md5_buffer(tmpbuf, 256, dest);
#endif
}
#define BASESALT "basepasswordstorage"
static UINT8 adminpassmd5[MD5_LEN];
static boolean adminpasswordset = false;
void D_SetPassword(const char *pw)
{
@ -3733,7 +3703,6 @@ static void Command_Login_f(void)
// If we have no MD5 support then completely disable XD_LOGIN responses for security.
CONS_Alert(CONS_NOTICE, "Remote administration commands are not supported in this build.\n");
#else
XBOXSTATIC UINT8 finalmd5[MD5_LEN];
const char *pw;
if (!netgame)
@ -3753,47 +3722,15 @@ static void Command_Login_f(void)
pw = COM_Argv(1);
// Do the base pass to get what the server has (or should?)
D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &finalmd5);
D_MD5PasswordPass((const UINT8 *)pw, strlen(pw), BASESALT, &netbuffer->u.md5sum);
// Do the final pass to get the comparison the server will come up with
D_MD5PasswordPass(finalmd5, MD5_LEN, va("PNUM%02d", consoleplayer), &finalmd5);
D_MD5PasswordPass(netbuffer->u.md5sum, 16, va("PNUM%02d", consoleplayer), &netbuffer->u.md5sum);
CONS_Printf(M_GetText("Sending login... (Notice only given if password is correct.)\n"));
SendNetXCmd(XD_LOGIN, finalmd5, MD5_LEN);
#endif
}
static void Got_Login(UINT8 **cp, INT32 playernum)
{
#ifdef NOMD5
// If we have no MD5 support then completely disable XD_LOGIN responses for security.
(void)cp;
(void)playernum;
#else
UINT8 sentmd5[MD5_LEN], finalmd5[MD5_LEN];
READMEM(*cp, sentmd5, MD5_LEN);
if (client)
return;
if (!adminpasswordset)
{
CONS_Printf(M_GetText("Password from %s failed (no password set).\n"), player_names[playernum]);
return;
}
// Do the final pass to compare with the sent md5
D_MD5PasswordPass(adminpassmd5, MD5_LEN, va("PNUM%02d", playernum), &finalmd5);
if (!memcmp(sentmd5, finalmd5, MD5_LEN))
{
CONS_Printf(M_GetText("%s passed authentication.\n"), player_names[playernum]);
COM_BufInsertText(va("promote %d\n", playernum)); // do this immediately
}
else
CONS_Printf(M_GetText("Password from %s failed.\n"), player_names[playernum]);
netbuffer->packettype = PT_LOGIN;
HSendPacket(servernode, true, 0, 16);
#endif
}

View File

@ -165,8 +165,8 @@ typedef enum
XD_ADDPLAYER, // 10
XD_TEAMCHANGE, // 11
XD_CLEARSCORES, // 12
XD_LOGIN, // 13
XD_VERIFIED, // 14
// UNUSED 13 (Because I don't want to change these comments)
XD_VERIFIED = 14,//14
XD_RANDOMSEED, // 15
XD_RUNSOC, // 16
XD_REQADDFILE, // 17

View File

@ -772,9 +772,12 @@ void Got_Filetxpak(void)
{
INT32 filenum = netbuffer->u.filetxpak.fileid;
fileneeded_t *file = &fileneeded[filenum];
char *filename = file->filename;
char *filename;
static INT32 filetime = 0;
filename = va("%s", file->filename);
nameonly(filename);
if (!(strcmp(filename, "srb2.srb")
&& strcmp(filename, "srb2.wad")
&& strcmp(filename, "patch.dta")
@ -789,6 +792,8 @@ void Got_Filetxpak(void)
))
I_Error("Tried to download \"%s\"", filename);
filename = file->filename;
if (filenum >= fileneedednum)
{
DEBFILE(va("fileframent not needed %d>%d\n", filenum, fileneedednum));

View File

@ -136,6 +136,7 @@ extern UINT8 skincolor_redteam, skincolor_blueteam, skincolor_redring, skincolor
extern tic_t countdowntimer;
extern boolean countdowntimeup;
extern boolean exitfadestarted;
typedef struct
{

View File

@ -16,6 +16,7 @@
#include "d_main.h"
#include "d_clisrv.h"
#include "d_player.h"
#include "d_clisrv.h"
#include "f_finale.h"
#include "filesrch.h" // for refreshdirmenu
#include "p_setup.h"
@ -135,6 +136,7 @@ UINT8 skincolor_bluering = SKINCOLOR_STEEL;
tic_t countdowntimer = 0;
boolean countdowntimeup = false;
boolean exitfadestarted = false;
cutscene_t *cutscenes[128];
@ -1848,7 +1850,9 @@ boolean G_Responder(event_t *ev)
if (F_CreditResponder(ev))
{
F_StartGameEvaluation();
// Skip credits for everyone
if (!netgame || server || IsPlayerAdmin(consoleplayer))
SendNetXCmd(XD_EXITLEVEL, NULL, 0);
return true;
}
}
@ -3266,6 +3270,10 @@ void G_ExitLevel(void)
// Don't save demos immediately here! Let standings write first
}
else if (gamestate == GS_CREDITS)
{
F_StartGameEvaluation();
}
}
// See also the enum GameType in doomstat.h
@ -4583,7 +4591,7 @@ void G_InitNew(UINT8 pencoremode, const char *mapname, boolean resetplayer, bool
{
// Clear a bunch of variables
tokenlist = token = sstimer = redscore = bluescore = lastmap = 0;
countdown = countdown2 = mapreset = 0;
countdown = countdown2 = mapreset = exitfadestarted = 0;
for (i = 0; i < MAXPLAYERS; i++)
{

View File

@ -1196,21 +1196,24 @@ UINT8 *HWR_GetScreenshot(void)
return buf;
}
boolean HWR_Screenshot(const char *lbmname)
boolean HWR_Screenshot(const char *pathname)
{
boolean ret;
UINT8 *buf = malloc(vid.width * vid.height * 3 * sizeof (*buf));
if (!buf)
{
CONS_Debug(DBG_RENDER, "HWR_Screenshot: Failed to allocate memory\n");
return false;
}
// returns 24bit 888 RGB
HWD.pfnReadRect(0, 0, vid.width, vid.height, vid.width * 3, (void *)buf);
#ifdef USE_PNG
ret = M_SavePNG(lbmname, buf, vid.width, vid.height, NULL);
ret = M_SavePNG(pathname, buf, vid.width, vid.height, NULL);
#else
ret = saveTGA(lbmname, buf, vid.width, vid.height);
ret = saveTGA(pathname, buf, vid.width, vid.height);
#endif
free(buf);
return ret;

View File

@ -38,8 +38,6 @@ void HWR_RenderSkyboxView(INT32 viewnumber, player_t *player);
void HWR_RenderPlayerView(INT32 viewnumber, player_t *player);
void HWR_DrawViewBorder(INT32 clearlines);
void HWR_DrawFlatFill(INT32 x, INT32 y, INT32 w, INT32 h, lumpnum_t flatlumpnum);
UINT8 *HWR_GetScreenshot(void);
boolean HWR_Screenshot(const char *lbmname);
void HWR_InitTextureMapping(void);
void HWR_SetViewSize(void);
void HWR_DrawPatch(GLPatch_t *gpatch, INT32 x, INT32 y, INT32 option);
@ -54,6 +52,9 @@ void HWR_DrawConsoleFill(INT32 x, INT32 y, INT32 w, INT32 h, UINT32 color, INT32
void HWR_DrawDiag(INT32 x, INT32 y, INT32 wh, INT32 color);
void HWR_DrawPic(INT32 x,INT32 y,lumpnum_t lumpnum);
UINT8 *HWR_GetScreenshot(void);
boolean HWR_Screenshot(const char *pathname);
void HWR_AddCommands(void);
void HWR_CorrectSWTricks(void);
void transform(float *cx, float *cy, float *cz);

View File

@ -74,10 +74,10 @@ static int inet_aton(const char *cp, struct in_addr *addr)
#ifdef USE_WINSOCK2
static HMODULE ipv6dll = NULL;
typedef int (WSAAPI *p_getaddrinfo) (const char *node, const char *service,
const struct my_addrinfo *hints,
struct my_addrinfo **res);
typedef void (WSAAPI *p_freeaddrinfo) (struct my_addrinfo *res);
typedef int (WSAAPI *p_getaddrinfo) (const char *, const char *,
const struct my_addrinfo *,
struct my_addrinfo **);
typedef void (WSAAPI *p_freeaddrinfo) (struct my_addrinfo *);
static p_getaddrinfo WS_getaddrinfo = NULL;
static p_freeaddrinfo WS_freeaddrinfo = NULL;
@ -86,10 +86,10 @@ static HMODULE WS_getfunctions(HMODULE tmp)
{
if (tmp != NULL)
{
WS_getaddrinfo = (p_getaddrinfo)((void *)GetProcAddress(tmp, "getaddrinfo"));
WS_getaddrinfo = (p_getaddrinfo)(LPVOID)GetProcAddress(tmp, "getaddrinfo");
if (WS_getaddrinfo == NULL)
return NULL;
WS_freeaddrinfo = (p_freeaddrinfo)((void *)GetProcAddress(tmp, "freeaddrinfo"));
WS_freeaddrinfo = (p_freeaddrinfo)(LPVOID)GetProcAddress(tmp, "freeaddrinfo");
if (WS_freeaddrinfo == NULL)
{
WS_getaddrinfo = NULL;

View File

@ -226,7 +226,7 @@ void A_NapalmScatter();
void A_SpawnFreshCopy();
// ratio of states to sprites to mobj types is roughly 6 : 1 : 1
#define NUMMOBJFREESLOTS 256
#define NUMMOBJFREESLOTS 512
#define NUMSPRITEFREESLOTS NUMMOBJFREESLOTS
#define NUMSTATEFREESLOTS (NUMMOBJFREESLOTS*8)

View File

@ -898,6 +898,7 @@ static INT32 K_KartGetItemOdds(UINT8 pos, SINT8 item, fixed_t mashed, boolean sp
newodds = 0;
else
POWERITEMODDS(newodds);
/* FALLTHRU */
case KITEM_HYUDORO:
if ((hyubgone > 0) || COOLDOWNONSTART)
newodds = 0;

View File

@ -303,6 +303,8 @@ static int lib_cvRegisterVar(lua_State *L)
#define FIELDERROR(f, e) luaL_error(L, "bad value for " LUA_QL(f) " in table passed to " LUA_QL("CV_RegisterVar") " (%s)", e);
#define TYPEERROR(f, t) FIELDERROR(f, va("%s expected, got %s", lua_typename(L, t), luaL_typename(L, -1)))
memset(cvar, 0x00, sizeof(consvar_t)); // zero everything by default
lua_pushnil(L);
while (lua_next(L, 1)) {
// stack: cvar table, cvar userdata, key/index, value
@ -390,6 +392,13 @@ static int lib_cvRegisterVar(lua_State *L)
#undef FIELDERROR
#undef TYPEERROR
if (!cvar->name)
return luaL_error(L, M_GetText("Variable has no name!\n"));
if ((cvar->flags & CV_NOINIT) && !(cvar->flags & CV_CALL))
return luaL_error(L, M_GetText("Variable %s has CV_NOINIT without CV_CALL\n"), cvar->name);
if ((cvar->flags & CV_CALL) && !cvar->func)
return luaL_error(L, M_GetText("Variable %s has CV_CALL without a function\n"), cvar->name);
// stack: cvar table, cvar userdata
lua_getfield(L, LUA_REGISTRYINDEX, "CV_Vars");
I_Assert(lua_istable(L, 3));

View File

@ -604,7 +604,7 @@ static int power_get(lua_State *L)
UINT16 *powers = *((UINT16 **)luaL_checkudata(L, 1, META_POWERS));
powertype_t p = luaL_checkinteger(L, 2);
if (p >= NUMPOWERS)
return luaL_error(L, LUA_QL("powertype_t") " cannot be %u", p);
return luaL_error(L, LUA_QL("powertype_t") " cannot be %d", (INT16)p);
lua_pushinteger(L, powers[p]);
return 1;
}
@ -616,7 +616,7 @@ static int power_set(lua_State *L)
powertype_t p = luaL_checkinteger(L, 2);
UINT16 i = (UINT16)luaL_checkinteger(L, 3);
if (p >= NUMPOWERS)
return luaL_error(L, LUA_QL("powertype_t") " cannot be %u", p);
return luaL_error(L, LUA_QL("powertype_t") " cannot be %d", (INT16)p);
if (hud_running)
return luaL_error(L, "Do not alter player_t in HUD rendering code!");
if (hook_cmd_running)

View File

@ -206,14 +206,7 @@ FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FixedDiv(fixed_t a, fixed_t b)
*/
FUNCMATH FUNCINLINE static ATTRINLINE fixed_t FixedRem(fixed_t x, fixed_t y)
{
const boolean n = x < 0;
x = abs(x);
while (x >= y)
x -= y;
if (n)
return -x;
else
return x;
return x % y;
}
/** \brief The FixedSqrt function

View File

@ -3751,7 +3751,7 @@ static void M_DrawGenericMenu(void)
y += 16;
break;
}
/* fallthru */
/* FALLTHRU */
case IT_CV_STRING:
M_DrawTextBox(x, y + 4, MAXSTRINGLENGTH, 1);
V_DrawString(x + 8, y + 12, V_ALLOWLOWERCASE, cv->string);
@ -5340,7 +5340,7 @@ static void DrawReplayHutReplayInfo(void)
case MD_OUTDATED:
V_DrawThinString(17, 64, V_SNAPTOTOP|V_ALLOWLOWERCASE|V_TRANSLUCENT|highlightflags, "Recorded on an outdated version.");
/*fallthru*/
/*FALLTHRU*/
default:
// Draw level stuff
x = 15; y = 15;

View File

@ -30,6 +30,7 @@
#include "g_game.h"
#include "m_misc.h"
#include "hu_stuff.h"
#include "st_stuff.h"
#include "v_video.h"
#include "z_zone.h"
#include "g_input.h"
@ -57,7 +58,7 @@ typedef off_t off64_t;
#endif
#endif
#if defined(__MINGW32__) && ((__GNUC__ > 7) || (__GNUC__ == 6 && __GNUC_MINOR__ >= 3))
#if defined(__MINGW32__) && ((__GNUC__ > 7) || (__GNUC__ == 6 && __GNUC_MINOR__ >= 3)) && (__GNUC__ < 8)
#define PRIdS "u"
#elif defined (_WIN32)
#define PRIdS "Iu"
@ -586,6 +587,21 @@ void M_SaveConfig(const char *filename)
fclose(f);
}
// ==========================================================================
// SCREENSHOTS
// ==========================================================================
static UINT8 screenshot_palette[768];
static void M_CreateScreenShotPalette(void)
{
size_t i, j;
for (i = 0, j = 0; i < 768; i += 3, j++)
{
RGBA_t locpal = pLocalPalette[(max(st_palette,0)*256)+j];
screenshot_palette[i] = locpal.s.red;
screenshot_palette[i+1] = locpal.s.green;
screenshot_palette[i+2] = locpal.s.blue;
}
}
#if NUMSCREENS > 2
static const char *Newsnapshotfile(const char *pathname, const char *ext)
@ -1017,6 +1033,7 @@ static boolean M_SetupaPNG(png_const_charp filename, png_bytep pal)
static inline moviemode_t M_StartMovieAPNG(const char *pathname)
{
#ifdef USE_APNG
UINT8 *palette = NULL;
const char *freename = NULL;
boolean ret = false;
@ -1033,9 +1050,12 @@ static inline moviemode_t M_StartMovieAPNG(const char *pathname)
}
if (rendermode == render_soft)
ret = M_SetupaPNG(va(pandf,pathname,freename), W_CacheLumpName(GetPalette(), PU_CACHE));
else
ret = M_SetupaPNG(va(pandf,pathname,freename), NULL);
{
M_CreateScreenShotPalette();
palette = screenshot_palette;
}
ret = M_SetupaPNG(va(pandf,pathname,freename), palette);
if (!ret)
{
@ -1238,7 +1258,7 @@ void M_StopMovie(void)
* \param data The image data.
* \param width Width of the picture.
* \param height Height of the picture.
* \param palette Palette of image data
* \param palette Palette of image data.
* \note if palette is NULL, BGR888 format
*/
boolean M_SavePNG(const char *filename, void *data, int width, int height, const UINT8 *palette)
@ -1260,8 +1280,7 @@ boolean M_SavePNG(const char *filename, void *data, int width, int height, const
return false;
}
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL,
PNG_error, PNG_warn);
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, PNG_error, PNG_warn);
if (!png_ptr)
{
CONS_Debug(DBG_RENDER, "M_SavePNG: Error on initialize libpng\n");
@ -1415,9 +1434,8 @@ void M_ScreenShot(void)
}
/** Takes a screenshot.
* The screenshot is saved as "kartxxxx.pcx" (or "kartxxxx.tga" in hardware
* rendermode) where xxxx is the lowest four-digit number for which a file
* does not already exist.
* The screenshot is saved as "srb2xxxx.png" where xxxx is the lowest
* four-digit number for which a file does not already exist.
*
* \sa HWR_ScreenShot
*/
@ -1431,6 +1449,10 @@ void M_DoScreenShot(void)
// Don't take multiple screenshots, obviously
takescreenshot = false;
// how does one take a screenshot without a render system?
if (rendermode == render_none)
return;
if (cv_screenshot_option.value == 0)
pathname = usehome ? srb2home : srb2path;
else if (cv_screenshot_option.value == 1)
@ -1441,16 +1463,13 @@ void M_DoScreenShot(void)
pathname = cv_screenshot_folder.string;
#ifdef USE_PNG
if (rendermode != render_none)
freename = Newsnapshotfile(pathname,"png");
freename = Newsnapshotfile(pathname,"png");
#else
if (rendermode == render_soft)
freename = Newsnapshotfile(pathname,"pcx");
else if (rendermode != render_none)
else if (rendermode == render_opengl)
freename = Newsnapshotfile(pathname,"tga");
#endif
else
I_Error("Can't take a screenshot without a render system");
if (rendermode == render_soft)
{
@ -1464,18 +1483,16 @@ void M_DoScreenShot(void)
// save the pcx file
#ifdef HWRENDER
if (rendermode != render_soft)
if (rendermode == render_opengl)
ret = HWR_Screenshot(va(pandf,pathname,freename));
else
#endif
if (rendermode != render_none)
{
M_CreateScreenShotPalette();
#ifdef USE_PNG
ret = M_SavePNG(va(pandf,pathname,freename), linear, vid.width, vid.height,
W_CacheLumpName(GetPalette(), PU_CACHE));
ret = M_SavePNG(va(pandf,pathname,freename), linear, vid.width, vid.height, screenshot_palette);
#else
ret = WritePCXfile(va(pandf,pathname,freename), linear, vid.width, vid.height,
W_CacheLumpName(GetPalette(), PU_CACHE));
ret = WritePCXfile(va(pandf,pathname,freename), linear, vid.width, vid.height, screenshot_palette);
#endif
}
@ -1483,14 +1500,14 @@ failure:
if (ret)
{
if (moviemode != MM_SCREENSHOT)
CONS_Printf(M_GetText("screen shot %s saved in %s\n"), freename, pathname);
CONS_Printf(M_GetText("Screen shot %s saved in %s\n"), freename, pathname);
}
else
{
if (freename)
CONS_Printf(M_GetText("Couldn't create screen shot %s in %s\n"), freename, pathname);
CONS_Alert(CONS_ERROR, M_GetText("Couldn't create screen shot %s in %s\n"), freename, pathname);
else
CONS_Printf(M_GetText("Couldn't create screen shot (all 10000 slots used!) in %s\n"), pathname);
CONS_Alert(CONS_ERROR, M_GetText("Couldn't create screen shot in %s (all 10000 slots used!)\n"), pathname);
if (moviemode == MM_SCREENSHOT)
M_StopMovie();

View File

@ -4050,6 +4050,7 @@ static boolean PIT_ChangeSector(mobj_t *thing, boolean realcrush)
boolean P_CheckSector(sector_t *sector, boolean crunch)
{
msecnode_t *n;
size_t i;
nofit = false;
crushchange = crunch;
@ -4064,9 +4065,57 @@ boolean P_CheckSector(sector_t *sector, boolean crunch)
// First, let's see if anything will keep it from crushing.
// Sal: This stupid function chain is required to fix polyobjects not being able to crush.
// Monster Iestyn: don't use P_CheckSector actually just look for objects in the blockmap instead
validcount++;
for (i = 0; i < sector->linecount; i++)
{
if (sector->lines[i]->polyobj)
{
polyobj_t *po = sector->lines[i]->polyobj;
if (po->validcount == validcount)
continue; // skip if already checked
if (!(po->flags & POF_SOLID))
continue;
if (po->lines[0]->backsector == sector) // Make sure you're currently checking the control sector
{
INT32 x, y;
po->validcount = validcount;
for (y = po->blockbox[BOXBOTTOM]; y <= po->blockbox[BOXTOP]; ++y)
{
for (x = po->blockbox[BOXLEFT]; x <= po->blockbox[BOXRIGHT]; ++x)
{
mobj_t *mo;
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
continue;
mo = blocklinks[y * bmapwidth + x];
for (; mo; mo = mo->bnext)
{
// Monster Iestyn: do we need to check if a mobj has already been checked? ...probably not I suspect
if (!P_MobjInsidePolyobj(po, mo))
continue;
if (!PIT_ChangeSector(mo, false))
{
nofit = true;
return nofit;
}
}
}
}
}
}
}
if (sector->numattached)
{
size_t i;
sector_t *sec;
for (i = 0; i < sector->numattached; i++)
{
@ -4126,9 +4175,53 @@ boolean P_CheckSector(sector_t *sector, boolean crunch)
} while (n); // repeat from scratch until all things left are marked valid
// Nothing blocked us, so lets crush for real!
// Sal: This stupid function chain is required to fix polyobjects not being able to crush.
// Monster Iestyn: don't use P_CheckSector actually just look for objects in the blockmap instead
validcount++;
for (i = 0; i < sector->linecount; i++)
{
if (sector->lines[i]->polyobj)
{
polyobj_t *po = sector->lines[i]->polyobj;
if (po->validcount == validcount)
continue; // skip if already checked
if (!(po->flags & POF_SOLID))
continue;
if (po->lines[0]->backsector == sector) // Make sure you're currently checking the control sector
{
INT32 x, y;
po->validcount = validcount;
for (y = po->blockbox[BOXBOTTOM]; y <= po->blockbox[BOXTOP]; ++y)
{
for (x = po->blockbox[BOXLEFT]; x <= po->blockbox[BOXRIGHT]; ++x)
{
mobj_t *mo;
if (x < 0 || y < 0 || x >= bmapwidth || y >= bmapheight)
continue;
mo = blocklinks[y * bmapwidth + x];
for (; mo; mo = mo->bnext)
{
// Monster Iestyn: do we need to check if a mobj has already been checked? ...probably not I suspect
if (!P_MobjInsidePolyobj(po, mo))
continue;
PIT_ChangeSector(mo, true);
return nofit;
}
}
}
}
}
}
if (sector->numattached)
{
size_t i;
sector_t *sec;
for (i = 0; i < sector->numattached; i++)
{

View File

@ -418,10 +418,6 @@ void P_CameraLineOpening(line_t *linedef)
if (front->ffloors || back->ffloors)
{
ffloor_t *rover;
fixed_t highestceiling = highceiling;
fixed_t lowestceiling = opentop;
fixed_t highestfloor = openbottom;
fixed_t lowestfloor = lowfloor;
fixed_t delta1, delta2;
// Check for frontsector's fake floors
@ -437,15 +433,15 @@ void P_CameraLineOpening(line_t *linedef)
delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2)));
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
if (bottomheight < lowestceiling && delta1 >= delta2)
lowestceiling = bottomheight;
else if (bottomheight < highestceiling && delta1 >= delta2)
highestceiling = bottomheight;
if (bottomheight < opentop && delta1 >= delta2)
opentop = bottomheight;
else if (bottomheight < highceiling && delta1 >= delta2)
highceiling = bottomheight;
if (topheight > highestfloor && delta1 < delta2)
highestfloor = topheight;
else if (topheight > lowestfloor && delta1 < delta2)
lowestfloor = topheight;
if (topheight > openbottom && delta1 < delta2)
openbottom = topheight;
else if (topheight > lowfloor && delta1 < delta2)
lowfloor = topheight;
}
// Check for backsectors fake floors
@ -461,28 +457,16 @@ void P_CameraLineOpening(line_t *linedef)
delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2)));
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
if (bottomheight < lowestceiling && delta1 >= delta2)
lowestceiling = bottomheight;
else if (bottomheight < highestceiling && delta1 >= delta2)
highestceiling = bottomheight;
if (bottomheight < opentop && delta1 >= delta2)
opentop = bottomheight;
else if (bottomheight < highceiling && delta1 >= delta2)
highceiling = bottomheight;
if (topheight > highestfloor && delta1 < delta2)
highestfloor = topheight;
else if (topheight > lowestfloor && delta1 < delta2)
lowestfloor = topheight;
if (topheight > openbottom && delta1 < delta2)
openbottom = topheight;
else if (topheight > lowfloor && delta1 < delta2)
lowfloor = topheight;
}
if (highestceiling < highceiling)
highceiling = highestceiling;
if (highestfloor > openbottom)
openbottom = highestfloor;
if (lowestceiling < opentop)
opentop = lowestceiling;
if (lowestfloor > lowfloor)
lowfloor = lowestfloor;
}
openrange = opentop - openbottom;
return;
@ -500,23 +484,26 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
return;
}
// Treat polyobjects kind of like 3D Floors
#ifdef POLYOBJECTS
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT))
{
front = linedef->frontsector;
back = linedef->frontsector;
}
else
#endif
{
front = linedef->frontsector;
back = linedef->backsector;
}
front = linedef->frontsector;
back = linedef->backsector;
I_Assert(front != NULL);
I_Assert(back != NULL);
#ifdef POLYOBJECTS
if (linedef->polyobj)
{
// set these defaults so that polyobjects don't interfere with collision above or below them
opentop = INT32_MAX;
openbottom = INT32_MIN;
highceiling = INT32_MIN;
lowfloor = INT32_MAX;
#ifdef ESLOPE
opentopslope = openbottomslope = NULL;
#endif
}
else
#endif
{ // Set open and high/low values here
fixed_t frontheight, backheight;
@ -622,25 +609,49 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
}
}
}
// Check for fake floors in the sector.
if (front->ffloors || back->ffloors
#ifdef POLYOBJECTS
|| linedef->polyobj
if (linedef->polyobj)
{
// Treat polyobj's backsector like a 3D Floor
if (linedef->polyobj->flags & POF_TESTHEIGHT)
{
const sector_t *polysec = linedef->backsector;
fixed_t polytop, polybottom;
fixed_t delta1, delta2;
if (linedef->polyobj->flags & POF_CLIPPLANES)
{
polytop = polysec->ceilingheight;
polybottom = polysec->floorheight;
}
else
{
polytop = INT32_MAX;
polybottom = INT32_MIN;
}
delta1 = abs(mobj->z - (polybottom + ((polytop - polybottom)/2)));
delta2 = abs(thingtop - (polybottom + ((polytop - polybottom)/2)));
if (polybottom < opentop && delta1 >= delta2)
opentop = polybottom;
else if (polybottom < highceiling && delta1 >= delta2)
highceiling = polybottom;
if (polytop > openbottom && delta1 < delta2)
openbottom = polytop;
else if (polytop > lowfloor && delta1 < delta2)
lowfloor = polytop;
}
// otherwise don't do anything special, pretend there's nothing else there
}
else
#endif
)
// Check for fake floors in the sector.
if (front->ffloors || back->ffloors)
{
ffloor_t *rover;
fixed_t highestceiling = highceiling;
fixed_t lowestceiling = opentop;
fixed_t highestfloor = openbottom;
fixed_t lowestfloor = lowfloor;
fixed_t delta1, delta2;
#ifdef ESLOPE
pslope_t *ceilingslope = opentopslope;
pslope_t *floorslope = openbottomslope;
#endif
// Check for frontsector's fake floors
for (rover = front->ffloors; rover; rover = rover->next)
@ -663,26 +674,26 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF
{
if (bottomheight < lowestceiling) {
lowestceiling = bottomheight;
if (bottomheight < opentop) {
opentop = bottomheight;
#ifdef ESLOPE
ceilingslope = *rover->b_slope;
opentopslope = *rover->b_slope;
#endif
}
else if (bottomheight < highestceiling)
highestceiling = bottomheight;
else if (bottomheight < highceiling)
highceiling = bottomheight;
}
if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF
{
if (topheight > highestfloor) {
highestfloor = topheight;
if (topheight > openbottom) {
openbottom = topheight;
#ifdef ESLOPE
floorslope = *rover->t_slope;
openbottomslope = *rover->t_slope;
#endif
}
else if (topheight > lowestfloor)
lowestfloor = topheight;
else if (topheight > lowfloor)
lowfloor = topheight;
}
}
@ -707,75 +718,28 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj)
if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF
{
if (bottomheight < lowestceiling) {
lowestceiling = bottomheight;
if (bottomheight < opentop) {
opentop = bottomheight;
#ifdef ESLOPE
ceilingslope = *rover->b_slope;
opentopslope = *rover->b_slope;
#endif
}
else if (bottomheight < highestceiling)
highestceiling = bottomheight;
else if (bottomheight < highceiling)
highceiling = bottomheight;
}
if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF
{
if (topheight > highestfloor) {
highestfloor = topheight;
if (topheight > openbottom) {
openbottom = topheight;
#ifdef ESLOPE
floorslope = *rover->t_slope;
openbottomslope = *rover->t_slope;
#endif
}
else if (topheight > lowestfloor)
lowestfloor = topheight;
else if (topheight > lowfloor)
lowfloor = topheight;
}
}
#ifdef POLYOBJECTS
// Treat polyobj's backsector like a 3D Floor
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT))
{
const sector_t *polysec = linedef->backsector;
delta1 = abs(mobj->z - (polysec->floorheight + ((polysec->ceilingheight - polysec->floorheight)/2)));
delta2 = abs(thingtop - (polysec->floorheight + ((polysec->ceilingheight - polysec->floorheight)/2)));
if (polysec->floorheight < lowestceiling && delta1 >= delta2) {
lowestceiling = polysec->floorheight;
#ifdef ESLOPE
ceilingslope = NULL;
#endif
}
else if (polysec->floorheight < highestceiling && delta1 >= delta2)
highestceiling = polysec->floorheight;
if (polysec->ceilingheight > highestfloor && delta1 < delta2) {
highestfloor = polysec->ceilingheight;
#ifdef ESLOPE
floorslope = NULL;
#endif
}
else if (polysec->ceilingheight > lowestfloor && delta1 < delta2)
lowestfloor = polysec->ceilingheight;
}
#endif
if (highestceiling < highceiling)
highceiling = highestceiling;
if (highestfloor > openbottom) {
openbottom = highestfloor;
#ifdef ESLOPE
openbottomslope = floorslope;
#endif
}
if (lowestceiling < opentop) {
opentop = lowestceiling;
#ifdef ESLOPE
opentopslope = ceilingslope;
#endif
}
if (lowestfloor > lowfloor)
lowfloor = lowestfloor;
}
}

View File

@ -6083,7 +6083,7 @@ void P_RunOverlays(void)
{
angle_t viewingangle;
if (players[displayplayers[0]].awayviewtics)
if (players[displayplayers[0]].awayviewtics && players[displayplayers[0]].awayviewmobj != NULL && !P_MobjWasRemoved(players[displayplayers[0]].awayviewmobj))
viewingangle = R_PointToAngle2(mo->target->x, mo->target->y, players[displayplayers[0]].awayviewmobj->x, players[displayplayers[0]].awayviewmobj->y);
else if (!camera[0].chase && players[displayplayers[0]].mo)
viewingangle = R_PointToAngle2(mo->target->x, mo->target->y, players[displayplayers[0]].mo->x, players[displayplayers[0]].mo->y);
@ -7302,7 +7302,7 @@ void P_MobjThinker(mobj_t *mobj)
P_RemoveMobj(mobj);
return;
}
// fallthru
// FALLTHRU
case MT_ORBINAUT_SHIELD:
case MT_BANANA_SHIELD:
case MT_EGGMANITEM_SHIELD:
@ -7312,7 +7312,7 @@ void P_MobjThinker(mobj_t *mobj)
case MT_JAWZ_DUD:
if (P_IsObjectOnGround(mobj))
P_SetMobjState(mobj, mobj->info->xdeathstate);
// fallthru
// FALLTHRU
case MT_JAWZ_SHIELD:
mobj->flags2 ^= MF2_DONTDRAW;
break;

View File

@ -1864,7 +1864,8 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
po->lines[0]->backsector->floorheight = target->z - amtz;
po->lines[0]->backsector->ceilingheight = target->z + amtz;
// Sal: Remember to check your sectors!
P_CheckSector(po->lines[0]->frontsector, (boolean)(po->damage));
// Monster Iestyn: we only need to bother with the back sector, now that P_CheckSector automatically checks the blockmap
// updating objects in the front one too just added teleporting to ground bugs
P_CheckSector(po->lines[0]->backsector, (boolean)(po->damage));
// Apply action to mirroring polyobjects as well
start = 0;
@ -1878,7 +1879,8 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
po->lines[0]->backsector->floorheight += diffz; // move up/down by same amount as the parent did
po->lines[0]->backsector->ceilingheight += diffz;
// Sal: Remember to check your sectors!
P_CheckSector(po->lines[0]->frontsector, (boolean)(po->damage));
// Monster Iestyn: we only need to bother with the back sector, now that P_CheckSector automatically checks the blockmap
// updating objects in the front one too just added teleporting to ground bugs
P_CheckSector(po->lines[0]->backsector, (boolean)(po->damage));
}
@ -2041,8 +2043,9 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
po->lines[0]->backsector->floorheight += momz;
po->lines[0]->backsector->ceilingheight += momz;
// Sal: Remember to check your sectors!
P_CheckSector(po->lines[0]->frontsector, (boolean)(po->damage)); // frontsector is NEEDED for crushing
P_CheckSector(po->lines[0]->backsector, (boolean)(po->damage)); // backsector may not be necessary, but just in case
// Monster Iestyn: we only need to bother with the back sector, now that P_CheckSector automatically checks the blockmap
// updating objects in the front one too just added teleporting to ground bugs
P_CheckSector(po->lines[0]->backsector, (boolean)(po->damage));
// Apply action to mirroring polyobjects as well
start = 0;
@ -2056,7 +2059,8 @@ void T_PolyObjWaypoint(polywaypoint_t *th)
po->lines[0]->backsector->floorheight += momz;
po->lines[0]->backsector->ceilingheight += momz;
// Sal: Remember to check your sectors!
P_CheckSector(po->lines[0]->frontsector, (boolean)(po->damage));
// Monster Iestyn: we only need to bother with the back sector, now that P_CheckSector automatically checks the blockmap
// updating objects in the front one too just added teleporting to ground bugs
P_CheckSector(po->lines[0]->backsector, (boolean)(po->damage));
}
}

View File

@ -1468,7 +1468,6 @@ static void P_LoadRawSideDefs2(void *data)
else
sd->bottomtexture = num;
}
break;
}
#ifdef HWRENDER
else
@ -1541,9 +1540,9 @@ static void P_LoadRawSideDefs2(void *data)
else
sd->bottomtexture = num;
}
break;
}
#endif
break;
case 413: // Change music
{
@ -2344,7 +2343,7 @@ static void P_LevelInitStuff(void)
players[i].lives = 1; // SRB2Kart
#endif
players[i].realtime = countdown = countdown2 = 0;
players[i].realtime = countdown = countdown2 = exitfadestarted = 0;
curlap = bestlap = 0; // SRB2Kart
players[i].gotcontinue = false;

View File

@ -584,23 +584,28 @@ static pslope_t *P_NewVertexSlope(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flag
//
void P_CopySectorSlope(line_t *line)
{
sector_t *fsec = line->frontsector;
int i, special = line->special;
sector_t *fsec = line->frontsector;
int i, special = line->special;
// Check for copy linedefs
for(i = -1; (i = P_FindSectorFromLineTag(line, i)) >= 0;)
{
sector_t *srcsec = sectors + i;
// Check for copy linedefs
for (i = -1; (i = P_FindSectorFromLineTag(line, i)) >= 0;)
{
sector_t *srcsec = sectors + i;
if((special - 719) & 1 && !fsec->f_slope && srcsec->f_slope)
fsec->f_slope = srcsec->f_slope; //P_CopySlope(srcsec->f_slope);
if((special - 719) & 2 && !fsec->c_slope && srcsec->c_slope)
fsec->c_slope = srcsec->c_slope; //P_CopySlope(srcsec->c_slope);
}
if ((special - 719) & 1 && !fsec->f_slope && srcsec->f_slope)
fsec->f_slope = srcsec->f_slope; //P_CopySlope(srcsec->f_slope);
if ((special - 719) & 2 && !fsec->c_slope && srcsec->c_slope)
fsec->c_slope = srcsec->c_slope; //P_CopySlope(srcsec->c_slope);
}
fsec->hasslope = true;
fsec->hasslope = true;
line->special = 0; // Linedef was use to set slopes, it finished its job, so now make it a normal linedef
// if this is an FOF control sector, make sure any target sectors also are marked as having slopes
if (fsec->numattached)
for (i = 0; i < (int)fsec->numattached; i++)
sectors[fsec->attached[i]].hasslope = true;
line->special = 0; // Linedef was use to set slopes, it finished its job, so now make it a normal linedef
}
//

View File

@ -5130,6 +5130,10 @@ static ffloor_t *P_AddFakeFloor(sector_t *sec, sector_t *sec2, line_t *master, f
// Add slopes
ffloor->t_slope = &sec2->c_slope;
ffloor->b_slope = &sec2->f_slope;
// mark the target sector as having slopes, if the FOF has any of its own
// (this fixes FOF slopes glitching initially at level load in software mode)
if (sec2->hasslope)
sec->hasslope = true;
#endif
if ((flags & FF_SOLID) && (master->flags & ML_EFFECT1)) // Block player only

View File

@ -8139,14 +8139,8 @@ void P_PlayerThink(player_t *player)
if (player->flashcount)
player->flashcount--;
// Re-fixed by Jimita (11-12-2018)
if (player->awayviewtics)
{
if (player->awayviewtics && player->awayviewtics != -1)
player->awayviewtics--;
if (!player->awayviewtics)
player->awayviewtics = -1;
// The timer might've reached zero, but we'll run the remote view camera anyway by setting it to -1.
}
/// \note do this in the cheat code
if (player->pflags & PF_NOCLIP)
@ -8226,6 +8220,48 @@ void P_PlayerThink(player_t *player)
if (player->exiting && countdown2)
player->exiting = 99; // SRB2kart
// The following code is disabled for now as this causes the game to freeze sometimes
// Monster Iestyn -- 16/08/19
#if 0
// Same check as below, just at 1 second before
// so we can fade music
if (!exitfadestarted &&
player->exiting > 0 && player->exiting <= 1*TICRATE &&
(!multiplayer || gametype == GT_COOP ? !mapheaderinfo[gamemap-1]->musinterfadeout : true) &&
// don't fade if we're fading during intermission. follows Y_StartIntermission intertype = int_coop
(gametype == GT_RACE || gametype == GT_COMPETITION ? countdown2 == 0 : true) && // don't fade on timeout
player->lives > 0 && // don't fade on game over (competition)
P_IsLocalPlayer(player))
{
if (cv_playersforexit.value)
{
INT32 i;
for (i = 0; i < MAXPLAYERS; i++)
{
if (!playeringame[i] || players[i].spectator || players[i].bot)
continue;
if (players[i].lives <= 0)
continue;
if (!players[i].exiting || players[i].exiting > 1*TICRATE)
break;
}
if (i == MAXPLAYERS)
{
exitfadestarted = true;
S_FadeOutStopMusic(1*MUSICRATE);
}
}
else
{
exitfadestarted = true;
S_FadeOutStopMusic(1*MUSICRATE);
}
}
#endif
if (player->exiting == 2 || countdown2 == 2)
{
if (cv_playersforexit.value) // Count to be sure everyone's exited
@ -8979,9 +9015,6 @@ void P_PlayerAfterThink(player_t *player)
}
}
if (player->awayviewtics < 0)
player->awayviewtics = 0;
// spectator invisibility and nogravity.
if ((netgame || multiplayer) && player->spectator)
{

View File

@ -408,16 +408,7 @@ void R_LoadTextures(void)
// but the alternative is to spend a ton of time checking and re-checking all previous entries just to skip any potentially patched textures.
for (w = 0, numtextures = 0; w < numwadfiles; w++)
{
if (wadfiles[w]->type == RET_PK3)
{
texstart = W_CheckNumForFolderStartPK3("textures/", (UINT16)w, 0);
texend = W_CheckNumForFolderEndPK3("textures/", (UINT16)w, texstart);
}
else
{
texstart = W_CheckNumForNamePwad(TX_START, (UINT16)w, 0) + 1;
texend = W_CheckNumForNamePwad(TX_END, (UINT16)w, 0);
}
// Count the textures from TEXTURES lumps
texturesLumpPos = W_CheckNumForNamePwad("TEXTURES", (UINT16)w, 0);
while (texturesLumpPos != INT16_MAX)
@ -426,19 +417,43 @@ void R_LoadTextures(void)
texturesLumpPos = W_CheckNumForNamePwad("TEXTURES", (UINT16)w, texturesLumpPos + 1);
}
// Add all the textures between TX_START and TX_END
if (texstart != INT16_MAX && texend != INT16_MAX)
// Count single-patch textures
if (wadfiles[w]->type == RET_PK3)
{
texstart = W_CheckNumForFolderStartPK3("textures/", (UINT16)w, 0);
texend = W_CheckNumForFolderEndPK3("textures/", (UINT16)w, texstart);
}
else
{
texstart = W_CheckNumForNamePwad(TX_START, (UINT16)w, 0);
texend = W_CheckNumForNamePwad(TX_END, (UINT16)w, 0);
}
if (texstart == INT16_MAX || texend == INT16_MAX)
continue;
texstart++; // Do not count the first marker
// PK3s have subfolders, so we can't just make a simple sum
if (wadfiles[w]->type == RET_PK3)
{
for (j = texstart; j < texend; j++)
{
if (!W_IsLumpFolder((UINT16)w, j)) // Check if lump is a folder; if not, then count it
numtextures++;
}
}
else // Add all the textures between TX_START and TX_END
{
numtextures += (UINT32)(texend - texstart);
}
// If no textures found by this point, bomb out
if (!numtextures && w == (numwadfiles - 1))
{
I_Error("No textures detected in any WADs!\n");
}
}
// If no textures found by this point, bomb out
if (!numtextures)
I_Error("No textures detected in any WADs!\n");
// Allocate memory and initialize to 0 for all the textures we are initialising.
// There are actually 5 buffers allocated in one for convenience.
textures = Z_Calloc((numtextures * sizeof(void *)) * 5, PU_STATIC, NULL);
@ -473,7 +488,7 @@ void R_LoadTextures(void)
}
else
{
texstart = W_CheckNumForNamePwad(TX_START, (UINT16)w, 0) + 1;
texstart = W_CheckNumForNamePwad(TX_START, (UINT16)w, 0);
texend = W_CheckNumForNamePwad(TX_END, (UINT16)w, 0);
texturesLumpPos = W_CheckNumForNamePwad("TEXTURES", (UINT16)w, 0);
if (texturesLumpPos != INT16_MAX)
@ -483,47 +498,43 @@ void R_LoadTextures(void)
if (texstart == INT16_MAX || texend == INT16_MAX)
continue;
texstart++; // Do not count the first marker
// Work through each lump between the markers in the WAD.
for (j = 0; j < (texend - texstart); i++, j++)
for (j = 0; j < (texend - texstart); j++)
{
if (wadfiles[w]->type == RET_PK3)
{
if (W_IsLumpFolder((UINT16)w, texstart + j)) // Check if lump is a folder
continue; // If it is then SKIP IT
}
patchlump = W_CacheLumpNumPwad((UINT16)w, texstart + j, PU_CACHE);
// Then, check the lump directly to see if it's a texture SOC,
// and if it is, load it using dehacked instead.
if (strstr((const char *)patchlump, "TEXTURE"))
{
CONS_Alert(CONS_WARNING, "%s is a Texture SOC.\n", W_CheckNameForNumPwad((UINT16)w,texstart+j));
Z_Unlock(patchlump);
DEH_LoadDehackedLumpPwad((UINT16)w, texstart + j);
}
else
{
//CONS_Printf("\n\"%s\" is a single patch, dimensions %d x %d",W_CheckNameForNumPwad((UINT16)w,texstart+j),patchlump->width, patchlump->height);
texture = textures[i] = Z_Calloc(sizeof(texture_t) + sizeof(texpatch_t), PU_STATIC, NULL);
//CONS_Printf("\n\"%s\" is a single patch, dimensions %d x %d",W_CheckNameForNumPwad((UINT16)w,texstart+j),patchlump->width, patchlump->height);
texture = textures[i] = Z_Calloc(sizeof(texture_t) + sizeof(texpatch_t), PU_STATIC, NULL);
// Set texture properties.
M_Memcpy(texture->name, W_CheckNameForNumPwad((UINT16)w, texstart + j), sizeof(texture->name));
texture->width = SHORT(patchlump->width);
texture->height = SHORT(patchlump->height);
texture->patchcount = 1;
texture->holes = false;
// Set texture properties.
M_Memcpy(texture->name, W_CheckNameForNumPwad((UINT16)w, texstart + j), sizeof(texture->name));
texture->width = SHORT(patchlump->width);
texture->height = SHORT(patchlump->height);
texture->patchcount = 1;
texture->holes = false;
// Allocate information for the texture's patches.
patch = &texture->patches[0];
// Allocate information for the texture's patches.
patch = &texture->patches[0];
patch->originx = patch->originy = 0;
patch->wad = (UINT16)w;
patch->lump = texstart + j;
patch->originx = patch->originy = 0;
patch->wad = (UINT16)w;
patch->lump = texstart + j;
Z_Unlock(patchlump);
Z_Unlock(patchlump);
k = 1;
while (k << 1 <= texture->width)
k <<= 1;
texturewidthmask[i] = k - 1;
textureheight[i] = texture->height << FRACBITS;
}
k = 1;
while (k << 1 <= texture->width)
k <<= 1;
texturewidthmask[i] = k - 1;
textureheight[i] = texture->height << FRACBITS;
i++;
}
}
}
@ -1076,6 +1087,7 @@ void R_ReInitColormaps(UINT16 num, lumpnum_t newencoremap)
{
char colormap[9] = "COLORMAP";
lumpnum_t lump;
const lumpnum_t basecolormaplump = W_GetNumForName(colormap);
if (num > 0 && num <= 10000)
snprintf(colormap, 8, "CLM%04u", num-1);
@ -1083,8 +1095,16 @@ void R_ReInitColormaps(UINT16 num, lumpnum_t newencoremap)
// Load in the light tables, now 64k aligned for smokie...
lump = W_GetNumForName(colormap);
if (lump == LUMPERROR)
lump = W_GetNumForName("COLORMAP");
W_ReadLump(lump, colormaps);
lump = basecolormaplump;
else
{
if (W_LumpLength(lump) != W_LumpLength(basecolormaplump))
{
CONS_Alert(CONS_WARNING, "%s lump size does not match COLORMAP, results may be unexpected.\n", colormap);
}
}
W_ReadLumpHeader(lump, colormaps, W_LumpLength(basecolormaplump), 0U);
// Encore mode.
if (newencoremap != LUMPERROR)

View File

@ -93,6 +93,7 @@
<Import Project="..\..\libs\libpng.props" />
<Import Project="..\..\libs\SDL2.props" />
<Import Project="..\..\libs\SDL_mixer.props" />
<Import Project="..\..\libs\libgme.props" />
<Import Project="Srb2SDL.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

View File

@ -5,7 +5,10 @@
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;SDLMAIN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- x86/x64 defines: has specific libraries that ARM does not -->
<PreprocessorDefinitions Condition="'$(Platform)' == 'Win32' OR '$(Platform)' == 'x64'">HAVE_ZLIB;HAVE_LIBGME;USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;SDLMAIN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- ARM defines -->
<PreprocessorDefinitions Condition="'$(Platform)' != 'Win32' AND '$(Platform)' != 'x64'">USE_WGL_SWAP;DIRECTFULLSCREEN;HAVE_SDL;HWRENDER;HW3SOUND;HAVE_FILTER;HAVE_MIXER;SDLMAIN;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />

View File

@ -547,7 +547,7 @@ static void Impl_HandleKeyboardConsoleEvent(KEY_EVENT_RECORD evt, HANDLE co)
break;
case VK_RETURN:
entering_con_command = false;
// Fall through.
/* FALLTHRU */
default:
event.data1 = MapVirtualKey(evt.wVirtualKeyCode,2); // convert in to char
}
@ -2960,7 +2960,7 @@ static void I_ShutdownTimer(void)
pfntimeGetTime = NULL;
if (winmm)
{
p_timeEndPeriod pfntimeEndPeriod = (p_timeEndPeriod)GetProcAddress(winmm, "timeEndPeriod");
p_timeEndPeriod pfntimeEndPeriod = (p_timeEndPeriod)(LPVOID)GetProcAddress(winmm, "timeEndPeriod");
if (pfntimeEndPeriod)
pfntimeEndPeriod(1);
FreeLibrary(winmm);
@ -3005,10 +3005,10 @@ void I_StartupTimer(void)
winmm = LoadLibraryA("winmm.dll");
if (winmm)
{
p_timeEndPeriod pfntimeBeginPeriod = (p_timeEndPeriod)GetProcAddress(winmm, "timeBeginPeriod");
p_timeEndPeriod pfntimeBeginPeriod = (p_timeEndPeriod)(LPVOID)GetProcAddress(winmm, "timeBeginPeriod");
if (pfntimeBeginPeriod)
pfntimeBeginPeriod(1);
pfntimeGetTime = (p_timeGetTime)GetProcAddress(winmm, "timeGetTime");
pfntimeGetTime = (p_timeGetTime)(LPVOID)GetProcAddress(winmm, "timeGetTime");
}
I_AddExitFunc(I_ShutdownTimer);
#endif
@ -3307,7 +3307,7 @@ void I_GetDiskFreeSpace(INT64 *freespace)
if (!testwin95)
{
pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA");
pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA");
testwin95 = true;
}
if (pfnGetDiskFreeSpaceEx)
@ -3331,7 +3331,7 @@ void I_GetDiskFreeSpace(INT64 *freespace)
char *I_GetUserName(void)
{
static char username[MAXPLAYERNAME];
static char username[MAXPLAYERNAME+1];
char *p;
#ifdef _WIN32
DWORD i = MAXPLAYERNAME;
@ -3827,7 +3827,7 @@ const CPUInfoFlags *I_CPUInfo(void)
#if defined (_WIN32)
static CPUInfoFlags WIN_CPUInfo;
SYSTEM_INFO SI;
p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent");
p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent");
ZeroMemory(&WIN_CPUInfo,sizeof (WIN_CPUInfo));
if (pfnCPUID)

View File

@ -635,11 +635,6 @@ static void Impl_HandleWindowEvent(SDL_WindowEvent evt)
if (cv_usemouse.value) I_StartupMouse();
}
//else firsttimeonmouse = SDL_FALSE;
capslock = !!( SDL_GetModState() & KMOD_CAPS );// in case CL changes
if (USE_MOUSEINPUT)
SDLdoGrabMouse();
}
else if (!mousefocus && !kbfocus)
{
@ -1296,6 +1291,8 @@ void I_StartupMouse(void)
//
void I_OsPolling(void)
{
SDL_Keymod mod;
if (consolevent)
I_GetConsoleEvents();
if (SDL_WasInit(SDL_INIT_JOYSTICK) == SDL_INIT_JOYSTICK)
@ -1310,6 +1307,18 @@ void I_OsPolling(void)
I_GetMouseEvents();
I_GetEvent();
mod = SDL_GetModState();
/* Handle here so that our state is always synched with the system. */
shiftdown = ctrldown = altdown = 0;
capslock = false;
if (mod & KMOD_LSHIFT) shiftdown |= 1;
if (mod & KMOD_RSHIFT) shiftdown |= 2;
if (mod & KMOD_LCTRL) ctrldown |= 1;
if (mod & KMOD_RCTRL) ctrldown |= 2;
if (mod & KMOD_LALT) altdown |= 1;
if (mod & KMOD_RALT) altdown |= 2;
if (mod & KMOD_CAPS) capslock = true;
}
//

View File

@ -1219,7 +1219,7 @@
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CURRENT_PROJECT_VERSION = 2.1.23;
CURRENT_PROJECT_VERSION = 2.1.25;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
NORMALSRB2,
@ -1231,7 +1231,7 @@
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CURRENT_PROJECT_VERSION = 2.1.23;
CURRENT_PROJECT_VERSION = 2.1.25;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_PREPROCESSOR_DEFINITIONS = (

View File

@ -98,8 +98,8 @@ static INT32 current_track;
static void var_cleanup(void)
{
loop_point = song_length =\
music_bytes = fading_source = fading_target =\
song_length = loop_point = 0.0f;
music_bytes = fading_source = fading_target =\
fading_timer = fading_duration = 0;
songpaused = is_looping =\
@ -362,7 +362,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
gme_track_info(emu, &info, 0);
len = (info->play_length * 441 / 10) << 2;
mem = malloc(len);
mem = Z_Malloc(len, PU_SOUND, 0);
gme_play(emu, len >> 1, mem);
gme_free_info(info);
gme_delete(emu);
@ -435,7 +435,7 @@ void *I_GetSfx(sfxinfo_t *sfx)
gme_track_info(emu, &info, 0);
len = (info->play_length * 441 / 10) << 2;
mem = malloc(len);
mem = Z_Malloc(len, PU_SOUND, 0);
gme_play(emu, len >> 1, mem);
gme_free_info(info);
gme_delete(emu);
@ -569,7 +569,7 @@ static void music_loop(void)
{
Mix_PlayMusic(music, 0);
Mix_SetMusicPosition(loop_point);
music_bytes = loop_point*44100.0L*4; //assume 44.1khz, 4-byte length (see I_GetSongPosition)
music_bytes = (UINT32)(loop_point*44100.0L*4); //assume 44.1khz, 4-byte length (see I_GetSongPosition)
}
else
I_StopSong();
@ -842,7 +842,7 @@ boolean I_SetSongPosition(UINT32 position)
Mix_RewindMusic(); // needed for mp3
if(Mix_SetMusicPosition((float)(position/1000.0L)) == 0)
music_bytes = position/1000.0L*44100.0L*4; //assume 44.1khz, 4-byte length (see I_GetSongPosition)
music_bytes = (UINT32)(position/1000.0L*44100.0L*4); //assume 44.1khz, 4-byte length (see I_GetSongPosition)
else
// NOTE: This block fires on incorrect song format,
// NOT if position input is greater than song length.
@ -886,7 +886,7 @@ UINT32 I_GetSongPosition(void)
if (!music || I_SongType() == MU_MID)
return 0;
else
return music_bytes/44100.0L*1000.0L/4; //assume 44.1khz
return (UINT32)(music_bytes/44100.0L*1000.0L/4); //assume 44.1khz
// 4 = byte length for 16-bit samples (AUDIO_S16SYS), stereo (2-channel)
// This is hardcoded in I_StartupSound. Other formats for factor:
// 8M: 1 | 8S: 2 | 16M: 2 | 16S: 4

View File

@ -1219,7 +1219,7 @@
C01FCF4B08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CURRENT_PROJECT_VERSION = 2.1.23;
CURRENT_PROJECT_VERSION = 2.1.25;
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
NORMALSRB2,
@ -1231,7 +1231,7 @@
C01FCF4C08A954540054247B /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CURRENT_PROJECT_VERSION = 2.1.23;
CURRENT_PROJECT_VERSION = 2.1.25;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_GENERATE_DEBUGGING_SYMBOLS = NO;
GCC_PREPROCESSOR_DEFINITIONS = (

View File

@ -54,7 +54,7 @@ typedef enum
} skinsound_t;
// free sfx for S_AddSoundFx()
#define NUMSFXFREESLOTS 800 // Matches SOC Editor.
#define NUMSFXFREESLOTS 1600 // Matches SOC Editor.
#define NUMSKINSFXSLOTS (MAXSKINS*NUMSKINSOUNDS)
//

View File

@ -203,7 +203,7 @@ void ST_Ticker(void)
}
// 0 is default, any others are special palettes.
static INT32 st_palette = 0;
INT32 st_palette = 0;
void ST_doPaletteStuff(void)
{

View File

@ -61,6 +61,7 @@ boolean ST_SameTeam(player_t *a, player_t *b);
//--------------------
extern boolean st_overlay; // sb overlay on or off when fullscreen
extern INT32 st_palette; // 0 is default, any others are special palettes.
extern lumpnum_t st_borderpatchnum;
// patches, also used in intermission

View File

@ -150,9 +150,15 @@ FILE *W_OpenWadFile(const char **filename, boolean useerrors)
{
FILE *handle;
strncpy(filenamebuf, *filename, MAX_WADPATH);
filenamebuf[MAX_WADPATH - 1] = '\0';
*filename = filenamebuf;
// Officially, strncpy should not have overlapping buffers, since W_VerifyNMUSlumps is called after this, and it
// changes filename to point at filenamebuf, it would technically be doing that. I doubt any issue will occur since
// they point to the same location, but it's better to be safe and this is a simple change.
if (filenamebuf != *filename)
{
strncpy(filenamebuf, *filename, MAX_WADPATH);
filenamebuf[MAX_WADPATH - 1] = '\0';
*filename = filenamebuf;
}
// open wad file
if ((handle = fopen(*filename, "rb")) == NULL)
@ -335,7 +341,6 @@ static restype_t ResourceFileDetect (const char* filename)
static lumpinfo_t* ResGetLumpsStandalone (FILE* handle, UINT16* numlumps, const char* lumpname)
{
lumpinfo_t* lumpinfo = Z_Calloc(sizeof (*lumpinfo), PU_STATIC, NULL);
lumpinfo = Z_Calloc(sizeof (*lumpinfo), PU_STATIC, NULL);
lumpinfo->position = 0;
fseek(handle, 0, SEEK_END);
lumpinfo->size = ftell(handle);
@ -567,14 +572,14 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
{
CONS_Alert(CONS_ERROR, "Failed to read central directory (%s)\n", strerror(ferror(handle)));
Z_Free(lumpinfo);
free(zentry);
free(zentries);
return NULL;
}
if (memcmp(zentry->signature, pat_central, 4))
{
CONS_Alert(CONS_ERROR, "Central directory is corrupt\n");
Z_Free(lumpinfo);
free(zentry);
free(zentries);
return NULL;
}
@ -587,7 +592,7 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
{
CONS_Alert(CONS_ERROR, "Unable to read lumpname (%s)\n", strerror(ferror(handle)));
Z_Free(lumpinfo);
free(zentry);
free(zentries);
free(fullname);
return NULL;
}
@ -629,6 +634,8 @@ static lumpinfo_t* ResGetLumpsZip (FILE* handle, UINT16* nlmp)
}
}
free(zentries);
*nlmp = numlumps;
return lumpinfo;
}
@ -1139,6 +1146,22 @@ boolean W_IsLumpWad(lumpnum_t lumpnum)
return false; // WADs should never be inside non-PK3s as far as SRB2 is concerned
}
//
// W_IsLumpFolder
// Is the lump a folder? (in a PK3 obviously)
//
boolean W_IsLumpFolder(UINT16 wad, UINT16 lump)
{
if (wadfiles[wad]->type == RET_PK3)
{
const char *name = wadfiles[wad]->lumpinfo[lump].name2;
return (name[strlen(name)-1] == '/'); // folders end in '/'
}
return false; // non-PK3s don't have folders
}
#ifdef HAVE_ZLIB
/* report a zlib or i/o error */
void zerr(int ret)
@ -1314,8 +1337,9 @@ size_t W_ReadLumpHeaderPwad(UINT16 wad, UINT16 lump, void *dest, size_t size, si
{
size = 0;
zerr(zErr);
(void)inflateEnd(&strm);
}
(void)inflateEnd(&strm);
}
else
{

View File

@ -154,6 +154,7 @@ size_t W_LumpLengthPwad(UINT16 wad, UINT16 lump);
size_t W_LumpLength(lumpnum_t lumpnum);
boolean W_IsLumpWad(lumpnum_t lumpnum); // for loading maps from WADs in PK3s
boolean W_IsLumpFolder(UINT16 wad, UINT16 lump); // for detecting folder "lumps"
#ifdef HAVE_ZLIB
void zerr(int ret); // zlib error checking

View File

@ -36,10 +36,6 @@ ifndef GCC44
#OPTS+=-mms-bitfields
endif
ifndef MINGW64
OPTS+=-gdwarf-2
endif
ifndef SDL
OPTS+=-D_WINDOWS
endif

View File

@ -91,6 +91,7 @@
<Import Project="..\..\libs\FMOD.props" />
<Import Project="..\..\libs\zlib.props" />
<Import Project="..\..\libs\libpng.props" />
<Import Project="..\..\libs\libgme.props" />
<Import Project="SRB2Win.props" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">

View File

@ -5,7 +5,10 @@
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<PreprocessorDefinitions>_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- x86/x64 defines: has specific libraries that ARM does not -->
<PreprocessorDefinitions Condition="'$(Platform)' == 'Win32' OR '$(Platform)' == 'x64'">HAVE_ZLIB;HAVE_LIBGME;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<!-- ARM defines -->
<PreprocessorDefinitions Condition="'$(Platform)' != 'Win32' AND '$(Platform)' != 'x64'">_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link />
<Link>

View File

@ -147,7 +147,7 @@ static inline BOOL LoadDirectDraw(VOID)
DDrawDLL = LoadLibraryA("DDRAW.DLL");
if (DDrawDLL == NULL)
return false;
pfnDirectDrawCreate = (DDCreate)GetProcAddress(DDrawDLL, "DirectDrawCreate");
pfnDirectDrawCreate = (DDCreate)(LPVOID)GetProcAddress(DDrawDLL, "DirectDrawCreate");
if (pfnDirectDrawCreate == NULL)
return false;
return true;

View File

@ -327,7 +327,7 @@ static inline VOID I_GetConsoleEvents(VOID)
break;
case VK_RETURN:
entering_con_command = false;
// Fall through.
/* FALLTHRU */
default:
ev.data1 = MapVirtualKey(input.Event.KeyEvent.wVirtualKeyCode,2); // convert in to char
}
@ -3395,7 +3395,7 @@ BOOL LoadDirectInput(VOID)
DInputDLL = LoadLibraryA("DINPUT.DLL");
if (DInputDLL == NULL)
return false;
pfnDirectInputCreateA = (DICreateA)GetProcAddress(DInputDLL, "DirectInputCreateA");
pfnDirectInputCreateA = (DICreateA)(LPVOID)GetProcAddress(DInputDLL, "DirectInputCreateA");
if (pfnDirectInputCreateA == NULL)
return false;
return true;
@ -3529,7 +3529,7 @@ void I_GetDiskFreeSpace(INT64* freespace)
if (!testwin95)
{
pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA");
pfnGetDiskFreeSpaceEx = (p_GetDiskFreeSpaceExA)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "GetDiskFreeSpaceExA");
testwin95 = true;
}
if (pfnGetDiskFreeSpaceEx)
@ -3615,7 +3615,7 @@ const CPUInfoFlags *I_CPUInfo(void)
{
static CPUInfoFlags WIN_CPUInfo;
SYSTEM_INFO SI;
p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent");
p_IsProcessorFeaturePresent pfnCPUID = (p_IsProcessorFeaturePresent)(LPVOID)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsProcessorFeaturePresent");
ZeroMemory(&WIN_CPUInfo,sizeof (WIN_CPUInfo));
if (pfnCPUID)
@ -3658,9 +3658,9 @@ static p_SetProcessAffinityMask pfnSetProcessAffinityMask = NULL;
static inline VOID GetAffinityFuncs(VOID)
{
HMODULE h = GetModuleHandleA("kernel32.dll");
pfnGetCurrentProcess = (p_GetCurrentProcess)GetProcAddress(h, "GetCurrentProcess");
pfnGetProcessAffinityMask = (p_GetProcessAffinityMask)GetProcAddress(h, "GetProcessAffinityMask");
pfnSetProcessAffinityMask = (p_SetProcessAffinityMask)GetProcAddress(h, "SetProcessAffinityMask");
pfnGetCurrentProcess = (p_GetCurrentProcess)(LPVOID)GetProcAddress(h, "GetCurrentProcess");
pfnGetProcessAffinityMask = (p_GetProcessAffinityMask)(LPVOID)GetProcAddress(h, "GetProcessAffinityMask");
pfnSetProcessAffinityMask = (p_SetProcessAffinityMask)(LPVOID)GetProcAddress(h, "SetProcessAffinityMask");
}
static void CPUAffinity_OnChange(void)