diff --git a/libultraship/libultraship/Environment.cpp b/libultraship/libultraship/Environment.cpp deleted file mode 100644 index 53d0f330b..000000000 --- a/libultraship/libultraship/Environment.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include "Environment.h" - -#include -#include - -std::map environmentVars; - -namespace SohUtils { - void saveEnvironmentVar(const std::string& key, const std::string& value) { - environmentVars[key] = value; - } - - std::string getEnvironmentVar(const std::string& key) { - return environmentVars[key]; - } -} \ No newline at end of file diff --git a/libultraship/libultraship/Environment.h b/libultraship/libultraship/Environment.h deleted file mode 100644 index 4d6ab3346..000000000 --- a/libultraship/libultraship/Environment.h +++ /dev/null @@ -1,8 +0,0 @@ -#pragma once - -#include - -namespace SohUtils { - void saveEnvironmentVar(const std::string& key, const std::string& value); - std::string getEnvironmentVar(const std::string& key); -} \ No newline at end of file diff --git a/libultraship/libultraship/ImGuiImpl.cpp b/libultraship/libultraship/ImGuiImpl.cpp index f19ce7eac..a1b44a6df 100644 --- a/libultraship/libultraship/ImGuiImpl.cpp +++ b/libultraship/libultraship/ImGuiImpl.cpp @@ -8,7 +8,6 @@ #include #include "Archive.h" -#include "Environment.h" #include "GameSettings.h" #include "Console.h" #include "Hooks.h" @@ -1626,7 +1625,7 @@ namespace SohImGui { pos = ImVec2(size.x / 2 - sw / 2, 0); size = ImVec2(sw, size.y); } - std::string fb_str = SohUtils::getEnvironmentVar("framebuffer"); + std::string fb_str = gfxFramebuffer; if (!fb_str.empty()) { uintptr_t fbuf = (uintptr_t)std::stoull(fb_str); //ImGui::ImageSimple(reinterpret_cast(fbuf), pos, size); diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp index ad683e047..3d199ef71 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_opengl.cpp @@ -44,7 +44,6 @@ #include "gfx_cc.h" #include "gfx_rendering_api.h" #include "../../ImGuiImpl.h" -#include "../../Environment.h" #include "../../GlobalCtx2.h" #include "gfx_pc.h" diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_pc.cpp b/libultraship/libultraship/Lib/Fast3D/gfx_pc.cpp index 0a5d0ceef..d855012ef 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_pc.cpp +++ b/libultraship/libultraship/Lib/Fast3D/gfx_pc.cpp @@ -32,7 +32,6 @@ #include "../../luslog.h" #include "../StrHash64.h" #include "../../ImGuiImpl.h" -#include "../../Environment.h" #include "../../GameVersions.h" #include "../../ResourceMgr.h" #include "../../Utils.h" @@ -49,6 +48,8 @@ extern "C" { int ResourceMgr_OTRSigCheck(char* imgData); } +std::string gfxFramebuffer; + using namespace std; #define SEG_ADDR(seg, addr) (addr | (seg << 24) | 1) @@ -2782,7 +2783,7 @@ void gfx_run(Gfx *commands, const std::unordered_map& mtx_replaceme rendering_state.scissor = {}; gfx_run_dl(commands); gfx_flush(); - SohUtils::saveEnvironmentVar("framebuffer", string()); + gfxFramebuffer = string(); if (game_renders_to_framebuffer) { gfx_rapi->start_draw_to_framebuffer(0, 1); gfx_rapi->clear_framebuffer(); @@ -2792,12 +2793,12 @@ void gfx_run(Gfx *commands, const std::unordered_map& mtx_replaceme if (different_size) { gfx_rapi->resolve_msaa_color_buffer(game_framebuffer_msaa_resolved, game_framebuffer); - SohUtils::saveEnvironmentVar("framebuffer", std::to_string((uintptr_t)gfx_rapi->get_framebuffer_texture_id(game_framebuffer_msaa_resolved))); + gfxFramebuffer = std::to_string((uintptr_t)gfx_rapi->get_framebuffer_texture_id(game_framebuffer_msaa_resolved)); } else { gfx_rapi->resolve_msaa_color_buffer(0, game_framebuffer); } } else { - SohUtils::saveEnvironmentVar("framebuffer", std::to_string((uintptr_t)gfx_rapi->get_framebuffer_texture_id(game_framebuffer))); + gfxFramebuffer = std::to_string((uintptr_t)gfx_rapi->get_framebuffer_texture_id(game_framebuffer)); } } SohImGui::DrawFramebufferAndGameInput(); diff --git a/libultraship/libultraship/Lib/Fast3D/gfx_pc.h b/libultraship/libultraship/Lib/Fast3D/gfx_pc.h index 4e620ef2d..931093079 100644 --- a/libultraship/libultraship/Lib/Fast3D/gfx_pc.h +++ b/libultraship/libultraship/Lib/Fast3D/gfx_pc.h @@ -14,6 +14,8 @@ #define SCREEN_WIDTH 320 #define SCREEN_HEIGHT 240 +extern std::string gfxFramebuffer; + struct GfxRenderingAPI; struct GfxWindowManagerAPI; diff --git a/libultraship/libultraship/libultraship.vcxproj b/libultraship/libultraship/libultraship.vcxproj index 4d7eab9b4..52df7d395 100644 --- a/libultraship/libultraship/libultraship.vcxproj +++ b/libultraship/libultraship/libultraship.vcxproj @@ -258,7 +258,6 @@ - @@ -354,7 +353,6 @@ - diff --git a/libultraship/libultraship/libultraship.vcxproj.filters b/libultraship/libultraship/libultraship.vcxproj.filters index fa5c505aa..f84250c29 100644 --- a/libultraship/libultraship/libultraship.vcxproj.filters +++ b/libultraship/libultraship/libultraship.vcxproj.filters @@ -67,9 +67,6 @@ {ccd6359f-e357-41ca-9b89-5f509dd30649} - - {94ca4b98-cee2-48e6-a88b-68b8d2fed287} - {0dca2d94-45ba-4916-b03a-1dd5f949114c} @@ -321,9 +318,6 @@ Source Files\Audio - - Source Files\CustomImpl\Environment - Source Files\CustomImpl\Utils @@ -605,9 +599,6 @@ Source Files\Lib\ImGui - - Source Files\CustomImpl\Environment - Source Files\CustomImpl\Utils