XProger / OpenLara

Classic Tomb Raider open-source engine
http://xproger.info/projects/OpenLara/
BSD 2-Clause "Simplified" License
4.71k stars 362 forks source link

Tomb Raider II: No Title background #262

Closed legluondunet closed 3 years ago

legluondunet commented 4 years ago

Hello,

I just installed Tomb Raider II from GOG and when I launch OpenLara I have no background.

Capture d’écran de 2020-05-27 00-33-15

I saw in OpenLara log:

$ ./OpenLara 
init gamepads:
OpenLara (May 24 2020)
Vendor   : NVIDIA Corporation
Renderer : GeForce GTX 770/PCIe/SSE2
Version  : 4.6.0 NVIDIA 435.21
cache    : /home/legluondunet/.openlara/
supports :
  variyngs count : 16
  binary shaders : true
  vertex arrays  : true
  depth texture  : true
  shadow sampler : true
  discard frame  : false
  NPOT textures  : true
  3D   textures  : true
  RG   textures  : true
  border color   : true
  max level      : false
  anisotropic    : 16
  float textures : float = full, half = full

shader: cache warm-up...
shader: cache is ready
error loading file "audio/2/MAIN.SFX"
! can't load MAIN.SFX
meshes: 12
rooms   : 128 x 256
objects : 512 x 256
sprites : 128 x 128
glyphs  : 1024 x 512
MegaMesh (i:57006 v:10507 a:3, size:564248)
Read Slots...
FPS: 0 DIP: 4 TRI: 40 RT: 0 CB: 8
FPS: 0 DIP: 4 TRI: 40 RT: 0 CB: 8
error loading file "level/2/TITLEUS.PNG"

This file "TITLEUS.PNG" is not provided by GOG, where could I find it? Why OpenLara does not use TITLE.PCX and TITLE.TR2?

Thank you for your help.

legluondunet commented 4 years ago

I join you the files listing: tr2_GOG.txt

vargaviktor commented 4 years ago

Hi, Those title screens should converted from the PSX release PCX title screenfiles, not included in the GOG version. Will look for you some files.

dj4g11e32 commented 3 years ago

If you have the TITLE.PCX file, it can be opened with an image editor (I used Gimp) and exported as a PNG file. Once you've done that, name it TITLEUS.PNG and put it with the other title files.

(I've not uploaded a copy as I'm not sure what rules might be on posting copyright images to Github...)

XProger commented 3 years ago

all possible bg file names is here In case of GOG version would be better to put OpenLara executable into game directory without of creation any "level/2/" folders, because "level/2/TITLEUS.PNG" path using for web version/

dj4g11e32 commented 3 years ago

I took a look at this as I've always used the web version style directory paths because I couldn't get it to run otherwise. I think I found the issue in gameflow.h.

OpenLara finds the version VER_TR2_PC by checking for 'data/ASSAULT.TR2' but then sets the data directory to 'DATA' rather than 'data'.

I updated the file and tested running from the game directory and it now finds the levels and uses the TITLE.PCX load screen.

I created a new local branch to push the change up but I don't think I have access to push a new branch so I've attached the file here instead. Hopefully it will be useful!

This is the diff:

diff --git a/src/gameflow.h b/src/gameflow.h
index 630e673..ab98797 100644
--- a/src/gameflow.h
+++ b/src/gameflow.h
@@ -1088,13 +1088,13 @@ namespace TR {
                         char buf[64];
                         strcpy(buf, LEVEL_INFO[id].name);
                         String::toLower(buf);
-                        sprintf(dst, "DATA/%s.TR2", buf);
+                        sprintf(dst, "data/%s.TR2", buf);
                     } else if (id == LVL_TR2_TITLE) {
-                        sprintf(dst, "DATA/%s.tr2", LEVEL_INFO[id].name);
+                        sprintf(dst, "data/%s.tr2", LEVEL_INFO[id].name);
                     } else if (id == LVL_TR2_EMPRTOMB) {
-                        strcpy(dst, "DATA/Emprtomb.tr2");
+                        strcpy(dst, "data/Emprtomb.tr2");
                     } else {
-                        sprintf(dst, "DATA/%s.TR2", LEVEL_INFO[id].name);
+                        sprintf(dst, "data/%s.TR2", LEVEL_INFO[id].name);
                     }
                     if (Stream::existsContent(dst)) break;
                     strcpy(dst, LEVEL_INFO[id].name);

gameflow.h.txt

dj4g11e32 commented 3 years ago

A bit of additional testing showed that the wall.TR2 level wasn't loading so I've updated the gameflow.h file and tested again. (I think that's all for now!)

Diff:

--- a/src/gameflow.h                                                                                                                                                                                              
+++ b/src/gameflow.h                                                                                                                                                                                              
@@ -1082,7 +1082,7 @@ namespace TR {                                                                                                                                                                              
                 case VER_TR1_PSX : sprintf(dst, "PSXDATA/%s.PSX", LEVEL_INFO[id].name); break;                                                                                                                   
                 case VER_TR1_SAT : sprintf(dst, "DATA/%s.SAT",    LEVEL_INFO[id].name); break;                                                                                                                   
                 case VER_TR2_PC  : { // oh FFFFUUUUUUCKing CaTaComB.Tr2!                                                                                                                                         
-                    if (id == LVL_TR2_VENICE || id == LVL_TR2_CUT_2 || id == LVL_TR2_PLATFORM || id == LVL_TR2_CUT_3 || id == LVL_TR2_UNWATER ||                                                                 
+                    if (id == LVL_TR2_WALL || id == LVL_TR2_VENICE || id == LVL_TR2_CUT_2 || id == LVL_TR2_PLATFORM || id == LVL_TR2_CUT_3 || id == LVL_TR2_UNWATER ||                                           
                         id == LVL_TR2_KEEL || id == LVL_TR2_LIVING || id == LVL_TR2_DECK || id == LVL_TR2_CATACOMB || id == LVL_TR2_ICECAVE ||                                                                   
                         id == LVL_TR2_CUT_4 || id == LVL_TR2_XIAN || id == LVL_TR2_HOUSE) {                                                                                                                      
                         char buf[64];
[gameflow.h.txt](https://github.com/XProger/OpenLara/files/5610418/gameflow.h.txt)
XProger commented 3 years ago

use the original game folder structure instead of web style (/level/2/...)