Commit graph

1562 commits

Author SHA1 Message Date
toasterbabe ce8ae48222 I think this is as optimised as it's gonna get. Now onto the flag! 2016-08-18 12:55:04 +01:00
toasterbabe 2d3ebc5e49 Fixed the last of the odd stretching by:
* recognising that the offsets weren't going to be accurate if you just SWAPPED yscale and yscale2 over 180 degrees
* taking scale into account consistently

also, some optimisations
2016-08-18 12:40:45 +01:00
toasterbabe 9231a4653c SORTED, THANKS MI
http://gfycat.com/SimpleShallowDeviltasmanian

now to put this behind some sort of flag and optimise it
2016-08-17 22:19:28 +01:00
toasterbabe 66a737a7f0 fuuuuuuuu 2016-08-17 21:24:53 +01:00
toasterbabe 6c559946f0 ok no i misunderstood what he was getting at 2016-08-17 21:14:01 +01:00
toasterbabe 7096659450 Thanks to MI for helping me notice a scaling issue by code alone 2016-08-17 21:11:05 +01:00
toasterbabe 2244e9162b Some overflow checks. They're not proper like the other overflow checks, but they remove all the situations I've been able to discover without making stuff unnecessarily disappear. 2016-08-17 19:09:59 +01:00
toasterbabe 63e58a02f8 Fixed the issue mentioned in last commit, but still not the one from before that. Hrm. 2016-08-17 00:15:23 +01:00
toasterbabe 84c39c24f9 Renamed leftoffset to offset, to refer to its multifaceted uses.
Also, discovered another undesirable bug, but don't understand exactly what's going on so won't describe it here.
2016-08-17 00:03:09 +01:00
toasterbabe 10a8682620 resolved issue where the sides had the opposite scales over ANGLE_180.
also, i've sussed out WHAT'S going wrong here - the topleft pixel of the sprite will always be rendered at the height on the screen it would be rendered otherwise, which is causing the waving. now to figure out what to change to get that to move appropriately...
2016-08-16 23:38:59 +01:00
toasterbabe a2b26c3bf4 Forgot a border of screen consideration 2016-08-16 23:25:01 +01:00
toasterbabe 27cdef0075 WOOPS, did not mean to leave it in the rangecheck, now it works close to desired
some complicated mathemagic leads to something which... seems CLOSE, but not perfectly accurate, so i think i need to tweak it more

http://gfycat.com/JovialSpitefulAmericancrayfish for current behaviour
2016-08-16 23:17:45 +01:00
toasterbabe 67f8a1295e Couldn't justify my hack in the long run, so it's back to adding and removing MF_NOCLIPTHING instead of the player pointer.
I DID make some steps towards re-implementing PIT_CheckThing for solids only in order to replace the hack long-term and hopefully use less CPU, but is currently disabled via #if 0 since I'm not comfortable changing the function signature of P_CheckPosition right now.
2016-08-16 17:49:20 +01:00
Monster Iestyn df9ad4a0e6 wall-scroll-by-linedef specials now use just linedef dx/dy to determine scrolling direction, rather than the complex system that was in place before
If there's any reason to bring the old system back we could make it togglable by one of the linedef flags I suppose. Not that many people would actually use it though, most likely
2016-08-16 17:15:39 +01:00
toasterbabe 76e53ee3b6 this is shitty and glitchy but it compiles
remove all the places where i've set vis->scalestep to anything other than 0 to see something that LOOKS okay, but doesn't fulfil exactly what i want (that being a sprite that looks exactly like a midtexture)
2016-08-15 20:54:05 +01:00
Monster Iestyn 1530183ddf Fix multiple solid midtexture-related issues:
* Effect 3 (Peg Midtexture) is now accounted for properly, flipping the collision box position to match the actual rendered position of the midtexture
* Fixed incorrect application of y-offsets for non-lower unpegged midtextures collision boxes; +ve always goes up, -ve always goes down!
* Effect 4 now doesn't make midtextures solid for polyobjects at all - this "conflicted" with First Line having both Effect 4 (visible planes) and Effect 3 (intangible) simultaneously, where we kind of expect the first line's wall to not be made solid. This may be less of a problem in future SRB2 versions, but for now solid midtextures for polyobjects are disabled.
2016-08-14 16:56:41 +01:00
Alam Ed Arias 0264fd24ae @MonsterIestyn: Should probably be returning true then 2016-08-14 10:43:44 -04:00
RedEnchilada 55b8ef9f64 More stepping upward fixing ugh 2016-08-14 00:03:00 -05:00
RedEnchilada 758c77fe53 Fixed non-players having fucked slope stepup/down 2016-08-13 17:45:23 -05:00
Monster Iestyn f1a9634260 P_LineOpening now takes a mobj_t argument, instead of relying on tmthing
. tmthing can be NULL if called from PTR_SlideTraverse, so we should use slidemo instead

This fixes a crash that occurs in yet ANOTHER SUGOI map, involving bouncy walls next to sloped floors/ceilings
2016-08-13 21:41:18 +01:00
Alam Ed Arias bdb5db878a NONET should also disable UPNP support 2016-08-13 10:12:14 -04:00
toasterbabe be973d6990 expanded comment for future generations 2016-08-13 15:07:40 +01:00
Alam Ed Arias da23d93b00 Disable netplay for DirectDraw builds 2016-08-13 10:03:17 -04:00
toasterbabe 612575620b Solved the climbing-on-one-sided-lines problem another way, using the last touched line's attributes.
(After talking to Alam, we can't have floats anywhere near P_ functions, so.)
2016-08-13 14:16:06 +01:00
toasterbabe 5d6463fafc Fixed Knuckles being able to climb in space in OpenGL.
To understand: look at AjustSegs(void) in hw_bsp.c. It reallocates the vetex_t pointers for lines as POLYVERTEX_T pointers, and of COURSE things are gonna get wacky when you're casting pointers.

I dunno how resilient the FLOAT_TO_FIXED solution is or whether it'll be netgame compatible (yayyy float precision loss) but it's not like our builds are netgame compatible with themselves
2016-08-13 13:39:24 +01:00
toasterbabe 9e38f44f34 Rob requested a reversion of the NiGHTS camera changes on exiting the level, so here we go. 2016-08-12 21:24:17 +01:00
toasterbabe de77dc4413 Fixed a bug where NiGHTS form didn't properly account for changing skins mid-flight (devmode, maybe mp if standing on ground - haven't checked there)
Also as a consequence, DEFAULTNIGHTSSKIN is #defined in r_things.h instead of p_user.c.
2016-08-12 19:18:50 +01:00
toasterbabe 104fc8ba98 Partially reverted on Inu's reccomendation. 2016-08-12 16:01:03 +01:00
toasterbabe 7795e146fa Two seperate single-line fixes, both concerning the end of NiGHTS maps.
* The NiGHTS drone had a single tic of visibility when you hit the goal, which is evident stepping frame by frame through http://gfycat.com/ComplicatedComposedAoudad (the contents of which may or may not make it into 2.2).
* When completing a NiGHTS stage with a non-zero link, the link could flash up in the final few tics before the fade to black. This just checks for player->exiting to make sure it shouldn't be shown.
2016-08-12 15:56:07 +01:00
toasterbabe 8b519631f8 * Keep the camera still when ending a NiGHTS map. http://gfycat.com/ComplicatedComposedAoudad
* Correcting an earlier oversight with the SPR2_ defaulting system for super forms.
2016-08-12 15:40:17 +01:00
toasterbabe 9c02c81095 Now that it's not 3am, here's some fixes to what I pushed last night.
* That hacky anti-NiGHTS-deaxisment code I commented out because I thought it was visual only? Reimplemented in a way that is both more and less hacky. It's identical in result to the original code, but takes a roundabout method to get there.
* Sprite references for SUPE, SUPZ and NDRL are removed because they are now unused.
* Helper's flashing conditional is restructured to do less flag swapping.
* The check for super setting FF_FULLBRIGHT is limited to MAXTRANSLATIONS now, and also correctly takes into account MAXSKINCOLORS == SKINCOLOR_SUPERSILVER1.
* NiGHTS collision bounds aren't hardcoded anymore.
* NiGHTS link will never display when leaving stage.
* Slightly tweaked rules for the supercolor setting when doing a NiGHTS transformation, but only meaningful for setting FF_FULLBRIGHT.
2016-08-12 14:42:22 +01:00
toasterbabe 0c3256fa14 NiGHTS is now spr2-ised. i'll upload the relevant files and etc to the ftp
* if you can turn SF_SUPER, flash your skin's supercolor, otherwise be your normal color
* if your skin doesn't have a SPR2_NGT0 (horizontal fly), use Sonic's (this will hopefully be replaced by 2.2 with sprites of NiGHTS themselves)
* MT_NIGHTSCHAR made irrelevant, everything follows actor->target instead of actor->target->tracer now
* emerald is now player->mo->tracer instead of player->mo->tracer->target
* nightopian helpers flash for the 35 tics before they disappear
* nights capsule makes boss explosions/noises now (i can change it back i just like it better)
* drill off into the sky instead of fly up in floating pose (but no noise yet)

