Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*.user
# IDE files
/.idea
# Meson files
*.wraplock

compile_commands.json
**/.ccls-cache
Expand Down
10 changes: 5 additions & 5 deletions Data/Base.rte/Shaders/Background.frag
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#version 330
#version 330 core
#extension GL_KHR_blend_equation_advanced: enable
#extension GL_ARB_sample_shading: enable

Expand All @@ -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);
Expand All @@ -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));
}
}
2 changes: 1 addition & 1 deletion Data/Base.rte/Shaders/Blit8.frag
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Blit8.frag
#version 130
#version 330 core

in vec2 textureUV;

Expand Down
2 changes: 1 addition & 1 deletion Data/Base.rte/Shaders/Blit8.vert
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#version 130
#version 330 core

in vec3 rteVertexPosition;
in vec2 rteVertexTexUV;
Expand Down
8 changes: 4 additions & 4 deletions Data/Base.rte/Shaders/Dissolve.frag
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#version 130
#version 330 core

in vec2 textureUV;
in vec4 vertexColor;
Expand Down Expand Up @@ -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);
Expand All @@ -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;
}
2 changes: 1 addition & 1 deletion Data/Base.rte/Shaders/Flat.frag
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#version 130
#version 330 core

in vec2 textureUV;

Expand Down
6 changes: 3 additions & 3 deletions Data/Base.rte/Shaders/PostProcess.frag
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#version 130
#version 330 core

in vec2 textureUV;
in vec4 vertexColor;
Expand All @@ -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);
Expand All @@ -19,5 +19,5 @@ vec4 texture2DAA(sampler2D tex, vec2 uv) {
}

void main() {
FragColor = texture2DAA(rteTexture, textureUV) * rteColor * vertexColor;
FragColor = textureAA(rteTexture, textureUV) * rteColor * vertexColor;
}
2 changes: 1 addition & 1 deletion Data/Base.rte/Shaders/PostProcess.vert
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#version 130
#version 330 core

in vec3 rteVertexPosition;
in vec2 rteVertexTexUV;
Expand Down
8 changes: 4 additions & 4 deletions Data/Base.rte/Shaders/ScreenBlit.frag
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#version 130
#version 330 core

in vec2 textureUV;

Expand All @@ -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);
Expand All @@ -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;
}
2 changes: 1 addition & 1 deletion Data/Base.rte/Shaders/ScreenBlit.vert
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#version 130
#version 330 core

in vec3 rteVertexPosition;
in vec2 rteVertexTexUV;
Expand Down
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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`
Expand All @@ -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.

Expand Down Expand Up @@ -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:**
Expand Down
2 changes: 1 addition & 1 deletion Source/Managers/WindowMan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
6 changes: 3 additions & 3 deletions meson.build
Original file line number Diff line number Diff line change
@@ -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 ####

Expand Down Expand Up @@ -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')
Expand All @@ -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 ####
Expand Down