From 5376a7e098dc34a71202d43349b1b99bdb849e7c Mon Sep 17 00:00:00 2001 From: ZakatTeamI2P Date: Wed, 27 May 2026 19:21:47 +0400 Subject: [PATCH] im tired --- src/main.cpp | 2 +- src/meow.cpp | 68 ++++++++++++++++++++++++---------------------------- 2 files changed, 32 insertions(+), 38 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 717fcbf..3c2ffc8 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -117,7 +117,7 @@ int rgssThreadFun(void *userdata){ bool vsync = conf.vsync || conf.syncToRefreshrate; SDL_GL_SetSwapInterval(vsync ? 1 : 0); - + #ifndef NDEBUG GLDebugLogger dLogger; #endif diff --git a/src/meow.cpp b/src/meow.cpp index 7583dcf..dd54631 100644 --- a/src/meow.cpp +++ b/src/meow.cpp @@ -5,13 +5,17 @@ #include #include #include +#include #include "meow.h" #include "eventthread.h" #include "config.h" +#include "gl-debug.h" +#include "gl-fun.h" #include #include #include #include +#include #include #include #include @@ -29,6 +33,11 @@ SDL_MessageBoxButtonData buttons[] = { { SDL_MESSAGEBOX_BUTTON_ESCAPEKEY_DEFAULT, 2, "No" } }; +static inline const char* glGetStringInt(GLenum name){ + return (const char*) gl.GetString(name); +} + + void crash(const char* reason){ char msg[1024]; snprintf(msg, sizeof msg, "Error occured! Error message: %s\n\n Want to create a crash log? You can share the crash log with the developers and help resolve the issue.", reason); @@ -50,41 +59,22 @@ void crash(const char* reason){ if(buttonid == 1){ std::ofstream out; - const Config conf; time_t mtime = time(NULL); struct tm *now = localtime(&mtime); std::string time = std::to_string(now->tm_hour) + "." + std::to_string(now->tm_min) + "." + std::to_string(now->tm_sec); out.open("crash_" + time + ".txt"); if (out.is_open()){ out << "[SUNSHINE CRASHDUMP]" << std::endl; - out << "CONFIG" << std::endl; - out << "defScreenW: " << conf.defScreenW << std::endl; - out << "defScreenH: " << conf.defScreenH << std::endl; - out << "debugMode: " << conf.debugMode << std::endl; - out << "screenMode: " << conf.screenMode << std::endl; - out << "fullscreen: " << conf.fullscreen << std::endl; - out << "fixedAspectRatio: " << conf.fixedAspectRatio << std::endl; - out << "smoothScaling: " << conf.smoothScaling << std::endl; - out << "vsync: " << conf.vsync << std::endl; - out << "EnableSixteenByNine: " << conf.EnableSixteenByNine << std::endl; - out << "windowTitle: " << conf.windowTitle << std::endl; - out << "defSfixedFrameratecreenW: " << conf.fixedFramerate << std::endl; - out << "frameSkip: " << conf.frameSkip << std::endl; - out << "syncToRefreshrate: " << conf.syncToRefreshrate << std::endl; - out << "solidFonts: " << conf.solidFonts << std::endl; - out << "subImageFix: " << conf.subImageFix << std::endl; - out << "enableBlitting: " << conf.enableBlitting << std::endl; - out << "maxTextureSize: " << conf.maxTextureSize << std::endl; - out << "gameFolder: " << conf.gameFolder << std::endl; - out << "allowSymlinks: " << conf.allowSymlinks << std::endl; - out << "pathCache: " << conf.pathCache << std::endl; - out << "iconPath: " << conf.iconPath << std::endl; - out << "useScriptNames: " << conf.useScriptNames << std::endl; - out << "customScript: " << conf.customScript << std::endl; - out << "customDataPath: " << conf.customDataPath << std::endl; - out << "commonDataPath: " << conf.commonDataPath << std::endl; - out << "" << std::endl; - + try{ + out << "GL Vendor: " << glGetStringInt(GL_VENDOR) << std::endl; + out << "GL Renderer: " << glGetStringInt(GL_RENDERER) << std::endl; + out << "GL Version: " << glGetStringInt(GL_VERSION) << std::endl; + out << "GLSL Version: " << glGetStringInt(GL_SHADING_LANGUAGE_VERSION) << std::endl; + out << "Shading language version: " << glGetStringInt(GL_SHADING_LANGUAGE_VERSION) << std::endl; + out << "GL Extensions: " << glGetStringInt(GL_EXTENSIONS) << std::endl; + }catch(const std::exception& e){ + out << "Crashed before OpenGL initialization: " << e.what() << std::endl; + } const int sdlcompiled = SDL_VERSION; const int sdllinked = SDL_GetVersion(); out << "SDL(compiled) version: " << SDL_VERSIONNUM_MAJOR(sdlcompiled) << "." << SDL_VERSIONNUM_MINOR(sdlcompiled) << "." << SDL_VERSIONNUM_MICRO(sdlcompiled) << std::endl; @@ -92,16 +82,20 @@ void crash(const char* reason){ out << "SDL_image(compiled) version: " << SDL_IMAGE_MAJOR_VERSION << "." << SDL_IMAGE_MINOR_VERSION << "." << SDL_IMAGE_MICRO_VERSION << std::endl; out << "SDL_sound(compiled) version: " << SDL_SOUND_MAJOR_VERSION << "." << SDL_IMAGE_MINOR_VERSION << "." << SDL_IMAGE_MICRO_VERSION << std::endl; out << "SDL_TTF(compiled) version: " << SDL_TTF_MAJOR_VERSION << "." << SDL_TTF_MINOR_VERSION << "." << SDL_TTF_MICRO_VERSION << std::endl; + out << "Ruby version: " << RUBY_API_VERSION_CODE << std::endl; + try{ + out << "Detected OS: " << SDL_GetPlatform() << std::endl; + }catch(const std::exception& e){ + out << "Detected OS: " << e.what() << std::endl; + } + if(getenv("XDG_CURRENT_DESKTOP") == NULL){ + out << "Desktop enviroment(XDG_CURRENT_DESKTOP): Unknown"<< std::endl; + }else{ + out << "Desktop enviroment(XDG_CURRENT_DESKTOP): " << getenv("XDG_CURRENT_DESKTOP") << std::endl; + } - //out << "Detected OS: " << SDL_GetPlatform() << std::endl; - - #ifdef __LINUX__ - out << "GTK(compiled) version: " << GTK_MAJOR_VERSION << "." << GTK_MINOR_VERSION << "." << GTK_MICRO_VERSION << std::endl; - out << "Desktop enviroment(XDG_CURRENT_DESKTOP): " << getenv("XDG_CURRENT_DESKTOP") << std::endl; - #endif - out << "ZLib version: " << ZLIB_VERSION << std::endl; - out << "OpenAL version: " << alGetString(AL_VERSION) << std::endl; + out << "OpenAL version: " << AL_VERSION << std::endl; out << "Boost versino: " << BOOST_VERSION / 100000 << "." << BOOST_VERSION / 100 % 1000 << "." << BOOST_VERSION % 100 << std::endl; out << "Pixman version: " << PIXMAN_VERSION_STRING << std::endl;