From 8d6aa77769d2d914fc05464435d6558b734bd4c1 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Thu, 4 Jul 2013 15:41:01 +0200 Subject: GUI: Cleanup EventRecorder::getSurface. Formerly the function created a SDL_Surface by hand. Instead now it uses SDL_CreateRGBSurface (which is used in the SDL backend anyway and yields the same results). This should fix PS3 port compilation. --- gui/EventRecorder.cpp | 38 ++------------------------------------ 1 file changed, 2 insertions(+), 36 deletions(-) (limited to 'gui/EventRecorder.cpp') diff --git a/gui/EventRecorder.cpp b/gui/EventRecorder.cpp index 94b955cb22..47358a0b3d 100644 --- a/gui/EventRecorder.cpp +++ b/gui/EventRecorder.cpp @@ -599,42 +599,8 @@ void EventRecorder::setFileHeader() { } SDL_Surface *EventRecorder::getSurface(int width, int height) { - SDL_Surface *surface = new SDL_Surface(); - surface->format = new SDL_PixelFormat(); - surface->flags = 0; - surface->format->palette = NULL; - surface->format->BitsPerPixel = 16; - surface->format->BytesPerPixel = 2; - surface->format->Rloss = 3; - surface->format->Gloss = 2; - surface->format->Bloss = 3; - surface->format->Aloss = 8; - surface->format->Rshift = 11; - surface->format->Gshift = 5; - surface->format->Bshift = 0; - surface->format->Ashift = 0; - surface->format->Rmask = 63488; - surface->format->Gmask = 2016; - surface->format->Bmask = 31; - surface->format->Amask = 0; - surface->format->colorkey = 0; - surface->format->alpha = 255; - surface->w = width; - surface->h = height; - surface->pitch = width * 2; - surface->pixels = (char *)malloc(surface->pitch * surface->h); - surface->offset = 0; - surface->hwdata = NULL; - surface->clip_rect.x = 0; - surface->clip_rect.y = 0; - surface->clip_rect.w = width; - surface->clip_rect.h = height; - surface->unused1 = 0; - surface->locked = 0; - surface->map = NULL; - surface->format_version = 4; - surface->refcount = 1; - return surface; + // Create a RGB565 surface of the requested dimensions. + return SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, 16, 0xF800, 0x07E0, 0x001F, 0x0000); } bool EventRecorder::switchMode() { -- cgit v1.2.3