1
0
mirror of https://github.com/XProger/OpenLara.git synced 2025-02-24 23:42:49 +01:00

#11 fix title screen for PSX format

This commit is contained in:
XProger 2017-08-29 23:07:21 +03:00
parent ec6ab322bb
commit 28718a033e
5 changed files with 12 additions and 12 deletions

View File

@ -1412,8 +1412,10 @@ namespace TR {
initRoomMeshes();
initTiles(tiles4, tiles8, palette, cluts);
//delete[] tiles4; tiles4 = NULL;
delete[] tiles8; tiles8 = NULL;
//delete[] tiles4;
//tiles4 = NULL;
delete[] tiles8;
tiles8 = NULL;
// init flipmap states
isFlipped = false;
@ -1737,8 +1739,8 @@ namespace TR {
stream.read(mesh.rectangles, stream.read(mesh.rCount));
stream.read(mesh.triangles, stream.read(mesh.tCount));
for (int i = 0; i < mesh.rCount; i++) if (mesh.rectangles[i].texture < 300) mesh.rectangles[i].color = true;
for (int i = 0; i < mesh.tCount; i++) if (mesh.triangles[i].texture < 300) mesh.triangles[i].color = true;
for (int i = 0; i < mesh.rCount; i++) if (mesh.rectangles[i].texture < 256) mesh.rectangles[i].color = true;
for (int i = 0; i < mesh.tCount; i++) if (mesh.triangles[i].texture < 256) mesh.triangles[i].color = true;
break;
}
}
@ -1984,6 +1986,7 @@ namespace TR {
switch (version) {
case VER_TR1_PC : return palette[texture & 0xFF];
case VER_TR1_PSX : {
ASSERT((texture & 0x7FFF) < 256);
ObjectTexture &t = objectTextures[texture & 0x7FFF];
int idx = (t.texCoord[0].y * 256 + t.texCoord[0].x) / 2;
int part = t.texCoord[0].x % 2;

View File

@ -52,9 +52,6 @@ namespace Game {
}
void updateTick() {
if (Input::state[cInventory])
level->inventory.toggle();
float dt = Core::deltaTime;
if (Input::down[ikR]) // slow motion (for animation debugging)
Core::deltaTime /= 10.0f;

View File

@ -792,6 +792,9 @@ struct Level : IGame {
}
void update() {
if (Input::state[cInventory] && level.id != TR::TITLE)
inventory.toggle();
Sound::Sample *sndChanged = sndCurrent;
if (inventory.isActive() || level.id == TR::TITLE) {

View File

@ -337,15 +337,12 @@ struct Atlas {
delete[] indices;
uint32 *data = new uint32[width * height];
memset(data, 0, width * height * sizeof(data[0]));
fill(root, data);
fillInstances();
Texture *atlas = new Texture(width, height, Texture::RGBA, false, data, true, true);
FILE *f = fopen("atlas.raw", "wb");
fwrite(&data[0], width * height * 4, 1, f);
fclose(f);
delete[] data;
return atlas;
};

View File

@ -13,7 +13,7 @@
#define debugBreak() _asm { int 3 }
#endif
#define ASSERT(expr) if (expr) {} else { LOG("ASSERT %s in %s:%d\n", #expr, __FILE__, __LINE__); debugBreak(); }
#define ASSERT(expr) if (expr) {} else { LOG("ASSERT:\n %s:%d\n %s => %s\n", __FILE__, __LINE__, __FUNCTION__, #expr); debugBreak(); }
#ifndef ANDROID
#define LOG(...) printf(__VA_ARGS__)