aboutsummaryrefslogtreecommitdiff
path: root/gui/EventRecorder.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2013-07-04 15:41:01 +0200
committerJohannes Schickel2013-07-04 15:43:17 +0200
commit8d6aa77769d2d914fc05464435d6558b734bd4c1 (patch)
tree1dc103bcd526f4b7c20306daecf2d8f51ec2a434 /gui/EventRecorder.cpp
parentafdb007e2e158efa4a9a1098f80ff224d0038729 (diff)
downloadscummvm-rg350-8d6aa77769d2d914fc05464435d6558b734bd4c1.tar.gz
scummvm-rg350-8d6aa77769d2d914fc05464435d6558b734bd4c1.tar.bz2
scummvm-rg350-8d6aa77769d2d914fc05464435d6558b734bd4c1.zip
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.
Diffstat (limited to 'gui/EventRecorder.cpp')
-rw-r--r--gui/EventRecorder.cpp38
1 files changed, 2 insertions, 36 deletions
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() {