X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fgrise.c;fp=src%2Fgrise.c;h=ed15de011b93930a58087c9a515d173f150f32bf;hp=3ac12cb9942ec14e98fe1c2315dcb604c511c0a7;hb=9dda65bd2ac317cf110c080e561f40b2ee221c93;hpb=bed531711e61f7fe2c5684882328e1452aa102f4 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 +}