From 73607410ca089667c1510d2a95c9b99f58c301a0 Mon Sep 17 00:00:00 2001 From: XProger Date: Sat, 7 Jul 2018 01:31:08 +0300 Subject: [PATCH] fix title background aspect ratio for PSX versions; add title screen loading for TR3 PSX version; fix aspect ration for TR2 & TR3 FMVs --- src/gameflow.h | 7 +++++++ src/inventory.h | 16 ++++++++++++---- src/texture.h | 6 +++--- 3 files changed, 22 insertions(+), 7 deletions(-) diff --git a/src/gameflow.h b/src/gameflow.h index c477625..0a4ac84 100644 --- a/src/gameflow.h +++ b/src/gameflow.h @@ -822,21 +822,25 @@ namespace TR { // TR3 case LVL_TR3_TITLE : CHECK_FILE("pix/TITLEUK.BMP"); // PC (TODO: add other languages) + CHECK_FILE("PIXUS/TITLEUS.RAW"); // PSX (TODO: add other languages) return "level/3/TITLEUK.PNG"; // WEB case LVL_TR3_HOUSE : CHECK_FILE("pix/HOUSE.BMP"); + CHECK_FILE("PIX/HOUSE.RAW"); return "level/3/HOUSE.PNG"; case LVL_TR3_JUNGLE : case LVL_TR3_TEMPLE : case LVL_TR3_QUADCHAS : case LVL_TR3_TONYBOSS : CHECK_FILE("pix/INDIA.BMP"); + CHECK_FILE("PIX/INDIA.RAW"); return "level/3/INDIA.PNG"; case LVL_TR3_SHORE : case LVL_TR3_CRASH : case LVL_TR3_RAPIDS : case LVL_TR3_TRIBOSS : CHECK_FILE("pix/SOUTHPAC.BMP"); + CHECK_FILE("PIX/SOUTHPAC.RAW"); return "level/3/SOUTHPAC.PNG"; case LVL_TR3_ROOFS : case LVL_TR3_SEWER : @@ -844,17 +848,20 @@ namespace TR { case LVL_TR3_OFFICE : case LVL_TR3_STPAUL : CHECK_FILE("pix/LONDON.BMP"); + CHECK_FILE("PIX/LONDON.RAW"); return "level/3/LONDON.PNG"; case LVL_TR3_NEVADA : case LVL_TR3_COMPOUND : case LVL_TR3_AREA51 : CHECK_FILE("pix/NEVADA.BMP"); + CHECK_FILE("PIX/NEVADA.RAW"); return "level/3/NEVADA.PNG"; case LVL_TR3_ANTARC : case LVL_TR3_MINES : case LVL_TR3_CITY : case LVL_TR3_CHAMBER : CHECK_FILE("pix/ANTARC.BMP"); + CHECK_FILE("PIX/ANTARC.RAW"); return "level/3/ANTARC.PNG"; default : return NULL; diff --git a/src/inventory.h b/src/inventory.h index 8c35fbc..9392c7e 100644 --- a/src/inventory.h +++ b/src/inventory.h @@ -1490,16 +1490,20 @@ struct Inventory { else alpha = 255; + float sy = 1.0f; + if (background[0]) + sy = (480.0f / 640.0f) * ((float)background[0]->width / (float)background[0]->height); + if (Core::settings.detail.stereo == Core::Settings::STEREO_VR) { if (game->getLevel()->isTitle()) - renderTitleBG(1.0f, 1.0f, alpha); + renderTitleBG(1.0f, sy, alpha); else renderGameBG(); } else { if (background[1]) renderGameBG(); else - renderTitleBG(1.0f, 1.0f, alpha); + renderTitleBG(1.0f, sy, alpha); } Core::setBlendMode(bmAlpha); @@ -1548,11 +1552,15 @@ struct Inventory { Texture *tmp = background[0]; + float sy = 1.0f; + if (game->getLevel()->version & TR::VER_TR1) + sy = 1.2f; + background[0] = video->frameTex[0]; - renderTitleBG(1.0f, 1.2f, 255); + renderTitleBG(1.0f, sy, 255); background[0] = video->frameTex[1]; - renderTitleBG(1.0f, 1.2f, clamp(int((video->time / video->step) * 255), 0, 255)); + renderTitleBG(1.0f, sy, clamp(int((video->time / video->step) * 255), 0, 255)); background[0] = tmp; diff --git a/src/texture.h b/src/texture.h index 55bf68c..714f0c9 100644 --- a/src/texture.h +++ b/src/texture.h @@ -498,7 +498,7 @@ struct Texture : GAPI::Texture { stream.seek(6); } else { stream.seek(-4); - size = 384 * 256 * 2; + size = 512 * 256 * 2; csize = stream.size; } @@ -562,8 +562,8 @@ struct Texture : GAPI::Texture { } delete[] cdata; - width = 384; - height = size / width / 2; + height = 256; + width = (dst - data) / height / 2; uint32 *data32 = new uint32[width * height]; {