mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-27 20:41:46 +00:00
rename rollaxis to rotaxis
This commit is contained in:
parent
ae630a9a23
commit
3e759a2b75
7 changed files with 31 additions and 31 deletions
|
|
@ -9365,10 +9365,10 @@ struct {
|
||||||
{"NUMDIRS",NUMDIRS},
|
{"NUMDIRS",NUMDIRS},
|
||||||
|
|
||||||
#ifdef ROTSPRITE
|
#ifdef ROTSPRITE
|
||||||
// Sprite roll axis (rollaxis_t)
|
// Sprite rotation axis (rotaxis_t)
|
||||||
{"ROLLAXIS_X",ROLLAXIS_X},
|
{"ROTAXIS_X",ROTAXIS_X},
|
||||||
{"ROLLAXIS_Y",ROLLAXIS_Y},
|
{"ROTAXIS_Y",ROTAXIS_Y},
|
||||||
{"ROLLAXIS_Z",ROLLAXIS_Z},
|
{"ROTAXIS_Z",ROTAXIS_Z},
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Buttons (ticcmd_t)
|
// Buttons (ticcmd_t)
|
||||||
|
|
|
||||||
|
|
@ -117,9 +117,9 @@ typedef struct
|
||||||
boolean flip; // screenflip
|
boolean flip; // screenflip
|
||||||
#ifdef ROTSPRITE
|
#ifdef ROTSPRITE
|
||||||
boolean roll;
|
boolean roll;
|
||||||
UINT8 rollaxis;
|
|
||||||
SINT8 rollflip;
|
SINT8 rollflip;
|
||||||
FLOAT rollangle; // done to not override USE_FTRANSFORM_ANGLEZ
|
FLOAT rollangle; // done to not override USE_FTRANSFORM_ANGLEZ
|
||||||
|
UINT8 rotaxis;
|
||||||
FLOAT centerx, centery;
|
FLOAT centerx, centery;
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_FTRANSFORM_MIRROR
|
#ifdef USE_FTRANSFORM_MIRROR
|
||||||
|
|
|
||||||
|
|
@ -1187,8 +1187,8 @@ void HWR_DrawModel(gr_vissprite_t *spr)
|
||||||
|
|
||||||
#ifdef ROTSPRITE
|
#ifdef ROTSPRITE
|
||||||
p.rollangle = 0.0f;
|
p.rollangle = 0.0f;
|
||||||
p.rollaxis = 0;
|
|
||||||
p.rollflip = 0;
|
p.rollflip = 0;
|
||||||
|
p.rotaxis = 0;
|
||||||
if (spr->mobj->rollangle)
|
if (spr->mobj->rollangle)
|
||||||
{
|
{
|
||||||
fixed_t anglef = AngleFixed(spr->mobj->rollangle);
|
fixed_t anglef = AngleFixed(spr->mobj->rollangle);
|
||||||
|
|
@ -1199,9 +1199,9 @@ void HWR_DrawModel(gr_vissprite_t *spr)
|
||||||
p.centerx = FIXED_TO_FLOAT(spr->mobj->radius/2);
|
p.centerx = FIXED_TO_FLOAT(spr->mobj->radius/2);
|
||||||
p.centery = FIXED_TO_FLOAT(spr->mobj->height/2);
|
p.centery = FIXED_TO_FLOAT(spr->mobj->height/2);
|
||||||
|
|
||||||
// roll axis
|
// rotation axis
|
||||||
if (sprinfo->available)
|
if (sprinfo->available)
|
||||||
p.rollaxis = (UINT8)(sprinfo->pivot[(spr->mobj->frame & FF_FRAMEMASK)].rollaxis);
|
p.rotaxis = (UINT8)(sprinfo->pivot[(spr->mobj->frame & FF_FRAMEMASK)].rotaxis);
|
||||||
|
|
||||||
// for NiGHTS specifically but should work everywhere else
|
// for NiGHTS specifically but should work everywhere else
|
||||||
ang = R_PointToAngle (spr->mobj->x, spr->mobj->y) - (spr->mobj->player ? spr->mobj->player->drawangle : spr->mobj->angle);
|
ang = R_PointToAngle (spr->mobj->x, spr->mobj->y) - (spr->mobj->player ? spr->mobj->player->drawangle : spr->mobj->angle);
|
||||||
|
|
|
||||||
|
|
@ -2071,9 +2071,9 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32
|
||||||
{
|
{
|
||||||
float roll = (1.0f * pos->rollflip);
|
float roll = (1.0f * pos->rollflip);
|
||||||
pglTranslatef(pos->centerx, pos->centery, 0);
|
pglTranslatef(pos->centerx, pos->centery, 0);
|
||||||
if (pos->rollaxis == 2) // Z
|
if (pos->rotaxis == 2) // Z
|
||||||
pglRotatef(pos->rollangle, 0.0f, 0.0f, roll);
|
pglRotatef(pos->rollangle, 0.0f, 0.0f, roll);
|
||||||
else if (pos->rollaxis == 1) // Y
|
else if (pos->rotaxis == 1) // Y
|
||||||
pglRotatef(pos->rollangle, 0.0f, roll, 0.0f);
|
pglRotatef(pos->rollangle, 0.0f, roll, 0.0f);
|
||||||
else // X
|
else // X
|
||||||
pglRotatef(pos->rollangle, roll, 0.0f, 0.0f);
|
pglRotatef(pos->rollangle, roll, 0.0f, 0.0f);
|
||||||
|
|
|
||||||
|
|
@ -305,8 +305,8 @@ static int PopPivotSubTable(spriteframepivot_t *pivot, lua_State *L, int stk, in
|
||||||
pivot[idx].x = (INT32)value;
|
pivot[idx].x = (INT32)value;
|
||||||
else if (ikey == 2 || (key && fastcmp(key, "y")))
|
else if (ikey == 2 || (key && fastcmp(key, "y")))
|
||||||
pivot[idx].y = (INT32)value;
|
pivot[idx].y = (INT32)value;
|
||||||
else if (ikey == 3 || (key && fastcmp(key, "rollaxis")))
|
else if (ikey == 3 || (key && fastcmp(key, "rotaxis")))
|
||||||
pivot[idx].rollaxis = (UINT8)value;
|
pivot[idx].rotaxis = (UINT8)value;
|
||||||
else if (ikey == -1 && (key != NULL))
|
else if (ikey == -1 && (key != NULL))
|
||||||
FIELDERROR("pivot key", va("x, y or roll axis expected, got %s", key));
|
FIELDERROR("pivot key", va("x, y or roll axis expected, got %s", key));
|
||||||
ok = 1;
|
ok = 1;
|
||||||
|
|
@ -330,7 +330,7 @@ static int PopPivotTable(spriteinfo_t *info, lua_State *L, int stk)
|
||||||
// stk = 0 has the pivot table
|
// stk = 0 has the pivot table
|
||||||
// stk = 1 has the frame key
|
// stk = 1 has the frame key
|
||||||
// stk = 2 has the frame table
|
// stk = 2 has the frame table
|
||||||
// stk = 3 has either "x" or "y" or "rollaxis" or a number as key
|
// stk = 3 has either "x" or "y" or "rotaxis" or a number as key
|
||||||
// stk = 4 has the value for the key mentioned above
|
// stk = 4 has the value for the key mentioned above
|
||||||
while (lua_next(L, stk))
|
while (lua_next(L, stk))
|
||||||
{
|
{
|
||||||
|
|
@ -570,8 +570,8 @@ static int framepivot_get(lua_State *L)
|
||||||
lua_pushinteger(L, framepivot->x);
|
lua_pushinteger(L, framepivot->x);
|
||||||
else if (fastcmp("y", field))
|
else if (fastcmp("y", field))
|
||||||
lua_pushinteger(L, framepivot->y);
|
lua_pushinteger(L, framepivot->y);
|
||||||
else if (fastcmp("rollaxis", field))
|
else if (fastcmp("rotaxis", field))
|
||||||
lua_pushinteger(L, (UINT8)framepivot->rollaxis);
|
lua_pushinteger(L, (UINT8)framepivot->rotaxis);
|
||||||
else
|
else
|
||||||
return luaL_error(L, va("Field %s does not exist in spriteframepivot_t", field));
|
return luaL_error(L, va("Field %s does not exist in spriteframepivot_t", field));
|
||||||
|
|
||||||
|
|
@ -594,8 +594,8 @@ static int framepivot_set(lua_State *L)
|
||||||
framepivot->x = luaL_checkinteger(L, 3);
|
framepivot->x = luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp("y", field))
|
else if (fastcmp("y", field))
|
||||||
framepivot->y = luaL_checkinteger(L, 3);
|
framepivot->y = luaL_checkinteger(L, 3);
|
||||||
else if (fastcmp("rollaxis", field))
|
else if (fastcmp("rotaxis", field))
|
||||||
framepivot->rollaxis = (UINT8)luaL_checkinteger(L, 3);
|
framepivot->rotaxis = (rotaxis_t)(luaL_checkinteger(L, 3));
|
||||||
else
|
else
|
||||||
return luaL_error(L, va("Field %s does not exist in spriteframepivot_t", field));
|
return luaL_error(L, va("Field %s does not exist in spriteframepivot_t", field));
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -791,7 +791,7 @@ static void R_ParseSpriteInfoFrame(spriteinfo_t *info)
|
||||||
#ifdef ROTSPRITE
|
#ifdef ROTSPRITE
|
||||||
INT16 frameXPivot = 0;
|
INT16 frameXPivot = 0;
|
||||||
INT16 frameYPivot = 0;
|
INT16 frameYPivot = 0;
|
||||||
rollaxis_t frameRollAxis = 0;
|
rotaxis_t frameRotAxis = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Sprite identifier
|
// Sprite identifier
|
||||||
|
|
@ -840,16 +840,16 @@ static void R_ParseSpriteInfoFrame(spriteinfo_t *info)
|
||||||
sprinfoToken = M_GetToken(NULL);
|
sprinfoToken = M_GetToken(NULL);
|
||||||
frameYPivot = atoi(sprinfoToken);
|
frameYPivot = atoi(sprinfoToken);
|
||||||
}
|
}
|
||||||
else if (stricmp(sprinfoToken, "ROLLAXIS")==0)
|
else if (stricmp(sprinfoToken, "ROTAXIS")==0)
|
||||||
{
|
{
|
||||||
Z_Free(sprinfoToken);
|
Z_Free(sprinfoToken);
|
||||||
sprinfoToken = M_GetToken(NULL);
|
sprinfoToken = M_GetToken(NULL);
|
||||||
if ((stricmp(sprinfoToken, "X")==0) || (stricmp(sprinfoToken, "XAXIS")==0))
|
if ((stricmp(sprinfoToken, "X")==0) || (stricmp(sprinfoToken, "XAXIS")==0) || (stricmp(sprinfoToken, "ROLL")==0))
|
||||||
frameRollAxis = ROLLAXIS_X;
|
frameRotAxis = ROTAXIS_X;
|
||||||
else if ((stricmp(sprinfoToken, "Y")==0) || (stricmp(sprinfoToken, "YAXIS")==0))
|
else if ((stricmp(sprinfoToken, "Y")==0) || (stricmp(sprinfoToken, "YAXIS")==0) || (stricmp(sprinfoToken, "PITCH")==0))
|
||||||
frameRollAxis = ROLLAXIS_Y;
|
frameRotAxis = ROTAXIS_Y;
|
||||||
else if ((stricmp(sprinfoToken, "Z")==0) || (stricmp(sprinfoToken, "ZAXIS")==0))
|
else if ((stricmp(sprinfoToken, "Z")==0) || (stricmp(sprinfoToken, "ZAXIS")==0) || (stricmp(sprinfoToken, "YAW")==0))
|
||||||
frameRollAxis = ROLLAXIS_Z;
|
frameRotAxis = ROTAXIS_Z;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
Z_Free(sprinfoToken);
|
Z_Free(sprinfoToken);
|
||||||
|
|
@ -868,7 +868,7 @@ static void R_ParseSpriteInfoFrame(spriteinfo_t *info)
|
||||||
#ifdef ROTSPRITE
|
#ifdef ROTSPRITE
|
||||||
info->pivot[frameFrame].x = frameXPivot;
|
info->pivot[frameFrame].x = frameXPivot;
|
||||||
info->pivot[frameFrame].y = frameYPivot;
|
info->pivot[frameFrame].y = frameYPivot;
|
||||||
info->pivot[frameFrame].rollaxis = frameRollAxis;
|
info->pivot[frameFrame].rotaxis = frameRotAxis;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,15 +21,15 @@
|
||||||
#ifdef ROTSPRITE
|
#ifdef ROTSPRITE
|
||||||
typedef enum
|
typedef enum
|
||||||
{
|
{
|
||||||
ROLLAXIS_X, // the default
|
ROTAXIS_X, // roll (the default)
|
||||||
ROLLAXIS_Y,
|
ROTAXIS_Y, // pitch
|
||||||
ROLLAXIS_Z
|
ROTAXIS_Z // yaw
|
||||||
} rollaxis_t;
|
} rotaxis_t;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
INT32 x, y;
|
INT32 x, y;
|
||||||
rollaxis_t rollaxis;
|
rotaxis_t rotaxis;
|
||||||
} spriteframepivot_t;
|
} spriteframepivot_t;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue