mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
Im tired, but i fix one buuugggg
This commit is contained in:
parent
a8ee9eb3f5
commit
3eccbfcab2
1 changed files with 9 additions and 4 deletions
|
|
@ -40,6 +40,10 @@ static VALUE fileIntForPath(const char *path, bool rubyExc){
|
|||
SDL_IOStream* ops = nullptr;
|
||||
try{
|
||||
shState->fileSystem().openReadRaw(ops, path);
|
||||
if (!ops){
|
||||
printf("NULL guard! fileIntForPath broken!");
|
||||
return Qnil;
|
||||
}
|
||||
}
|
||||
catch (const Exception &e){
|
||||
if (ops)
|
||||
|
|
@ -61,12 +65,14 @@ static VALUE fileIntForPath(const char *path, bool rubyExc){
|
|||
}
|
||||
|
||||
RB_METHOD(fileIntRead){
|
||||
|
||||
int length = -1;
|
||||
rb_get_args(argc, argv, "i", &length);
|
||||
|
||||
SDL_IOStream *ops = getPrivateData<SDL_IOStream>(self);
|
||||
|
||||
if (!ops){
|
||||
printf("NULL guard! fileIntRead broken!");
|
||||
return Qnil;
|
||||
}
|
||||
if (length == -1){
|
||||
Sint64 cur = SDL_TellIO(ops);
|
||||
Sint64 end = SDL_SeekIO(ops, 0, SDL_IO_SEEK_END);
|
||||
|
|
@ -89,10 +95,9 @@ RB_METHOD(fileIntClose){
|
|||
SDL_IOStream *ops = getPrivateData<SDL_IOStream>(self);
|
||||
if (!ops){
|
||||
printf("NULL guard! fileIntClose broken!");
|
||||
return Qnil;
|
||||
return Qnil;
|
||||
}
|
||||
SDL_CloseIO(ops);
|
||||
setPrivateData(self, nullptr);
|
||||
return Qnil;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue