diff --git a/CMakeLists.txt b/CMakeLists.txt index b3e5309..bf5ae88 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -130,7 +130,7 @@ elseif(APPLE) list(APPEND MAIN_SOURCE src/mac-desktop.mm) else() find_package(PkgConfig REQUIRED) - pkg_check_modules(LINUXPKGS REQUIRED gtk+-2.0 libxfconf-0) + pkg_check_modules(LINUXPKGS REQUIRED gtk+-4.0 libxfconf-0) include_directories(${LINUXPKGS_INCLUDE_DIRS}) add_compile_options(${LINUXPKGS_CFLAGS_OTHER}) list(APPEND PLATFORM_LIBRARIES ${LINUXPKGS_LDFLAGS}) diff --git a/src/font.cpp b/src/font.cpp index c40b3cf..b1cc869 100644 --- a/src/font.cpp +++ b/src/font.cpp @@ -88,7 +88,7 @@ SharedFontState::~SharedFontState() delete p; } -void SharedFontState::initFontSetCB(SDL_RWops &ops, +void SharedFontState::initFontSetCB(SDL_IOStream &ops, const std::string &filename) { TTF_Font *font = TTF_OpenFontRW(&ops, 0, 0); @@ -96,8 +96,8 @@ void SharedFontState::initFontSetCB(SDL_RWops &ops, if (!font) return; - std::string family = TTF_FontFaceFamilyName(font); - std::string style = TTF_FontFaceStyleName(font); + std::string family = TTF_GetFontFamilyName(font); + std::string style = TTF_GetFontStyleName(font); TTF_CloseFont(font); @@ -133,7 +133,7 @@ _TTF_Font *SharedFontState::getFont(std::string family, return font; /* Not in pool; open new handle */ - SDL_RWops *ops; + SDL_IOStream *ops; if (family.empty()) { @@ -146,7 +146,7 @@ _TTF_Font *SharedFontState::getFont(std::string family, const char *path = !req.regular.empty() ? req.regular.c_str() : req.other.c_str(); - ops = SDL_AllocRW(); + ops = SDL_OpenIO(); shState->fileSystem().openReadRaw(*ops, path, true); } diff --git a/src/font.h b/src/font.h index 2724762..c436809 100644 --- a/src/font.h +++ b/src/font.h @@ -28,7 +28,7 @@ #include #include -struct SDL_RWops; +struct SDL_IOStream; struct _TTF_Font; struct Config; @@ -44,7 +44,7 @@ public: * (when "Fonts/" is scanned for available assets). * 'ops' is an opened handle to a possible font file, * 'filename' is the corresponding path */ - void initFontSetCB(SDL_RWops &ops, + void initFontSetCB(SDL_IOStream &ops, const std::string &filename); _TTF_Font *getFont(std::string family, diff --git a/src/gl-fun.cpp b/src/gl-fun.cpp index cb520bd..41f2999 100644 --- a/src/gl-fun.cpp +++ b/src/gl-fun.cpp @@ -24,7 +24,7 @@ #include "boost-hash.h" #include "exception.h" -#include +#include #include GLFunctions gl; diff --git a/src/gl-fun.h b/src/gl-fun.h index b989ba9..72c726d 100644 --- a/src/gl-fun.h +++ b/src/gl-fun.h @@ -26,7 +26,7 @@ #include #define APIENTRYP GL_APIENTRYP #else -#include +#include #endif /* Etc */ diff --git a/src/gl-meta.cpp b/src/gl-meta.cpp index 321c6eb..97579bf 100644 --- a/src/gl-meta.cpp +++ b/src/gl-meta.cpp @@ -51,7 +51,7 @@ void subRectImageUpload(GLint srcW, GLint srcX, GLint srcY, TEX::uploadSubImage(dstX, dstY, dstW, dstH, tmp->pixels, format); - SDL_FreeSurface(tmp); + SDL_DestroySurface(tmp); } } diff --git a/src/gl-meta.h b/src/gl-meta.h index a30e478..f8d5d96 100644 --- a/src/gl-meta.h +++ b/src/gl-meta.h @@ -26,7 +26,7 @@ #include "gl-util.h" #include "vertex.h" -#include +#include namespace GLMeta { diff --git a/src/glstate.cpp b/src/glstate.cpp index ff88de7..96b00b1 100644 --- a/src/glstate.cpp +++ b/src/glstate.cpp @@ -25,7 +25,7 @@ #include "gl-fun.h" #include "config.h" -#include +#include static void applyBool(GLenum state, bool mode) { diff --git a/src/graphics.cpp b/src/graphics.cpp index 8cd2132..44332fb 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -39,9 +39,9 @@ #include "debugwriter.h" #include "oneshot.h" -#include -#include -#include +#include +#include +#include #include #ifndef _MSC_VER