]> 4ch.mooo.com Git - 16.git/commitdiff
==== INITIAL LAYER MAP STUFF DONE, added mapdraw layer ontop of bg, going to implemen...
authorsparky4 <sparky4@cock.li>
Thu, 16 Feb 2017 01:40:10 +0000 (19:40 -0600)
committersparky4 <sparky4@cock.li>
Thu, 16 Feb 2017 01:40:10 +0000 (19:40 -0600)
src/lib/scroll16.c

index 95996534a670668bfc13c9a958837594a6ad6ded..a78c99820637862235de9801504f1e15b919fedb 100755 (executable)
@@ -338,6 +338,7 @@ void near mapScrollRight(map_view_t *mv, player_t *player, word id, word plid)
 \r
        /* draw the next column */\r
        x= mv[0].page->sw + mv[0].map->tiles->tileWidth;\r
+       if(mv[0].tx >= 0 && mv[0].tx+mv[0].page->ti.tw < mv[0].map->width)\r
 #ifndef FULLRCREND\r
        if(player[plid].enti.q%4)\r
 #else\r
@@ -360,6 +361,7 @@ void near mapScrollLeft(map_view_t *mv, player_t *player, word id, word plid)
 \r
        /* draw the next column */\r
        x= 0;\r
+       if(mv[0].tx > 0 && mv[0].tx+mv[0].page->ti.tw <= mv[0].map->width)\r
 #ifndef FULLRCREND\r
        if(player[plid].enti.q%4)\r
 #else\r
@@ -382,6 +384,7 @@ void near mapScrollUp(map_view_t *mv, player_t *player, word id, word plid)
 \r
        /* draw the next row */\r
        y= 0;\r
+       if(mv[0].ty > 0 && mv[0].ty+mv[0].page->ti.th <= mv[0].map->height)\r
 #ifndef FULLRCREND\r
        if(player[plid].enti.q%3)\r
 #else\r
@@ -404,6 +407,7 @@ void near mapScrollDown(map_view_t *mv, player_t *player, word id, word plid)
 \r
        /* draw the next row */\r
        y= mv[0].page->sh + mv[0].map->tiles->tileHeight;\r
+       if(mv[0].ty >= 0 && mv[0].ty+mv[0].page->ti.th < mv[0].map->height)\r
 #ifndef FULLRCREND\r
        if(player[plid].enti.q%3)\r
 #else\r
@@ -602,16 +606,14 @@ if(pagedelayrendermap){ sprintf(global_temp_status_text, "%-3u", mv->dx); modexp
        for(    mv->dx=poopoffset;      mv->dx<(mv->page->sw+mv->dxThresh)/(poopoffset+1) && tx < mv->map->width;       mv->dx+=mv->map->tiles->tileWidth, tx++) {\r
                if(i>=0){\r
                        mapDrawTile(mv->map->tiles, mv->map->layerdata[0].data[i], mv->page, mv->dx, y);\r
-                       for(z=1;z<=2;z++){\r
+                       for(z=1;z<=2;z++)\r
                                if(mv->map->layerdata[z].data[i]){\r
                                        sprintf(global_temp_status_text2, "%u", mv->map->layerdata[z].data[i]); modexprint(mv->page, mv->dx, y, 1, 0, PALMAPDRAWW, z+2, global_temp_status_text2);\r
                                        //mapDrawTile(mv->map->tiles, mv->map->layerdata[z].data[i], mv->page, mv->dx, y);\r
                                }\r
-                       }\r
                }\r
                i++; /* next! */\r
-       }\r
-if(pagedelayrendermap) delay(200);\r
+       } if(pagedelayrendermap) delay(200);\r
 }\r
 \r
 void near mapDrawCol(map_view_t *mv, int tx, int ty, word x, player_t *player, word poopoffset)\r
@@ -628,16 +630,14 @@ if(pagedelayrendermap){ sprintf(global_temp_status_text, "%-3u", mv->dy); modexp
        for(    mv->dy=poopoffset;      mv->dy<(mv->page->sh+mv->dyThresh)/(poopoffset+1) && ty < mv->map->height;      mv->dy+=mv->map->tiles->tileHeight, ty++) {\r
                if(i>=0){\r
                        mapDrawTile(mv->map->tiles, mv->map->layerdata[0].data[i], mv->page, x, mv->dy);\r
-                       for(z=1;z<=2;z++){\r
+                       for(z=1;z<=2;z++)\r
                                if(mv->map->layerdata[z].data[i]){\r
                                        sprintf(global_temp_status_text2, "%u", mv->map->layerdata[z].data[i]); modexprint(mv->page, x, mv->dy, 1, 0, PALMAPDRAWW, z+2, global_temp_status_text2);\r
                                        //mapDrawTile(mv->map->tiles, mv->map->layerdata[z].data[i], mv->page, x, mv->dy);\r
                                }\r
-                       }\r
                }\r
                i += mv->map->width;\r
-       }\r
-if(pagedelayrendermap) delay(200);\r
+       } if(pagedelayrendermap) delay(200);\r
 }\r
 \r
 void mapDrawWRow(map_view_t *mv, int tx, int ty, word y)\r
@@ -649,12 +649,11 @@ void mapDrawWRow(map_view_t *mv, int tx, int ty, word y)
        for(mv->dx=0; mv->dx<mv->page->sw+mv->dxThresh && tx < mv->map->width; mv->dx+=mv->map->tiles->tileWidth, tx++) {\r
                if(i>=0){       /* we are in the map, so copy! */\r
                        mapDrawTile(mv->map->tiles, mv->map->layerdata[0].data[i], mv->page, mv->dx, y);\r
-                       for(z=1;z<=2;z++){\r
+                       for(z=1;z<=2;z++)\r
                                if(mv->map->layerdata[z].data[i]){\r
                                        sprintf(global_temp_status_text2, "%u", mv->map->layerdata[z].data[i]); modexprint(mv->page, mv->dx, y, 1, 0, PALMAPDRAWW, z+2, global_temp_status_text2);\r
                                        //mapDrawTile(mv->map->tiles, mv->map->layerdata[z].data[i], mv->page, mv->dx, y);\r
                                }\r
-                       }\r
                }\r
                i++; /* next! */\r
        }\r
@@ -672,12 +671,11 @@ void mapDrawWCol(map_view_t *mv, int tx, int ty, word x)
        for(mv->dy=0; mv->dy<mv->page->sh+mv->dyThresh && ty < mv->map->height; mv->dy+=mv->map->tiles->tileHeight, ty++) {\r
                if(i>=0){       /* we are in the map, so copy away! */\r
                        mapDrawTile(mv->map->tiles, mv->map->layerdata[0].data[i], mv->page, x, mv->dy);\r
-                       for(z=1;z<=2;z++){\r
+                       for(z=1;z<=2;z++)\r
                                if(mv->map->layerdata[z].data[i]){\r
                                        sprintf(global_temp_status_text2, "%u", mv->map->layerdata[z].data[i]); modexprint(mv->page, x, mv->dy, 1, 0, PALMAPDRAWW, z+2, global_temp_status_text2);\r
                                        //mapDrawTile(mv->map->tiles, mv->map->layerdata[z].data[i], mv->page, x, mv->dy);\r
                                }\r
-                       }\r
                }\r
                i += mv->map->width;\r
        }\r