From aa0d66de1d0190058433ffd743dfd010da3738fc Mon Sep 17 00:00:00 2001 From: sparky4 Date: Sat, 18 Jun 2016 11:34:49 -0500 Subject: [PATCH] optimized scrolling ww --- src/lib/scroll16.c | 19 +++++++++++++------ src/scroll.c | 8 ++++---- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index bc785aa6..735b76fc 100755 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -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) diff --git a/src/scroll.c b/src/scroll.c index 2731c0b6..ae350ee3 100755 --- a/src/scroll.c +++ b/src/scroll.c @@ -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 */ -- 2.39.5