]> 4ch.mooo.com Git - 16.git/commitdiff
wtf!?
authorsparky4 <sparky4@cock.li>
Fri, 31 Jul 2015 03:06:50 +0000 (22:06 -0500)
committersparky4 <sparky4@cock.li>
Fri, 31 Jul 2015 03:06:50 +0000 (22:06 -0500)
modified:   scroll.exe
modified:   src/lib/scroll16.c
modified:   src/scroll.c

scroll.exe
src/lib/scroll16.c
src/scroll.c

index 40cf52c9edd3d0ffb6cbd03eff7a218e89689537..53216d30215f46dde7754304c623838fec5e9855 100644 (file)
Binary files a/scroll.exe and b/scroll.exe differ
index 4b9bf28f24d3e4454a44b7683c670143cd77e2ed..fa0061dec7ca1f4145a002cde84e9b90592982dd 100644 (file)
@@ -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);
index d5797593284fddd47e63614c0214c0aa8077ab32..6e6dc03231738c132dc66a1b7c2900793e4c8760 100644 (file)
@@ -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);