From 968baa3a22be5749a100ab4b3b67879a07d57264 Mon Sep 17 00:00:00 2001 From: sparky4 Date: Thu, 18 Jun 2015 23:38:17 -0500 Subject: [PATCH] optimization of scrolling routines of pages is finished~ modified: Project 16.bfproject modified: scroll.exe modified: src/scroll.c --- Project 16.bfproject | 39 +++++++++++++++++++++------------------ scroll.exe | Bin 60076 -> 60076 bytes src/scroll.c | 30 ++++++++++++++---------------- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/Project 16.bfproject b/Project 16.bfproject index a92a3bdf..81a70c67 100644 --- a/Project 16.bfproject +++ b/Project 16.bfproject @@ -3,7 +3,7 @@ e2c.convert_num: 0 openfiles: /dos/z/16/doc/project.txt:138:0:0: openfiles: /dos/z/16/src/palettec.c:179:0:0: openfiles: /dos/z/16/src/pcxtest.c:141:0:0: -openfiles: /dos/z/16/src/scroll.c:3783:3119:1: +openfiles: /dos/z/16/src/scroll.c:8595:7726:1: openfiles: /dos/z/16/src/fmemtest.c:116:0:0: openfiles: /dos/z/16/src/emmtest.c:439:0:0: openfiles: /dos/z/16/src/emsdump.c:456:0:0: @@ -12,7 +12,7 @@ openfiles: /dos/z/16/src/maptest0.c:366:0:0: openfiles: /dos/z/16/src/test.c:0:0:0: openfiles: /dos/z/16/src/test2.c:0:0:0: openfiles: /dos/z/16/src/lib/modex16.c:2760:2448:0: -openfiles: /dos/z/16/src/lib/modex16.h:1833:866:0: +openfiles: /dos/z/16/src/lib/modex16.h:503:0:0: openfiles: /dos/z/16/src/lib/planar.h:131:0:0: openfiles: /dos/z/16/src/lib/PLANAR.C:0:0:0: openfiles: /dos/z/16/src/lib/bitmap.c:1152:604:0: @@ -47,10 +47,13 @@ c2e.convert_iso: 0 opendir: file:///dos/z/16/src wrap_text_default: 0 bookmarks_filename_mode: 1 -ssearch_text: mv +ssearch_text: mapscroll snr_casesens: 0 view_blocks: 1 name: Project 16 +replacelist: mv[id] +replacelist: ]. +replacelist: mv[id]. fb_show_hidden_f: 0 editor_tab_width: 4 template: /usr/share/bluefish/templates/C_header_GPL @@ -121,21 +124,21 @@ snr_escape_chars: 0 htmlbar_view: 0 spell_lang: en ssearch_dotmatchall: 0 -searchlist: modexShowPage() +searchlist: vo scroll +searchlist: voi scroll +searchlist: void scrollright +searchlist: void mscrollright +searchlist: void mascrollright +searchlist: void mapscrollright searchlist: scrollright -searchlist: col -searchlist: dacol -searchlist: dcol -searchlist: drcol -searchlist: dracol -searchlist: drawcol -searchlist: scrolle -searchlist: scrollr -searchlist: map_view_db_tscr -searchlist: scrollright -searchlist: map_view_db_t *mvdb, byte offset, word id -searchlist: scrollright -searchlist: mv +searchlist: mvdb[id].mv +searchlist: ]-> +searchlist: scroll +searchlist: mscroll +searchlist: mascroll +searchlist: maposcroll +searchlist: mapscroll +searchlist: mv-> autocomplete: 1 outputb_show_all_output: 0 bookmarks_show_mode: 0 @@ -169,7 +172,7 @@ c2e.convert_xml: 1 editor_indent_wspaces: 0 view_cline: 1 snr_type: 0 -snr_scope: 2 +snr_scope: 0 bmarksearchmode: 0 view_main_toolbar: 1 e2c.convert_symbol: 0 diff --git a/scroll.exe b/scroll.exe index 8a2086610d73e3166f53591199500f343cdc248f..297c04a27de6f98abdf4ac96e49c555ef0a09153 100644 GIT binary patch delta 1275 zcma)(ZA=_R7{_OJ=3Y4NxV_uia)K0#AiZiMOVG3d0cYYG^@_~n`3 z{Gb2M{-2pkOX$)Py7DQP{jPn;hou#1QGZ*T(P(U23ww~Aj7$|+jh$Ik#Sqsw6ARy9O_SV^c_Aw3Y&~-lvA6Gl`ZD( zPKH}`xZlfRwMGqd>PgnY%2x_A)u>IJ@(tVeB|LB-9uk$LT8q_ZjRpezNxz?G6=9VUfj`5|ina=VB zc89XgPE#APH1Dt1Ir=AmF#2Hju60ehHkeetQ$b6NlQTM`Dh)b>pq_{L6 zP#d`bn}R*zkmdizf|*#V*IZd=>F&y0@4aB~zrk1r7I9X6itC$R2Lp>oc60X6*z5I1 zn0jdYLH0zvm#~3d^iIB;w8beyj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GZ#7Qo)=-Y&^ z;e48xgO40A|6eei1k+@b$7^nD-9UqfZldA;q5%UyPHUB1&*Um9+9FM{qK(1CqkbHF z3I@Fexy4xJnt;jvOSsDF?FzoeCLq4b@Knt$^bZ=R9Q%_#hlkld$%k*TE~z7u#E*4AM|2=(J3b}q1u3Be4~Wy@i?L3jEYo5QYL0?&fY!J314WT*W)G(M0%-`{x8JuTJrHDJ1t6YWRi?o!z+5N;b<#ae%oW;jmS`fmmnJ@^2vmoTB?^6YXc!OT1 z3IcJFUSw0l;RKdt21F9(ups#tR~ZT^46~X#HgQN=*1NW2C?bDC`P;U7L^vT$D diff --git a/src/scroll.c b/src/scroll.c index 39990d1f..d9ad13a9 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -49,7 +49,7 @@ void mapDrawRow(map_view_t *mv, int tx, int ty, word y); void mapDrawCol(map_view_t *mv, int tx, int ty, word x); void qclean(); void pdump(map_view_t *pee); -void animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */sword d, short scrolloffsetswitch, int x, int y, int ls, int lp, bitmap_t *bmp); +void animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */sword d, short scrolloffsetswitch, int x, int y, int ls, int lp, bitmap_t *bmp); #define TILEWH 16 #define QUADWH TILEWH/2 @@ -208,9 +208,6 @@ void main() { bg = &mv[0]; spri = &mv[1]; mask = &mv[2]; - //pgid[0].mv = &mv; - //pgid[1].mv = &mv2; - //pgid[2].mv = &mv3; //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen mapGoTo(bg, 0, 0); @@ -264,9 +261,9 @@ void main() { { INC_PER_FRAME; //animatePlayer(bg, spri, mask, 1, 1, player.x, player.y, persist_aniframe, q, &ptmp); - animatePlayer(bg, spri, player.d-1, 1, player.x, player.y, persist_aniframe, player.q, &ptmp); + animatePlayer(bg, spri, player.d-1, 1, player.x, player.y, persist_aniframe, player.q, &ptmp); mapScrollRight(mv, SPEED, 0); - mapScrollRight(mv, SPEED, 1); + mapScrollRight(mv, SPEED, 1); //mapScrollRight(mask, SPEED); modexShowPage(spri->page); player.q++; @@ -707,8 +704,8 @@ initMap(map_t *map) { } //tile = tile ? 0 : 1; }*/ -} - +} + void mapScrollRight(map_view_t *mv, byte offset, word id) @@ -729,7 +726,7 @@ mapScrollRight(map_view_t *mv, byte offset, word id) /* draw the next column */ x= SCREEN_WIDTH + mv[id].map->tiles->tileWidth; if(id==0) - mapDrawCol(&mv[id], mv[id].tx + 20 , mv[id].ty-1, x); + mapDrawCol(&mv[0], mv[0].tx + 20 , mv[0].ty-1, x); else modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[id].map->tiles->tileWidth, mv[id].map->tiles->tileHeight*17); } @@ -753,11 +750,12 @@ mapScrollLeft(map_view_t *mv, byte offset, word id) mv[id].page->data -= 4; mv[id].page->dx = mv[id].map->tiles->tileWidth; - /* draw the next column */ + /* draw the next column */ + x= 0; if(id==0) - mapDrawCol(&mv[0], mv[id].tx-1, mv[id].ty-1, 0); + mapDrawCol(&mv[0], mv[0].tx-1, mv[0].ty-1, 0); else - modexCopyPageRegion(mv[id].page, mv[0].page, 0, 0, 0, 0, mv[id].map->tiles->tileWidth, mv[id].map->tiles->tileHeight*17); + modexCopyPageRegion(mv[id].page, mv[0].page, x, 0, x, 0, mv[id].map->tiles->tileWidth, mv[id].map->tiles->tileHeight*17); } } @@ -779,11 +777,11 @@ mapScrollUp(map_view_t *mv, byte offset, word id) mv[id].page->dy = mv[id].map->tiles->tileHeight; /* draw the next row */ - //y= 0; + y= 0; if(id==0) - mapDrawRow(&mv[0], mv[id].tx-1 , mv[id].ty-1, 0); + mapDrawRow(&mv[0], mv[0].tx-1 , mv[0].ty-1, 0); else - modexCopyPageRegion(mv[id].page, mv[0].page, 0, 0, 0, 0, mv[id].map->tiles->tileWidth*22, mv[id].map->tiles->tileHeight); + modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[id].map->tiles->tileWidth*22, mv[id].map->tiles->tileHeight); } } @@ -807,7 +805,7 @@ mapScrollDown(map_view_t *mv, byte offset, word id) /* draw the next row */ y= SCREEN_HEIGHT + mv[id].map->tiles->tileHeight; if(id==0) - mapDrawRow(&mv[0], mv[id].tx-1 , mv[id].ty+15, y); + mapDrawRow(&mv[0], mv[0].tx-1 , mv[0].ty+15, y); else modexCopyPageRegion(mv[id].page, mv[0].page, 0, y, 0, y, mv[id].map->tiles->tileWidth*22, mv[id].map->tiles->tileHeight); } -- 2.39.5