mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-22 23:06:18 +00:00
FIlesystem module memewmemw
This commit is contained in:
parent
8aeff6e84a
commit
b5fc1e4c5a
2 changed files with 5 additions and 6 deletions
|
|
@ -52,7 +52,7 @@ struct SDLRWIoContext{
|
||||||
filename(filename)
|
filename(filename)
|
||||||
{
|
{
|
||||||
if (!ops)
|
if (!ops)
|
||||||
throw Exception(Exception::SDLError, "Failed to open file: %s", SDL_GetError());
|
crash(Exception::SDLError, "Failed to open file: %s", SDL_GetError());
|
||||||
}
|
}
|
||||||
|
|
||||||
~SDLRWIoContext(){
|
~SDLRWIoContext(){
|
||||||
|
|
@ -117,7 +117,7 @@ static PHYSFS_Io *createSDLRWIo(const char *filename){
|
||||||
try{
|
try{
|
||||||
ctx = new SDLRWIoContext(filename);
|
ctx = new SDLRWIoContext(filename);
|
||||||
}catch (const Exception &e){
|
}catch (const Exception &e){
|
||||||
Debug() << "Failed mounting" << filename;
|
crash(Exception::MEOW, "Failed mounting %s", filename);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -595,16 +595,16 @@ void FileSystem::openRead(OpenHandler &handler, const char *filename){
|
||||||
}
|
}
|
||||||
|
|
||||||
if (data.physfsError)
|
if (data.physfsError)
|
||||||
throw Exception(Exception::PHYSFSError, "PhysFS: %s", data.physfsError);
|
crash(Exception::PHYSFSError, "PhysFS: %s", data.physfsError);
|
||||||
|
|
||||||
if (data.matchCount == 0)
|
if (data.matchCount == 0)
|
||||||
throw Exception(Exception::NoFileError, "%s", filename);
|
crash(Exception::NoFileError, "%s", filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileSystem::openReadRaw(SDL_IOStream* &stream, const char *filename){
|
void FileSystem::openReadRaw(SDL_IOStream* &stream, const char *filename){
|
||||||
PHYSFS_File *handle = PHYSFS_openRead(filename);
|
PHYSFS_File *handle = PHYSFS_openRead(filename);
|
||||||
if (!handle)
|
if (!handle)
|
||||||
throw Exception(Exception::NoFileError, "%s", filename);
|
crash(Exception::NoFileError, "%s", filename);
|
||||||
|
|
||||||
initReadOps(handle, stream);
|
initReadOps(handle, stream);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@ public:
|
||||||
|
|
||||||
/* Circumvents extension supplementing */
|
/* Circumvents extension supplementing */
|
||||||
void openReadRaw(SDL_IOStream* &ops, const char *filename);
|
void openReadRaw(SDL_IOStream* &ops, const char *filename);
|
||||||
//bool freeOnClose = false);
|
|
||||||
|
|
||||||
/* Does not perform extension supplementing */
|
/* Does not perform extension supplementing */
|
||||||
bool exists(const char *filename);
|
bool exists(const char *filename);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue