- use a method for setting wall coordinates when loading a map.

This commit is contained in:
Christoph Oelckers 2022-01-27 18:03:59 +01:00
parent f44736a5b6
commit bc0e8b4a8d
3 changed files with 13 additions and 8 deletions

View file

@ -178,8 +178,9 @@ static void ReadSectorV5(FileReader& fr, sectortype& sect)
static void ReadWallV7(FileReader& fr, walltype& wall)
{
wall.__wall_int_pos.X = fr.ReadInt32();
wall.__wall_int_pos.Y = fr.ReadInt32();
int x = fr.ReadInt32();
int y = fr.ReadInt32();
wall.setPosFromLoad(x, y);
wall.point2 = fr.ReadInt16();
wall.nextwall = fr.ReadInt16();
wall.nextsector = fr.ReadInt16();
@ -199,8 +200,9 @@ static void ReadWallV7(FileReader& fr, walltype& wall)
static void ReadWallV6(FileReader& fr, walltype& wall)
{
wall.__wall_int_pos.X = fr.ReadInt32();
wall.__wall_int_pos.Y = fr.ReadInt32();
int x = fr.ReadInt32();
int y = fr.ReadInt32();
wall.setPosFromLoad(x, y);
wall.point2 = fr.ReadInt16();
wall.nextsector = fr.ReadInt16();
wall.nextwall = fr.ReadInt16();
@ -220,8 +222,9 @@ static void ReadWallV6(FileReader& fr, walltype& wall)
static void ReadWallV5(FileReader& fr, walltype& wall)
{
wall.__wall_int_pos.X = fr.ReadInt32();
wall.__wall_int_pos.Y = fr.ReadInt32();
int x = fr.ReadInt32();
int y = fr.ReadInt32();
wall.setPosFromLoad(x, y);
wall.point2 = fr.ReadInt16();
wall.picnum = fr.ReadInt16();
wall.overpicnum = fr.ReadInt16();

View file

@ -361,6 +361,7 @@ struct walltype
vec2_t __wall_int_pos;
const vec2_t wall_int_pos() const { return __wall_int_pos; }
void setPosFromLoad(int x, int y) { __wall_int_pos = { x, y }; }
int32_t point2;
int32_t nextwall;

View file

@ -392,8 +392,9 @@ void dbLoadMap(const char* pPath, int* pX, int* pY, int* pZ, short* pAngle, int*
{
dbCrypt((char*)&load, sizeof(walltypedisk), (gMapRev * sizeof(sectortypedisk)) | 0x7474614d);
}
pWall->__wall_int_pos.X = LittleLong(load.x);
pWall->__wall_int_pos.Y = LittleLong(load.y);
int x = LittleLong(load.x);
int y = LittleLong(load.y);
pWall->setPosFromLoad(x, y);
pWall->point2 = LittleShort(load.point2);
pWall->nextwall = LittleShort(load.nextwall);
pWall->nextsector = LittleShort(load.nextsector);