From: sparky4 Date: Fri, 21 Nov 2014 02:07:32 +0000 (-0600) Subject: modified: 16/modex16/pcxtest.exe X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=d9c2c14be60cdbde56500d65bdc9d20374d8e1ea;p=16.git modified: 16/modex16/pcxtest.exe modified: 16/modex16/scroll.c modified: 16/modex16/scroll.exe modified: 16/modex16/test.exe modified: 16/modex16/test2.exe added player struct about to do some serious stuff --- diff --git a/16/modex16/pcxtest.exe b/16/modex16/pcxtest.exe index 20910efc..de765ece 100644 Binary files a/16/modex16/pcxtest.exe and b/16/modex16/pcxtest.exe differ diff --git a/16/modex16/scroll.c b/16/modex16/scroll.c index b7a3846c..602a63be 100644 --- a/16/modex16/scroll.c +++ b/16/modex16/scroll.c @@ -31,7 +31,10 @@ typedef struct { word dyThresh; } map_view_t; - +struct { + int tilex; + int tiley; +} player; map_t allocMap(int w, int h); @@ -44,7 +47,9 @@ void mapGoTo(map_view_t *mv, int tx, int ty); void mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y); void mapDrawRow(map_view_t *mv, int tx, int ty, word y); void mapDrawCol(map_view_t *mv, int tx, int ty, word x); - + +#define TILEWH 16 +#define QUADWH (TILEWH/4) #define SWAP(a, b) tmp=a; a=b; b=tmp; void main() { int show1=1; @@ -57,8 +62,10 @@ void main() { map_t map; map_view_t mv, mv2; map_view_t *draw, *show, *tmp; - byte *ptr; - + byte *ptr; + //default player position on the viewable map + player.tilex = 10; + player.tiley = 8; setkb(1); /* create the map */ @@ -85,42 +92,43 @@ void main() { while(!keyp(1)) { if(keyp(77)){ - for(q=0; q<16; q++) { +// for(q=0; qpage); +// modexShowPage(draw->page); // mapScrollRight(draw, 1); // SWAP(draw, show); - } +// } } if(keyp(75)){ - for(q=0; q<16; q++) { +// for(q=0; qpage); +// modexShowPage(draw->page); // mapScrollLeft(show, 1); // SWAP(draw, show); - } +// } } if(keyp(80)){ - for(q=0; q<16; q++) { +// for(q=0; qpage); +// modexShowPage(draw->page); // mapScrollDown(show, 1); // SWAP(draw, show); - } +// } } if(keyp(72)){ - for(q=0; q<16; q++) { +// for(q=0; qpage); +// modexShowPage(draw->page); // mapScrollUp(show, 1); // SWAP(draw, show); - } +// } } - //keyp(ch); + //keyp(ch); + modexShowPage(draw->page); } @@ -151,18 +159,18 @@ initMap(map_t *map) { /* create the tile set */ map->tiles->data = malloc(sizeof(bitmap_t)); - map->tiles->data->width = 32; - map->tiles->data->height= 16; - map->tiles->data->data = malloc(32*16); - map->tiles->tileHeight = 16; - map->tiles->tileWidth = 16; + map->tiles->data->width = (TILEWH*2); + map->tiles->data->height= TILEWH; + map->tiles->data->data = malloc((TILEWH*2)*TILEWH); + map->tiles->tileHeight = TILEWH; + map->tiles->tileWidth =TILEWH; map->tiles->rows = 1; map->tiles->cols = 2; i=0; - for(y=0; y<16; y++) { - for(x=0; x<32; x++) { - if(x<16) + for(y=0; ytiles->data->data[i] = 0x24; else map->tiles->data->data[i] = 0x34; diff --git a/16/modex16/scroll.exe b/16/modex16/scroll.exe index 46167a51..c67f9137 100755 Binary files a/16/modex16/scroll.exe and b/16/modex16/scroll.exe differ diff --git a/16/modex16/test.exe b/16/modex16/test.exe index 63a3da16..99404b1a 100644 Binary files a/16/modex16/test.exe and b/16/modex16/test.exe differ diff --git a/16/modex16/test2.exe b/16/modex16/test2.exe index d0b6755c..2b870eff 100644 Binary files a/16/modex16/test2.exe and b/16/modex16/test2.exe differ