From: Michael Georgoulopoulos Date: Sun, 18 Sep 2016 16:37:23 +0000 (+0300) Subject: Merge branch 'master' of mutantstargoat.com:/home/nuclear/git/dosdemo X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=commitdiff_plain;h=9dda65bd2ac317cf110c080e561f40b2ee221c93;hp=bed531711e61f7fe2c5684882328e1452aa102f4 Merge branch 'master' of mutantstargoat.com:/home/nuclear/git/dosdemo --- diff --git a/src/grise.c b/src/grise.c index 3ac12cb..ed15de0 100644 --- a/src/grise.c +++ b/src/grise.c @@ -99,7 +99,7 @@ static int init(void) int tmpBitmapW, tmpBitmapH; /* Allocate back buffer */ - backBuffer = (unsigned short*) malloc(BB_SIZE * BB_SIZE * sizeof(unsigned short)); + backBuffer = (unsigned short*) calloc(BB_SIZE * BB_SIZE, sizeof(unsigned short)); /* grise.png contains the background (horizon), baked reflection and normalmap for displacement */ if (!(background = img_load_pixels(BG_FILENAME, &backgroundW, &backgroundH, IMG_FMT_RGBA32))) { @@ -282,14 +282,14 @@ static void draw(void) /* Blit effect to framebuffer */ src = backBuffer + PIXEL_PADDING; - dst = fb_pixels; + dst = vmem_back; for (scanline = 0; scanline < fb_height; scanline++) { memcpy(dst, src, fb_width * 2); src += BB_SIZE; dst += fb_width; } - swap_buffers(fb_pixels); + swap_buffers(0); } /* src and dst can be the same */ @@ -641,4 +641,4 @@ static void rleBlitScaleInv(unsigned short *dst, int dstW, int dstH, int dstStri dst -= dstStride; } -} \ No newline at end of file +}