X-Git-Url: http://4ch.mooo.com/gitweb/?a=blobdiff_plain;f=src%2Fscroll.c;h=8279a20e10a17cb8ce9eb5a26641563a20d126a8;hb=312a36372b6826ad9c6296e17a2586d11355c6b3;hp=7c542a8db1d46a9978a6d8879f4c01a3d8dbea8a;hpb=4daf6ddbf0fc3981d5d4a29765bab1289cb36738;p=16.git diff --git a/src/scroll.c b/src/scroll.c index 7c542a8d..8279a20e 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -75,9 +75,9 @@ void animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */sword void main() { size_t oldfreemem=GetFreeSize(); - long emmhandle; + /*long emmhandle; long emsavail; - char teststr[80]; + char teststr[80];*/ word panswitch=0, panq=1, pand=0; //for panning! int i; static word paloffset=0; @@ -90,7 +90,8 @@ void main() { map_view_t mv, mv2, mv3; map_view_t *bg, *spri, *mask;//, *tmp; byte *dpal, *gpal; - byte *ptr, *mappalptr; + byte huge *ptr; + byte *mappalptr; actor_t player; //actor_t npc0; @@ -123,9 +124,9 @@ void main() { /* create the map */ //0000 printf("Total used @ before map load: %zu\n", oldfreemem-GetFreeSize()); - fprintf(stderr, "testing~\n"); +//0000 fprintf(stderr, "testing~\n"); loadmap("data/test.map", &map); - fprintf(stderr, "yay map loaded~~\n"); +//0000 fprintf(stderr, "yay map loaded~~\n"); //---- map = allocMap(map.width,map.height); //20x15 is the resolution of the screen you can make maps smaller than 20x15 but the null space needs to be drawn properly //if(isEMS()) printf("%d tesuto\n", coretotalEMS()); //---- initMap(&map); @@ -652,7 +653,8 @@ void main() { printf("temporary player sprite 0: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45556867\n"); printf("temporary player sprite 1: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44606385\n"); printf("Screen: %dx", screen.width); printf("%d\n", screen.height); - printf("Screen2: %dx", screen2.width); printf("%d\n", screen2.height); + printf("Screen2: %dx", screen2.width); printf("%d\n", screen2.height); + //printf("map.width=%d map.height=%d map.data[0]=%d\n", bg->map->width, bg->map->height, bg->map->data[0]); //xmsfree(&map); //xmsfree(bg); //xmsfree(spri); @@ -868,8 +870,8 @@ mapGoTo(map_view_t *mv, int tx, int ty) { /* draw the tiles */ modexClearRegion(mv->page, 0, 0, mv->page->width, mv->page->height, 0); - py=0; - i=mv->ty * mv->map->width + mv->tx; + py=0; + i=mv->ty * mv->map->width + mv->tx; for(ty=mv->ty-1; py < SCREEN_HEIGHT+mv->dyThresh && ty < mv->map->height; ty++, py+=mv->map->tiles->tileHeight) { mapDrawRow(mv, tx-1, ty, py); i+=mv->map->width - tx; @@ -890,7 +892,8 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) { else { rx = (((i-1) % ((t->data->width)/t->tileWidth)) * t->tileWidth); - ry = (((i-1) / ((t->data->height)/t->tileHeight)) * t->tileHeight); + ry = (((i-1) / ((t->data->height)/t->tileHeight)) * t->tileHeight); + printf("i=%d\n", i); //mxPutTile(t->data, x, y, t->tileWidth, t->tileHeight); modexDrawBmpRegion(page, x, y, rx, ry, t->tileWidth, t->tileHeight, (t->data)); } @@ -903,7 +906,7 @@ mapDrawRow(map_view_t *mv, int tx, int ty, word y) { int i; /* the position within the map array */ - i=ty * mv->map->width + tx; + i=ty * mv->map->width + tx; for(x=0; xdxThresh && tx < mv->map->width; x+=mv->map->tiles->tileWidth, tx++) { if(i>=0) { /* we are in the map, so copy! */