mirror of
https://github.com/XProger/OpenLara.git
synced 2025-08-15 09:34:18 +02:00
#15 TR3 PSX cutscenes support
This commit is contained in:
29
src/format.h
29
src/format.h
@@ -2526,19 +2526,21 @@ namespace TR {
|
|||||||
|
|
||||||
if (version == VER_TR3_PSX) {
|
if (version == VER_TR3_PSX) {
|
||||||
stream.read(soundOffsets, stream.read(soundOffsetsCount));
|
stream.read(soundOffsets, stream.read(soundOffsetsCount));
|
||||||
stream.read(soundDataSize);
|
|
||||||
stream.read(soundData, soundDataSize);
|
|
||||||
soundSize = new uint32[soundOffsetsCount];
|
|
||||||
int size = 0;
|
|
||||||
for (int i = 0; i < soundOffsetsCount - 1; i++) {
|
|
||||||
ASSERT(soundOffsets[i] < soundOffsets[i + 1]);
|
|
||||||
size += soundSize[i] = soundOffsets[i + 1] - soundOffsets[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
if (soundOffsetsCount) {
|
if (soundOffsetsCount) {
|
||||||
soundSize[soundOffsetsCount - 1] = soundDataSize;
|
stream.read(soundDataSize);
|
||||||
if (soundOffsetsCount > 1)
|
stream.read(soundData, soundDataSize);
|
||||||
soundSize[soundOffsetsCount - 1] -= soundSize[soundOffsetsCount - 2];
|
soundSize = new uint32[soundOffsetsCount];
|
||||||
|
int size = 0;
|
||||||
|
for (int i = 0; i < soundOffsetsCount - 1; i++) {
|
||||||
|
ASSERT(soundOffsets[i] < soundOffsets[i + 1]);
|
||||||
|
size += soundSize[i] = soundOffsets[i + 1] - soundOffsets[i];
|
||||||
|
}
|
||||||
|
|
||||||
|
if (soundOffsetsCount) {
|
||||||
|
soundSize[soundOffsetsCount - 1] = soundDataSize;
|
||||||
|
if (soundOffsetsCount > 1)
|
||||||
|
soundSize[soundOffsetsCount - 1] -= soundSize[soundOffsetsCount - 2];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2813,6 +2815,9 @@ namespace TR {
|
|||||||
ASSERT(s.volume <= 1.0f);
|
ASSERT(s.volume <= 1.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (version == VER_TR3_PSX)
|
||||||
|
stream.seek(4);
|
||||||
|
|
||||||
if (version == VER_TR1_PC) {
|
if (version == VER_TR1_PC) {
|
||||||
stream.read(soundData, stream.read(soundDataSize));
|
stream.read(soundData, stream.read(soundDataSize));
|
||||||
stream.read(soundOffsets, stream.read(soundOffsetsCount));
|
stream.read(soundOffsets, stream.read(soundOffsetsCount));
|
||||||
|
@@ -403,39 +403,72 @@ namespace TR {
|
|||||||
case 2558286 : return LVL_TR2_CUT_3;
|
case 2558286 : return LVL_TR2_CUT_3;
|
||||||
case 1116966 : version = VER_TR2_PSX;
|
case 1116966 : version = VER_TR2_PSX;
|
||||||
case 1900230 : return LVL_TR2_CUT_4;
|
case 1900230 : return LVL_TR2_CUT_4;
|
||||||
// TR3 (TODO PSX)
|
// TR3
|
||||||
|
case 653403 :
|
||||||
case 1275266 : return LVL_TR3_TITLE;
|
case 1275266 : return LVL_TR3_TITLE;
|
||||||
|
case 1889506 :
|
||||||
case 3437855 : return LVL_TR3_HOUSE;
|
case 3437855 : return LVL_TR3_HOUSE;
|
||||||
|
case 1930923 :
|
||||||
case 3360001 : return LVL_TR3_JUNGLE;
|
case 3360001 : return LVL_TR3_JUNGLE;
|
||||||
|
case 1943847 :
|
||||||
case 3180412 : return LVL_TR3_TEMPLE;
|
case 3180412 : return LVL_TR3_TEMPLE;
|
||||||
|
case 1880004 :
|
||||||
case 3131453 : return LVL_TR3_QUADCHAS;
|
case 3131453 : return LVL_TR3_QUADCHAS;
|
||||||
|
case 1493796 :
|
||||||
case 2618437 : return LVL_TR3_TONYBOSS;
|
case 2618437 : return LVL_TR3_TONYBOSS;
|
||||||
|
case 1979611 :
|
||||||
case 3365562 : return LVL_TR3_SHORE;
|
case 3365562 : return LVL_TR3_SHORE;
|
||||||
|
case 2016876 :
|
||||||
case 3331132 : return LVL_TR3_CRASH;
|
case 3331132 : return LVL_TR3_CRASH;
|
||||||
|
case 1940346 :
|
||||||
case 3148248 : return LVL_TR3_RAPIDS;
|
case 3148248 : return LVL_TR3_RAPIDS;
|
||||||
|
case 1521998 :
|
||||||
case 2276838 : return LVL_TR3_TRIBOSS;
|
case 2276838 : return LVL_TR3_TRIBOSS;
|
||||||
|
case 2097077 :
|
||||||
case 3579476 : return LVL_TR3_ROOFS;
|
case 3579476 : return LVL_TR3_ROOFS;
|
||||||
|
case 2033505 :
|
||||||
case 3670149 : return LVL_TR3_SEWER;
|
case 3670149 : return LVL_TR3_SEWER;
|
||||||
|
case 2079183 :
|
||||||
case 3523586 : return LVL_TR3_TOWER;
|
case 3523586 : return LVL_TR3_TOWER;
|
||||||
|
case 1549006 :
|
||||||
case 2504910 : return LVL_TR3_OFFICE;
|
case 2504910 : return LVL_TR3_OFFICE;
|
||||||
|
case 1938738 :
|
||||||
case 3140417 : return LVL_TR3_NEVADA;
|
case 3140417 : return LVL_TR3_NEVADA;
|
||||||
|
case 2048288 :
|
||||||
case 3554880 : return LVL_TR3_COMPOUND;
|
case 3554880 : return LVL_TR3_COMPOUND;
|
||||||
|
case 2054325 :
|
||||||
case 3530130 : return LVL_TR3_AREA51;
|
case 3530130 : return LVL_TR3_AREA51;
|
||||||
|
case 1998398 :
|
||||||
case 3515272 : return LVL_TR3_ANTARC;
|
case 3515272 : return LVL_TR3_ANTARC;
|
||||||
|
case 2023895 :
|
||||||
case 3331087 : return LVL_TR3_MINES;
|
case 3331087 : return LVL_TR3_MINES;
|
||||||
|
case 2056388 :
|
||||||
case 3575873 : return LVL_TR3_CITY;
|
case 3575873 : return LVL_TR3_CITY;
|
||||||
|
case 1780885 :
|
||||||
case 3190736 : return LVL_TR3_CHAMBER;
|
case 3190736 : return LVL_TR3_CHAMBER;
|
||||||
|
case 1709427 :
|
||||||
case 3140028 : return LVL_TR3_STPAUL;
|
case 3140028 : return LVL_TR3_STPAUL;
|
||||||
|
case 757827 :
|
||||||
case 1547866 : return LVL_TR3_CUT_1;
|
case 1547866 : return LVL_TR3_CUT_1;
|
||||||
|
case 982765 :
|
||||||
case 1957327 : return LVL_TR3_CUT_2;
|
case 1957327 : return LVL_TR3_CUT_2;
|
||||||
|
case 1242972 :
|
||||||
case 2020225 : return LVL_TR3_CUT_3;
|
case 2020225 : return LVL_TR3_CUT_3;
|
||||||
|
case 430130 :
|
||||||
case 1048466 : return LVL_TR3_CUT_4;
|
case 1048466 : return LVL_TR3_CUT_4;
|
||||||
|
case 971285 :
|
||||||
case 1580868 : return LVL_TR3_CUT_5;
|
case 1580868 : return LVL_TR3_CUT_5;
|
||||||
|
case 1325488 :
|
||||||
case 2430940 : return LVL_TR3_CUT_6;
|
case 2430940 : return LVL_TR3_CUT_6;
|
||||||
|
case 467121 :
|
||||||
case 1253227 : return LVL_TR3_CUT_7;
|
case 1253227 : return LVL_TR3_CUT_7;
|
||||||
case 944962 : return LVL_TR3_CUT_8;
|
case 494314 :
|
||||||
|
case 944962 : return LVL_TR3_CUT_8;
|
||||||
|
case 1002236 :
|
||||||
case 1788075 : return LVL_TR3_CUT_9;
|
case 1788075 : return LVL_TR3_CUT_9;
|
||||||
|
case 590185 :
|
||||||
case 1402003 : return LVL_TR3_CUT_11;
|
case 1402003 : return LVL_TR3_CUT_11;
|
||||||
|
case 1080046 :
|
||||||
case 2321393 : return LVL_TR3_CUT_12;
|
case 2321393 : return LVL_TR3_CUT_12;
|
||||||
}
|
}
|
||||||
return LVL_CUSTOM;
|
return LVL_CUSTOM;
|
||||||
@@ -664,10 +697,10 @@ namespace TR {
|
|||||||
break;
|
break;
|
||||||
case VER_TR2_PC :
|
case VER_TR2_PC :
|
||||||
case VER_TR2_PSX :
|
case VER_TR2_PSX :
|
||||||
if (Stream::existsContent("audio/cdaudio.mp3")) {
|
//if (Stream::existsContent("audio/cdaudio.mp3")) {
|
||||||
callback(Sound::openCDAudioMP3("audio/cdaudio.dat", "audio/cdaudio.mp3", track), userData);
|
// callback(Sound::openCDAudioMP3("audio/cdaudio.dat", "audio/cdaudio.mp3", track), userData);
|
||||||
return;
|
// return;
|
||||||
}
|
//}
|
||||||
sprintf(title, "track_%02d", track);
|
sprintf(title, "track_%02d", track);
|
||||||
if (!checkTrack("", title) && !checkTrack("audio/2/", title) && !checkTrack("audio/", title)) {
|
if (!checkTrack("", title) && !checkTrack("audio/2/", title) && !checkTrack("audio/", title)) {
|
||||||
callback(NULL, userData);
|
callback(NULL, userData);
|
||||||
|
@@ -3044,7 +3044,8 @@ struct Lara : Character {
|
|||||||
hitTime = 0.0f;
|
hitTime = 0.0f;
|
||||||
}
|
}
|
||||||
|
|
||||||
hitDir = angleQuadrant(dir.rotateY(angle.y + PI * 0.5f).angleY());
|
if (level->version & TR::VER_TR1) // TODO: check hit animation indices for TR2 and TR3
|
||||||
|
hitDir = angleQuadrant(dir.rotateY(angle.y + PI * 0.5f).angleY());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user