Browse Source

Reorganized poly vertex data structure to allow for faster copying in the PS1 code

master
Nico de Poel 3 years ago
parent
commit
45796822cd
  1. 2
      main.cpp
  2. 4
      ps1bsp.h

2
main.cpp

@ -235,7 +235,7 @@ int process_faces(const world_t* world, const TextureList& textures)
if (light > 255)
light = 255;
polyVert.light = (unsigned short)light;
polyVert.r = polyVert.g = polyVert.b = (unsigned char)light;
outPolyVertices.push_back(polyVert);
}

4
ps1bsp.h

@ -59,9 +59,9 @@ typedef struct
// TODO: break up into poly vertex (index + uv) and surface vertex (index + light) shared between polygons. Will reduce this struct size to 4 bytes and eliminate duplicate light values.
typedef struct
{
unsigned char r, g, b, pad;
unsigned char u, v;
unsigned short index;
unsigned short light; // Can be made into u_char if we need to store more data; currently u_short for 32-bit alignment purposes
unsigned short u, v; // Can be made into u_char if we need to store more data; currently u_short for 32-bit alignment purposes
} ps1bsp_polyvertex_t;
// Faces are broken up into one or more polygons, each of which can be drawn as a quad/triangle strip with a single texture.

Loading…
Cancel
Save