]> 4ch.mooo.com Git - 16.git/commitdiff
I THINK I GOT THE ANIMATION FIXED AGAINrm data/spri/chikyuu.vrs
authorsparky4 <sparky4@cock.li>
Tue, 24 Jan 2017 20:06:22 +0000 (14:06 -0600)
committersparky4 <sparky4@cock.li>
Tue, 24 Jan 2017 20:06:22 +0000 (14:06 -0600)
data/spri/chikyuu.sht
data/spri/chikyuu.vrs
src/lib/16_enti.c
src/lib/16_sprit.c
src/lib/scroll16.c

index 67687225642e43a3d748900e2e9c2d42b8d76eb9..701617a2049d2a2bc69f517b1747b0b6047b247b 100755 (executable)
@@ -81,17 +81,17 @@ sprite=CHUBFCW1
 
 +CHUBFCW_WALKING@11
 sprite=CHUBFCW0
-delay=2
+delay=3
 -newframe
 sprite=CHUBFCW1
-delay=2
+delay=3
 event=@100         # in this example, signal the game engine the frame is one that can immediately transition to "standing"
 -newframe
 sprite=CHUBFCW2
-delay=2
+delay=3
 -newframe
 sprite=CHUBFCW1
-delay=2
+delay=3
 event=@100         # in this example, signal the game engine the frame is one that can immediately transition to "standing"
 
 # Chikyuu, left, standing and walking animation cycles
@@ -100,17 +100,17 @@ sprite=CHUBLCW1
 
 +CHUBLCW_WALKING@21
 sprite=CHUBLCW0
-delay=2
+delay=3
 -newframe
 sprite=CHUBLCW1
-delay=2
+delay=3
 event=@100         # in this example, signal the game engine the frame is one that can immediately transition to "standing"
 -newframe
 sprite=CHUBLCW2
-delay=2
+delay=3
 -newframe
 sprite=CHUBLCW1
-delay=2
+delay=3
 event=@100         # in this example, signal the game engine the frame is one that can immediately transition to "standing"
 
 # Chikyuu, right, standing and walking animation cycles
@@ -119,17 +119,17 @@ sprite=CHUBRCW1
 
 +CHUBRCW_WALKING@31
 sprite=CHUBRCW0
-delay=2
+delay=3
 -newframe
 sprite=CHUBRCW1
-delay=2
+delay=3
 event=@100         # in this example, signal the game engine the frame is one that can immediately transition to "standing"
 -newframe
 sprite=CHUBRCW2
-delay=2
+delay=3
 -newframe
 sprite=CHUBRCW1
-delay=2
+delay=3
 event=@100         # in this example, signal the game engine the frame is one that can immediately transition to "standing"
 
 # Chikyuu, away, standing and walking animation cycles
@@ -138,16 +138,16 @@ sprite=CHUBACW1
 
 +CHUBACW_WALKING@41
 sprite=CHUBACW0
-delay=2
+delay=3
 -newframe
 sprite=CHUBACW1
-delay=2
+delay=3
 event=@100         # in this example, signal the game engine the frame is one that can immediately transition to "standing"
 -newframe
 sprite=CHUBACW2
-delay=2
+delay=3
 -newframe
 sprite=CHUBACW1
-delay=2
+delay=3
 event=@100         # in this example, signal the game engine the frame is one that can immediately transition to "standing"
 
index bff3a82409a327c2753fc91bbf6bd2d01d7a9dea..abcaf75b4785eb26163ce3eb5b68b5b1e1ecad1f 100755 (executable)
Binary files a/data/spri/chikyuu.vrs and b/data/spri/chikyuu.vrs differ
index 088701d780637eeb7bb57c26ddf8070afd983983..96be5fde4bbc60f973d619f1a89dbc7bb39b0bc4 100755 (executable)
@@ -35,7 +35,7 @@ void EN_initentity(entity_t *enti)
        enti->speed=4;\r
        enti->persist_aniframe= enti->q;\r
        enti->spt=(TILEWH/(enti->speed));       //speed per tile wwww\r
-       enti->spri->delay=1;\r
+       //enti->spri->delay=1;\r
        enti->invq=1;\r
        enti->pred = enti->d;\r
 }\r
index 311a3dd73a5f60954a35f3ddf378e1a02e174539..0be43073a11528728aeaf7fb1ee606b0e45f9865 100755 (executable)
@@ -107,6 +107,41 @@ void animate_spri(entity_t *enti, video_t *video)
                                                // if the sprite's edge pixels are clear anyway, you can set this to 0.\r
        VGA_RAM_PTR omemptr;\r
 \r
