changeset 89:ea44e1d9eb7c default tip

Cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 25 May 2014 05:03:14 +0300
parents 09fad777f370
children
files pwplib/sdl.c
diffstat 1 files changed, 22 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/pwplib/sdl.c	Sat Dec 21 07:28:31 2013 +0200
+++ b/pwplib/sdl.c	Sun May 25 05:03:14 2014 +0300
@@ -69,23 +69,25 @@
     SDL_Flip(pwp_SDL.screen);
 }
 
-static void rast2rgb(int n, int muller, int *r, int *g, int *b)
+static void rast2rgb(const int n, const int muller, int *r, int *g, int *b)
 {
-    int fg = n & 15, bg = (n >> 4) & 15;
-    static const char rgb[16 * 3] = { 0, 0, 0,
-        0, 0, 9,
-        0, 9, 0,
-        0, 9, 9,
-        9, 0, 0,
-        9, 0, 9,
-        9, 9, 0,
-        9, 9, 9,
-        6, 6, 6,
-        0, 0, 15,
-        0, 15, 0,
-        0, 15, 15,
-        15, 0, 0,
-        15, 0, 15,
+    const int fg = n & 15, bg = (n >> 4) & 15;
+    static const char rgb[16 * 3] = 
+    {
+         0, 0 , 0,
+         0, 0 , 9,
+         0, 9 , 0,
+         0, 9 , 9,
+         9, 0 , 0,
+         9, 0 , 9,
+         9, 9 , 0,
+         9, 9 , 9,
+         6, 6 , 6,
+         0, 0 , 15,
+         0, 15, 0,
+         0, 15, 15,
+        15, 0 , 0,
+        15, 0 , 15,
         15, 15, 0,
         15, 15, 15
     };
@@ -104,7 +106,8 @@
     pwp_SDL.width = pwplib.setup[SETUP_XRES];
     pwp_SDL.height = pwplib.setup[SETUP_YRES];
 
-    if (pwp_SDL.width < 8 || pwp_SDL.height < 16) {
+    if (pwp_SDL.width < 8 || pwp_SDL.height < 16)
+    {
         pwpwrite("* invalid xres or yres (%d x %d)\n", pwp_SDL.width, pwp_SDL.height);
         return 0;
     }
@@ -116,7 +119,8 @@
 
     /* Initialize a indexed / paletted video surface */
     pwp_SDL.screen = SDL_SetVideoMode(pwp_SDL.width, pwp_SDL.height, 8, pwp_SDL.vflags);
-    if (pwp_SDL.screen == NULL) {
+    if (pwp_SDL.screen == NULL)
+    {
         pwpwrite("* SDL could not initialize video surface/mode.\n");
         return 0;
     }