Rename R_IsPointInSubsector to R_PointInSubsectorOrNull/Nil
The old name made it really easy to accidentally read R_IsPointInSubsector as R_PointInSubsector, and anyway it didn't even make sense...
This commit is contained in:
parent
0d460aed1d
commit
fb28ede660
|
@ -2193,11 +2193,11 @@ static int lib_rPointInSubsector(lua_State *L)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lib_rIsPointInSubsector(lua_State *L)
|
static int lib_rPointInSubsectorOrNil(lua_State *L)
|
||||||
{
|
{
|
||||||
fixed_t x = luaL_checkfixed(L, 1);
|
fixed_t x = luaL_checkfixed(L, 1);
|
||||||
fixed_t y = luaL_checkfixed(L, 2);
|
fixed_t y = luaL_checkfixed(L, 2);
|
||||||
subsector_t *sub = R_IsPointInSubsector(x, y);
|
subsector_t *sub = R_PointInSubsectorOrNull(x, y);
|
||||||
//HUDSAFE
|
//HUDSAFE
|
||||||
INLEVEL
|
INLEVEL
|
||||||
if (sub)
|
if (sub)
|
||||||
|
@ -3141,7 +3141,7 @@ static luaL_Reg lib[] = {
|
||||||
{"R_PointToDist",lib_rPointToDist},
|
{"R_PointToDist",lib_rPointToDist},
|
||||||
{"R_PointToDist2",lib_rPointToDist2},
|
{"R_PointToDist2",lib_rPointToDist2},
|
||||||
{"R_PointInSubsector",lib_rPointInSubsector},
|
{"R_PointInSubsector",lib_rPointInSubsector},
|
||||||
{"R_IsPointInSubsector",lib_rIsPointInSubsector},
|
{"R_PointInSubsectorOrNil",lib_rPointInSubsectorOrNil},
|
||||||
|
|
||||||
// r_things (sprite)
|
// r_things (sprite)
|
||||||
{"R_Char2Frame",lib_rChar2Frame},
|
{"R_Char2Frame",lib_rChar2Frame},
|
||||||
|
|
|
@ -452,7 +452,7 @@ void Command_RTeleport_f(void)
|
||||||
else
|
else
|
||||||
inty = 0;
|
inty = 0;
|
||||||
|
|
||||||
ss = R_IsPointInSubsector(p->mo->x + intx*FRACUNIT, p->mo->y + inty*FRACUNIT);
|
ss = R_PointInSubsectorOrNull(p->mo->x + intx*FRACUNIT, p->mo->y + inty*FRACUNIT);
|
||||||
if (!ss || ss->sector->ceilingheight - ss->sector->floorheight < p->mo->height)
|
if (!ss || ss->sector->ceilingheight - ss->sector->floorheight < p->mo->height)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_NOTICE, M_GetText("Not a valid location.\n"));
|
CONS_Alert(CONS_NOTICE, M_GetText("Not a valid location.\n"));
|
||||||
|
@ -530,7 +530,7 @@ void Command_Teleport_f(void)
|
||||||
inty = mt->y<<FRACBITS;
|
inty = mt->y<<FRACBITS;
|
||||||
offset = mt->z<<FRACBITS;
|
offset = mt->z<<FRACBITS;
|
||||||
|
|
||||||
ss = R_IsPointInSubsector(intx, inty);
|
ss = R_PointInSubsectorOrNull(intx, inty);
|
||||||
if (!ss || ss->sector->ceilingheight - ss->sector->floorheight < p->mo->height)
|
if (!ss || ss->sector->ceilingheight - ss->sector->floorheight < p->mo->height)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_NOTICE, M_GetText("Spawnpoint not in a valid location.\n"));
|
CONS_Alert(CONS_NOTICE, M_GetText("Spawnpoint not in a valid location.\n"));
|
||||||
|
@ -597,7 +597,7 @@ void Command_Teleport_f(void)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ss = R_IsPointInSubsector(mo2->x, mo2->y);
|
ss = R_PointInSubsectorOrNull(mo2->x, mo2->y);
|
||||||
if (!ss || ss->sector->ceilingheight - ss->sector->floorheight < p->mo->height)
|
if (!ss || ss->sector->ceilingheight - ss->sector->floorheight < p->mo->height)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_NOTICE, M_GetText("Starpost not in a valid location.\n"));
|
CONS_Alert(CONS_NOTICE, M_GetText("Starpost not in a valid location.\n"));
|
||||||
|
@ -653,7 +653,7 @@ void Command_Teleport_f(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ss = R_IsPointInSubsector(intx, inty);
|
ss = R_PointInSubsectorOrNull(intx, inty);
|
||||||
if (!ss || ss->sector->ceilingheight - ss->sector->floorheight < p->mo->height)
|
if (!ss || ss->sector->ceilingheight - ss->sector->floorheight < p->mo->height)
|
||||||
{
|
{
|
||||||
CONS_Alert(CONS_NOTICE, M_GetText("Not a valid location.\n"));
|
CONS_Alert(CONS_NOTICE, M_GetText("Not a valid location.\n"));
|
||||||
|
|
|
@ -11114,7 +11114,7 @@ void P_SpawnPrecipitation(void)
|
||||||
x = basex + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
|
x = basex + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
|
||||||
y = basey + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
|
y = basey + ((M_RandomKey(MAPBLOCKUNITS<<3)<<FRACBITS)>>3);
|
||||||
|
|
||||||
precipsector = R_IsPointInSubsector(x, y);
|
precipsector = R_PointInSubsectorOrNull(x, y);
|
||||||
|
|
||||||
// No sector? Stop wasting time,
|
// No sector? Stop wasting time,
|
||||||
// move on to the next entry in the blockmap
|
// move on to the next entry in the blockmap
|
||||||
|
|
|
@ -3160,7 +3160,7 @@ static void P_DoClimbing(player_t *player)
|
||||||
platx = P_ReturnThrustX(player->mo, player->mo->angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale));
|
platx = P_ReturnThrustX(player->mo, player->mo->angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale));
|
||||||
platy = P_ReturnThrustY(player->mo, player->mo->angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale));
|
platy = P_ReturnThrustY(player->mo, player->mo->angle, player->mo->radius + FixedMul(8*FRACUNIT, player->mo->scale));
|
||||||
|
|
||||||
glidesector = R_IsPointInSubsector(player->mo->x + platx, player->mo->y + platy);
|
glidesector = R_PointInSubsectorOrNull(player->mo->x + platx, player->mo->y + platy);
|
||||||
|
|
||||||
{
|
{
|
||||||
boolean floorclimb = false;
|
boolean floorclimb = false;
|
||||||
|
@ -10235,7 +10235,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall
|
||||||
}
|
}
|
||||||
|
|
||||||
// move camera down to move under lower ceilings
|
// move camera down to move under lower ceilings
|
||||||
newsubsec = R_IsPointInSubsector(((mo->x>>FRACBITS) + (thiscam->x>>FRACBITS))<<(FRACBITS-1), ((mo->y>>FRACBITS) + (thiscam->y>>FRACBITS))<<(FRACBITS-1));
|
newsubsec = R_PointInSubsectorOrNull(((mo->x>>FRACBITS) + (thiscam->x>>FRACBITS))<<(FRACBITS-1), ((mo->y>>FRACBITS) + (thiscam->y>>FRACBITS))<<(FRACBITS-1));
|
||||||
|
|
||||||
if (!newsubsec)
|
if (!newsubsec)
|
||||||
newsubsec = thiscam->subsector;
|
newsubsec = thiscam->subsector;
|
||||||
|
|
|
@ -701,9 +701,9 @@ subsector_t *R_PointInSubsector(fixed_t x, fixed_t y)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// R_IsPointInSubsector, same as above but returns 0 if not in subsector
|
// R_PointInSubsectorOrNull, same as above but returns 0 if not in subsector
|
||||||
//
|
//
|
||||||
subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y)
|
subsector_t *R_PointInSubsectorOrNull(fixed_t x, fixed_t y)
|
||||||
{
|
{
|
||||||
node_t *node;
|
node_t *node;
|
||||||
INT32 side, i;
|
INT32 side, i;
|
||||||
|
|
|
@ -64,7 +64,7 @@ fixed_t R_PointToDist2(fixed_t px2, fixed_t py2, fixed_t px1, fixed_t py1);
|
||||||
|
|
||||||
fixed_t R_ScaleFromGlobalAngle(angle_t visangle);
|
fixed_t R_ScaleFromGlobalAngle(angle_t visangle);
|
||||||
subsector_t *R_PointInSubsector(fixed_t x, fixed_t y);
|
subsector_t *R_PointInSubsector(fixed_t x, fixed_t y);
|
||||||
subsector_t *R_IsPointInSubsector(fixed_t x, fixed_t y);
|
subsector_t *R_PointInSubsectorOrNull(fixed_t x, fixed_t y);
|
||||||
|
|
||||||
boolean R_DoCulling(line_t *cullheight, line_t *viewcullheight, fixed_t vz, fixed_t bottomh, fixed_t toph);
|
boolean R_DoCulling(line_t *cullheight, line_t *viewcullheight, fixed_t vz, fixed_t bottomh, fixed_t toph);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue