diff editor/edmain.cpp @ 1738:b4992d9f72fe

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 09 Jun 2018 13:05:22 +0300
parents ef5a9c51569c
children 69a5af2eb1ea
line wrap: on
line diff
--- a/editor/edmain.cpp	Fri Jun 08 22:32:30 2018 +0300
+++ b/editor/edmain.cpp	Sat Jun 09 13:05:22 2018 +0300
@@ -39,9 +39,9 @@
     else
 #ifdef DM_USE_JSS
     {
-        if (engine->dev != NULL)
-            jvmRenderAudio(engine->dev, stream,
-                           len / jvmGetSampleSize(engine->dev));
+        if (engine->jssDev != NULL)
+            jvmRenderAudio(engine->jssDev, stream,
+                           len / jvmGetSampleSize(engine->jssDev));
     }
 #endif
 #ifdef DM_USE_TREMOR
@@ -66,7 +66,7 @@
         &engine.resources, engine.optPackFilename, engine.optDataPath,
         engine.optResFlags, engineClassifier)) != DMERR_OK)
     {
-        dmError("Could not initialize resource manager: %d, %s.\n",
+        dmErrorMsg("Could not initialize resource manager: %d, %s.\n",
             err, dmErrorStr(err));
     }
     return err;
@@ -112,7 +112,7 @@
     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());
+        dmErrorMsg("Could not initialize SDL: %s\n", SDL_GetError());
         goto error_exit;
     }
     initSDL = true;
@@ -133,33 +133,33 @@
     switch (engine.optAfmt.format)
     {
         case AUDIO_S16SYS:
-            engine.jss_format = JSS_AUDIO_S16;
+            engine.jssFormat = JSS_AUDIO_S16;
             break;
         case AUDIO_U16SYS:
-            engine.jss_format = JSS_AUDIO_U16;
+            engine.jssFormat = JSS_AUDIO_U16;
             break;
         case AUDIO_S8:
-            engine.jss_format = JSS_AUDIO_S8;
+            engine.jssFormat = JSS_AUDIO_S8;
             break;
         case AUDIO_U8:
-            engine.jss_format = JSS_AUDIO_U8;
+            engine.jssFormat = JSS_AUDIO_U8;
             break;
     }
 
     dmPrint(1, "Initializing miniJSS mixer with fmt=%d, chn=%d, freq=%d\n",
-            engine.jss_format, engine.optAfmt.channels, engine.optAfmt.freq);
+            engine.jssFormat, engine.optAfmt.channels, engine.optAfmt.freq);
 
-    if ((engine.dev =
-         jvmInit(engine.jss_format, engine.optAfmt.channels,
+    if ((engine.jssDev =
+         jvmInit(engine.jssFormat, engine.optAfmt.channels,
                  engine.optAfmt.freq, JMIX_AUTO)) == NULL)
     {
-        dmError("jvmInit() returned NULL, voi perkele.\n");
+        dmErrorMsg("jvmInit() returned NULL, voi perkele.\n");
         goto error_exit;
     }
 
-    if ((engine.plr = jmpInit(engine.dev)) == NULL)
+    if ((engine.jssPlr = jmpInit(engine.jssDev)) == NULL)
     {
-        dmError("jmpInit() returned NULL\n");
+        dmErrorMsg("jmpInit() returned NULL\n");
         goto error_exit;
     }
 #endif
@@ -173,7 +173,7 @@
 
     if (SDL_OpenAudio(&engine.optAfmt, NULL) < 0)
     {
-        dmError("Couldn't open SDL audio: %s\n", SDL_GetError());
+        dmErrorMsg("Couldn't open SDL audio: %s\n", SDL_GetError());
         goto error_exit;
     }
 
@@ -181,7 +181,7 @@
     if (engine.demoInitPreVideo != NULL &&
         (err = engine.demoInitPreVideo(&engine)) != DMERR_OK)
     {
-        dmError("demoInitPreVideo() failed, %d: %s\n", err, dmErrorStr(err));
+        dmErrorMsg("demoInitPreVideo() failed, %d: %s\n", err, dmErrorStr(err));
         goto error_exit;
     }
 
@@ -191,14 +191,14 @@
     engine.screen = SDL_CreateRGBSurface(SDL_SWSURFACE, engine.optVidWidth, engine.optVidHeight, engine.optVidDepth, 0, 0, 0, 0);
     if (engine.screen == NULL)
     {
-        dmError("Could not allocate video backbuffer surface.\n");
+        dmErrorMsg("Could not allocate video backbuffer surface.\n");
         goto error_exit;
     }
 
     if (engine.demoInitPostVideo != NULL &&
         (err = engine.demoInitPostVideo(&engine)) != DMERR_OK)
     {
-        dmError("demoInitPostVideo() failed, %d: %s\n", err, dmErrorStr(err));
+        dmErrorMsg("demoInitPostVideo() failed, %d: %s\n", err, dmErrorStr(err));
         goto error_exit;
     }
 
@@ -229,8 +229,8 @@
     SDL_LockAudio();
     SDL_PauseAudio(1);
 #ifdef DM_USE_JSS
-    jmpClose(engine.plr);
-    jvmClose(engine.dev);
+    jmpClose(engine.jssPlr);
+    jvmClose(engine.jssDev);
     jssClose();
 #endif
     SDL_UnlockAudio();
@@ -323,7 +323,7 @@
     statusMsg("Loading resources, please wait...");
     if ((err = loadResources()) != DMERR_OK)
     {
-        dmError("Error loading resources, %d: %s.\n", err, dmErrorStr(err));
+        dmErrorMsg("Error loading resources, %d: %s.\n", err, dmErrorStr(err));
         return err;
     }
 
@@ -332,7 +332,7 @@
     statusMsg("Initializing custom demo data.");
     if ((err = engine.demoInit(&engine)) != DMERR_OK)
     {
-        dmError("Failure in demoInit(), %d: %s\n",
+        dmErrorMsg("Failure in demoInit(), %d: %s\n",
             err, dmErrorStr(err));
         return err;
     }
@@ -341,7 +341,7 @@
     statusMsg("Initializing effects ...");
     if ((err = engineInitializeEffects(&engine)) != DMERR_OK)
     {
-        dmError("Effects initialization failed, %d: %s\n",
+        dmErrorMsg("Effects initialization failed, %d: %s\n",
             err, dmErrorStr(err));
         return err;
     }