//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);
{
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);
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))
{
{
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);
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))
{
{
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);
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))
{
{
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);
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))
{
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;
}
}
}
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 */
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]);