X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?p=dosdemo;a=blobdiff_plain;f=src%2Fgrise.c;h=e6cd7ea257e58186822c7a3032f61cf27e476940;hp=896b7c0b3e6457ede7cdb13ee0dadcee10c32bb5;hb=976c2aca502358c5f407a109c31d67abd519ac1d;hpb=899b88b4ab8ef15a5032e745ff34dd9b60cadc26 diff --git a/src/grise.c b/src/grise.c index 896b7c0..e6cd7ea 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))) { @@ -206,14 +206,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 */ @@ -541,4 +541,4 @@ static void rleBlitScaleInv(unsigned short *dst, int dstW, int dstH, int dstStri dst -= dstStride; } -} \ No newline at end of file +}