mirror of
https://forgejo.xatacraft.ru/Sunshine/mkxp-sunshine.git
synced 2026-08-19 13:29:54 +00:00
meow
This commit is contained in:
parent
c0101d1d6c
commit
12cdf73b0d
2 changed files with 10 additions and 6 deletions
|
|
@ -51,9 +51,10 @@ struct SDLRWIoContext{
|
|||
: ops(SDL_IOFromFile(filename, "r")),
|
||||
filename(filename)
|
||||
{
|
||||
if (!ops)
|
||||
if (!ops){
|
||||
crash(Exception::SDLError, "Failed to open file: %s", SDL_GetError());
|
||||
}
|
||||
}
|
||||
|
||||
~SDLRWIoContext(){
|
||||
SDL_CloseIO(ops);
|
||||
|
|
@ -594,17 +595,20 @@ void FileSystem::openRead(OpenHandler &handler, const char *filename){
|
|||
PHYSFS_enumerate(dir, openReadEnumCB, &data);
|
||||
}
|
||||
|
||||
if (data.physfsError)
|
||||
if (data.physfsError){
|
||||
crash(Exception::PHYSFSError, "PhysFS: %s", data.physfsError);
|
||||
}
|
||||
|
||||
if (data.matchCount == 0)
|
||||
if (data.matchCount == 0){
|
||||
crash(Exception::NoFileError, "%s", filename);
|
||||
}
|
||||
}
|
||||
|
||||
void FileSystem::openReadRaw(SDL_IOStream* &stream, const char *filename){
|
||||
PHYSFS_File *handle = PHYSFS_openRead(filename);
|
||||
if (!handle)
|
||||
if (!handle){
|
||||
crash(Exception::NoFileError, "%s", filename);
|
||||
}
|
||||
|
||||
initReadOps(handle, stream);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ struct VorbisSource : ALDataSource{
|
|||
|
||||
if (error){
|
||||
SDL_CloseIO(&src);
|
||||
crash("Vorbisfile: Cannot read ogg file", Exception::MKXPError, true);
|
||||
crash(Exception::MKXPError, "Vorbisfile: Cannot read ogg file");
|
||||
}
|
||||
|
||||
/* Extract bitstream info */
|
||||
|
|
@ -90,7 +90,7 @@ struct VorbisSource : ALDataSource{
|
|||
if (info.channels > 2){
|
||||
ov_clear(&vf);
|
||||
SDL_CloseIO(&src);
|
||||
crash("Cannot handle audio with more than 2 channels", Exception::MKXPError, true);
|
||||
crash(Exception::MKXPError, "Cannot handle audio with more than 2 channels");
|
||||
}
|
||||
|
||||
info.alFormat = chooseALFormat(sizeof(int16_t), info.channels);
|
||||
|
|
|
|||
Loading…
Reference in a new issue