]> 4ch.mooo.com Git - 16.git/commitdiff
====i made a quick and dirty fix to the video issue wwww====
authorsparky4 <sparky4@cock.li>
Mon, 6 Jun 2016 16:04:56 +0000 (11:04 -0500)
committersparky4 <sparky4@cock.li>
Mon, 6 Jun 2016 16:04:56 +0000 (11:04 -0500)
src/lib/scroll16.c
src/lib/typdefst.h
src/scroll.c

index f092a3cb931951453884622c59430115046527b1..d00a504dfaf9dfe52083ed46c640aea73a01c68e 100755 (executable)
@@ -30,6 +30,10 @@ void walk(map_view_t *pip, player_t *player, word pn)
        //printf("player[%d].d=%d\n", pn, player[pn].d);
        switch(player[pn].d)
        {
+               //no direction
+               case 2:
+                       pip[0].video->startclk = (*clockw);
+               break;
                //right movement
                case 3:
                        //printf("pip[0].page->tilesw=%d        ", pip[0].page->tilesw); printf("pip[0].page->tw=%d\n", pip[0].page->tw);
@@ -40,7 +44,6 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                {
                                        INC_PER_FRAME;
                                        animatePlayer(pip, player, pn, 1);
-                                       pip[0].video->startclk = (*clockw);
                                        if(!pageflipflop) mapScrollRight(pip, player, !(pip[0].video->p), pn); else{
                                        mapScrollRight(pip, player, 0, pn);
                                        mapScrollRight(pip, player, 1, pn);
@@ -48,7 +51,8 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                        ScrollRight(pip, player, 3, pn); }
                                        if(!pageflipflop) modexShowPage(pip[1].page);
                                        player[pn].q++;
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; pip[0].video->clk = (float)((*clockw)-pip[0].video->startclk)/18.2; }
+                                       pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;
+                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; }
                        }
                        else if(player[pn].tx < pip[0].map->width && !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY))
                        {
@@ -85,7 +89,6 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                {
                                        INC_PER_FRAME;
                                        animatePlayer(pip, player, pn, 1);
-                                       pip[0].video->startclk = (*clockw);
                                        if(!pageflipflop) mapScrollLeft(pip, player, !(pip[0].video->p), pn); else{
                                        mapScrollLeft(pip, player, 0, pn);
                                        mapScrollLeft(pip, player, 1, pn);
@@ -93,7 +96,8 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                        ScrollLeft(pip, player, 3, pn); }
                                        if(!pageflipflop) modexShowPage(pip[1].page);
                                        player[pn].q++;
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; pip[0].video->clk = (float)((*clockw)-pip[0].video->startclk)/18.2; }
+                                       pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;
+                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; }
                        }
                        else if(player[pn].tx > 1 && !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY))
                        {
@@ -130,7 +134,6 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                {
                                        INC_PER_FRAME;
                                        animatePlayer(pip, player, pn, 1);
-                                       pip[0].video->startclk = (*clockw);
                                        if(!pageflipflop) mapScrollDown(pip, player, !(pip[0].video->p), pn); else{
                                        mapScrollDown(pip, player, 0, pn);
                                        mapScrollDown(pip, player, 1, pn);
@@ -138,7 +141,8 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                        ScrollDown(pip, player, 3, pn); }
                                        if(!pageflipflop) modexShowPage(pip[1].page);
                                        player[pn].q++;
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; pip[0].video->clk = (float)((*clockw)-pip[0].video->startclk)/18.2; }
+                                       pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;
+                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; }
                        }
                        else if(player[pn].ty < pip[0].map->height && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY))
                        {
@@ -175,7 +179,6 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                {
                                        INC_PER_FRAME;
                                        animatePlayer(pip, player, pn, 1);
-                                       pip[0].video->startclk = (*clockw);
                                        if(!pageflipflop) mapScrollUp(pip, player, !(pip[0].video->p), pn); else{
                                        mapScrollUp(pip, player, 0, pn);
                                        mapScrollUp(pip, player, 1, pn);
@@ -183,7 +186,8 @@ void walk(map_view_t *pip, player_t *player, word pn)
                                        ScrollUp(pip, player, 3, pn); }
                                        if(!pageflipflop) modexShowPage(pip[1].page);
                                        player[pn].q++;
-                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; pip[0].video->clk = (float)((*clockw)-pip[0].video->startclk)/18.2; }
+                                       pip[0].video->clk = ((*clockw)-pip[0].video->startclk)/18.2;
+                               } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; }
                        }
                        else if(player[pn].ty > 1 && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX &&  player[pn].ty-1 == TRIGGY))
                        {
@@ -790,6 +794,7 @@ void shinku(global_game_variables_t *gv)
                modexShowPage(&(gv->video.page[gv->video.p])); //this is slow as fack too!!
                gv->video.p=!gv->video.p;
                gv->video.r=!gv->video.r;
+               gv->video.tickclk = ((*clockw)-gv->video.startclk)/18.2;
        }
        }
 }
index 25e2a0a8090bd7e8c1e60f3a7cd5c7deaba17ba1..91ca7c79cba8da8bc4bd15dd0dd3e4072f19c240 100755 (executable)
@@ -117,7 +117,7 @@ typedef struct
        boolean __near p;                       //render page number\r
        boolean __near r;                       //page flip if true\r
        word pr[MAXPAGE][4];    //render sections of pages\r
-       word startclk; float clk;               //timer\r
+       word startclk; float clk, tickclk;      //timer\r
 } video_t;\r
 \r
 typedef struct\r
index 28b2fb886a22762c76a889c1bf9c31ab4d86a169..2bf2f972c8c1db231ebf82ac3f2e371e41a00112 100755 (executable)
@@ -42,7 +42,7 @@ sword bakapee;
 pan_t pan;
 //debugswitches
 boolean panswitch=0;
-boolean pageflipflop=1;
+pageflipflop=1;
        unsigned int i;
        const char *cpus;
        //static int persist_aniframe = 0;    /* gonna be increased to 1 before being used, so 0 is ok for default */
@@ -322,8 +322,8 @@ void main(int argc, char *argv[])
        printf("middle tile position: %dx", gvar.video.page[0].tilemidposscreenx);      printf("%d\n", gvar.video.page[0].tilemidposscreeny);
        modexprintmeminfo(&gvar.video);
        printf("mv[%u].tx: %d", pan.pn, mv[pan.pn].tx); printf("        mv[%u].ty: %d   ", pan.pn, mv[pan.pn].ty); printf("gvar.video.p=%u\n", gvar.video.p);
-       printf("\ngvar.video.startclk=%u        ", gvar.video.startclk);
-       printf("gvar.video.clk=%f\n", (float)((*clockw)-gvar.video.startclk)/18.2);
+       printf("\ngvar.video.tickclk=%f\n", gvar.video.tickclk);
+       printf("gvar.video.clk=%f", gvar.video.clk);
        printf("\n");
        //printf("map.width=%d  map.height=%d   map.data[0]=%d\n", mv[0].map->width, mv[0].map->height, mv[0].map->data[0]);