Skip to content

Commit

Permalink
Merge pull request #1550 from heinezen/legacy-remove
Browse files Browse the repository at this point in the history
Remove legacy subsystem code
  • Loading branch information
TheJJ committed Dec 15, 2023
2 parents 682aa64 + 10bc91d commit d0d9a4b
Show file tree
Hide file tree
Showing 429 changed files with 2,343 additions and 36,333 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/macosx-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Install environment helpers with homebrew
run: brew install ccache
- name: Install dependencies with homebrew
run: brew install libepoxy freetype fontconfig harfbuzz sdl2 sdl2_image opus opusfile qt6 libogg libpng toml11 eigen
run: brew install libepoxy freetype fontconfig harfbuzz opus opusfile qt6 libogg libpng toml11 eigen
- name: Install nyan dependencies with homebrew
run: brew install flex make
- name: Install python3 packages
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ubuntu-22.04.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
run: mkdir -p /tmp/image
shell: bash
- name: Download devenv image
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: devenv-image-compressed.tar.gz
path: '/tmp/image'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-server-2019.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
mkdir download
cd download
$zipfile = "openage-dep-x64-windows.zip"
Invoke-WebRequest https://github.com/SFTtech/openage-dependencies/releases/download/v0.5.0/openage-dep-x64-windows.zip -OutFile $zipfile
Invoke-WebRequest https://github.com/SFTtech/openage-dependencies/releases/download/v0.5.1/openage-dep-x64-windows.zip -OutFile $zipfile
Expand-Archive -Path $zipfile -DestinationPath . -Force
Remove-Item $zipfile
(Get-ChildItem . -Recurse -File).FullName
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/windows-server-2022.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
mkdir download
cd download
$zipfile = "openage-dep-x64-windows.zip"
Invoke-WebRequest https://github.com/SFTtech/openage-dependencies/releases/download/v0.5.0/openage-dep-x64-windows.zip -OutFile $zipfile
Invoke-WebRequest https://github.com/SFTtech/openage-dependencies/releases/download/v0.5.1/openage-dep-x64-windows.zip -OutFile $zipfile
Expand-Archive -Path $zipfile -DestinationPath . -Force
Remove-Item $zipfile
(Get-ChildItem . -Recurse -File).FullName
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ Quickstart
```

* **I compiled everything. Now how do I run it?**
* Execute `./bin/run`.
* Execute `cd bin && ./run main`.
* [The convert script](/doc/media_convert.md) will transform original assets into openage formats, which are a lot saner and more moddable.
* Use your brain and react to the things you'll see.

Expand Down
2 changes: 1 addition & 1 deletion assets/test/textures/test_animation.sprite
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version 2

texture 0 "test_texture.texture"

scalefactor 1
scalefactor 1.0

layer 0 mode=loop position=20 time_per_frame=0.125

Expand Down
2 changes: 1 addition & 1 deletion assets/test/textures/test_missing.sprite
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version 2

texture 0 "test_missing.texture"

scalefactor 1
scalefactor 1.0

layer 0 mode=once

Expand Down
2 changes: 1 addition & 1 deletion assets/test/textures/test_terrain.terrain
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ version 2

texture 0 "test_terrain.texture"

scalefactor 1
scalefactor 1.0

layer 0

Expand Down
29 changes: 0 additions & 29 deletions buildsystem/modules/FindSDL2Image.cmake

This file was deleted.

2 changes: 1 addition & 1 deletion doc/build_instructions/arch_linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
This command should provide required packages from the Arch Linux repositories:

`sudo pacman -S --needed eigen python python-mako python-pillow python-numpy python-lz4 python-pygments cython libepoxy libogg libpng ttf-dejavu freetype2 fontconfig harfbuzz cmake sdl2 sdl2_image opusfile opus python-pylint python-toml qt6-declarative`
`sudo pacman -S --needed eigen python python-mako python-pillow python-numpy python-lz4 python-pygments cython libepoxy libogg libpng ttf-dejavu freetype2 fontconfig harfbuzz cmake opusfile opus python-pylint python-toml qt6-declarative qt6-multimedia`

Additionally, you have to install [`toml11`](https://aur.archlinux.org/packages/toml11) from the AUR.
If you have `yay`, you can run this command:
Expand Down
2 changes: 1 addition & 1 deletion doc/build_instructions/debian.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Prerequisite steps for Debian users

- `sudo apt-get update`
- `sudo apt-get install cmake cython3 libeigen3-dev libepoxy-dev libfontconfig1-dev libfreetype-dev libharfbuzz-dev libogg-dev libopus-dev libopusfile-dev libpng-dev libsdl2-dev libsdl2-image-dev libtoml11-dev python3-dev python3-mako python3-numpy python3-lz4 python3-pil python3-pip python3-pygments python3-toml qml6-module-qtquick-controls qt6-declarative-dev`
- `sudo apt-get install cmake cython3 libeigen3-dev libepoxy-dev libfontconfig1-dev libfreetype-dev libharfbuzz-dev libogg-dev libopus-dev libopusfile-dev libpng-dev libtoml11-dev python3-dev python3-mako python3-numpy python3-lz4 python3-pil python3-pip python3-pygments python3-toml qml6-module-qtquick-controls qt6-declarative-dev qt6-multimedia-dev qml6-module-qtquick3d-spatialaudio`

You will also need [nyan](https://github.com/SFTtech/nyan/blob/master/doc/building.md) and its dependencies.
2 changes: 1 addition & 1 deletion doc/build_instructions/fedora.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

Run the following command:

`sudo dnf install clang cmake eigen3-devel fontconfig-devel gcc-c harfbuzz-devel libepoxy-devel libogg-devel libopusenc-devel libpng-devel opusfile-devel python3-Cython python3-devel python3-mako python3-numpy python3-lz4 python3-pillow python3-pygments python3-toml SDL2-devel SDL2_image-devel++ toml11-devel qt6-qtdeclarative-devel`
`sudo dnf install clang cmake eigen3-devel fontconfig-devel gcc-c harfbuzz-devel libepoxy-devel libogg-devel libopusenc-devel libpng-devel opusfile-devel python3-Cython python3-devel python3-mako python3-numpy python3-lz4 python3-pillow python3-pygments python3-toml toml11-devel qt6-qtdeclarative-devel qt6-qtmultimedia-devel`

You will also need [nyan](https://github.com/SFTtech/nyan/blob/master/doc/building.md) and its dependencies.
2 changes: 1 addition & 1 deletion doc/build_instructions/freebsd.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

This command should provide required packages for FreeBSD installation:

`sudo pkg install cmake cython eigen3 harfbuzz opus-tools opusfile png py-mako py-numpy py-lz4 py-pillow py-pygments py-toml pylint python qt6 sdl2 sdl2_image toml11`
`sudo pkg install cmake cython eigen3 harfbuzz opus-tools opusfile png py-mako py-numpy py-lz4 py-pillow py-pygments py-toml pylint python qt6 toml11`

You will also need [nyan](https://github.com/SFTtech/nyan/blob/master/doc/building.md) and its dependencies.

Expand Down
2 changes: 1 addition & 1 deletion doc/build_instructions/macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
brew update-reset && brew update
brew tap homebrew/cask-fonts
brew install font-dejavu
brew install cmake python3 libepoxy freetype fontconfig harfbuzz sdl2 sdl2_image opus opusfile qt6 libogg libpng toml11 eigen
brew install cmake python3 libepoxy freetype fontconfig harfbuzz opus opusfile qt6 libogg libpng toml11 eigen
brew install llvm
pip3 install cython numpy mako lz4 pillow pygments toml
Expand Down
2 changes: 1 addition & 1 deletion doc/build_instructions/opensuse.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Prerequisite steps for openSUSE users

- `zypper install --no-recommends cmake doxygen eigen3-devel fontconfig-devel gcc-c graphviz++ harfbuzz-devel libSDL2-devel libSDL2_image-devel libepoxy-devel libfreetype-dev libogg-devel libopus-devel libpng-devel libtoml11-dev libqt6-qtdeclarative-devel libqt6-qtquickcontrols opusfile-devel python3-Cython python3-Mako python3-lz4 python3-Pillow python3-Pygments python3-toml python3-devel`
- `zypper install --no-recommends cmake doxygen eigen3-devel fontconfig-devel gcc-c graphviz++ harfbuzz-devel libepoxy-devel libfreetype-dev libogg-devel libopus-devel libpng-devel libtoml11-dev qt6-declarative-dev qt6-quickcontrols2 qt6-multimedia-dev opusfile-devel python3-Cython python3-Mako python3-lz4 python3-Pillow python3-Pygments python3-toml python3-devel`

You will also need [nyan](https://github.com/SFTtech/nyan/blob/master/doc/building.md) and its dependencies.
2 changes: 1 addition & 1 deletion doc/build_instructions/ubuntu.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
Run the following commands:

- `sudo apt-get update`
- `sudo apt-get install g++ cmake cython3 libeigen3-dev libepoxy-dev libfontconfig1-dev libfreetype-dev libharfbuzz-dev libogg-dev libopus-dev libopusfile-dev libpng-dev libsdl2-dev libsdl2-image-dev libtoml11-dev python3-dev python3-mako python3-numpy python3-lz4 python3-pil python3-pip python3-pygments python3-toml qml6-module-qtquick-controls qt6-declarative-dev`
- `sudo apt-get install g++ cmake cython3 libeigen3-dev libepoxy-dev libfontconfig1-dev libfreetype-dev libharfbuzz-dev libogg-dev libopus-dev libopusfile-dev libpng-dev libtoml11-dev python3-dev python3-mako python3-numpy python3-lz4 python3-pil python3-pip python3-pygments python3-toml qml6-module-qtquick-controls qt6-declarative-dev qt6-multimedia-dev qml6-module-qtquick3d-spatialaudio`

You will also need [nyan](https://github.com/SFTtech/nyan/blob/master/doc/building.md) and its dependencies.

Expand Down
2 changes: 1 addition & 1 deletion doc/build_instructions/windows_msvc.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ _Note:_ Also ensure that `python` and `python3` both point to the correct and th
### vcpkg packages
Set up [vcpkg](https://github.com/Microsoft/vcpkg#quick-start). Open a command prompt at `<vcpkg directory>`

vcpkg install dirent eigen3 fontconfig freetype harfbuzz libepoxy libogg libpng opus opusfile qtbase qtdeclarative sdl2 sdl2-image toml11
vcpkg install dirent eigen3 fontconfig freetype harfbuzz libepoxy libogg libpng opus opusfile qtbase qtdeclarative qtmultimedia toml11

_Note:_ The `qt6` port in vcpkg has been split into multiple packages, build times are acceptable now.
If you want, you can still use [the prebuilt version](https://www.qt.io/download-open-source/) instead.
Expand Down
8 changes: 3 additions & 5 deletions doc/building.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,13 @@ Dependency list:
CR nyan (https://github.com/SFTtech/nyan)
CR O ncurses
C mako
CR sdl2
CR sdl2_image
CR opusfile
CRA opus
CRA ogg
S pycodestyle
C pygments
S pylint
CR qt6 >=6.2 (Core, Quick, QuickControls modules)
CR qt6 >=6.2 (Core, Quick, QuickControls, Multimedia modules)
CR toml11
CR O vulkan

Expand Down Expand Up @@ -167,10 +165,10 @@ The reference package is [created for Gentoo](https://github.com/SFTtech/gentoo-

- I wanna see compiler invocations
- `make VERBOSE=1`
- My `SDL2_Image`/`Python`/whatever is installed somewhere, but `cmake` can't find it!
- My `Qt`/`Python`/whatever is installed somewhere, but `cmake` can't find it!
- Run `ccmake` or `cmake-gui` in the build directory to see and change config variables.
- You can manually tell `cmake` where to look. Try something along the lines of
- `./configure -- -DSDL2IMAGE_INCLUDE_DIRS=/whereever/sdl2_image/include/`
- `./configure -- -DPYTHON_INCLUDE_DIRS=/whereever/python/include/`
- `-DPython3_EXECUTABLE=/your/py3/directory/`

- I get compiler errors about missing header files
Expand Down
12 changes: 6 additions & 6 deletions doc/code/gui.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ qmlRegisterType<ResourceAmountLink>("yay.sfttech.openage", 1, 0, "ResourceAmount

2. Specializations `struct Wrap<ResourceAmount>` and `struct Unwrap<ResourceAmountLink>` must be defined:
```cpp
namespace qtsdl {
namespace qtgui {
template<>
struct Wrap<ResourceAmount> {
using Type = ResourceAmountLink;
Expand All @@ -61,13 +61,13 @@ template<>
struct Unwrap<ResourceAmountLink> {
using Type = ResourceAmount;
};
} // namespace qtsdl
} // namespace qtgui
```
3. Also ResourceAmount needs a public member to be added:
```cpp
public:
qtsdl::GuiItemLink *gui_link
qtgui::GuiItemLink *gui_link
```

4. Declare and implement needed properties and signals in the `ResourceAmountLink` using Qt property syntax.
Expand All @@ -78,7 +78,7 @@ There is a class `GeneratorParameters` in `libopenage/` directory.
It has a big list of parameters of different types like `generation_seed`, `player_radius`, `player_names`, etc.
So, we're not going to write a Qt property for each one:

1. `GeneratorParameters` must derive from the `qtsdl::GuiPropertyMap`.
1. `GeneratorParameters` must derive from the `qtgui::GuiPropertyMap`.

2. `GeneratorParameters` should set its initial values like so:
```cpp
Expand All @@ -96,7 +96,7 @@ qmlRegisterType<GeneratorParametersLink>("yay.sfttech.openage", 1, 0, "Generator

4. Specializations `struct Wrap<GeneratorParameters>` and `struct Unwrap<GeneratorParametersLink>` must be defined:
```cpp
namespace qtsdl {
namespace qtgui {
template<>
struct Wrap<GeneratorParameters> {
using Type = GeneratorParametersLink;
Expand All @@ -106,7 +106,7 @@ template<>
struct Unwrap<GeneratorParametersLink> {
using Type = GeneratorParameters;
};
} // namespace qtsdl
} // namespace qtgui
```
That results into a `ListModel`-like QML type with `display` and `edit` roles.
Expand Down
9 changes: 6 additions & 3 deletions doc/code_style/mom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@
// The associated header file comes first!
#include "mom.h"

// System includes follow, sorted alphabetically
// C++ std library includes follow, sorted alphabetically
#include <cmath>
#include <cstdio>
#include <iostream>
#include <SDL/SDL.h>

// Local includes next, sorted alphabetically
// External libraries are next, sorted alphabetically
#include <eigen3/Eigen/Dense>
#include <epoxy/gl.h>

// Local includes come last, sorted alphabetically
#include "../valve.h"
#include "half_life.h"
#include "log/log.h"
Expand Down
15 changes: 0 additions & 15 deletions doc/troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,3 @@ A workaround would be to make a backup of your AGE2 directory and let the conver
backup at subfolder `AGE2/resources` delete all files ***except*** folders. Another workaround would be to
backup your AGE2 folder and redownload it to have a clean install. After conversion you can replace
it with the backup.

## Installation

### Cannot specify compile definitions for target "SDL2::SDL2" which is not built by this project

This error is specific to a few operating systems. The main cause is that your SDL2 version is too old and does not
include the necessary CMake files defining the target. There is an indepth discussion about this
[here](https://discourse.libsdl.org/t/how-is-sdl2-supposed-to-be-used-with-cmake/31275/16).
As a solution, you should update your SDL packages to SDL >=2.0.12 or **compile the latest SDL2 and SDL2-image from
source**. The latest version includes the necessary CMake files to expose the `SDL2::SDL2` target.

## Building on Debian 12
On Debian you might get an error saying that it couldn't find SDL2 library. This happens because the CMAKE prefix and SDL2 path are not set correctly.
The solution is to append at the end of the `./configure` command the cmake variables for both the prefix and SDL2 path, like so:
`./configure <your configure opts> -- -DCMAKE_PREFIX_PATH=/usr -DSDL2_DIR=/usr/include/SDL2` (you can use `find` to look for the correct paths)
20 changes: 2 additions & 18 deletions libopenage/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ find_library(FONTCONFIG_LIB fontconfig)
find_package(toml11 REQUIRED)
find_package(Freetype REQUIRED)
find_package(PNG REQUIRED)
find_package(SDL2 CONFIG REQUIRED)
target_compile_definitions(SDL2::SDL2 INTERFACE SDL_MAIN_HANDLED)
find_package(SDL2Image REQUIRED)
find_package(Opusfile REQUIRED)
find_package(Epoxy REQUIRED)
find_package(HarfBuzz 1.0.0 REQUIRED)
Expand All @@ -65,8 +62,7 @@ set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)

set(QT_VERSION_REQ "6.2")
find_package(Qt6Core ${QT_VERSION_REQ} REQUIRED)
find_package(Qt6Quick ${QT_VERSION_REQ} REQUIRED)
find_package(Qt6 ${QT_VERSION_REQ} REQUIRED COMPONENTS Core Quick Multimedia)

if(WANT_BACKTRACE)
find_package(GCCBacktrace)
Expand Down Expand Up @@ -268,7 +264,6 @@ target_include_directories(libopenage
${EPOXY_INCLUDE_DIRS}
${OPUS_INCLUDE_DIRS}
${PNG_INCLUDE_DIRS}
${SDL2IMAGE_INCLUDE_DIRS}
${HarfBuzz_INCLUDE_DIRS}
${QTPLATFORM_INCLUDE_DIRS}
)
Expand All @@ -292,14 +287,13 @@ target_link_libraries(libopenage
${FREETYPE_LIBRARIES}
${EPOXY_LIBRARIES}
${MATH_LIB}
${SDL2IMAGE_LIBRARIES}
SDL2::SDL2
${UTIL_LIB}
${HarfBuzz_LIBRARIES}
${RT_LIB}
${EXECINFO_LIB}
Qt6::Core
Qt6::Quick
Qt6::Multimedia
)

##################################################
Expand All @@ -322,19 +316,14 @@ get_codegen_scu_file()
# are specified above the source file list.

add_sources(libopenage
handlers.cpp
legacy_engine.cpp
main.cpp
options.cpp
screenshot.cpp
texture.cpp
${CMAKE_CURRENT_BINARY_DIR}/config.cpp
${CMAKE_CURRENT_BINARY_DIR}/version.cpp
${CODEGEN_SCU_FILE}
)

pxdgen(
legacy_engine.h
main.h
)

Expand All @@ -349,9 +338,7 @@ add_subdirectory("datastructure")
add_subdirectory("engine")
add_subdirectory("error")
add_subdirectory("event")
add_subdirectory("gamedata")
add_subdirectory("gamestate")
add_subdirectory("gui")
add_subdirectory("input")
add_subdirectory("job")
add_subdirectory("log")
Expand All @@ -361,10 +348,7 @@ add_subdirectory("presenter")
add_subdirectory("pyinterface")
add_subdirectory("renderer")
add_subdirectory("rng")
add_subdirectory("shader")
add_subdirectory("terrain")
add_subdirectory("testing")
add_subdirectory("time")
add_subdirectory("unit")
add_subdirectory("util")
add_subdirectory("versions")
2 changes: 0 additions & 2 deletions libopenage/assets/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
add_sources(libopenage
assetmanager.cpp
legacy_assetmanager.cpp
mod_manager.cpp
modpack.cpp
)
Loading

0 comments on commit d0d9a4b

Please sign in to comment.