From 4c3afed824d33d629a3f8d14f59acff4a1e9a990 Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Tue, 3 Mar 2026 16:22:01 -0600 Subject: [PATCH] refactor: remove the need for `gl_stubs.h` --- Minecraft.Client/DemoLevel.cpp | 2 +- Minecraft.Client/DemoLevel.h | 2 +- Minecraft.Client/Linux/Stubs/LinuxStubs.h | 5 ++- Minecraft.Client/Linux/Stubs/d3d11_stubs.h | 34 +++++++++++++++++++ Minecraft.Client/Linux/Stubs/gl_stubs.h | 10 ------ .../Windows64/4JLibs/inc/4J_Render.h | 2 -- 6 files changed, 38 insertions(+), 17 deletions(-) delete mode 100644 Minecraft.Client/Linux/Stubs/gl_stubs.h diff --git a/Minecraft.Client/DemoLevel.cpp b/Minecraft.Client/DemoLevel.cpp index 0e72033f9..bec808be2 100644 --- a/Minecraft.Client/DemoLevel.cpp +++ b/Minecraft.Client/DemoLevel.cpp @@ -2,7 +2,7 @@ #include "DemoLevel.h" #include "../Minecraft.World/net.minecraft.world.level.storage.h" -const LevelSettings DemoLevel::DEMO_LEVEL_SETTINGS = LevelSettings( +LevelSettings DemoLevel::DEMO_LEVEL_SETTINGS = LevelSettings( DemoLevel::DEMO_LEVEL_SEED, GameType::SURVIVAL, false, diff --git a/Minecraft.Client/DemoLevel.h b/Minecraft.Client/DemoLevel.h index e9e1ee72f..7e2c770bd 100644 --- a/Minecraft.Client/DemoLevel.h +++ b/Minecraft.Client/DemoLevel.h @@ -5,10 +5,10 @@ class DemoLevel : public Level { private: static const __int64 DEMO_LEVEL_SEED = 0; // 4J - TODO - was "Don't Look Back".hashCode(); - static const LevelSettings DEMO_LEVEL_SETTINGS; static const int DEMO_SPAWN_X = 796; static const int DEMO_SPAWN_Y = 72; static const int DEMO_SPAWN_Z = -731; + static LevelSettings DEMO_LEVEL_SETTINGS; public: DemoLevel(shared_ptr levelStorage, const wstring& levelName); DemoLevel(Level *level, Dimension *dimension); diff --git a/Minecraft.Client/Linux/Stubs/LinuxStubs.h b/Minecraft.Client/Linux/Stubs/LinuxStubs.h index 61cc4d64c..d936f7c39 100644 --- a/Minecraft.Client/Linux/Stubs/LinuxStubs.h +++ b/Minecraft.Client/Linux/Stubs/LinuxStubs.h @@ -3,10 +3,9 @@ #pragma once -#include "gl_stubs.h" -#include "d3d11_stubs.h" -#include "iggy_stubs.h" #include "winapi_stubs.h" +#include "d3d11_stubs.h" #include "xbox_stubs.h" +#include "iggy_stubs.h" #endif // STUBS_H \ No newline at end of file diff --git a/Minecraft.Client/Linux/Stubs/d3d11_stubs.h b/Minecraft.Client/Linux/Stubs/d3d11_stubs.h index efa13ebc8..52edb5625 100644 --- a/Minecraft.Client/Linux/Stubs/d3d11_stubs.h +++ b/Minecraft.Client/Linux/Stubs/d3d11_stubs.h @@ -34,4 +34,38 @@ typedef void ID3D11Resource; typedef void ID3D11Texture2D; typedef void D3D11_TEXTURE2D_DESC; +enum D3D11_BLEND +{ + D3D11_BLEND_ZERO = 1, + D3D11_BLEND_ONE = 2, + D3D11_BLEND_SRC_COLOR = 3, + D3D11_BLEND_INV_SRC_COLOR = 4, + D3D11_BLEND_SRC_ALPHA = 5, + D3D11_BLEND_INV_SRC_ALPHA = 6, + D3D11_BLEND_DEST_ALPHA = 7, + D3D11_BLEND_INV_DEST_ALPHA = 8, + D3D11_BLEND_DEST_COLOR = 9, + D3D11_BLEND_INV_DEST_COLOR = 10, + D3D11_BLEND_SRC_ALPHA_SAT = 11, + D3D11_BLEND_BLEND_FACTOR = 14, + D3D11_BLEND_INV_BLEND_FACTOR = 15, + D3D11_BLEND_SRC1_COLOR = 16, + D3D11_BLEND_INV_SRC1_COLOR = 17, + D3D11_BLEND_SRC1_ALPHA = 18, + D3D11_BLEND_INV_SRC1_ALPHA = 19 +}; + + +enum D3D11_COMPARISON_FUNC +{ + D3D11_COMPARISON_NEVER = 1, + D3D11_COMPARISON_LESS = 2, + D3D11_COMPARISON_EQUAL = 3, + D3D11_COMPARISON_LESS_EQUAL = 4, + D3D11_COMPARISON_GREATER = 5, + D3D11_COMPARISON_NOT_EQUAL = 6, + D3D11_COMPARISON_GREATER_EQUAL = 7, + D3D11_COMPARISON_ALWAYS = 8 +}; + #endif // D3D11STUBS_H \ No newline at end of file diff --git a/Minecraft.Client/Linux/Stubs/gl_stubs.h b/Minecraft.Client/Linux/Stubs/gl_stubs.h deleted file mode 100644 index 1cd02fb36..000000000 --- a/Minecraft.Client/Linux/Stubs/gl_stubs.h +++ /dev/null @@ -1,10 +0,0 @@ -#ifndef GLSTUBS_H -#define GLSTUBS_H - -#pragma once - -#define GL_ONE 1 -#define GL_SRC_ALPHA 0x0302 -#define GL_ONE_MINUS_SRC_ALPHA 0x0303 - -#endif // GLSTUBS_H \ No newline at end of file diff --git a/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h b/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h index 8fc510616..ac84ac97d 100644 --- a/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h +++ b/Minecraft.Client/Windows64/4JLibs/inc/4J_Render.h @@ -247,7 +247,6 @@ const int CLEAR_COLOUR_FLAG = 2; const int GL_DEPTH_BUFFER_BIT = CLEAR_DEPTH_FLAG; const int GL_COLOR_BUFFER_BIT = CLEAR_COLOUR_FLAG; -#ifndef __linux__ const int GL_SRC_ALPHA = D3D11_BLEND_SRC_ALPHA; const int GL_ONE_MINUS_SRC_ALPHA = D3D11_BLEND_INV_SRC_ALPHA; const int GL_ONE = D3D11_BLEND_ONE; @@ -265,7 +264,6 @@ const int GL_EQUAL = D3D11_COMPARISON_EQUAL; const int GL_LEQUAL = D3D11_COMPARISON_LESS_EQUAL; const int GL_GEQUAL = D3D11_COMPARISON_GREATER_EQUAL; const int GL_ALWAYS = D3D11_COMPARISON_ALWAYS; -#endif // __linux__ const int GL_TEXTURE_MIN_FILTER = 1; const int GL_TEXTURE_MAG_FILTER = 2;