FIlesystem module memewmemw

This commit is contained in:
DepressedTWM 2026-06-01 11:31:38 -04:00
parent 8aeff6e84a
commit b5fc1e4c5a
2 changed files with 5 additions and 6 deletions

View file

@ -52,7 +52,7 @@ struct SDLRWIoContext{
filename(filename)
{
if (!ops)
throw Exception(Exception::SDLError, "Failed to open file: %s", SDL_GetError());
crash(Exception::SDLError, "Failed to open file: %s", SDL_GetError());
}
~SDLRWIoContext(){
@ -117,7 +117,7 @@ static PHYSFS_Io *createSDLRWIo(const char *filename){
try{
ctx = new SDLRWIoContext(filename);
}catch (const Exception &e){
Debug() << "Failed mounting" << filename;
crash(Exception::MEOW, "Failed mounting %s", filename);
return 0;
}
@ -595,16 +595,16 @@ void FileSystem::openRead(OpenHandler &handler, const char *filename){
}
if (data.physfsError)
throw Exception(Exception::PHYSFSError, "PhysFS: %s", data.physfsError);
crash(Exception::PHYSFSError, "PhysFS: %s", data.physfsError);
if (data.matchCount == 0)
throw Exception(Exception::NoFileError, "%s", filename);
crash(Exception::NoFileError, "%s", filename);
}
void FileSystem::openReadRaw(SDL_IOStream* &stream, const char *filename){
PHYSFS_File *handle = PHYSFS_openRead(filename);
if (!handle)
throw Exception(Exception::NoFileError, "%s", filename);
crash(Exception::NoFileError, "%s", filename);
initReadOps(handle, stream);
}

View file

@ -57,7 +57,6 @@ 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);