]> 4ch.mooo.com Git - 16.git/commitdiff
optimized scrolling ww
authorsparky4 <sparky4@cock.li>
Sat, 18 Jun 2016 16:34:49 +0000 (11:34 -0500)
committersparky4 <sparky4@cock.li>
Sat, 18 Jun 2016 16:34:49 +0000 (11:34 -0500)
src/lib/scroll16.c
src/scroll.c

index bc785aa6f77da48e7c388bed075bb7b54d6ee614..735b76fc1950d69274828bc43691db087f5fafcc 100755 (executable)
@@ -843,10 +843,10 @@ void shinku(global_game_variables_t *gv)
        }
        if(pageflipflop){
        if(gv->video.r){
-               vga_setup_wm1_block_copy();
-               _fmemcpy((gv->video.page[(gv->video.p)]).data, (gv->video.page[(!gv->video.p)]).data, gv->video.page[(!gv->video.p)].pagesize);
-               vga_restore_rm0wm0();
-               //modexCopyPageRegion(&(gv->video.page[(gv->video.p)]), &(gv->video.page[(!gv->video.p)]), 0, 0, 0, 0, gv->video.page[gv->video.p].width, gv->video.page[!gv->video.p].height);
+               //vga_setup_wm1_block_copy();
+               //_fmemcpy((gv->video.page[(gv->video.p)]).data, (gv->video.page[(!gv->video.p)]).data, gv->video.page[(!gv->video.p)].pagesize);
+               //vga_restore_rm0wm0();
+               modexCopyPageRegion(&(gv->video.page[(gv->video.p)]), &(gv->video.page[(!gv->video.p)]), 0, 0, 0, 0, gv->video.page[gv->video.p].width, gv->video.page[!gv->video.p].height);
                modexShowPage(&(gv->video.page[gv->video.p]));
                gv->video.p=!gv->video.p;
                gv->video.r=!gv->video.r;
@@ -863,8 +863,15 @@ void near animatePlayer(map_view_t *pip, player_t *player, word pn, sword scroll
        sword qq; //scroll offset
        word ls = player[pn].persist_aniframe;
 
-       if(scrollswitch==0) qq = 0;
-       else qq = ((player[pn].q)*(player[pn].speed));
+       switch(scrollswitch)
+       {
+               case 0:
+                       qq = 0;
+               break;
+               default:
+                       qq = ((player[pn].q)*(player[pn].speed));
+               break;
+       }
        //x-=4;
        y-=TILEWH;
        switch (player[pn].d)
index 2731c0b6a70512d17e1c80453250da3aae8594b2..ae350ee372da214681143a45646a2cfb64fdd1b9 100755 (executable)
@@ -182,7 +182,7 @@ void main(int argc, char *argv[])
        //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen
        mapGoTo(mv, 0, 0);
        //_fmemcpy(mv[1].page->data, mv[0].page->data, mv[0].page->pagesize);
-       modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[1].page->width, mv[1].page->height);
+       //====modexCopyPageRegion(mv[1].page, mv[0].page, 0, 0, 0, 0, mv[1].page->width, mv[1].page->height);
 
        //TODO: put player in starting position of spot
        //default player position on the viewable map
@@ -193,14 +193,14 @@ void main(int argc, char *argv[])
 
 #ifndef        SPRITE
        modexClearRegion(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 32, 15);
-       modexClearRegion(mv[1].page, player[0].x, player[0].y-TILEWH, 16, 32, 15);
+       //====modexClearRegion(mv[1].page, player[0].x, player[0].y-TILEWH, 16, 32, 15);
 #else
        //PBUFSFUN(mv[1].page, player[0].x, player[0].y-TILEWH, 16, 64, 24, 32, PLAYERBMPDATA);
-       PBUFSFUN(mv[1].page, player[0].x, player[0].y-TILEWH, 16, 64, 16, 32,   &pp);
+       PBUFSFUN(mv[0].page, player[0].x, player[0].y-TILEWH, 16, 64, 16, 32,   &pp);
 #endif
 
        if(!pageflipflop)       modexShowPage(mv[1].page);
-       else                    modexShowPage(mv[(gvar.video.p)].page);
+       else                    modexShowPage(mv[0].page);//!(gvar.video.p)
                shinku_fps_indicator_page = 1; // we're on page 1 now, shinku(). follow along please or it will not be visible.
 
        /* buffer pages */