mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-26 22:31:10 +00:00
Delete ROTSPRITE
This commit is contained in:
parent
c02fcc6ce2
commit
37be2d0f5f
10 changed files with 6 additions and 57 deletions
|
@ -719,7 +719,6 @@ extern int
|
|||
#define SECTORSPECIALSAFTERTHINK
|
||||
|
||||
/// Sprite rotation
|
||||
#define ROTSPRITE
|
||||
#define ROTANGLES 72 // Needs to be a divisor of 360 (45, 60, 90, 120...)
|
||||
#define ROTANGDIFF (360 / ROTANGLES)
|
||||
|
||||
|
|
|
@ -4254,9 +4254,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
float gz, gzt;
|
||||
spritedef_t *sprdef;
|
||||
spriteframe_t *sprframe;
|
||||
#ifdef ROTSPRITE
|
||||
spriteinfo_t *sprinfo;
|
||||
#endif
|
||||
md2_t *md2;
|
||||
size_t lumpoff;
|
||||
unsigned rot;
|
||||
|
@ -4276,11 +4274,9 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
|
||||
fixed_t spr_width, spr_height;
|
||||
fixed_t spr_offset, spr_topoffset;
|
||||
#ifdef ROTSPRITE
|
||||
patch_t *rotsprite = NULL;
|
||||
INT32 rollangle = 0;
|
||||
angle_t spriterotangle = 0;
|
||||
#endif
|
||||
|
||||
// uncapped/interpolation
|
||||
interpmobjstate_t interp = {0};
|
||||
|
@ -4365,16 +4361,12 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
if (thing->skin && thing->sprite == SPR_PLAY)
|
||||
{
|
||||
sprdef = P_GetSkinSpritedef(thing->skin, thing->sprite2);
|
||||
#ifdef ROTSPRITE
|
||||
sprinfo = P_GetSkinSpriteInfo(thing->skin, thing->sprite2);
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
sprdef = &sprites[thing->sprite];
|
||||
#ifdef ROTSPRITE
|
||||
sprinfo = &spriteinfo[thing->sprite];
|
||||
#endif
|
||||
}
|
||||
|
||||
if (rot >= sprdef->numframes)
|
||||
|
@ -4384,9 +4376,7 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
thing->sprite = states[S_UNKNOWN].sprite;
|
||||
thing->frame = states[S_UNKNOWN].frame;
|
||||
sprdef = &sprites[thing->sprite];
|
||||
#ifdef ROTSPRITE
|
||||
sprinfo = &spriteinfo[thing->sprite];
|
||||
#endif
|
||||
rot = thing->frame&FF_FRAMEMASK;
|
||||
thing->state->sprite = thing->sprite;
|
||||
thing->state->frame = thing->frame;
|
||||
|
@ -4451,7 +4441,6 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
spr_offset = spritecachedinfo[lumpoff].offset;
|
||||
spr_topoffset = spritecachedinfo[lumpoff].topoffset;
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
spriterotangle = R_SpriteRotationAngle(&interp);
|
||||
|
||||
if (spriterotangle != 0
|
||||
|
@ -4481,7 +4470,6 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
flip = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (thing->renderflags & RF_ABSOLUTEOFFSETS)
|
||||
{
|
||||
|
@ -4689,14 +4677,12 @@ static void HWR_ProjectSprite(mobj_t *thing)
|
|||
|
||||
vis->rotated = false;
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
if (rotsprite)
|
||||
{
|
||||
vis->gpatch = (patch_t *)rotsprite;
|
||||
vis->rotated = true;
|
||||
}
|
||||
else
|
||||
#endif
|
||||
vis->gpatch = (patch_t *)W_CachePatchNum(sprframe->lumppat[rot], PU_SPRITE);
|
||||
|
||||
vis->mobj = thing;
|
||||
|
|
|
@ -522,7 +522,6 @@ static int libd_getSpritePatch(lua_State *L)
|
|||
if (angle >= ((sprframe->rotate & SRF_3DGE) ? 16 : 8)) // out of range?
|
||||
return 0;
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
if (lua_isnumber(L, 4))
|
||||
{
|
||||
// rotsprite?????
|
||||
|
@ -537,7 +536,6 @@ static int libd_getSpritePatch(lua_State *L)
|
|||
return 3;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// push both the patch and it's "flip" value
|
||||
LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_SPRITE), META_PATCH);
|
||||
|
@ -633,7 +631,6 @@ static int libd_getSprite2Patch(lua_State *L)
|
|||
if (angle >= ((sprframe->rotate & SRF_3DGE) ? 16 : 8)) // out of range?
|
||||
return 0;
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
if (lua_isnumber(L, 4))
|
||||
{
|
||||
// rotsprite?????
|
||||
|
@ -648,7 +645,6 @@ static int libd_getSprite2Patch(lua_State *L)
|
|||
return 3;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// push both the patch and it's "flip" value
|
||||
LUA_PushUserdata(L, W_CachePatchNum(sprframe->lumppat[angle], PU_SPRITE), META_PATCH);
|
||||
|
|
|
@ -7377,7 +7377,7 @@ static void P_NiGHTSMovement(player_t *player)
|
|||
else
|
||||
player->mo->momz = 0;
|
||||
|
||||
#if 0//def ROTSPRITE
|
||||
#if 0
|
||||
if (!(player->charflags & SF_NONIGHTSROTATION) && player->mo->momz)
|
||||
{
|
||||
if (player->mo->state != &states[S_PLAY_NIGHTS_DRILL])
|
||||
|
|
|
@ -851,13 +851,11 @@ typedef struct drawseg_s
|
|||
vertex_t leftpos, rightpos; // Used for rendering FOF walls with slopes
|
||||
} drawseg_t;
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
typedef struct
|
||||
{
|
||||
INT32 angles;
|
||||
void **patches;
|
||||
} rotsprite_t;
|
||||
#endif
|
||||
|
||||
// Patches.
|
||||
// A patch holds one or more columns.
|
||||
|
@ -876,9 +874,7 @@ typedef struct
|
|||
void *hardware; // OpenGL patch, allocated whenever necessary
|
||||
void *flats[4]; // The patch as flats
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
rotsprite_t *rotated; // Rotated patches
|
||||
#endif
|
||||
} patch_t;
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
@ -971,9 +967,7 @@ typedef struct
|
|||
// Flip bits (1 = flip) to use for view angles 0-7/15.
|
||||
UINT16 flip;
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
rotsprite_t *rotated[16]; // Rotated patches
|
||||
#endif
|
||||
} spriteframe_t;
|
||||
|
||||
#define MAXFRAMENUM 256
|
||||
|
|
|
@ -137,7 +137,6 @@ static void Patch_FreeData(patch_t *patch)
|
|||
Z_Free(patch->flats[i]);
|
||||
}
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
if (patch->rotated)
|
||||
{
|
||||
rotsprite_t *rotsprite = patch->rotated;
|
||||
|
@ -151,7 +150,6 @@ static void Patch_FreeData(patch_t *patch)
|
|||
Z_Free(rotsprite->patches);
|
||||
Z_Free(rotsprite);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (patch->pixels)
|
||||
Z_Free(patch->pixels);
|
||||
|
|
|
@ -34,7 +34,6 @@ void *Patch_AllocateHardwarePatch(patch_t *patch);
|
|||
void *Patch_CreateGL(patch_t *patch);
|
||||
#endif
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
void Patch_Rotate(patch_t *patch, INT32 angle, INT32 xpivot, INT32 ypivot, boolean flip);
|
||||
patch_t *Patch_GetRotated(patch_t *patch, INT32 angle, boolean flip);
|
||||
patch_t *Patch_GetRotatedSprite(
|
||||
|
@ -45,6 +44,5 @@ patch_t *Patch_GetRotatedSprite(
|
|||
angle_t R_ModelRotationAngle(interpmobjstate_t *interp);
|
||||
angle_t R_SpriteRotationAngle(interpmobjstate_t *interp);
|
||||
INT32 R_GetRollAngle(angle_t rollangle);
|
||||
#endif
|
||||
|
||||
#endif // __R_PATCH__
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
#include "w_wad.h"
|
||||
#include "r_main.h" // R_PointToAngle
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
fixed_t rollcosang[ROTANGLES];
|
||||
fixed_t rollsinang[ROTANGLES];
|
||||
|
||||
|
@ -285,4 +284,3 @@ void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle
|
|||
rotated->leftoffset = ox;
|
||||
rotated->topoffset = oy;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -12,10 +12,8 @@
|
|||
#include "r_patch.h"
|
||||
#include "r_picformats.h"
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
rotsprite_t *RotatedPatch_Create(INT32 numangles);
|
||||
void RotatedPatch_DoRotation(rotsprite_t *rotsprite, patch_t *patch, INT32 angle, INT32 xpivot, INT32 ypivot, boolean flip);
|
||||
|
||||
extern fixed_t rollcosang[ROTANGLES];
|
||||
extern fixed_t rollsinang[ROTANGLES];
|
||||
#endif
|
||||
|
|
|
@ -148,12 +148,10 @@ static void R_InstallSpriteLump(UINT16 wad, // graphics patch
|
|||
if (maxframe ==(size_t)-1 || frame > maxframe)
|
||||
maxframe = frame;
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
for (r = 0; r < 16; r++)
|
||||
{
|
||||
sprtemp[frame].rotated[r] = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (rotation == 0)
|
||||
{
|
||||
|
@ -731,22 +729,18 @@ static vissprite_t *visspritechunks[MAXVISSPRITES >> VISSPRITECHUNKBITS] = {NULL
|
|||
void R_InitSprites(void)
|
||||
{
|
||||
size_t i;
|
||||
#ifdef ROTSPRITE
|
||||
INT32 angle;
|
||||
float fa;
|
||||
#endif
|
||||
|
||||
for (i = 0; i < MAXVIDWIDTH; i++)
|
||||
negonearray[i] = -1;
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
for (angle = 1; angle < ROTANGLES; angle++)
|
||||
{
|
||||
fa = ANG2RAD(FixedAngle((ROTANGDIFF * angle)<<FRACBITS));
|
||||
rollcosang[angle] = FLOAT_TO_FIXED(cos(-fa));
|
||||
rollsinang[angle] = FLOAT_TO_FIXED(sin(-fa));
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// count the number of sprite names, and allocate sprites table
|
||||
|
@ -1700,9 +1694,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
|
||||
spritedef_t *sprdef;
|
||||
spriteframe_t *sprframe;
|
||||
#ifdef ROTSPRITE
|
||||
spriteinfo_t *sprinfo;
|
||||
#endif
|
||||
size_t lump;
|
||||
|
||||
size_t frame, rot;
|
||||
|
@ -1747,11 +1739,9 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
fixed_t spr_width, spr_height;
|
||||
fixed_t spr_offset, spr_topoffset;
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
patch_t *rotsprite = NULL;
|
||||
INT32 rollangle = 0;
|
||||
angle_t spriterotangle = 0;
|
||||
#endif
|
||||
|
||||
// uncapped/interpolation
|
||||
interpmobjstate_t interp = {0};
|
||||
|
@ -1807,9 +1797,7 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
if (thing->skin && thing->sprite == SPR_PLAY)
|
||||
{
|
||||
sprdef = P_GetSkinSpritedef(thing->skin, thing->sprite2);
|
||||
#ifdef ROTSPRITE
|
||||
sprinfo = P_GetSkinSpriteInfo(thing->skin, thing->sprite2);
|
||||
#endif
|
||||
|
||||
if (frame >= sprdef->numframes)
|
||||
{
|
||||
|
@ -1817,18 +1805,14 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
thing->sprite = states[S_UNKNOWN].sprite;
|
||||
thing->frame = states[S_UNKNOWN].frame;
|
||||
sprdef = &sprites[thing->sprite];
|
||||
#ifdef ROTSPRITE
|
||||
sprinfo = &spriteinfo[thing->sprite];
|
||||
#endif
|
||||
frame = thing->frame&FF_FRAMEMASK;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
sprdef = &sprites[thing->sprite];
|
||||
#ifdef ROTSPRITE
|
||||
sprinfo = &spriteinfo[thing->sprite];
|
||||
#endif
|
||||
|
||||
if (frame >= sprdef->numframes)
|
||||
{
|
||||
|
@ -1905,7 +1889,6 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
// than lumpid for sprites-in-pwad : the graphics are patched
|
||||
patch = W_CachePatchNum(sprframe->lumppat[rot], PU_SPRITE);
|
||||
|
||||
#ifdef ROTSPRITE
|
||||
spriterotangle = R_SpriteRotationAngle(&interp);
|
||||
|
||||
if (spriterotangle != 0
|
||||
|
@ -1938,7 +1921,6 @@ static void R_ProjectSprite(mobj_t *thing)
|
|||
flip = 0;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
flip = !flip != !hflip;
|
||||
|
||||
|
|
Loading…
Reference in a new issue