wwww
Revision | 20f690b53a11b7aa09a8614b3d281c4014e0df22 (tree) |
---|---|
Time | 2016-06-07 00:15:47 |
Author | sparky4 <sparky4@cock...> |
Commiter | sparky4 |
====i made a quick and dirty fix to the video issue wwww====
@@ -40,6 +40,7 @@ void walk(map_view_t *pip, player_t *player, word pn) | ||
40 | 40 | { |
41 | 41 | INC_PER_FRAME; |
42 | 42 | animatePlayer(pip, player, pn, 1); |
43 | + pip[0].video->startclk = (*clockw); | |
43 | 44 | if(!pageflipflop) mapScrollRight(pip, player, !(pip[0].video->p), pn); else{ |
44 | 45 | mapScrollRight(pip, player, 0, pn); |
45 | 46 | mapScrollRight(pip, player, 1, pn); |
@@ -47,7 +48,7 @@ void walk(map_view_t *pip, player_t *player, word pn) | ||
47 | 48 | ScrollRight(pip, player, 3, pn); } |
48 | 49 | if(!pageflipflop) modexShowPage(pip[1].page); |
49 | 50 | player[pn].q++; |
50 | - } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; } | |
51 | + } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; pip[0].video->clk = (float)((*clockw)-pip[0].video->startclk)/18.2; } | |
51 | 52 | } |
52 | 53 | 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)) |
53 | 54 | { |
@@ -84,6 +85,7 @@ void walk(map_view_t *pip, player_t *player, word pn) | ||
84 | 85 | { |
85 | 86 | INC_PER_FRAME; |
86 | 87 | animatePlayer(pip, player, pn, 1); |
88 | + pip[0].video->startclk = (*clockw); | |
87 | 89 | if(!pageflipflop) mapScrollLeft(pip, player, !(pip[0].video->p), pn); else{ |
88 | 90 | mapScrollLeft(pip, player, 0, pn); |
89 | 91 | mapScrollLeft(pip, player, 1, pn); |
@@ -91,7 +93,7 @@ void walk(map_view_t *pip, player_t *player, word pn) | ||
91 | 93 | ScrollLeft(pip, player, 3, pn); } |
92 | 94 | if(!pageflipflop) modexShowPage(pip[1].page); |
93 | 95 | player[pn].q++; |
94 | - } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; } | |
96 | + } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; pip[0].video->clk = (float)((*clockw)-pip[0].video->startclk)/18.2; } | |
95 | 97 | } |
96 | 98 | 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)) |
97 | 99 | { |
@@ -128,6 +130,7 @@ void walk(map_view_t *pip, player_t *player, word pn) | ||
128 | 130 | { |
129 | 131 | INC_PER_FRAME; |
130 | 132 | animatePlayer(pip, player, pn, 1); |
133 | + pip[0].video->startclk = (*clockw); | |
131 | 134 | if(!pageflipflop) mapScrollDown(pip, player, !(pip[0].video->p), pn); else{ |
132 | 135 | mapScrollDown(pip, player, 0, pn); |
133 | 136 | mapScrollDown(pip, player, 1, pn); |
@@ -135,7 +138,7 @@ void walk(map_view_t *pip, player_t *player, word pn) | ||
135 | 138 | ScrollDown(pip, player, 3, pn); } |
136 | 139 | if(!pageflipflop) modexShowPage(pip[1].page); |
137 | 140 | player[pn].q++; |
138 | - } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; } | |
141 | + } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; pip[0].video->clk = (float)((*clockw)-pip[0].video->startclk)/18.2; } | |
139 | 142 | } |
140 | 143 | 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)) |
141 | 144 | { |
@@ -172,6 +175,7 @@ void walk(map_view_t *pip, player_t *player, word pn) | ||
172 | 175 | { |
173 | 176 | INC_PER_FRAME; |
174 | 177 | animatePlayer(pip, player, pn, 1); |
178 | + pip[0].video->startclk = (*clockw); | |
175 | 179 | if(!pageflipflop) mapScrollUp(pip, player, !(pip[0].video->p), pn); else{ |
176 | 180 | mapScrollUp(pip, player, 0, pn); |
177 | 181 | mapScrollUp(pip, player, 1, pn); |
@@ -179,7 +183,7 @@ void walk(map_view_t *pip, player_t *player, word pn) | ||
179 | 183 | ScrollUp(pip, player, 3, pn); } |
180 | 184 | if(!pageflipflop) modexShowPage(pip[1].page); |
181 | 185 | player[pn].q++; |
182 | - } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; } | |
186 | + } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; pip[0].video->clk = (float)((*clockw)-pip[0].video->startclk)/18.2; } | |
183 | 187 | } |
184 | 188 | 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)) |
185 | 189 | { |
@@ -775,8 +779,8 @@ void shinku(global_game_variables_t *gv) | ||
775 | 779 | break; |
776 | 780 | case 1: |
777 | 781 | //turn this off if XT |
778 | - modexWaitBorder(); | |
779 | - //vga_wait_for_vsync(); | |
782 | + //modexWaitBorder(); | |
783 | + vga_wait_for_vsync(); | |
780 | 784 | gv->kurokku.frames_per_second=60; |
781 | 785 | break; |
782 | 786 | } |
@@ -117,6 +117,7 @@ typedef struct | ||
117 | 117 | boolean __near p; //render page number |
118 | 118 | boolean __near r; //page flip if true |
119 | 119 | word pr[MAXPAGE][4]; //render sections of pages |
120 | + word startclk; float clk; //timer | |
120 | 121 | } video_t; |
121 | 122 | |
122 | 123 | typedef struct |
@@ -322,7 +322,8 @@ void main(int argc, char *argv[]) | ||
322 | 322 | printf("middle tile position: %dx", gvar.video.page[0].tilemidposscreenx); printf("%d\n", gvar.video.page[0].tilemidposscreeny); |
323 | 323 | modexprintmeminfo(&gvar.video); |
324 | 324 | 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); |
325 | - //printf("player[1].q: %d", player[1].q); printf(" player[1].d: %d\n", player[1].d); | |
325 | + printf("\ngvar.video.startclk=%u ", gvar.video.startclk); | |
326 | + printf("gvar.video.clk=%f\n", (float)((*clockw)-gvar.video.startclk)/18.2); | |
326 | 327 | printf("\n"); |
327 | 328 | //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]); |
328 | 329 |