From a9183b474bb6fa299e53ee377ab7f7197374a248 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Wed, 13 Nov 2019 12:47:30 -0300 Subject: [PATCH] rename rollaxis to rotaxis --- src/dehacked.c | 8 ++++---- src/hardware/hw_defs.h | 2 +- src/hardware/hw_md2.c | 6 +++--- src/hardware/r_opengl/r_opengl.c | 4 ++-- src/lua_infolib.c | 14 +++++++------- src/r_patch.c | 18 +++++++++--------- src/r_patch.h | 10 +++++----- 7 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index cf654dcd7..ac68c8f28 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -9365,10 +9365,10 @@ struct { {"NUMDIRS",NUMDIRS}, #ifdef ROTSPRITE - // Sprite roll axis (rollaxis_t) - {"ROLLAXIS_X",ROLLAXIS_X}, - {"ROLLAXIS_Y",ROLLAXIS_Y}, - {"ROLLAXIS_Z",ROLLAXIS_Z}, + // Sprite rotation axis (rotaxis_t) + {"ROTAXIS_X",ROTAXIS_X}, + {"ROTAXIS_Y",ROTAXIS_Y}, + {"ROTAXIS_Z",ROTAXIS_Z}, #endif // Buttons (ticcmd_t) diff --git a/src/hardware/hw_defs.h b/src/hardware/hw_defs.h index c1996ea4b..965f06980 100644 --- a/src/hardware/hw_defs.h +++ b/src/hardware/hw_defs.h @@ -117,9 +117,9 @@ typedef struct boolean flip; // screenflip #ifdef ROTSPRITE boolean roll; - UINT8 rollaxis; SINT8 rollflip; FLOAT rollangle; // done to not override USE_FTRANSFORM_ANGLEZ + UINT8 rotaxis; FLOAT centerx, centery; #endif #ifdef USE_FTRANSFORM_MIRROR diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 2c5ab07db..9d9171cea 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -1187,8 +1187,8 @@ void HWR_DrawModel(gr_vissprite_t *spr) #ifdef ROTSPRITE p.rollangle = 0.0f; - p.rollaxis = 0; p.rollflip = 0; + p.rotaxis = 0; if (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.centery = FIXED_TO_FLOAT(spr->mobj->height/2); - // roll axis + // rotation axis 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 ang = R_PointToAngle (spr->mobj->x, spr->mobj->y) - (spr->mobj->player ? spr->mobj->player->drawangle : spr->mobj->angle); diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index b05a5dd83..d208580a9 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -2071,9 +2071,9 @@ static void DrawModelEx(model_t *model, INT32 frameIndex, INT32 duration, INT32 { float roll = (1.0f * pos->rollflip); pglTranslatef(pos->centerx, pos->centery, 0); - if (pos->rollaxis == 2) // Z + if (pos->rotaxis == 2) // Z 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); else // X pglRotatef(pos->rollangle, roll, 0.0f, 0.0f); diff --git a/src/lua_infolib.c b/src/lua_infolib.c index 2782e6b29..db8b85194 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -305,8 +305,8 @@ static int PopPivotSubTable(spriteframepivot_t *pivot, lua_State *L, int stk, in pivot[idx].x = (INT32)value; else if (ikey == 2 || (key && fastcmp(key, "y"))) pivot[idx].y = (INT32)value; - else if (ikey == 3 || (key && fastcmp(key, "rollaxis"))) - pivot[idx].rollaxis = (UINT8)value; + else if (ikey == 3 || (key && fastcmp(key, "rotaxis"))) + pivot[idx].rotaxis = (UINT8)value; else if (ikey == -1 && (key != NULL)) FIELDERROR("pivot key", va("x, y or roll axis expected, got %s", key)); ok = 1; @@ -330,7 +330,7 @@ static int PopPivotTable(spriteinfo_t *info, lua_State *L, int stk) // stk = 0 has the pivot table // stk = 1 has the frame key // 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 while (lua_next(L, stk)) { @@ -570,8 +570,8 @@ static int framepivot_get(lua_State *L) lua_pushinteger(L, framepivot->x); else if (fastcmp("y", field)) lua_pushinteger(L, framepivot->y); - else if (fastcmp("rollaxis", field)) - lua_pushinteger(L, (UINT8)framepivot->rollaxis); + else if (fastcmp("rotaxis", field)) + lua_pushinteger(L, (UINT8)framepivot->rotaxis); else 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); else if (fastcmp("y", field)) framepivot->y = luaL_checkinteger(L, 3); - else if (fastcmp("rollaxis", field)) - framepivot->rollaxis = (UINT8)luaL_checkinteger(L, 3); + else if (fastcmp("rotaxis", field)) + framepivot->rotaxis = (rotaxis_t)(luaL_checkinteger(L, 3)); else return luaL_error(L, va("Field %s does not exist in spriteframepivot_t", field)); diff --git a/src/r_patch.c b/src/r_patch.c index 6f6050ce9..28a9d2732 100644 --- a/src/r_patch.c +++ b/src/r_patch.c @@ -791,7 +791,7 @@ static void R_ParseSpriteInfoFrame(spriteinfo_t *info) #ifdef ROTSPRITE INT16 frameXPivot = 0; INT16 frameYPivot = 0; - rollaxis_t frameRollAxis = 0; + rotaxis_t frameRotAxis = 0; #endif // Sprite identifier @@ -840,16 +840,16 @@ static void R_ParseSpriteInfoFrame(spriteinfo_t *info) sprinfoToken = M_GetToken(NULL); frameYPivot = atoi(sprinfoToken); } - else if (stricmp(sprinfoToken, "ROLLAXIS")==0) + else if (stricmp(sprinfoToken, "ROTAXIS")==0) { Z_Free(sprinfoToken); sprinfoToken = M_GetToken(NULL); - if ((stricmp(sprinfoToken, "X")==0) || (stricmp(sprinfoToken, "XAXIS")==0)) - frameRollAxis = ROLLAXIS_X; - else if ((stricmp(sprinfoToken, "Y")==0) || (stricmp(sprinfoToken, "YAXIS")==0)) - frameRollAxis = ROLLAXIS_Y; - else if ((stricmp(sprinfoToken, "Z")==0) || (stricmp(sprinfoToken, "ZAXIS")==0)) - frameRollAxis = ROLLAXIS_Z; + if ((stricmp(sprinfoToken, "X")==0) || (stricmp(sprinfoToken, "XAXIS")==0) || (stricmp(sprinfoToken, "ROLL")==0)) + frameRotAxis = ROTAXIS_X; + else if ((stricmp(sprinfoToken, "Y")==0) || (stricmp(sprinfoToken, "YAXIS")==0) || (stricmp(sprinfoToken, "PITCH")==0)) + frameRotAxis = ROTAXIS_Y; + else if ((stricmp(sprinfoToken, "Z")==0) || (stricmp(sprinfoToken, "ZAXIS")==0) || (stricmp(sprinfoToken, "YAW")==0)) + frameRotAxis = ROTAXIS_Z; } #endif Z_Free(sprinfoToken); @@ -868,7 +868,7 @@ static void R_ParseSpriteInfoFrame(spriteinfo_t *info) #ifdef ROTSPRITE info->pivot[frameFrame].x = frameXPivot; info->pivot[frameFrame].y = frameYPivot; - info->pivot[frameFrame].rollaxis = frameRollAxis; + info->pivot[frameFrame].rotaxis = frameRotAxis; #endif } diff --git a/src/r_patch.h b/src/r_patch.h index fa6785792..7fbdeb6e1 100644 --- a/src/r_patch.h +++ b/src/r_patch.h @@ -21,15 +21,15 @@ #ifdef ROTSPRITE typedef enum { - ROLLAXIS_X, // the default - ROLLAXIS_Y, - ROLLAXIS_Z -} rollaxis_t; + ROTAXIS_X, // roll (the default) + ROTAXIS_Y, // pitch + ROTAXIS_Z // yaw +} rotaxis_t; typedef struct { INT32 x, y; - rollaxis_t rollaxis; + rotaxis_t rotaxis; } spriteframepivot_t; #endif