From: sparky4 Date: Fri, 31 Jul 2015 03:06:50 +0000 (-0500) Subject: wtf!? X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=aba1d7da3056826854f3280cf8efb2f3520bebda;p=16.git wtf!? modified: scroll.exe modified: src/lib/scroll16.c modified: src/scroll.c --- diff --git a/scroll.exe b/scroll.exe index 40cf52c9..53216d30 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 4b9bf28f..fa0061de 100644 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -454,13 +454,13 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) break; case 1: //modexprintbig(page, x, y, 1, 15, 0, (t->debug_data)); - for(texty=0; texty<2; texty++) + /*for(texty=0; texty<2; texty++) { for(textx=0; textx<2; textx++) - { + {*/ modexprint(page, x+(textx*8), y+(texty*8), 1, (word)(t->debug_data), 0, (t->debug_data)); - } - } +/* } + }*/ break; } } @@ -580,46 +580,48 @@ void shinku(page_t *page, global_game_variables_t *gv) void animatePlayer(map_view_t *pip, player_t *player, word playnum, sword scrollswitch) { + sword x = player[playnum].x; + sword y = player[playnum].y; sword dire=32; //direction sword qq; //scroll offset word ls = player[playnum].persist_aniframe; if(scrollswitch==0) qq = 0; - else qq = ((player[playnum].persist_aniframe)*player[playnum].speed); + else qq = ((ls)*player[playnum].speed); switch (player[playnum].info.dir) { case 0: //up dire*=player[playnum].info.dir; - player[playnum].x=player[playnum].x-4; - player[playnum].y=player[playnum].y-qq-TILEWH; + x-=4; + y-=(qq-TILEWH); break; case 1: // right dire*=(player[playnum].info.dir-2); - player[playnum].x=player[playnum].x+qq-4; - player[playnum].y=player[playnum].y-TILEWH; + x+=qq-4; + y-=TILEWH; break; case 2: break; case 3: //down dire*=(player[playnum].info.dir-2); - player[playnum].x=player[playnum].x-4; - player[playnum].y=player[playnum].y+qq-TILEWH; + x-=4; + y+=(qq-TILEWH); break; case 4: //left dire*=(player[playnum].info.dir+2); - player[playnum].x=player[playnum].x-qq-4; - player[playnum].y=player[playnum].y-TILEWH; + x-=qq-4; + y-=TILEWH; break; } - modexCopyPageRegion(pip[1].page, pip[0].page, player[playnum].x-4, player[playnum].y-4, player[playnum].x-4, player[playnum].y-4, 28, 40); - if(2>ls && ls>=1) { modexDrawSpriteRegion(pip[1].page, player[playnum].x, player[playnum].y, 48, dire, 24, 32, &player[playnum].data); }else - if(3>ls && ls>=2) { modexDrawSpriteRegion(pip[1].page, player[playnum].x, player[playnum].y, 24, dire, 24, 32, &player[playnum].data); }else - if(4>ls && ls>=3) { modexDrawSpriteRegion(pip[1].page, player[playnum].x, player[playnum].y, 0, dire, 24, 32, &player[playnum].data); }else - if(5>ls && ls>=4) { modexDrawSpriteRegion(pip[1].page, player[playnum].x, player[playnum].y, 24, dire, 24, 32, &player[playnum].data); } + modexCopyPageRegion(pip[1].page, pip[0].page, x-4, y-4, x-4, y-4, 28, 40); + if(2>ls && ls>=1) { modexDrawSpriteRegion(pip[1].page, x, y, 48, dire, 24, 32, &player[playnum].data); }else + if(3>ls && ls>=2) { modexDrawSpriteRegion(pip[1].page, x, y, 24, dire, 24, 32, &player[playnum].data); }else + if(4>ls && ls>=3) { modexDrawSpriteRegion(pip[1].page, x, y, 0, dire, 24, 32, &player[playnum].data); }else + if(5>ls && ls>=4) { modexDrawSpriteRegion(pip[1].page, x, y, 24, dire, 24, 32, &player[playnum].data); } //TODO: mask copy //modexCopyPageRegion(dest->page, src->page, x-4, y-4, x-4, y-4, 28, 40); //modexClearRegion(top->page, 66, 66, 2, 40, 0); //modexCopyPageRegion(dest->page, top->page, 66, 66, 66, 66, 2, 40); diff --git a/src/scroll.c b/src/scroll.c index d5797593..6e6dc032 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -361,6 +361,7 @@ void main() printf("Screen: %dx", screen.width); printf("%d\n", screen.height); printf("Screen2: %dx", screen2.width); printf("%d\n", screen2.height); printf("map: %dx%d\n", map.width, map.height); + printf("player[0].info.dir: %u\n", player[0].info.dir); //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);