From a99a0f403c236dab866e00a81a1a2062417d0eff Mon Sep 17 00:00:00 2001 From: sparky4 Date: Mon, 13 Jun 2016 12:24:31 -0500 Subject: [PATCH] hmmm --- src/lib/modex16.c | 6 +++++- src/lib/scroll16.c | 8 ++++---- src/lib/typdefst.h | 1 + 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/lib/modex16.c b/src/lib/modex16.c index 271a84ef..df9767bc 100755 --- a/src/lib/modex16.c +++ b/src/lib/modex16.c @@ -199,6 +199,7 @@ modexDefaultPage(page_t *p) page.tilemidposscreeny = (page.th/2)+1; page.stridew=page.width/4; page.pagesize = (word)(page.width/4)*page.height; + page.pi=4; page.id = 0; return page; @@ -222,9 +223,10 @@ modexNextPage(page_t *p) { result.th = p->th; result.tilesw = p->tilesw; result.tilesh = p->tilesh; - result.id = p->id+1; result.stridew=p->stridew; result.pagesize = p->pagesize; + result.pi=4; + result.id = p->id+1; return result; } @@ -249,6 +251,8 @@ modexNextPageFlexibleSize(page_t *p, word x, word y) result.id = p->id+1; result.stridew=result.width/4; result.pagesize = (word)(result.width/4)*result.height; + if(result.id==2) result.pi=p->width*p->pi; + else if(result.id==3) result.pi=p->pi; return result; } diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index e2c6b9ad..a43591f6 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -486,7 +486,7 @@ void near ScrollRight(map_view_t *mv, player_t *player, word id, word plid) 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; } } @@ -501,7 +501,7 @@ void near ScrollLeft(map_view_t *mv, player_t *player, word id, word plid) 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; } } @@ -515,7 +515,7 @@ void near ScrollUp(map_view_t *mv, player_t *player, word id, word plid) 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; } } @@ -529,7 +529,7 @@ void near ScrollDown(map_view_t *mv, player_t *player, word id, word plid) 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; } } diff --git a/src/lib/typdefst.h b/src/lib/typdefst.h index 91ca7c79..7dbe38a1 100755 --- a/src/lib/typdefst.h +++ b/src/lib/typdefst.h @@ -84,6 +84,7 @@ typedef struct { sword tileplayerposscreeny; /* player position on screen */ word stridew; /*width/4*/ word pagesize; /* page size */ + word pi; /* incremention page by this much to preserve location */ } page_t; typedef struct -- 2.39.5