changeset 29:d83239a98d1e

Take SDL into account when halving height of rendering buffer, and remove the corresponding "hack" from sdl.c. Also misc. cleanups.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 24 May 2010 00:19:57 +0300
parents e45ae779d439
children 72d1c04c788b
files pwplib/pwplib-unix.c pwplib/sdl.c
diffstat 2 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pwplib/pwplib-unix.c	Mon May 24 00:18:41 2010 +0300
+++ b/pwplib/pwplib-unix.c	Mon May 24 00:19:57 2010 +0300
@@ -199,7 +199,7 @@
 
    /*** hmmm ***/
 
-    if (pwplib.setup[SETUP_HALVE])
+    if (!sdl_init && pwplib.setup[SETUP_HALVE])
         pwplib.videobuf.height <<= 1;
 
     /* only allow if smaller than original? */
--- a/pwplib/sdl.c	Mon May 24 00:18:41 2010 +0300
+++ b/pwplib/sdl.c	Mon May 24 00:19:57 2010 +0300
@@ -111,7 +111,7 @@
 
     /* Set pwplib internal parameters */
     pwplib.videobuf.width = pwp_SDL.width / 4;
-    pwplib.videobuf.height = pwp_SDL.height / 8;
+    pwplib.videobuf.height = pwp_SDL.height / 4;
     pwplib.dump_rast = pwp_SDL_dump_rast_4x4;
 
     /* Initialize a indexed / paletted video surface */
@@ -121,8 +121,6 @@
         return 0;
     }
     
-    fprintf(stderr, "\nSDL_surface: %d x %d, pitch=%d\n", pwp_SDL.screen->w, pwp_SDL.screen->h, pwp_SDL.screen->pitch);
-    
     /* Set window caption, if any, hide mouse cursor */
     SDL_WM_SetCaption(PWP_WINNAME, PWP_WINNAME);
     SDL_ShowCursor(0);
@@ -139,7 +137,7 @@
     }
     SDL_SetColors(pwp_SDL.screen, pwp_SDL.cols, 0, PWP_NCOLORS);
 
-    pwpwrite("* SDL video\n");
+    pwpwrite("* SDL video (%d x %d, pitch=%d)\n", pwp_SDL.screen->w, pwp_SDL.screen->h, pwp_SDL.screen->pitch);
 
     return 1;
 }