From 9a75a5bde219ba7fc62b08e7aa9c69a0afb98d61 Mon Sep 17 00:00:00 2001 From: stpohle Date: Wed, 4 Jun 2003 15:48:00 +0000 Subject: [PATCH] Animated Death scene :o) --- src/gfx.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gfx.c b/src/gfx.c index 5cc2396..0a508ff 100644 --- a/src/gfx.c +++ b/src/gfx.c @@ -63,10 +63,10 @@ getpixel (SDL_Surface * surface, int x, int y) void putpixel (SDL_Surface * surface, int x, int y, Uint32 pixel) { - int bpp = surface->format->BytesPerPixel; - /* Here p is the address to the pixel we want to set */ + int bpp = surface->format->BytesPerPixel; Uint8 *p = (Uint8 *) surface->pixels + y * surface->pitch + x * bpp; + switch (bpp) { case 1: *p = pixel; @@ -163,6 +163,7 @@ scale_image (SDL_Surface * orginal, int newx, int newy) amask = 0xff000000; #endif /* */ + surface = SDL_CreateRGBSurface (SDL_SWSURFACE, newx, newy, 32, rmask, gmask, bmask, amask); if (surface == NULL) { fprintf (stderr, "CreateRGBSurface failed: %s\n", SDL_GetError ());