1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-01-17 12:58:50 +01:00

#368 remove partially duplicated textures, reduce total number of WAD texture tiles from 103 (6.5 mb) to 78 (4.9 mb)

This commit is contained in:
XProger 2022-02-07 01:47:25 +03:00
parent 859d9892f1
commit 401c854209
4 changed files with 549 additions and 429 deletions

View File

@ -880,7 +880,7 @@ struct TR1_PC
uint16* mesh = addElements(meshData, meshDataSize, sizeof(meshPlane) / sizeof(uint16));
memcpy(mesh, &meshPlane, sizeof(meshPlane));
*meshOffset = (mesh - meshData) * sizeof(uint16);
*meshOffset = uint32((mesh - meshData) * sizeof(uint16));
uint16* frame = addElements(frameData, frameDataSize, sizeof(meshPlaneFrame) / sizeof(uint16));
memcpy(frame, &meshPlaneFrame, sizeof(meshPlaneFrame));
@ -888,7 +888,7 @@ struct TR1_PC
Animation* anim = addElements(anims, animsCount, 1);
memset(anim, 0, sizeof(anim[0]));
anim->frameRate = 1;
anim->frameOffset = (frame - frameData) << 1;
anim->frameOffset = uint32((frame - frameData) << 1);
Node* node = (Node*)addElements(nodesData, nodesDataSize, sizeof(Node) / sizeof(uint32));
node->flags = 0;
@ -899,7 +899,7 @@ struct TR1_PC
model->count = 1;
model->start = meshOffsetsCount - 1;
model->animIndex = animsCount - 1;
model->nodeIndex = (uint32*)node - nodesData;
model->nodeIndex = uint32((uint32*)node - nodesData);
}
}

View File

@ -178,7 +178,7 @@ struct FileStream
if (!elements || !count)
return;
for (int32 i = 0; i < count; i++)
for (int32 i = 0; i < int32(count); i++)
{
write(elements[i]);
}
@ -665,7 +665,7 @@ uint8* loadBitmap(const char* fileName, int32* width, int32* height, int32* bpp)
uint8* data = new uint8[ihdr.biWidth * ihdr.biHeight * ihdr.biBitCount / 8];
data += ihdr.biWidth * ihdr.biHeight * ihdr.biBitCount / 8;
for (int32 i = 0; i < ihdr.biHeight; i++)
for (uint32 i = 0; i < ihdr.biHeight; i++)
{
data -= ihdr.biWidth * ihdr.biBitCount / 8;
fread(data, ihdr.biWidth * ihdr.biBitCount / 8, 1, f);

View File

@ -36,14 +36,16 @@ int main(int argc, char** argv)
if (strcmp(argv[1], "gba") == 0)
{
out_GBA out;
out.process(argv[2], pc, NULL);
out_GBA* out = new out_GBA();
out->process(argv[2], pc, NULL);
delete out;
}
if (strcmp(argv[1], "3do") == 0)
{
out_3DO out;
out.process(argv[2], pc, NULL);
out_3DO* out = new out_3DO();
out->process(argv[2], pc, NULL);
delete out;
}
for (int32 i = 0; i < LVL_MAX; i++)

File diff suppressed because it is too large Load Diff