# HG changeset patch # User Matti Hamalainen # Date 1348796081 -10800 # Node ID 187f50f02f17c3e13d39d037abeb8006e2739ba7 # Parent bf77857b8e6209d1a50d35a887e0bca44056ea69 Fix blittest, remove useless code. diff -r bf77857b8e62 -r 187f50f02f17 blittest.c --- 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 -#ifdef USE_IMG -#include -#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();