From 30c25d5d19931aadd22ac5e7a45f33867aa20776 Mon Sep 17 00:00:00 2001 From: Tommy March Date: Fri, 2 Jan 2026 00:11:59 +0530 Subject: [PATCH 1/5] Shader fixes: * Use core opengl version so works on OSX * Use texture, not deprecated texture2D (and renamed appropriately) --- Data/Base.rte/Shaders/Background.frag | 10 +++++----- Data/Base.rte/Shaders/Blit8.frag | 2 +- Data/Base.rte/Shaders/Blit8.vert | 2 +- Data/Base.rte/Shaders/Dissolve.frag | 8 ++++---- Data/Base.rte/Shaders/Flat.frag | 2 +- Data/Base.rte/Shaders/PostProcess.frag | 6 +++--- Data/Base.rte/Shaders/PostProcess.vert | 2 +- Data/Base.rte/Shaders/ScreenBlit.frag | 8 ++++---- Data/Base.rte/Shaders/ScreenBlit.vert | 2 +- Source/Managers/WindowMan.cpp | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Data/Base.rte/Shaders/Background.frag b/Data/Base.rte/Shaders/Background.frag index 7f8449e15b..1110efcbbd 100644 --- a/Data/Base.rte/Shaders/Background.frag +++ b/Data/Base.rte/Shaders/Background.frag @@ -1,4 +1,4 @@ -#version 330 +#version 330 core #extension GL_KHR_blend_equation_advanced: enable #extension GL_ARB_sample_shading: enable @@ -16,7 +16,7 @@ uniform bool rteBlendInvert = false; uniform bool drawMasked = false; -vec4 texture2DAA(sampler2D tex, vec2 uv) { +vec4 textureAA(sampler2D tex, vec2 uv) { vec2 texsize = vec2(textureSize(tex, 0)); vec2 uv_texspace = uv * texsize; vec2 seam = floor(uv_texspace + .5); @@ -26,13 +26,13 @@ vec4 texture2DAA(sampler2D tex, vec2 uv) { } void main() { - float red = texture2D(rteTexture, textureUV).r; + float red = texture(rteTexture, textureUV).r; if (red==0 && drawMasked) { discard; } if (!rteBlendInvert) { - FragColor = texture2DAA(rtePalette, vec2(red * vertexColor.r, 0.0)) * vec4(rteColor.rgb, rteColor.a * vertexColor.a); + FragColor = textureAA(rtePalette, vec2(red * vertexColor.r, 0.0)) * vec4(rteColor.rgb, rteColor.a * vertexColor.a); } else { - FragColor = vec4(vec3(1.0), 0.0) - (texture2DAA(rtePalette, vec2(red * vertexColor.r, 0.0)) * vec4(rteColor.rgb, -rteColor.a * vertexColor.a)); + FragColor = vec4(vec3(1.0), 0.0) - (textureAA(rtePalette, vec2(red * vertexColor.r, 0.0)) * vec4(rteColor.rgb, -rteColor.a * vertexColor.a)); } } diff --git a/Data/Base.rte/Shaders/Blit8.frag b/Data/Base.rte/Shaders/Blit8.frag index f61dfd7831..a1b5e05aff 100644 --- a/Data/Base.rte/Shaders/Blit8.frag +++ b/Data/Base.rte/Shaders/Blit8.frag @@ -1,5 +1,5 @@ // Blit8.frag -#version 130 +#version 330 core in vec2 textureUV; diff --git a/Data/Base.rte/Shaders/Blit8.vert b/Data/Base.rte/Shaders/Blit8.vert index ee58dc5626..da626baa08 100644 --- a/Data/Base.rte/Shaders/Blit8.vert +++ b/Data/Base.rte/Shaders/Blit8.vert @@ -1,4 +1,4 @@ -#version 130 +#version 330 core in vec3 rteVertexPosition; in vec2 rteVertexTexUV; diff --git a/Data/Base.rte/Shaders/Dissolve.frag b/Data/Base.rte/Shaders/Dissolve.frag index 446027755b..859e7e2775 100644 --- a/Data/Base.rte/Shaders/Dissolve.frag +++ b/Data/Base.rte/Shaders/Dissolve.frag @@ -1,4 +1,4 @@ -#version 130 +#version 330 core in vec2 textureUV; in vec4 vertexColor; @@ -32,7 +32,7 @@ float noise( vec2 U ) return mix( C.x, C.y, U.y ); } -vec4 texture2DAA(sampler2D tex, vec2 uv) { +vec4 textureAA(sampler2D tex, vec2 uv) { vec2 texsize = vec2(textureSize(tex, 0)); vec2 uv_texspace = uv * texsize; vec2 seam = floor(uv_texspace + .5); @@ -45,8 +45,8 @@ void main() { if (noise(gl_FragCoord.xy + textureUV) < 0.5) { discard; } - float red = texture2D(rteTexture, textureUV).r; - vec4 color = texture2DAA(rtePalette, vec2(red * vertexColor.r, 0.0)) * vec4(rteColor.rgb, rteColor.a * vertexColor.a); + float red = texture(rteTexture, textureUV).r; + vec4 color = textureAA(rtePalette, vec2(red * vertexColor.r, 0.0)) * vec4(rteColor.rgb, rteColor.a * vertexColor.a); FragColor = color; } \ No newline at end of file diff --git a/Data/Base.rte/Shaders/Flat.frag b/Data/Base.rte/Shaders/Flat.frag index cb0e6e1dfe..cad17c7f4b 100644 --- a/Data/Base.rte/Shaders/Flat.frag +++ b/Data/Base.rte/Shaders/Flat.frag @@ -1,4 +1,4 @@ -#version 130 +#version 330 core in vec2 textureUV; diff --git a/Data/Base.rte/Shaders/PostProcess.frag b/Data/Base.rte/Shaders/PostProcess.frag index ed2835c5fd..c49408f682 100644 --- a/Data/Base.rte/Shaders/PostProcess.frag +++ b/Data/Base.rte/Shaders/PostProcess.frag @@ -1,4 +1,4 @@ -#version 130 +#version 330 core in vec2 textureUV; in vec4 vertexColor; @@ -9,7 +9,7 @@ uniform sampler2D rteTexture; uniform vec4 rteColor; -vec4 texture2DAA(sampler2D tex, vec2 uv) { +vec4 textureAA(sampler2D tex, vec2 uv) { vec2 texsize = vec2(textureSize(tex, 0)); vec2 uv_texspace = uv * texsize; vec2 seam = floor(uv_texspace + .5); @@ -19,5 +19,5 @@ vec4 texture2DAA(sampler2D tex, vec2 uv) { } void main() { - FragColor = texture2DAA(rteTexture, textureUV) * rteColor * vertexColor; + FragColor = textureAA(rteTexture, textureUV) * rteColor * vertexColor; } diff --git a/Data/Base.rte/Shaders/PostProcess.vert b/Data/Base.rte/Shaders/PostProcess.vert index 8c2ba4bfa1..affd9d6b06 100644 --- a/Data/Base.rte/Shaders/PostProcess.vert +++ b/Data/Base.rte/Shaders/PostProcess.vert @@ -1,4 +1,4 @@ -#version 130 +#version 330 core in vec3 rteVertexPosition; in vec2 rteVertexTexUV; diff --git a/Data/Base.rte/Shaders/ScreenBlit.frag b/Data/Base.rte/Shaders/ScreenBlit.frag index 6ce4707916..48b5e42ba6 100644 --- a/Data/Base.rte/Shaders/ScreenBlit.frag +++ b/Data/Base.rte/Shaders/ScreenBlit.frag @@ -1,4 +1,4 @@ -#version 130 +#version 330 core in vec2 textureUV; @@ -7,7 +7,7 @@ out vec4 FragColor; uniform sampler2D rteTexture; uniform sampler2D rteGUITexture; -vec4 texture2DAA(sampler2D tex, vec2 uv) { +vec4 textureAA(sampler2D tex, vec2 uv) { vec2 texsize = vec2(textureSize(tex, 0)); vec2 uv_texspace = uv * texsize; vec2 seam = floor(uv_texspace + .5); @@ -17,8 +17,8 @@ vec4 texture2DAA(sampler2D tex, vec2 uv) { } void main() { - vec4 guiColor = texture2DAA(rteGUITexture, vec2(textureUV.x, -textureUV.y)); + vec4 guiColor = textureAA(rteGUITexture, vec2(textureUV.x, -textureUV.y)); float guiSolid = float((guiColor.r + guiColor.g + guiColor.b) > 0.0); float blendRatio = max(guiColor.a, guiSolid); - FragColor = (texture2DAA(rteTexture, textureUV) * (1.0F - blendRatio)) + guiColor * blendRatio; + FragColor = (textureAA(rteTexture, textureUV) * (1.0F - blendRatio)) + guiColor * blendRatio; } diff --git a/Data/Base.rte/Shaders/ScreenBlit.vert b/Data/Base.rte/Shaders/ScreenBlit.vert index 3532362c5e..a5f67d44a3 100644 --- a/Data/Base.rte/Shaders/ScreenBlit.vert +++ b/Data/Base.rte/Shaders/ScreenBlit.vert @@ -1,4 +1,4 @@ -#version 130 +#version 330 core in vec3 rteVertexPosition; in vec2 rteVertexTexUV; diff --git a/Source/Managers/WindowMan.cpp b/Source/Managers/WindowMan.cpp index 2b80a62be6..51c87a1616 100644 --- a/Source/Managers/WindowMan.cpp +++ b/Source/Managers/WindowMan.cpp @@ -136,7 +136,7 @@ void WindowMan::Initialize() { ImGui::StyleColorsDark(); ImGui_ImplSDL3_InitForOpenGL(m_PrimaryWindow.get(), m_GLContext.get()); - ImGui_ImplOpenGL3_Init("#version 130"); + ImGui_ImplOpenGL3_Init("#version 330 core"); ImGui_ImplOpenGL3_NewFrame(); ImGui_ImplSDL3_NewFrame(); ImGui::NewFrame(); From 36c8fa6ea055cf2852540435dfc471881781c1ee Mon Sep 17 00:00:00 2001 From: Tommy March Date: Fri, 2 Jan 2026 00:30:37 +0530 Subject: [PATCH 2/5] Updated readme and meson info to the best of my limited understanding: * GCC 12 wasn't compiling for me anymore. I had to update to 13- unsure if this is MacOSX specific, but updating * We use SDL3 now, not SDL2. * SDL2_Image is gone * Upped meson version to 1.6 SDL3 seems to require it, and tracy at least requires 1.3. In any case I had to update past 1.0.0 (which I had) to build. * Updated version number in meson to be representative of the actual project now (not pre 4.1!) --- README.md | 19 ++++++------------- meson.build | 2 +- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 746465662c..a16674823b 100644 --- a/README.md +++ b/README.md @@ -38,13 +38,7 @@ You may also want to check out the list of recommended Visual Studio plugins [he 2. Clone this Repository into a folder. -3. Copy the following libraries from `Cortex-Command-Community-Project\external\lib\win` into the root directory: -* `fmod.dll` -* `SDL2.dll` - - For 32-bit builds, copy the following libraries from the `x86` folder inside `...\lib\win` as well: -* `fmodL.dll` -* `SDL2-32.dll` +3. Copy the `fmod.dll` library from `Cortex-Command-Community-Project\external\lib\win` into the root directory. Now you're ready to build and launch the game. Simply open `RTEA.sln` with Visual Studio, choose your target platform (x86 or x64) and configuration, and run the project. @@ -75,10 +69,10 @@ The Linux build uses the meson build system, and builds against system libraries ## Dependencies -* [`meson`](https://www.mesonbuild.com)`>= 1.0.0` (`pip install meson` if your distro doesn't include a recent version) +* [`meson`](https://www.mesonbuild.com)`>= 1.6.0` (`pip install meson`/`brew install meson` if your distro doesn't include a recent version) * `ninja` -* `gcc`, `g++` (>=12, clang unsupported) -* `sdl2` +* `gcc`, `g++` (>=13, clang unsupported) +* `sdl3` * `opengl` (usually provided by the gpu driver) * `flac` * `luajit` @@ -88,7 +82,6 @@ The Linux build uses the meson build system, and builds against system libraries * `lz4>=1.9.0` * `libpng` * `dylibbundler` (required only if installing on macOS) -* `SDL2_image` (linux only) For unspecified versions assume compatibility with the latest ubuntu LTS release. @@ -123,10 +116,10 @@ If you want to change the buildtype afterwards, you can use `meson configure --b - `Xcode` or `Command Line Tools for Xcode` (if you need to, you can also generate an xcode project from meson using the `--backend=xcode` option on setup) **Homebrew (macOS):** -`brew install pkg-config sdl2 minizip lz4 flac luajit lua libpng tbb gcc@13 ninja meson dylibbundler` +`brew install pkg-config sdl3 minizip lz4 flac luajit lua libpng tbb gcc@13 ninja meson dylibbundler` **Arch Linux:** -`sudo pacman -S sdl2 sdl2_image tbb flac luajit lua minizip lz4 libpng meson ninja base-devel` +`sudo pacman -S sdl3 tbb flac luajit lua minizip lz4 libpng meson ninja base-devel` **Ubuntu >=22.04:** `sudo apt-get install build-essential libsdl2-dev libsdl2-image-dev libloadpng4-dev libflac++-dev luajit-5.1-dev liblua5.1-dev libminizip-dev liblz4-dev libpng++-dev libtbb-dev ninja-build python3-pip` diff --git a/meson.build b/meson.build index 9ec9394b80..c7bf6f8d5a 100644 --- a/meson.build +++ b/meson.build @@ -1,4 +1,4 @@ -project('Cortex-Command-Community-Project', ['cpp','c'], subproject_dir: 'external/sources', default_options:['cpp_std=c++20', 'buildtype=release', 'default_library=static'], version:'0.1.0-Pre-4.1', meson_version:'>=1.0.0') +project('Cortex-Command-Community-Project', ['cpp','c'], subproject_dir: 'external/sources', default_options:['cpp_std=c++20', 'buildtype=release', 'default_library=static'], version:'7.0.0-dev', meson_version:'>=1.6.0') #### Build environment Setup #### From 97ddb27a75c558e9cf5713bc2da47858d886c0fb Mon Sep 17 00:00:00 2001 From: Tommy March Date: Fri, 2 Jan 2026 00:46:53 +0530 Subject: [PATCH 3/5] Added .wraplock to gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index efb3ceae1a..cffa58a2cf 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ *.user # IDE files /.idea +# Meson files +*.wraplock compile_commands.json **/.ccls-cache From a370e2b8c21aada748002675a9a07d1fd7ff428c Mon Sep 17 00:00:00 2001 From: Tommy March Date: Fri, 2 Jan 2026 00:52:21 +0530 Subject: [PATCH 4/5] Fixed the following error message, caused by allegro's dependency being set before tracy had a change to do its thing ../external/sources/tracy/meson.build:230:6: ERROR: Tried to override dependency 'tracy' which has already been resolved or overridden at ../external/sources/allegro 4.4.3.1-custom/meson.build:75 --- meson.build | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index c7bf6f8d5a..604c0d7797 100644 --- a/meson.build +++ b/meson.build @@ -231,6 +231,8 @@ sdl3_image_dep = sdl3_image_proj.get_variable('sdl3_image_dep') boost_dep = declare_dependency(include_directories: include_directories('external/include/boost_1_75')) meson.override_dependency('boost-175', boost_dep) install_rpath = prefix/get_option('fmod_dir') +tracy_proj = subproject('tracy') +tracy_dep = dependency('tracy') allegro_proj = subproject('allegro 4.4.3.1-custom') luajit_proj = subproject('LuaJIT-2.1') luajit_dep = dependency('luajit') @@ -241,8 +243,6 @@ luabind_proj = subproject('luabind-0.7.1') luabind_dep = dependency('luabind') raknet_proj = subproject('RakNet') raknet_dep = dependency('RakNet') -tracy_proj = subproject('tracy') -tracy_dep = dependency('tracy') deps += [sdl3_dep, sdl3_image_dep, allegro_dep, luajit_dep, loadpng_dep, raknet_dep, boost_dep, tracy_dep] #### Sources Setup #### From d1758e61a1ccf808b5063d5f3ae92eccdad2f3e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Leo=20G=C3=B6ttlicher?= <8429918+HeliumAnt@users.noreply.github.com> Date: Thu, 1 Jan 2026 21:09:46 +0100 Subject: [PATCH 5/5] remove sdl dependency from readme (until we use systemlib sdl3 again) --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a16674823b..007de18323 100644 --- a/README.md +++ b/README.md @@ -72,7 +72,6 @@ The Linux build uses the meson build system, and builds against system libraries * [`meson`](https://www.mesonbuild.com)`>= 1.6.0` (`pip install meson`/`brew install meson` if your distro doesn't include a recent version) * `ninja` * `gcc`, `g++` (>=13, clang unsupported) -* `sdl3` * `opengl` (usually provided by the gpu driver) * `flac` * `luajit` @@ -119,10 +118,10 @@ If you want to change the buildtype afterwards, you can use `meson configure --b `brew install pkg-config sdl3 minizip lz4 flac luajit lua libpng tbb gcc@13 ninja meson dylibbundler` **Arch Linux:** -`sudo pacman -S sdl3 tbb flac luajit lua minizip lz4 libpng meson ninja base-devel` +`sudo pacman -S tbb flac luajit lua minizip lz4 libpng meson ninja base-devel` **Ubuntu >=22.04:** -`sudo apt-get install build-essential libsdl2-dev libsdl2-image-dev libloadpng4-dev libflac++-dev luajit-5.1-dev liblua5.1-dev libminizip-dev liblz4-dev libpng++-dev libtbb-dev ninja-build python3-pip` +`sudo apt-get install build-essential libflac++-dev luajit-5.1-dev liblua5.1-dev libminizip-dev liblz4-dev libpng++-dev libtbb-dev ninja-build python3-pip` `sudo python3 -m pip install meson` **Fedora:**