mirror of
https://github.com/XProger/OpenLara.git
synced 2025-01-29 18:47:49 +01:00
#8 PSX cutscenes support
This commit is contained in:
parent
b0e380e064
commit
acb31d366e
BIN
bin/OpenLara.exe
BIN
bin/OpenLara.exe
Binary file not shown.
32
src/format.h
32
src/format.h
@ -824,11 +824,10 @@ namespace TR {
|
|||||||
int16 weapons[4];
|
int16 weapons[4];
|
||||||
} extra;
|
} extra;
|
||||||
|
|
||||||
Level(Stream &stream, bool demo) : cutEntity(-1) {
|
Level(Stream &stream, bool demo) {
|
||||||
tiles4 = NULL;
|
memset(this, 0, sizeof(*this));
|
||||||
|
cutEntity = -1;
|
||||||
Tile8 *tiles8 = NULL;
|
Tile8 *tiles8 = NULL;
|
||||||
cluts = NULL;
|
|
||||||
palette = NULL;
|
|
||||||
|
|
||||||
int soundOffset = 0;
|
int soundOffset = 0;
|
||||||
|
|
||||||
@ -838,7 +837,7 @@ namespace TR {
|
|||||||
stream.read(version);
|
stream.read(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (version != VER_TR1_PC && version != VER_TR1_PSX) {
|
if (version && version != VER_TR1_PC && version != VER_TR1_PSX) {
|
||||||
LOG("unsupported level format\n");
|
LOG("unsupported level format\n");
|
||||||
ASSERT(false);
|
ASSERT(false);
|
||||||
memset(this, 0, sizeof(*this));
|
memset(this, 0, sizeof(*this));
|
||||||
@ -868,19 +867,21 @@ namespace TR {
|
|||||||
// sound data
|
// sound data
|
||||||
stream.setPos(2600 + numSounds * 512);
|
stream.setPos(2600 + numSounds * 512);
|
||||||
stream.read(soundData, soundDataSize);
|
stream.read(soundData, soundDataSize);
|
||||||
// tiles
|
|
||||||
stream.setPos(offsetTexTiles + 8);
|
stream.setPos(offsetTexTiles + 8);
|
||||||
stream.read(tiles4, tilesCount = 13);
|
} else if (version == VER_TR1_PC) {
|
||||||
stream.read(cluts, 512);
|
|
||||||
|
|
||||||
stream.seek(0x4000 + 4);
|
|
||||||
} else {
|
|
||||||
soundSize = NULL;
|
|
||||||
// tiles
|
// tiles
|
||||||
stream.read(tiles8, stream.read(tilesCount));
|
stream.read(tiles8, stream.read(tilesCount));
|
||||||
stream.read(unused);
|
stream.read(unused);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!version /*PSX cutscene*/ || version == VER_TR1_PSX) {
|
||||||
|
version = VER_TR1_PSX;
|
||||||
|
// tiles
|
||||||
|
stream.read(tiles4, tilesCount = 13);
|
||||||
|
stream.read(cluts, 512);
|
||||||
|
stream.seek(0x4000 + 4);
|
||||||
|
}
|
||||||
|
|
||||||
// rooms
|
// rooms
|
||||||
rooms = new Room[stream.read(roomsCount)];
|
rooms = new Room[stream.read(roomsCount)];
|
||||||
for (int i = 0; i < roomsCount; i++) {
|
for (int i = 0; i < roomsCount; i++) {
|
||||||
@ -997,8 +998,7 @@ namespace TR {
|
|||||||
stream.read(cameraFrames, stream.read(cameraFramesCount));
|
stream.read(cameraFrames, stream.read(cameraFramesCount));
|
||||||
// demo data
|
// demo data
|
||||||
stream.read(demoData, stream.read(demoDataSize));
|
stream.read(demoData, stream.read(demoDataSize));
|
||||||
} else
|
}
|
||||||
demoData = NULL;
|
|
||||||
|
|
||||||
// sounds
|
// sounds
|
||||||
stream.read(soundsMap, 256);
|
stream.read(soundsMap, 256);
|
||||||
@ -1008,8 +1008,10 @@ namespace TR {
|
|||||||
stream.read(soundOffsets, stream.read(soundOffsetsCount));
|
stream.read(soundOffsets, stream.read(soundOffsetsCount));
|
||||||
}
|
}
|
||||||
// cinematic frames for cameras (PSX)
|
// cinematic frames for cameras (PSX)
|
||||||
if (version == VER_TR1_PSX)
|
if (version == VER_TR1_PSX) {
|
||||||
|
stream.seek(4); // unknown 4 bytes always == 6
|
||||||
stream.read(cameraFrames, stream.read(cameraFramesCount));
|
stream.read(cameraFrames, stream.read(cameraFramesCount));
|
||||||
|
}
|
||||||
|
|
||||||
initTiles(tiles4, tiles8, palette, cluts);
|
initTiles(tiles4, tiles8, palette, cluts);
|
||||||
|
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
#ifndef H_GAME_TR
|
#ifndef H_GAME_TR
|
||||||
#define H_GAME_TR
|
#define H_GAME_TR
|
||||||
|
|
||||||
//#define FREE_CAMERA
|
|
||||||
|
|
||||||
#include "core.h"
|
#include "core.h"
|
||||||
#include "format.h"
|
#include "format.h"
|
||||||
#include "level.h"
|
#include "level.h"
|
||||||
@ -17,7 +15,6 @@ namespace Game {
|
|||||||
#ifndef __EMSCRIPTEN__
|
#ifndef __EMSCRIPTEN__
|
||||||
//Sound::play(Sound::openWAD("05_Lara's_Themes.wav"), 1, 1, 0);
|
//Sound::play(Sound::openWAD("05_Lara's_Themes.wav"), 1, 1, 0);
|
||||||
Sound::play(new Stream(sndName), vec3(0.0f), 1, 1, Sound::Flags::LOOP);
|
Sound::play(new Stream(sndName), vec3(0.0f), 1, 1, Sound::Flags::LOOP);
|
||||||
//Sound::play(new Stream("03.mp3"), 1, 1, 0);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -32,9 +29,6 @@ namespace Game {
|
|||||||
|
|
||||||
if (!lvlName) lvlName = (char*)"LEVEL2.PSX";
|
if (!lvlName) lvlName = (char*)"LEVEL2.PSX";
|
||||||
if (!sndName) sndName = (char*)"05.ogg";
|
if (!sndName) sndName = (char*)"05.ogg";
|
||||||
//lstartLevel("LEVEL2_DEMO.PHD", true, false);
|
|
||||||
//lstartLevel("GYM.PSX", false, true);
|
|
||||||
//lstartLevel("LEVEL3A.PHD", false, false);
|
|
||||||
startLevel(lvlName, sndName, false, false);
|
startLevel(lvlName, sndName, false, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user