void mapDrawCol(map_view_t *mv, int tx, int ty, word x, word poopoffset);
void mapDrawWRow(map_view_t *mv, int tx, int ty, word y);
void mapDrawWCol(map_view_t *mv, int tx, int ty, word x);
-void animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp);
+void animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp);
#define TILEWH 16
#define QUADWH (TILEWH/4)
bitmap_t ptmp; // player sprite
word q=1;
const char *cpus;
- static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */
+ //static int persist_aniframe = 0; /* gonna be increased to 1 before being used, so 0 is ok for default */
page_t screen, screen2, screen3;
map_t map;
map_view_t mv, mv2, mv3;
/*data\\*/
ptmp = bitmapLoadPcx("ptmp.pcx"); // load sprite
setkb(1);
- modexEnter();
+ VGAmodeX(1, &gvar);
modexPalUpdate(ptmp.palette);
screen = modexDefaultPage();
screen.width += (TILEWH*2);
//to stop scrolling and have the player position data move to the edge of the screen with respect to the direction
//when player.tx or player.ty == 0 or player.tx == 20 or player.ty == 15 then stop because that is edge of map and you do not want to walk of the map
- #define INC_PER_FRAME if(q&1) persist_aniframe++; if(persist_aniframe>4) persist_aniframe = 1;
+ #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)
}
}
- modexLeave();
+ VGAmodeX(0, &gvar);
setkb(0);
printf("Project 16 scroll.exe\n");
printf("tx: %d\n", bg->tx);
if(mv->page->dx == 0) {
/* go backward one tile */
mv->tx--;
-
+
/* Snap the origin backward */
mv->page->data -= 4;
mv->page->dx = mv->map->tiles->tileWidth;
}
-void
+void
mapDrawRow(map_view_t *mv, int tx, int ty, word y, word poopoffset) {
word x;
int i;
}
-void
+void
mapDrawCol(map_view_t *mv, int tx, int ty, word x, word poopoffset) {
int y;
int i;
/* location in the map array */
i=ty * mv->map->width + tx;
- /* We'll copy all of the columns in the screen,
+ /* We'll copy all of the columns in the screen,
i + 1 row above and one below */
for(y=poopoffset; y<(SCREEN_HEIGHT+mv->dyThresh)/(poopoffset+1) && ty < mv->map->height; y+=mv->map->tiles->tileHeight, ty++) {
if(i>=0) {
}
}
-void
+void
mapDrawWRow(map_view_t *mv, int tx, int ty, word y) {
word x;
int i;
}
}
-void
+void
mapDrawWCol(map_view_t *mv, int tx, int ty, word x) {
int y;
int i;
/* location in the map array */
i=ty * mv->map->width + tx;
- /* We'll copy all of the columns in the screen,
+ /* We'll copy all of the columns in the screen,
i + 1 row above and one below */
for(y=0; y<SCREEN_HEIGHT+mv->dyThresh && ty < mv->map->height; y+=mv->map->tiles->tileHeight, ty++) {
if(i>=0) {
}
}
-void
-animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp)
+// animatePlayer(map_view_t *src, map_view_t *dest, 1, 1, player.x, player.y, persist_aniframe, q, &ptmp);
+// animatePlayer(bg, spri, 0, 1, player.x, player.y, persist_aniframe, q, &ptmp);
+// animatePlayer(bg, spri, 0, 0, player.x, player.y, persist_aniframe, q, &ptmp);
+// animatePlayer(map_view_t *src, map_view_t *dest, player_t *player, word playnum, sword scrolloffsetswitch, int ls, bitmap_t *bmp)
+void animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp)
{
short dire=32*d1; //direction
short qq; //scroll offset