mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) {\r
word rx;\r
word ry;
- //rx = (i % t->cols) * t->tileWidth;\r
- //ry = (i / t->cols) * t->tileHeight;
//if(i==0) i=2;
if(i==0)
{
{
rx = (((i-1) % ((t->data->width)/t->tileWidth)) * t->tileWidth);\r
ry = (((i-1) / ((t->data->height)/t->tileHeight)) * t->tileHeight);
- if(i==5) printf("rx= %d\n", rx);
- if(i==5) printf("ry= %d\n", ry);
- if(i==5) printf("i= %d\n", i);
- //if(i==4) printf("x= %d\n", (i % ((t->data->width*i)/t->tileWidth)) * t->tileWidth);
- //if(i==4) printf("y= %d\n", (i / ((t->data->height*i)/t->tileHeight)) * t->tileHeight);\r
//mxPutTile(t->data, x, y, t->tileWidth, t->tileHeight);\r
modexDrawBmpRegion(page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data));
}\r
for(x=0; x<SCREEN_WIDTH+mv->dxThresh && tx < mv->map->width; x+=mv->map->tiles->tileWidth, tx++) {\r
if(i>=0) {\r
/* we are in the map, so copy! */
- //if(mv->map->data[i]==0) mv->map->data[i]=2;
- //if(mv->map->data[i]==0) modexClearRegion(mv->page, x, y, 16, 16, 0);
- //else
mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y);\r
}\r
i++; /* next! */\r
for(y=0; y<SCREEN_HEIGHT+mv->dyThresh && ty < mv->map->height; y+=mv->map->tiles->tileHeight, ty++) {\r
if(i>=0) {\r
/* we are in the map, so copy away! */
- //if(mv->map->data[i]==0) mv->map->data[i]=2;
- //if(mv->map->data[i]==0) modexClearRegion(mv->page, x, y, 16, 16, 0);
- //else\r
mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y);\r
}\r
i += mv->map->width;\r