page.tilemidposscreeny = (page.th/2)+1;\r
page.stridew=page.width/4;\r
page.pagesize = (word)(page.width/4)*page.height;\r
+ page.pi=4;\r
page.id = 0;\r
\r
return page;\r
result.th = p->th;\r
result.tilesw = p->tilesw;\r
result.tilesh = p->tilesh;\r
- result.id = p->id+1;\r
result.stridew=p->stridew;\r
result.pagesize = p->pagesize;\r
+ result.pi=4;\r
+ result.id = p->id+1;\r
\r
return result;\r
}\r
result.id = p->id+1;\r
result.stridew=result.width/4;\r
result.pagesize = (word)(result.width/4)*result.height;\r
+ if(result.id==2) result.pi=p->width*p->pi;\r
+ else if(result.id==3) result.pi=p->pi;\r
\r
return result;\r
}\r
if(mv[0].video->page[id].dx >= mv[0].dxThresh )
{
/* Snap the origin forward */
- mv[0].video->page[id].data += 4;
+ mv[0].video->page[id].data += mv[0].video->page[id].pi;
mv[0].video->page[id].dx = mv[0].map->tiles->tileWidth;
}
}
if(mv[0].video->page[id].dx == 0)
{
/* Snap the origin backward */
- mv[0].video->page[id].data -= 4;
+ mv[0].video->page[id].data -= mv[0].video->page[id].pi;
mv[0].video->page[id].dx = mv[0].map->tiles->tileWidth;
}
}
if(mv[0].video->page[id].dy == 0)
{
/* Snap the origin backward */
- mv[0].video->page[id].data -= 1408;//4;
+ mv[0].video->page[id].data -= mv[0].video->page[id].pi;//4;
mv[0].video->page[id].dy = mv[0].map->tiles->tileWidth;
}
}
if(mv[0].video->page[id].dy >= mv[0].dxThresh )
{
/* Snap the origin forward */
- mv[0].video->page[id].data += 1408;//4;
+ mv[0].video->page[id].data += mv[0].video->page[id].pi;//4;
mv[0].video->page[id].dy = mv[0].map->tiles->tileWidth;
}
}
sword tileplayerposscreeny; /* player position on screen */\r
word stridew; /*width/4*/\r
word pagesize; /* page size */\r
+ word pi; /* incremention page by this much to preserve location */\r
} page_t;\r
\r
typedef struct\r