From 559b207ee258ac67fa27531d054d213e989cd57b Mon Sep 17 00:00:00 2001 From: Tropical <42101043+tropicaaal@users.noreply.github.com> Date: Tue, 7 Apr 2026 18:05:45 -0500 Subject: [PATCH] nuke d3d11_stubs --- targets/app/common/DLCController.cpp | 1 + targets/app/common/UI/UIController.h | 14 +++- targets/app/linux/Stubs/LinuxStubs.h | 1 - targets/app/linux/Stubs/d3d11_stubs.h | 112 +++++++++++++------------- 4 files changed, 69 insertions(+), 59 deletions(-) diff --git a/targets/app/common/DLCController.cpp b/targets/app/common/DLCController.cpp index 7965ef4c9..093186e82 100644 --- a/targets/app/common/DLCController.cpp +++ b/targets/app/common/DLCController.cpp @@ -6,6 +6,7 @@ #include "app/common/DLC/DLCSkinFile.h" #include "app/linux/LinuxGame.h" #include "app/linux/Linux_UIController.h" +#include "app/linux/Stubs/winapi_stubs.h" #include "minecraft/client/Minecraft.h" #include "minecraft/client/skins/TexturePack.h" #include "minecraft/client/skins/TexturePackRepository.h" diff --git a/targets/app/common/UI/UIController.h b/targets/app/common/UI/UIController.h index 877369a99..ad2ff44a3 100644 --- a/targets/app/common/UI/UIController.h +++ b/targets/app/common/UI/UIController.h @@ -11,11 +11,12 @@ #include "util/Timer.h" #ifdef __linux__ + #include "app/linux/Iggy/include/iggy.h" #ifndef _ENABLEIGGY #include "app/linux/Stubs/iggy_stubs.h" #endif -#include "app/linux/Stubs/d3d11_stubs.h" + #elif defined(_WINDOWS64) #include "app/windows/Iggy/include/iggy.h" #endif @@ -41,6 +42,15 @@ class C4JThread; class Tutorial; class UIScene; +// 4jcraft, used to be D3D11_RECT. +// This was the only class that used it, so it's here now. +struct RECT { + long left; + long top; + long right; + long bottom; +}; + // Base class for all shared functions between UIControllers class UIController : public IUIController { public: @@ -187,7 +197,7 @@ private: int m_accumulatedTicks; uint64_t m_lastUiSfx; // Tracks time (ms) of last UI sound effect - D3D11_RECT m_customRenderingClearRect; + RECT m_customRenderingClearRect; std::unordered_map m_registeredCallbackScenes; // A collection of scenes and unique id's diff --git a/targets/app/linux/Stubs/LinuxStubs.h b/targets/app/linux/Stubs/LinuxStubs.h index 26c563bdb..7ed4032d3 100644 --- a/targets/app/linux/Stubs/LinuxStubs.h +++ b/targets/app/linux/Stubs/LinuxStubs.h @@ -2,7 +2,6 @@ #define STUBS_H #pragma once -#include "d3d11_stubs.h" #include "winapi_stubs.h" #ifndef _ENABLEIGGY #include "iggy_stubs.h" diff --git a/targets/app/linux/Stubs/d3d11_stubs.h b/targets/app/linux/Stubs/d3d11_stubs.h index a2f38881d..938e223b4 100644 --- a/targets/app/linux/Stubs/d3d11_stubs.h +++ b/targets/app/linux/Stubs/d3d11_stubs.h @@ -1,64 +1,64 @@ -#ifndef D3D11STUBS_H -#define D3D11STUBS_H +// #ifndef D3D11STUBS_H +// #define D3D11STUBS_H -#pragma once +// #pragma once -#include "winapi_stubs.h" +// #include "winapi_stubs.h" -typedef struct _RECT { - LONG left; - LONG top; - LONG right; - LONG bottom; -} RECT, *PRECT; +// typedef struct _RECT { +// LONG left; +// LONG top; +// LONG right; +// LONG bottom; +// } RECT, *PRECT; -// stole- i mean borrowed from OrbisStubs.h -typedef void ID3D11Device; -typedef void ID3D11DeviceContext; -typedef void IDXGISwapChain; -typedef RECT D3D11_RECT; -typedef void ID3D11RenderTargetView; -typedef void ID3D11DepthStencilView; -typedef void ID3D11Buffer; -// typedef DWORD (*PTHREAD_START_ROUTINE)( void* lpThreadParameter); -// typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; +// // stole- i mean borrowed from OrbisStubs.h +// typedef void ID3D11Device; +// typedef void ID3D11DeviceContext; +// typedef void IDXGISwapChain; +// typedef RECT D3D11_RECT; +// typedef void ID3D11RenderTargetView; +// typedef void ID3D11DepthStencilView; +// typedef void ID3D11Buffer; +// // typedef DWORD (*PTHREAD_START_ROUTINE)( void* lpThreadParameter); +// // typedef PTHREAD_START_ROUTINE LPTHREAD_START_ROUTINE; -// Used only by windows/durango gdraw and UIController. Will be unnecessary once -// we have our own UIController stubs. -typedef void ID3D11ShaderResourceView; -typedef void ID3D11Resource; -typedef void ID3D11Texture2D; -typedef void D3D11_TEXTURE2D_DESC; +// // Used only by windows/durango gdraw and UIController. Will be unnecessary once +// // we have our own UIController stubs. +// typedef void ID3D11ShaderResourceView; +// 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_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 -}; +// 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 +// #endif // D3D11STUBS_H