Commit graph

1608 commits

Author SHA1 Message Date
toasterbabe
552a67200c A revert of the sorting because it produced better (but not perfect) results for paper and normal mobj interaction.
Also, I added more sortscale handling in the places where I forgot it.

I probably need some help with the maths here to get this to work nicely. http://gfycat.com/LimpAgedDowitcher
2016-08-19 15:06:10 +01:00
toasterbabe
fbff05bd17 Fixed the between-objects sorting problem previously mentioned in the merge request. Now they're sorted by whichever sprite has an end closest to the camera, instead of the middle point previously used.
http://i.imgur.com/UyOKX5u.png <-- this common glitch with crawlas given MF_PAPER (THEY'RE NOT GOOD AT TURNING NEAR EDGES) used to show the behind-crawlas in front of the front-crawlas.

Unfortunately, I've just discovered this issue (which happens with the old version of the sorting code too): http://i.imgur.com/QNjbATB.png but to be fair these crawlas have gotten stuck inside the edges of this platform, so I'm not sure I can do anything about this without cutting off Sonic's feet when he stands on the ground? shrug
2016-08-19 12:26:26 +01:00
toasterbabe
66a845a33a silly me 2016-08-18 22:24:36 +01:00
toasterbabe
ff362534b4 An experimental attempt at collision correction, put behind a #define because it's buggy as SHIT. 2016-08-18 22:20:42 +01:00
toasterbabe
430a2e07cc Added linedef collision and fixed the following clipping bug, shown in gfy form. http://gfycat.com/BiodegradableNaturalHadrosaurus 2016-08-18 20:55:24 +01:00
toasterbabe
7786ef43e8 Okay, did a bunch of stuff. Getting ready to create a merge request, but not quite there yet.
* MF_AMBUSH is now MF2_AMBUSH, because it's something you turn on in a map editor, not with a SOC definition.
* Where MF_AMBUSH was is now MF_PAPER.
* MF_PAPER accesses all the stuff I did previously in this branch...
* ...as well as turn on paper-thin collision detection between mobjs, which I've gotten working but isn't perfect but it's still good enough for non-solid objects!!
2016-08-18 20:09:35 +01:00
toasterbabe
430d7cfbd2 Noticed some sorting issues, so introduced the sortscale struct variable. (SORRY, NO FLAG YET) 2016-08-18 15:45:44 +01:00
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
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
Alam Ed Arias
074dde5f78 Merge branch 'public_next' into master 2016-08-11 12:59:04 -04:00
Alam Ed Arias
60f0bd8eec Merge branch 'next' into public_next 2016-08-11 12:58:08 -04:00
Alam Ed Arias
fb8de61a81 Merge branch 'master' into next 2016-08-11 12:48:52 -04:00
Monster Iestyn
1ea0f9ceb8 Merge branch 'new_new_spriteframe_angle' into 'master'
NAMEcLcR sprite angle loading, take 2

HEY LOOK, A NEW SPRITE LUMP LOADING FEATURE (which isn't that new since this merge request description is literally copypasted from the one for public next)

 * NAMEcL refers to a frame which is seen for the entirety of an object's left side. (ie - in 2d mode, facing to the left relative to the camera)
 * NAMEcR refers to a name which is seen for the entirety of an object's right side. (ie - in 2d mode, facing to the right relative to the camera)
 * NAMEcLcR does both sides, duh. I didn't break reflection.
 * Having just a NAMEcL requires you to fill in the opposite side either with NAMEcn where n is 1 and 5-8 OR a NAMEcR OR a NAMEc0
 * Having just a NAMEcR requires you to fill in the opposite side either with NAMEcn where n is 1-5 OR a NAMEcL OR a NAMEc0
 * Switches down the centerline of the object instead of at the ANGLE_202h interval for normal sprites. Has a very small window where you can see a NAMEc1 and NAMEc5 if you only use one of NAMEcL or NAMEcR down one side.
 * The specific symbols selected for this were selected for 1) ease of mental understanding (Left, Right) and 2) not getting in the way of adding support for zdoom's totally bananas 16-way sprite system at a later date if we so choose, which only goes up to G

totally makes sense for stuff like NiGHTS stuff, Axis2D stuff, and maybe if SRB1 survives the chopping block in some shape or form it can take advantage of that too

See merge request !33
2016-08-11 12:41:11 -04: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
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
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
ce129c28c2 Merge branch 'next' into public_next 2016-08-07 23:27:40 -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
3fcaf0b351 Merge branch 'findspeciallinefromtag-fix' into 'next'
P_FindSpecialLineFromTag crash fix

This fixes the case where an in-level sector or FOF control sector with a tag of -1 or 65535 (seriously, who does that?) can possibly lead to a crash in this function when searching for heat linedef specials in 1st person. And also the same kind of crash any other sort of weird case where the tag number that function uses for searching is -1 or 65535, I suppose!

See merge request !98
2016-08-07 16:33:53 -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
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
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
ff6440d343 Merge branch 'next' into public_next 2016-07-24 01:08:00 -04:00
Alam Ed Arias
4321757df4 Merge branch 'master' into next 2016-07-24 01:07:25 -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