diff --git a/.gitignore b/.gitignore index c62ca394b..24ddc84f3 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,8 @@ bld/ [Ll]og/ [Ll]ogs/ amnesia/_temp/ +amnesia/src/*.bin* +*.a # CMake build files CMakeFiles/ diff --git a/HPL2/core/CMakeLists.txt b/HPL2/core/CMakeLists.txt index 4ffbb208a..13fbec572 100644 --- a/HPL2/core/CMakeLists.txt +++ b/HPL2/core/CMakeLists.txt @@ -294,10 +294,10 @@ target_link_libraries(HPL2 ) -if(APPLE) +if(APPLE) # helper function to copy the needed frameworks in at build time SET(HPL2_FRAMEWORKS ${HPL2_FRAMEWORKS} CACHE STRING "HPL2 copy frameworks") - SET(HPL2_LIBRARIES libSDL2.dylib libIL.1.dylib) + SET(HPL2_LIBRARIES libSDL2.dylib libIL.1.dylib) SET(HPL2_LIBRARIES ${HPL2_LIBRARIES} CACHE STRING "HPL2 copy libs") mark_as_advanced(HPL2_FRAMEWORKS HPL2_LIBRARIES) @@ -344,7 +344,6 @@ FUNCTION(AddTestTarget target_name) ) ENDFUNCTION() -add_subdirectory(../tests tests) add_subdirectory(../tools tools) - +set(CMAKE_CXX_FLAGS "-fpermissive -no-pie") diff --git a/HPL2/core/sources/BuildID_HPL2_0_Linux.cpp b/HPL2/core/sources/BuildID_HPL2_0_Linux.cpp new file mode 100644 index 000000000..61aa3e15f --- /dev/null +++ b/HPL2/core/sources/BuildID_HPL2_0_Linux.cpp @@ -0,0 +1,32 @@ +/* + * Copyright © 2009-2020 Frictional Games + * + * This file is part of Amnesia: The Dark Descent. + * + * Amnesia: The Dark Descent is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * Amnesia: The Dark Descent is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Amnesia: The Dark Descent. If not, see . + */ + +////////////////////////////////////////////////// +// File autogenerated by buildcounter +// Do not hand edit! (preferably) +////////////////////////////////////////////////// +#include "./BuildID_HPL2_0.h" + +static char gsBuildID[16] = "20160407093727"; + +const char* GetBuildID_HPL2_0() +{ + return gsBuildID; +} + diff --git a/HPL2/tools/CMakeLists.txt b/HPL2/tools/CMakeLists.txt index 03511a9a9..c882aa414 100644 --- a/HPL2/tools/CMakeLists.txt +++ b/HPL2/tools/CMakeLists.txt @@ -68,3 +68,4 @@ add_executable(MshConverter ) target_link_libraries(MshConverter HPL2) +set(CMAKE_CXX_FLAGS "-fpermissive -no-pie") diff --git a/HPL2/tools/editors/CMakeLists.txt b/HPL2/tools/editors/CMakeLists.txt index b6ab56b24..ced7b2340 100644 --- a/HPL2/tools/editors/CMakeLists.txt +++ b/HPL2/tools/editors/CMakeLists.txt @@ -384,3 +384,4 @@ AddToolTarget(MaterialEditor # vim: noet ts=4: +set(CMAKE_CXX_FLAGS "-fpermissive -no-pie") diff --git a/HPL2/tools/editors/leveleditor/BuildID_LevelEditor_Linux.cpp b/HPL2/tools/editors/leveleditor/BuildID_LevelEditor_Linux.cpp new file mode 100644 index 000000000..41b2b2f36 --- /dev/null +++ b/HPL2/tools/editors/leveleditor/BuildID_LevelEditor_Linux.cpp @@ -0,0 +1,32 @@ +/* + * Copyright © 2009-2020 Frictional Games + * + * This file is part of Amnesia: The Dark Descent. + * + * Amnesia: The Dark Descent is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * Amnesia: The Dark Descent is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Amnesia: The Dark Descent. If not, see . + */ + +////////////////////////////////////////////////// +// File autogenerated by buildcounter +// Do not hand edit! (preferably) +////////////////////////////////////////////////// +#include "./BuildID_LevelEditor.h" + +static char gsBuildID[16] = "20101027185544"; + +const char* GetBuildID_LevelEditor() +{ + return gsBuildID; +} + diff --git a/HPL2/tools/editors/materialeditor/BuildID_MaterialEditor_Linux.cpp b/HPL2/tools/editors/materialeditor/BuildID_MaterialEditor_Linux.cpp new file mode 100644 index 000000000..2886a54c9 --- /dev/null +++ b/HPL2/tools/editors/materialeditor/BuildID_MaterialEditor_Linux.cpp @@ -0,0 +1,32 @@ +/* + * Copyright © 2009-2020 Frictional Games + * + * This file is part of Amnesia: The Dark Descent. + * + * Amnesia: The Dark Descent is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * Amnesia: The Dark Descent is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Amnesia: The Dark Descent. If not, see . + */ + +////////////////////////////////////////////////// +// File autogenerated by buildcounter +// Do not hand edit! (preferably) +////////////////////////////////////////////////// +#include "./BuildID_MaterialEditor.h" + +static char gsBuildID[16] = "20100917115138"; + +const char* GetBuildID_MaterialEditor() +{ + return gsBuildID; +} + diff --git a/HPL2/tools/editors/modeleditor/BuildID_ModelEditor_Linux.cpp b/HPL2/tools/editors/modeleditor/BuildID_ModelEditor_Linux.cpp new file mode 100644 index 000000000..d7002ffad --- /dev/null +++ b/HPL2/tools/editors/modeleditor/BuildID_ModelEditor_Linux.cpp @@ -0,0 +1,32 @@ +/* + * Copyright © 2009-2020 Frictional Games + * + * This file is part of Amnesia: The Dark Descent. + * + * Amnesia: The Dark Descent is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * Amnesia: The Dark Descent is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Amnesia: The Dark Descent. If not, see . + */ + +////////////////////////////////////////////////// +// File autogenerated by buildcounter +// Do not hand edit! (preferably) +////////////////////////////////////////////////// +#include "./BuildID_ModelEditor.h" + +static char gsBuildID[16] = "20100917115135"; + +const char* GetBuildID_ModelEditor() +{ + return gsBuildID; +} + diff --git a/HPL2/tools/editors/particleeditor/BuildID_ParticleEditor_Linux.cpp b/HPL2/tools/editors/particleeditor/BuildID_ParticleEditor_Linux.cpp new file mode 100644 index 000000000..aaa84c332 --- /dev/null +++ b/HPL2/tools/editors/particleeditor/BuildID_ParticleEditor_Linux.cpp @@ -0,0 +1,32 @@ +/* + * Copyright © 2009-2020 Frictional Games + * + * This file is part of Amnesia: The Dark Descent. + * + * Amnesia: The Dark Descent is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + + * Amnesia: The Dark Descent is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Amnesia: The Dark Descent. If not, see . + */ + +////////////////////////////////////////////////// +// File autogenerated by buildcounter +// Do not hand edit! (preferably) +////////////////////////////////////////////////// +#include "./BuildID_ParticleEditor.h" + +static char gsBuildID[16] = "20100917115133"; + +const char* GetBuildID_ParticleEditor() +{ + return gsBuildID; +} + diff --git a/README.md b/README.md index c4898f045..a3ff5f88d 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,20 @@ -# Amnesia: The Dark Descent Source Code - HPL Chad Gang Fork +# Amnesia: The Dark Descent - HPL Chad Gang Fork This is a fork of the Amnesia the Dark Descent repository from FrictionalGames. We will mostly play with different parts of the engine and perhaps even fix some bugs :) -## Project Overview -The game is built from two separate solutions: The HPL2 Engine and the game itself. +## Index + +* [Windows](#project-overview-windows) - Compiling instructions for Windows. +* [Linux](#building--playing-linux) - Compiling instructions for Linux. ## Prerequisites - A copy of Amnesia: the Dark Descent (For playing the game) -- Visual Studio 2010 (For compiling the engine) -- Visual Studio 2017 (For compiling the game) -- CMake +- Visual Studio 2010 (Windows, for compiling the engine) +- Visual Studio 2017 (Windows, for compiling the game) +- CMake, Make (Linux, for compiling) -## Project Overview +## Project Overview (Windows) The game is built from two separate solutions: The engine solution named `HPL2_2010` and the main game solution named `Lux`. The project also includes all the different editors and additional tools, such as the Level Editor and the Model Editor. @@ -57,31 +59,22 @@ Copy `Amnesia.exe` into your Amnesia game folder and launch it. The main menu sh ## Building & Playing (Linux) -There are quite a few extra steps required to be able to successfully build everything on Linux. This is partially due to incorrect configuration in the default repository. +There are a few extra steps required to be able to successfully build everything on Linux compared to Windows. ### Building the Engine, Game & Editors -0. Ensure you have `make` and `cmake` installed. -1. Clone the project and enter the folder -2. Extract `./HPL2/dependencies.zip` to the same folder it's in -3. Edit `./HPL2/core/CMakeLists.txt` and remove the line near the bottom about adding the `../tests` subdirectory. -4. Open a terminal in `./amnesia/src` and run `cmake .` -5. Search for "BuildID" in the file system and you will see 5 sets of .h and .cpp files. The .cpp filenames end with "Win32". Create duplicates of these files and rename from "Win32" to "Linux". For example: `BuildID_HPL2_0_Win32.cpp` > `BuildID_HPL2_0_Linux.cpp`. -6. Add the following CMake line into the files listed below: `set(CMAKE_CXX_FLAGS "-fpermissive -no-pie")` - - `./amnesia/src/CMakeLists.txt` - - `./amnesia/src/launcher/CMakeLists.txt` - - `./amnesia/src/game/CMakeLists.txt` - - `./HPL2/core/CMakeLists.txt` - - `./HPL2/tools/CMakeLists.txt` - - `./HPL2/tools/editors/CMakeLists.txt` -7. Open a terminal in `./HPL2/dependencies/lib/linux/lib64` and run ([credit](https://github.com/FrictionalGames/AmnesiaTheDarkDescent/pull/2#issuecomment-697648592)): +1. Ensure you have `make` and `cmake` installed. +2. Clone the project and enter the folder +3. Extract `./HPL2/dependencies.zip` to the same folder it's in +4. Open a terminal in `./HPL2/dependencies/lib/linux/lib64` and run ([credit](https://github.com/FrictionalGames/AmnesiaTheDarkDescent/pull/2#issuecomment-697648592)): ``` for f in `file * | grep ASCII | cut -d: -f1`; do ln -fs `cut -d' ' -f2 $f` $f; done ``` -8. With a terminal in `./amnesia/src` do `make` (or use `make -jX` where X is the number of jobs you want to run to speed things up, based on your CPU threads) -9. The build will compile and the resulting binaries will be found in `./amnesia/src` +5. Open a terminal in `./amnesia/src` and run `cmake .` +6. With a terminal in `./amnesia/src` do `make` (or use `make -jX` where X is the number of jobs you want to run to speed things up, based on your CPU threads) +7. The build should compile and the resulting binaries will be found in `./amnesia/src` ### Playing the Game diff --git a/amnesia/src/BuildScripts/README.txt b/amnesia/src/BuildScripts/README.md similarity index 100% rename from amnesia/src/BuildScripts/README.txt rename to amnesia/src/BuildScripts/README.md diff --git a/amnesia/src/CMakeLists.txt b/amnesia/src/CMakeLists.txt index 07acf3552..e32b88efd 100644 --- a/amnesia/src/CMakeLists.txt +++ b/amnesia/src/CMakeLists.txt @@ -44,3 +44,5 @@ endif() add_custom_target(GameRelease DEPENDS Amnesia Launcher ) + +set(CMAKE_CXX_FLAGS "-fpermissive -no-pie") diff --git a/amnesia/src/game/CMakeLists.txt b/amnesia/src/game/CMakeLists.txt index 34356d822..0ad1afbad 100644 --- a/amnesia/src/game/CMakeLists.txt +++ b/amnesia/src/game/CMakeLists.txt @@ -90,3 +90,5 @@ IF(APPLE) ENDIF() # vim: noet ts=4: + +set(CMAKE_CXX_FLAGS "-fpermissive -no-pie") diff --git a/amnesia/src/launcher/CMakeLists.txt b/amnesia/src/launcher/CMakeLists.txt index 7089e74b3..24e5d98e2 100644 --- a/amnesia/src/launcher/CMakeLists.txt +++ b/amnesia/src/launcher/CMakeLists.txt @@ -13,3 +13,4 @@ add_executable(Launcher target_link_libraries(Launcher HPL2 ${FLTK_IMAGES_LIBRARY} ${FLTK_LIBRARY} X11 Xext Xft fontconfig ${JPEG_LIBRARY}) # vim: et ts=4 +set(CMAKE_CXX_FLAGS "-fpermissive -no-pie")