From d223decf2b36ae4169863c40d9a8dc126620bac6 Mon Sep 17 00:00:00 2001 From: wowzaman12 Date: Wed, 29 Apr 2015 20:36:40 +0000 Subject: [PATCH] removed a useless buffer (backported from bgk changes on his github repo) --- src/sdl/SDL.cpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/src/sdl/SDL.cpp b/src/sdl/SDL.cpp index 28fa32c0..f6170c86 100644 --- a/src/sdl/SDL.cpp +++ b/src/sdl/SDL.cpp @@ -168,7 +168,6 @@ extern int autoFireMaxCount; #define REWIND_NUM 8 #define REWIND_SIZE 400000 -#define SYSMSG_BUFFER_SIZE 1024 enum VIDEO_SIZE{ VIDEO_1X, VIDEO_2X, VIDEO_3X, VIDEO_4X, VIDEO_5X, VIDEO_6X, @@ -364,7 +363,7 @@ FILE *sdlFindFile(const char *name) if(f != NULL) return f; } - + if (!strchr(home, '/') && !strchr(home, '\\')) { char *path = getenv("PATH"); @@ -760,7 +759,7 @@ void sdlInitVideo() { } u32 rmask, gmask, bmask; - + if(openGL) { #if SDL_BYTEORDER == SDL_LIL_ENDIAN /* OpenGL RGBA masks */ rmask = 0x000000FF; @@ -768,19 +767,19 @@ void sdlInitVideo() { bmask = 0x00FF0000; #else rmask = 0xFF000000; - gmask = 0x00FF0000; - bmask = 0x0000FF00; + gmask = 0x00FF0000; + bmask = 0x0000FF00; #endif } else { rmask = surface->format->Rmask; gmask = surface->format->Gmask; bmask = surface->format->Bmask; } - + systemRedShift = sdlCalculateShift(rmask); systemGreenShift = sdlCalculateShift(gmask); systemBlueShift = sdlCalculateShift(bmask); - + if(openGL) { // Align to BGRA instead of ABGR systemRedShift += 8; @@ -1570,12 +1569,6 @@ int main(int argc, char **argv) if(optind < argc) { char *szFile = argv[optind]; - u32 len = strlen(szFile); - if (len > SYSMSG_BUFFER_SIZE) - { - fprintf(stderr,"%s :%s: File name too long\n",argv[0],szFile); - exit(-1); - } utilStripDoubleExtension(szFile, filename); char *p = strrchr(filename, '.'); @@ -1860,13 +1853,11 @@ int main(int argc, char **argv) void systemMessage(int num, const char *msg, ...) { - char buffer[SYSMSG_BUFFER_SIZE*2]; va_list valist; va_start(valist, msg); - vsprintf(buffer, msg, valist); - - fprintf(stderr, "%s\n", buffer); + vfprintf(stderr, msg, valist); + fprintf(stderr, "\n") va_end(valist); }