Browse Source

Padded some structs to make them 32-bit aligned

master
Nico de Poel 3 years ago
parent
commit
f6da144c6a
  1. 6
      main.cpp
  2. 6
      ps1bsp.h

6
main.cpp

@ -368,7 +368,7 @@ int process_faces(const world_t* world)
//if (face->ledge_num >= 10)
// export_lightmap(world, face, bounds, faceIdx);
outFace.numFaceVertices = (unsigned char)(outFaceVertices.size() - outFace.firstFaceVertex);
outFace.numFaceVertices = (unsigned short)(outFaceVertices.size() - outFace.firstFaceVertex);
outFaces.push_back(outFace);
}
@ -390,9 +390,9 @@ int process_faces(const world_t* world)
{
plane_t* plane = &world->planes[planeIdx];
ps1bsp_plane_t outPlane;
ps1bsp_plane_t outPlane = { 0 };
outPlane.normal = convertNormal(plane->normal);
outPlane.dist = (short)(plane->dist * 4);
outPlane.dist = (int)(plane->dist * 4);
outPlanes.push_back(outPlane);
}

6
ps1bsp.h

@ -66,13 +66,13 @@ typedef struct
typedef struct
{
unsigned short index;
unsigned char light;
unsigned short light;
} ps1bsp_facevertex_t;
typedef struct
{
unsigned short firstFaceVertex;
unsigned char numFaceVertices;
unsigned short numFaceVertices;
u_long drawFrame; // Which frame was this face last drawn on? Used to check if this face should be drawn.
} ps1bsp_face_t;
@ -80,7 +80,7 @@ typedef struct
typedef struct
{
SVECTOR normal;
short dist;
int dist;
} ps1bsp_plane_t;
typedef struct

Loading…
Cancel
Save