C++ compat: rename tm -> g_tm

This one's not even C++. It's in the ISO C standard library. :(
This commit is contained in:
Eidolon 2024-02-19 19:30:58 -06:00
parent e0fe5543fa
commit af7800c17b
13 changed files with 791 additions and 791 deletions

View file

@ -2082,7 +2082,7 @@ void F_EndTextPrompt(boolean forceexec, boolean noexec)
// \todo net safety, maybe loop all player thinkers?
if ((promptwasactive || forceexec) && !noexec && promptpostexectag)
{
if (tm.thing) // edge case where starting an invalid prompt immediately on level load will make P_MapStart fail
if (g_tm.thing) // edge case where starting an invalid prompt immediately on level load will make P_MapStart fail
P_LinedefExecute(promptpostexectag, promptmo, NULL);
else
{

View file

@ -793,12 +793,12 @@ boolean K_BubbleShieldCollide(mobj_t *t1, mobj_t *t2)
{
// Counter desyncs
/*mobj_t *oldthing = thing;
mobj_t *oldtm.thing = tm.thing;
mobj_t *oldg_tm.thing = g_tm.thing;
P_Thrust(tm.thing, R_PointToAngle2(thing->x, thing->y, tm.thing->x, tm.thing->y), 4*thing->scale);
P_Thrust(g_tm.thing, R_PointToAngle2(thing->x, thing->y, g_tm.thing->x, g_tm.thing->y), 4*thing->scale);
thing = oldthing;
P_SetTarget(&tm.thing, oldtm.thing);*/
P_SetTarget(&g_tm.thing, oldg_tm.thing);*/
if (K_KartBouncing(t2, t1->target) == true)
{

View file

@ -986,7 +986,7 @@ static int lib_pRemoveFloorSpriteSlope(lua_State *L)
static int lib_pRailThinker(lua_State *L)
{
mobj_t *mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
tm_t ptm = tm;
tm_t ptm = g_tm;
NOHUD
INLEVEL
if (!mobj)
@ -999,7 +999,7 @@ static int lib_pRailThinker(lua_State *L)
static int lib_pXYMovement(lua_State *L)
{
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
tm_t ptm = tm;
tm_t ptm = g_tm;
NOHUD
INLEVEL
if (!actor)
@ -1012,7 +1012,7 @@ static int lib_pXYMovement(lua_State *L)
static int lib_pRingXYMovement(lua_State *L)
{
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
tm_t ptm = tm;
tm_t ptm = g_tm;
NOHUD
INLEVEL
if (!actor)
@ -1025,7 +1025,7 @@ static int lib_pRingXYMovement(lua_State *L)
static int lib_pSceneryXYMovement(lua_State *L)
{
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
tm_t ptm = tm;
tm_t ptm = g_tm;
NOHUD
INLEVEL
if (!actor)
@ -1038,7 +1038,7 @@ static int lib_pSceneryXYMovement(lua_State *L)
static int lib_pZMovement(lua_State *L)
{
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
tm_t ptm = tm;
tm_t ptm = g_tm;
NOHUD
INLEVEL
if (!actor)
@ -1052,7 +1052,7 @@ static int lib_pZMovement(lua_State *L)
static int lib_pRingZMovement(lua_State *L)
{
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
tm_t ptm = tm;
tm_t ptm = g_tm;
NOHUD
INLEVEL
if (!actor)
@ -1066,7 +1066,7 @@ static int lib_pRingZMovement(lua_State *L)
static int lib_pSceneryZMovement(lua_State *L)
{
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
tm_t ptm = tm;
tm_t ptm = g_tm;
NOHUD
INLEVEL
if (!actor)
@ -1080,7 +1080,7 @@ static int lib_pSceneryZMovement(lua_State *L)
static int lib_pPlayerZMovement(lua_State *L)
{
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
tm_t ptm = tm;
tm_t ptm = g_tm;
NOHUD
INLEVEL
if (!actor)
@ -1235,7 +1235,7 @@ static int lib_pGivePlayerLives(lua_State *L)
static int lib_pMovePlayer(lua_State *L)
{
player_t *player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
tm_t ptm = tm;
tm_t ptm = g_tm;
NOHUD
INLEVEL
if (!player)
@ -1314,7 +1314,7 @@ static int lib_pNukeEnemies(lua_State *L)
static int lib_pCheckPosition(lua_State *L)
{
tm_t ptm = tm;
tm_t ptm = g_tm;
mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
fixed_t x = luaL_checkfixed(L, 2);
fixed_t y = luaL_checkfixed(L, 3);
@ -1323,14 +1323,14 @@ static int lib_pCheckPosition(lua_State *L)
if (!thing)
return LUA_ErrInvalid(L, "mobj_t");
lua_pushboolean(L, P_CheckPosition(thing, x, y, NULL));
LUA_PushUserdata(L, tm.thing, META_MOBJ);
LUA_PushUserdata(L, g_tm.thing, META_MOBJ);
P_RestoreTMStruct(ptm);
return 2;
}
static int lib_pTryMove(lua_State *L)
{
tm_t ptm = tm;
tm_t ptm = g_tm;
mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
fixed_t x = luaL_checkfixed(L, 2);
fixed_t y = luaL_checkfixed(L, 3);
@ -1340,14 +1340,14 @@ static int lib_pTryMove(lua_State *L)
if (!thing)
return LUA_ErrInvalid(L, "mobj_t");
lua_pushboolean(L, P_TryMove(thing, x, y, allowdropoff, NULL));
LUA_PushUserdata(L, tm.thing, META_MOBJ);
LUA_PushUserdata(L, g_tm.thing, META_MOBJ);
P_RestoreTMStruct(ptm);
return 2;
}
static int lib_pMove(lua_State *L)
{
tm_t ptm = tm;
tm_t ptm = g_tm;
mobj_t *actor = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
fixed_t speed = luaL_checkfixed(L, 2);
NOHUD
@ -1355,14 +1355,14 @@ static int lib_pMove(lua_State *L)
if (!actor)
return LUA_ErrInvalid(L, "mobj_t");
lua_pushboolean(L, P_Move(actor, speed));
LUA_PushUserdata(L, tm.thing, META_MOBJ);
LUA_PushUserdata(L, g_tm.thing, META_MOBJ);
P_RestoreTMStruct(ptm);
return 2;
}
static int lib_pTeleportMove(lua_State *L)
{
tm_t ptm = tm;
tm_t ptm = g_tm;
mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
fixed_t x = luaL_checkfixed(L, 2);
fixed_t y = luaL_checkfixed(L, 3);
@ -1373,14 +1373,14 @@ static int lib_pTeleportMove(lua_State *L)
return LUA_ErrInvalid(L, "mobj_t");
LUA_Deprecated(L, "P_TeleportMove", "P_SetOrigin\" or \"P_MoveOrigin");
lua_pushboolean(L, P_MoveOrigin(thing, x, y, z));
LUA_PushUserdata(L, tm.thing, META_MOBJ);
LUA_PushUserdata(L, g_tm.thing, META_MOBJ);
P_RestoreTMStruct(ptm);
return 2;
}
static int lib_pSetOrigin(lua_State *L)
{
tm_t ptm = tm;
tm_t ptm = g_tm;
mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
fixed_t x = luaL_checkfixed(L, 2);
fixed_t y = luaL_checkfixed(L, 3);
@ -1390,14 +1390,14 @@ static int lib_pSetOrigin(lua_State *L)
if (!thing)
return LUA_ErrInvalid(L, "mobj_t");
lua_pushboolean(L, P_SetOrigin(thing, x, y, z));
LUA_PushUserdata(L, tm.thing, META_MOBJ);
LUA_PushUserdata(L, g_tm.thing, META_MOBJ);
P_RestoreTMStruct(ptm);
return 2;
}
static int lib_pMoveOrigin(lua_State *L)
{
tm_t ptm = tm;
tm_t ptm = g_tm;
mobj_t *thing = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ));
fixed_t x = luaL_checkfixed(L, 2);
fixed_t y = luaL_checkfixed(L, 3);
@ -1407,7 +1407,7 @@ static int lib_pMoveOrigin(lua_State *L)
if (!thing)
return LUA_ErrInvalid(L, "mobj_t");
lua_pushboolean(L, P_MoveOrigin(thing, x, y, z));
LUA_PushUserdata(L, tm.thing, META_MOBJ);
LUA_PushUserdata(L, g_tm.thing, META_MOBJ);
P_RestoreTMStruct(ptm);
return 2;
}
@ -3850,10 +3850,10 @@ static luaL_Reg lib[] = {
{"VS_GetArena", lib_vsGetArena},
{"VS_PredictAroundArena", lib_vsPredictAroundArena},
{"VS_RandomPointOnArena", lib_vsRandomPointOnArena},
// hu_stuff technically?
{"HU_DoTitlecardCEcho", lib_startTitlecardCecho},
{NULL, NULL}
};

View file

@ -796,7 +796,7 @@ static int sector_set(lua_State *L)
return luaL_error(L, "sector_t field " LUA_QS " cannot be set.", sector_opt[field]);
case sector_floorheight: { // floorheight
boolean flag;
tm_t ptm = tm;
tm_t ptm = g_tm;
fixed_t lastpos = sector->floorheight;
sector->floorheight = luaL_checkfixed(L, 3);
flag = P_CheckSector(sector, true);
@ -810,7 +810,7 @@ static int sector_set(lua_State *L)
}
case sector_ceilingheight: { // ceilingheight
boolean flag;
tm_t ptm = tm;
tm_t ptm = g_tm;
fixed_t lastpos = sector->ceilingheight;
sector->ceilingheight = luaL_checkfixed(L, 3);
flag = P_CheckSector(sector, true);
@ -2203,7 +2203,7 @@ static int ffloor_set(lua_State *L)
case ffloor_topheight: { // topheight
boolean flag;
fixed_t lastpos = *ffloor->topheight;
tm_t ptm = tm;
tm_t ptm = g_tm;
sector_t *sector = &sectors[ffloor->secnum];
sector->ceilingheight = luaL_checkfixed(L, 3);
flag = P_CheckSector(sector, true);
@ -2224,7 +2224,7 @@ static int ffloor_set(lua_State *L)
case ffloor_bottomheight: { // bottomheight
boolean flag;
fixed_t lastpos = *ffloor->bottomheight;
tm_t ptm = tm;
tm_t ptm = g_tm;
sector_t *sector = &sectors[ffloor->secnum];
sector->floorheight = luaL_checkfixed(L, 3);
flag = P_CheckSector(sector, true);

View file

@ -565,13 +565,13 @@ static int mobj_set(lua_State *L)
case mobj_z:
{
// z doesn't cross sector bounds so it's okay.
tm_t ptm = tm;
tm_t ptm = g_tm;
mo->z = luaL_checkfixed(L, 3);
P_CheckPosition(mo, mo->x, mo->y, NULL);
mo->floorz = tm.floorz;
mo->ceilingz = tm.ceilingz;
mo->floorrover = tm.floorrover;
mo->ceilingrover = tm.ceilingrover;
mo->floorz = g_tm.floorz;
mo->ceilingz = g_tm.ceilingz;
mo->floorrover = g_tm.floorrover;
mo->ceilingrover = g_tm.ceilingrover;
P_RestoreTMStruct(ptm);
break;
}
@ -636,29 +636,29 @@ static int mobj_set(lua_State *L)
return NOSET;
case mobj_radius:
{
tm_t ptm = tm;
tm_t ptm = g_tm;
mo->radius = luaL_checkfixed(L, 3);
if (mo->radius < 0)
mo->radius = 0;
P_CheckPosition(mo, mo->x, mo->y, NULL);
mo->floorz = tm.floorz;
mo->ceilingz = tm.ceilingz;
mo->floorrover = tm.floorrover;
mo->ceilingrover = tm.ceilingrover;
mo->floorz = g_tm.floorz;
mo->ceilingz = g_tm.ceilingz;
mo->floorrover = g_tm.floorrover;
mo->ceilingrover = g_tm.ceilingrover;
P_RestoreTMStruct(ptm);
break;
}
case mobj_height:
{
tm_t ptm = tm;
tm_t ptm = g_tm;
mo->height = luaL_checkfixed(L, 3);
if (mo->height < 0)
mo->height = 0;
P_CheckPosition(mo, mo->x, mo->y, NULL);
mo->floorz = tm.floorz;
mo->ceilingz = tm.ceilingz;
mo->floorrover = tm.floorrover;
mo->ceilingrover = tm.ceilingrover;
mo->floorz = g_tm.floorz;
mo->ceilingz = g_tm.ceilingz;
mo->floorrover = g_tm.floorrover;
mo->ceilingrover = g_tm.ceilingrover;
P_RestoreTMStruct(ptm);
break;
}

View file

@ -49,13 +49,13 @@ void Obj_SneakerPanelSetup(mobj_t *mobj, mapthing_t *mthing)
{
if (P_IsObjectFlipped(mobj))
{
if (tm.ceilingz <= mobj->z + mobj->height)
mobj->standingslope = tm.ceilingslope;
if (g_tm.ceilingz <= mobj->z + mobj->height)
mobj->standingslope = g_tm.ceilingslope;
}
else
{
if (mobj->z <= tm.floorz)
mobj->standingslope = tm.floorslope;
if (mobj->z <= g_tm.floorz)
mobj->standingslope = g_tm.floorslope;
}
}

View file

@ -495,10 +495,10 @@ boolean P_Move(mobj_t *actor, fixed_t speed)
if (!P_TryMove(actor, tryx, tryy, false, NULL))
{
if (actor->flags & MF_FLOAT && tm.floatok)
if (actor->flags & MF_FLOAT && g_tm.floatok)
{
// must adjust height
if (actor->z < tm.floorz)
if (actor->z < g_tm.floorz)
actor->z += FixedMul(FLOATSPEED, actor->scale);
else
actor->z -= FixedMul(FLOATSPEED, actor->scale);
@ -9940,13 +9940,13 @@ void A_FlickyCenter(mobj_t *actor)
{
actor->extravalue2 = 1;
P_SetOrigin(actor, actor->target->x, actor->target->y, actor->target->z);
P_SetTarget(&tm.thing, NULL);
P_SetTarget(&g_tm.thing, NULL);
}
else if(actor->extravalue2)
{
actor->extravalue2 = 0;
P_SetOrigin(actor, originx, originy, originz);
P_SetTarget(&tm.thing, NULL);
P_SetTarget(&g_tm.thing, NULL);
}
}
}
@ -12139,11 +12139,11 @@ void A_SSMineExplode(mobj_t *actor)
return;
delay = K_MineExplodeAttack(actor, (3*actor->info->painchance)>>1, (boolean)locvar1);
skincolornum_t color = SKINCOLOR_KETCHUP;
if (!P_MobjWasRemoved(actor->target) && actor->target->player)
color = actor->target->player->skincolor;
K_SpawnMineExplosion(actor, color, delay);
}

View file

@ -398,7 +398,7 @@ struct tm_t
fixed_t maxstep;
};
extern tm_t tm;
extern tm_t g_tm;
void P_RestoreTMStruct(tm_t tmrestore);

File diff suppressed because it is too large Load diff

View file

@ -375,8 +375,8 @@ void P_CameraLineOpening(line_t *linedef, opening_t *open)
}
else
{
frontfloor = P_CameraGetFloorZ (mapcampointer, front, tm.x, tm.y, linedef);
frontceiling = P_CameraGetCeilingZ(mapcampointer, front, tm.x, tm.y, linedef);
frontfloor = P_CameraGetFloorZ (mapcampointer, front, g_tm.x, g_tm.y, linedef);
frontceiling = P_CameraGetCeilingZ(mapcampointer, front, g_tm.x, g_tm.y, linedef);
}
if (back->camsec >= 0)
@ -393,8 +393,8 @@ void P_CameraLineOpening(line_t *linedef, opening_t *open)
}
else
{
backfloor = P_CameraGetFloorZ (mapcampointer, back, tm.x, tm.y, linedef);
backceiling = P_CameraGetCeilingZ(mapcampointer, back, tm.x, tm.y, linedef);
backfloor = P_CameraGetFloorZ (mapcampointer, back, g_tm.x, g_tm.y, linedef);
backceiling = P_CameraGetCeilingZ(mapcampointer, back, g_tm.x, g_tm.y, linedef);
}
thingtop = mapcampointer->z + mapcampointer->height;
@ -435,8 +435,8 @@ void P_CameraLineOpening(line_t *linedef, opening_t *open)
if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_RENDERALL) || !(rover->fofflags & FOF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
continue;
topheight = P_CameraGetFOFTopZ(mapcampointer, front, rover, tm.x, tm.y, linedef);
bottomheight = P_CameraGetFOFBottomZ(mapcampointer, front, rover, tm.x, tm.y, linedef);
topheight = P_CameraGetFOFTopZ(mapcampointer, front, rover, g_tm.x, g_tm.y, linedef);
bottomheight = P_CameraGetFOFBottomZ(mapcampointer, front, rover, g_tm.x, g_tm.y, linedef);
delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2)));
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
@ -459,8 +459,8 @@ void P_CameraLineOpening(line_t *linedef, opening_t *open)
if (!(rover->fofflags & FOF_BLOCKOTHERS) || !(rover->fofflags & FOF_RENDERALL) || !(rover->fofflags & FOF_EXISTS) || (rover->master->frontsector->flags & MSF_NOCLIPCAMERA))
continue;
topheight = P_CameraGetFOFTopZ(mapcampointer, back, rover, tm.x, tm.y, linedef);
bottomheight = P_CameraGetFOFBottomZ(mapcampointer, back, rover, tm.x, tm.y, linedef);
topheight = P_CameraGetFOFTopZ(mapcampointer, back, rover, g_tm.x, g_tm.y, linedef);
bottomheight = P_CameraGetFOFBottomZ(mapcampointer, back, rover, g_tm.x, g_tm.y, linedef);
delta1 = abs(mapcampointer->z - (bottomheight + ((topheight - bottomheight)/2)));
delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2)));
@ -617,7 +617,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj, opening_t *open)
return;
}
P_ClosestPointOnLine(tm.x, tm.y, linedef, &cross);
P_ClosestPointOnLine(g_tm.x, g_tm.y, linedef, &cross);
// Treat polyobjects kind of like 3D Floors
if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT))
@ -645,8 +645,8 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj, opening_t *open)
fixed_t height[2];
const sector_t * sector[2] = { front, back };
height[FRONT] = P_GetCeilingZ(mobj, front, tm.x, tm.y, linedef);
height[BACK] = P_GetCeilingZ(mobj, back, tm.x, tm.y, linedef);
height[FRONT] = P_GetCeilingZ(mobj, front, g_tm.x, g_tm.y, linedef);
height[BACK] = P_GetCeilingZ(mobj, back, g_tm.x, g_tm.y, linedef);
hi = ( height[0] < height[1] );
lo = ! hi;
@ -665,8 +665,8 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj, opening_t *open)
open->ceilingdrop = ( topedge[hi] - topedge[lo] );
}
height[FRONT] = P_GetFloorZ(mobj, front, tm.x, tm.y, linedef);
height[BACK] = P_GetFloorZ(mobj, back, tm.x, tm.y, linedef);
height[FRONT] = P_GetFloorZ(mobj, front, g_tm.x, g_tm.y, linedef);
height[BACK] = P_GetFloorZ(mobj, back, g_tm.x, g_tm.y, linedef);
hi = ( height[0] < height[1] );
lo = ! hi;
@ -855,8 +855,8 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj, opening_t *open)
}
else
{
topheight = P_GetFOFTopZ(mobj, front, rover, tm.x, tm.y, linedef);
bottomheight = P_GetFOFBottomZ(mobj, front, rover, tm.x, tm.y, linedef);
topheight = P_GetFOFTopZ(mobj, front, rover, g_tm.x, g_tm.y, linedef);
bottomheight = P_GetFOFBottomZ(mobj, front, rover, g_tm.x, g_tm.y, linedef);
}
switch (open->fofType)
@ -947,8 +947,8 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj, opening_t *open)
}
else
{
topheight = P_GetFOFTopZ(mobj, back, rover, tm.x, tm.y, linedef);
bottomheight = P_GetFOFBottomZ(mobj, back, rover, tm.x, tm.y, linedef);
topheight = P_GetFOFTopZ(mobj, back, rover, g_tm.x, g_tm.y, linedef);
bottomheight = P_GetFOFBottomZ(mobj, back, rover, g_tm.x, g_tm.y, linedef);
}
switch (open->fofType)
@ -1754,16 +1754,16 @@ boolean P_RadiusLinesCheck(fixed_t radius, fixed_t x, fixed_t y,
INT32 xl, xh, yl, yh;
INT32 bx, by;
tm.bbox[BOXTOP] = y + radius;
tm.bbox[BOXBOTTOM] = y - radius;
tm.bbox[BOXRIGHT] = x + radius;
tm.bbox[BOXLEFT] = x - radius;
g_tm.bbox[BOXTOP] = y + radius;
g_tm.bbox[BOXBOTTOM] = y - radius;
g_tm.bbox[BOXRIGHT] = x + radius;
g_tm.bbox[BOXLEFT] = x - radius;
// check lines
xl = (unsigned)(tm.bbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (unsigned)(tm.bbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (unsigned)(tm.bbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (unsigned)(tm.bbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
xl = (unsigned)(g_tm.bbox[BOXLEFT] - bmaporgx)>>MAPBLOCKSHIFT;
xh = (unsigned)(g_tm.bbox[BOXRIGHT] - bmaporgx)>>MAPBLOCKSHIFT;
yl = (unsigned)(g_tm.bbox[BOXBOTTOM] - bmaporgy)>>MAPBLOCKSHIFT;
yh = (unsigned)(g_tm.bbox[BOXTOP] - bmaporgy)>>MAPBLOCKSHIFT;
for (bx = xl; bx <= xh; bx++)
for (by = yl; by <= yh; by++)

View file

@ -1558,12 +1558,12 @@ bustupdone:
//
static boolean P_CheckSkyHit(mobj_t *mo)
{
if (tm.ceilingline && tm.ceilingline->backsector
&& tm.ceilingline->backsector->ceilingpic == skyflatnum
&& tm.ceilingline->frontsector
&& tm.ceilingline->frontsector->ceilingpic == skyflatnum
&& (mo->z >= tm.ceilingline->frontsector->ceilingheight
|| mo->z >= tm.ceilingline->backsector->ceilingheight))
if (g_tm.ceilingline && g_tm.ceilingline->backsector
&& g_tm.ceilingline->backsector->ceilingpic == skyflatnum
&& g_tm.ceilingline->frontsector
&& g_tm.ceilingline->frontsector->ceilingpic == skyflatnum
&& (mo->z >= g_tm.ceilingline->frontsector->ceilingheight
|| mo->z >= g_tm.ceilingline->backsector->ceilingheight))
return true;
return false;
}
@ -1668,7 +1668,7 @@ void P_XYMovement(mobj_t *mo)
// blocked move
moved = false;
if (LUA_HookMobjMoveBlocked(mo, tm.hitthing, result.line))
if (LUA_HookMobjMoveBlocked(mo, g_tm.hitthing, result.line))
{
if (P_MobjWasRemoved(mo))
return;
@ -1695,7 +1695,7 @@ void P_XYMovement(mobj_t *mo)
// draw damage on wall
//SPLAT TEST ----------------------------------------------------------
#ifdef WALLSPLATS
if (tm.blockingline && mo->type != MT_REDRING && mo->type != MT_FIREBALL
if (g_tm.blockingline && mo->type != MT_REDRING && mo->type != MT_FIREBALL
&& !(mo->flags2 & (MF2_AUTOMATIC|MF2_RAILRING|MF2_BOUNCERING|MF2_EXPLOSION|MF2_SCATTER)))
// set by last P_TryMove() that failed
{
@ -1703,13 +1703,13 @@ void P_XYMovement(mobj_t *mo)
divline_t misl;
fixed_t frac;
P_MakeDivline(tm.blockingline, &divl);
P_MakeDivline(g_tm.blockingline, &divl);
misl.x = mo->x;
misl.y = mo->y;
misl.dx = mo->momx;
misl.dy = mo->momy;
frac = P_InterceptVector(&divl, &misl);
R_AddWallSplat(tm.blockingline, P_PointOnLineSide(mo->x,mo->y,tm.blockingline),
R_AddWallSplat(g_tm.blockingline, P_PointOnLineSide(mo->x,mo->y,g_tm.blockingline),
"A_DMG3", mo->z, frac, SPLATDRAWMODE_SHADE);
}
#endif
@ -2367,11 +2367,11 @@ boolean P_ZMovement(mobj_t *mo)
mom.y = mo->momy;
mom.z = mo->momz;
K_UpdateMobjTerrain(mo, ((mo->eflags & MFE_VERTICALFLIP) ? tm.ceilingpic : tm.floorpic));
K_UpdateMobjTerrain(mo, ((mo->eflags & MFE_VERTICALFLIP) ? g_tm.ceilingpic : g_tm.floorpic));
if (((mo->eflags & MFE_VERTICALFLIP) ? tm.ceilingslope : tm.floorslope) && (mo->type != MT_STEAM))
if (((mo->eflags & MFE_VERTICALFLIP) ? g_tm.ceilingslope : g_tm.floorslope) && (mo->type != MT_STEAM))
{
mo->standingslope = (mo->eflags & MFE_VERTICALFLIP) ? tm.ceilingslope : tm.floorslope;
mo->standingslope = (mo->eflags & MFE_VERTICALFLIP) ? g_tm.ceilingslope : g_tm.floorslope;
P_SetPitchRollFromSlope(mo, mo->standingslope);
P_ReverseQuantizeMomentumToSlope(&mom, mo->standingslope);
}
@ -2598,11 +2598,11 @@ boolean P_ZMovement(mobj_t *mo)
}
}
else
mom.z = (tm.floorthing ? tm.floorthing->momz : 0);
mom.z = (g_tm.floorthing ? g_tm.floorthing->momz : 0);
}
else if (tm.floorthing)
mom.z = tm.floorthing->momz;
else if (g_tm.floorthing)
mom.z = g_tm.floorthing->momz;
if (mo->standingslope) { // MT_STEAM will never have a standingslope, see above.
P_QuantizeMomentumToSlope(&mom, mo->standingslope);
@ -2843,7 +2843,7 @@ void P_PlayerZMovement(mobj_t *mo)
mo->z = mo->floorz;
}
K_UpdateMobjTerrain(mo, (mo->eflags & MFE_VERTICALFLIP ? tm.ceilingpic : tm.floorpic));
K_UpdateMobjTerrain(mo, (mo->eflags & MFE_VERTICALFLIP ? g_tm.ceilingpic : g_tm.floorpic));
// Get up if you fell.
if (mo->player->panim == PA_HURT && mo->player->spinouttimer == 0 && mo->player->tumbleBounces == 0)
@ -2851,10 +2851,10 @@ void P_PlayerZMovement(mobj_t *mo)
P_SetPlayerMobjState(mo, S_KART_STILL);
}
if (!mo->standingslope && (mo->eflags & MFE_VERTICALFLIP ? tm.ceilingslope : tm.floorslope))
if (!mo->standingslope && (mo->eflags & MFE_VERTICALFLIP ? g_tm.ceilingslope : g_tm.floorslope))
{
// Handle landing on slope during Z movement
P_HandleSlopeLanding(mo, (mo->eflags & MFE_VERTICALFLIP ? tm.ceilingslope : tm.floorslope));
P_HandleSlopeLanding(mo, (mo->eflags & MFE_VERTICALFLIP ? g_tm.ceilingslope : g_tm.floorslope));
}
if (P_MobjFlip(mo) * mo->momz < 0) // falling
@ -2869,12 +2869,12 @@ void P_PlayerZMovement(mobj_t *mo)
if (clipmomz)
{
mo->momz = (tm.floorthing ? tm.floorthing->momz : 0);
mo->momz = (g_tm.floorthing ? g_tm.floorthing->momz : 0);
}
}
else if (tm.floorthing)
else if (g_tm.floorthing)
{
mo->momz = tm.floorthing->momz;
mo->momz = g_tm.floorthing->momz;
}
}
else
@ -3124,9 +3124,9 @@ boolean P_SceneryZMovement(mobj_t *mo)
{
mo->eflags |= MFE_JUSTHITFLOOR; // Spin Attack
if (tm.floorthing)
mo->momz = tm.floorthing->momz;
else if (!tm.floorthing)
if (g_tm.floorthing)
mo->momz = g_tm.floorthing->momz;
else if (!g_tm.floorthing)
mo->momz = 0;
}
}
@ -3868,8 +3868,8 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled
}
thiscam->subsector = R_PointInSubsector(thiscam->x, thiscam->y);
thiscam->floorz = tm.floorz;
thiscam->ceilingz = tm.ceilingz;
thiscam->floorz = g_tm.floorz;
thiscam->ceilingz = g_tm.ceilingz;
if (thiscam->momz || thiscam->pmomz)
{
@ -4029,8 +4029,8 @@ static void P_PlayerMobjThinker(mobj_t *mobj)
mobj->z += mobj->momz;
P_SetThingPosition(mobj);
P_CheckPosition(mobj, mobj->x, mobj->y, NULL);
mobj->floorz = tm.floorz;
mobj->ceilingz = tm.ceilingz;
mobj->floorz = g_tm.floorz;
mobj->ceilingz = g_tm.ceilingz;
mobj->terrain = NULL;
goto animonly;
}
@ -7159,7 +7159,7 @@ static boolean P_MobjRegularThink(mobj_t *mobj)
// the backdrop can also go transparent. EUUUAUUAUUAAAUUUUGGGHGHHHHHHHGSSS
if (mobj->extravalue1 > 0)
mobj->extravalue1--;
break;
}
case MT_ITEMCAPSULE:
@ -10166,8 +10166,8 @@ void P_MobjThinker(mobj_t *mobj)
mobj->eflags &= ~(MFE_PUSHED|MFE_SPRUNG|MFE_JUSTBOUNCEDWALL|MFE_DAMAGEHITLAG|MFE_SLOPELAUNCHED);
// sal: what the hell? is there any reason this isn't done, like, literally ANYWHERE else?
P_SetTarget(&tm.floorthing, NULL);
P_SetTarget(&tm.hitthing, NULL);
P_SetTarget(&g_tm.floorthing, NULL);
P_SetTarget(&g_tm.hitthing, NULL);
if (udmf)
{
@ -10520,10 +10520,10 @@ void P_SceneryThinker(mobj_t *mobj)
P_CheckPosition(mobj, mobj->x, mobj->y, NULL); // Need this to pick up objects!
if (P_MobjWasRemoved(mobj))
return;
mobj->floorz = tm.floorz;
mobj->ceilingz = tm.ceilingz;
mobj->floorrover = tm.floorrover;
mobj->ceilingrover = tm.ceilingrover;
mobj->floorz = g_tm.floorz;
mobj->ceilingz = g_tm.ceilingz;
mobj->floorrover = g_tm.floorrover;
mobj->ceilingrover = g_tm.ceilingrover;
}
else
{

View file

@ -763,7 +763,7 @@ static void Polyobj_removeFromBlockmap(polyobj_t *po)
// Movement functions
// A version of Lee's routine from p_maputl.c that accepts an mobj pointer
// argument instead of using tm.thing. Returns true if the line isn't contacted
// argument instead of using g_tm.thing. Returns true if the line isn't contacted
// and false otherwise.
static inline boolean Polyobj_untouched(line_t *ld, mobj_t *mo)
{
@ -807,10 +807,10 @@ static void Polyobj_pushThing(polyobj_t *po, line_t *line, mobj_t *mo)
if (po->damage && (mo->flags & MF_SHOOTABLE))
{
P_CheckPosition(mo, mo->x + momx, mo->y + momy, NULL);
mo->floorz = tm.floorz;
mo->ceilingz = tm.ceilingz;
mo->floorrover = tm.floorrover;
mo->ceilingrover = tm.ceilingrover;
mo->floorz = g_tm.floorz;
mo->ceilingz = g_tm.ceilingz;
mo->floorrover = g_tm.floorrover;
mo->ceilingrover = g_tm.ceilingrover;
}
}
@ -2199,7 +2199,7 @@ boolean EV_DoPolyObjWaypoint(polywaypointdata_t *pwdata)
R_CreateInterpolator_Polyobj(&th->thinker, po);
// T_PolyObjWaypoint is the only polyobject movement
// that can adjust z, so we add these ones too.
R_CreateInterpolator_SectorPlane(&th->thinker, po->lines[0]->backsector, false);
R_CreateInterpolator_SectorPlane(&th->thinker, po->lines[0]->backsector, false);
R_CreateInterpolator_SectorPlane(&th->thinker, po->lines[0]->backsector, true);
// Most other polyobject functions handle children by recursively

View file

@ -380,13 +380,13 @@ static boolean P_CanBotTraverse(seg_t *seg, divline_t *divl, register los_t *los
frac = P_InterceptVector2(&los->strace, divl);
// calculate position at intercept
tm.x = los->strace.x + FixedMul(los->strace.dx, frac);
tm.y = los->strace.y + FixedMul(los->strace.dy, frac);
g_tm.x = los->strace.x + FixedMul(los->strace.dx, frac);
g_tm.y = los->strace.y + FixedMul(los->strace.dy, frac);
// set openrange, opentop, openbottom
open.fofType = (flip ? LO_FOF_CEILINGS : LO_FOF_FLOORS);
P_LineOpening(line, los->t1, &open);
maxstep = P_GetThingStepUp(los->t1, tm.x, tm.y);
maxstep = P_GetThingStepUp(los->t1, g_tm.x, g_tm.y);
if (open.range < los->t1->height)
{
@ -408,7 +408,7 @@ static boolean P_CanBotTraverse(seg_t *seg, divline_t *divl, register los_t *los
UINT8 side = P_DivlineSide(los->t2x, los->t2y, divl) & 1;
sector_t *sector = (side == 1) ? seg->backsector : seg->frontsector;
if (K_BotHatesThisSector(los->t1->player, sector, tm.x, tm.y))
if (K_BotHatesThisSector(los->t1->player, sector, g_tm.x, g_tm.y))
{
// This line does not block us, but we don't want to cross it regardless.
return false;
@ -448,13 +448,13 @@ static boolean P_CanWaypointTraverse(seg_t *seg, divline_t *divl, register los_t
frac = P_InterceptVector2(&los->strace, divl);
// calculate position at intercept
tm.x = los->strace.x + FixedMul(los->strace.dx, frac);
tm.y = los->strace.y + FixedMul(los->strace.dy, frac);
g_tm.x = los->strace.x + FixedMul(los->strace.dx, frac);
g_tm.y = los->strace.y + FixedMul(los->strace.dy, frac);
// set openrange, opentop, openbottom
open.fofType = (flip ? LO_FOF_CEILINGS : LO_FOF_FLOORS);
P_LineOpening(line, los->t1, &open);
maxstep = P_GetThingStepUp(los->t1, tm.x, tm.y);
maxstep = P_GetThingStepUp(los->t1, g_tm.x, g_tm.y);
#if 0
if (los->t2->type == MT_WAYPOINT)