diff --git a/programs/level.c b/programs/level.c index 4641e4f..38ca705 100644 --- a/programs/level.c +++ b/programs/level.c @@ -34,7 +34,6 @@ #include "levelModel.h" #include "levelTextures.h" -S3L_Model3D models[3]; S3L_Scene scene; S3L_Vec4 teleportPoint; @@ -43,8 +42,6 @@ uint32_t pixels[S3L_RESOLUTION_X * S3L_RESOLUTION_Y]; uint32_t frame = 0; uint8_t *texture = 0; -S3L_Unit *uvs = 0; -S3L_Index *uvIndices = 0; uint32_t previousTriangle = 1000; S3L_Vec4 uv0, uv1, uv2; @@ -125,29 +122,25 @@ void drawPixel(S3L_PixelInfo *p) #if TEXTURES if (p->triangleID != previousTriangle) { - switch (p->modelIndex) + uint8_t material = levelMaterials[p->triangleIndex]; + + switch (material) { case 0: - uvs = levelWallsUVs; - uvIndices = levelWallsUVIndices; texture = level1Texture; break; case 1: - uvs = levelFloorUVs; - uvIndices = levelFloorUVIndices; texture = level2Texture; break; case 2: default: - uvs = levelCeilingUVs; - uvIndices = levelCeilingUVIndices; texture = level3Texture; break; } - S3L_getIndexedTriangleValues(p->triangleIndex,uvIndices,uvs,2,&uv0,&uv1,&uv2); + S3L_getIndexedTriangleValues(p->triangleIndex,levelUVIndices,levelUVs,2,&uv0,&uv1,&uv2); previousTriangle = p->triangleID; } @@ -241,27 +234,17 @@ int main() nextT = clock(); - levelWallsModelInit(); - levelFloorModelInit(); - levelCeilingModelInit(); + levelModelInit(); - S3L_initScene(models,3,&scene); + S3L_initScene(&levelModel,1,&scene); - scene.models[0] = levelWallsModel; - scene.models[1] = levelFloorModel; - scene.models[2] = levelCeilingModel; + S3L_Unit s = S3L_FRACTIONS_PER_UNIT / 3; - S3L_Unit scale = S3L_FRACTIONS_PER_UNIT / 3; + S3L_Vec4 scale; - S3L_Vec4 s; + S3L_setVec4(&scale,s,s,s,S3L_FRACTIONS_PER_UNIT); - s.x = scale; - s.y = scale; - s.z = scale; - - scene.models[0].transform.scale = s; - scene.models[1].transform.scale = s; - scene.models[2].transform.scale = s; + scene.models[0].transform.scale = scale; int running = 1; diff --git a/programs/levelCeilingModel.h b/programs/levelCeilingModel.h deleted file mode 100644 index 7d2a66e..0000000 --- a/programs/levelCeilingModel.h +++ /dev/null @@ -1,88 +0,0 @@ -#ifndef LEVELCEILING_MODEL_H -#define LEVELCEILING_MODEL_H - -#define LEVELCEILING_VERTEX_COUNT 143 -const S3L_Unit levelCeilingVertices[LEVELCEILING_VERTEX_COUNT * 3] = { --0x10cf,-0x54,-0x6bc,-0x8cf,-0x54,-0xebc,-0x18cf,-0x54,-0x6bc,-0xcf,-0x54, --0x1ebc,-0xcf,-0x54,-0xebc,-0x8cf,-0x54,0x143,-0xcf,-0x54,-0x6bc,-0x18cf,-0x54, -0x143,-0x12cf,-0x54,-0x8bc,0x730,-0x854,-0x1ebc,-0x12cf,0xfab,-0x8bc,0x730, --0x854,-0xebc,-0x1acf,-0x54,0x1f43,-0x10cf,-0x54,0x943,0x130,0xfab,0x1943,-0x8cf, --0x54,0x943,0x1730,-0x854,-0xebc,0x1930,-0x854,-0x8bc,0x2130,0xfab,-0x8bc,0x2130, --0x854,-0x8bc,0x1730,-0x854,-0x6bc,0x1930,0xfab,-0x1ebc,0x130,-0x54,0x943,-0xcf, --0x1854,-0xebc,-0xcf,-0x1854,-0x6bc,0xf30,-0x1854,-0xebc,-0x8cf,-0x1854,0x143, -0x130,-0x54,0x1943,-0x10cf,-0x1854,0x143,0xf30,-0x1854,-0x6bc,0x1f30,-0x854, --0x6bc,0x1730,-0x1854,0x143,0x1f30,-0x1854,0x143,-0x24cf,-0x254,0xb43,-0x24cf, --0x254,0x143,0x2f30,-0x854,-0x8bc,0x1730,-0x1854,-0x6bc,-0x1acf,-0x54,-0x8bc, --0x1acf,-0x54,0x343,-0x12cf,-0x54,0xb43,-0x12cf,-0x54,0x1743,0x1f30,-0x54,0x943, -0x1930,0xfab,-0x8bc,-0x10cf,0xfab,0x943,0x130,0xfab,0x943,-0x24cf,0xfab,-0x6bc, --0x24cf,-0x54,-0xebc,-0xcf,0xfab,0x1743,-0x12cf,0xfab,0x1743,-0x12cf,0xfab,0xb43, --0x10cf,0xfab,-0x6bc,-0x18cf,0xfab,0x143,-0x8cf,0xfab,-0xebc,-0x8cf,0xfab, --0x1ebc,-0x18cf,0xfab,-0x6bc,0x1f30,0xfab,0x943,0x1f30,0xfab,-0x6bc,0x2130,-0x54, -0x943,0x2130,0xfab,0x943,0x1730,0xfab,-0x1ebc,0x1730,0xfab,-0x6bc,0x2f30,-0x54, -0x943,0x2f30,-0x54,0x1943,-0x8cf,-0x254,0x943,0x2f30,0xfab,0x1943,0x2730,-0x854, --0x1ebc,0x2f30,-0x854,-0x16bc,0x2730,0xfab,-0x1ebc,0x2f30,0xfab,-0x16bc,-0x18cf, --0x1054,0x1143,-0x8cf,-0x1854,0x1143,-0x10cf,-0x1854,0x1143,0x1730,-0x1854, -0x1143,0x1f30,-0x1854,0x1143,0x1730,-0x854,0x1943,0x1f30,-0x854,0x1943,0x1730, --0x1854,0x1943,0x1f30,-0x1854,0x1943,0x1f30,-0x1854,-0x6bc,-0x1acf,0xfab,0x343, --0x1acf,0xfab,-0x8bc,-0x24cf,0xfab,-0xebc,-0x34cf,-0x54,-0xebc,-0x18cf,-0x1054, -0x143,-0x24cf,-0x1054,0x143,-0x34cf,-0x1054,0x143,-0x34cf,-0x1054,0x1143,-0x1acf, -0xfab,0x1f43,-0x8cf,-0x854,0x1943,-0x10cf,-0x854,0x1943,-0x8cf,-0x1854,0x1943, --0x10cf,-0x254,0x1143,-0x34cf,-0x254,0xb43,-0x34cf,0xfab,-0x6bc,-0x34cf,-0x254, -0x1143,-0x8cf,-0x254,0x143,0x1f30,-0x254,0x943,0x2f30,-0x854,-0x6bc,0x2f30, --0x254,0x943,0x2f30,-0x1854,0x1943,-0x10cf,-0x254,0x1943,0x2f30,-0x1854,-0x6bc, --0xcf,-0x54,0x1743,-0xcf,-0x54,0xb43,-0x22cf,-0x54,0x1f43,-0x22cf,-0x54,-0xebc, --0xcf,0xfab,0xb43,-0x22cf,0xfab,0x1f43,-0x22cf,0xfab,-0xebc,-0xacf,-0x54,-0x10bc, --0xacf,0xfab,-0x10bc,-0xacf,0xfab,-0x1ebc,-0x34cf,-0x54,-0x1ebc,-0x34cf,0xfab, --0x1ebc,0x2f30,-0x254,0x1943,-0xcf,-0x54,0x15c3,-0xcf,-0x54,0xd5c,-0xcf,0x8e5, -0x15c3,-0xcf,0xb35,0x1355,-0xcf,0xb35,0xff2,-0xcf,0x8e5,0xd5c,0x130,-0x54,0xd5c, -0x130,-0x54,0x15c3,0x130,0x8e5,0xd5c,0x130,0xb35,0xff2,0x130,0xb35,0x1355,0x130, -0x8e5,0x15c3,-0x8cf,0xbcb,-0x1ebc,-0x8cf,-0x54,-0x1599,-0x8cf,0xbcb,-0x18de, --0x8cf,0x8ed,-0x1599,-0xacf,0xbcb,-0x1ebc,-0xacf,-0x54,-0x1599,-0xacf,0xbcb, --0x18de,-0xacf,0x8ed,-0x1599,0x1730,0x5e7,-0x1ebc,0x1730,-0x854,-0x1274,0x1730, -0x2b5,-0x1274,0x1730,0x5e7,-0x14a9,0x1930,-0x854,-0x1274,0x1930,0x5e7,-0x1ebc, -0x1930,0x2b5,-0x1274,0x1930,0x5e7,-0x14a9}; - -#define LEVELCEILING_TRIANGLE_COUNT 49 -const S3L_Index levelCeilingTriangleIndices[LEVELCEILING_TRIANGLE_COUNT * 3] = { -32,20,30,75,72,73,34,63,95,88,71,70,93,33,45,98,30,96,94,33,92,91,33,94,91,100, -63,45,81,93,93,81,113,111,108,110,110,108,10,10,108,80,108,79,80,107,87,79,87,49, -79,47,49,48,51,50,54,43,44,50,50,44,52,59,52,44,59,53,52,60,59,44,56,60,55,60,44, -55,44,14,55,64,55,14,55,64,58,58,64,18,64,68,18,68,67,18,67,21,18,42,18,21,32,31, -20,75,74,72,34,33,63,88,89,71,93,92,33,98,97,30,91,63,33,108,107,79,87,48,49,47, -106,49,51,43,50,81,111,113,108,111,81,63,100,114,114,98,63}; - -#define LEVELCEILING_UV_COUNT 60 -const S3L_Unit levelCeilingUVs[LEVELCEILING_UV_COUNT * 2] = { -0x1cc,-0xfd,0x15,0x2d9,0x1cc,0x2d9,0x1d3,-0x100,0x16,0x2e4,0x1d3,0x2e4,0x1,0x8d0, --0x1f4,0x1f5,0x1,0x1f5,0x1d2,-0xf6,0x1a,0x2e0,0x1d2,0x2e0,0x1f6,0xcbb,-0x271, -0x8d0,0x1f6,0x8d0,-0x1f4,-0xbc0,0x1f6,-0x7d5,-0x1f4,-0x7d5,-0x3e9,0xcbb,-0x271, -0xcbb,-0x3e9,0x3eb,-0x5df,0x3eb,0x3ec,0x8d0,0x7d7,0xcbb,0x7d7,0x273,0x3ec,0x853, -0x469,0x273,0x274,0x468,0x274,0x65d,-0x7b,0x65d,-0x757,0x853,-0x757,0x65d,-0x271, -0x468,-0x561,0x0,-0x561,0x468,0x1,0x5e0,0x1f6,0x3eb,0x1f6,0x5e0,-0x1f4,0x3eb, --0x1f4,-0x7d,0x3ec,0x1f5,0x7d7,-0x5e0,0x7d7,0x1f5,0x1f6,-0x5e0,0x1f6,-0x7d5, --0x1f4,-0x7d5,-0x5df,-0x7d,-0x5df,-0xbc0,-0x1f4,-0x853,0x274,-0x853,0x5e1,-0xbc0, -0x7d7,-0x9cb,0x7d7,-0x65d,0x274,-0x65d,0x15,-0xfd,0x16,-0x100,0x1a,-0xf6,0x1f6, --0xbc0,-0x271,0x0,-0x5df,-0xbc0}; - -#define LEVELCEILING_UV_INDEX_COUNT 49 -const S3L_Index levelCeilingUVIndices[LEVELCEILING_UV_INDEX_COUNT * 3] = { -0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,13,19,20,13,18,20,21,7,14,22,12, -12,22,23,24,25,26,26,25,27,27,25,28,25,29,28,30,31,29,31,32,29,33,32,34,35,36,37, -38,39,36,36,39,40,41,40,39,41,42,40,43,41,39,44,43,45,43,39,45,39,46,45,47,45,46, -45,47,48,48,47,49,47,50,49,50,51,49,51,52,49,53,49,52,0,54,1,3,55,4,6,13,7,9,56, -10,12,19,13,15,57,16,20,7,13,25,30,29,31,34,32,33,58,32,35,38,36,22,24,23,25,24, -22,7,21,59,59,15,7}; - -S3L_Model3D levelCeilingModel; - -void levelCeilingModelInit() -{ - S3L_initModel3D( - levelCeilingVertices, - LEVELCEILING_VERTEX_COUNT, - levelCeilingTriangleIndices, - LEVELCEILING_TRIANGLE_COUNT, - &levelCeilingModel); -} - -#endif // guard diff --git a/programs/levelFloorModel.h b/programs/levelFloorModel.h deleted file mode 100644 index bb8f61a..0000000 --- a/programs/levelFloorModel.h +++ /dev/null @@ -1,95 +0,0 @@ -#ifndef LEVELFLOOR_MODEL_H -#define LEVELFLOOR_MODEL_H - -#define LEVELFLOOR_VERTEX_COUNT 143 -const S3L_Unit levelFloorVertices[LEVELFLOOR_VERTEX_COUNT * 3] = { --0x10cf,-0x54,-0x6bc,-0x8cf,-0x54,-0xebc,-0x18cf,-0x54,-0x6bc,-0xcf,-0x54, --0x1ebc,-0xcf,-0x54,-0xebc,-0x8cf,-0x54,0x143,-0xcf,-0x54,-0x6bc,-0x18cf,-0x54, -0x143,-0x12cf,-0x54,-0x8bc,0x730,-0x854,-0x1ebc,-0x12cf,0xfab,-0x8bc,0x730, --0x854,-0xebc,-0x1acf,-0x54,0x1f43,-0x10cf,-0x54,0x943,0x130,0xfab,0x1943,-0x8cf, --0x54,0x943,0x1730,-0x854,-0xebc,0x1930,-0x854,-0x8bc,0x2130,0xfab,-0x8bc,0x2130, --0x854,-0x8bc,0x1730,-0x854,-0x6bc,0x1930,0xfab,-0x1ebc,0x130,-0x54,0x943,-0xcf, --0x1854,-0xebc,-0xcf,-0x1854,-0x6bc,0xf30,-0x1854,-0xebc,-0x8cf,-0x1854,0x143, -0x130,-0x54,0x1943,-0x10cf,-0x1854,0x143,0xf30,-0x1854,-0x6bc,0x1f30,-0x854, --0x6bc,0x1730,-0x1854,0x143,0x1f30,-0x1854,0x143,-0x24cf,-0x254,0xb43,-0x24cf, --0x254,0x143,0x2f30,-0x854,-0x8bc,0x1730,-0x1854,-0x6bc,-0x1acf,-0x54,-0x8bc, --0x1acf,-0x54,0x343,-0x12cf,-0x54,0xb43,-0x12cf,-0x54,0x1743,0x1f30,-0x54,0x943, -0x1930,0xfab,-0x8bc,-0x10cf,0xfab,0x943,0x130,0xfab,0x943,-0x24cf,0xfab,-0x6bc, --0x24cf,-0x54,-0xebc,-0xcf,0xfab,0x1743,-0x12cf,0xfab,0x1743,-0x12cf,0xfab,0xb43, --0x10cf,0xfab,-0x6bc,-0x18cf,0xfab,0x143,-0x8cf,0xfab,-0xebc,-0x8cf,0xfab, --0x1ebc,-0x18cf,0xfab,-0x6bc,0x1f30,0xfab,0x943,0x1f30,0xfab,-0x6bc,0x2130,-0x54, -0x943,0x2130,0xfab,0x943,0x1730,0xfab,-0x1ebc,0x1730,0xfab,-0x6bc,0x2f30,-0x54, -0x943,0x2f30,-0x54,0x1943,-0x8cf,-0x254,0x943,0x2f30,0xfab,0x1943,0x2730,-0x854, --0x1ebc,0x2f30,-0x854,-0x16bc,0x2730,0xfab,-0x1ebc,0x2f30,0xfab,-0x16bc,-0x18cf, --0x1054,0x1143,-0x8cf,-0x1854,0x1143,-0x10cf,-0x1854,0x1143,0x1730,-0x1854, -0x1143,0x1f30,-0x1854,0x1143,0x1730,-0x854,0x1943,0x1f30,-0x854,0x1943,0x1730, --0x1854,0x1943,0x1f30,-0x1854,0x1943,0x1f30,-0x1854,-0x6bc,-0x1acf,0xfab,0x343, --0x1acf,0xfab,-0x8bc,-0x24cf,0xfab,-0xebc,-0x34cf,-0x54,-0xebc,-0x18cf,-0x1054, -0x143,-0x24cf,-0x1054,0x143,-0x34cf,-0x1054,0x143,-0x34cf,-0x1054,0x1143,-0x1acf, -0xfab,0x1f43,-0x8cf,-0x854,0x1943,-0x10cf,-0x854,0x1943,-0x8cf,-0x1854,0x1943, --0x10cf,-0x254,0x1143,-0x34cf,-0x254,0xb43,-0x34cf,0xfab,-0x6bc,-0x34cf,-0x254, -0x1143,-0x8cf,-0x254,0x143,0x1f30,-0x254,0x943,0x2f30,-0x854,-0x6bc,0x2f30, --0x254,0x943,0x2f30,-0x1854,0x1943,-0x10cf,-0x254,0x1943,0x2f30,-0x1854,-0x6bc, --0xcf,-0x54,0x1743,-0xcf,-0x54,0xb43,-0x22cf,-0x54,0x1f43,-0x22cf,-0x54,-0xebc, --0xcf,0xfab,0xb43,-0x22cf,0xfab,0x1f43,-0x22cf,0xfab,-0xebc,-0xacf,-0x54,-0x10bc, --0xacf,0xfab,-0x10bc,-0xacf,0xfab,-0x1ebc,-0x34cf,-0x54,-0x1ebc,-0x34cf,0xfab, --0x1ebc,0x2f30,-0x254,0x1943,-0xcf,-0x54,0x15c3,-0xcf,-0x54,0xd5c,-0xcf,0x8e5, -0x15c3,-0xcf,0xb35,0x1355,-0xcf,0xb35,0xff2,-0xcf,0x8e5,0xd5c,0x130,-0x54,0xd5c, -0x130,-0x54,0x15c3,0x130,0x8e5,0xd5c,0x130,0xb35,0xff2,0x130,0xb35,0x1355,0x130, -0x8e5,0x15c3,-0x8cf,0xbcb,-0x1ebc,-0x8cf,-0x54,-0x1599,-0x8cf,0xbcb,-0x18de, --0x8cf,0x8ed,-0x1599,-0xacf,0xbcb,-0x1ebc,-0xacf,-0x54,-0x1599,-0xacf,0xbcb, --0x18de,-0xacf,0x8ed,-0x1599,0x1730,0x5e7,-0x1ebc,0x1730,-0x854,-0x1274,0x1730, -0x2b5,-0x1274,0x1730,0x5e7,-0x14a9,0x1930,-0x854,-0x1274,0x1930,0x5e7,-0x1ebc, -0x1930,0x2b5,-0x1274,0x1930,0x5e7,-0x14a9}; - -#define LEVELFLOOR_TRIANGLE_COUNT 70 -const S3L_Index levelFloorTriangleIndices[LEVELFLOOR_TRIANGLE_COUNT * 3] = { -6,0,1,4,6,1,13,5,15,4,1,128,13,0,5,3,11,4,23,29,24,2,0,7,122,121,41,62,57,61,70, -31,72,69,84,83,85,84,86,77,73,99,32,99,73,70,28,26,71,83,28,84,69,86,85,46,84, -115,102,40,57,62,41,72,90,70,73,31,32,78,101,32,61,19,35,38,40,12,104,38,12,105, -38,104,38,105,37,37,109,8,105,132,109,112,46,82,36,31,29,29,26,24,35,19,66,66,19, -65,46,112,105,116,122,115,6,5,0,3,4,128,13,7,0,3,9,11,16,11,136,11,9,136,23,25, -29,62,27,41,27,122,41,121,22,41,70,26,31,32,101,99,70,71,28,71,69,83,85,82,46,40, -39,116,39,103,116,116,115,40,72,76,90,73,72,31,61,57,19,38,39,40,37,105,109,3, -105,112,29,31,26,65,19,139,19,17,139,116,121,122,128,132,3,136,65,139,136,9,65, -105,3,132}; - -#define LEVELFLOOR_UV_COUNT 70 -const S3L_Unit levelFloorUVs[LEVELFLOOR_UV_COUNT * 2] = { -0x192,0x2bb,-0x2b2,0x2bb,-0x90,0x4de,0x192,0x4de,-0x2b2,-0x189,-0x90,0x98,-0x90, --0x189,-0x90,0x6b2,0x192,0x923,0x3b4,0x4de,0x192,0x4de,0x5d7,0x2bb,0x192,0x2bb, --0x4d5,0x2bb,-0x4d5,0x98,0x21a,-0x4df,0x21a,-0x2a1,0xa1c,-0x189,0xe61,-0x5ce, -0xaa4,-0x189,0xe61,-0x189,-0x90,-0x3ac,0x7f9,0x98,0x7f9,-0x3ac,-0x4d5,-0x3ac, --0x809,0x98,-0x4d5,0x98,-0xc4e,0x98,-0xc4e,-0x3ac,0xa1c,-0x5ce,0xa1c,-0x3ac, -0xe61,-0x5ce,0xa1c,0x98,-0x2b2,0x98,-0x90,0x98,-0x2b2,-0x3ac,-0x809,0x4de,0x192, --0x4df,0x192,-0x545,-0x33b,-0x545,-0x90,-0x5ce,0xa1c,0x2bb,0xe61,0x2bb,0xaa4, -0x344,0xe61,0x344,-0x55e,0x10,-0x55e,-0x768,-0x780,-0x768,-0x780,0x4de,-0x55e, -0x344,-0x118,0x566,-0x33b,0x344,-0x118,0x6b2,-0xc4e,0x923,-0xc4e,0x4de,0x7f9, -0x2bb,0xe61,0x700,0xc3e,0x923,0x192,-0x2a1,0x3b4,0x923,0x7f9,0x4de,0x7f9,0x5db, -0x5d7,0x4de,0x21a,-0x5ce,0x21a,-0x189,-0x33b,-0x212,0x192,-0x212,0x7f9,-0x5ce, -0x882,0x5db,0x882,0x344}; - -#define LEVELFLOOR_UV_INDEX_COUNT 70 -const S3L_Index levelFloorUVIndices[LEVELFLOOR_UV_INDEX_COUNT * 3] = { -0,1,2,3,0,2,4,5,6,3,2,7,4,1,5,8,9,3,10,11,12,13,1,14,15,16,17,18,19,20,21,22,23, -24,25,26,27,25,28,29,30,31,32,31,30,21,33,34,35,26,33,25,24,28,27,36,25,37,38,39, -19,18,17,23,40,21,30,22,32,41,42,32,20,43,44,45,39,46,47,45,46,48,45,47,45,48,49, -49,50,51,48,52,50,53,36,54,55,22,11,11,34,12,44,43,56,56,43,57,36,53,48,58,15,37, -0,5,1,8,3,7,4,14,1,8,59,9,60,9,61,9,59,61,10,62,11,18,63,17,63,15,17,16,64,17,21, -34,22,32,42,31,21,35,33,35,24,26,27,54,36,39,65,58,65,66,58,58,37,39,23,67,40,30, -23,22,20,19,43,45,65,39,49,48,50,8,48,53,11,22,34,57,43,68,43,69,68,58,16,15,7, -52,8,61,57,68,61,59,57,48,8,52}; - -S3L_Model3D levelFloorModel; - -void levelFloorModelInit() -{ - S3L_initModel3D( - levelFloorVertices, - LEVELFLOOR_VERTEX_COUNT, - levelFloorTriangleIndices, - LEVELFLOOR_TRIANGLE_COUNT, - &levelFloorModel); -} - -#endif // guard diff --git a/programs/levelModel.h b/programs/levelModel.h index b76abf5..81aa9d7 100644 --- a/programs/levelModel.h +++ b/programs/levelModel.h @@ -3,238 +3,1399 @@ #define LEVEL_VERTEX_COUNT 143 const S3L_Unit levelVertices[LEVEL_VERTEX_COUNT * 3] = { --0x10cf,-0x54,-0x669,-0x8cf,-0x54,-0xe69,-0x18cf,-0x54,-0x669,-0xcf,-0x54, --0x1e69,-0xcf,-0x54,-0xe69,-0x8cf,-0x54,0x196,-0xcf,-0x54,-0x669,-0x18cf,-0x54, -0x196,-0x12cf,-0x54,-0x869,0x730,-0x854,-0x1e69,-0x12cf,0xfab,-0x869,0x730, --0x854,-0xe69,-0x1acf,-0x54,0x1f96,-0x10cf,-0x54,0x996,0x130,0xfab,0x1996,-0x8cf, --0x54,0x996,0x1730,-0x854,-0xe69,0x1930,-0x854,-0x869,0x2130,0xfab,-0x869,0x2130, --0x854,-0x869,0x1730,-0x854,-0x669,0x1930,0xfab,-0x1e69,0x130,-0x54,0x996,-0xcf, --0x1854,-0xe69,-0xcf,-0x1854,-0x669,0xf30,-0x1854,-0xe69,-0x8cf,-0x1854,0x196, -0x130,-0x54,0x1996,-0x10cf,-0x1854,0x196,0xf30,-0x1854,-0x669,0x1f30,-0x854, --0x669,0x1730,-0x1854,0x196,0x1f30,-0x1854,0x196,-0x24cf,-0x254,0xb96,-0x24cf, --0x254,0x196,0x2f30,-0x854,-0x869,0x1730,-0x1854,-0x669,-0x1acf,-0x54,-0x869, --0x1acf,-0x54,0x396,-0x12cf,-0x54,0xb96,-0x12cf,-0x54,0x1796,0x1f30,-0x54,0x996, -0x1930,0xfab,-0x869,-0x10cf,0xfab,0x996,0x130,0xfab,0x996,-0x24cf,0xfab,-0x669, --0x24cf,-0x54,-0xe69,-0xcf,0xfab,0x1796,-0x12cf,0xfab,0x1796,-0x12cf,0xfab,0xb96, --0x10cf,0xfab,-0x669,-0x18cf,0xfab,0x196,-0x8cf,0xfab,-0xe69,-0x8cf,0xfab, --0x1e69,-0x18cf,0xfab,-0x669,0x1f30,0xfab,0x996,0x1f30,0xfab,-0x669,0x2130,-0x54, -0x996,0x2130,0xfab,0x996,0x1730,0xfab,-0x1e69,0x1730,0xfab,-0x669,0x2f30,-0x54, -0x996,0x2f30,-0x54,0x1996,-0x8cf,-0x254,0x996,0x2f30,0xfab,0x1996,0x2730,-0x854, --0x1e69,0x2f30,-0x854,-0x1669,0x2730,0xfab,-0x1e69,0x2f30,0xfab,-0x1669,-0x18cf, --0x1054,0x1196,-0x8cf,-0x1854,0x1196,-0x10cf,-0x1854,0x1196,0x1730,-0x1854, -0x1196,0x1f30,-0x1854,0x1196,0x1730,-0x854,0x1996,0x1f30,-0x854,0x1996,0x1730, --0x1854,0x1996,0x1f30,-0x1854,0x1996,0x1f30,-0x1854,-0x669,-0x1acf,0xfab,0x396, --0x1acf,0xfab,-0x869,-0x24cf,0xfab,-0xe69,-0x34cf,-0x54,-0xe69,-0x18cf,-0x1054, -0x196,-0x24cf,-0x1054,0x196,-0x34cf,-0x1054,0x196,-0x34cf,-0x1054,0x1196,-0x1acf, -0xfab,0x1f96,-0x8cf,-0x854,0x1996,-0x10cf,-0x854,0x1996,-0x8cf,-0x1854,0x1996, --0x10cf,-0x254,0x1196,-0x34cf,-0x254,0xb96,-0x34cf,0xfab,-0x669,-0x34cf,-0x254, -0x1196,-0x8cf,-0x254,0x196,0x1f30,-0x254,0x996,0x2f30,-0x854,-0x669,0x2f30, --0x254,0x996,0x2f30,-0x1854,0x1996,-0x10cf,-0x254,0x1996,0x2f30,-0x1854,-0x669, --0xcf,-0x54,0x1796,-0xcf,-0x54,0xb96,-0x22cf,-0x54,0x1f96,-0x22cf,-0x54,-0xe69, --0xcf,0xfab,0xb96,-0x22cf,0xfab,0x1f96,-0x22cf,0xfab,-0xe69,-0xacf,-0x54,-0x1069, --0xacf,0xfab,-0x1069,-0xacf,0xfab,-0x1e69,-0x34cf,-0x54,-0x1e69,-0x34cf,0xfab, --0x1e69,0x2f30,-0x254,0x1996,-0xcf,-0x54,0x1616,-0xcf,-0x54,0xdaf,-0xcf,0x8e5, -0x1616,-0xcf,0xb35,0x13a8,-0xcf,0xb35,0x1045,-0xcf,0x8e5,0xdaf,0x130,-0x54,0xdaf, -0x130,-0x54,0x1616,0x130,0x8e5,0xdaf,0x130,0xb35,0x1045,0x130,0xb35,0x13a8,0x130, -0x8e5,0x1616,-0x8cf,0xbcb,-0x1e69,-0x8cf,-0x54,-0x1545,-0x8cf,0xbcb,-0x188b, --0x8cf,0x8ed,-0x1545,-0xacf,0xbcb,-0x1e69,-0xacf,-0x54,-0x1545,-0xacf,0xbcb, --0x188b,-0xacf,0x8ed,-0x1545,0x1730,0x5e7,-0x1e69,0x1730,-0x854,-0x1220,0x1730, -0x2b5,-0x1220,0x1730,0x5e7,-0x1456,0x1930,-0x854,-0x1220,0x1930,0x5e7,-0x1e69, -0x1930,0x2b5,-0x1220,0x1930,0x5e7,-0x1456}; + -4303, -84, -1724, // 0 + -2255, -84, -3772, // 3 + -6351, -84, -1724, // 6 + -207, -84, -7868, // 9 + -207, -84, -3772, // 12 + -2255, -84, 323, // 15 + -207, -84, -1724, // 18 + -6351, -84, 323, // 21 + -4815, -84, -2236, // 24 + 1840, -2132, -7868, // 27 + -4815, 4011, -2236, // 30 + 1840, -2132, -3772, // 33 + -6863, -84, 8003, // 36 + -4303, -84, 2371, // 39 + 304, 4011, 6467, // 42 + -2255, -84, 2371, // 45 + 5936, -2132, -3772, // 48 + 6448, -2132, -2236, // 51 + 8496, 4011, -2236, // 54 + 8496, -2132, -2236, // 57 + 5936, -2132, -1724, // 60 + 6448, 4011, -7868, // 63 + 304, -84, 2371, // 66 + -207, -6228, -3772, // 69 + -207, -6228, -1724, // 72 + 3888, -6228, -3772, // 75 + -2255, -6228, 323, // 78 + 304, -84, 6467, // 81 + -4303, -6228, 323, // 84 + 3888, -6228, -1724, // 87 + 7984, -2132, -1724, // 90 + 5936, -6228, 323, // 93 + 7984, -6228, 323, // 96 + -9423, -596, 2883, // 99 + -9423, -596, 323, // 102 + 12080, -2132, -2236, // 105 + 5936, -6228, -1724, // 108 + -6863, -84, -2236, // 111 + -6863, -84, 835, // 114 + -4815, -84, 2883, // 117 + -4815, -84, 5955, // 120 + 7984, -84, 2371, // 123 + 6448, 4011, -2236, // 126 + -4303, 4011, 2371, // 129 + 304, 4011, 2371, // 132 + -9423, 4011, -1724, // 135 + -9423, -84, -3772, // 138 + -207, 4011, 5955, // 141 + -4815, 4011, 5955, // 144 + -4815, 4011, 2883, // 147 + -4303, 4011, -1724, // 150 + -6351, 4011, 323, // 153 + -2255, 4011, -3772, // 156 + -2255, 4011, -7868, // 159 + -6351, 4011, -1724, // 162 + 7984, 4011, 2371, // 165 + 7984, 4011, -1724, // 168 + 8496, -84, 2371, // 171 + 8496, 4011, 2371, // 174 + 5936, 4011, -7868, // 177 + 5936, 4011, -1724, // 180 + 12080, -84, 2371, // 183 + 12080, -84, 6467, // 186 + -2255, -596, 2371, // 189 + 12080, 4011, 6467, // 192 + 10032, -2132, -7868, // 195 + 12080, -2132, -5820, // 198 + 10032, 4011, -7868, // 201 + 12080, 4011, -5820, // 204 + -6351, -4180, 4419, // 207 + -2255, -6228, 4419, // 210 + -4303, -6228, 4419, // 213 + 5936, -6228, 4419, // 216 + 7984, -6228, 4419, // 219 + 5936, -2132, 6467, // 222 + 7984, -2132, 6467, // 225 + 5936, -6228, 6467, // 228 + 7984, -6228, 6467, // 231 + 7984, -6228, -1724, // 234 + -6863, 4011, 835, // 237 + -6863, 4011, -2236, // 240 + -9423, 4011, -3772, // 243 + -13519, -84, -3772, // 246 + -6351, -4180, 323, // 249 + -9423, -4180, 323, // 252 + -13519, -4180, 323, // 255 + -13519, -4180, 4419, // 258 + -6863, 4011, 8003, // 261 + -2255, -2132, 6467, // 264 + -4303, -2132, 6467, // 267 + -2255, -6228, 6467, // 270 + -4303, -596, 4419, // 273 + -13519, -596, 2883, // 276 + -13519, 4011, -1724, // 279 + -13519, -596, 4419, // 282 + -2255, -596, 323, // 285 + 7984, -596, 2371, // 288 + 12080, -2132, -1724, // 291 + 12080, -596, 2371, // 294 + 12080, -6228, 6467, // 297 + -4303, -596, 6467, // 300 + 12080, -6228, -1724, // 303 + -207, -84, 5955, // 306 + -207, -84, 2883, // 309 + -8911, -84, 8003, // 312 + -8911, -84, -3772, // 315 + -207, 4011, 2883, // 318 + -8911, 4011, 8003, // 321 + -8911, 4011, -3772, // 324 + -2767, -84, -4284, // 327 + -2767, 4011, -4284, // 330 + -2767, 4011, -7868, // 333 + -13519, -84, -7868, // 336 + -13519, 4011, -7868, // 339 + 12080, -596, 6467, // 342 + -207, -84, 5571, // 345 + -207, -84, 3420, // 348 + -207, 2277, 5571, // 351 + -207, 2869, 4949, // 354 + -207, 2869, 4082, // 357 + -207, 2277, 3420, // 360 + 304, -84, 3420, // 363 + 304, -84, 5571, // 366 + 304, 2277, 3420, // 369 + 304, 2869, 4082, // 372 + 304, 2869, 4949, // 375 + 304, 2277, 5571, // 378 + -2255, 3019, -7868, // 381 + -2255, -84, -5529, // 384 + -2255, 3019, -6366, // 387 + -2255, 2285, -5529, // 390 + -2767, 3019, -7868, // 393 + -2767, -84, -5529, // 396 + -2767, 3019, -6366, // 399 + -2767, 2285, -5529, // 402 + 5936, 1511, -7868, // 405 + 5936, -2132, -4724, // 408 + 5936, 693, -4724, // 411 + 5936, 1511, -5289, // 414 + 6448, -2132, -4724, // 417 + 6448, 1511, -7868, // 420 + 6448, 693, -4724, // 423 + 6448, 1511, -5289 // 426 +}; // levelVertices -#define LEVELWALLS_TRIANGLE_COUNT 174 -const S3L_Index levelWallsTriangleIndices[LEVELWALLS_TRIANGLE_COUNT * 3] = { -7,54,2,3,59,9,63,5,95,26,6,24,6,26,95,6,95,5,43,15,44,109,10,8,22,44,15,3,53,59, -29,16,20,29,20,36,31,36,20,41,96,30,60,137,138,22,96,41,124,125,14,13,51,7,82,93, -113,57,18,19,13,15,43,40,87,12,104,108,105,3,127,53,54,0,2,41,56,55,50,1,0,19,42, -17,56,20,60,27,64,14,8,80,37,110,134,133,61,68,64,65,68,66,35,66,68,140,21,67,35, -68,61,58,41,55,61,64,62,16,25,11,11,23,4,23,11,25,98,99,97,99,101,97,74,76,72,73, -77,75,30,78,32,80,38,37,12,107,104,46,108,81,69,71,91,81,45,34,34,45,33,34,84,46, -49,103,39,79,39,38,119,106,47,102,48,40,70,90,88,89,91,71,26,28,95,84,34,83,95, -83,34,28,83,95,94,92,86,91,94,69,112,82,113,34,46,81,86,69,94,86,92,85,52,129, -130,92,82,85,74,90,76,97,78,30,77,114,75,99,114,77,100,91,89,100,89,88,98,114,99, -22,15,63,74,100,88,124,120,119,125,119,118,126,118,117,122,117,115,123,116,120, -130,132,128,129,134,130,127,133,129,131,127,3,16,60,20,141,17,42,136,141,137,137, -142,138,138,140,135,7,51,54,63,15,5,109,110,10,23,24,6,6,4,23,29,25,16,60,16,137, -16,136,137,135,59,138,59,60,138,22,63,96,44,22,123,22,121,123,122,27,126,27,14, -126,44,123,124,125,126,14,44,124,14,13,43,51,57,58,18,40,48,87,104,107,108,54,50, -0,41,30,56,50,52,1,19,18,42,56,30,20,27,62,64,8,10,80,110,109,134,109,132,134, -131,111,133,111,110,133,65,67,68,9,59,135,67,65,140,58,57,41,80,79,38,12,87,107, -46,105,108,49,106,103,79,49,39,116,103,120,103,106,120,47,102,117,102,115,117, -119,120,106,47,117,118,118,119,47,102,47,48,128,1,130,1,52,130,52,53,129,53,127, -129,92,93,82,74,88,90,97,101,78,124,123,120,125,124,119,126,125,118,122,126,117, -123,121,116,130,134,132,129,133,134,127,131,133,21,140,142,141,139,17,42,21,142, -142,141,42,136,139,141,137,141,142,138,142,140,140,65,135,9,135,65,3,112,131,112, -113,131,131,113,111,75,114,74,74,114,100}; +#define LEVEL_TRIANGLE_COUNT 293 +const S3L_Index levelTriangleIndices[LEVEL_TRIANGLE_COUNT * 3] = { + 7, 54, 2, // 0 + 6, 0, 1, // 3 + 4, 6, 1, // 6 + 13, 5, 15, // 9 + 3, 59, 9, // 12 + 4, 1, 128, // 15 + 63, 5, 95, // 18 + 26, 6, 24, // 21 + 6, 26, 95, // 24 + 6, 95, 5, // 27 + 43, 15, 44, // 30 + 13, 0, 5, // 33 + 3, 11, 4, // 36 + 109, 10, 8, // 39 + 23, 29, 24, // 42 + 22, 44, 15, // 45 + 3, 53, 59, // 48 + 29, 16, 20, // 51 + 32, 20, 30, // 54 + 29, 20, 36, // 57 + 31, 36, 20, // 60 + 41, 96, 30, // 63 + 60, 137, 138, // 66 + 22, 96, 41, // 69 + 124, 125, 14, // 72 + 13, 51, 7, // 75 + 82, 93, 113, // 78 + 57, 18, 19, // 81 + 13, 15, 43, // 84 + 40, 87, 12, // 87 + 104, 108, 105, // 90 + 2, 0, 7, // 93 + 3, 127, 53, // 96 + 54, 0, 2, // 99 + 41, 56, 55, // 102 + 50, 1, 0, // 105 + 19, 42, 17, // 108 + 56, 20, 60, // 111 + 27, 64, 14, // 114 + 8, 80, 37, // 117 + 110, 134, 133, // 120 + 122, 121, 41, // 123 + 61, 68, 64, // 126 + 62, 57, 61, // 129 + 65, 68, 66, // 132 + 35, 66, 68, // 135 + 140, 21, 67, // 138 + 35, 68, 61, // 141 + 58, 41, 55, // 144 + 61, 64, 62, // 147 + 16, 25, 11, // 150 + 11, 23, 4, // 153 + 23, 11, 25, // 156 + 98, 99, 97, // 159 + 70, 31, 72, // 162 + 69, 84, 83, // 165 + 99, 101, 97, // 168 + 85, 84, 86, // 171 + 77, 73, 99, // 174 + 32, 99, 73, // 177 + 70, 28, 26, // 180 + 75, 72, 73, // 183 + 74, 76, 72, // 186 + 73, 77, 75, // 189 + 30, 78, 32, // 192 + 80, 38, 37, // 195 + 12, 107, 104, // 198 + 46, 108, 81, // 201 + 69, 71, 91, // 204 + 71, 83, 28, // 207 + 34, 63, 95, // 210 + 84, 69, 86, // 213 + 81, 45, 34, // 216 + 34, 45, 33, // 219 + 34, 84, 46, // 222 + 49, 103, 39, // 225 + 79, 39, 38, // 228 + 119, 106, 47, // 231 + 102, 48, 40, // 234 + 88, 71, 70, // 237 + 70, 90, 88, // 240 + 89, 91, 71, // 243 + 26, 28, 95, // 246 + 84, 34, 83, // 249 + 95, 83, 34, // 252 + 28, 83, 95, // 255 + 94, 92, 86, // 258 + 91, 94, 69, // 261 + 112, 82, 113, // 264 + 34, 46, 81, // 267 + 86, 69, 94, // 270 + 86, 92, 85, // 273 + 93, 33, 45, // 276 + 85, 46, 84, // 279 + 115, 102, 40, // 282 + 52, 129, 130, // 285 + 92, 82, 85, // 288 + 57, 62, 41, // 291 + 72, 90, 70, // 294 + 74, 90, 76, // 297 + 97, 78, 30, // 300 + 73, 31, 32, // 303 + 78, 101, 32, // 306 + 98, 30, 96, // 309 + 77, 114, 75, // 312 + 99, 114, 77, // 315 + 100, 91, 89, // 318 + 100, 89, 88, // 321 + 98, 114, 99, // 324 + 61, 19, 35, // 327 + 38, 40, 12, // 330 + 104, 38, 12, // 333 + 105, 38, 104, // 336 + 38, 105, 37, // 339 + 37, 109, 8, // 342 + 105, 132, 109, // 345 + 112, 46, 82, // 348 + 22, 15, 63, // 351 + 94, 33, 92, // 354 + 91, 33, 94, // 357 + 74, 100, 88, // 360 + 36, 31, 29, // 363 + 29, 26, 24, // 366 + 91, 100, 63, // 369 + 35, 19, 66, // 372 + 66, 19, 65, // 375 + 45, 81, 93, // 378 + 93, 81, 113, // 381 + 111, 108, 110, // 384 + 110, 108, 10, // 387 + 10, 108, 80, // 390 + 108, 79, 80, // 393 + 107, 87, 79, // 396 + 87, 49, 79, // 399 + 47, 49, 48, // 402 + 51, 50, 54, // 405 + 43, 44, 50, // 408 + 50, 44, 52, // 411 + 59, 52, 44, // 414 + 59, 53, 52, // 417 + 60, 59, 44, // 420 + 56, 60, 55, // 423 + 60, 44, 55, // 426 + 44, 14, 55, // 429 + 64, 55, 14, // 432 + 55, 64, 58, // 435 + 58, 64, 18, // 438 + 64, 68, 18, // 441 + 68, 67, 18, // 444 + 67, 21, 18, // 447 + 42, 18, 21, // 450 + 46, 112, 105, // 453 + 124, 120, 119, // 456 + 125, 119, 118, // 459 + 126, 118, 117, // 462 + 122, 117, 115, // 465 + 123, 116, 120, // 468 + 116, 122, 115, // 471 + 130, 132, 128, // 474 + 129, 134, 130, // 477 + 127, 133, 129, // 480 + 131, 127, 3, // 483 + 16, 60, 20, // 486 + 141, 17, 42, // 489 + 136, 141, 137, // 492 + 137, 142, 138, // 495 + 138, 140, 135, // 498 + 7, 51, 54, // 501 + 6, 5, 0, // 504 + 3, 4, 128, // 507 + 63, 15, 5, // 510 + 13, 7, 0, // 513 + 3, 9, 11, // 516 + 16, 11, 136, // 519 + 11, 9, 136, // 522 + 109, 110, 10, // 525 + 23, 25, 29, // 528 + 23, 24, 6, // 531 + 6, 4, 23, // 534 + 29, 25, 16, // 537 + 32, 31, 20, // 540 + 60, 16, 137, // 543 + 16, 136, 137, // 546 + 135, 59, 138, // 549 + 59, 60, 138, // 552 + 22, 63, 96, // 555 + 44, 22, 123, // 558 + 22, 121, 123, // 561 + 122, 27, 126, // 564 + 27, 14, 126, // 567 + 44, 123, 124, // 570 + 125, 126, 14, // 573 + 44, 124, 14, // 576 + 13, 43, 51, // 579 + 57, 58, 18, // 582 + 40, 48, 87, // 585 + 104, 107, 108, // 588 + 54, 50, 0, // 591 + 41, 30, 56, // 594 + 50, 52, 1, // 597 + 19, 18, 42, // 600 + 56, 30, 20, // 603 + 27, 62, 64, // 606 + 8, 10, 80, // 609 + 110, 109, 134, // 612 + 109, 132, 134, // 615 + 131, 111, 133, // 618 + 111, 110, 133, // 621 + 62, 27, 41, // 624 + 27, 122, 41, // 627 + 121, 22, 41, // 630 + 65, 67, 68, // 633 + 9, 59, 135, // 636 + 67, 65, 140, // 639 + 58, 57, 41, // 642 + 70, 26, 31, // 645 + 32, 101, 99, // 648 + 70, 71, 28, // 651 + 75, 74, 72, // 654 + 80, 79, 38, // 657 + 12, 87, 107, // 660 + 46, 105, 108, // 663 + 71, 69, 83, // 666 + 34, 33, 63, // 669 + 49, 106, 103, // 672 + 79, 49, 39, // 675 + 116, 103, 120, // 678 + 103, 106, 120, // 681 + 47, 102, 117, // 684 + 102, 115, 117, // 687 + 119, 120, 106, // 690 + 47, 117, 118, // 693 + 118, 119, 47, // 696 + 102, 47, 48, // 699 + 88, 89, 71, // 702 + 93, 92, 33, // 705 + 85, 82, 46, // 708 + 40, 39, 116, // 711 + 39, 103, 116, // 714 + 116, 115, 40, // 717 + 128, 1, 130, // 720 + 1, 52, 130, // 723 + 52, 53, 129, // 726 + 53, 127, 129, // 729 + 92, 93, 82, // 732 + 72, 76, 90, // 735 + 74, 88, 90, // 738 + 97, 101, 78, // 741 + 73, 72, 31, // 744 + 98, 97, 30, // 747 + 61, 57, 19, // 750 + 38, 39, 40, // 753 + 37, 105, 109, // 756 + 3, 105, 112, // 759 + 91, 63, 33, // 762 + 29, 31, 26, // 765 + 65, 19, 139, // 768 + 19, 17, 139, // 771 + 108, 107, 79, // 774 + 87, 48, 49, // 777 + 47, 106, 49, // 780 + 51, 43, 50, // 783 + 124, 123, 120, // 786 + 125, 124, 119, // 789 + 126, 125, 118, // 792 + 122, 126, 117, // 795 + 123, 121, 116, // 798 + 116, 121, 122, // 801 + 130, 134, 132, // 804 + 129, 133, 134, // 807 + 127, 131, 133, // 810 + 128, 132, 3, // 813 + 21, 140, 142, // 816 + 141, 139, 17, // 819 + 42, 21, 142, // 822 + 142, 141, 42, // 825 + 136, 139, 141, // 828 + 137, 141, 142, // 831 + 138, 142, 140, // 834 + 136, 65, 139, // 837 + 136, 9, 65, // 840 + 140, 65, 135, // 843 + 9, 135, 65, // 846 + 105, 3, 132, // 849 + 3, 112, 131, // 852 + 112, 113, 131, // 855 + 81, 111, 113, // 858 + 108, 111, 81, // 861 + 131, 113, 111, // 864 + 75, 114, 74, // 867 + 74, 114, 100, // 870 + 63, 100, 114, // 873 + 114, 98, 63 // 876 +}; // levelTriangleIndices -#define LEVELWALLS_UV_COUNT 214 -const S3L_Unit levelWallsUVs[LEVELWALLS_UV_COUNT * 2] = { --0x677,-0x3ef,-0x888,-0x811,-0x888,-0x3ef,-0xd9a,-0x3e8,-0x13b7,-0x7ff,-0xfa5, --0x1de,-0x2791,-0x390,-0x299d,-0x415,-0x299d,-0x392,-0x29a3,0x20d,-0x2c82,-0x418, --0x2c88,0x20a,-0x38b,-0x811,-0x17a,-0x3ef,0x11a,-0x811,0x144,-0x3f8,-0x1a7, --0x81a,-0x1a7,-0x3f8,0x11a,-0x3ef,-0xb8e,-0x7fc,0x211,-0x16b,-0x14,0x36b,0x211, -0x36b,-0x62,-0x3ff,-0x270,-0x81a,-0x270,-0x3ff,-0x47e,-0x3ff,-0x72e,-0x3e0, --0x72e,-0x359,-0x2fa,-0x1c6,-0xe0,-0x814,0x233,-0x4ac,0x2c7,-0x583,-0x2502, --0x410,-0x1d56,-0x385,-0x1d55,-0x408,0x2d4,-0x6ea,0x3b4,-0x6ea,0x53c,-0x811, --0x38b,-0x3ef,-0x677,-0x811,0x3be,-0x3e1,0x5ca,-0x7f5,-0x54,-0x7f7,0x94,-0x3f5, --0x40d,-0x813,-0x40d,-0x1e6,-0xd24,-0x3f8,-0x1004,-0x812,-0x1008,-0x3fb,-0x1214, --0x3fd,-0x1dd4,-0x821,-0x1dd8,-0x409,-0xb8e,-0x6ff,-0xa99,-0x3ef,-0x2fa,-0x814, --0x72e,-0x814,-0xa99,-0x811,-0xd85,-0x3ef,-0x61c,-0x813,-0x61c,-0x1e6,-0xe0, --0x1c6,-0x32ab,-0x3f7,-0x26ed,-0x807,-0x32a9,-0x80b,-0x3b8,-0x81a,-0x3b8,-0x3f8, -0x144,-0x81a,0x285,-0x65c,0x35d,-0x71a,-0x22da,-0x3f0,-0x1aaf,-0x802,-0x17cf, --0x1e1,-0x1ab1,-0x1e3,-0x1e44,-0x1e4,-0x143b,-0x581,-0x143a,-0x7ff,-0x17cc, --0x801,0x94,-0x813,0x118,-0x3f5,0x118,-0x813,-0x26ef,-0x3f2,-0x34b7,-0x208, --0x32af,0x207,-0x30a7,-0x208,-0x2e9f,0x207,-0x2e9f,-0x410,0x2b89,-0x34e,0x2772, -0x24c,0x2f9d,-0x1c4,0x2f9b,0x24f,-0x272,-0x813,-0x272,-0x3f7,-0x64,-0x3f7,-0x474, --0x3f2,-0x266,-0x3f2,-0x266,-0x80e,-0x266,-0x806,-0x25f,-0x3ea,-0x51,-0x3ed, --0x6d2,-0x3f8,-0x1210,-0x814,-0x1e5b,-0x40a,-0x1e57,-0x821,0x130a,0x39,0x1514, -0x245,0x1516,-0x357,-0x2063,-0x823,-0x2274,-0x38b,-0x2502,-0x38d,-0x2277,0x9, --0x9be,-0x81a,-0xe64,-0x3f8,-0x9be,-0x3f8,-0x6d2,-0x81a,-0xf9a,-0x6f3,-0xe64, --0x81a,-0x117d,-0x81a,-0x889,-0x3f3,-0xd1f,-0x80f,-0x481,-0x3f7,-0x273,-0x3f7, --0x273,-0x813,0x1720,-0x1ce,-0x2797,0x210,-0x2589,0x6,0xbe7,-0x35b,0xa60,-0x35b, -0xbe6,0x37,-0x56,-0x3e2,0x7d1,0x35,-0xd85,-0x811,-0x1023,-0x710,-0xf4a,-0x653, -0x2154,-0x1ca,0x1929,0x246,0x2152,0x24a,0x33b0,0x251,0x33b2,-0x1c3,0x235d,0x24a, -0x2774,-0x34f,0x235e,-0x1c9,0x1721,-0x356,0x192a,-0x1cd,-0x2791,-0x413,0x176, -0x15e,0x29d,0xb4,0x176,0xb4,0x57,0x15e,0x57,0xb4,-0xc5,0x15e,-0xc5,0xb4,-0x25e, --0x3f1,-0x2e0,-0x64a,-0x2e0,-0x3f1,-0x25e,-0x64a,-0x1db,-0x3f1,-0x1db,-0x64a, --0x159,-0x64a,-0x1db,-0x3ef,-0x159,-0x3ef,0xb9,0x203,-0x96,0x168,-0x96,0x203, -0x27e,0x203,0xb9,0x168,-0xb0b,-0x6fe,0x139,-0x1c6,-0x89c,-0x4bd,-0x139,-0x3eb, --0xb6,-0x6ba,-0x139,-0x6ba,0x34a,0x15f,0x1f4,0xb0,0x1f4,0x15f,-0x181,0xb0,-0x181, -0x15f,-0x2e94,0x208,-0x2e8d,-0x41a,-0x14,-0x16b,0x233,-0x1c6,0x56d,-0x583,0x56d, --0x814,0x229,-0x651,0x229,-0x3ef,0x455,-0x3ef,0x53c,-0x3ef,0x455,-0x651,0x285, --0x3f8,0x4e1,-0x71a,0x4e1,-0x81a,-0x13b8,-0x581,-0xeef,-0x3f8,-0xeef,-0x65a, --0x117d,-0x3f8,-0x111a,-0x65a,-0x111a,-0x3f8,-0x1079,-0x6f3,-0x885,-0x80b,-0xf4a, --0x3ef,-0x11a7,-0x811,-0x11a7,-0x710,0x29d,0x15e,-0x25e,-0x64a,-0x25e,-0x3f1, --0x1db,-0x64a,0x27e,0x168,-0xbc5,-0x813,-0xbc5,-0x58f,-0x92d,-0x58f,-0x89c, --0x1e6,-0xb6,-0x3eb,0x34a,0xb0,-0xb0b,-0x7fb}; +const uint8_t levelMaterials[LEVEL_TRIANGLE_COUNT] = { + 0, // 0 + 1, // 1 + 1, // 2 + 1, // 3 + 0, // 4 + 1, // 5 + 0, // 6 + 0, // 7 + 0, // 8 + 0, // 9 + 0, // 10 + 1, // 11 + 1, // 12 + 0, // 13 + 1, // 14 + 0, // 15 + 0, // 16 + 0, // 17 + 2, // 18 + 0, // 19 + 0, // 20 + 0, // 21 + 0, // 22 + 0, // 23 + 0, // 24 + 0, // 25 + 0, // 26 + 0, // 27 + 0, // 28 + 0, // 29 + 0, // 30 + 1, // 31 + 0, // 32 + 0, // 33 + 0, // 34 + 0, // 35 + 0, // 36 + 0, // 37 + 0, // 38 + 0, // 39 + 0, // 40 + 1, // 41 + 0, // 42 + 1, // 43 + 0, // 44 + 0, // 45 + 0, // 46 + 0, // 47 + 0, // 48 + 0, // 49 + 0, // 50 + 0, // 51 + 0, // 52 + 0, // 53 + 1, // 54 + 1, // 55 + 0, // 56 + 1, // 57 + 1, // 58 + 1, // 59 + 1, // 60 + 2, // 61 + 0, // 62 + 0, // 63 + 0, // 64 + 0, // 65 + 0, // 66 + 0, // 67 + 0, // 68 + 1, // 69 + 2, // 70 + 1, // 71 + 0, // 72 + 0, // 73 + 0, // 74 + 0, // 75 + 0, // 76 + 0, // 77 + 0, // 78 + 2, // 79 + 0, // 80 + 0, // 81 + 0, // 82 + 0, // 83 + 0, // 84 + 0, // 85 + 0, // 86 + 0, // 87 + 0, // 88 + 0, // 89 + 0, // 90 + 0, // 91 + 2, // 92 + 1, // 93 + 1, // 94 + 0, // 95 + 0, // 96 + 1, // 97 + 1, // 98 + 0, // 99 + 0, // 100 + 1, // 101 + 1, // 102 + 2, // 103 + 0, // 104 + 0, // 105 + 0, // 106 + 0, // 107 + 0, // 108 + 1, // 109 + 1, // 110 + 1, // 111 + 1, // 112 + 1, // 113 + 1, // 114 + 1, // 115 + 1, // 116 + 0, // 117 + 2, // 118 + 2, // 119 + 0, // 120 + 1, // 121 + 1, // 122 + 2, // 123 + 1, // 124 + 1, // 125 + 2, // 126 + 2, // 127 + 2, // 128 + 2, // 129 + 2, // 130 + 2, // 131 + 2, // 132 + 2, // 133 + 2, // 134 + 2, // 135 + 2, // 136 + 2, // 137 + 2, // 138 + 2, // 139 + 2, // 140 + 2, // 141 + 2, // 142 + 2, // 143 + 2, // 144 + 2, // 145 + 2, // 146 + 2, // 147 + 2, // 148 + 2, // 149 + 2, // 150 + 1, // 151 + 0, // 152 + 0, // 153 + 0, // 154 + 0, // 155 + 0, // 156 + 1, // 157 + 0, // 158 + 0, // 159 + 0, // 160 + 0, // 161 + 0, // 162 + 0, // 163 + 0, // 164 + 0, // 165 + 0, // 166 + 0, // 167 + 1, // 168 + 1, // 169 + 0, // 170 + 1, // 171 + 1, // 172 + 1, // 173 + 1, // 174 + 0, // 175 + 1, // 176 + 0, // 177 + 0, // 178 + 0, // 179 + 2, // 180 + 0, // 181 + 0, // 182 + 0, // 183 + 0, // 184 + 0, // 185 + 0, // 186 + 0, // 187 + 0, // 188 + 0, // 189 + 0, // 190 + 0, // 191 + 0, // 192 + 0, // 193 + 0, // 194 + 0, // 195 + 0, // 196 + 0, // 197 + 0, // 198 + 0, // 199 + 0, // 200 + 0, // 201 + 0, // 202 + 0, // 203 + 0, // 204 + 0, // 205 + 0, // 206 + 0, // 207 + 1, // 208 + 1, // 209 + 1, // 210 + 0, // 211 + 0, // 212 + 0, // 213 + 0, // 214 + 1, // 215 + 1, // 216 + 1, // 217 + 2, // 218 + 0, // 219 + 0, // 220 + 0, // 221 + 1, // 222 + 2, // 223 + 0, // 224 + 0, // 225 + 0, // 226 + 0, // 227 + 0, // 228 + 0, // 229 + 0, // 230 + 0, // 231 + 0, // 232 + 0, // 233 + 2, // 234 + 2, // 235 + 1, // 236 + 1, // 237 + 1, // 238 + 1, // 239 + 0, // 240 + 0, // 241 + 0, // 242 + 0, // 243 + 0, // 244 + 1, // 245 + 0, // 246 + 0, // 247 + 1, // 248 + 2, // 249 + 1, // 250 + 1, // 251 + 1, // 252 + 1, // 253 + 2, // 254 + 1, // 255 + 1, // 256 + 1, // 257 + 2, // 258 + 2, // 259 + 2, // 260 + 2, // 261 + 0, // 262 + 0, // 263 + 0, // 264 + 0, // 265 + 0, // 266 + 1, // 267 + 0, // 268 + 0, // 269 + 0, // 270 + 1, // 271 + 0, // 272 + 0, // 273 + 0, // 274 + 0, // 275 + 0, // 276 + 0, // 277 + 0, // 278 + 1, // 279 + 1, // 280 + 0, // 281 + 0, // 282 + 1, // 283 + 0, // 284 + 0, // 285 + 2, // 286 + 2, // 287 + 0, // 288 + 0, // 289 + 0, // 290 + 2, // 291 + 2 // 292 +}; // levelMaterials -#define LEVELWALLS_UV_INDEX_COUNT 174 -const S3L_Index levelWallsUVIndices[LEVELWALLS_UV_INDEX_COUNT * 3] = { -0,1,2,3,4,5,6,7,8,9,10,11,10,9,8,10,8,7,12,13,14,15,16,17,18,14,13,3,19,4,20,21, -22,23,24,25,26,25,24,27,28,29,30,31,32,33,34,35,36,37,38,39,40,0,41,42,43,44,45, -46,39,13,12,47,48,49,50,51,52,3,53,19,1,54,2,27,55,56,57,58,54,46,59,60,55,61,30, -62,63,64,17,65,66,67,68,69,70,71,63,72,71,73,74,73,71,75,76,77,74,71,70,78,79,80, -70,63,81,82,83,84,84,85,86,85,84,83,87,88,89,88,90,89,91,92,93,94,95,96,97,98,99, -65,100,66,49,101,50,102,51,103,104,105,106,103,107,108,108,107,109,108,110,102, -111,112,113,114,113,100,115,116,117,118,119,47,120,121,122,123,106,105,9,124,8, -110,108,125,8,125,108,124,125,8,126,127,128,106,126,104,129,41,43,108,102,103, -128,104,126,128,127,130,131,132,133,127,41,130,134,135,136,89,137,138,139,140, -141,88,140,139,142,106,123,142,123,143,87,140,88,33,144,6,134,142,143,145,146, -147,148,147,149,150,149,151,152,153,154,155,156,157,158,159,160,161,162,163,164, -165,161,166,53,3,167,30,61,168,60,59,169,170,171,172,173,174,174,175,176,0,40,1, -6,144,7,15,67,16,177,11,10,10,178,177,20,179,21,30,167,31,167,180,31,181,182,32, -182,30,32,33,6,34,14,18,183,18,184,183,185,186,187,186,38,187,14,183,36,37,187, -38,14,36,38,39,12,40,44,78,45,47,119,48,50,101,51,1,57,54,27,29,55,57,131,58,46, -45,59,55,29,61,62,81,63,17,16,65,67,15,68,15,188,68,189,190,69,190,67,69,72,77, -71,5,4,191,77,72,75,78,44,79,65,114,100,49,48,101,102,52,51,111,116,112,114,111, -113,192,112,193,112,116,193,117,194,195,194,196,195,115,193,116,117,195,197,197, -115,117,118,198,119,199,58,133,58,131,133,131,200,132,200,201,132,127,42,41,134, -143,135,89,90,137,145,202,146,148,145,147,150,148,149,152,203,153,155,204,156, -158,205,159,161,165,162,164,206,165,207,208,209,168,210,60,59,207,209,209,168,59, -169,211,170,172,212,173,174,173,175,75,72,191,5,191,72,3,129,166,129,43,166,166, -43,213,141,140,134,134,140,142}; +#define LEVEL_UV_COUNT 344 +const S3L_Unit levelUVs[LEVEL_UV_COUNT * 2] = { + -1655, -1007, // 0 + -2184, -2065, // 2 + -2184, -1007, // 4 + 402, 699, // 6 + -690, 699, // 8 + -144, 1246, // 10 + 402, 1246, // 12 + -690, -393, // 14 + -144, 152, // 16 + -144, -393, // 18 + -3482, -1000, // 20 + -5047, -2047, // 22 + -4005, -478, // 24 + -144, 1714, // 26 + -10129, -912, // 28 + -10653, -1045, // 30 + -10653, -914, // 32 + -10659, 525, // 34 + -11394, -1048, // 36 + -11400, 522, // 38 + -907, -2065, // 40 + -378, -1007, // 42 + 282, -2065, // 44 + 402, 2339, // 46 + 948, 1246, // 48 + 324, -1016, // 50 + -423, -2074, // 52 + -423, -1016, // 54 + 402, 1246, // 56 + 1495, 699, // 58 + 402, 699, // 60 + 282, -1007, // 62 + -2958, -2044, // 64 + 553, -430, // 66 + -60, 942, // 68 + 553, 942, // 70 + 460, -253, // 72 + 21, 729, // 74 + 460, 729, // 76 + -98, -1023, // 78 + -624, -2074, // 80 + -624, -1023, // 82 + -1150, -1023, // 84 + -1838, -992, // 86 + -1838, -857, // 88 + -762, -454, // 90 + -224, -2068, // 92 + 563, -1196, // 94 + 711, -1411, // 96 + -9474, -1040, // 98 + -7510, -901, // 100 + -7509, -1032, // 102 + 724, -1770, // 104 + 948, -1770, // 106 + 1340, -2065, // 108 + -907, -1007, // 110 + -1655, -2065, // 112 + 958, -993, // 114 + 1482, -2037, // 116 + -84, -2039, // 118 + 148, -1013, // 120 + -1037, -2067, // 122 + -1037, -486, // 124 + -3364, -1016, // 126 + -4100, -2066, // 128 + -4104, -1019, // 130 + -4628, -1021, // 132 + -7636, -2081, // 134 + -7640, -1033, // 136 + -1237, 699, // 138 + -1237, 152, // 140 + -2958, -1791, // 142 + -2713, -1007, // 144 + -762, -2068, // 146 + -1838, -2068, // 148 + -2713, -2065, // 150 + -3461, -1007, // 152 + -1564, -2067, // 154 + -1564, -486, // 156 + -224, -454, // 158 + -12971, -1015, // 160 + -9965, -2055, // 162 + -12969, -2059, // 164 + -952, -2074, // 166 + -952, -1016, // 168 + 324, -2074, // 170 + 645, -1628, // 172 + 861, -1818, // 174 + 538, -1247, // 176 + 538, -673, // 178 + 2588, -393, // 180 + -8922, -1008, // 182 + -6831, -2050, // 184 + 3681, -1486, // 186 + 2724, -393, // 188 + 3681, -393, // 190 + -6095, -481, // 192 + -6833, -483, // 194 + -7748, -484, // 196 + -5179, -1409, // 198 + -5178, -2047, // 200 + -6092, -2049, // 202 + 148, -2067, // 204 + 280, -1013, // 206 + 280, -2067, // 208 + -9967, -1010, // 210 + -13495, -520, // 212 + -12975, 519, // 214 + -12455, -520, // 216 + -11935, 519, // 218 + -11935, -1040, // 220 + 11145, -846, // 222 + 10098, 588, // 224 + 12189, -452, // 226 + -144, -940, // 228 + 2041, 152, // 230 + 2041, -940, // 232 + -1237, -940, // 234 + -2057, 152, // 236 + -1237, 152, // 238 + 12187, 591, // 240 + -3150, 152, // 242 + -3150, -940, // 244 + 2588, -1486, // 246 + 2588, -940, // 248 + 3681, -1486, // 250 + 2588, 152, // 252 + -690, 152, // 254 + -144, 152, // 256 + 467, -256, // 258 + 22, 740, // 260 + 467, 740, // 262 + -626, -2067, // 264 + -626, -1015, // 266 + -100, -1015, // 268 + -1140, -1010, // 270 + -614, -1010, // 272 + -614, -2062, // 274 + -614, -2054, // 276 + -607, -1002, // 278 + -81, -1005, // 280 + -1746, -1016, // 282 + -4624, -2068, // 284 + -7771, -1034, // 286 + -7767, -2081, // 288 + 4874, 57, // 290 + 5396, 581, // 292 + 5398, -855, // 294 + -690, -940, // 296 + 1, 2256, // 298 + -500, 501, // 300 + 1, 501, // 302 + -8291, -2083, // 304 + -8820, -907, // 306 + -9474, -909, // 308 + -8823, 9, // 310 + -2494, -2074, // 312 + -3684, -1016, // 314 + -2494, -1016, // 316 + -1746, -2074, // 318 + -3994, -1779, // 320 + -3684, -2074, // 322 + -4477, -2074, // 324 + -2185, -1011, // 326 + -3359, -2063, // 328 + 466, -246, // 330 + 26, 736, // 332 + 466, 736, // 334 + -1153, -1015, // 336 + -627, -1015, // 338 + -627, -2067, // 340 + 5920, -462, // 342 + -10135, 528, // 344 + -9609, 6, // 346 + 3047, -859, // 348 + 2656, -859, // 350 + 3046, 55, // 352 + -86, -994, // 354 + 2001, 53, // 356 + 502, 3259, // 358 + -625, 2256, // 360 + 502, 2256, // 362 + -2057, 1246, // 364 + 402, -1247, // 366 + 402, -1349, // 368 + -827, -1349, // 370 + -3461, -2065, // 372 + -4131, -1808, // 374 + -3914, -1619, // 376 + -144, -1486, // 378 + 8532, -458, // 380 + 6441, 582, // 382 + 8530, 586, // 384 + 13232, 593, // 386 + 13234, -451, // 388 + 2588, 699, // 390 + 3681, 699, // 392 + -500, -3008, // 394 + 502, -2005, // 396 + -500, -2005, // 398 + 9053, 586, // 400 + 10100, -847, // 402 + 9054, -457, // 404 + 5921, -854, // 406 + 6442, -461, // 408 + 2724, 836, // 410 + 3681, 836, // 412 + -1374, 16, // 414 + -1374, -1896, // 416 + -1920, -1896, // 418 + -1920, 1246, // 420 + -1374, 836, // 422 + -280, 1382, // 424 + -827, 836, // 426 + -280, 1714, // 428 + -3150, 2339, // 430 + -3150, 1246, // 432 + -10129, -1043, // 434 + -1001, 3259, // 436 + -625, 3259, // 438 + -1001, 1003, // 440 + 2041, 699, // 442 + -1503, 1003, // 444 + 3681, 1792, // 446 + 3134, 2339, // 448 + 1004, 2256, // 450 + 2007, 3259, // 452 + 2007, 627, // 454 + 1004, 2131, // 456 + 1129, 627, // 458 + 628, 1128, // 460 + 628, 1629, // 462 + -123, 1629, // 464 + -1879, 2131, // 466 + -1879, 1629, // 468 + -625, 1128, // 470 + -1377, 0, // 472 + -1377, 1128, // 474 + 1, 1504, // 476 + 502, 1003, // 478 + 502, 1504, // 480 + -500, 1003, // 482 + -500, -125, // 484 + 1004, 501, // 486 + 2007, -1504, // 488 + 2007, 501, // 490 + 502, -1504, // 492 + 502, -2005, // 494 + -500, -2005, // 496 + -1503, -125, // 498 + -1503, -3008, // 500 + -500, -2131, // 502 + 628, -2131, // 504 + 1505, -3008, // 506 + 2007, -2507, // 508 + 2007, -1629, // 510 + 628, -1629, // 512 + 374, 350, // 514 + 669, 180, // 516 + 374, 180, // 518 + 87, 350, // 520 + 87, 180, // 522 + -197, 350, // 524 + -197, 180, // 526 + -606, -1009, // 528 + -736, -1610, // 530 + -736, -1009, // 532 + -606, -1610, // 534 + -475, -1009, // 536 + -475, -1610, // 538 + 402, -673, // 540 + -345, -1610, // 542 + -475, -1007, // 544 + -345, -1007, // 546 + 185, 515, // 548 + -150, 360, // 550 + -150, 515, // 552 + 638, 515, // 554 + 185, 360, // 556 + -2827, -1790, // 558 + 313, -454, // 560 + -2204, -1213, // 562 + -313, -1003, // 564 + -182, -1722, // 566 + -313, -1722, // 568 + 842, 351, // 570 + 500, 176, // 572 + 500, 351, // 574 + -385, 176, // 576 + -385, 351, // 578 + 948, 2339, // 580 + 2041, 1246, // 582 + 2041, 1499, // 584 + 1495, 1246, // 586 + -11924, 520, // 588 + -11917, -1050, // 590 + -60, -430, // 592 + 21, -253, // 594 + 563, -454, // 596 + 1389, -1411, // 598 + 1389, -2068, // 600 + 553, -1617, // 602 + 553, -1007, // 604 + 1109, -1007, // 606 + 1340, -1007, // 608 + 1109, -1617, // 610 + 645, -1016, // 612 + 1249, -1818, // 614 + 1249, -2074, // 616 + 538, -1486, // 618 + 538, -393, // 620 + -5048, -1409, // 622 + 22, -256, // 624 + -3823, -1016, // 626 + -3823, -1626, // 628 + -4477, -1016, // 630 + -4378, -1626, // 632 + -4378, -1016, // 634 + -4217, -1779, // 636 + -2181, -2059, // 638 + 26, -246, // 640 + -827, -530, // 642 + 402, -530, // 644 + -3914, -1007, // 646 + -4519, -2065, // 648 + -4519, -1808, // 650 + 2041, -1486, // 652 + 502, -3008, // 654 + 2178, 1499, // 656 + 2178, 836, // 658 + -625, 0, // 660 + 669, 350, // 662 + -606, -1610, // 664 + -606, -1009, // 666 + -475, -1610, // 668 + 638, 360, // 670 + -3013, -2067, // 672 + -3013, -1423, // 674 + -2349, -1423, // 676 + -2204, -486, // 678 + -182, -1003, // 680 + 842, 176, // 682 + -2827, -2043, // 684 + -1503, -3008 // 686 +}; // levelUVs -#define LEVELFLOOR_TRIANGLE_COUNT 70 -const S3L_Index levelFloorTriangleIndices[LEVELFLOOR_TRIANGLE_COUNT * 3] = { -6,0,1,4,6,1,13,5,15,4,1,128,13,0,5,3,11,4,23,29,24,2,0,7,122,121,41,62,57,61,70, -31,72,69,84,83,85,84,86,77,73,99,32,99,73,70,28,26,71,83,28,84,69,86,85,46,84, -115,102,40,57,62,41,72,90,70,73,31,32,78,101,32,61,19,35,38,40,12,104,38,12,105, -38,104,38,105,37,37,109,8,105,132,109,112,46,82,36,31,29,29,26,24,35,19,66,66,19, -65,46,112,105,116,122,115,6,5,0,3,4,128,13,7,0,3,9,11,16,11,136,11,9,136,23,25, -29,62,27,41,27,122,41,121,22,41,70,26,31,32,101,99,70,71,28,71,69,83,85,82,46,40, -39,116,39,103,116,116,115,40,72,76,90,73,72,31,61,57,19,38,39,40,37,105,109,3, -105,112,29,31,26,65,19,139,19,17,139,116,121,122,128,132,3,136,65,139,136,9,65, -105,3,132}; +#define LEVEL_UV_INDEX_COUNT 293 +const S3L_Index levelUVIndices[LEVEL_UV_INDEX_COUNT * 3] = { + 0, 1, 2, // 0 + 3, 4, 5, // 3 + 6, 3, 5, // 6 + 7, 8, 9, // 9 + 10, 11, 12, // 12 + 6, 5, 13, // 15 + 14, 15, 16, // 18 + 17, 18, 19, // 21 + 18, 17, 16, // 24 + 18, 16, 15, // 27 + 20, 21, 22, // 30 + 7, 4, 8, // 33 + 23, 24, 6, // 36 + 25, 26, 27, // 39 + 28, 29, 30, // 42 + 31, 22, 21, // 45 + 10, 32, 11, // 48 + 33, 34, 35, // 51 + 36, 37, 38, // 54 + 39, 40, 41, // 57 + 42, 41, 40, // 60 + 43, 44, 45, // 63 + 46, 47, 48, // 66 + 49, 50, 51, // 69 + 52, 53, 54, // 72 + 55, 56, 0, // 75 + 57, 58, 59, // 78 + 60, 61, 62, // 81 + 55, 21, 20, // 84 + 63, 64, 65, // 87 + 66, 67, 68, // 90 + 69, 4, 70, // 93 + 10, 71, 32, // 96 + 1, 72, 2, // 99 + 43, 73, 74, // 102 + 75, 76, 72, // 105 + 62, 77, 78, // 108 + 73, 79, 46, // 111 + 80, 81, 82, // 114 + 27, 83, 84, // 117 + 85, 86, 87, // 120 + 88, 89, 90, // 123 + 91, 92, 81, // 126 + 93, 94, 95, // 129 + 96, 92, 97, // 132 + 98, 97, 92, // 135 + 99, 100, 101, // 138 + 98, 92, 91, // 141 + 102, 103, 104, // 144 + 91, 81, 105, // 147 + 106, 107, 108, // 150 + 108, 109, 110, // 153 + 109, 108, 107, // 156 + 111, 112, 113, // 159 + 114, 115, 116, // 162 + 117, 118, 119, // 165 + 112, 120, 113, // 168 + 121, 118, 122, // 171 + 123, 124, 125, // 174 + 126, 125, 124, // 177 + 114, 127, 128, // 180 + 129, 130, 131, // 183 + 132, 133, 134, // 186 + 135, 136, 137, // 189 + 138, 139, 140, // 192 + 83, 141, 84, // 195 + 65, 142, 66, // 198 + 143, 67, 144, // 201 + 145, 146, 147, // 204 + 148, 119, 127, // 207 + 149, 150, 151, // 210 + 118, 117, 122, // 213 + 144, 152, 153, // 216 + 153, 152, 154, // 219 + 153, 155, 143, // 222 + 156, 157, 158, // 225 + 159, 158, 141, // 228 + 160, 161, 162, // 231 + 163, 164, 63, // 234 + 165, 166, 167, // 237 + 168, 169, 170, // 240 + 171, 147, 146, // 243 + 17, 172, 16, // 246 + 155, 153, 173, // 249 + 16, 173, 153, // 252 + 172, 173, 16, // 255 + 174, 175, 176, // 258 + 147, 174, 145, // 261 + 177, 57, 59, // 264 + 153, 143, 144, // 267 + 176, 145, 174, // 270 + 176, 175, 178, // 273 + 179, 180, 181, // 276 + 121, 182, 118, // 279 + 183, 184, 185, // 282 + 186, 187, 188, // 285 + 175, 57, 178, // 288 + 94, 93, 90, // 291 + 116, 189, 114, // 294 + 190, 191, 192, // 297 + 113, 193, 194, // 300 + 124, 115, 126, // 303 + 195, 196, 126, // 306 + 197, 198, 199, // 309 + 200, 201, 202, // 312 + 112, 201, 200, // 315 + 203, 147, 171, // 318 + 203, 171, 204, // 321 + 111, 201, 112, // 324 + 95, 205, 206, // 327 + 207, 185, 208, // 330 + 209, 207, 208, // 333 + 210, 207, 209, // 336 + 207, 210, 211, // 339 + 211, 212, 213, // 342 + 210, 214, 212, // 345 + 215, 182, 216, // 348 + 49, 217, 14, // 351 + 218, 180, 219, // 354 + 220, 180, 218, // 357 + 190, 203, 204, // 360 + 221, 115, 29, // 363 + 29, 128, 30, // 366 + 220, 222, 150, // 369 + 206, 205, 223, // 372 + 223, 205, 224, // 375 + 181, 225, 179, // 378 + 179, 225, 226, // 381 + 227, 228, 229, // 384 + 229, 228, 230, // 387 + 230, 228, 231, // 390 + 228, 232, 231, // 393 + 233, 234, 232, // 396 + 234, 235, 232, // 399 + 236, 235, 237, // 402 + 238, 239, 240, // 405 + 241, 242, 239, // 408 + 239, 242, 243, // 411 + 244, 243, 242, // 414 + 244, 245, 243, // 417 + 246, 244, 242, // 420 + 247, 246, 248, // 423 + 246, 242, 248, // 426 + 242, 249, 248, // 429 + 250, 248, 249, // 432 + 248, 250, 251, // 435 + 251, 250, 252, // 438 + 250, 253, 252, // 441 + 253, 254, 252, // 444 + 254, 255, 252, // 447 + 256, 252, 255, // 450 + 182, 215, 210, // 453 + 257, 258, 259, // 456 + 260, 259, 261, // 459 + 262, 261, 263, // 462 + 264, 265, 266, // 465 + 267, 268, 269, // 468 + 270, 88, 183, // 471 + 271, 272, 273, // 474 + 274, 275, 276, // 477 + 277, 278, 274, // 480 + 279, 71, 10, // 483 + 280, 46, 79, // 486 + 281, 78, 77, // 489 + 282, 283, 284, // 492 + 285, 286, 287, // 495 + 287, 288, 289, // 498 + 0, 56, 1, // 501 + 3, 8, 4, // 504 + 23, 6, 13, // 507 + 14, 217, 15, // 510 + 7, 70, 4, // 513 + 23, 290, 24, // 516 + 291, 24, 292, // 519 + 24, 290, 292, // 522 + 25, 85, 26, // 525 + 28, 293, 29, // 528 + 294, 19, 18, // 531 + 18, 295, 294, // 534 + 33, 296, 34, // 537 + 36, 297, 37, // 540 + 46, 280, 47, // 543 + 280, 298, 47, // 546 + 299, 300, 48, // 549 + 300, 46, 48, // 552 + 49, 14, 50, // 555 + 22, 31, 301, // 558 + 31, 302, 301, // 561 + 303, 304, 305, // 564 + 304, 54, 305, // 567 + 22, 301, 52, // 570 + 53, 305, 54, // 573 + 22, 52, 54, // 576 + 55, 20, 56, // 579 + 60, 102, 61, // 582 + 63, 164, 64, // 585 + 66, 142, 67, // 588 + 1, 75, 72, // 591 + 43, 45, 73, // 594 + 75, 186, 76, // 597 + 62, 61, 77, // 600 + 73, 45, 79, // 603 + 80, 105, 81, // 606 + 27, 26, 83, // 609 + 85, 25, 86, // 612 + 25, 306, 86, // 615 + 307, 308, 87, // 618 + 308, 85, 87, // 621 + 93, 309, 90, // 624 + 309, 88, 90, // 627 + 89, 310, 90, // 630 + 96, 101, 92, // 633 + 12, 11, 311, // 636 + 101, 96, 99, // 639 + 102, 60, 103, // 642 + 114, 128, 115, // 645 + 126, 196, 125, // 648 + 114, 148, 127, // 651 + 129, 312, 130, // 654 + 83, 159, 141, // 657 + 65, 64, 142, // 660 + 143, 68, 67, // 663 + 148, 117, 119, // 666 + 149, 180, 150, // 669 + 156, 161, 157, // 672 + 159, 156, 158, // 675 + 313, 157, 314, // 678 + 157, 161, 314, // 681 + 162, 315, 316, // 684 + 315, 317, 316, // 687 + 160, 314, 161, // 690 + 162, 316, 318, // 693 + 318, 160, 162, // 696 + 163, 319, 164, // 699 + 165, 320, 166, // 702 + 179, 219, 180, // 705 + 121, 216, 182, // 708 + 185, 321, 270, // 711 + 321, 322, 270, // 714 + 270, 183, 185, // 717 + 323, 76, 188, // 720 + 76, 186, 188, // 723 + 186, 324, 187, // 726 + 324, 325, 187, // 729 + 175, 58, 57, // 732 + 116, 326, 189, // 735 + 190, 204, 191, // 738 + 113, 120, 193, // 741 + 124, 116, 115, // 744 + 197, 327, 198, // 747 + 95, 94, 205, // 750 + 207, 321, 185, // 753 + 211, 210, 212, // 756 + 23, 210, 215, // 759 + 220, 150, 180, // 762 + 29, 115, 128, // 765 + 224, 205, 328, // 768 + 205, 329, 328, // 771 + 228, 233, 232, // 774 + 234, 237, 235, // 777 + 236, 330, 235, // 780 + 238, 241, 239, // 783 + 257, 331, 258, // 786 + 260, 257, 259, // 789 + 262, 260, 261, // 792 + 264, 332, 265, // 795 + 267, 333, 268, // 798 + 270, 89, 88, // 801 + 271, 334, 272, // 804 + 274, 278, 275, // 807 + 277, 335, 278, // 810 + 13, 214, 23, // 813 + 336, 337, 338, // 816 + 281, 339, 78, // 819 + 77, 336, 338, // 822 + 338, 281, 77, // 825 + 282, 340, 283, // 828 + 285, 341, 286, // 831 + 287, 286, 288, // 834 + 292, 224, 328, // 837 + 292, 290, 224, // 840 + 99, 96, 311, // 843 + 12, 311, 96, // 846 + 210, 23, 214, // 849 + 10, 177, 279, // 852 + 177, 59, 279, // 855 + 225, 227, 226, // 858 + 228, 227, 225, // 861 + 279, 59, 342, // 864 + 202, 201, 190, // 867 + 190, 201, 203, // 870 + 150, 222, 343, // 873 + 343, 197, 150 // 876 +}; // levelUVIndices -#define LEVELFLOOR_UV_COUNT 70 -const S3L_Unit levelFloorUVs[LEVELFLOOR_UV_COUNT * 2] = { -0x192,0x2bb,-0x2b2,0x2bb,-0x90,0x4de,0x192,0x4de,-0x2b2,-0x189,-0x90,0x98,-0x90, --0x189,-0x90,0x6b2,0x192,0x923,0x3b4,0x4de,0x192,0x4de,0x5d7,0x2bb,0x192,0x2bb, --0x4d5,0x2bb,-0x4d5,0x98,0x21a,-0x4df,0x21a,-0x2a1,0xa1c,-0x189,0xe61,-0x5ce, -0xaa4,-0x189,0xe61,-0x189,-0x90,-0x3ac,0x7f9,0x98,0x7f9,-0x3ac,-0x4d5,-0x3ac, --0x809,0x98,-0x4d5,0x98,-0xc4e,0x98,-0xc4e,-0x3ac,0xa1c,-0x5ce,0xa1c,-0x3ac, -0xe61,-0x5ce,0xa1c,0x98,-0x2b2,0x98,-0x90,0x98,-0x2b2,-0x3ac,-0x809,0x4de,0x192, --0x4df,0x192,-0x545,-0x33b,-0x545,-0x90,-0x5ce,0xa1c,0x2bb,0xe61,0x2bb,0xaa4, -0x344,0xe61,0x344,-0x55e,0x10,-0x55e,-0x768,-0x780,-0x768,-0x780,0x4de,-0x55e, -0x344,-0x118,0x566,-0x33b,0x344,-0x118,0x6b2,-0xc4e,0x923,-0xc4e,0x4de,0x7f9, -0x2bb,0xe61,0x700,0xc3e,0x923,0x192,-0x2a1,0x3b4,0x923,0x7f9,0x4de,0x7f9,0x5db, -0x5d7,0x4de,0x21a,-0x5ce,0x21a,-0x189,-0x33b,-0x212,0x192,-0x212,0x7f9,-0x5ce, -0x882,0x5db,0x882,0x344}; +S3L_Model3D levelModel; -#define LEVELFLOOR_UV_INDEX_COUNT 70 -const S3L_Index levelFloorUVIndices[LEVELFLOOR_UV_INDEX_COUNT * 3] = { -0,1,2,3,0,2,4,5,6,3,2,7,4,1,5,8,9,3,10,11,12,13,1,14,15,16,17,18,19,20,21,22,23, -24,25,26,27,25,28,29,30,31,32,31,30,21,33,34,35,26,33,25,24,28,27,36,25,37,38,39, -19,18,17,23,40,21,30,22,32,41,42,32,20,43,44,45,39,46,47,45,46,48,45,47,45,48,49, -49,50,51,48,52,50,53,36,54,55,22,11,11,34,12,44,43,56,56,43,57,36,53,48,58,15,37, -0,5,1,8,3,7,4,14,1,8,59,9,60,9,61,9,59,61,10,62,11,18,63,17,63,15,17,16,64,17,21, -34,22,32,42,31,21,35,33,35,24,26,27,54,36,39,65,58,65,66,58,58,37,39,23,67,40,30, -23,22,20,19,43,45,65,39,49,48,50,8,48,53,11,22,34,57,43,68,43,69,68,58,16,15,7, -52,8,61,57,68,61,59,57,48,8,52}; - -#define LEVELCEILING_TRIANGLE_COUNT 49 -const S3L_Index levelCeilingTriangleIndices[LEVELCEILING_TRIANGLE_COUNT * 3] = { -32,20,30,75,72,73,34,63,95,88,71,70,93,33,45,98,30,96,94,33,92,91,33,94,91,100, -63,45,81,93,93,81,113,111,108,110,110,108,10,10,108,80,108,79,80,107,87,79,87,49, -79,47,49,48,51,50,54,43,44,50,50,44,52,59,52,44,59,53,52,60,59,44,56,60,55,60,44, -55,44,14,55,64,55,14,55,64,58,58,64,18,64,68,18,68,67,18,67,21,18,42,18,21,32,31, -20,75,74,72,34,33,63,88,89,71,93,92,33,98,97,30,91,63,33,108,107,79,87,48,49,47, -106,49,51,43,50,81,111,113,108,111,81,63,100,114,114,98,63}; - -#define LEVELCEILING_UV_COUNT 60 -const S3L_Unit levelCeilingUVs[LEVELCEILING_UV_COUNT * 2] = { -0x1cc,-0xfd,0x15,0x2d9,0x1cc,0x2d9,0x1d3,-0x100,0x16,0x2e4,0x1d3,0x2e4,0x1,0x8d0, --0x1f4,0x1f5,0x1,0x1f5,0x1d2,-0xf6,0x1a,0x2e0,0x1d2,0x2e0,0x1f6,0xcbb,-0x271, -0x8d0,0x1f6,0x8d0,-0x1f4,-0xbc0,0x1f6,-0x7d5,-0x1f4,-0x7d5,-0x3e9,0xcbb,-0x271, -0xcbb,-0x3e9,0x3eb,-0x5df,0x3eb,0x3ec,0x8d0,0x7d7,0xcbb,0x7d7,0x273,0x3ec,0x853, -0x469,0x273,0x274,0x468,0x274,0x65d,-0x7b,0x65d,-0x757,0x853,-0x757,0x65d,-0x271, -0x468,-0x561,0x0,-0x561,0x468,0x1,0x5e0,0x1f6,0x3eb,0x1f6,0x5e0,-0x1f4,0x3eb, --0x1f4,-0x7d,0x3ec,0x1f5,0x7d7,-0x5e0,0x7d7,0x1f5,0x1f6,-0x5e0,0x1f6,-0x7d5, --0x1f4,-0x7d5,-0x5df,-0x7d,-0x5df,-0xbc0,-0x1f4,-0x853,0x274,-0x853,0x5e1,-0xbc0, -0x7d7,-0x9cb,0x7d7,-0x65d,0x274,-0x65d,0x15,-0xfd,0x16,-0x100,0x1a,-0xf6,0x1f6, --0xbc0,-0x271,0x0,-0x5df,-0xbc0}; - -#define LEVELCEILING_UV_INDEX_COUNT 49 -const S3L_Index levelCeilingUVIndices[LEVELCEILING_UV_INDEX_COUNT * 3] = { -0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,13,19,20,13,18,20,21,7,14,22,12, -12,22,23,24,25,26,26,25,27,27,25,28,25,29,28,30,31,29,31,32,29,33,32,34,35,36,37, -38,39,36,36,39,40,41,40,39,41,42,40,43,41,39,44,43,45,43,39,45,39,46,45,47,45,46, -45,47,48,48,47,49,47,50,49,50,51,49,51,52,49,53,49,52,0,54,1,3,55,4,6,13,7,9,56, -10,12,19,13,15,57,16,20,7,13,25,30,29,31,34,32,33,58,32,35,38,36,22,24,23,25,24, -22,7,21,59,59,15,7}; - -S3L_Model3D levelCeilingModel; -S3L_Model3D levelFloorModel; -S3L_Model3D levelWallsModel; - -void levelCeilingModelInit() +void levelModelInit() { S3L_initModel3D( levelVertices, LEVEL_VERTEX_COUNT, - levelCeilingTriangleIndices, - LEVELCEILING_TRIANGLE_COUNT, - &levelCeilingModel); -} - -void levelFloorModelInit() -{ - S3L_initModel3D( - levelVertices, - LEVEL_VERTEX_COUNT, - levelFloorTriangleIndices, - LEVELFLOOR_TRIANGLE_COUNT, - &levelFloorModel); -} - -void levelWallsModelInit() -{ - S3L_initModel3D( - levelVertices, - LEVEL_VERTEX_COUNT, - levelWallsTriangleIndices, - LEVELWALLS_TRIANGLE_COUNT, - &levelWallsModel); + levelTriangleIndices, + LEVEL_TRIANGLE_COUNT, + &levelModel); } #endif // guard diff --git a/programs/levelWallsModel.h b/programs/levelWallsModel.h deleted file mode 100644 index 4796649..0000000 --- a/programs/levelWallsModel.h +++ /dev/null @@ -1,149 +0,0 @@ -#ifndef LEVELWALLS_MODEL_H -#define LEVELWALLS_MODEL_H - -#define LEVELWALLS_VERTEX_COUNT 143 -const S3L_Unit levelWallsVertices[LEVELWALLS_VERTEX_COUNT * 3] = { --0x10cf,-0x54,-0x6bc,-0x8cf,-0x54,-0xebc,-0x18cf,-0x54,-0x6bc,-0xcf,-0x54, --0x1ebc,-0xcf,-0x54,-0xebc,-0x8cf,-0x54,0x143,-0xcf,-0x54,-0x6bc,-0x18cf,-0x54, -0x143,-0x12cf,-0x54,-0x8bc,0x730,-0x854,-0x1ebc,-0x12cf,0xfab,-0x8bc,0x730, --0x854,-0xebc,-0x1acf,-0x54,0x1f43,-0x10cf,-0x54,0x943,0x130,0xfab,0x1943,-0x8cf, --0x54,0x943,0x1730,-0x854,-0xebc,0x1930,-0x854,-0x8bc,0x2130,0xfab,-0x8bc,0x2130, --0x854,-0x8bc,0x1730,-0x854,-0x6bc,0x1930,0xfab,-0x1ebc,0x130,-0x54,0x943,-0xcf, --0x1854,-0xebc,-0xcf,-0x1854,-0x6bc,0xf30,-0x1854,-0xebc,-0x8cf,-0x1854,0x143, -0x130,-0x54,0x1943,-0x10cf,-0x1854,0x143,0xf30,-0x1854,-0x6bc,0x1f30,-0x854, --0x6bc,0x1730,-0x1854,0x143,0x1f30,-0x1854,0x143,-0x24cf,-0x254,0xb43,-0x24cf, --0x254,0x143,0x2f30,-0x854,-0x8bc,0x1730,-0x1854,-0x6bc,-0x1acf,-0x54,-0x8bc, --0x1acf,-0x54,0x343,-0x12cf,-0x54,0xb43,-0x12cf,-0x54,0x1743,0x1f30,-0x54,0x943, -0x1930,0xfab,-0x8bc,-0x10cf,0xfab,0x943,0x130,0xfab,0x943,-0x24cf,0xfab,-0x6bc, --0x24cf,-0x54,-0xebc,-0xcf,0xfab,0x1743,-0x12cf,0xfab,0x1743,-0x12cf,0xfab,0xb43, --0x10cf,0xfab,-0x6bc,-0x18cf,0xfab,0x143,-0x8cf,0xfab,-0xebc,-0x8cf,0xfab, --0x1ebc,-0x18cf,0xfab,-0x6bc,0x1f30,0xfab,0x943,0x1f30,0xfab,-0x6bc,0x2130,-0x54, -0x943,0x2130,0xfab,0x943,0x1730,0xfab,-0x1ebc,0x1730,0xfab,-0x6bc,0x2f30,-0x54, -0x943,0x2f30,-0x54,0x1943,-0x8cf,-0x254,0x943,0x2f30,0xfab,0x1943,0x2730,-0x854, --0x1ebc,0x2f30,-0x854,-0x16bc,0x2730,0xfab,-0x1ebc,0x2f30,0xfab,-0x16bc,-0x18cf, --0x1054,0x1143,-0x8cf,-0x1854,0x1143,-0x10cf,-0x1854,0x1143,0x1730,-0x1854, -0x1143,0x1f30,-0x1854,0x1143,0x1730,-0x854,0x1943,0x1f30,-0x854,0x1943,0x1730, --0x1854,0x1943,0x1f30,-0x1854,0x1943,0x1f30,-0x1854,-0x6bc,-0x1acf,0xfab,0x343, --0x1acf,0xfab,-0x8bc,-0x24cf,0xfab,-0xebc,-0x34cf,-0x54,-0xebc,-0x18cf,-0x1054, -0x143,-0x24cf,-0x1054,0x143,-0x34cf,-0x1054,0x143,-0x34cf,-0x1054,0x1143,-0x1acf, -0xfab,0x1f43,-0x8cf,-0x854,0x1943,-0x10cf,-0x854,0x1943,-0x8cf,-0x1854,0x1943, --0x10cf,-0x254,0x1143,-0x34cf,-0x254,0xb43,-0x34cf,0xfab,-0x6bc,-0x34cf,-0x254, -0x1143,-0x8cf,-0x254,0x143,0x1f30,-0x254,0x943,0x2f30,-0x854,-0x6bc,0x2f30, --0x254,0x943,0x2f30,-0x1854,0x1943,-0x10cf,-0x254,0x1943,0x2f30,-0x1854,-0x6bc, --0xcf,-0x54,0x1743,-0xcf,-0x54,0xb43,-0x22cf,-0x54,0x1f43,-0x22cf,-0x54,-0xebc, --0xcf,0xfab,0xb43,-0x22cf,0xfab,0x1f43,-0x22cf,0xfab,-0xebc,-0xacf,-0x54,-0x10bc, --0xacf,0xfab,-0x10bc,-0xacf,0xfab,-0x1ebc,-0x34cf,-0x54,-0x1ebc,-0x34cf,0xfab, --0x1ebc,0x2f30,-0x254,0x1943,-0xcf,-0x54,0x15c3,-0xcf,-0x54,0xd5c,-0xcf,0x8e5, -0x15c3,-0xcf,0xb35,0x1355,-0xcf,0xb35,0xff2,-0xcf,0x8e5,0xd5c,0x130,-0x54,0xd5c, -0x130,-0x54,0x15c3,0x130,0x8e5,0xd5c,0x130,0xb35,0xff2,0x130,0xb35,0x1355,0x130, -0x8e5,0x15c3,-0x8cf,0xbcb,-0x1ebc,-0x8cf,-0x54,-0x1599,-0x8cf,0xbcb,-0x18de, --0x8cf,0x8ed,-0x1599,-0xacf,0xbcb,-0x1ebc,-0xacf,-0x54,-0x1599,-0xacf,0xbcb, --0x18de,-0xacf,0x8ed,-0x1599,0x1730,0x5e7,-0x1ebc,0x1730,-0x854,-0x1274,0x1730, -0x2b5,-0x1274,0x1730,0x5e7,-0x14a9,0x1930,-0x854,-0x1274,0x1930,0x5e7,-0x1ebc, -0x1930,0x2b5,-0x1274,0x1930,0x5e7,-0x14a9}; - -#define LEVELWALLS_TRIANGLE_COUNT 174 -const S3L_Index levelWallsTriangleIndices[LEVELWALLS_TRIANGLE_COUNT * 3] = { -7,54,2,3,59,9,63,5,95,26,6,24,6,26,95,6,95,5,43,15,44,109,10,8,22,44,15,3,53,59, -29,16,20,29,20,36,31,36,20,41,96,30,60,137,138,22,96,41,124,125,14,13,51,7,82,93, -113,57,18,19,13,15,43,40,87,12,104,108,105,3,127,53,54,0,2,41,56,55,50,1,0,19,42, -17,56,20,60,27,64,14,8,80,37,110,134,133,61,68,64,65,68,66,35,66,68,140,21,67,35, -68,61,58,41,55,61,64,62,16,25,11,11,23,4,23,11,25,98,99,97,99,101,97,74,76,72,73, -77,75,30,78,32,80,38,37,12,107,104,46,108,81,69,71,91,81,45,34,34,45,33,34,84,46, -49,103,39,79,39,38,119,106,47,102,48,40,70,90,88,89,91,71,26,28,95,84,34,83,95, -83,34,28,83,95,94,92,86,91,94,69,112,82,113,34,46,81,86,69,94,86,92,85,52,129, -130,92,82,85,74,90,76,97,78,30,77,114,75,99,114,77,100,91,89,100,89,88,98,114,99, -22,15,63,74,100,88,124,120,119,125,119,118,126,118,117,122,117,115,123,116,120, -130,132,128,129,134,130,127,133,129,131,127,3,16,60,20,141,17,42,136,141,137,137, -142,138,138,140,135,7,51,54,63,15,5,109,110,10,23,24,6,6,4,23,29,25,16,60,16,137, -16,136,137,135,59,138,59,60,138,22,63,96,44,22,123,22,121,123,122,27,126,27,14, -126,44,123,124,125,126,14,44,124,14,13,43,51,57,58,18,40,48,87,104,107,108,54,50, -0,41,30,56,50,52,1,19,18,42,56,30,20,27,62,64,8,10,80,110,109,134,109,132,134, -131,111,133,111,110,133,65,67,68,9,59,135,67,65,140,58,57,41,80,79,38,12,87,107, -46,105,108,49,106,103,79,49,39,116,103,120,103,106,120,47,102,117,102,115,117, -119,120,106,47,117,118,118,119,47,102,47,48,128,1,130,1,52,130,52,53,129,53,127, -129,92,93,82,74,88,90,97,101,78,124,123,120,125,124,119,126,125,118,122,126,117, -123,121,116,130,134,132,129,133,134,127,131,133,21,140,142,141,139,17,42,21,142, -142,141,42,136,139,141,137,141,142,138,142,140,140,65,135,9,135,65,3,112,131,112, -113,131,131,113,111,75,114,74,74,114,100}; - -#define LEVELWALLS_UV_COUNT 214 -const S3L_Unit levelWallsUVs[LEVELWALLS_UV_COUNT * 2] = { --0x677,-0x3ef,-0x888,-0x811,-0x888,-0x3ef,-0xd9a,-0x3e8,-0x13b7,-0x7ff,-0xfa5, --0x1de,-0x2791,-0x390,-0x299d,-0x415,-0x299d,-0x392,-0x29a3,0x20d,-0x2c82,-0x418, --0x2c88,0x20a,-0x38b,-0x811,-0x17a,-0x3ef,0x11a,-0x811,0x144,-0x3f8,-0x1a7, --0x81a,-0x1a7,-0x3f8,0x11a,-0x3ef,-0xb8e,-0x7fc,0x211,-0x16b,-0x14,0x36b,0x211, -0x36b,-0x62,-0x3ff,-0x270,-0x81a,-0x270,-0x3ff,-0x47e,-0x3ff,-0x72e,-0x3e0, --0x72e,-0x359,-0x2fa,-0x1c6,-0xe0,-0x814,0x233,-0x4ac,0x2c7,-0x583,-0x2502, --0x410,-0x1d56,-0x385,-0x1d55,-0x408,0x2d4,-0x6ea,0x3b4,-0x6ea,0x53c,-0x811, --0x38b,-0x3ef,-0x677,-0x811,0x3be,-0x3e1,0x5ca,-0x7f5,-0x54,-0x7f7,0x94,-0x3f5, --0x40d,-0x813,-0x40d,-0x1e6,-0xd24,-0x3f8,-0x1004,-0x812,-0x1008,-0x3fb,-0x1214, --0x3fd,-0x1dd4,-0x821,-0x1dd8,-0x409,-0xb8e,-0x6ff,-0xa99,-0x3ef,-0x2fa,-0x814, --0x72e,-0x814,-0xa99,-0x811,-0xd85,-0x3ef,-0x61c,-0x813,-0x61c,-0x1e6,-0xe0, --0x1c6,-0x32ab,-0x3f7,-0x26ed,-0x807,-0x32a9,-0x80b,-0x3b8,-0x81a,-0x3b8,-0x3f8, -0x144,-0x81a,0x285,-0x65c,0x35d,-0x71a,-0x22da,-0x3f0,-0x1aaf,-0x802,-0x17cf, --0x1e1,-0x1ab1,-0x1e3,-0x1e44,-0x1e4,-0x143b,-0x581,-0x143a,-0x7ff,-0x17cc, --0x801,0x94,-0x813,0x118,-0x3f5,0x118,-0x813,-0x26ef,-0x3f2,-0x34b7,-0x208, --0x32af,0x207,-0x30a7,-0x208,-0x2e9f,0x207,-0x2e9f,-0x410,0x2b89,-0x34e,0x2772, -0x24c,0x2f9d,-0x1c4,0x2f9b,0x24f,-0x272,-0x813,-0x272,-0x3f7,-0x64,-0x3f7,-0x474, --0x3f2,-0x266,-0x3f2,-0x266,-0x80e,-0x266,-0x806,-0x25f,-0x3ea,-0x51,-0x3ed, --0x6d2,-0x3f8,-0x1210,-0x814,-0x1e5b,-0x40a,-0x1e57,-0x821,0x130a,0x39,0x1514, -0x245,0x1516,-0x357,-0x2063,-0x823,-0x2274,-0x38b,-0x2502,-0x38d,-0x2277,0x9, --0x9be,-0x81a,-0xe64,-0x3f8,-0x9be,-0x3f8,-0x6d2,-0x81a,-0xf9a,-0x6f3,-0xe64, --0x81a,-0x117d,-0x81a,-0x889,-0x3f3,-0xd1f,-0x80f,-0x481,-0x3f7,-0x273,-0x3f7, --0x273,-0x813,0x1720,-0x1ce,-0x2797,0x210,-0x2589,0x6,0xbe7,-0x35b,0xa60,-0x35b, -0xbe6,0x37,-0x56,-0x3e2,0x7d1,0x35,-0xd85,-0x811,-0x1023,-0x710,-0xf4a,-0x653, -0x2154,-0x1ca,0x1929,0x246,0x2152,0x24a,0x33b0,0x251,0x33b2,-0x1c3,0x235d,0x24a, -0x2774,-0x34f,0x235e,-0x1c9,0x1721,-0x356,0x192a,-0x1cd,-0x2791,-0x413,0x176, -0x15e,0x29d,0xb4,0x176,0xb4,0x57,0x15e,0x57,0xb4,-0xc5,0x15e,-0xc5,0xb4,-0x25e, --0x3f1,-0x2e0,-0x64a,-0x2e0,-0x3f1,-0x25e,-0x64a,-0x1db,-0x3f1,-0x1db,-0x64a, --0x159,-0x64a,-0x1db,-0x3ef,-0x159,-0x3ef,0xb9,0x203,-0x96,0x168,-0x96,0x203, -0x27e,0x203,0xb9,0x168,-0xb0b,-0x6fe,0x139,-0x1c6,-0x89c,-0x4bd,-0x139,-0x3eb, --0xb6,-0x6ba,-0x139,-0x6ba,0x34a,0x15f,0x1f4,0xb0,0x1f4,0x15f,-0x181,0xb0,-0x181, -0x15f,-0x2e94,0x208,-0x2e8d,-0x41a,-0x14,-0x16b,0x233,-0x1c6,0x56d,-0x583,0x56d, --0x814,0x229,-0x651,0x229,-0x3ef,0x455,-0x3ef,0x53c,-0x3ef,0x455,-0x651,0x285, --0x3f8,0x4e1,-0x71a,0x4e1,-0x81a,-0x13b8,-0x581,-0xeef,-0x3f8,-0xeef,-0x65a, --0x117d,-0x3f8,-0x111a,-0x65a,-0x111a,-0x3f8,-0x1079,-0x6f3,-0x885,-0x80b,-0xf4a, --0x3ef,-0x11a7,-0x811,-0x11a7,-0x710,0x29d,0x15e,-0x25e,-0x64a,-0x25e,-0x3f1, --0x1db,-0x64a,0x27e,0x168,-0xbc5,-0x813,-0xbc5,-0x58f,-0x92d,-0x58f,-0x89c, --0x1e6,-0xb6,-0x3eb,0x34a,0xb0,-0xb0b,-0x7fb}; - -#define LEVELWALLS_UV_INDEX_COUNT 174 -const S3L_Index levelWallsUVIndices[LEVELWALLS_UV_INDEX_COUNT * 3] = { -0,1,2,3,4,5,6,7,8,9,10,11,10,9,8,10,8,7,12,13,14,15,16,17,18,14,13,3,19,4,20,21, -22,23,24,25,26,25,24,27,28,29,30,31,32,33,34,35,36,37,38,39,40,0,41,42,43,44,45, -46,39,13,12,47,48,49,50,51,52,3,53,19,1,54,2,27,55,56,57,58,54,46,59,60,55,61,30, -62,63,64,17,65,66,67,68,69,70,71,63,72,71,73,74,73,71,75,76,77,74,71,70,78,79,80, -70,63,81,82,83,84,84,85,86,85,84,83,87,88,89,88,90,89,91,92,93,94,95,96,97,98,99, -65,100,66,49,101,50,102,51,103,104,105,106,103,107,108,108,107,109,108,110,102, -111,112,113,114,113,100,115,116,117,118,119,47,120,121,122,123,106,105,9,124,8, -110,108,125,8,125,108,124,125,8,126,127,128,106,126,104,129,41,43,108,102,103, -128,104,126,128,127,130,131,132,133,127,41,130,134,135,136,89,137,138,139,140, -141,88,140,139,142,106,123,142,123,143,87,140,88,33,144,6,134,142,143,145,146, -147,148,147,149,150,149,151,152,153,154,155,156,157,158,159,160,161,162,163,164, -165,161,166,53,3,167,30,61,168,60,59,169,170,171,172,173,174,174,175,176,0,40,1, -6,144,7,15,67,16,177,11,10,10,178,177,20,179,21,30,167,31,167,180,31,181,182,32, -182,30,32,33,6,34,14,18,183,18,184,183,185,186,187,186,38,187,14,183,36,37,187, -38,14,36,38,39,12,40,44,78,45,47,119,48,50,101,51,1,57,54,27,29,55,57,131,58,46, -45,59,55,29,61,62,81,63,17,16,65,67,15,68,15,188,68,189,190,69,190,67,69,72,77, -71,5,4,191,77,72,75,78,44,79,65,114,100,49,48,101,102,52,51,111,116,112,114,111, -113,192,112,193,112,116,193,117,194,195,194,196,195,115,193,116,117,195,197,197, -115,117,118,198,119,199,58,133,58,131,133,131,200,132,200,201,132,127,42,41,134, -143,135,89,90,137,145,202,146,148,145,147,150,148,149,152,203,153,155,204,156, -158,205,159,161,165,162,164,206,165,207,208,209,168,210,60,59,207,209,209,168,59, -169,211,170,172,212,173,174,173,175,75,72,191,5,191,72,3,129,166,129,43,166,166, -43,213,141,140,134,134,140,142}; - -S3L_Model3D levelWallsModel; - -void levelWallsModelInit() -{ - S3L_initModel3D( - levelWallsVertices, - LEVELWALLS_VERTEX_COUNT, - levelWallsTriangleIndices, - LEVELWALLS_TRIANGLE_COUNT, - &levelWallsModel); -} - -#endif // guard diff --git a/small3dlib.h b/small3dlib.h index ea02a19..d1d6b26 100644 --- a/small3dlib.h +++ b/small3dlib.h @@ -287,6 +287,8 @@ typedef struct } S3L_Vec4; static inline void S3L_initVec4(S3L_Vec4 *v); +static inline void S3L_setVec4(S3L_Vec4 *v, S3L_Unit x, S3L_Unit y, + S3L_Unit z, S3L_Unit w); static inline void S3L_vec3Add(S3L_Vec4 *result, S3L_Vec4 added); static inline void S3L_vec3Sub(S3L_Vec4 *result, S3L_Vec4 substracted); S3L_Unit S3L_vec3Length(S3L_Vec4 v); @@ -871,6 +873,14 @@ void S3L_initVec4(S3L_Vec4 *v) v->x = 0; v->y = 0; v->z = 0; v->w = S3L_FRACTIONS_PER_UNIT; } +void S3L_setVec4(S3L_Vec4 *v, S3L_Unit x, S3L_Unit y, S3L_Unit z, S3L_Unit w) +{ + v->x = x; + v->y = y; + v->z = z; + v->w = w; +} + void S3L_vec3Add(S3L_Vec4 *result, S3L_Vec4 added) { result->x += added.x; diff --git a/todo.txt b/todo.txt index 7a29338..3cee3d1 100644 --- a/todo.txt +++ b/todo.txt @@ -8,7 +8,7 @@ features: should be in a separate file? - objtool: An option to parse material groups and generate an array of - per-triangle material indices. + per-triangle material indices. DONE - PC == 2 (and possibly 1) could likely be accelerated by not using interpolate functions, but rather FastLerStates for the values recomputed after each diff --git a/tools/obj2array.py b/tools/obj2array.py index a18b5a7..194ef24 100644 --- a/tools/obj2array.py +++ b/tools/obj2array.py @@ -13,6 +13,7 @@ def printHelp(): print(" -c compact format (off by default)") print(" -t use direct instead of indexed UV coords (off by default)") print(" -h include header guards (for model per file)") + print(" -m include a material array (per-triangle)") print(" -nS use the name S for the model (defaut: \"model\")") print(" -sX scale the model by X (default: 512)") print(" -uY scale the U texture coord by Y (default: 512)") @@ -33,6 +34,7 @@ NAME = "model" GUARDS = False COMPACT = False INDEXED_UVS = True +MATERIALS = False for s in sys.argv: if s == "-c": @@ -41,6 +43,8 @@ for s in sys.argv: INDEXED_UVS = False elif s == "-h": GUARDS = True + elif s == "-m": + MATERIALS = True elif s[:2] == "-s": VERTEX_SCALE = int(s[2:]) elif s[:2] == "-u": @@ -58,6 +62,17 @@ vertices = [] uvs = [] triangles = [] triangleUVs = [] +materials = [] +materialNames = [] + +currentMatrial = 0 + +def getMaterialIndex(materialName): + try: + return materialNames.index(materialName) + except Exception: + materialNames.append(materialName) + return len(materialNames) - 1 # parse the file: @@ -88,6 +103,9 @@ for line in objFile: triangles.append(t) triangleUVs.append(u) + materials.append([currentMatrial]) + elif line[:7] == "usemtl ": + currentMatrial = getMaterialIndex(line[7:]) # print the result: @@ -160,6 +178,9 @@ print(arrayString(NAME + "Vertices",vertices,3,[VERTEX_SCALE],5,False,"S3L_Unit" print("#define " + NAME.upper() + "_TRIANGLE_COUNT " + str(len(triangles))) print(arrayString(NAME + "TriangleIndices",triangles,3,[1],5,True,"S3L_Index",NAME.upper() + "_TRIANGLE_COUNT * 3")) +if MATERIALS: + print(arrayString(NAME + "Materials",materials,1,[1],5,True,"uint8_t",NAME.upper() + "_TRIANGLE_COUNT")) + if INDEXED_UVS: print("#define " + NAME.upper() + "_UV_COUNT " + str(len(uvs))) print(arrayString(NAME + "UVs",uvs,2,[U_SCALE,V_SCALE],5,False,"S3L_Unit",NAME.upper() + "_UV_COUNT * 2"))