From 2f754e1cabfd7a32af2ad98cfe5e127f497df628 Mon Sep 17 00:00:00 2001 From: ZakatTeamI2P Date: Wed, 29 Apr 2026 20:52:26 +0400 Subject: [PATCH] im stupid --- binding-mri/filesystem-binding.cpp | 26 +++++++++++++------------- binding-mri/wallpaper-binding.cpp | 7 ++++--- binding-mri/window-binding.cpp | 1 + src/config.cpp | 2 +- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/binding-mri/filesystem-binding.cpp b/binding-mri/filesystem-binding.cpp index d4f31fc..429d805 100644 --- a/binding-mri/filesystem-binding.cpp +++ b/binding-mri/filesystem-binding.cpp @@ -29,7 +29,7 @@ #include "ruby/intern.h" #include -static void fileIntFreeInstance(void *inst){ +void fileIntFreeInstance(void *inst){ printf("[fileIntFreeInstance] fileIntFreeInstance\n"); SDL_IOStream *ops = static_cast(inst); if (ops) { @@ -39,8 +39,8 @@ static void fileIntFreeInstance(void *inst){ } DEF_TYPE_CUSTOMFREE(FileInt, fileIntFreeInstance); -static VALUE fileIntForPath(const char *path, bool rubyExc){ - printf("[fileIntForPath] %s!\n", *path); +VALUE fileIntForPath(const char *path, bool rubyExc){ + printf("[fileIntForPath] %s!\n", path); SDL_IOStream* ops = nullptr; try{ shState->fileSystem().openReadRaw(ops, path); @@ -100,18 +100,19 @@ RB_METHOD(fileIntRead){ } RB_NA_METHOD(fileIntClose){ - printf("[fileIntClose] fileIntClose\n"); - SDL_IOStream *ops = getPrivateData(self); + printf("[fileIntClose] fileIntClose\n"); + SDL_IOStream *ops = getPrivateData(self); if (!ops){ - printf("[fileIntClose] Null guard\n"); + printf("[fileIntClose] Already closed or null\n"); return Qnil; } + printf("[fileIntClose] Closing ops\n"); SDL_CloseIO(ops); setPrivateData(self, nullptr); + return Qnil; } - RB_NA_METHOD(fileIntGetByte){ printf("[fileIntGetByte] fileIntGetByte\n"); SDL_IOStream *ops = getPrivateData(self); @@ -126,7 +127,7 @@ RB_NA_METHOD(fileIntBinmode){ return Qnil; } -static VALUE load_protect(VALUE marsh_and_port) { +VALUE load_protect(VALUE marsh_and_port) { printf("[Load_protect] Protecting!\n"); VALUE *arr = (VALUE *)marsh_and_port; VALUE marsh = arr[0]; @@ -146,7 +147,7 @@ VALUE kernelLoadDataInt(const char *filename, bool rubyExc){ printf("[kernelLoadDataInt] Result == false, bRuH\n"); } - rb_funcallv(port, rb_intern("close"), 0, nullptr); + rb_funcallv(port, rb_intern("close"), 0, NULL); if (state) { VALUE err = rb_errinfo(); @@ -158,7 +159,6 @@ VALUE kernelLoadDataInt(const char *filename, bool rubyExc){ rb_p(klass); rb_p(message); rb_p(backtrace); - rb_jump_tag(state); } return result; @@ -192,7 +192,7 @@ RB_METHOD(kernelSaveData){ return Qnil; } -static VALUE stringForceUTF8(VALUE arg){ +VALUE stringForceUTF8(VALUE arg){ printf("[stringForceUTF8] %s\n", rb_str_to_str(arg)); if (RB_TYPE_P(arg, RUBY_T_STRING)) { /* If current encoding is ASCII-8BIT (binary), associate UTF-8 so @@ -206,7 +206,7 @@ static VALUE stringForceUTF8(VALUE arg){ return arg; } -static VALUE customProc(VALUE arg, VALUE proc){ +VALUE customProc(VALUE arg, VALUE proc){ printf("[customProc] \n"); VALUE obj = stringForceUTF8(arg); obj = rb_funcall2(proc, rb_intern("call"), 1, &obj); @@ -219,7 +219,7 @@ RB_METHOD(_marshalLoad){ rb_scan_args(argc, argv, "01", &port, &proc); VALUE utf8Proc; - printf("[_marshalLoad]\n"); + printf("[_marshalLoad] i fuckin hate it\n"); if (NIL_P(proc)) utf8Proc = rb_proc_new(RUBY_METHOD_FUNC(stringForceUTF8), Qnil); else diff --git a/binding-mri/wallpaper-binding.cpp b/binding-mri/wallpaper-binding.cpp index 456db5f..b3b6c1a 100644 --- a/binding-mri/wallpaper-binding.cpp +++ b/binding-mri/wallpaper-binding.cpp @@ -91,6 +91,7 @@ defColorStyle = xfconf_channel_get_int(bgchannel, optionColorStyle.c_str(), -1); } else { // Configuration failed to initialize, we won't set the wallpaper + printf("[desktopEnvironmentInit] Configuration failed to initialize, we won't set the wallpaper\n"); desktop = "xfce_error"; g_error_free(xferror); } @@ -157,7 +158,7 @@ } configFile.close(); } else { - Debug() << "FATAL: Cannot find desktop configuration!"; + Debug() << "[desktopEnvironmentInit]FATAL: Cannot find desktop configuration!"; desktop = "kde_error"; } } else { @@ -345,9 +346,9 @@ end: "\"]);" << "}" << "'"; - Debug() << "Wallpaper command:" << command.str(); + Debug() << "[wallpaperSet] Wallpaper command:" << command.str(); int result = system(command.str().c_str()); - Debug() << "Result:" << result; + Debug() << "[wallpaperSet ]Result:" << result; } else { std::ifstream srcHint(gameDirStr + path); std::ofstream dstHint(fallbackPath); diff --git a/binding-mri/window-binding.cpp b/binding-mri/window-binding.cpp index fb59431..1281b5a 100644 --- a/binding-mri/window-binding.cpp +++ b/binding-mri/window-binding.cpp @@ -27,6 +27,7 @@ DEF_TYPE(Window); RB_METHOD(windowInitialize){ + printf("[windowInitialize] Creating window\n"); Window *w = viewportElementInitialize(argc, argv, self); setPrivateData(self, w); diff --git a/src/config.cpp b/src/config.cpp index 624cbef..4c0c22a 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -133,7 +133,7 @@ void Config::read(int argc, char *argv[]){ po::store(cmdPo, vm); } catch (po::error &error){ - Debug() << "Command line:" << error.what(); + Debug() << "[config] Command line:" << error.what(); } /* Parse configuration file */