+       // Depending on delay, update indices\r
+//#define FRAME1 modexDrawSpriteRegion(pip[(pip->video->p)].page, x, y, 48, player[pn].enti.dire, 24, 32,      PLAYERBMPDATAPTR);\r
+//#define FRAME2 modexDrawSpriteRegion(pip[(pip->video->p)].page, x, y, 24, player[pn].enti.dire, 24, 32,      PLAYERBMPDATAPTR); stand\r
+//#define FRAME3 modexDrawSpriteRegion(pip[(pip->video->p)].page, x, y, 0, player[pn].enti.dire, 24, 32,       PLAYERBMPDATAPTR);\r
+//#define FRAME4 modexDrawSpriteRegion(pip[(pip->video->p)].page, x, y, 24, player[pn].enti.dire, 24, 32,      PLAYERBMPDATAPTR); stand\r
+       switch(enti->spri->delay)\r
+{\r
+               // Delay = 0 means that sprite should loop. Nothing to change here\r
+               case 0:\r
+               break;\r
+\r
+               // Delay = 1 means that on next time unit sprite should be changed\r
+               case 1:\r
+                       if(enti->invq)  enti->spri->curr_anim_spri++;\r
+                       else                    enti->spri->curr_anim_spri--;\r
+//printf("1[%u]        %u", enti->invq, enti->spri->curr_anim_spri);\r
+                       // If we hit the end of an animation sequence, restart it\r
+                       if(!(   enti->spri->curr_spri_id = enti->spri->curr_anim_list[enti->spri->curr_anim_spri].sprite_id)){\r
+                               //enti->spri->curr_anim_spri = 1;\r
+                               enti->invq=!enti->invq;\r
+                               if(enti->invq)                          enti->spri->curr_anim_spri+=2;\r
+                               else if(enti->spri->curr_anim_spri)     enti->spri->curr_anim_spri-=2;\r
+                               enti->spri->curr_spri_id = enti->spri->curr_anim_list[enti->spri->curr_anim_spri].sprite_id;\r
+//printf("     enti->spri->curr_anim_spri=%u   ", enti->spri->curr_anim_spri);\r
+                       }\r
+                       enti->spri->delay = enti->spri->curr_anim_list[enti->spri->curr_anim_spri].delay;\r
+//printf("\n");\r
+//break;\r
+               // Delay > 1 means that we should not change sprite yet. Decrease delay\r
+               default:\r
+//printf("2[%u]        %u\n", enti->invq, enti->spri->curr_anim_spri);\r
+                       enti->spri->delay--;\r
+               break;\r
+       }\r
+\r
        // Events go here\r
 \r
 \r
@@ -176,34 +211,5 @@ void animate_spri(entity_t *enti, video_t *video)
        // restore stride\r
        vga_state.vga_draw_stride_limit = vga_state.vga_draw_stride = GVARVIDEO->page[0].stridew;\r
 \r
-       // Depending on delay, update indices\r
-//#define FRAME1 modexDrawSpriteRegion(pip[(pip->video->p)].page, x, y, 48, player[pn].enti.dire, 24, 32,      PLAYERBMPDATAPTR);\r
-//#define FRAME2 modexDrawSpriteRegion(pip[(pip->video->p)].page, x, y, 24, player[pn].enti.dire, 24, 32,      PLAYERBMPDATAPTR); stand\r
-//#define FRAME3 modexDrawSpriteRegion(pip[(pip->video->p)].page, x, y, 0, player[pn].enti.dire, 24, 32,       PLAYERBMPDATAPTR);\r
-//#define FRAME4 modexDrawSpriteRegion(pip[(pip->video->p)].page, x, y, 24, player[pn].enti.dire, 24, 32,      PLAYERBMPDATAPTR); stand\r
-       switch(enti->spri->delay)\r
-{\r
-               // Delay = 0 means that sprite should loop. Nothing to change here\r
-               case 0:\r
-               break;\r
-\r
-               // Delay = 1 means that on next time unit sprite should be changed\r
-               case 1:\r
-                       if(enti->invq)  enti->spri->curr_anim_spri++;\r
-                       else                    enti->spri->curr_anim_spri--;\r
-\r
-                       // If we hit the end of an animation sequence, restart it\r
-                       if(!(   enti->spri->curr_spri_id = enti->spri->curr_anim_list[enti->spri->curr_anim_spri].sprite_id)){\r
-                               enti->spri->curr_anim_spri = 1;\r
-                               enti->spri->curr_spri_id = enti->spri->curr_anim_list[enti->spri->curr_anim_spri].sprite_id;\r
-                               enti->invq=!enti->invq;\r
-                       }\r
-                       enti->spri->delay = enti->spri->curr_anim_list[enti->spri->curr_anim_spri].delay;\r
-\r
-               // Delay > 1 means that we should not change sprite yet. Decrease delay\r
-               default:\r
-                       enti->spri->delay--;\r
-               break;\r
-       }\r
        vga_state.vga_graphics_ram = video->omemptr;\r
 }\r
index 6d0dd00381bd57a23c87a77ce59a0d627347161d..2d9de4f97622c50ccfddbba95de926e877b199c0 100755 (executable)
@@ -1267,7 +1267,6 @@ void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scr
                break;\r
        }\r
        player[pn].enti.dire+=dd;\r
-\r
        if((player[pn].enti.q==1 && player[pn].enti.pred != player[pn].enti.d) || !dd)\r
        {\r
                set_anim_by_id(player[pn].enti.spri, player[pn].enti.dire); //pip->video->sprifilei = set_anim_by_id(player[pn].enti.spri, player[pn].enti.dire);       if(pip->video->sprifilei == -1){ printf("ERROR! %u\n", player[pn].enti.dire); return; }\r
@@ -1280,7 +1279,7 @@ void near ZC_animatePlayer(map_view_t *pip, player_t *player, word pn, sword scr
 \r
        //draw sprite\r
        ZC_drawframe(pip, &player[pn].enti, x, y);\r
-\r
+//if(player[pn].enti.q<4) delay(500);\r
        pip->video->r=1;\r
        //WALKTYPE_FRAM_PRINT;\r
 }\r