- Changed all thing coordinates that were stored as shorts into fixed_t.
- Separated mapthing2_t into mapthinghexen_t and the internal FMapThing so that it is easier to add new features in the UDMF map format. - Added some initial code to read UDMF maps. SVN r956 (trunk)
This commit is contained in:
parent
80aebe9044
commit
d5563fe478
19 changed files with 340 additions and 170 deletions
|
|
@ -414,7 +414,7 @@ void AActor::Serialize (FArchive &arc)
|
|||
}
|
||||
}
|
||||
|
||||
void MapThing::Serialize (FArchive &arc)
|
||||
void FMapThing::Serialize (FArchive &arc)
|
||||
{
|
||||
arc << thingid << x << y << z << angle << type << flags << special
|
||||
<< args[0] << args[1] << args[2] << args[3] << args[4];
|
||||
|
|
@ -2185,19 +2185,19 @@ void P_NightmareRespawn (AActor *mobj)
|
|||
else if (info->flags2 & MF2_SPAWNFLOAT)
|
||||
z = FLOATRANDZ;
|
||||
else if (info->flags2 & MF2_FLOATBOB)
|
||||
z = mobj->SpawnPoint[2] << FRACBITS;
|
||||
z = mobj->SpawnPoint[2];
|
||||
else
|
||||
z = ONFLOORZ;
|
||||
|
||||
// spawn it
|
||||
x = mobj->SpawnPoint[0] << FRACBITS;
|
||||
y = mobj->SpawnPoint[1] << FRACBITS;
|
||||
x = mobj->SpawnPoint[0];
|
||||
y = mobj->SpawnPoint[1];
|
||||
mo = Spawn (RUNTIME_TYPE(mobj), x, y, z, NO_REPLACE);
|
||||
|
||||
if (z == ONFLOORZ)
|
||||
mo->z += mo->SpawnPoint[2] << FRACBITS;
|
||||
mo->z += mo->SpawnPoint[2];
|
||||
else if (z == ONCEILINGZ)
|
||||
mo->z -= mo->SpawnPoint[2] << FRACBITS;
|
||||
mo->z -= mo->SpawnPoint[2];
|
||||
|
||||
// something is occupying its position?
|
||||
if (!P_TestMobjLocation (mo))
|
||||
|
|
@ -3252,8 +3252,8 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
|
|||
actor->ceilingsector = actor->Sector;
|
||||
}
|
||||
|
||||
actor->SpawnPoint[0] = ix >> FRACBITS;
|
||||
actor->SpawnPoint[1] = iy >> FRACBITS;
|
||||
actor->SpawnPoint[0] = ix;
|
||||
actor->SpawnPoint[1] = iy;
|
||||
|
||||
if (iz == ONFLOORZ)
|
||||
{
|
||||
|
|
@ -3278,7 +3278,7 @@ AActor *AActor::StaticSpawn (const PClass *type, fixed_t ix, fixed_t iy, fixed_t
|
|||
}
|
||||
else
|
||||
{
|
||||
actor->SpawnPoint[2] = (actor->z - actor->floorz) >> FRACBITS;
|
||||
actor->SpawnPoint[2] = (actor->z - actor->floorz);
|
||||
}
|
||||
|
||||
if (actor->flags2 & MF2_FLOATBOB)
|
||||
|
|
@ -3500,7 +3500,7 @@ EXTERN_CVAR (Bool, chasedemo)
|
|||
|
||||
extern bool demonew;
|
||||
|
||||
APlayerPawn *P_SpawnPlayer (mapthing2_t *mthing, bool tempplayer)
|
||||
APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer)
|
||||
{
|
||||
int playernum;
|
||||
player_t *p;
|
||||
|
|
@ -3571,8 +3571,8 @@ APlayerPawn *P_SpawnPlayer (mapthing2_t *mthing, bool tempplayer)
|
|||
}
|
||||
else
|
||||
{
|
||||
spawn_x = mthing->x << FRACBITS;
|
||||
spawn_y = mthing->y << FRACBITS;
|
||||
spawn_x = mthing->x;
|
||||
spawn_y = mthing->y;
|
||||
spawn_angle = ANG45 * (mthing->angle/45);
|
||||
}
|
||||
|
||||
|
|
@ -3738,7 +3738,7 @@ APlayerPawn *P_SpawnPlayer (mapthing2_t *mthing, bool tempplayer)
|
|||
// already be in host byte order.
|
||||
//
|
||||
// [RH] position is used to weed out unwanted start spots
|
||||
AActor *P_SpawnMapThing (mapthing2_t *mthing, int position)
|
||||
AActor *P_SpawnMapThing (FMapThing *mthing, int position)
|
||||
{
|
||||
const PClass *i;
|
||||
int mask;
|
||||
|
|
@ -3786,8 +3786,8 @@ AActor *P_SpawnMapThing (mapthing2_t *mthing, int position)
|
|||
{
|
||||
polyspawns_t *polyspawn = new polyspawns_t;
|
||||
polyspawn->next = polyspawns;
|
||||
polyspawn->x = mthing->x << FRACBITS;
|
||||
polyspawn->y = mthing->y << FRACBITS;
|
||||
polyspawn->x = mthing->x;
|
||||
polyspawn->y = mthing->y;
|
||||
polyspawn->angle = mthing->angle;
|
||||
polyspawn->type = mthing->type;
|
||||
polyspawns = polyspawn;
|
||||
|
|
@ -3888,8 +3888,7 @@ AActor *P_SpawnMapThing (mapthing2_t *mthing, int position)
|
|||
// [RH] sound sequence overriders
|
||||
if (mthing->type >= 1400 && mthing->type < 1410)
|
||||
{
|
||||
P_PointInSector (mthing->x<<FRACBITS,
|
||||
mthing->y<<FRACBITS)->seqType = mthing->type - 1400;
|
||||
P_PointInSector (mthing->x, mthing->y)->seqType = mthing->type - 1400;
|
||||
return NULL;
|
||||
}
|
||||
else if (mthing->type == 1411)
|
||||
|
|
@ -3907,8 +3906,7 @@ AActor *P_SpawnMapThing (mapthing2_t *mthing, int position)
|
|||
}
|
||||
else
|
||||
{
|
||||
P_PointInSector (mthing->x << FRACBITS,
|
||||
mthing->y << FRACBITS)->seqType = type;
|
||||
P_PointInSector (mthing->x, mthing->y)->seqType = type;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -3932,7 +3930,7 @@ AActor *P_SpawnMapThing (mapthing2_t *mthing, int position)
|
|||
// [RH] Don't die if the map tries to spawn an unknown thing
|
||||
Printf ("Unknown type %i at (%i, %i)\n",
|
||||
mthing->type,
|
||||
mthing->x, mthing->y);
|
||||
mthing->x>>FRACBITS, mthing->y>>FRACBITS);
|
||||
i = PClass::FindClass("Unknown");
|
||||
}
|
||||
// [RH] If the thing's corresponding sprite has no frames, also map
|
||||
|
|
@ -3948,7 +3946,7 @@ AActor *P_SpawnMapThing (mapthing2_t *mthing, int position)
|
|||
sprites[defaults->SpawnState->sprite.index].numframes == 0)
|
||||
{
|
||||
Printf ("%s at (%i, %i) has no frames\n",
|
||||
i->TypeName.GetChars(), mthing->x, mthing->y);
|
||||
i->TypeName.GetChars(), mthing->x>>FRACBITS, mthing->y>>FRACBITS);
|
||||
i = PClass::FindClass("Unknown");
|
||||
}
|
||||
}
|
||||
|
|
@ -4002,8 +4000,8 @@ AActor *P_SpawnMapThing (mapthing2_t *mthing, int position)
|
|||
}
|
||||
|
||||
// spawn it
|
||||
x = mthing->x << FRACBITS;
|
||||
y = mthing->y << FRACBITS;
|
||||
x = mthing->x;
|
||||
y = mthing->y;
|
||||
|
||||
if (info->flags & MF_SPAWNCEILING)
|
||||
z = ONCEILINGZ;
|
||||
|
|
@ -4017,9 +4015,9 @@ AActor *P_SpawnMapThing (mapthing2_t *mthing, int position)
|
|||
SpawningMapThing = false;
|
||||
|
||||
if (z == ONFLOORZ)
|
||||
mobj->z += mthing->z << FRACBITS;
|
||||
mobj->z += mthing->z;
|
||||
else if (z == ONCEILINGZ)
|
||||
mobj->z -= mthing->z << FRACBITS;
|
||||
mobj->z -= mthing->z;
|
||||
|
||||
mobj->SpawnPoint[0] = mthing->x;
|
||||
mobj->SpawnPoint[1] = mthing->y;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue