Skip to content

Commit 2b7f552

Browse files
committed
add LIEF and rewrite README
1 parent 2d023db commit 2b7f552

File tree

9 files changed

+493
-163
lines changed

9 files changed

+493
-163
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
[submodule "libs/miniz"]
22
path = libs/miniz
33
url = https://github.com/richgel999/miniz
4+
[submodule "libs/LIEF"]
5+
path = libs/LIEF
6+
url = https://github.com/lief-project/LIEF

CMakeLists.txt

Lines changed: 45 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,34 @@ if(NOT EXISTS "${CMAKE_SOURCE_DIR}/libs/miniz/CMakeLists.txt")
3333
file(WRITE "${CMAKE_SOURCE_DIR}/libs/miniz/CMakeLists.txt" "${my_cmake}")
3434
endif()
3535

36+
add_subdirectory(libs/miniz)
37+
38+
# Add LIEF as a subdirectory
39+
set(LIEF_EXAMPLES OFF)
40+
set(LIEF_TESTS OFF)
41+
set(LIEF_DOC OFF)
42+
set(LIEF_C_API OFF)
43+
set(LIEF_ELF OFF)
44+
set(LIEF_PE ON)
45+
set(LIEF_MACHO OFF)
46+
set(LIEF_DEX OFF)
47+
set(LIEF_ART OFF)
48+
49+
if(NOT EXISTS "${CMAKE_SOURCE_DIR}/libs/LIEF/CMakeLists.txt")
50+
message(STATUS "Submodule 'libs/LIEF' not found. Updating submodules...")
51+
execute_process(
52+
COMMAND git submodule update --init --recursive
53+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
54+
)
55+
endif()
56+
57+
add_subdirectory(libs/LIEF)
58+
3659
# Update submodules if we forget
3760
# git submodule update --init --recursive
3861
# git submodule update --remote --merge
3962
# git submodule sync # (optional) if URL change
4063

41-
add_subdirectory(libs/miniz)
42-
4364
set(SOURCES_TESTS
4465
test/test.hpp
4566
)
@@ -60,6 +81,7 @@ set(SOURCES_MC
6081
src/Runner.cpp
6182
src/Runner.hpp
6283
src/binary.hpp
84+
src/binary.cpp
6385
src/main.cpp
6486
src/staticData.hpp
6587
)
@@ -77,6 +99,7 @@ set(LINK_COMMON
7799
Qt5::WebEngineWidgets
78100
Qt5::Sql
79101
miniz
102+
LIEF::LIEF
80103
${CURL_LIBRARY}
81104
OpenSSL::SSL
82105
Boost::system
@@ -91,13 +114,12 @@ set(INCLUDE_DIR
91114
${CURL_INCLUDE_DIR}
92115
${Boost_INCLUDE_DIRS}
93116
libs/miniz
117+
libs/LIEF/include
94118
src
95119
)
96120

97-
set(COMPILE_OPT
98-
CXX_STANDARD 17
99-
CXX_STANDARD_REQUIRED ON
100-
)
121+
set(CMAKE_CXX_STANDARD 17)
122+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
101123

102124
if(TEST)
103125
enable_testing()
@@ -106,23 +128,36 @@ if(TEST)
106128
add_test(NAME ${PROJECT_NAME}Test COMMAND ${PROJECT_NAME}Test)
107129
target_link_libraries(${PROJECT_NAME}Test PUBLIC ${LINK_COMMON} Qt5::Test)
108130
target_include_directories(${PROJECT_NAME}Test PRIVATE ${INCLUDE_DIR} test)
109-
set_target_properties(${PROJECT_NAME}Test PROPERTIES ${COMPILE_OPT})
110131
target_compile_definitions(${PROJECT_NAME}Test PRIVATE TEST)
132+
set_target_properties(${PROJECT_NAME}Test PROPERTIES
133+
CXX_STANDARD 17
134+
CXX_STANDARD_REQUIRED ON
135+
)
111136
else()
112137
set(SOURCES ${SOURCES_MC} ${SOURCES_VIEW})
113138
add_executable(${PROJECT_NAME} ${SOURCES})
114139
target_link_libraries(${PROJECT_NAME} PUBLIC ${LINK_COMMON} ${LINK_GUI})
115140
target_include_directories(${PROJECT_NAME} PRIVATE ${INCLUDE_DIR})
116-
set_target_properties(${PROJECT_NAME} PROPERTIES ${COMPILE_OPT})
141+
set_target_properties(${PROJECT_NAME} PROPERTIES
142+
CXX_STANDARD 17
143+
CXX_STANDARD_REQUIRED ON
144+
)
117145
endif()
118146

119147
if(NOT TEST)
120148
install(TARGETS ${PROJECT_NAME}
121149
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
122150
)
123151

124-
install(FILES ${CMAKE_SOURCE_DIR}/database/tombll.db
152+
install(FILES
153+
${CMAKE_SOURCE_DIR}/database/tombll.db
154+
${CMAKE_SOURCE_DIR}/database/data_factory.py
155+
${CMAKE_SOURCE_DIR}/database/get_leaf_cert.py
156+
${CMAKE_SOURCE_DIR}/database/https.py
157+
${CMAKE_SOURCE_DIR}/database/scrape.py
158+
${CMAKE_SOURCE_DIR}/database/tombll_add_data.py
159+
${CMAKE_SOURCE_DIR}/database/tombll_get_data.py
160+
${CMAKE_SOURCE_DIR}/database/tombll_get_list.py
125161
DESTINATION ${CMAKE_INSTALL_PREFIX}/share/${PROJECT_NAME}
126162
)
127163
endif()
128-

README.md

Lines changed: 94 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,96 @@
11
# Tomb Raider Linux Launcher
22

3-
A tool to run Tomb Raider classics 1, 2, 3, 4, 5 on Linux with Wine/Proton.
4-
Problems that you may face for 3 and 4 are one particular input problem and
5-
sometimes graphical glitches, crashes or lags. The work around for the input
6-
problem is to avoid ctrl alt. The other work around is to use a kernel suitable
7-
for gaming/wine and try to use mature suitable graphics drivers, usually open
8-
source. That will get you far if you want to play those games, but you should
9-
also know modding is tricky and only some might work. I'm doing it for fun
10-
and I would love to learn more c++ and Qt
11-
12-
This application will be written in c++ for the GUI and for modding and
13-
manipulation configuration files. Bash for launching with Steam or Lutris or just Wine.
3+
A tool for running and modding classic Tomb Raider games (1–5) on Linux with Wine/Proton. It also supports searching and downloading levels from trle.net, enabling direct play from the application.
144

15-
## Features
16-
17-
* with steam or Lutris to select a map from trle.net to play
18-
* launch along the game a controller mapper like qjoypad or antimicrox
19-
* script so that I dont have to manually move all game files when I want to play a mod with steam input to steams tomb raider game folder
20-
* backup game savefiles and configurations for all maps and moods.
21-
* check for corrupted config.txt file and possible other workarounds. (TR3)
22-
* check if I forgot to connect controller and so on... On Linux. I like my Steam controller configurations also.
23-
* implement patching of files and backup.
24-
* checksums
25-
* download maps/mods, and install them
26-
* add a filter for html in database
27-
* make sure the rest of the GUI still updates while downloading
28-
29-
## trle.net mods the launcher will download and play with wine-tkg that I tested
5+
This project is my passion for Tomb Raider classics combined with learning C++, Python, and SQL. My dream is to create an arcade machine featuring all classic Tomb Raider games and TRLE levels, potentially with a co-op mode.
306

31-
* [Calypsis Jungle - Part One](https://www.trle.net/sc/levelfeatures.php?lid=3500)
32-
* [Feder - Templars Secret](https://www.trle.net/sc/levelfeatures.php?lid=3082)
33-
* [Delca - Kitten Adventure](https://www.trle.net/sc/levelfeatures.php?lid=3379)
34-
35-
## Prepare
7+
## Features
368

37-
This install the program in you're ".local" home directory
38-
You need those, should be installed on a desktop linux
9+
- Integrates with Linux launchers (Steam, Lutris, etc.)
10+
- Controller mapper support (e.g., qjoypad, antimicrox)
11+
- Save file and configuration backups
12+
- Workarounds for Linux/Wine compatibility issues
13+
- Modding support for executable-based mods
14+
- Level download and installation from trle.net
15+
- Respectful scraping and filtering of data from trle.net (with site owner permission)
3916

40-
* curl 7.71.0 or newer
41-
* Boost
42-
* OpenSSL
43-
* Qt5
17+
## Installation
4418

45-
## Build
19+
### Dependencies
20+
Ensure the following are installed on your Linux desktop:
21+
- `curl` (7.71.0 or newer)
22+
- Boost
23+
- OpenSSL
24+
- Qt5
4625

26+
### Build
4727
```shell
4828
cmake -DCMAKE_INSTALL_PREFIX=~/.local .
49-
make install
29+
make install -j$(nproc)
5030
```
5131

5232
## Use database
5333

54-
You can add maps to the database if you cd into database.
55-
This should add Kitten Adventure Demo.
34+
### pip
35+
Never use sudo with pip, you can use a virtual environment or keep updating them in home.
36+
If a required module isn't available in the system's package manager, fall back to pip.
5637

57-
If it don't work try installing the
58-
python3 module from the error, with pip, you'll need, beautifulsoup4 and tqdm
38+
```shell
39+
python3 -m venv myenv
40+
source myenv/bin/activate
41+
pip install pycurl tqdm cryptography beautifulsoup4 pillow
42+
```
43+
or just
44+
```shell
45+
pip install pycurl tqdm cryptography beautifulsoup4 pillow
46+
```
47+
how to update
48+
```shell
49+
#!/bin/bash
50+
pimp_my_pip() {
51+
pip list --outdated | awk 'NR > 2 {print $1}' | xargs -n1 pip install -U
52+
}
53+
pimp_my_pip
54+
```
5955

56+
### Arch Linux
6057
```shell
61-
python3 tombll_get_data.py https://www.trle.net/sc/levelfeatures.php?lid=3379
58+
sudo pacman -S python-pycurl python-tqdm python-cryptography python-beautifulsoup4 python-pillow
59+
```
6260

61+
### Ubuntu/Debian
62+
```shell
63+
sudo apt update
64+
sudo apt install python3-pycurl python3-tqdm python3-cryptography python3-bs4 python3-pil
6365
```
6466

65-
It will show
67+
### Fedora
68+
```shell
69+
sudo dnf install python3-pycurl python3-tqdm python3-cryptography python3-beautifulsoup4 python3-pillow
70+
```
6671

67-
```text
68-
ERROR:The file at https://www.trle.net/scadm/trle_dl.php?lid=3379 is not a ZIP file. Content-Type: text/html
72+
### openSUSE
73+
```shell
74+
sudo zypper install python3-pycurl python3-tqdm python3-cryptography python3-beautifulsoup4 python3-Pillow
6975
```
7076

71-
This means that you have to open the data.json file and add those values
77+
### Alpine Linux
78+
```shell
79+
sudo apk add py3-pycurl py3-tqdm py3-cryptography py3-beautifulsoup4 py3-pillow
80+
```
81+
82+
Some levels wont be added because they use external or different download URL's
83+
You can add maps to the database if you cd into where you installed you're database.
84+
85+
If you did just follow the command above you can use:
86+
87+
88+
```shell
89+
python3 tombll_get_data.py https://www.trle.net/sc/levelfeatures.php?lid=3684
90+
91+
```
92+
Now that you have an data.json file you get a chance to edit it.
93+
Sometimes you need or want to edit those but right now I allow only trle.net
7294

7395
```text
7496
"zipFileName": "",
@@ -88,6 +110,11 @@ compile with cmake -DTEST=on
88110
./TombRaiderLinuxLauncherTest -w tomb4.exe
89111
```
90112

113+
I was going to mix trle.net with trcustoms.org data, I have not made contacted with the site owner
114+
to ask if I can use the site for scraping for non commercial use. As this task turned out to be
115+
harder than I thought, to match data without creating doubles, I'm gonna wait until the basics
116+
and trle.net part is implemented.
117+
91118
## Screenshots
92119

93120
![screenshot1](https://raw.githubusercontent.com/noisecode3/TombRaiderLinuxLauncher/main/doc/screenshot1.jpg)
@@ -97,42 +124,30 @@ compile with cmake -DTEST=on
97124

98125
## Guide
99126

100-
How to play Tomb Raider 3 (need to update)
101-
102-
## Patches
103-
104-
The game uses old API and old optimizations..
105-
With wine you need a minimum
106-
4 x DDR3-1600mhz and 3.0 GHz CPU
107-
It's a bit demanding on the memory, try use gallium nine if you have nouveau
108-
No special graphics card, but if you gonna play mods you could need
109-
One 2010+ card that has about 2-4 Gb for some Tomb Raider 4 mods with enhanced graphics
110-
recommend patches, on steam proton 7 (old)
127+
The game uses old API and old optimizations, but you can play basically on a potato laptop.
128+
It depends on drivers quality, but with proton you can try `PROTON_USE_WINED3D=1`
129+
or using [dgvoodoo2] with `PROTON_USE_WINED3D=0` usually you get the best performance with (DXVK/dgvoodoo2).
130+
The easiest way to get this setup it using Lutris. Some levels can be lagging even on
131+
a computer with a strong video card.
132+
[dgvoodoo2]: https://github.com/lutris/dgvoodoo2/releases
111133

112-
* <https://github.com/Trxyebeep/tomb3>
134+
### TR1
135+
* <https://github.com/LostArtefacts/TRX>
113136

114-
* <https://github.com/dege-diosg/dgVoodoo2> (use Lutris, not manual)
115-
* <https://tombraiders.net/stella/downloads/widescreen.html>
116-
* <https://core-design.com/community_tr3withoutcrystals.html>
137+
### TR2
138+
* <https://github.com/Arsunt/TR2Main>
117139

118140
### TR3
141+
* <https://github.com/Trxyebeep/tomb3>
119142

120-
Most, if not all trle.net tr3 mods will work with proton 7, if unpacked and configured with dgVoodoo2
121-
some new tr3 mods already comes with the tomb3 patch. A combination of tomb3 and dgVoodoo2 is recommended for the original game.
122-
123-
## Tips
124-
125-
### Recommended compatibility layer
143+
### TR4
144+
* <https://github.com/Trxyebeep/TOMB4>
126145

127-
* Proton 7.0 for TR3 - with dgVoodoo2
128-
* Proton 5.0-10 for TR3
129-
* Sometimes avoiding Ctrl and Alt will make wine/proton
130-
* [GloriousEggroll](https://github.com/GloriousEggroll/proton-ge-custom/releases/tag/6.21-GE-2)
131-
* [Wine-tkg](https://github.com/Frogging-Family/wine-tkg-git/releases/tag/7.6.r12.g51472395) tick "emulate a virtual desktop"
146+
### TR5
147+
* <https://github.com/Trxyebeep/TOMB5>
132148

133-
### Recommended compatibility layer configuration and other tips
149+
## Targets
150+
I program mostly on Slackware-current and Arch, I gonna try target and test SteamOS for second release.
134151

135-
* Use fsync or esync
136-
* If you have problems witn FMV cut-scenes. Run winecfg go to graphics tab and tick "emulate a virtual desktop" use same size as you're desktop under. Or use dgVoodoo2
137-
* Sometimes when you run tomb3.exe -setup you window manager will put the background over the configuration windows, for example in i3 mod+f "full screen key" or something similar like alt+tab could help you see the window
138-
* The game will recognize your controller, left stick only, see [https://github.com/AntiMicroX/antimicrox](https://github.com/AntiMicroX/antimicrox)
152+
## License
153+
This project is licensed under GPLv3. Art assets are under Creative Commons Attribution-NonCommercial-ShareAlike 4.0. Tomb Raider is a trademark of Embracer Group AB.

build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
22
cd "$(dirname "$0")" || exit 1
33
cd build || exit 1
4-
make
4+
make -j$(nproc)

libs/LIEF

Submodule LIEF added at 9a4f609

src/Runner.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ Runner::Runner() : m_env(QProcessEnvironment::systemEnvironment()) {
2222

2323
Runner::Runner(const QString& cmd)
2424
: m_env(QProcessEnvironment::systemEnvironment()) {
25-
m_env.insert("WINEDLLOVERRIDES", "winmm=n,b");
25+
m_env.insert("WINEDLLOVERRIDES", "winmm=n,b;ddraw=n,b");
26+
m_env.insert("WINEFSYNC", "1");
2627
m_process.setProcessEnvironment(m_env);
2728
m_status = 0;
2829
m_command = cmd;

0 commit comments

Comments
 (0)