load_data is still too slow to handle overworld

This commit is contained in:
Inori 2019-08-08 12:32:10 -04:00 committed by Inori
parent 6b50662b46
commit 47908d0470
2 changed files with 22 additions and 0 deletions

View file

@ -86,6 +86,7 @@ If a requested font is not found, no error is generated. Instead, a built-in fon
* Win32API calls outside of Windows (Win32API is just an alias to the MiniFFI class, which *does* work with other operating systems, but you can obviously only load libraries made for the platform you're on)*
* Some Win32API calls don't play nicely with SDL. Building with the `fix_essentials` option will attempt to fix this.
* Sockets.
* `load_data` is slow. In fact, it's too slow to handle `pbResolveBitmap` firing a million times a second, so if `fix_essentials` is used Graphics files can only be loaded from outside of the game's archive. You could remove that code if you want, but you'll lag. Very hard.
* Movie playback
* wma audio files
* Creating Bitmaps with sizes greater than the OpenGL texture size limit (around 8192 on modern cards)^

View file

@ -178,6 +178,27 @@ RB_METHOD(kernelLoadData)
VALUE filename;
rb_get_args(argc, argv, "S", &filename RB_ARG_END);
#ifdef USE_ESSENTIALS_FIXES
// Until a faster method for getting RGSSAD data is
// written (could just copy RMXP, keeping stuff in
// memory and just passing char pointers can't be
// that complicated), load_data is still too slow
// to handle the overworld load_data assault
VALUE isGraphicsFile = rb_funcall(filename,
rb_intern("start_with?"),
1,
rb_str_new2("Graphics"));
if (isGraphicsFile == Qtrue)
{
VALUE f = rb_file_open_str(filename, "rb");
VALUE ret = rb_funcall(f, rb_intern("read"), 0);
rb_funcall(f, rb_intern("close"), 0);
return ret;
}
#endif
return kernelLoadDataInt(RSTRING_PTR(filename), true);
}