mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-13 16:44:50 +02:00
#11 fix title screen for PSX format
This commit is contained in:
11
src/format.h
11
src/format.h
@@ -1412,8 +1412,10 @@ namespace TR {
|
|||||||
initRoomMeshes();
|
initRoomMeshes();
|
||||||
initTiles(tiles4, tiles8, palette, cluts);
|
initTiles(tiles4, tiles8, palette, cluts);
|
||||||
|
|
||||||
//delete[] tiles4; tiles4 = NULL;
|
//delete[] tiles4;
|
||||||
delete[] tiles8; tiles8 = NULL;
|
//tiles4 = NULL;
|
||||||
|
delete[] tiles8;
|
||||||
|
tiles8 = NULL;
|
||||||
|
|
||||||
// init flipmap states
|
// init flipmap states
|
||||||
isFlipped = false;
|
isFlipped = false;
|
||||||
@@ -1737,8 +1739,8 @@ namespace TR {
|
|||||||
|
|
||||||
stream.read(mesh.rectangles, stream.read(mesh.rCount));
|
stream.read(mesh.rectangles, stream.read(mesh.rCount));
|
||||||
stream.read(mesh.triangles, stream.read(mesh.tCount));
|
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.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 < 300) mesh.triangles[i].color = true;
|
for (int i = 0; i < mesh.tCount; i++) if (mesh.triangles[i].texture < 256) mesh.triangles[i].color = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1984,6 +1986,7 @@ namespace TR {
|
|||||||
switch (version) {
|
switch (version) {
|
||||||
case VER_TR1_PC : return palette[texture & 0xFF];
|
case VER_TR1_PC : return palette[texture & 0xFF];
|
||||||
case VER_TR1_PSX : {
|
case VER_TR1_PSX : {
|
||||||
|
ASSERT((texture & 0x7FFF) < 256);
|
||||||
ObjectTexture &t = objectTextures[texture & 0x7FFF];
|
ObjectTexture &t = objectTextures[texture & 0x7FFF];
|
||||||
int idx = (t.texCoord[0].y * 256 + t.texCoord[0].x) / 2;
|
int idx = (t.texCoord[0].y * 256 + t.texCoord[0].x) / 2;
|
||||||
int part = t.texCoord[0].x % 2;
|
int part = t.texCoord[0].x % 2;
|
||||||
|
@@ -52,9 +52,6 @@ namespace Game {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void updateTick() {
|
void updateTick() {
|
||||||
if (Input::state[cInventory])
|
|
||||||
level->inventory.toggle();
|
|
||||||
|
|
||||||
float dt = Core::deltaTime;
|
float dt = Core::deltaTime;
|
||||||
if (Input::down[ikR]) // slow motion (for animation debugging)
|
if (Input::down[ikR]) // slow motion (for animation debugging)
|
||||||
Core::deltaTime /= 10.0f;
|
Core::deltaTime /= 10.0f;
|
||||||
|
@@ -792,6 +792,9 @@ struct Level : IGame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void update() {
|
void update() {
|
||||||
|
if (Input::state[cInventory] && level.id != TR::TITLE)
|
||||||
|
inventory.toggle();
|
||||||
|
|
||||||
Sound::Sample *sndChanged = sndCurrent;
|
Sound::Sample *sndChanged = sndCurrent;
|
||||||
|
|
||||||
if (inventory.isActive() || level.id == TR::TITLE) {
|
if (inventory.isActive() || level.id == TR::TITLE) {
|
||||||
|
@@ -337,15 +337,12 @@ struct Atlas {
|
|||||||
delete[] indices;
|
delete[] indices;
|
||||||
|
|
||||||
uint32 *data = new uint32[width * height];
|
uint32 *data = new uint32[width * height];
|
||||||
|
memset(data, 0, width * height * sizeof(data[0]));
|
||||||
fill(root, data);
|
fill(root, data);
|
||||||
fillInstances();
|
fillInstances();
|
||||||
|
|
||||||
Texture *atlas = new Texture(width, height, Texture::RGBA, false, data, true, true);
|
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;
|
delete[] data;
|
||||||
return atlas;
|
return atlas;
|
||||||
};
|
};
|
||||||
|
@@ -13,7 +13,7 @@
|
|||||||
#define debugBreak() _asm { int 3 }
|
#define debugBreak() _asm { int 3 }
|
||||||
#endif
|
#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
|
#ifndef ANDROID
|
||||||
#define LOG(...) printf(__VA_ARGS__)
|
#define LOG(...) printf(__VA_ARGS__)
|
||||||
|
Reference in New Issue
Block a user