changeset 6:187f50f02f17

Fix blittest, remove useless code.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 28 Sep 2012 04:34:41 +0300
parents bf77857b8e62
children d427763f113a
files blittest.c
diffstat 1 files changed, 3 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/blittest.c	Fri Sep 28 04:31:57 2012 +0300
+++ b/blittest.c	Fri Sep 28 04:34:41 2012 +0300
@@ -2,14 +2,10 @@
 #include "dmargs.h"
 #include "dmvecmat.h"
 #include <math.h>
-#ifdef USE_IMG
-#include <SDL_image.h>
-#endif
 
 #define DM_COLORS (256)
 
-char *optFontFile = "font.ttf",
-     *optBitmapFilename = "tnsp.pcx";
+char *optFontFile = "font.ttf";
 BOOL optBenchmark = FALSE;
 int optVFlags = SDL_SWSURFACE | SDL_HWPALETTE;
 int optScrWidth = 640, optScrHeight = 480, optFontSize = 20, optScrDepth = 32;
@@ -301,13 +297,13 @@
 
 int main(int argc, char *argv[])
 {
-    SDL_Surface *screen = NULL, *bmap = NULL, *logo = NULL;
+    SDL_Surface *screen = NULL, *bmap = NULL;
     TTF_Font *font = NULL;
     SDL_Color fontcol={255,155,155,0};
     Uint32 lcol;
     SDL_Event event;
     int mouseX, mouseY;
-    BOOL initSDL = FALSE, initTTF = FALSE, exitFlag, showMap = FALSE, initImage = FALSE;
+    BOOL initSDL = FALSE, initTTF = FALSE, exitFlag, showMap = FALSE;
 
     dmInitProg("blittest", "dmlib blittest", "0.2", NULL, NULL);
     if (!dmArgsProcess(argc, argv, optList, optListN,
@@ -338,29 +334,6 @@
     }
     TTF_SetFontStyle(font, TTF_STYLE_NORMAL);
 
-#ifdef USE_IMG
-    if (IMG_Init(IMG_INIT_PNG) < 0)
-    {
-        dmError("Could not initialize SDL_image: %s\n", SDL_GetError());
-        goto error_exit;
-    }
-    initImage = TRUE;
-
-    SDL_RWops *rwop = SDL_RWFromFile(optBitmapFilename, "rb");
-    if (rwop == NULL)
-    {
-        dmError("Could not open file '%s'.\n", optBitmapFilename);
-        goto error_exit;
-    }
-    logo = IMG_LoadPCX_RW(rwop);
-    SDL_RWclose(rwop);
-    if (logo == NULL)
-    {
-        dmError("Could not load image file '%s'.\n", optBitmapFilename);
-        goto error_exit;
-    }
-#endif
-    
     if (optBenchmark)
     {
         screen = SDL_CreateRGBSurface(SDL_SWSURFACE, optScrWidth, optScrHeight, optScrDepth, 0, 0, 0, 0);
@@ -524,20 +497,12 @@
     if (screen)
         SDL_FreeSurface(screen);
 
-    if (logo)
-        SDL_FreeSurface(logo);
-
     if (font)
         TTF_CloseFont(font);
 
     if (initSDL)
         SDL_Quit();
 
-#ifdef USE_IMG
-    if (initImage)
-        IMG_Quit();
-#endif
-
     if (initTTF)
         TTF_Quit();