From: sparky4 Date: Tue, 14 Feb 2017 22:02:37 +0000 (-0600) Subject: hmmm layers in map_t .... X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=d26e0714368d1cfbe4caee5d6309cf97e0af55db;p=16.git hmmm layers in map_t .... --- diff --git a/src/lib/16_tdef.h b/src/lib/16_tdef.h index 54ec8b9c..d1220d54 100755 --- a/src/lib/16_tdef.h +++ b/src/lib/16_tdef.h @@ -64,18 +64,16 @@ typedef struct { byte *palette; } planar_buf_t; +//===========================================================================// + //TODO: 16_mm and 16_ca must handle this typedef struct { - bitmap_t far *pcximg; //old - //planar_buf_t far *data; //old + bitmap_t far *pcximg; //I will probibaly use this --sparky4 + //planar_buf_t far *pbdata; //old word tileHeight, tileWidth; //defined by mapfile unsigned int rows, cols; -// #ifdef __DEBUG__ -// boolean debug_text; //show the value of the tile! wwww -// byte *debug_data; -// #endif - byte imgname[8]; //image file of tileset -} tiles_t; + byte imgname[8]; //image file of tileset (set to 8 because DOS ^^;) +} tiles_t; //seems to be the tileset properties //TODO: 16_mm and 16_ca must handle this //TODO: add variables from 16_ca @@ -99,13 +97,15 @@ typedef struct { byte *data; //TODO: 16_mm and 16_ca must handle this tiles_t *tiles; //TODO: 16_mm and 16_ca must handle this #else - byte * far *layerdata; - tiles_t far *layertile[MAPLAYERS]; + byte far *layerdata[MAPLAYERS]; // mapdata for multilayer (map index values for rendering which image on the tile) + tiles_t far *layertile[MAPLAYERS]; // tilesets for layers (currently ony 4 can be loaded wwww) #endif int width, height; //this has to be signed! byte name[16]; } map_t; +//===================================// + typedef struct{ word tw; /* screen width in tiles */ word th; /* screen height in tiles */ diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 6f5665ec..e421fd91 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -567,38 +567,34 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) word ry; //word textx=0, texty=0; //if(i==0) i=2; - if(i==0) + switch(i) { - //wwww - modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, 1); //currently the over scan color! - } - else - { - rx = (((i-1) % ((t->pcximg->width)/t->tileWidth)) * t->tileWidth); - ry = (((i-1) / ((t->pcximg->height)/t->tileHeight)) * t->tileHeight); + case 0: + //wwww + modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, 1); //currently the over scan color! + break; + default: + rx = (((i-1) % ((t->pcximg->width)/t->tileWidth)) * t->tileWidth); + ry = (((i-1) / ((t->pcximg->height)/t->tileHeight)) * t->tileHeight); ////0000printf("i=%d\n", i); -#ifdef __DEBUG_MAP__ - switch(dbg_maptext) - { - case 0: -#endif #ifndef TILERENDER - if(!pagenorendermap) modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, i+1); + if(!pagenorendermap) modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, i+1); #else - modexDrawBmpRegion (page, x, y, rx, ry, t->tileWidth, t->tileHeight, i); - /* then the sprite. note modding ram ptr means we just draw to (x&3,0) */ - //draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header),bufsz-sizeof(*vrl_header)); - //modexDrawBmpRegion (page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data)); -#endif -#ifdef __DEBUG_MAP__ - break; - case 1: - if(!pagenorendermap) modexClearRegion(page, x, y, t->tileWidth, t->tileHeight, i); - sprintf(global_temp_status_text2, "%d", i); - modexprint(page, x, y, 1, 1, 2, global_temp_status_text2); - break; - } + modexDrawBmpRegion (page, x, y, rx, ry, t->tileWidth, t->tileHeight, i); + //draw_vrl1_vgax_modex(x-rx,y-ry,vrl_header,vrl_lineoffs,buffer+sizeof(*vrl_header),bufsz-sizeof(*vrl_header)); + //modexDrawBmpRegion (page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data)); #endif +/*#ifdef __DEBUG_MAP__ + switch(dbg_maptext) + { + case 0: + break; + case 1: + sprintf(global_temp_status_text2, "%u", i); modexprint(page, x, y, 1, 1, 2, global_temp_status_text2); + break; + } +#endif*/ + break; } } diff --git a/src/zcroll.c b/src/zcroll.c index b398a8e8..342f3ba5 100755 --- a/src/zcroll.c +++ b/src/zcroll.c @@ -147,7 +147,7 @@ void main(int argc, char *argv[]) gvar.video.page[0].tlx=mv[0].tx*TILEWH; gvar.video.page[0].tly=mv[0].ty*TILEWH; shinku(&gvar); - modexpdump(mv[0].page); +//modexpdump(mv[0].page); #ifdef FADE modexFadeOn(4, gpal); #endif