]> 4ch.mooo.com Git - 16.git/commitdiff
hmmm
authorsparky4 <sparky4@cock.li>
Mon, 13 Jun 2016 17:24:31 +0000 (12:24 -0500)
committersparky4 <sparky4@cock.li>
Mon, 13 Jun 2016 17:24:31 +0000 (12:24 -0500)
src/lib/modex16.c
src/lib/scroll16.c
src/lib/typdefst.h

index 271a84efd3cfec5743eb49ec6d42022563b84403..df9767bc713bfaaa82db7659c3706a7d6a7e1b8d 100755 (executable)
@@ -199,6 +199,7 @@ modexDefaultPage(page_t *p)
        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
@@ -222,9 +223,10 @@ modexNextPage(page_t *p) {
        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
@@ -249,6 +251,8 @@ modexNextPageFlexibleSize(page_t *p, word x, word y)
        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
index e2c6b9ad2aa95eedb1c0263a82177bc67eb5720f..a43591f6300c69b5a54c6aacfc269db676946528 100755 (executable)
@@ -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;
        }
 }
index 91ca7c79cba8da8bc4bd15dd0dd3e4072f19c240..7dbe38a1aa26426f561699dfbc43d5b46ca67ee0 100755 (executable)
@@ -84,6 +84,7 @@ typedef struct {
        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