diff dmsimple.c @ 122:5ba672ebe014

Add some verbose engine startup messages.
author Matti Hamalainen <ccr@tnsp.org>
date Thu, 04 Oct 2012 05:36:32 +0300
parents 16fc6e6cf3b5
children 6f7356f3b91c
line wrap: on
line diff
--- a/dmsimple.c	Thu Oct 04 05:36:06 2012 +0300
+++ b/dmsimple.c	Thu Oct 04 05:36:32 2012 +0300
@@ -441,6 +441,7 @@
     }
 
     // Initialize SDL components
+    dmPrint(1, "Initializing libSDL.\n");
     if (SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) != 0)
     {
         dmError("Could not initialize SDL: %s\n", SDL_GetError());
@@ -448,13 +449,12 @@
     }
     initSDL = TRUE;
 
-    // Initialize JSS
+    // Initialize audio parts
     engine.optAfmt.freq     = 44100;
     engine.optAfmt.format   = AUDIO_S16SYS;
     engine.optAfmt.channels = 2;
     engine.optAfmt.samples  = 16*1024;
 
-
 #ifdef DM_USE_JSS
     jssInit();
 
@@ -495,7 +495,7 @@
     
     if (SDL_OpenAudio(&engine.optAfmt, NULL) < 0)
     {
-        dmError("Couldn't open audio: %s\n", SDL_GetError());
+        dmError("Couldn't open SDL audio: %s\n", SDL_GetError());
         goto error_exit;
     }
 
@@ -515,6 +515,7 @@
 
 
     // Load resources
+    dmPrint(1, "Loading resources, please wait...\n");
     if ((err = engineLoadResources()) != DMERR_OK)
     {
         dmError("Error loading resources, %d: %s.\n",
@@ -531,6 +532,7 @@
     {
         Uint8 *ptr;
         int left = engine.dev->outFreq * engine.demoDuration;
+        dmPrint(1, "DEBUG mode enabled, pre-rendering audio.");
         engine.audioBufSize = jvmGetSampleSize(engine.dev) * engine.dev->outFreq * engine.demoDuration;
         if ((engine.audioBuf = dmMalloc(engine.audioBufSize)) == NULL)
         {
@@ -553,6 +555,7 @@
     }
 #endif
 
+    dmPrint(1, "Starting up.\n");
     SDL_PauseAudio(0);
     engine.startTime = SDL_GetTicks();