Fix VRAM leak on window resize#413
Conversation
|
Sorry for the delay. I'm a bit hesitant to create a unique_ptr here in this one case as it's not used anywhere else in the code base and like for the C++ version bump, I'd like to keep things so that it could be potentially compiled on a potato if needed. |
|
No problem
Well,
Your choice, I have no info on the portability of different C++ versions to either object or support that :) |
|
I might be being too strict regarding the usage of C++ standard library stuff - I've been wary of sending this project down a "let's port System Shock to modern C++!" rabbit hole of refactoring for refactoring's sake but for something like this it does make sense. I'll merge this in if you can resolve the conflicts. |
0a0f312 to
bbd0d08
Compare
|
Hello! Sorry, I kind of tuned out for quite a while... the conflicts should be solved now I've had some problems building this on a modern system though (Arch), the CMake required version seems outdated, the older SDL version fails to link to Wayland libs, and some new warnings make dependency compilations fail. I've had to also use this for testing: diff --git a/CMakeLists.txt b/CMakeLists.txt
index f240aa81..12d88b21 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.1)
+cmake_minimum_required(VERSION 4.3)
project(shockolate VERSION 0.7.8)
diff --git a/build_deps.sh b/build_deps.sh
index df5d1280..56ba8c41 100755
--- a/build_deps.sh
+++ b/build_deps.sh
@@ -1,7 +1,7 @@
#!/bin/bash
set -e
-SDL_version=2.0.9
+SDL_version=2.0.20
SDL2_mixer_version=2.0.4
if [ -d ./build_ext/ ]; then
@@ -24,7 +24,7 @@ function build_sdl {
tar xvf SDL2-${SDL_version}.tar.gz
pushd SDL2-${SDL_version}
- ./configure --prefix=${install_dir}/built_sdl
+ CFLAGS=-Wno-incompatible-pointer-types ./configure --prefix=${install_dir}/built_sdl
make
make install
@@ -47,12 +47,15 @@ function build_sdl_mixer {
function build_fluidsynth {
git clone https://github.com/EtherTyper/fluidsynth-lite.git
pushd fluidsynth-lite
+ sed -i 's/2.6.3/4.1/g' CMakeLists.txt
sed -i 's/DLL"\ off/DLL"\ on/' CMakeLists.txt
# if building fluidsynth fails, move on without it
set +e
#export CFLAGS="-m32"
#export CXXFLAGS="-m32"
+ export CFLAGS="-Wno-unterminated-string-initialization -Wno-unused-but-set-variable"
+ export CXXFLAGS="$CFLAGS"
cmake .
cmake --build .I didn't include this in the PR ofc, but just thought I'd let you know |
Also newer compilers give a warning (that gets promoted to a compile-time error) on
interp.c:216. Fixed it with an explicit conversionAdmittedly, using a
std::unique_ptris a bit overkill here becauseCreateFrameBufferis only called once in the entire code base, but I've decided to stay future-proof just in case.Also, maybe project's
CMAKE_CXX_STANDARDcould be bumped to at least 14-17? I see no reason to keep it as low as 11, but ofc there's also an argument of "if it ain't broke don't fix it"...