From: root Date: Fri, 6 May 2016 10:34:57 +0000 (-0400) Subject: Fixups, etc. Some aspects haven't aged so well X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=dd7df6c04de1ba2d9c14b09b2272438b014d751d;p=vn%2Fvndc.git Fixups, etc. Some aspects haven't aged so well --- diff --git a/external/zero/src/AudioManager.cpp b/external/zero/src/AudioManager.cpp index 135de93..fa00a8d 100644 --- a/external/zero/src/AudioManager.cpp +++ b/external/zero/src/AudioManager.cpp @@ -2,13 +2,22 @@ // 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; diff --git a/vndc/src/Data.cpp b/vndc/src/Data.cpp index 654cb06..17b3def 100644 --- a/vndc/src/Data.cpp +++ b/vndc/src/Data.cpp @@ -32,16 +32,16 @@ DataContainer::DataContainer() { 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() { diff --git a/vndc/src/Loop.cpp b/vndc/src/Loop.cpp index 18c41fe..788d07e 100644 --- a/vndc/src/Loop.cpp +++ b/vndc/src/Loop.cpp @@ -43,7 +43,7 @@ void Setup() { 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); @@ -60,6 +60,7 @@ void Setup() { GetData()->s_flags = new std::map(); // 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); diff --git a/vndc/src/VNDC.cpp b/vndc/src/VNDC.cpp index f260b24..f885a9c 100644 --- a/vndc/src/VNDC.cpp +++ b/vndc/src/VNDC.cpp @@ -152,7 +152,7 @@ int main(int argc, char** argv) { 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);