#define INC_PER_FRAME if(q&1) persist_aniframe++; if(persist_aniframe>4) persist_aniframe = 1;
- //temp testing
- /*if(bg->tx >= 0 && bg->tx+20 < MAPX && player.tx == bg->tx + 10)
- {
- for(q=1; q<=(TILEWH/SPEED); q++)
- {
- //INC_PER_FRAME;
- //animatePlayer(bg, spri, mask, 1, 1, player.x, player.y, persist_aniframe, q, &ptmp);
- //animatePlayer(bg, spri, 1, 1, player.x, player.y, persist_aniframe, q, &ptmp);
- mapScrollRight(bg, SPEED);
- //mapScrollRight(spri, SPEED);
- //mapScrollRight(mask, SPEED);
- modexShowPage(bg->page);
- }
- player.tx++;
- }
- else if(player.tx < MAPX)
- {
- for(q=1; q<=(TILEWH/SPEED); q++)
- {
- INC_PER_FRAME;
- player.x+=SPEED;
- //animatePlayer(bg, spri, mask, 1, 0, player.x, player.y, persist_aniframe, q, &ptmp);
- animatePlayer(bg, spri, 1, 0, player.x, player.y, persist_aniframe, q, &ptmp);
- modexShowPage(spri->page);
- }
- player.tx++;
- }
- else
- {
-break;
- }*/
if(keyp(77) && !keyp(75))
{
if(bg->tx >= 0 && bg->tx+20 < MAPX && player.tx == bg->tx + 10 && !(player.tx+1 == TRIGGX && player.ty == TRIGGY))
printf("player.ty: %d\n", player.ty);
printf("player.triggx: %d\n", player.triggerx);
printf("player.triggy: %d\n", player.triggery);
- printf("dxThresh: %d\n", bg->dxThresh);
- printf("dyThresh: %d\n", bg->dyThresh);
printf("temporary player sprite 0: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=45556867\n");
printf("temporary player sprite 1: http://www.pixiv.net/member_illust.php?mode=medium&illust_id=44606385\n");
printf("\n");
/* Snap the origin forward */
mv->page->data += 4;
mv->page->dx = mv->map->tiles->tileWidth;
-
+ //}
/* draw the next column */
x= SCREEN_WIDTH + mv->map->tiles->tileWidth;
/* Snap the origin backward */
mv->page->data -= 4;
mv->page->dx = mv->map->tiles->tileWidth;
-
+ //}
/* draw the next column */
mapDrawCol(mv, mv->tx-1, mv->ty-1, 0);
}
/* Snap the origin downward */
mv->page->data -= mv->page->width*4;
mv->page->dy = mv->map->tiles->tileHeight;
-
+ //}
/* draw the next row */
y= 0;
/* Snap the origin downward */
mv->page->data += mv->page->width*4;
mv->page->dy = mv->map->tiles->tileHeight;
-
+ //}
/* draw the next row */
y= SCREEN_HEIGHT + mv->map->tiles->tileHeight;
}
}
-
void
mapDrawCol(map_view_t *mv, int tx, int ty, word x) {
int y;