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 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/README.md b/README.md index 746465662c..007de18323 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,9 @@ 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) * `opengl` (usually provided by the gpu driver) * `flac` * `luajit` @@ -88,7 +81,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,13 +115,13 @@ 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 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:** 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(); diff --git a/meson.build b/meson.build index 9ec9394b80..604c0d7797 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 #### @@ -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 ####