]> git.mxchange.org Git - quix0rs-blobwars.git/blobdiff - src/map.cpp
Prevent a segmentation fault when using the -map option without specifying a map.
[quix0rs-blobwars.git] / src / map.cpp
index 048e2db069c6c146970f70ca6a0b7e35b59e2b20..d0206ccc524584e33f0ab6487fa336c89cd52daf 100644 (file)
@@ -1,5 +1,6 @@
 /*
-Copyright (C) 2004-2010 Parallel Realities
+Copyright (C) 2004-2011 Parallel Realities
+Copyright (C) 2011-2015 Perpendicular Dimensions
 
 This program is free software; you can redistribute it and/or
 modify it under the terms of the GNU General Public License
@@ -293,7 +294,7 @@ void showMap(int centerX, int centerY)
        
        SDL_Surface *panel = graphics.createSurface(320, 240);
        SDL_Surface *background = graphics.loadImage("gfx/main/mapBackground.png");
-       SDL_SetAlpha(background, SDL_SRCALPHA|SDL_RLEACCEL, 130);
+       SDL_SetAlpha(background, 130);
        
        graphics.blit(background, 0, 0, panel, false);
        
@@ -412,7 +413,7 @@ void showMap(int centerX, int centerY)
                graphics.drawRect(160, 120, 320, 240, graphics.black, graphics.white, graphics.screen);
                graphics.blit(panel, 160, 120, graphics.screen, false);
 
-               if ((config.isControl(CONTROL::MAP)) || (config.isControl(CONTROL::PAUSE)) || (engine.keyState[SDLK_ESCAPE]))
+               if ((config.isControl(CONTROL::MAP)) || (config.isControl(CONTROL::PAUSE)) || (engine.keyState[SDL_SCANCODE_ESCAPE]))
                {
                        break;
                }
@@ -649,7 +650,7 @@ void parseMapDataLine(const char *line, int y)
 
                while (true)
                {
-                       *line++;
+                       line++;
 
                        if (*line == ' ')
                                break;