Commit Graph

838 Commits

Author SHA1 Message Date
Inuyasha 8e753c1886 compilation fix for DEBUGRANDOM 2016-04-27 17:17:35 -07:00
Monster Iestyn ac3de70c93 Merge branch 'slope-fixes' into 'next'
Slope fixes

This branch fixes the following slope-related physics and rendering bugs:

* Rings in multiplayer stages respawning inside slopes (even despite being able to spawn ABOVE them on map load)
* Player starts spawning players inside slopes
* Elemental flame trails not appearing if a player spindashes UP a slope; see issue #21
* Dying players "jumping" off slopes to the side if they were previously standing on one
* Some issues with FOF slope rendering
* Various issues with sprites displaying through walls adjacent to slopes

Other features added:
* Objectplace now supports slopes (this is Inuyasha's doing)
* Automap in DEVMODE now supports slopes (my doing)

Just making this merge request now rather than later, ~~in case I decide not to make any more fixes for the time being~~ (this branch doesn't seem to want to die lol), and so we can get these merged in as soon as the code's all been checked over.

See merge request !50
2016-04-26 17:21:27 -04:00
Monster Iestyn 0a887948eb Ensure pixhigh/pixlow is always set whenever the game decides a top/bottom texture should be drawn
This fixes the rendering glitches encountered around slopes in Glacier Gear, yes. :)
2016-04-25 18:48:14 +01:00
Inuyasha b288d8a399 Merge branch 'bp_random2' into 'next'
xorshift* PRNG

This needs testing to ensure I didn't mess anything up switching function names around.

Our PRNG sucks. This is probably obvious. I wish I had known better at the time I implemented it, but oh well.

The replacement is an xorshift* PRNG variant with period 2^32 - 1 (meaning that the PRNG state will loop after four billion calls ... that's not likely to happen), versus the old PRNG's period of about 2^22 (?). The output is also much more random and less predictable; the old PRNG would fall into a predictable loop of output after about 4000 numbers were generated, which isn't much.

The PRNG here also outputs numbers as fixed point from [0,1) (that's 0 to FRACUNIT-1, in other words) instead of single bytes at a time. This makes it much easier to calculate things for, say, P_RandomRange and P_RandomKey. A new macro, P_RandomChance(p), is now in use that returns true _p_ percent of the time, where _p_ is a fixed_t probability from 0 (0%) to FRACUNIT (100%).

This doesn't affect netgames at all; the code for seed saving and restoring is identical (aside from a check to prevent seed being set to 0, which breaks xorshift PRNGs). Demos break, but A: _duh_ and B: they're already broken by all the changes to physics to accommodate slopes.

P_Random is deprecated in Lua, as the function was renamed to P_RandomByte. Aside from that, nothing special.

See merge request !64
2016-04-24 18:03:13 -04:00
Monster Iestyn b8cc36dfd1 P_LookForEnemies should not change the player's angle until the target has been decided
This fixes a quirk with Shadow with chaos control sometimes throwing the player in the wrong direction
2016-04-22 22:28:00 +01:00
Monster Iestyn d53801c85c Disable the corona-related consvars unless ALAM_LIGHTING macro is enabled 2016-04-21 18:50:30 +01:00
Monster Iestyn 009616e6ac Merge branch 'next' into gl-slopes 2016-04-20 20:47:47 +01:00
Monster Iestyn ab2cadd372 Merge branch 'next' into slope-fixes 2016-04-20 20:47:11 +01:00
Monster Iestyn ae491f1b8c Merge branch 'next' into skybox-hotfix 2016-04-20 20:46:43 +01:00
Monster Iestyn 96d329ad49 Merge branch 'next' into portal-fix 2016-04-20 20:46:13 +01:00
Monster Iestyn dcf1ccb950 Merge branch 'next' into demo-replay-fixes 2016-04-20 20:45:43 +01:00
Monster Iestyn e0604bb5f3 Merge branch 'master' into next 2016-04-20 20:27:09 +01:00
Monster Iestyn 69b43aee2d Fix how FF_CUTEXTRA FOFs carry over cutting ability to FOFs below them in the same sector, even if they shouldn't do that 2016-04-20 20:26:41 +01:00
Monster Iestyn 8d7edbff1a Merge branch 'next' into gl-slopes 2016-04-20 18:21:49 +01:00
Monster Iestyn c833f3845f Merge branch 'next' into bp_random2 2016-04-20 18:18:28 +01:00
Monster Iestyn e05951e213 Merge branch 'next' into slope-fixes 2016-04-20 18:17:14 +01:00
Monster Iestyn d47ccb0859 Merge branch 'next' into skybox-hotfix 2016-04-20 18:16:46 +01:00
Monster Iestyn 42b281f06c Merge branch 'next' into portal-fix 2016-04-20 18:16:16 +01:00
Monster Iestyn 60ec0ff294 Merge branch 'next' into demo-replay-fixes 2016-04-20 18:15:36 +01:00
Monster Iestyn b797ae9731 Merge branch 'master' into next 2016-04-20 18:05:51 +01:00
Monster Iestyn 0aba2f607b Fix FOFs with FF_CUTSOLIDS but not FF_SOLID causing software renderer problems and even crashes
Always wondered why a flag meant for FOF physics was used in the rendering code, lol
2016-04-20 18:04:51 +01:00
Inuyasha a26989c903 brevity is a virtue or something like that 2016-04-18 21:59:33 -07:00
Inuyasha 18d5d64a4d error conditions for Lua fixed point math 2016-04-18 14:50:15 -07:00
Monster Iestyn be7b866e4f resynch_pak changes
* add skidtime, which we forgot before 2.1 release apparently
* change tics from INT16 to INT32
* change eflags from UINT8 to UINT16
* change actionspd/mindash/maxdash from INT32 to fixed_t
2016-04-16 18:40:14 +01:00
Monster Iestyn f96b830f36 Write/read FOF flags as 32-bit not 16-bit, whoops 2016-04-16 18:06:26 +01:00
Monster Iestyn 7830a9e27b Splitscreen fix: half of GFZ1's invinc monitor should no longer appear above the bridge for player 2
I don't know if there's any other vid.height/viewheight confusion like this around, but that was the cause apparently
2016-04-10 20:27:55 +01:00
Monster Iestyn 11c24f5ab6 Merge branch 'next' into gl-slopes
# Conflicts:
#	src/hardware/hw_main.c
2016-04-09 22:12:29 +01:00
Alam Ed Arias b9eed02123 whitespace clean 2016-04-07 16:34:36 -04:00
Inuyasha 3b4b7a05fd Better CTF in splitscreen, no death message for spectators 2016-04-06 19:55:58 -07:00
Inuyasha 0dd92e9396 V_DrawFill in OGL now consistent with software 2016-04-06 18:33:38 -07:00
Inuyasha 3117a6a16e Splitscreen fixes
initialize flipcam2
player 2 gets game over music now.
restore the other player's music when the dead player is done sulking about their game over
2016-04-06 18:28:43 -07:00
Inuyasha 5aea82ec91 Some drawing code cleanup
Fixed mashing buttons during fades causing crashes,
messed up behavior, record attack anywhere,
all the damn stupid bugs that it caused, basically
2016-04-06 18:01:01 -07:00
Monster Iestyn b1e736242f fixed all compiling errors relating to ESLOPE being undefined 2016-04-06 22:19:39 +01:00
Inuyasha e91cfa7110 Fixed frustrating MIDI stuff
Until we use something besides Native MIDI to play
back MIDI music, MIDI volume changing is disabled
since it causes way too much of a damn headache.
(It's not even our fault, it's fucking MS.)
2016-04-06 08:16:13 -07:00
Monster Iestyn 29f0301540 Whoops 2016-04-05 21:21:45 +01:00
Monster Iestyn e8a4d7b7b8 Fix replay camera not being turnable when climbing, sliding ...and several other things.
If in analog mode, this does not apply (also analog mode replay camera no longer borks)
2016-04-05 20:56:48 +01:00
Monster Iestyn 1df25050be Merge branch 'next' into bp_random2 2016-04-05 17:26:05 +01:00
Monster Iestyn 93a1e46f1c Merge branch 'next' into slope-fixes 2016-04-05 17:19:28 +01:00
Monster Iestyn acdba7316c Merge branch 'next' into skybox-hotfix 2016-04-05 17:18:48 +01:00
Monster Iestyn 53b093b197 Merge branch 'next' into portal-fix 2016-04-05 17:18:08 +01:00
Monster Iestyn 69a58d8369 Fix lighting parity between resolutions for sprites and FOFs 2016-04-05 15:33:55 +01:00
Monster Iestyn 7a369a5650 Turns out boss thing types re-setting mthing->z is a left-over from 1.09.4 and older versions
Apparently bosses and players used to use options >> 5 instead of 4 for z heights, or so it seems
2016-04-05 12:39:53 +01:00
Monster Iestyn 48e3b5e37d Corrected botch-up with plane viewangles, slope planes probably broke because of the last commit 2016-04-05 10:43:56 +01:00
Monster Iestyn 44fe6e0533 Fix sky rendering when visportals are on-screen.
They now render the same way they would if you were actually at the other side of each portal. Why didn't they do this before?
2016-04-04 21:46:51 +01:00
Monster Iestyn 3c5a8b806d Fix slope planes rendering at wrong heights when visportals are visible on-screen 2016-04-04 20:49:01 +01:00
Inuyasha 1db51f5a23 doomed# 750 shouldn't ever spawn objects 2016-04-03 19:49:27 -07:00
Monster Iestyn 5f3beb6899 Fix M_PI not being defined for Visual Studio 2016-04-02 20:09:00 +01:00
Monster Iestyn cf89a5bb11 Removed obsolete PORTAL_LIMIT macro 2016-04-02 17:04:23 +01:00
Monster Iestyn aab5e656ea removed unused "total" variable in P_GroupLines 2016-04-02 17:01:58 +01:00
Alam Ed Arias 1c16943be8 Merge branch 'next' into bp_random2 2016-03-31 21:44:03 -04:00
Alam Ed Arias b45b9801d6 Merge branch 'next' into slope-fixes 2016-03-31 21:43:51 -04:00
Alam Ed Arias d2241ce30a Merge branch 'next' into skybox-hotfix 2016-03-31 21:42:59 -04:00
wolfy852 f3f2c59622 Remove p_fab.c 2016-03-31 20:42:01 -05:00
Inuyasha 816990a3ed Merge branch 'polyobj-teeter-fix' into 'next'
Fix for teetering on PolyObjects

So... somebody goofed and didn't realise PolyObject sectors could be added to the sector node list for each object (which is referenced by mobj->touching_sectorlist), via their linedefs if they are nearby the player (yes, PolyObject linedefs are special and get to move about the level). As it turns out, this allows even INTANGIBLE PolyObjects to make you teeter in a seemingly inexplicable way.

What is happening is that PolyObject sectors, when they are added to the mentioned lists, are then checked under normal sector teetering conditions - if the player is above the floorheight by 24 FUs, you're officially teetering unless stated otherwise. The actual PolyObject teetering code can't help you here if the conditions are right, especially if they're taller than 24 FU in height.

There are a number of things wrong with the teetering code in general that I'd like to sort eventually, but at least now teetering on PolyObjects is fixed at last ...right? Please check the branch out if you can to check this, obviously.

See merge request !54
2016-03-31 20:55:28 -04:00
Inuyasha 042331edd5 Merge branch 'patch-scaling-flip-fix' into 'next'
Fixes for patch scaling and V_FLIP usage

The following issues are fixed by this branch:
* a patch using both scaling and V_FLIP does not appear in the "correct" place on the screen. Thanks to LJSonic for pointing this out to me on 'fun
* Scaled and/or V_FLIPed patches wrap at the left/right screen edges even though they're not supposed to. V_FLIP patches at these edges may also crop the wrong side of the patch if they're at the right edge.

See merge request !60
2016-03-31 20:21:51 -04:00
Inuyasha 31cec9dfee Merge branch 'portal-fix' into 'next'
Some fixes for portals

Specifically the following things are fixed in this branch:

* a memory leak resulting from not clearing away clipping-related arrays each tic you view a portal
* a very specific crash to do with portals sometimes (unintentionally) using a hack on drawsegs that don't actually belong to them ...which results in a crash if the drawsegs in question have midtextures. I reported it on the MB a year ago, with a test map included there: https://mb.srb2.org/showthread.php?t=38199&page=4#79
* another specific crash to do with mirrored (horizontally flipped) sprites that are scaled, particularly when you cover up the left edge of them via portals at the least. Needs more testing to be absolutely sure this is fixed, and is also reproducable in the test map linked in the post above

May be fine to merge changes into master too, I don't really know exactly

See merge request !42
2016-03-31 20:19:58 -04:00
Inuyasha 96c1d7a14b Merge branch 'camera-fix' into 'next'
Camera fix

This fixes the third person camera being silly around intangible PolyObjects, particularly the fact they can affect the camera's floorz and ceilingz even though I see no reason why they should do so.

Also a good reminder that POF_SOLID is the same as POF_CLIPLINES and POF_CLIPPLANES combined, which is probably how this issue came about to begin with. Can't say that with certainty of course.

See merge request !57
2016-03-31 20:17:27 -04:00
Alam Ed Arias 6b9fd60f06 Merge branch 'next' into camera-fix 2016-03-31 12:28:31 -04:00
Alam Ed Arias e8770f0264 Merge branch 'next' into skybox-hotfix 2016-03-31 12:28:19 -04:00
Alam Ed Arias 8b4236c00d Merge branch 'next' into portal-fix 2016-03-31 12:27:55 -04:00
Alam Ed Arias 121f144e3c Merge branch 'next' into patch-scaling-flip-fix 2016-03-31 12:27:43 -04:00
Alam Ed Arias 47bb95f5f5 Merge branch 'next' into polyobj-teeter-fix 2016-03-31 12:26:52 -04:00
Alam Ed Arias e16129a8c5 Merge branch 'next' into closestpointonline 2016-03-31 12:17:52 -04:00
Alam Ed Arias 32a950893e Merge branch 'next' into slope-fixes 2016-03-31 12:17:40 -04:00
Alam Ed Arias d77e541f29 Merge branch 'next' into bp_random2 2016-03-31 12:15:09 -04:00
Monster Iestyn e34da95c4c DEVMODE's automap now supports slopes 2016-03-31 16:32:25 +01:00
Inuyasha fc8e7728cd I meant to extend this to 4 seconds but forgot 2016-03-31 06:57:11 -07:00
Inuyasha 690b65b47f "Sonic can now become Super Sonic" exists again
Fixed an off-by-one array error in the process
2016-03-31 06:51:04 -07:00
Inuyasha 3812b6bc20 the abs() is necessary; force unsigned shift and signed result 2016-03-31 06:48:08 -07:00
Alam Ed Arias 283c64ee20 Merge branch 'next' into camera-fix 2016-03-30 20:49:44 -04:00
Alam Ed Arias 9fcd06f152 Merge branch 'next' into skybox-hotfix 2016-03-30 20:49:20 -04:00
Alam Ed Arias f84d76c683 Merge branch 'next' into portal-fix 2016-03-30 20:43:25 -04:00
Alam Ed Arias 44afedd85f Merge branch 'next' into patch-scaling-flip-fix 2016-03-30 20:42:59 -04:00
Alam Ed Arias d26c486c6d Merge branch 'next' into polyobj-teeter-fix 2016-03-30 20:42:33 -04:00
Alam Ed Arias bdcdf8ddab Merge branch 'next' into closestpointonline 2016-03-30 20:42:07 -04:00
Alam Ed Arias 4370459166 Merge branch 'next' into slope-fixes 2016-03-30 20:41:33 -04:00
Alam Ed Arias a935ac21e8 Merge branch 'next' into bp_random2 2016-03-30 20:40:48 -04:00
Alam Ed Arias 75f65c4d44 using abs() on unsigned have no effect 2016-03-30 20:17:09 -04:00
Alam Ed Arias 51aa7692d8 Merge branch 'master' into next 2016-03-30 20:15:08 -04:00
Alam Ed Arias d90536967d removed/remline ununsed code 2016-03-30 14:05:07 -04:00
Alam Ed Arias b169529dfd switich to do the angle math in signed, then run it thur abs() 2016-03-30 11:47:27 -04:00
Inuyasha 9cec9093bb denom of A_CheckRandom can't be zero, that would be bad 2016-03-30 06:20:57 -07:00
Alam Ed Arias 0fe6ee5339 cleanup abs warnings 2016-03-30 00:22:12 -04:00
Inuyasha caf081b6f5 Merge branch 'bp_random2' of http://git.magicalgirl.moe/STJr/SRB2 into bp_random2 2016-03-29 16:35:21 -07:00
Inuyasha 480f9be51f gotta start compensating for xorshift's needs 2016-03-29 16:27:57 -07:00
Inuyasha 3dc4cfc229 Simplicity is a virute... don't overcomplicate things. 2016-03-29 16:27:56 -07:00
Inuyasha a3e940fe65 Compensate for insufficient RAND_MAX values. 2016-03-29 16:27:56 -07:00
Inuyasha ac03ce39c8 *_Random is now *_RandomByte.
P_RandomChance is now a macro for something that should happen a
certain percentage of time.

P_SignedRandom was moved to a macro. Nobody cared.

# Conflicts:
#	src/p_inter.c
2016-03-29 16:27:55 -07:00
Inuyasha ce2c2de58a P_Random now using a variant of xorshift
This actually passes most diehard tests, as opposed to the old RNG.
It's also similarly fast.

Internally the PRNG generates a fixed point number from [0,1) now,
which makes P_RandomKey and P_RandomRange much easier to
calculate. P_Random is just a simple shift, as well.

Also, the lack of floating point math in P_RandomKey and
P_RandomRange now is probably for the best.
2016-03-29 16:27:25 -07:00
Monster Iestyn 1108a52959 Check change in ceilinglightsec for markceiling code, not floorlightsec 2016-03-29 22:44:16 +01:00
Monster Iestyn ee00da6a74 Another thing that probably needed to check for slopes 2016-03-29 22:32:09 +01:00
Monster Iestyn ef832dd8b8 Fixed how two adjacent FOFs can prevent each others' walls from displaying if they're at least partially covered
Also some miscellaneous tweaks and changes to account for slopes properly
2016-03-29 18:59:56 +01:00
Monster Iestyn 6bda1a57a5 Fix FOF plane light underside checks 2016-03-29 15:40:01 +01:00
Monster Iestyn bc8ea700ed Merge branch 'next' of http://git.magicalgirl.moe/STJr/SRB2.git into closestpointonline 2016-03-26 18:32:51 +00:00
Alam Ed Arias 583ffd2537 Merge branch 'next' into patch-scaling-flip-fix 2016-03-25 22:40:17 -04:00
Alam Ed Arias f50a46a0cd Merge branch 'next' into camera-fix 2016-03-25 22:40:04 -04:00
Alam Ed Arias b11236a591 Merge branch 'next' into skybox-hotfix 2016-03-25 22:39:51 -04:00
Alam Ed Arias 21b13acd4b Merge branch 'next' into polyobj-teeter-fix 2016-03-25 22:39:41 -04:00
Alam Ed Arias b29a176275 Merge branch 'next' into slope-fixes 2016-03-25 22:39:11 -04:00
Alam Ed Arias 8d3ded4020 Merge branch 'next' into portal-fix 2016-03-25 22:38:56 -04:00