ALSO:
* default maxdash is now 70
* forgot to add supercolor to lua, it is there now
* SPR2_SMSL renamed to SPR2_SSTN (stun)
* any player with a skincolor that's in the super range is set to FF_FULLBRIGHT at state-set time, so no need to keep super players non-fullbright just because they use spin stuff
2016-08-12 02:57:37 +01:00
Alam Ed Arias 074dde5f78 Merge branch 'public_next' into master 2016-08-11 12:59:04 -04:00
Alam Ed Arias fb8de61a81 Merge branch 'master' into next 2016-08-11 12:48:52 -04:00
toasterbabe 3310b02b68 Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2Internal.git into s_skinprovements 2016-08-11 17:46:08 +01:00
Monster Iestyn c79428a178 Merge branch 'opengl-planes' into 'master'
OpenGL planes fix

This branch removes a specific hack in the OpenGL code for detecting if a plane is for the floor or ceiling of a sector. This it turns out fixes ceiling slopes in Boinciel's SUGOI map going missing. Though, It doesn't fix that other glitch with one FOF (must be unrelated).

If you want to test these fixes out properly, make sure working in-level sectors, FOFs AND also polyobjects all still work fine, sloped or not.

See merge request !97
2016-08-11 12:15:08 -04:00
Monster Iestyn ae5844be76 Merge branch 'fof-slope-crash-fix' into 'master'
Fof slope crash fix

This fixes yet another software renderer crash, this time relating to sloped FOFs: sometimes the renderer thinks parts of FOFs where the top and bottom heights are the same height are actually the bottom going through the top (in other words a negative height). This causes problems when drawing normal walls around such FOFs since the game obviously doesn't expect negative heights anywhere along the FOF - before slopes, the game could just flip around the top and bottom heights automatically with no problems. This branch also should fix crashes for all genuine cases of negative FOF heights when slopes are involved, I suppose.

Hopefully this stops FuriousFox's SUGOI map crashing for the time being, all seemed fine when I tested it out myself.

See merge request !96
2016-08-11 12:13:52 -04:00
toasterbabe a6f4178023 Rob requested new NiGHTS link colours, his wish is my command. (This is only vaguely appropriate for this branch, but the boat sailed on a specific Reduced_Palette branch a while ago.) 2016-08-10 23:51:35 +01:00
toasterbabe 8b333f5933 Forgot a comment. 2016-08-10 22:47:42 +01:00
toasterbabe 8f5258fc22 Two changes to the supercolor stuff.
* Don't allow arbitrary numbers to be used for a skin's supercolor, only strings.
* Devmode is no fun allowed mode, so turn off the god hyper flash there.
2016-08-10 20:31:18 +01:00
toasterbabe b3b6d5c4f9 woops, renamed superwhite to supersilver during writing and forgot to change this comment 2016-08-10 19:54:07 +01:00
toasterbabe 810e1ec041 SUPERCOLOR BONANZA COMMIT.
* Several new supercolours.
	- SKINCOLOR_SUPERSILVER1-5 (for fun) - "Silver"
	- SKINCOLOR_SUPERPERIDOT1-5 (nyeheheh) - "Peridot"
	- SKINCOLOR_SUPERCYAN1-5 (for fun) - "Cyan"
	- SKINCOLOR_SUPERPURPLE1-5 (for fun) - "Purple"
	- SKINCOLOR_SUPERRUST1-5 (mecha/metal sonic) - "Rust"
	- SKINCOLOR_SUPERTAN1-5 (shadow/silver the hedgehog) - "Tan"
* SKINCOLOR_SUPER1-5 renamed to SKINCOLOR_SUPERGOLD1-5, one index for darkest is changed - "Gold"
* SKINCOLOR_TSUPER1-5 renamed to SKINCOLOR_SUPERORANGE1-5, ported properly to the new palette - "Orange"
* SKINCOLOR_KSUPER1-5 renamed to SKINCOLOR_SUPERRED1-5, ported properly to the new palette - "Red"

* new S_SKIN attribute - supercolor - uses an entirely different function to get the names (R_GetSuperColorByName instead of R_GetColorByName)

* a fun little secret - typing "god on" in the console whilst super makes the player hyper (visual only, no sparkles - just rainbow flash) - can be removed if no fun is allowed
2016-08-10 19:48:20 +01:00
toasterbabe bc7389327a Mario invincibility colours now span solely the saturated colours (no white to black, no peach, no brown) 2016-08-09 13:59:31 +01:00
toasterbabe 742dced437 Updating I_Error to use 4 characters for the spritename only in the same way the other ones do 2016-08-09 13:04:53 +01:00
toasterbabe 4183912c60 Please don't assume indentation carries intent, especially since a break that exclusively follows an I_Error will never run 2016-08-09 13:01:56 +01:00
Alam Ed Arias 6c6cbecb10 I do not think you wanted to break on EVERYTHING 2016-08-08 21:30:20 -04:00
Monster Iestyn 841ee6eca0 Reduced GETFLAG macro args to just one as requested, true/yes are also valid now like with level header flags params (everything else is considered 'off') 2016-08-08 22:34:47 +01:00
Monster Iestyn f46ec64958 each SF_ flag can be set by their own parameters again, does not replace "flags" but is an alternative to it
e.g.: super = 1 for SF_SUPER, noskid = 1 for SF_NOSKID, machine = 1 for SF_MACHINE
2016-08-08 21:17:51 +01:00
toasterbabe c77b3aa58d Sorted an issue MI discovered (I was basing the flip code off the C0 scenario rather than the Cn one) 2016-08-08 17:24:36 +01:00
toasterbabe 6a070adf4b Making the flag value more obvious. 2016-08-08 14:35:18 +01:00
toasterbabe aa89eadac4 Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2Internal.git into new_new_spriteframe_angle 2016-08-08 14:16:20 +01:00
Alam Ed Arias c3690092e1 Merge branch 'public_next' into master 2016-08-07 23:29:01 -04:00
Alam Ed Arias 774a93c819 Merge branch 'master' into next 2016-08-07 23:23:50 -04:00
Wolfy bbb4bb8a05 Merge branch 'invalid-map-name-test' into 'next'
-warp checking for invalid map names

I've noticed a bunch of new people getting the "Cannot warp to map 0 (out of range)" error when testing their custom maps. On asking what map name they used, it was clear they didn't use a MAPxx name at all. Sadly it was not obvious to them that other kind of map names are not accepted by SRB2, so I thought it best we make that more clear in-game.

SRB2 now gives you the error "Cannot warp to map \[your input\] (invalid map name)" if you used -warp with a param that is neither a MAPxx name or a plain number.

See merge request !99
2016-08-07 16:34:23 -04:00
Wolfy 8561a6b413 Merge branch 'sprite-loading-tweaks' into 'master'
Fix R_AddSingleSpriteDef's I_Error messages

Whoops, seems I forgot about this little branch. Basically this fixes how for a character's sprites, a full sprite lump name is displayed instead of just its sprite prefix in the "R_AddSingleSpriteDef: No patches found for [sprite prefix] frame [frame character]" message (unlike when it occurs for non-character sprites), resulting in something like "R_AddSingleSpriteDef: No patches found for PLAYC2C8 frame \^" which does NOT help custom character authors at all as it just confuses them instead. (for the record, the problem would actually with the ^ frame and not the ones displayed after "PLAY")

Oh, and the same problem is also fixed for this similar message: "R_AddSingleSpriteDef: Sprite [sprite prefix] frame [frame character] is missing rotations"

