diff --git a/main.cpp b/main.cpp index df7a047..dc6ad5f 100644 --- a/main.cpp +++ b/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); } diff --git a/ps1bsp.h b/ps1bsp.h index 6e129da..f8fef4b 100644 --- a/ps1bsp.h +++ b/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.