diff --git a/main.cpp b/main.cpp index 4af5709..4c8941f 100644 --- a/main.cpp +++ b/main.cpp @@ -152,8 +152,8 @@ int process_faces(const world_t* world, const TextureList& textures) outFace.numFaceVertices = (unsigned char)(outFaceVertices.size() - outFace.firstFaceVertex); outFace.center = (vertexSum / face->ledge_num).convertWorldPosition(); - float area = computeFaceArea(world, face); // TODO: divide by number of polygons - outFace.center.pad = (short)(sqrt(area)); + float area = computeFaceArea(world, face); + outFace.center.pad = (short)(area / 100); outFaces.push_back(outFace); } @@ -285,6 +285,7 @@ int process_faces(const world_t* world, const TextureList& textures) } outFace->numPolygons = (unsigned char)(outPolygons.size() - outFace->firstPolygon); + outFace->center.pad = (short)sqrt((double)outFace->center.pad * 100 / outFace->numPolygons); } printf("Converting data...\n"); diff --git a/ps1bsp.h b/ps1bsp.h index 545ed4c..2de23ad 100644 --- a/ps1bsp.h +++ b/ps1bsp.h @@ -95,9 +95,9 @@ typedef struct unsigned char b : 5; } ps1bsp_facevertex_t; -#define SURF_DRAWSKY 0x2 -#define SURF_DRAWLIQUID 0x4 -#define SURF_DRAWWATER 0x8 +#define SURF_DRAWSKY 0x4 +#define SURF_DRAWLIQUID 0x8 +#define SURF_DRAWWATER 0x10 // High quality: Face -> polygons -> polygon vertex indices (index + UV + light) -> vertices // Low quality: Face -> face vertex indices (index + color) -> vertices