From: Brad A. <br...@us...> - 2013-02-21 21:28:32
|
gemrb: Infinity Engine emulator The branch master has been updated via c4c47ada57dafc13767697d7e05c427afa3bec2d (commit) Summary of changes: gemrb/plugins/SDLVideo/SDL20Video.cpp | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) from 356570d849bcca25fc9b8bd94ada008a22dd222a (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://gemrb.git.sourceforge.net/git/gitweb.cgi?p=gemrb/gemrb;a=commitdiff;h=c4c47ada57dafc13767697d7e05c427afa3bec2d commit c4c47ada57dafc13767697d7e05c427afa3bec2d Author: Brad Allred <bra...@me...> Date: Thu Feb 21 14:06:24 2013 -0700 SDL2: no need to create an intermediate surface. diff --git a/gemrb/plugins/SDLVideo/SDL20Video.cpp b/gemrb/plugins/SDLVideo/SDL20Video.cpp index 5bece1c..0a59de7 100644 --- a/gemrb/plugins/SDLVideo/SDL20Video.cpp +++ b/gemrb/plugins/SDLVideo/SDL20Video.cpp @@ -53,9 +53,8 @@ SDL20VideoDriver::~SDL20VideoDriver(void) SDL_DestroyWindow(window); } -int SDL20VideoDriver::CreateDisplay(int w, int h, int b, bool fs, const char* title) +int SDL20VideoDriver::CreateDisplay(int w, int h, int bpp, bool fs, const char* title) { - bpp=b; fullscreen=fs; width = w, height = h; @@ -92,12 +91,13 @@ int SDL20VideoDriver::CreateDisplay(int w, int h, int b, bool fs, const char* ti Viewport.h = height; Log(MESSAGE, "SDL 2 Driver", "Creating Main Surface..."); - SDL_Surface* tmp = SDL_CreateRGBSurface( 0, width, height, - bpp, 0, 0, 0, 0 ); - Uint32 winFormat = SDL_GetWindowPixelFormat(window); - backBuf = SDL_ConvertSurfaceFormat(tmp, winFormat, 0); - SDL_FreeSurface( tmp ); + Uint32 r, g, b, a; + SDL_PixelFormatEnumToMasks(winFormat, &this->bpp, &r, &g, &b, &a); + a = 0; + backBuf = SDL_CreateRGBSurface( 0, width, height, + bpp, r, g, b, a ); + if (!backBuf) { Log(ERROR, "SDL 2 Video", "Unable to create backbuffer of %s format: %s", SDL_GetPixelFormatName(winFormat), SDL_GetError()); ----------------------------------------------------------------------- This is an automated email from the git hooks/post-receive script. -- gemrb: Infinity Engine emulator |