]> Chaos Git - vn/vndc.git/commitdiff
Fixups, etc. Some aspects haven't aged so well
authorroot <chaos.kagami@gmail.com>
Fri, 6 May 2016 10:34:57 +0000 (06:34 -0400)
committerroot <chaos.kagami@gmail.com>
Fri, 6 May 2016 10:34:57 +0000 (06:34 -0400)
external/zero/src/AudioManager.cpp
vndc/src/Data.cpp
vndc/src/Loop.cpp
vndc/src/VNDC.cpp

index 135de932ea28735dbc269ce5df697c70d77a625b..fa00a8d56cf19cd05d6b8084f5bcd127ef06fab2 100644 (file)
@@ -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;
index 654cb06b2143bd788e601939ab559c338b08ba9e..17b3def2fe02c140bf66e364ec11e642ca56b78d 100644 (file)
@@ -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() {
index 18c41fe06f352ba0355a55b55b70dc35d93f5f02..788d07ee6d14d446b15ef2354d7d6fed4e462e0a 100644 (file)
@@ -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<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);
 
index f260b24d2ac4c3b7b9150464868bfb8c8af6de23..f885a9ced9a76139ef493a5d985e4e7528ba35bc 100644 (file)
@@ -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);