diff --git a/src/filesystem/filesystem.cpp b/src/filesystem/filesystem.cpp index 7e707ebd..10f8d5b4 100644 --- a/src/filesystem/filesystem.cpp +++ b/src/filesystem/filesystem.cpp @@ -282,7 +282,14 @@ struct FileSystemPrivate { static void throwPhysfsError(const char *desc) { PHYSFS_ErrorCode ec = PHYSFS_getLastErrorCode(); - const char *englishStr = PHYSFS_getErrorByCode(ec); + const char *englishStr; + if (ec == 0) { + // Sometimes on Windows PHYSFS_init can return null + // but the error code never changes + englishStr = "unknown error"; + } else { + englishStr = PHYSFS_getErrorByCode(ec); + } throw Exception(Exception::PHYSFSError, "%s: %s", desc, englishStr); } diff --git a/src/main.cpp b/src/main.cpp index d7f51047..47792213 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -395,7 +395,7 @@ int main(int argc, char *argv[]) { ALCdevice *alcDev = alcOpenDevice(0); if (!alcDev) { - showInitError("Error opening OpenAL device"); + showInitError("Could not detect an available audio device."); SDL_DestroyWindow(win); TTF_Quit(); IMG_Quit(); @@ -517,7 +517,7 @@ static SDL_GLContext initGL(SDL_Window *win, Config &conf, glCtx = SDL_GL_CreateContext(win); if (!glCtx) { - GLINIT_SHOWERROR(std::string("Error creating context: ") + SDL_GetError()); + GLINIT_SHOWERROR(std::string("Could not create OpenGL context: ") + SDL_GetError()); return 0; }