See merge request !95
2016-08-07 16:33:15 -04:00
RedEnchilada 02d3382408 Leave a note to anyone foolish enough to try to fix this 2016-08-07 12:17:31 -05:00
toasterbabe 0a75b8d918 Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2Internal.git into new_new_spriteframe_angle 2016-08-07 11:21:53 +01:00
toasterbabe 76e658bf1b Minor re-ordering to optimise this branch. 2016-08-07 00:21:16 +01:00
toasterbabe 6a865abb93 Bugfix for spike sound playing when attempting to attack non-solid spikes with CA_DASHMODE/CA_TWINSPIN/CA2_MELEE. 2016-08-06 23:54:38 +01:00
toasterbabe c678220857 New S_SKIN attribute - "camerascale", another float. Acts as a scale modifier to t_cam_dist and t_cam_height. 2016-08-06 23:18:37 +01:00
toasterbabe 029fd156a8 Some nice optimisations to the new character select menu - no need to iterate up to 3 times a tic at the expense of ((32*2 + 2)*UINT8 - 3*INT32) memory. 2016-08-06 22:41:25 +01:00
toasterbabe 5e35d629f2 A clearer understanding of freeslots and their relation to FF_FRAMEMASK, explained via comment. 2016-08-06 21:22:38 +01:00
toasterbabe 9d870ea31d Enabling patch.dta, and also upping the number of SPR2_ slots (not just freeslots) to be equivalent to FF_FRAMEMASK. 2016-08-06 13:53:16 +01:00
toasterbabe c9227dfbed Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2Internal.git into s_skinprovements 2016-08-06 12:34:26 +01:00
Monster Iestyn 5b2705ef48 Merge branch 'spr2-freeslots' into 'master'
Spr2 freeslots

Needed for Miles, generally a good idea to have around anyway. Considering Miles uses it without problems, seems to work fine.

See merge request !24
2016-08-04 16:24:37 -04:00
Monster Iestyn f465de8f8c Nev3r's vertical sky distortion 2016-08-01 21:07:01 +01:00
toasterbabe 1ac1f27e4c Preparation for the SPR2_ freeslot branch's merger. *crosses fingers it happens soon* 2016-08-01 17:17:25 +01:00
Monster Iestyn fe5b8c58af Add basic support for animated sky textures 2016-07-31 20:51:39 +01:00
Monster Iestyn 4c4f124611 Detect if -warp's parm is actually a valid map name (MAPxx or plain number), and print an "invalid map name" message if not 2016-07-28 16:07:26 +01:00
Monster Iestyn 2b985bda85 Make sure we detect if start >= numlines so we can deal with that properly
for some apparent reason the compiler didn't like the while loop condition edit on its own (it complained about inline failures for P_MobjReadyToTrigger for some reason), so I had to add that extra bit above the while loop... and it was happy again, huh
2016-07-28 14:57:19 +01:00
Monster Iestyn 2870e19f7f Take out fixedheight-based hacks for checking if floor or ceiling! Use an "isceiling" boolean for that instead
This apparently fixes most of the issues with ceiling slopes in Boinciel's SUGOI map
2016-07-27 19:56:21 +01:00
Monster Iestyn dc765cde2c Fix R_DrawColumnShadowed_8 crash encountered in FuriousFox's map
If you want more specifics, sloped FOFs are to blame it turns out: sometimes the bottom of an FOF wall blocking a segment of an in-level wall column can be considered ABOVE the top part of the FOF there (yikes), and then the dc_y* values go offscreen, and then BOOM
2016-07-24 18:54:01 +01:00
Alam Ed Arias 6b94f286e2 Merge branch 'public_next' into private 2016-07-24 01:08:31 -04:00
Alam Ed Arias 03ddc1f29a define SRTICT_ALIGN to - if the system is x86/x64 system 2016-07-23 23:26:08 -04:00
Alam Ed Arias ddce305c17 under clang, defined does not means true 2016-07-23 23:14:24 -04:00
Alam Ed Arias 82fad646e7 wad and lumps are unsigned, not signed 2016-07-23 23:02:10 -04:00
toasterbabe 436dfbb24f Crashed in THZ1 when testing going down the long section at the end, EIP blames this line, wasn't really necessary in the first place... fair enough. 2016-07-23 21:37:32 +01:00
toasterbabe d0bb7293bd Maximum Drop Dash speed of 75*FRACUNIT. 2016-07-23 21:01:40 +01:00
toasterbabe ad03bb5278 Force Shield's air ability is now the Drop Dash (thanks, Sonic Mania, for making me like the momentum redirection idea by recontextualising it to collision with the ground only!)
* Press spin in midair to make the shield flash solid repeatedly and make a number of ding noises.
* When the player with a flashing, dinging shield hits the ground, they are sent off in spinning form at the maximum of 2*abs(momz) VS the 3D hypotenuse of momx, momy, and momz.
2016-07-23 18:25:51 +01:00
Alam Ed Arias 7b88db478c Merge branch 'public_next' into private 2016-07-21 19:22:30 -04:00
Alam Ed Arias 5c234a817a Merge branch 'master' into next 2016-07-21 18:49:33 -04:00
Alam Ed Arias f6b8b51ac2 Merge branch 'software-fixes' into 'master'
Software crashes fix... fix

Fixes a typo introduced by merge request !75 that caused upper textures to set the wrong ceiling clipping value when not visible, allowing all sorts behind the walls to be visible. This is most noticable in GFZ2 when the inside of the tunnel section is visible

...probably a good idea to make sure this one doesn't introduce any MORE visual glitches by mistake (again, compare with 2.1.15 if possible)

See merge request !93
2016-07-21 17:45:45 -04:00
Alam Ed Arias df0a90957f Merge branch 'tilted-transparent-flats-fix' into 'master'
Fix for flats with transparent pixels on slopes

This fixes how R_DrawTiltedSplat_8 unintentionally allows the cyan pixels to NOT be considered "transparent" if after being remapped, depending on sector brightness and/or linedef type 606 colormaps, the result of remapping is not palette index 247 (the cyan we typically turn transparent). That is, the original colors from the source flat graphic are not checked, but instead the __result__ of coloring the flat under the respective colormap is checked for "transparent" pixels. This is only a problem for the tilted splat drawing function, not the regular one for non-sloped planes with cyan-pixel-using flats.

I found out about this bug from the issues Ritz was having with sloped 255-alpha translucent FOFs using transparent flats and his custom COLORMAP lump (and later when he applied a linedef type 606 colormap to the FOF) for his custom map. Thankfully he has some workarounds, but this should fix the code-side issues that caused his problems in the first place.

I also fixed stuff with another splat drawing function that's not currently used atm (maybe it will be in the future, if splats themselves are ever enabled again? *shrugs*).

See merge request !92
2016-07-21 17:14:43 -04:00
Alam Ed Arias b02c824da8 Merge branch 'skybox-render-fix' into 'master'
Skybox rendering offset fix for third person/alt view camera

Fixes the issue reported in this thread: https://mb.srb2.org/showthread.php?t=41729

I dunno if this will negatively affect any existing skyboxes in SRB2's own levels, that said. I tried out THZ2 and CEZ1 with this fix at least but I forgot to compare them with how they are in 2.1.15 so _*shrugs_*

See merge request !94
2016-07-21 16:58:06 -04:00
Alam Ed Arias 9301344003 Merge branch 'macosx-hacking' into 'master'
OS X Makefile build setup

This merge request:

* Cleans up the OS X bundle resource location code and fixes a SIGSEGV and memory leak
* Simplifies and fixes the OS X desktop alert code, closing more leaks
* Adds the MACOSX build flag to the Makefiles, to allow building a binary (but not Mac app yet) of SRB2.

This is intended to make it easier for developers to build on Mac OS X, without having to pull in all of XCode. You can keep using CMake if you prefer.

To test, use `make -C src MACOSX=1 NONX86=1 SDL=1 NOASM=1` for a release build.

Left to do:

* Add a content bundling script to be run after building, and a flag to trigger doing that.
  `MACOSX_BUNDLE` maybe?
* Somehow get access to a Mac running PowerPC and figure out how to build a multi-platform binary.
* Add the proper magic to compile using gcc if requested. (Right now, compilation is done via LLVM/Clang)

See merge request !72
2016-07-21 15:38:46 -04:00
Alam Ed Arias a9c521031d Merge branch 'gasjets_and_slopes' into 'next'
Gas jets, fan objects, springs and slopes

Whoop whoop whoop minor bugs that only get noticed due to weird experiments whoop whoop whoop

