// Sets up.
AudioManager::AudioManager() {
- int MixerFlags = MIX_INIT_OGG | MIX_INIT_FLAC | MIX_INIT_MP3;
- if((Mix_Init(MixerFlags) & MixerFlags) != MixerFlags) {
+ if((Mix_Init(MIX_INIT_OGG) & MIX_INIT_OGG) != MIX_INIT_OGG) {
// Failed to load.
- fprintf(stderr, "[E] Failed on Mix_Init. Reported error:\n");
- fprintf(stderr, "[E] %s\n", Mix_GetError());
- fprintf(stderr, "[E] Fatal. Dying.\n");
- exit(-1);
+ fprintf(stderr, "[W] Failed on Mix_Init for OGG format.\n");
+ fprintf(stderr, "[W] Internal message: %s\n", Mix_GetError());
+ }
+
+ if((Mix_Init(MIX_INIT_FLAC) & MIX_INIT_FLAC) != MIX_INIT_FLAC) {
+ // Failed to load.
+ fprintf(stderr, "[W] Failed on Mix_Init for FLAC format.\n");
+ fprintf(stderr, "[W] Internal message: %s\n", Mix_GetError());
+ }
+
+ if((Mix_Init(MIX_INIT_MP3) & MIX_INIT_MP3) != MIX_INIT_MP3) {
+ // Failed to load.
+ fprintf(stderr, "[W] Failed on Mix_Init for MP3 format.\n");
+ fprintf(stderr, "[W] Internal message: %s\n", Mix_GetError());
}
uint16_t fmt = 0;
verbose = false;
currentLine = 0;
skip_key_on = false;
- #ifdef USE_ANDROID
+#ifdef USE_ANDROID
rendering_mode = 0;
fullscreen = true;
- #else
+#else
rendering_mode = 1;
fullscreen = false;
- #endif
+#endif
eof = false;
next_line = NULL; // Used for voice-detect.
- // It's impossible to parse without lookahead.
+ // It's impossible to parse without lookahead.
}
void Data_PreInit() {
GetData()->ctx->InitWindowLogical(GetData()->physical_w, GetData()->physical_h, GetData()->screen_w, GetData()->screen_h, GetData()->fullscreen, Software);
else if (GetData()->rendering_mode == 1)
GetData()->ctx->InitWindowLogical(GetData()->physical_w, GetData()->physical_h, GetData()->screen_w, GetData()->screen_h, GetData()->fullscreen, Accel2d);
- else if (GetData()->rendering_mode == 2)
+ else if (GetData()->rendering_mode == 2)
GetData()->ctx->InitWindowLogical(GetData()->physical_w, GetData()->physical_h, GetData()->screen_w, GetData()->screen_h, GetData()->fullscreen, OpenGL);
GetData()->window_name = (char*)calloc(sizeof(char), 400);
GetData()->s_flags = new std::map<std::string, int>();
// Font
+ // FIXME - Not loading default.ttf is a segv. Print an error instead
GetData()->ctx->Text()->LoadFont((char*)"default.ttf", GetData()->text_size);
GetData()->ctx->Text()->SetFontUsed(1);
op_jump((char*)"save.scr", NULL, true);
}
else // Jump to main, there is no save.
- op_jump(GetData()->main_scr[0], NULL, true);
+ op_jump(GetData()->main_scr[0], NULL, true);
}
else // Otherwise just jump to the main screen.
op_jump(GetData()->main_scr[0], NULL, true);