Forgot to stage this, woops. Adds special casing to prevent the I_Error and makes the behaviour of the cL/cR more consistent in general such that it matches my description.

This commit is contained in:
toasterbabe 2016-06-16 01:20:35 +01:00
parent 52bf13367f
commit b1ab36561d

View file

@ -135,15 +135,15 @@ static void R_InstallSpriteLump(UINT16 wad, // graphics patch
CONS_Debug(DBG_SETUP, "R_InitSprites: Sprite %s frame %c has both L/R and 1-8 rotations\n", spritename, cn);
// Let's not complain about multiple L/R rotations. It's not worth the effort.
if (sprtemp[frame].rotate == 0xff)
sprtemp[frame].rotate = 0;
sprtemp[frame].rotate |= ((rotation == ROT_R) ? 4 : 2);
for (r = 0; r < 4; r++)
{
if ((r != 0) || (sprtemp[frame].lumppat[rotation] == LUMPERROR)) // Only set front/back angles if they don't exist
for (r = 1; r < 4; r++) // Don't set for front/back frames
{
sprtemp[frame].lumppat[r + rightfactor] = lumppat;
sprtemp[frame].lumpid[r + rightfactor] = lumpid;
}
}
sprtemp[frame].flip |= (flipped ? (0x0F << rightfactor) : 0); // 00001111 or 11110000 in binary, depending on rotation being ROT_L or ROT_R
return;
}
@ -317,6 +317,14 @@ static boolean R_AddSingleSpriteDef(const char *sprname, spritedef_t *spritedef,
// only the first rotation is needed
break;
case 6: // (rotate & (2|4)) == (2|4) - both Left and Right rotations
case 7:
// we test to see whether the left and right slots are present
if ((sprtemp[frame].lumppat[2] == LUMPERROR) || (sprtemp[frame].lumppat[6] == LUMPERROR))
I_Error("R_AddSingleSpriteDef: Sprite %s frame %c is missing rotations",
sprname, R_Frame2Char(frame));
break;
default:
// must have all 8 frames
for (rotation = 0; rotation < 8; rotation++)