* For gas jets only: the object's standingslope is ALWAYS null. No drifting down the slope for you.
* For gas jets and fan objects: Now checks whether the player's top is below the bottom of the launcher, instead of its bottom. zdist calculation not affected, since it's signed and okay with being negative by about the height of the player.
* For all 3: the player's standingslope is NULL'd so the player isn't launched off at a wacky angle if they're standing on a slope then walk into the thing.

See merge request !91
2016-07-21 15:11:49 -04:00
Alam Ed Arias 1a0fcbd8dc Revert "Merge branch 'RemoveINetC' into 'master'"
This reverts commit 8607f5247c, reversing
changes made to 11d76a6562.
2016-07-21 14:42:00 -04:00
Alam Ed Arias 8607f5247c Merge branch 'RemoveINetC' into 'master'
Remove i_net.c

The code in i_net.c doesn't actually seem to be used in SRB2. I was able to compile a build without it, and hosting and joining netgames worked just fine (well, as fine as they can with the current state of the netcode...).

The vast majority of code in the file seems to be contained in HAVE_SDLNET ifdefs, and I'm pretty sure SRB2 has never used SDLNET in a public build. The only bit not contained in that block is I_InitNetwork(), which just prints an error and returns false.

Do we really need to keep it around? If not, I say get rid of it. It seems like useless clutter that is just going to confuse people who are trying to understand the source code.

See merge request !73
2016-07-21 14:15:58 -04:00
Alam Ed Arias c5fe08dcd2 Merge branch 'aatree-refactor' into 'next'
Re-factoring AA tree code from m_misc.c/m_misc.h into its own files

What the title says. The AA tree-related code now lives in the files m_aatree.c and m_aatree.h. Part of why I did this was to solve this m_misc.h/w_wad.h cyclic dependency problem (involving MAX_WADPATH and AA trees themselves) mentioned in the now-removed comments, another reason was ...only OpenGL uses AA trees at all, why include the relevent structs/functions/otherwise anywhere except where is necessary (which is very few files as it turns out)?

Otherwise, it just looked better on its own rather than mixed with all the other stuff already in the m_misc files. Not really important or anything affecting gameplay at all I guess.

See merge request !82
2016-07-21 14:13:38 -04:00
toasterbabe d0cd1d951f Add prefoppositecolor to Lua. 2016-07-20 15:53:08 +01:00
toasterbabe 4435815c35 "prefoppositecolor" - exists solely for metal so he can have his sonic 4 peridot-background end sign when using skincolor_blue. not updating player.dta yet though. 2016-07-20 15:48:24 +01:00
Monster Iestyn 6ba568ac49 Fixed typo of mine that lead to the ceiling part of GFZ2's tunnel section being rendered wrongly 2016-07-20 15:11:36 +01:00
toasterbabe f1311c515d Making FF_MIDDLESTARTCHANCE more useful for FF_ANIMATE animations. 2016-07-19 13:45:31 +01:00
toasterbabe 46e50a523f Let's be consistent with how other parts of the code handle this same issue of conditional operations surrounding non-conditional operations. 2016-07-19 01:19:03 +01:00
toasterbabe cfcd25f2cd Fixing a bug which could be caused by tapping up/down on the character select at high speeds by ensuring that o is never negative instead of assuming the one circumstance it may have been negative under. 2016-07-19 01:03:40 +01:00
toasterbabe 333d8c882e Recreating NAMEcLcR sprite angle loading in internal, as Inu requested. 2016-07-19 00:04:00 +01:00
Monster Iestyn 77a40e9016 Slightly unrelated, but if R_DrawTranslucentSplat_8 is ever going to be used this is probably more efficient (also fixing early colormap application for the last part) 2016-07-17 23:01:07 +01:00
Monster Iestyn 9ad205f5ba R_DrawTiltedSplat_8 fix: apply colormapping AFTER checking the source pixel is cyan first 2016-07-17 22:33:37 +01:00
toasterbabe ac2ff5e386 CA_MELEE. Mostly complete.
* When moving slowly, P_InstaThrust at S_SKIN's maxdash forward, and set momz to S_SKIN's mindash upwards. Plays a tok noise (not thok). Hurts enemies/bosses, busts spikes/monitors/all types of bustable blocks.
* When moving quickly... doesn't do anything yet, but WILL do a slide.

Also, P_DoSpinDash is now renamed to P_DoSpinAbility, and CA_TWINSPIN users can bust all bustable blocks on collision too.
2016-07-17 21:31:15 +01:00
toasterbabe 4168fc02cb Decided the forcing of S_PLAY_FALL when PF_THOKKED was present wasn't that great. 2016-07-17 18:57:03 +01:00
toasterbabe 4bd56b82be Better multiability support.
* CA_TWINSPIN - you can do it multiple times
* CA_DOUBLEJUMP - your jump height is reduced each time, like in Kirby games. The number of extra jumps once you've left the ground that are available is determined by the character's actionspd.
2016-07-17 17:41:44 +01:00
Monster Iestyn 4d0f0230de Fix chasecam/awayviewmobj viewz offset to be consistent with non-skybox frame rendering 2016-07-17 17:36:37 +01:00
toasterbabe df8568642e Dashmode users can break spinbust blocks when dashing, twinspin users can break both spinbust and Knuckles-only blocks when twinspinning. 2016-07-17 16:34:07 +01:00
toasterbabe cc9f874c5d Further improvements to the character select menu. 2016-07-17 16:21:46 +01:00
toasterbabe 9557cad235 Noticed some bad logic and typos, so correcting. 2016-07-17 15:56:31 +01:00
toasterbabe 9c48cbb68c Doing stuff for Rob, turns out the anim was designed to go twice as fast. Tally ho! 2016-07-17 01:22:50 +01:00
toasterbabe 898e17a441 SF_MACHINE characters create boss explosions on death.
Also, the gravity of drowning characters has been reduced to look more natural.
2016-07-16 23:26:52 +01:00
toasterbabe 8cb8990863 Merge branch 's_skinprovements' of http://git.magicalgirl.moe/STJr/SRB2Internal.git into s_skinprovements 2016-07-16 22:44:01 +01:00
toasterbabe f757fb3545 SF_MACHINE. Currently only changes drowning, but could do more.
* Electric sparks coming off entire body instead of bubbles coming out mouth
* Different sounds.
* Different icons.

These sprites are currently local only, but I'll be doing a lot of asset updating this evening since Rob asked me to so it won't be long until you can get them.
2016-07-16 22:43:49 +01:00
Alam Ed Arias 4e064dc335 whitespace: cleanup 2016-07-16 16:05:00 -04:00
Alam Ed Arias e393b12cec Merge branch 'master' into s_skinprovements 2016-07-16 16:04:10 -04:00
Alam Ed Arias 4e322af6cb whitespace: cleanup 2016-07-16 16:03:32 -04:00
toasterbabe 0f79e9ea3b On Rob's request, the twinspin can break spikes. (woo) 2016-07-16 18:54:22 +01:00
toasterbabe 21ba204c9e Revert of the FF_MIDDLESTARTCHANCE changes for player states, although the flag still exists internally since there's no reason to remove it. 2016-07-16 18:34:42 +01:00
toasterbabe 765254f183 Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2Internal.git into s_skinprovements 2016-07-16 17:24:19 +01:00
toasterbabe d8065fa525 Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2Internal.git into s_skinprovements
# Conflicts:
#	src/d_player.h
#	src/dehacked.c
#	src/info.c
#	src/p_user.c
2016-07-16 17:23:25 +01:00
Monster Iestyn 99ee3d5149 Merge branch 'side-springs' into 'master'
Sideways springs, horizontal hog-launchers, perpendicular plungers...

Call them what you like, they're in the code now. And have been for months!

Nev3r uses the hell out of these and I'm fed up of them being <!>'s all over the place, so please have 'em in master so we can update srb2.srb and make things better for all of us.

See merge request !30
2016-07-16 12:20:22 -04:00
toasterbabe 94490623b5 Cleanup of P_CheckUnderwaterAndSpaceTimer's conditional checks for future PF_ROBOT changes, where characters like Metal make electric zaps instead of bubbles. 2016-07-16 17:11:34 +01:00
Monster Iestyn 9b15247191 Merge branch 'dashmode' into 'master'
Dashmode

This branch Metal Sonic's abilities (CA_DASHMODE) to the game.

