im stupid

This commit is contained in:
ZakatTeamI2P 2026-04-29 20:52:26 +04:00
parent a184b2a5d4
commit 2f754e1cab
4 changed files with 19 additions and 17 deletions

View file

@ -29,7 +29,7 @@
#include "ruby/intern.h" #include "ruby/intern.h"
#include <ruby.h> #include <ruby.h>
static void fileIntFreeInstance(void *inst){ void fileIntFreeInstance(void *inst){
printf("[fileIntFreeInstance] fileIntFreeInstance\n"); printf("[fileIntFreeInstance] fileIntFreeInstance\n");
SDL_IOStream *ops = static_cast<SDL_IOStream*>(inst); SDL_IOStream *ops = static_cast<SDL_IOStream*>(inst);
if (ops) { if (ops) {
@ -39,8 +39,8 @@ static void fileIntFreeInstance(void *inst){
} }
DEF_TYPE_CUSTOMFREE(FileInt, fileIntFreeInstance); DEF_TYPE_CUSTOMFREE(FileInt, fileIntFreeInstance);
static VALUE fileIntForPath(const char *path, bool rubyExc){ VALUE fileIntForPath(const char *path, bool rubyExc){
printf("[fileIntForPath] %s!\n", *path); printf("[fileIntForPath] %s!\n", path);
SDL_IOStream* ops = nullptr; SDL_IOStream* ops = nullptr;
try{ try{
shState->fileSystem().openReadRaw(ops, path); shState->fileSystem().openReadRaw(ops, path);
@ -100,18 +100,19 @@ RB_METHOD(fileIntRead){
} }
RB_NA_METHOD(fileIntClose){ RB_NA_METHOD(fileIntClose){
printf("[fileIntClose] fileIntClose\n"); printf("[fileIntClose] fileIntClose\n");
SDL_IOStream *ops = getPrivateData<SDL_IOStream>(self); SDL_IOStream *ops = getPrivateData<SDL_IOStream>(self);
if (!ops){ if (!ops){
printf("[fileIntClose] Null guard\n"); printf("[fileIntClose] Already closed or null\n");
return Qnil; return Qnil;
} }
printf("[fileIntClose] Closing ops\n"); printf("[fileIntClose] Closing ops\n");
SDL_CloseIO(ops); SDL_CloseIO(ops);
setPrivateData(self, nullptr); setPrivateData(self, nullptr);
return Qnil; return Qnil;
} }
RB_NA_METHOD(fileIntGetByte){ RB_NA_METHOD(fileIntGetByte){
printf("[fileIntGetByte] fileIntGetByte\n"); printf("[fileIntGetByte] fileIntGetByte\n");
SDL_IOStream *ops = getPrivateData<SDL_IOStream>(self); SDL_IOStream *ops = getPrivateData<SDL_IOStream>(self);
@ -126,7 +127,7 @@ RB_NA_METHOD(fileIntBinmode){
return Qnil; return Qnil;
} }
static VALUE load_protect(VALUE marsh_and_port) { VALUE load_protect(VALUE marsh_and_port) {
printf("[Load_protect] Protecting!\n"); printf("[Load_protect] Protecting!\n");
VALUE *arr = (VALUE *)marsh_and_port; VALUE *arr = (VALUE *)marsh_and_port;
VALUE marsh = arr[0]; VALUE marsh = arr[0];
@ -146,7 +147,7 @@ VALUE kernelLoadDataInt(const char *filename, bool rubyExc){
printf("[kernelLoadDataInt] Result == false, bRuH\n"); printf("[kernelLoadDataInt] Result == false, bRuH\n");
} }
rb_funcallv(port, rb_intern("close"), 0, nullptr); rb_funcallv(port, rb_intern("close"), 0, NULL);
if (state) { if (state) {
VALUE err = rb_errinfo(); VALUE err = rb_errinfo();
@ -158,7 +159,6 @@ VALUE kernelLoadDataInt(const char *filename, bool rubyExc){
rb_p(klass); rb_p(klass);
rb_p(message); rb_p(message);
rb_p(backtrace); rb_p(backtrace);
rb_jump_tag(state); rb_jump_tag(state);
} }
return result; return result;
@ -192,7 +192,7 @@ RB_METHOD(kernelSaveData){
return Qnil; return Qnil;
} }
static VALUE stringForceUTF8(VALUE arg){ VALUE stringForceUTF8(VALUE arg){
printf("[stringForceUTF8] %s\n", rb_str_to_str(arg)); printf("[stringForceUTF8] %s\n", rb_str_to_str(arg));
if (RB_TYPE_P(arg, RUBY_T_STRING)) { if (RB_TYPE_P(arg, RUBY_T_STRING)) {
/* If current encoding is ASCII-8BIT (binary), associate UTF-8 so /* If current encoding is ASCII-8BIT (binary), associate UTF-8 so
@ -206,7 +206,7 @@ static VALUE stringForceUTF8(VALUE arg){
return arg; return arg;
} }
static VALUE customProc(VALUE arg, VALUE proc){ VALUE customProc(VALUE arg, VALUE proc){
printf("[customProc] \n"); printf("[customProc] \n");
VALUE obj = stringForceUTF8(arg); VALUE obj = stringForceUTF8(arg);
obj = rb_funcall2(proc, rb_intern("call"), 1, &obj); obj = rb_funcall2(proc, rb_intern("call"), 1, &obj);
@ -219,7 +219,7 @@ RB_METHOD(_marshalLoad){
rb_scan_args(argc, argv, "01", &port, &proc); rb_scan_args(argc, argv, "01", &port, &proc);
VALUE utf8Proc; VALUE utf8Proc;
printf("[_marshalLoad]\n"); printf("[_marshalLoad] i fuckin hate it\n");
if (NIL_P(proc)) if (NIL_P(proc))
utf8Proc = rb_proc_new(RUBY_METHOD_FUNC(stringForceUTF8), Qnil); utf8Proc = rb_proc_new(RUBY_METHOD_FUNC(stringForceUTF8), Qnil);
else else

View file

@ -91,6 +91,7 @@
defColorStyle = xfconf_channel_get_int(bgchannel, optionColorStyle.c_str(), -1); defColorStyle = xfconf_channel_get_int(bgchannel, optionColorStyle.c_str(), -1);
} else { } else {
// Configuration failed to initialize, we won't set the wallpaper // 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"; desktop = "xfce_error";
g_error_free(xferror); g_error_free(xferror);
} }
@ -157,7 +158,7 @@
} }
configFile.close(); configFile.close();
} else { } else {
Debug() << "FATAL: Cannot find desktop configuration!"; Debug() << "[desktopEnvironmentInit]FATAL: Cannot find desktop configuration!";
desktop = "kde_error"; desktop = "kde_error";
} }
} else { } else {
@ -345,9 +346,9 @@ end:
"\"]);" << "\"]);" <<
"}" << "}" <<
"'"; "'";
Debug() << "Wallpaper command:" << command.str(); Debug() << "[wallpaperSet] Wallpaper command:" << command.str();
int result = system(command.str().c_str()); int result = system(command.str().c_str());
Debug() << "Result:" << result; Debug() << "[wallpaperSet ]Result:" << result;
} else { } else {
std::ifstream srcHint(gameDirStr + path); std::ifstream srcHint(gameDirStr + path);
std::ofstream dstHint(fallbackPath); std::ofstream dstHint(fallbackPath);

View file

@ -27,6 +27,7 @@
DEF_TYPE(Window); DEF_TYPE(Window);
RB_METHOD(windowInitialize){ RB_METHOD(windowInitialize){
printf("[windowInitialize] Creating window\n");
Window *w = viewportElementInitialize<Window>(argc, argv, self); Window *w = viewportElementInitialize<Window>(argc, argv, self);
setPrivateData(self, w); setPrivateData(self, w);

View file

@ -133,7 +133,7 @@ void Config::read(int argc, char *argv[]){
po::store(cmdPo, vm); po::store(cmdPo, vm);
} }
catch (po::error &error){ catch (po::error &error){
Debug() << "Command line:" << error.what(); Debug() << "[config] Command line:" << error.what();
} }
/* Parse configuration file */ /* Parse configuration file */