From 53b9fa75c899af4149258ec0cf09fc5dd736624d Mon Sep 17 00:00:00 2001 From: sparky4 Date: Mon, 6 Jun 2016 11:04:56 -0500 Subject: [PATCH] ====i made a quick and dirty fix to the video issue wwww==== --- src/lib/scroll16.c | 21 +++++++++++++-------- src/lib/typdefst.h | 2 +- src/scroll.c | 6 +++--- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index f092a3cb..d00a504d 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -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; } } } diff --git a/src/lib/typdefst.h b/src/lib/typdefst.h index 25e2a0a8..91ca7c79 100755 --- a/src/lib/typdefst.h +++ b/src/lib/typdefst.h @@ -117,7 +117,7 @@ typedef struct boolean __near p; //render page number boolean __near r; //page flip if true word pr[MAXPAGE][4]; //render sections of pages - word startclk; float clk; //timer + word startclk; float clk, tickclk; //timer } video_t; typedef struct diff --git a/src/scroll.c b/src/scroll.c index 28b2fb88..2bf2f972 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -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]); -- 2.39.5