mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-20 22:09:55 +00:00
ekfjkg
This commit is contained in:
parent
12cdf73b0d
commit
fd9805fd84
2 changed files with 10 additions and 13 deletions
|
|
@ -51,9 +51,8 @@ struct SDLRWIoContext{
|
|||
: ops(SDL_IOFromFile(filename, "r")),
|
||||
filename(filename)
|
||||
{
|
||||
if (!ops){
|
||||
crash(Exception::SDLError, "Failed to open file: %s", SDL_GetError());
|
||||
}
|
||||
if (!ops)
|
||||
throw Exception(Exception::SDLError, "Failed to open file: %s", SDL_GetError());
|
||||
}
|
||||
|
||||
~SDLRWIoContext(){
|
||||
|
|
@ -118,7 +117,7 @@ static PHYSFS_Io *createSDLRWIo(const char *filename){
|
|||
try{
|
||||
ctx = new SDLRWIoContext(filename);
|
||||
}catch (const Exception &e){
|
||||
crash(Exception::MEOW, "Failed mounting %s", filename);
|
||||
Debug() << "Failed mounting" << filename;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -595,20 +594,17 @@ void FileSystem::openRead(OpenHandler &handler, const char *filename){
|
|||
PHYSFS_enumerate(dir, openReadEnumCB, &data);
|
||||
}
|
||||
|
||||
if (data.physfsError){
|
||||
crash(Exception::PHYSFSError, "PhysFS: %s", data.physfsError);
|
||||
}
|
||||
if (data.physfsError)
|
||||
throw Exception(Exception::PHYSFSError, "PhysFS: %s", data.physfsError);
|
||||
|
||||
if (data.matchCount == 0){
|
||||
crash(Exception::NoFileError, "%s", filename);
|
||||
}
|
||||
if (data.matchCount == 0)
|
||||
throw Exception(Exception::NoFileError, "%s", filename);
|
||||
}
|
||||
|
||||
void FileSystem::openReadRaw(SDL_IOStream* &stream, const char *filename){
|
||||
PHYSFS_File *handle = PHYSFS_openRead(filename);
|
||||
if (!handle){
|
||||
crash(Exception::NoFileError, "%s", filename);
|
||||
}
|
||||
if (!handle)
|
||||
throw Exception(Exception::NoFileError, "%s", filename);
|
||||
|
||||
initReadOps(handle, stream);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ public:
|
|||
|
||||
/* Circumvents extension supplementing */
|
||||
void openReadRaw(SDL_IOStream* &ops, const char *filename);
|
||||
//bool freeOnClose = false);
|
||||
|
||||
/* Does not perform extension supplementing */
|
||||
bool exists(const char *filename);
|
||||
|
|
|
|||
Loading…
Reference in a new issue