EngineRework - OnlineCop/kq-fork GitHub Wiki
Allegro 4 to SDL2
Convert from- Allegro 4 has been deprecated, so it can be difficult to get working on modern OS's.
- DUMB can also be difficult to get working on modern OS's.
- SDL_mixer may be a drop-in replacement.
- KQ appears laggy/choppy on modern hardware.
- This could be due to the libraries.
- The code calls redraw functions like
blit2screen
within scripts and when menus are displayed. - Running (holding the left CTRL button on the overworld map) makes screen redraw look choppy.
Nice-to-haves if the engine was remade
- 32-bit colors.
- Support for sprites taller than tile size.
- Many OGA sprites are at least 18px tall.
- Better window scaling for larger monitors.
- Support for multiple tilesets per map.
Building on windows with new SDL branch on (road_to_1.0)
- Install vcpkg https://vcpkg.io/en/getting-started.html.
- I commented out include(FindPkgConfig) and pkg_check_modules(SDL2_MIXER REQUIRED sdl2_mixer) in CMakeLists.txt
- I modified CMakeSettings.json
{ "configurations": [ { "name": "x64-Debug", "generator": "Ninja", "configurationType": "Debug", "buildRoot": "${projectDir}\\out\\build\\${name}", "installRoot": "${projectDir}\\out\\install\\${name}", "cmakeCommandArgs": "", "buildCommandArgs": "", "ctestCommandArgs": "", "inheritEnvironments": [ "msvc_x64_x64" ], "variables": [ { "name": "VCPKG_MANIFEST_MODE", "value": "True", "type": "BOOL" }, { "name": "VCPKG_MANIFEST_INSTALL", "value": "True", "type": "BOOL" }, { "name": "KQ_DATADIR", "value": "<REPLACE WITH YOUR KQ FOLDER>", "type": "STRING" } ] } ] }
- And made a vcpkg.json file in the root kq folder
{ "name": "kq", "version-string": "0.99", "dependencies": [ "pkgconf", "sdl2", "sdl2-mixer", "lua", "libpng", "zlib", "tinyxml2" ] }
- Then I opened the kq-fork folder in VisualStudio2019 and regenerated the CMake Cache and then it built on windows.
I haven't committed this yet because we have to decide if we want to commit the vcpkg.json and force the libraries to be installed in your build folder or if I should learn how to modify the cmakesettings to go off of global vcpkg installs, and then we add the vcpkg install or apt install commands to the readme. I'm leaning toward maybe we should learn how to make vcpkg integrate with CMake correctly so I can generate a real Visual Studio Solution, going off a straight Cmake project has some quirks.
Hmm maybe I should have followed the vcpkg instructions better. Running cmake -B build/ -S . -DKQ_DATADIR=YOUR PATH/kq-fork -DCMAKE_TOOLCHAIN_FILE=YOUR PATH/vcpkg/scripts/buildsystems/vcpkg.cmake
made the Visual Studio project just fine.