Merge branch 'udmf-next' into udmf-multitag
# Conflicts: # src/doomdata.h # src/p_setup.c
This commit is contained in:
commit
de3ad9bc43
|
@ -24,6 +24,7 @@
|
||||||
#include "doomdef.h"
|
#include "doomdef.h"
|
||||||
|
|
||||||
#include "taglist.h"
|
#include "taglist.h"
|
||||||
|
#include "m_fixed.h" // See the mapthing_t scale.
|
||||||
|
|
||||||
//
|
//
|
||||||
// Map level types.
|
// Map level types.
|
||||||
|
@ -200,12 +201,13 @@ typedef struct
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
INT16 x, y;
|
INT16 x, y;
|
||||||
INT16 angle;
|
INT16 angle, pitch, roll;
|
||||||
UINT16 type;
|
UINT16 type;
|
||||||
UINT16 options;
|
UINT16 options;
|
||||||
INT16 z;
|
INT16 z;
|
||||||
UINT8 extrainfo;
|
UINT8 extrainfo;
|
||||||
taglist_t tags;
|
taglist_t tags;
|
||||||
|
fixed_t scale;
|
||||||
struct mobj_s *mobj;
|
struct mobj_s *mobj;
|
||||||
} mapthing_t;
|
} mapthing_t;
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@ enum mobj_e {
|
||||||
mobj_snext,
|
mobj_snext,
|
||||||
mobj_sprev,
|
mobj_sprev,
|
||||||
mobj_angle,
|
mobj_angle,
|
||||||
|
mobj_pitch,
|
||||||
|
mobj_roll,
|
||||||
mobj_rollangle,
|
mobj_rollangle,
|
||||||
mobj_sprite,
|
mobj_sprite,
|
||||||
mobj_frame,
|
mobj_frame,
|
||||||
|
@ -97,6 +99,8 @@ static const char *const mobj_opt[] = {
|
||||||
"snext",
|
"snext",
|
||||||
"sprev",
|
"sprev",
|
||||||
"angle",
|
"angle",
|
||||||
|
"pitch",
|
||||||
|
"roll",
|
||||||
"rollangle",
|
"rollangle",
|
||||||
"sprite",
|
"sprite",
|
||||||
"frame",
|
"frame",
|
||||||
|
@ -198,6 +202,12 @@ static int mobj_get(lua_State *L)
|
||||||
case mobj_angle:
|
case mobj_angle:
|
||||||
lua_pushangle(L, mo->angle);
|
lua_pushangle(L, mo->angle);
|
||||||
break;
|
break;
|
||||||
|
case mobj_pitch:
|
||||||
|
lua_pushangle(L, mo->pitch);
|
||||||
|
break;
|
||||||
|
case mobj_roll:
|
||||||
|
lua_pushangle(L, mo->roll);
|
||||||
|
break;
|
||||||
case mobj_rollangle:
|
case mobj_rollangle:
|
||||||
lua_pushangle(L, mo->rollangle);
|
lua_pushangle(L, mo->rollangle);
|
||||||
break;
|
break;
|
||||||
|
@ -453,6 +463,11 @@ static int mobj_set(lua_State *L)
|
||||||
localangle = mo->angle;
|
localangle = mo->angle;
|
||||||
else if (mo->player == &players[secondarydisplayplayer])
|
else if (mo->player == &players[secondarydisplayplayer])
|
||||||
localangle2 = mo->angle;
|
localangle2 = mo->angle;
|
||||||
|
case mobj_pitch:
|
||||||
|
mo->pitch = luaL_checkangle(L, 3);
|
||||||
|
break;
|
||||||
|
case mobj_roll:
|
||||||
|
mo->roll = luaL_checkangle(L, 3);
|
||||||
break;
|
break;
|
||||||
case mobj_rollangle:
|
case mobj_rollangle:
|
||||||
mo->rollangle = luaL_checkangle(L, 3);
|
mo->rollangle = luaL_checkangle(L, 3);
|
||||||
|
@ -771,10 +786,16 @@ static int mapthing_get(lua_State *L)
|
||||||
number = mt->y;
|
number = mt->y;
|
||||||
else if(fastcmp(field,"angle"))
|
else if(fastcmp(field,"angle"))
|
||||||
number = mt->angle;
|
number = mt->angle;
|
||||||
|
else if(fastcmp(field,"pitch"))
|
||||||
|
number = mt->pitch;
|
||||||
|
else if(fastcmp(field,"roll"))
|
||||||
|
number = mt->roll;
|
||||||
else if(fastcmp(field,"type"))
|
else if(fastcmp(field,"type"))
|
||||||
number = mt->type;
|
number = mt->type;
|
||||||
else if(fastcmp(field,"options"))
|
else if(fastcmp(field,"options"))
|
||||||
number = mt->options;
|
number = mt->options;
|
||||||
|
else if(fastcmp(field,"scale"))
|
||||||
|
number = mt->scale;
|
||||||
else if(fastcmp(field,"z"))
|
else if(fastcmp(field,"z"))
|
||||||
number = mt->z;
|
number = mt->z;
|
||||||
else if(fastcmp(field,"extrainfo"))
|
else if(fastcmp(field,"extrainfo"))
|
||||||
|
@ -810,10 +831,16 @@ static int mapthing_set(lua_State *L)
|
||||||
mt->y = (INT16)luaL_checkinteger(L, 3);
|
mt->y = (INT16)luaL_checkinteger(L, 3);
|
||||||
else if(fastcmp(field,"angle"))
|
else if(fastcmp(field,"angle"))
|
||||||
mt->angle = (INT16)luaL_checkinteger(L, 3);
|
mt->angle = (INT16)luaL_checkinteger(L, 3);
|
||||||
|
else if(fastcmp(field,"pitch"))
|
||||||
|
mt->pitch = (INT16)luaL_checkinteger(L, 3);
|
||||||
|
else if(fastcmp(field,"roll"))
|
||||||
|
mt->roll = (INT16)luaL_checkinteger(L, 3);
|
||||||
else if(fastcmp(field,"type"))
|
else if(fastcmp(field,"type"))
|
||||||
mt->type = (UINT16)luaL_checkinteger(L, 3);
|
mt->type = (UINT16)luaL_checkinteger(L, 3);
|
||||||
else if(fastcmp(field,"options"))
|
else if(fastcmp(field,"options"))
|
||||||
mt->options = (UINT16)luaL_checkinteger(L, 3);
|
mt->options = (UINT16)luaL_checkinteger(L, 3);
|
||||||
|
else if(fastcmp(field,"scale"))
|
||||||
|
mt->scale = luaL_checkfixed(L, 3);
|
||||||
else if(fastcmp(field,"z"))
|
else if(fastcmp(field,"z"))
|
||||||
mt->z = (INT16)luaL_checkinteger(L, 3);
|
mt->z = (INT16)luaL_checkinteger(L, 3);
|
||||||
else if(fastcmp(field,"extrainfo"))
|
else if(fastcmp(field,"extrainfo"))
|
||||||
|
|
20
src/p_mobj.c
20
src/p_mobj.c
|
@ -11618,7 +11618,7 @@ void P_MovePlayerToStarpost(INT32 playernum)
|
||||||
mapthing_t *huntemeralds[MAXHUNTEMERALDS];
|
mapthing_t *huntemeralds[MAXHUNTEMERALDS];
|
||||||
INT32 numhuntemeralds;
|
INT32 numhuntemeralds;
|
||||||
|
|
||||||
static fixed_t P_GetMobjSpawnHeight(const mobjtype_t mobjtype, const fixed_t x, const fixed_t y, const fixed_t offset, const boolean flip)
|
static fixed_t P_GetMobjSpawnHeight(const mobjtype_t mobjtype, const fixed_t x, const fixed_t y, const fixed_t offset, const boolean flip, const fixed_t scale)
|
||||||
{
|
{
|
||||||
const subsector_t *ss = R_PointInSubsector(x, y);
|
const subsector_t *ss = R_PointInSubsector(x, y);
|
||||||
|
|
||||||
|
@ -11629,10 +11629,10 @@ static fixed_t P_GetMobjSpawnHeight(const mobjtype_t mobjtype, const fixed_t x,
|
||||||
// Establish height.
|
// Establish height.
|
||||||
if (flip)
|
if (flip)
|
||||||
return (ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) : ss->sector->ceilingheight)
|
return (ss->sector->c_slope ? P_GetZAt(ss->sector->c_slope, x, y) : ss->sector->ceilingheight)
|
||||||
- offset - mobjinfo[mobjtype].height;
|
- FixedMul(scale, offset + mobjinfo[mobjtype].height);
|
||||||
else
|
else
|
||||||
return (ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) : ss->sector->floorheight)
|
return (ss->sector->f_slope ? P_GetZAt(ss->sector->f_slope, x, y) : ss->sector->floorheight)
|
||||||
+ offset;
|
+ FixedMul(scale, offset);
|
||||||
}
|
}
|
||||||
|
|
||||||
static fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthing_t* mthing, const fixed_t x, const fixed_t y)
|
static fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthing_t* mthing, const fixed_t x, const fixed_t y)
|
||||||
|
@ -11703,7 +11703,7 @@ static fixed_t P_GetMapThingSpawnHeight(const mobjtype_t mobjtype, const mapthin
|
||||||
return ONFLOORZ;
|
return ONFLOORZ;
|
||||||
}
|
}
|
||||||
|
|
||||||
return P_GetMobjSpawnHeight(mobjtype, x, y, offset, flip);
|
return P_GetMobjSpawnHeight(mobjtype, x, y, offset, flip, mthing->scale);
|
||||||
}
|
}
|
||||||
|
|
||||||
static boolean P_SpawnNonMobjMapThing(mapthing_t *mthing)
|
static boolean P_SpawnNonMobjMapThing(mapthing_t *mthing)
|
||||||
|
@ -13081,12 +13081,18 @@ static mobj_t *P_SpawnMobjFromMapThing(mapthing_t *mthing, fixed_t x, fixed_t y,
|
||||||
mobj = P_SpawnMobj(x, y, z, i);
|
mobj = P_SpawnMobj(x, y, z, i);
|
||||||
mobj->spawnpoint = mthing;
|
mobj->spawnpoint = mthing;
|
||||||
|
|
||||||
|
P_SetScale(mobj, mthing->scale);
|
||||||
|
mobj->destscale = mthing->scale;
|
||||||
|
|
||||||
if (!P_SetupSpawnedMapThing(mthing, mobj, &doangle))
|
if (!P_SetupSpawnedMapThing(mthing, mobj, &doangle))
|
||||||
return mobj;
|
return mobj;
|
||||||
|
|
||||||
if (doangle)
|
if (doangle)
|
||||||
mobj->angle = FixedAngle(mthing->angle << FRACBITS);
|
mobj->angle = FixedAngle(mthing->angle << FRACBITS);
|
||||||
|
|
||||||
|
mobj->pitch = FixedAngle(mthing->pitch << FRACBITS);
|
||||||
|
mobj->roll = FixedAngle(mthing->roll << FRACBITS);
|
||||||
|
|
||||||
mthing->mobj = mobj;
|
mthing->mobj = mobj;
|
||||||
|
|
||||||
// ignore MTF_ flags and return early
|
// ignore MTF_ flags and return early
|
||||||
|
@ -13183,7 +13189,7 @@ static void P_SpawnHoopInternal(mapthing_t *mthing, INT32 hoopsize, fixed_t size
|
||||||
TVector v, *res;
|
TVector v, *res;
|
||||||
fixed_t x = mthing->x << FRACBITS;
|
fixed_t x = mthing->x << FRACBITS;
|
||||||
fixed_t y = mthing->y << FRACBITS;
|
fixed_t y = mthing->y << FRACBITS;
|
||||||
fixed_t z = P_GetMobjSpawnHeight(MT_HOOP, x, y, mthing->z << FRACBITS, false);
|
fixed_t z = P_GetMobjSpawnHeight(MT_HOOP, x, y, mthing->z << FRACBITS, false, mthing->scale);
|
||||||
|
|
||||||
hoopcenter = P_SpawnMobj(x, y, z, MT_HOOPCENTER);
|
hoopcenter = P_SpawnMobj(x, y, z, MT_HOOPCENTER);
|
||||||
hoopcenter->spawnpoint = mthing;
|
hoopcenter->spawnpoint = mthing;
|
||||||
|
@ -13328,7 +13334,7 @@ static void P_SpawnItemRow(mapthing_t *mthing, mobjtype_t* itemtypes, UINT8 numi
|
||||||
itemtypes[r] = P_GetMobjtypeSubstitute(&dummything, itemtypes[r]);
|
itemtypes[r] = P_GetMobjtypeSubstitute(&dummything, itemtypes[r]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
z = P_GetMobjSpawnHeight(itemtypes[0], x, y, z, mthing->options & MTF_OBJECTFLIP);
|
z = P_GetMobjSpawnHeight(itemtypes[0], x, y, z, mthing->options & MTF_OBJECTFLIP, mthing->scale);
|
||||||
|
|
||||||
for (r = 0; r < numitems; r++)
|
for (r = 0; r < numitems; r++)
|
||||||
{
|
{
|
||||||
|
@ -13386,7 +13392,7 @@ static void P_SpawnItemCircle(mapthing_t *mthing, mobjtype_t *itemtypes, UINT8 n
|
||||||
itemtypes[i] = P_GetMobjtypeSubstitute(&dummything, itemtypes[i]);
|
itemtypes[i] = P_GetMobjtypeSubstitute(&dummything, itemtypes[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
z = P_GetMobjSpawnHeight(itemtypes[0], x, y, z, false);
|
z = P_GetMobjSpawnHeight(itemtypes[0], x, y, z, false, mthing->scale);
|
||||||
|
|
||||||
for (i = 0; i < numitems; i++)
|
for (i = 0; i < numitems; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -278,7 +278,7 @@ typedef struct mobj_s
|
||||||
struct mobj_s **sprev; // killough 8/11/98: change to ptr-to-ptr
|
struct mobj_s **sprev; // killough 8/11/98: change to ptr-to-ptr
|
||||||
|
|
||||||
// More drawing info: to determine current sprite.
|
// More drawing info: to determine current sprite.
|
||||||
angle_t angle; // orientation
|
angle_t angle, pitch, roll; // orientation
|
||||||
angle_t rollangle;
|
angle_t rollangle;
|
||||||
spritenum_t sprite; // used to find patch_t and flip value
|
spritenum_t sprite; // used to find patch_t and flip value
|
||||||
UINT32 frame; // frame number, plus bits see p_pspr.h
|
UINT32 frame; // frame number, plus bits see p_pspr.h
|
||||||
|
@ -398,7 +398,7 @@ typedef struct precipmobj_s
|
||||||
struct precipmobj_s **sprev; // killough 8/11/98: change to ptr-to-ptr
|
struct precipmobj_s **sprev; // killough 8/11/98: change to ptr-to-ptr
|
||||||
|
|
||||||
// More drawing info: to determine current sprite.
|
// More drawing info: to determine current sprite.
|
||||||
angle_t angle; // orientation
|
angle_t angle, pitch, roll; // orientation
|
||||||
angle_t rollangle;
|
angle_t rollangle;
|
||||||
spritenum_t sprite; // used to find patch_t and flip value
|
spritenum_t sprite; // used to find patch_t and flip value
|
||||||
UINT32 frame; // frame number, plus bits see p_pspr.h
|
UINT32 frame; // frame number, plus bits see p_pspr.h
|
||||||
|
|
|
@ -1463,7 +1463,9 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
||||||
|
|
||||||
if ((mobj->x != mobj->spawnpoint->x << FRACBITS) ||
|
if ((mobj->x != mobj->spawnpoint->x << FRACBITS) ||
|
||||||
(mobj->y != mobj->spawnpoint->y << FRACBITS) ||
|
(mobj->y != mobj->spawnpoint->y << FRACBITS) ||
|
||||||
(mobj->angle != FixedAngle(mobj->spawnpoint->angle*FRACUNIT)))
|
(mobj->angle != FixedAngle(mobj->spawnpoint->angle*FRACUNIT)) ||
|
||||||
|
(mobj->pitch != FixedAngle(mobj->spawnpoint->pitch*FRACUNIT)) ||
|
||||||
|
(mobj->roll != FixedAngle(mobj->spawnpoint->roll*FRACUNIT)) )
|
||||||
diff |= MD_POS;
|
diff |= MD_POS;
|
||||||
|
|
||||||
if (mobj->info->doomednum != mobj->spawnpoint->type)
|
if (mobj->info->doomednum != mobj->spawnpoint->type)
|
||||||
|
@ -1645,6 +1647,8 @@ static void SaveMobjThinker(const thinker_t *th, const UINT8 type)
|
||||||
WRITEFIXED(save_p, mobj->x);
|
WRITEFIXED(save_p, mobj->x);
|
||||||
WRITEFIXED(save_p, mobj->y);
|
WRITEFIXED(save_p, mobj->y);
|
||||||
WRITEANGLE(save_p, mobj->angle);
|
WRITEANGLE(save_p, mobj->angle);
|
||||||
|
WRITEANGLE(save_p, mobj->pitch);
|
||||||
|
WRITEANGLE(save_p, mobj->roll);
|
||||||
}
|
}
|
||||||
if (diff & MD_MOM)
|
if (diff & MD_MOM)
|
||||||
{
|
{
|
||||||
|
@ -2661,12 +2665,16 @@ static thinker_t* LoadMobjThinker(actionf_p1 thinker)
|
||||||
mobj->x = READFIXED(save_p);
|
mobj->x = READFIXED(save_p);
|
||||||
mobj->y = READFIXED(save_p);
|
mobj->y = READFIXED(save_p);
|
||||||
mobj->angle = READANGLE(save_p);
|
mobj->angle = READANGLE(save_p);
|
||||||
|
mobj->pitch = READANGLE(save_p);
|
||||||
|
mobj->roll = READANGLE(save_p);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
mobj->x = mobj->spawnpoint->x << FRACBITS;
|
mobj->x = mobj->spawnpoint->x << FRACBITS;
|
||||||
mobj->y = mobj->spawnpoint->y << FRACBITS;
|
mobj->y = mobj->spawnpoint->y << FRACBITS;
|
||||||
mobj->angle = FixedAngle(mobj->spawnpoint->angle*FRACUNIT);
|
mobj->angle = FixedAngle(mobj->spawnpoint->angle*FRACUNIT);
|
||||||
|
mobj->pitch = FixedAngle(mobj->spawnpoint->pitch*FRACUNIT);
|
||||||
|
mobj->roll = FixedAngle(mobj->spawnpoint->roll*FRACUNIT);
|
||||||
}
|
}
|
||||||
if (diff & MD_MOM)
|
if (diff & MD_MOM)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1281,6 +1281,8 @@ static void P_LoadThings(UINT8 *data)
|
||||||
mt->options = READUINT16(data);
|
mt->options = READUINT16(data);
|
||||||
mt->extrainfo = (UINT8)(mt->type >> 12);
|
mt->extrainfo = (UINT8)(mt->type >> 12);
|
||||||
Tag_FSet(&mt->tags, 0);
|
Tag_FSet(&mt->tags, 0);
|
||||||
|
mt->scale = FRACUNIT;
|
||||||
|
mt->pitch = mt->roll = 0;
|
||||||
|
|
||||||
mt->type &= 4095;
|
mt->type &= 4095;
|
||||||
|
|
||||||
|
@ -1597,9 +1599,14 @@ static void ParseTextmapThingParameter(UINT32 i, char *param, char *val)
|
||||||
mapthings[i].z = atol(val);
|
mapthings[i].z = atol(val);
|
||||||
else if (fastcmp(param, "angle"))
|
else if (fastcmp(param, "angle"))
|
||||||
mapthings[i].angle = atol(val);
|
mapthings[i].angle = atol(val);
|
||||||
|
else if (fastcmp(param, "pitch"))
|
||||||
|
mapthings[i].pitch = atol(val);
|
||||||
|
else if (fastcmp(param, "roll"))
|
||||||
|
mapthings[i].roll = atol(val);
|
||||||
else if (fastcmp(param, "type"))
|
else if (fastcmp(param, "type"))
|
||||||
mapthings[i].type = atol(val);
|
mapthings[i].type = atol(val);
|
||||||
|
else if (fastcmp(param, "scale") || fastcmp(param, "scalex") || fastcmp(param, "scaley"))
|
||||||
|
mapthings[i].scale = FLOAT_TO_FIXED(atof(val));
|
||||||
// Flags
|
// Flags
|
||||||
else if (fastcmp(param, "extra") && fastcmp("true", val))
|
else if (fastcmp(param, "extra") && fastcmp("true", val))
|
||||||
mapthings[i].options |= MTF_EXTRA;
|
mapthings[i].options |= MTF_EXTRA;
|
||||||
|
@ -1809,6 +1816,7 @@ static void P_LoadTextmap(void)
|
||||||
mt->z = 0;
|
mt->z = 0;
|
||||||
mt->extrainfo = 0;
|
mt->extrainfo = 0;
|
||||||
Tag_FSet(&mt->tags, 0);
|
Tag_FSet(&mt->tags, 0);
|
||||||
|
mt->scale = FRACUNIT;
|
||||||
mt->mobj = NULL;
|
mt->mobj = NULL;
|
||||||
|
|
||||||
TextmapParse(mapthingsPos[i], i, ParseTextmapThingParameter);
|
TextmapParse(mapthingsPos[i], i, ParseTextmapThingParameter);
|
||||||
|
|
Loading…
Reference in New Issue