From 59d277dc0e01bfd433fad77cd25770be01ac4913 Mon Sep 17 00:00:00 2001 From: PancakeTAS Date: Thu, 24 Jul 2025 17:27:33 +0200 Subject: [PATCH] test: remove raygui it was basically pointless anyways --- .gitmodules | 3 -- CMakeLists.txt | 3 +- include/utils/gui.hpp | 14 ------- src/main.cpp | 5 +-- src/utils/gui.cpp | 88 ------------------------------------------- thirdparty/raylib | 1 - 6 files changed, 3 insertions(+), 111 deletions(-) delete mode 100644 include/utils/gui.hpp delete mode 100644 src/utils/gui.cpp delete mode 160000 thirdparty/raylib diff --git a/.gitmodules b/.gitmodules index 331e7c8..d5ff308 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,6 +7,3 @@ [submodule "thirdparty/toml11"] path = thirdparty/toml11 url = https://github.com/ToruNiina/toml11 -[submodule "thirdparty/raylib"] - path = thirdparty/raylib - url = https://github.com/raysan5/raylib diff --git a/CMakeLists.txt b/CMakeLists.txt index 046541d..e39f12b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,7 +19,6 @@ set(GLFW_BUILD_X11 ON) add_subdirectory(thirdparty/dxbc EXCLUDE_FROM_ALL) add_subdirectory(thirdparty/pe-parse/pe-parser-library EXCLUDE_FROM_ALL) add_subdirectory(thirdparty/toml11 EXCLUDE_FROM_ALL) -add_subdirectory(thirdparty/raylib EXCLUDE_FROM_ALL) add_subdirectory(framegen) # main project @@ -45,7 +44,7 @@ set_target_properties(lsfg-vk PROPERTIES target_include_directories(lsfg-vk PRIVATE include) target_link_libraries(lsfg-vk PRIVATE - pe-parse dxbc toml11 raylib SPIRV-Headers + pe-parse dxbc toml11 SPIRV-Headers lsfg-vk-framegen vulkan) get_target_property(TOML11_INCLUDE_DIRS toml11 INTERFACE_INCLUDE_DIRECTORIES) diff --git a/include/utils/gui.hpp b/include/utils/gui.hpp deleted file mode 100644 index 37295f3..0000000 --- a/include/utils/gui.hpp +++ /dev/null @@ -1,14 +0,0 @@ -#pragma once - -#include - -namespace Utils { - - /// - /// Display error gui and exit - /// - /// @param message The error message to display in the GUI. - /// - [[noreturn]] void showErrorGui(const std::string& message); - -} diff --git a/src/main.cpp b/src/main.cpp index ec7916e..ef9eb07 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,6 @@ #include "config/config.hpp" #include "extract/extract.hpp" #include "utils/benchmark.hpp" -#include "utils/gui.hpp" #include "utils/utils.hpp" #include @@ -68,7 +67,7 @@ namespace { } catch (const std::exception& e) { std::cerr << "lsfg-vk: An error occurred while trying to write the latest file, exiting:\n"; std::cerr << "- " << e.what() << '\n'; - Utils::showErrorGui(e.what()); + exit(EXIT_FAILURE); } // load shaders @@ -77,7 +76,7 @@ namespace { } catch (const std::exception& e) { std::cerr << "lsfg-vk: An error occurred while trying to extract the shaders, exiting:\n"; std::cerr << "- " << e.what() << '\n'; - Utils::showErrorGui(e.what()); + exit(EXIT_FAILURE); } std::cerr << "lsfg-vk: Shaders extracted successfully.\n"; diff --git a/src/utils/gui.cpp b/src/utils/gui.cpp deleted file mode 100644 index a09c7cf..0000000 --- a/src/utils/gui.cpp +++ /dev/null @@ -1,88 +0,0 @@ -#include "utils/gui.hpp" - -#include - -#include -#include -#include - -using namespace Utils; - -namespace { - - void DrawCenteredText(const std::string& message, int y, Color color) { - const int textWidth = MeasureText(message.c_str(), 20); - DrawText(message.c_str(), (GetScreenWidth() - textWidth) / 2, y, 20, color); - } - - int DrawTextBox(std::string message, int x, int y, int width, bool draw) { - while (!message.empty()) { - std::string current = message; - - // take one line at a time - const size_t pos = current.find('\n'); - if (pos != std::string::npos) - current = current.substr(0, pos); - - // if too long, remove word or character - while (MeasureText(message.c_str(), 20) > width) { - const size_t pos = current.find_last_of(' '); - if (pos == std::string::npos) - current = current.substr(0, current.size() - 1); - else - current = current.substr(0, pos); - } - - // remove the current line from the message text - message = message.substr(current.size()); - while (message.starts_with(' ')) - message = message.substr(1); // remove leading space - while (message.starts_with('\n')) - message = message.substr(1); // remove leading newline - - // draw the current line - if (draw) DrawText(current.c_str(), x, y, 20, Color { 198, 173, 173, 255 }); - y += 25; // move down for the next line - } - return y; // return height of the text box - } -} - -void Utils::showErrorGui(const std::string& message) { - SetTraceLogLevel(LOG_WARNING); - - const int height = DrawTextBox(message, 10, 60, 780, false); - InitWindow(800, height + 80, "lsfg-vk - Error"); - - SetTargetFPS(24); // cinema frame rate lol - - while (!WindowShouldClose()) { - BeginDrawing(); - - ClearBackground(Color{ 58, 23, 32, 255 }); - DrawCenteredText("lsfg-vk encountered an error", 10, Color{ 225, 115, 115, 255 }); - DrawLine(10, 35, 790, 35, Color{ 218, 87, 87, 255 }); - DrawTextBox(message, 10, 60, 780, true); - - const bool hover = GetMouseY() > height + 30 - && GetMouseY() < height + 70 - && GetMouseX() > 10 - && GetMouseX() < 790; - if (hover) { - DrawRectangleLines(10, height + 30, 780, 40, Color{ 250, 170, 151, 255 }); - DrawCenteredText("Press Escape or click here to close", height + 40, Color{ 253, 180, 170, 255 }); - } else { - DrawRectangleLines(10, height + 30, 780, 40, Color{ 218, 87, 87, 255 }); - DrawCenteredText("Press Escape or click here to close", height + 40, Color{ 225, 115, 115, 255 }); - } - - EndDrawing(); - - if (hover && IsMouseButtonPressed(MOUSE_BUTTON_LEFT)) - break; - } - - CloseWindow(); - - exit(EXIT_FAILURE); -} diff --git a/thirdparty/raylib b/thirdparty/raylib deleted file mode 160000 index 78a0699..0000000 --- a/thirdparty/raylib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 78a06990c7c55ace00a8e6c5afe983457304e645