X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Frt.c;h=020c51f6d93dc30b9143007ed586411d06d8b301;hb=d2894c1a2380cee76476d63e4800188dcbc121f8;hp=18b7f17548674537cd709473ddede1c73870f0a6;hpb=92fb08c674a95e1b14de3dc21c718444be91aac5;p=cyberay diff --git a/src/rt.c b/src/rt.c index 18b7f17..020c51f 100644 --- a/src/rt.c +++ b/src/rt.c @@ -33,8 +33,8 @@ int fbsize(int width, int height) if(!(fbptr = malloc(width * height * sizeof *fb.pixels))) { return -1; } - xtiles = width / TILESZ; - ytiles = height / TILESZ; + xtiles = (width + TILESZ - 1) / TILESZ; + ytiles = (height + TILESZ - 1) / TILESZ; if(!(tileptr = malloc(xtiles * ytiles * sizeof *tiles))) { free(fbptr); return -1;