See merge request !26
2016-07-16 12:09:20 -04:00
toasterbabe 226785dcd6 Putting the swim animation checks in one place. 2016-07-16 14:45:22 +01:00
toasterbabe cc35a5e1c1 Ported CA_HAMMER from new-character-actions in a way that takes advantage of all of the non-hardcodey things I've added in this branch.
Also, it's called CA_TWINSPIN because that's more inoccouous.
2016-07-16 13:55:12 +01:00
toasterbabe df8be73787 ...fixed this error 2016-07-15 22:13:47 +01:00
toasterbabe 1e648e4709 Woops, forgot SOC parser. 2016-07-15 17:32:29 +01:00
toasterbabe 03fe312490 On MI's reccomendation, a skin flag to disable the effects of FF_MIDDLESTARTCHANCE for specific characters whose animations might not be symmetrical. 2016-07-15 17:30:52 +01:00
toasterbabe 01dc98f8f0 New frame flags for more complicated animations.
* FF_MIDDLESTARTCHANCE - has a 50% chance of starting the spr2 or FF_ANIMATE animation halfway in
* FF_SPR2ENDSTATE - if var1 == S_NULL, don't loop, just stop incrementing the frames. Otherwise, go to the state represented by var1.

The former is just something I did for fun, the latter is something that'll come in handy when porting in new-character-moves.
2016-07-15 16:48:30 +01:00
toasterbabe 9b68da63de Minor cockup with availability handling not being updated when I changed how it worked. 2016-07-14 17:10:17 +01:00
toasterbabe b8fe20a086 Changing irrelevant comment. 2016-07-14 16:27:48 +01:00
toasterbabe 4c6ed6da76 The availability unlockable number for a skin is now available, read only, to Lua. 2016-07-14 15:51:03 +01:00
toasterbabe 417e9187d9 Realised the potential for out-of-bounds memory accessing, so put some limits in place to prevent that from happening.
(skin->availability is a UINT8, so it'll never be negative)
2016-07-14 14:45:15 +01:00
toasterbabe caed5718c1 Characters can now be unlocked just like any existing unlockable.
Setup:
* S_SKIN needs an "availability" line. Set to 0 to have always available, otherwise is assumed to be UINT8 unlockable number. If it's a valid unlockable, its name will be copied over with the character's realname.
* Define an unlockable via SOC or hardcode. If you don't want it visible on the Secrets menu, just set its type to None. Everything else is as normal - you can set the conditionset to whatever, objective, height, nochecklist, nocecho...
2016-07-14 14:39:22 +01:00
toasterbabe c5f6ae8aaa Fixed forceskin to not always allow due to bad logic. 2016-07-14 13:24:57 +01:00
toasterbabe 674ec3e515 Correction of the new default revitem setup. 2016-07-14 12:31:20 +01:00
toasterbabe 6e0c9f7e18 The "forcecharacter" level header now allows for hidden characters.
Also, new default for revitem to match player.dta, and an updated Force Skin netgame option name to reflect the fact it's string based now.
2016-07-13 22:28:23 +01:00
toasterbabe 76910a8e11 Sorry, one last change. I know I should be more certain when committing. 2016-07-13 20:24:39 +01:00
toasterbabe f1b1e1aa9b I'm stupid. 2016-07-13 20:19:52 +01:00
toasterbabe 2ee22fc40a Dedicated servers have all skins unlocked for the purpose of forceskin.
Meanwhile, a sneaky sneaky for hiding hidden characters further.
2016-07-13 20:14:07 +01:00
toasterbabe a108fcce5b Simplification of the hide check after discussion with Rob. 2016-07-13 19:10:31 +01:00
toasterbabe 824458a5ff Swimming animation! Since I know we want it for Smiles eventually.
Also, I guess CA_SWIM isn't forced into running on water anymore.
2016-07-13 18:18:18 +01:00
toasterbabe c2aba46298 New S_SKIN attributes.
* radius - sets the player's radius for that skin.
* height - sets the player's normal height for that skin.
* spinheight - sets the player's spinheight for that skin.
* shieldscale - see http://i.imgur.com/BQ5DhKC.png for justification
2016-07-13 15:15:45 +01:00
toasterbabe 8087cde5db Correcting a few cockups. 2016-07-13 13:26:21 +01:00
toasterbabe b2bfe3737a Rudimentary SOC shuffling if you add a character with the same name as a previous character to prevent character select from breaking. 2016-07-13 12:17:53 +01:00
toasterbabe fcfe8c0132 More clearly defined handling for replacing character select images. Specifically takes into account whether the hidden character was added in this file or a seperate one.
Also, removed some commented out code regarding character selects, and removed a useless case for R_SkinAvailable().
2016-07-12 20:10:01 +01:00
toasterbabe 80a3d79d4d Some hacks added to forceskin to:
* support hidden characters
* take the skin->name, not the number
* display the skin->name in the menu

Also, minor tweaks to other things.
2016-07-12 14:40:20 +01:00
toasterbabe b5108afe16 Substantial re-engineering for the foundations of hidden characters.
R_SkinUnlock defines the circumstances under which a skin is available. For simplicty's sake, I've currently bound it to an S_SKIN variable so I can toggle it easily, but it WILL be replaced with a hook into the savegame system at some point.
* Currently has three tiers of unlock - freebie (forceskin or modeattacking via a loaded replay), Ringslinger Only, and SP/Coop and Ringslinger.
* I don't know anything about netcode so I basically decided to make R_SkinUnlock relevant only under local circumstances, try as hard as possible to stop bad skin info from getting sent to the server, and then admit defeat once the server has the information. If this is a bad choice, please discipline me and show me how to fix it.
* Character Select now checks for whether the character is hidden or not on menu load and does/undoes it based on that info, but will never touch one disabled via SOC. I also used this opportunity to optimise, checking for/filling out charsel pictures instead of doing it later. (It now also includes special casing for a select screen with zero characters!)
* Mode Attack now hides hidden characters in its character select based on SP rules.

Things that still need to be done:
* ForceSkin_OnChange. Is there a graceful way to handle this?
* No obvious skin name conflicts. Add a salt to the names of hidden skins, and then remove it when they're unhidden?
* The gap between Knuckles' skin number and the first custom character anybody adds will be way too obvious. A seperate hidden skin numbering system? Start at 32 and count up from there? There's a few ways...
2016-07-12 03:15:58 +01:00
toasterbabe ee92e043b9 Preparation for hidden characters, making sure R_SkinAvailable was being used where appropriate.
Also, bugfix for something my optimisation introduced.
2016-07-11 23:40:31 +01:00
toasterbabe eee6a6ff45 Optimisations to the character select screen.
* If a character select character image is not set, don't iterate every tic - iterate on first image get and then save to the struct.
* A character select screen with only two characters now has special case handling.
* A memory leak in the making has been plugged. (specifically, picname not being Z_Free'd if the loop fails to do so)
* Logic/operation simplification.

Also, some typo corrections and clarity case movements of stuff in other files I've been looking at.
2016-07-11 23:01:43 +01:00
Alam Ed Arias 8f0994b38b Merge branch 'public_next' into master 2016-07-11 16:22:05 -04:00
Alam Ed Arias 765d68899f Merge branch 'master' into next 2016-07-11 16:10:40 -04:00
Alam Ed Arias b347ed2ca6 Merge branch 'public_next' into master 2016-07-11 15:52:27 -04:00
Alam Ed Arias 59fd7bbe46 Merge branch 'public_next' (early part) into private 2016-07-11 15:50:06 -04:00
Alam Ed Arias 0c8fcb5e4d Merge branch 'master' into repeat-monitors 2016-07-11 15:29:06 -04:00
Alam Ed Arias 8693be0811 Merge branch 'master' into spr2-freeslots 2016-07-11 15:26:39 -04:00
toasterbabe 7c63a96bf1 Logic error. Now works as described previously. 2016-07-10 20:03:08 +01:00
toasterbabe 8431f64300 A thorough reimplementation of Nojumpspin for the SPR2_ age.
* SF_NOJUMPSPIN - Player's height is full whilst jumping, SPR2_JUMP defaults to SPR2_SPNG instead of SPR2_SPIN, and the player goes into fall frames if they start moving downwards or use their ability.
* PA_JUMP - for jumping (upwards in the case of SF_NOJUMPSPIN.
* SF_NOJUMPDAMAGE - Ala rosy.wad, don't damage enemies, etc when jumping into them.
* SF_STOMPDAMAGE - Just for fun. Ala in Mario, always damage enemies when you land on top of them (your gravity reference, not theirs).
* SF_MARIODAMAGE - SF_NOJUMPDAMAGE|SF_STOMPDAMAGE is reasonably accurate to the Mario games, and might as well be surfaced as such.

Also, a minor change:

* Instead of not spawning the revitem if your SPR2_ is SPR2_DASH, don't spawn it if it's set to 0. This requires the player.dta I uploaded a couple days ago to behave as it was previously.
* Don't get stuck in spindash frames if your maxdash is 0, and don't flash rolling frames if you're on goop.
2016-07-10 18:41:38 +01:00
toasterbabe d8d8333719 S_SKIN now supports both DS* and sfx_* prefixes for sounds. 2016-07-10 13:22:49 +01:00
toasterbabe 7fe80a7f31 Minor optimisations and clearer code. 2016-07-10 12:35:24 +01:00
toasterbabe 8ab32ca93a Significant improvements to the Character select screen in preperation of implementing unlockable characters.
* Characters disabled through SOC are outright removed. No awkward gap in scrolling - no hint they were ever there in the first place.
* Vertical loop - the character select images are visually continuous. No matter where you are in the chain, you'll always see a hint of the character above or below your current selection in the chain.
* Smooth scrolling - Moto and Prime showed me a gfy from back during 2.1 development where it was super smooth. I didn't make it as slow as that one, but the smoothness was easy to add and the reason it was removed previously - gaps in the character select leading to varying speeds - is no longer relevant.
2016-07-10 02:05:59 +01:00
toasterbabe 625cb39af7 Dashmode now destroys spikes and monitors on contact. Enemies? Probably not for now. 2016-07-09 16:53:41 +01:00
toasterbabe cee37819cd Dashmode now has its own animation, SPR2_PEEL. Requires a new PLAYER.DTA. I made a lot of references to the peelout here because I'm not sure what else to call a Sonic character's faster-than-usual-running animation and SPR2_DASH was taken.
* SPR2_PEEL, SPR2_SPEE.
* S_PLAY_PEEL, S_PLAY_SUPER_PEEL.
* PA_PEEL.
* Dashmode actually starts charging from runspeed instead of the arbitrarily calculated (normalspeed - 5*FRACUNIT). This just made things easier, honestly, and it's 1 FU of difference compared to the current test case.
2016-07-09 14:52:49 +01:00
toasterbabe 0fefd86d1e More generic name for P_ElementalFireTrail upon MI's request 2016-07-08 22:56:17 +01:00
toasterbabe 940a58b5ca Shouldn't be true by default, WOOPS 2016-07-08 22:52:49 +01:00
toasterbabe ec85357643 Didn't properly use the #defined numangles constant. 2016-07-08 22:05:13 +01:00
toasterbabe f8dd9b64ab Elemental shield ability now coded. REQUIRES NEW PATCH.DTA FROM THE FTP.
- Press spin in midair to stomp directly downwards (losing horizontal momentum), creating a flickering fireball around you.
- No bouncing on enemies, item boxes, etc - just go straight through.
- Hurts other players on touch whilst you're stomping.
- Spawns a bunch of flames around you when you hit the ground.

Also:

- Electric shield's ability now uses different sounds, because I'm picky.
2016-07-08 21:55:17 +01:00
toasterbabe 95ac0fa9a0 Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2Internal.git into shield-actions 2016-07-08 13:20:24 +01:00
toasterbabe c5ca1a8f24 The dashmode struct variable now has a cap, per a Wolfs request. 2016-07-07 01:40:28 +01:00
toasterbabe 64ef2798a2 Merge branch 'master' of http://git.magicalgirl.moe/STJr/SRB2Internal.git into dashmode
# Conflicts:
#	src/d_clisrv.c
#	src/d_clisrv.h
2016-07-07 01:08:51 +01:00
toasterbabe 8426ce8d9c Minor change to fans and gas jets that makes them work on slopes.
- Now checks whether the player's top is below the bottom of the fan/gas jet, instead of its bottom. zdist calculation not affected.
- mo->standingslope is NULL'd so the player isn't launched off at a wacky angle. (I also did this for springs, since Prime mentioned it was a problem for them too.)
2016-06-30 23:23:50 +01:00
Inuyasha 331ea9814f version numbers, etc 2016-06-29 20:01:22 -07:00
Inuyasha 26b3f2e0dc Merge branch 'toast_slopes' into 'next'
Some slope improvements/fixes (plus P_GetMobjGravity)

Dear Red, I did some things.

* Made the slope flag SL_NOPHYSICS actually have an effect like we wanted to, but didn't get around to implementing yet - activated by setting the slope's linedef flags to have ML_NOSONIC.
* Made downhill slope thrusts proportional to an object's gravity and friction.
* To make the above happen - seperated out the gravity value finding code in P_CheckGravity into a seperate function, P_GetMobjGravity. (p_mobj.c, p_local.h) I also made this function available to Lua.
* Turned those PANIC n console messages (which would inevitably be followed up with a crash, since we're accessing invalid memory immediately after) into a descriptive I_Error.
* Put the SRB2CB type-shimming behind an ESLOPE_TYPESHIM ifdef.
* Removed SPRINGCLEAN-ifdef'd code.
* Cleaned up some eosteric comments.
* NEW SINCE RED +1'd THIS: The teetering code now takes slopes into account pretty well. There are edge circumstances as outlined in commit 9d221f4f3f, but this is unilaterally better behaviour in every way and the teetering code was kind of a mess anyways.
* NEW SINCE RED AND ALAM +1'd THIS: P_ReverseQuantiseMomentumToSlope. Simple function that replaces the inverse angle stuff (which also wasn't using InvAngle, just ANGLE_MAX - angle - which is inaccurate!!)

Current testing files available at /toaster/slptst3.wad and /toaster/gravitytest.lua on the ftp.

I want to do more to the branch like implement SL_ANCHORVERTEX in the near future, but this is probably safe to merge in its current state.

See merge request !77
2016-06-22 19:03:58 -04:00
toasterbabe f93b31f0a7 FUCK C90 2016-06-20 02:08:07 +01:00
toasterbabe 20ffbbdc41 Climbing now supports one-sided linedefs.
The whole thing needs a refactor in general, but it's almost 2am here, I need my sleeb, and this fix would probably break something with 2.1 climbing if I made it any more/less (depending on viewpoint) complicated.
2016-06-20 01:50:47 +01:00
Alam Ed Arias 7126d57fd7 whitespace cleanup 2016-06-19 20:25:09 -04:00
toasterbabe 71f5d4ea85 ...completely misunderstood the reasons we weren't merging toast_slopes, mom holy fuck i'm stupid and bad
Enjoy your slopes without physics, people :D
2016-06-20 00:20:20 +01:00
Alam Ed Arias 24038d4d54 Merge branch 'next' into aatree-refactor 2016-06-19 15:48:22 -04:00
Alam Ed Arias e87e747a29 clean up warning done in setup-fixes 2016-06-19 12:48:35 -04:00
toasterbabe 86721f1457 Compilation fix of the patch to disable this feature ( :c ). 2016-06-19 17:29:04 +01:00
toasterbabe fa58993bda Merge branch 'next' of http://git.magicalgirl.moe/STJr/SRB2.git into toast_slopes
# Conflicts:
#	src/p_user.c
2016-06-19 16:59:49 +01:00
toasterbabe 1147428904 Revert "Changed teetering to match the discoveries made about it in the sectorlist_traversal branch in a way that matches my revamps here, since I DID change a lot."
This reverts commit 19b186e52e.
2016-06-19 16:38:11 +01:00
toasterbabe f5f2c4ad48 Revert "Okay, NOW I fixed the compile error. Forgot to stage this."
This reverts commit 1723bb55f9.
2016-06-19 16:38:04 +01:00
Alam Ed Arias 8e98c78456 Merge branch 'next' (early part) into toast_slopes 2016-06-19 03:39:42 -04:00
toasterbabe 3fe87eff97 Disabling the functionality of SL_NOPHYSICS for 2.1 patches by never applying it 2016-06-18 23:55:43 +01:00
toasterbabe 9c277bfb22 Merge branch 'next' of http://git.magicalgirl.moe/STJr/SRB2.git into toast_slopes 2016-06-18 22:58:24 +01:00
Inuyasha 8fc61bb674 Merge branch 'sectorlist_traversal' into 'next'
Sectorlist traversal

MOM GET THE CAMERA

There's a LOT of code in the source that ended up mixing m_snext (the node for the next thing in the sector's thinglist) and m_tnext (the node for the next sector in the thing's sectorlist), so I renamed the following:

* m_snext ==> m_thinglist_next
* m_sprev ==> m_thinglist_prev
* m_tnext ==> m_sectorlist_next
* m_tprev ==> m_sectorlist_prev

Then, I changed all the instances where the code was trying to go m_thinglist_next on a mobj's touching_sectorlist (which would've just gone to the node for the next thing in the same sector, instead of the node for the next sector for the same thing). Notable samples:

* FF_SHATTER blocks now disappear the moment you go into their sector. You still can't give FF_SOLID to them because in that case they will still stop you if you never enter their sector at all (ie - clip on corners), but having them nonsolid no longer allows you to phase through entirely without busting them (which was the whole downside of making them intangible in the first place).
* You can now bump into multiple Mario blocks at a time, even if you're not exclusively in their sector.
* No more getting randomly stopped on the edges of bouncy FOFs.
* Landing on polyobjects might behave a little more consistently at the edge of their host sector.
* Teetering did a SHITTON of code that basically never got executed, and then had directly-blockmap-accessing code as a backup. The code was activatable by replacing the m_thinglist_next with m_sectorlist_next, but it behaved SUPER differently from what we're used to with teetering (if the player mobj's edge was JUST off the edge of a platform, you ended up in teetering frames - even if it looked like you could stand) so I ended up removing that section entirely.

Any objections?

See merge request !85
2016-06-18 16:52:21 -04:00
Monster Iestyn 9e31ab1393 Merge branch 'master' into next 2016-06-17 14:44:23 +01:00
Alam Ed Arias 56331d86c4 Merge remote-tracking branch 'origin/master' into build-modes 2016-06-17 08:55:20 -04:00
Inuyasha ee180807d1 Merge branch 'setup-fixes' into 'next'
Fixes and changes related to the act of setting up a level (in other words, setup fixes)

Changes made in this branch so far:
* a REJECT lump of zero length (NOT to be confused with a REJECT lump of non-zero length with all-zeros, just to clarify) should no longer cause problems with netgames and otherwise. The game now checks if the lump exists, has the right name, and length is not zero - if it fails any of these, the REJECT lump is not loaded and P_CheckSight won't be allowed to use it. This means ZDBSP (no reject) should be safe(r) to use now!
* there's now a simple devmode-only message (requires "Setup" mode) if a sector is found to have no lines at all during setup. It's a far cry from the plot to I_Error the game I once had for that unsusal scenario, but such a level still works anyway so whatever.

See merge request !87
2016-06-17 08:05:09 -04:00
Inuyasha 191a4bc7d2 Merge branch 'reverseplatform_clipping' into 'next'
FF_REVERSEPLATFORM clipping

Ran into an issue whilst testing out one last feature (there's always one more...) for flat_alignment_revamp. This is a backported fix.

The bug was such that if you're falling through a platform with FF_REVERSEPLATFORM and not FF_PLATFORM, you'll be pushed downwards such that your head is against the bottom of the FOF. This just checks momz is greater than zero if it has FF_REVERSEPLATFORM to make sure it's okay to set ceilingz. (OR the alternative in reverse gravity.)

No test map because this was originally done for internal. Instead, test it on the other branch's test map.

See merge request !83
2016-06-17 08:01:03 -04:00
Monster Iestyn 5fd87351a8 Place precision of 4 on sprname string in the I_Error messages, so that you just get "PLAY" instead of "PLAYC2C8" or "PLAYA0" etc
This is so custom character creators won't get confused by having two different frames shown in the same message anymore, bleh
2016-06-13 22:52:20 +01:00
Monster Iestyn a135def1bb Merge branch 'next' into aatree-refactor 2016-06-13 21:14:52 +01:00
Monster Iestyn df55019d40 Merge branch 'master' into other-software-fixes 2016-06-13 21:13:51 +01:00
Monster Iestyn 9ae2a4036a Merge branch 'master' into next 2016-06-13 21:10:53 +01:00
Alam Ed Arias a046d3807e strings return by M_GetText() can not be changed 2016-06-13 11:11:02 -04:00
Alam Ed Arias 2c8008e11e NULL checks 2016-06-13 10:07:10 -04:00
Monster Iestyn 9b037164bc Added debug messages for when REJECT lump is not loaded 2016-06-12 21:51:27 +01:00
Monster Iestyn f94dd510ad change back to 8, add \0s 2016-06-12 21:16:41 +01:00
Alam Ed Arias 4d6a3e3398 FUNCMATH fun 2016-06-12 16:08:48 -04:00
Alam Ed Arias 1e507d3d1e added printf checks to hardware's I_Error 2016-06-12 16:08:48 -04:00
Alam Ed Arias 1e3631425f r_opengl: move DrawMD2i code to DrawMD2Ex 2016-06-12 16:08:48 -04:00
Alam Ed Arias 6271adcbe7 make sure !BLUA EXE works without warnings 2016-06-12 16:08:48 -04:00
Monster Iestyn b4798538e2 Merge branch 'software-fixes' into 'master'
Software crashes fix

This branch SHOULD fix the many crashes people have reported lately that all point to the software renderer. Simply put, the software renderer allowed stuff to be drawn out of the screen even though that wasn't safe, and even the existing checks to prevent that didn't work.

If you saw me worrying about the sky HOMs I discovered in AGZ earlier in the commits for this branch, don't worry - it turns out that issue already existed in 2.1.15's srb2win.exe (and probably srb2dd.exe too) anyway, the changes in this branch didn't cause them. Hopefully nothing else broke then.

See merge request !75
2016-06-12 14:33:27 -04:00
toasterbabe 2c676eea43 P_ReverseQuantiseMomentumToSlope is now a function. (I was thinking about a macro, but couldn't get it down.)
Also, the teetering angle on slopes is now FRACUNIT/2 because there's literally no way to stand still on a slope that steep unless it doesn't have physics.
2016-06-12 19:27:34 +01:00
Monster Iestyn 305d32870f Effect 2 (No Midtexture Skew) now toggles off skewing for midtextures on single-sided lines, which was what was intended for them to begin with apparently.
This means the current skewing-by-default effect isn't changed, and OpenGL's equivalent code doesn't have to be touched since apparently it was already like that.
2016-06-12 18:47:27 +01:00
Alam Ed Arias 472dce1ae6 Do not why we are not checking REJECT\0\0, let fix this check 2016-06-11 21:42:02 -04:00
Monster Iestyn 1d0e74f9c0 "REJECT" is only 5 chars long, not 8. 2016-06-11 21:19:16 +01:00
Monster Iestyn a7a7a7ee6d Added P_LoadReject function to properly check if REJECT lump is valid or not when loading it, so P_CheckSight can avoid accessing it if not.
This should mean that maps built with ZBSDP (no reject) should have less or no problems in netgames compared to the standard ZenNode maps now, hopefully. =)
2016-06-11 18:45:56 +01:00
Monster Iestyn df92dc8d9e Print debugging message if sector->linecount is zero 2016-06-11 16:14:08 +01:00
toasterbabe 9e87f6d85d i did so much in this branch, so UPGRADE ME TO PROGRAMMER
note: once this is merged into internal, you should probably remove me from "programming assistance" so i'm not duplicated for no clear reason. unless you want me to slowly take over every section in the credits >:3c
2016-06-10 22:45:42 +01:00
Monster Iestyn a04fcce3a9 Hack to fix midtextures for polyobjects being mucked up
"frontsector" in this part of the code isn't actually the polyobject's sector for back-side polyobject segs, it's the in-level sector the polyobject as a whole is being rendered in it turns out.
2016-06-09 22:07:43 +01:00
Monster Iestyn 20c2d84c78 Fix single side line midtexture skewing
Red apparently left in code for single-sided linedefs to NOT skew their midtextures ...but it doesn't work because it doesn't stop the skewing code from running instead, regardless of whether Effect 1 is on or not. If it's decided single-sided line midtextures shouldn't do this though, the non-skew code could just as well be thrown out lol (or something else I guess?)
2016-06-09 20:37:36 +01:00
toasterbabe 661da15146 Reinforcing encapsulation I originally broke down to allow for P_GetMobjGravity.
When I first wrote this, I thought the .h file that contained a function declaration needed to have the same name as the .c file the function was in. Now I know that's not the case, off to p_local.h with you.
2016-06-09 18:16:13 +01:00
toasterbabe 1723bb55f9 Okay, NOW I fixed the compile error. Forgot to stage this. 2016-06-09 15:24:23 +01:00
toasterbabe c5ff41d6a6 Fixed compile error and placed the #undefs for xsign and ysign in more logical places. 2016-06-09 15:20:45 +01:00
toasterbabe 19b186e52e Changed teetering to match the discoveries made about it in the sectorlist_traversal branch in a way that matches my revamps here, since I DID change a lot. 2016-06-09 15:16:25 +01:00
toasterbabe 7af14c20ed Everywhere in the code that was doing things wrong has been changed.
Two interesting points of note:
* The touchspecial sector flag seems to actually do its job now.
* Detection of sectors with polyobjects in seems to have done this incorrectly, but this doesn't mess with anything about touching the polies themselves so it seems to really only handle edge cases where the polyobject was too close to the border of another sector (which would've likely made rendering glitches anyways).
* There was a whole swathe of teetering code that was basically never run properly because of this mistake. I did a simple fix at first, but you started teetering whenever you were slightly less than your radius away from a sector's edge, which was completely different and undesirable behaviour. Instead, I cut out the code that was never running, and just left the hacky method in instead since it was more accurate to what we want in general.
2016-06-09 14:56:24 +01:00
toasterbabe 17e0adcbac Renamed some struct variables so the problem this branch sets out to fix is more obvious at a glance.
* m_snext ==> m_thinglist_next
* m_sprev ==> m_thinglist_prev
* m_tnext ==> m_sectorlist_next
* m_tprev ==> m_sectorlist_prev
2016-06-09 14:16:02 +01:00
toasterbabe 0b920ee249 You know that problem where you bumped on the edges of Mario blocks and Bustable blocks and Bouncy FOFs sometimes? Wham. Bam. In the van.
Issue was caused by attempting to traverse the sector's thing-touching-list across all the things in the sector (which would inevitably have the same sector as the first node in mobj->touching_sectorlist) instead of traversing the thing's sector-touching-list (which has the same thing but different sector references).

I wonder how many times AJ copypasted this code with absolutely no idea why it wasn't working properly. I'll figure that out tomorrow, maybe set up some compiler macros so this mistake is never made again. For now, I must sleeb.
2016-06-09 00:02:50 +01:00
Alam Ed Arias 214cd404bd Merge branch 'public_next' into master 2016-06-08 15:29:25 -04:00
Alam Ed Arias 742353d0ab Merge branch 'master' into next 2016-06-08 15:06:17 -04:00
Monster Iestyn 29ea733ae5 Fix sprites in skyboxes not having clipping arrays actually set properly 2016-06-08 17:53:34 +01:00
toasterbabe 51c769247a Compiling fixes. 2016-06-07 19:44:43 +01:00
toasterbabe aa113045d7 MI pointed out opportunity for more optimisation, and who could resist? 2016-06-07 18:18:47 +01:00
toasterbabe 9df72a966e Some simplifications after MI pointed out that the sector heights are the only thing accessed outside of the iteration. 2016-06-07 17:55:03 +01:00
toasterbabe 9d221f4f3f Teetering now supports slopes properly.
Behaves ALMOST as you'd expect. It gets the z position of the slope at the player coordinates when it comes to the sectorlist check (which is first), though, so there's a few oddities that are amplified with steep slopes:
* If the slope's sloping away from you at a steep angle, you might not be able to step down onto it, but you won't teeter (because it's at a step-down-able height if it extended to directly beneath you)
* If the slope's sloping towards you at a steep angle, you might end up in teetering frames when you're able to step down onto it (because it's NOT at a step-down-able height if it extended to directly beneath you)

HOWEVER, it would be pretty obnoxious to hold back code which is functionally superior in every way otherwise, and it doesn't really seem like there's a good way to get that checked tbph
2016-06-07 17:37:25 +01:00
toasterbabe 26744c2a6b woops #1 2016-06-06 21:02:47 +01:00
toasterbabe 7c0eee6ff1 The fix now takes reverse gravity platform step-up into account properly. 2016-06-06 20:53:29 +01:00
toasterbabe 60dd8dab3c Backported clipping fix for FF_REVERSEPLATFORM collision. 2016-06-06 18:11:23 +01:00
Monster Iestyn 69f556d40a Split AA trees code from m_misc.c/.h into m_aatree.c/.h
Also updated any relevant project files that I can think of to include the new files, as well as the makefile of course. Some of the other project files haven't been touched in years so I'll leave those alone ...unless someone objects
2016-06-05 21:29:40 +01:00
Alam Ed Arias b9a39f3043 Merge branch 'public_next' into master 2016-06-04 22:36:55 -04:00
Monster Iestyn 2e9607938d Merge branch 'master' into next 2016-06-04 20:23:46 +01:00
toasterbabe 3591e92dfa Merge branch 'toast_slopes' of http://git.magicalgirl.moe/STJr/SRB2 into toast_slopes 2016-06-04 19:48:04 +01:00
toasterbabe ba528a075e Last few changes as reccomended by Red. (<3 u, no hetero) 2016-06-04 19:47:40 +01:00
Monster Iestyn 4c422f6605 OpenGL: closed door/window detection code now accounts for slopes, just like in software 2016-06-04 18:31:21 +01:00
Alam Ed Arias c23b40fa9c Merge branch 'public_next' into master 2016-06-02 18:39:08 -04:00
Alam Ed Arias 31a59f8ae6 Merge branch 'next' into toast_slopes 2016-06-02 17:45:16 -04:00
Monster Iestyn 83c4dba4ce Fix crash reported by FuriousFox at http://mb.srb2.org/showthread.php?t=41536
Basically this makes sure numwadfiles is updated before loading the SOC/Lua scripts, so if a Lua script calls COM_BufInsertText with the contents "addfile scr_mysticrealm.wad" it can't overwrite the last written wadfile slot! Not that COM_BufInsertText really should be used like that to begin with
2016-06-02 20:16:25 +01:00
toasterbabe c1caf21323 Reccomended by MI: Dividing by the original friction value just so slopes with normal friction don't behave differently between next and this branch. 2016-06-02 16:51:12 +01:00
toasterbabe 882622d2e7 ...I made two major mistakes with P_GetMobjGravity.
*Didn't take into account object scale
*Doubled force when on the ground (ignore what the comment of the line I moved says, it was relevant for slopes...)

This also led to a mistake with slopes, where I was double-multiplying by the gravity constant to get half (because of a quirk of numbers...)
2016-06-02 16:42:07 +01:00
toasterbabe 213a9632ca Let's multiply the thrust by the mobj's friction. You should have less chance of purchase on a slippery slope (tee hee) and more on a rough one, but the slopes were basically identical during testing before I implemented this change. 2016-06-02 16:09:33 +01:00
toasterbabe 80fceafcb9 Merge branch 'toast_slopes' of http://git.magicalgirl.moe/STJr/SRB2 into toast_slopes 2016-06-02 14:40:36 +01:00
toasterbabe 1493537dfc Moved the standingslope check in P_ZMovement to after the FOF and height adjustment as it is in P_PlayerZMovement, as reccomended.
Doesn't actually stop Crawla jittering, but might as well make it happen for consistency's sake.
2016-06-02 14:39:41 +01:00
wolfy852 919e3ed0e2 Make token available to Lua as a global variable
Reviewed by @RedEnchilada
2016-06-01 21:06:24 -05:00
Alam Ed Arias 507b336bd6 Merge branch 'next' into toast_slopes 2016-06-01 15:36:46 -04:00
Alam Ed Arias 208fb75a17 Merge branch 'master' into software-fixes 2016-06-01 15:35:55 -04:00
toasterbabe 44a6e8bb54 I_Error description syntax consistency (buzzword buzzword buzzword). 2016-06-01 19:52:12 +01:00
Monster Iestyn 43b6b2a53f Merge branch 'master' into next 2016-06-01 19:31:57 +01:00
Monster Iestyn c863e311fe OpenGL: Fix upper texture Effect 1 only skewing 2016-06-01 19:22:54 +01:00
Monster Iestyn bf85cc25bd OpenGL: Fix lower unpegged texture offset, fix lower unpegged + effect 1 so the texture actually skews 2016-06-01 18:51:38 +01:00
Alam Ed Arias 629dd8e08f Merge branch 'next' into toast_slopes 2016-06-01 11:47:22 -04:00
Alam Ed Arias 0444e8a14c Merge branch 'master' into next 2016-06-01 11:45:57 -04:00
toasterbabe ae8b45965c No Size_t --> int
in an I_Error print!
[/rhyme]
2016-06-01 16:45:10 +01:00