]> 4ch.mooo.com Git - 16.git/commitdiff
!! optimized 1 scroll function
authorsparky4 <sparky4@cock.li>
Fri, 19 Jun 2015 03:45:48 +0000 (22:45 -0500)
committersparky4 <sparky4@cock.li>
Fri, 19 Jun 2015 03:45:48 +0000 (22:45 -0500)
modified:   Project 16.bfproject
modified:   maptest.exe
modified:   pcxtest.exe
modified:   scroll.exe
modified:   src/scroll.c
modified:   test.exe
modified:   test2.exe

Project 16.bfproject
maptest.exe
pcxtest.exe
scroll.exe
src/scroll.c
test.exe
test2.exe

index c5b969ddbbb321c729b99e3a744b5a19c6ae637a..ab8785b1c4dc0220071dbe59a64c34b813d189ce 100644 (file)
@@ -3,25 +3,25 @@ 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:20776:19775:0:
+openfiles: /dos/z/16/src/scroll.c:22998:22397:1:
 openfiles: /dos/z/16/src/fmemtest.c:116:0:0:
-openfiles: /dos/z/16/src/emmtest.c:732:0:0:
+openfiles: /dos/z/16/src/emmtest.c:439:0:0:
 openfiles: /dos/z/16/src/emsdump.c:456:0:0:
 openfiles: /dos/z/16/src/maptest.c:463:0:0:
 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:2794:2497:1:
-openfiles: /dos/z/16/src/lib/modex16.h:1062:586: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/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:
 openfiles: /dos/z/16/src/lib/bitmap.h:257:0:0:
-openfiles: /dos/z/16/src/lib/dos_kb.c:3264:2448:0:
+openfiles: /dos/z/16/src/lib/dos_kb.c:3264:2407:0:
 openfiles: /dos/z/16/src/lib/dos_kb.h:0:0:0:
 openfiles: /dos/z/16/src/lib/mapread.c:2265:1988:0:
 openfiles: /dos/z/16/src/lib/mapread.h:584:0:0:
-openfiles: /dos/z/16/src/lib/fmapread.c:5968:4626:0:
+openfiles: /dos/z/16/src/lib/fmapread.c:5968:4541:0:
 openfiles: /dos/z/16/src/lib/fmapread.h:436:0:0:
 openfiles: /dos/z/16/src/lib/exmm/memory.c:308:99:0:
 openfiles: /dos/z/16/src/lib/exmm/memory.h:0:0:0:
@@ -44,10 +44,10 @@ view_left_panel: 0
 default_mime_type: text/plain
 e2c.convert_xml: 1
 c2e.convert_iso: 0
-opendir: file:///dos/z/16/src/lib
+opendir: file:///dos/z/16/src
 wrap_text_default: 0
 bookmarks_filename_mode: 1
-ssearch_text: modexShowPage()
+ssearch_text: drawcol
 snr_casesens: 0
 view_blocks: 1
 name: Project 16
@@ -77,41 +77,41 @@ recent_files: file:///dos/z/16/src/emstest.c
 recent_files: file:///dos/z/16/src/lib/exmm/x.bat
 recent_files: file:///dos/z/16/src/lib/jsmn/jsmn.c
 recent_files: file:///dos/z/16/src/lib/jsmn/jsmn.h
-recent_files: file:///dos/z/16/src/scroll.c
+recent_files: file:///dos/z/16/src/lib/modex16.c
 recent_files: file:///dos/z/16/doc/project.txt
 recent_files: file:///dos/z/16/src/palettec.c
-recent_files: file:///dos/z/16/src/emmtest.c
 recent_files: file:///dos/z/16/src/pcxtest.c
 recent_files: file:///dos/z/16/src/fmemtest.c
 recent_files: file:///dos/z/16/src/emsdump.c
 recent_files: file:///dos/z/16/src/maptest.c
-recent_files: file:///dos/z/16/src/maptest0.c
+recent_files: file:///dos/z/16/src/emmtest.c
 recent_files: file:///dos/z/16/src/test.c
-recent_files: file:///dos/z/16/src/test2.c
+recent_files: file:///dos/z/16/src/lib/modex16.h
 recent_files: file:///dos/z/16/src/lib/planar.h
-recent_files: file:///dos/z/16/src/lib/PLANAR.C
+recent_files: file:///dos/z/16/src/maptest0.c
+recent_files: file:///dos/z/16/src/lib/bitmap.h
 recent_files: file:///dos/z/16/src/lib/dos_kb.c
+recent_files: file:///dos/z/16/src/lib/PLANAR.C
 recent_files: file:///dos/z/16/src/lib/dos_kb.h
-recent_files: file:///dos/z/16/src/lib/mapread.h
-recent_files: file:///dos/z/16/src/lib/fmapread.h
-recent_files: file:///dos/z/16/src/lib/fmapread.c
+recent_files: file:///dos/z/16/src/test2.c
 recent_files: file:///dos/z/16/src/lib/bitmap.c
-recent_files: file:///dos/z/16/src/lib/bitmap.h
 recent_files: file:///dos/z/16/src/lib/mapread.c
-recent_files: file:///dos/z/16/src/lib/exmm/emmsize.h
-recent_files: file:///dos/z/16/src/lib/exmm/emmret.h
+recent_files: file:///dos/z/16/src/lib/mapread.h
+recent_files: file:///dos/z/16/src/lib/fmapread.c
 recent_files: file:///dos/z/16/src/lib/exmm/memory.c
-recent_files: file:///dos/z/16/src/lib/jsmn/farjsmn.c
+recent_files: file:///dos/z/16/src/lib/fmapread.h
+recent_files: file:///dos/z/16/src/lib/exmm/emmret.h
 recent_files: file:///dos/z/16/src/lib/lib_head.h
-recent_files: file:///dos/z/16/src/lib/jsmn/farjsmn.h
-recent_files: file:///dos/z/16/src/lib/exmm/memory.h
+recent_files: file:///dos/z/16/src/lib/types.h
+recent_files: file:///dos/z/16/src/lib/jsmn/farjsmn.c
 recent_files: file:///dos/z/16/makefile
+recent_files: file:///dos/z/16/src/lib/exmm/memory.h
+recent_files: file:///dos/z/16/src/lib/jsmn/farjsmn.h
+recent_files: file:///dos/z/16/src/lib/exmm/emmsize.h
 recent_files: file:///dos/z/16/src/lib/lib_head.c
-recent_files: file:///dos/z/16/src/lib/types.h
-recent_files: file:///dos/z/16/src/lib/modex16.c
-recent_files: file:///dos/z/16/src/lib/modex16.h
+recent_files: file:///dos/z/16/src/scroll.c
 snr_replacetype: 0
-savedir: file:///dos/z/16/src/lib
+savedir: file:///dos/z/16/src
 spell_check_default: 1
 spell_insert_entities: 0
 last_filefilter: 
@@ -121,13 +121,6 @@ snr_escape_chars: 0
 htmlbar_view: 0
 spell_lang: en
 ssearch_dotmatchall: 0
-searchlist: 0x3C4
-searchlist: SC_INDEX
-searchlist: panswitch
-searchlist: ++++
-searchlist: !!
-searchlist: drawbmp
-searchlist: move
 searchlist: next
 searchlist: bg
 searchlist: newde
@@ -136,6 +129,13 @@ searchlist: (1)
 searchlist: map
 searchlist: screen,
 searchlist: modexShowPage()
+searchlist: scrollright
+searchlist: col
+searchlist: dacol
+searchlist: dcol
+searchlist: drcol
+searchlist: dracol
+searchlist: drawcol
 autocomplete: 1
 outputb_show_all_output: 0
 bookmarks_show_mode: 0
index 4bddfea81b53f80e8060dba35a863008fe74cbb1..8c40dfa512ac2c6ec4d249294a89dd61554bd9d8 100644 (file)
Binary files a/maptest.exe and b/maptest.exe differ
index da40e7ab0934d6736485171515cb053a266fd54d..3a095beba24c7c7dad8669cc5126d71124b9ffdb 100644 (file)
Binary files a/pcxtest.exe and b/pcxtest.exe differ
index 7e8ed183eba4397e27a028e3158f6ac4e34b05d8..af5d73432cdb25bcd67380074ed631030a415816 100644 (file)
Binary files a/scroll.exe and b/scroll.exe differ
index 29d7037dc14813b1f0697c73987d0ca23eb4bf17..e0a6efca43634ea1ca9052f6125704d3076dd359 100644 (file)
@@ -30,11 +30,16 @@ typedef struct {
        word d; //direction\r
        bitmap_t data; //supposively the sprite sheet data\r
        int hp; //hitpoints of the player\r
-} actor_t;\r
+} actor_t;
+
+typedef struct
+{
+       map_view_t *mv;
+} map_view_db_t;\r
 \r
 map_t allocMap(int w, int h);\r
 void initMap(map_t *map);\r
-void mapScrollRight(map_view_t *mv, byte offset);\r
+void mapScrollRight(map_view_db_t *mvdb, byte offset, word id);\r
 void mapScrollLeft(map_view_t *mv, byte offest);\r
 void mapScrollUp(map_view_t *mv, byte offset);\r
 void mapScrollDown(map_view_t *mv, byte offset);\r
@@ -72,7 +77,8 @@ void main() {
        page_t screen, screen2, screen3;\r
        map_t map;\r
        map_view_t mv, mv2, mv3;\r
-       map_view_t *bg, *spri, *mask;//, *tmp;\r
+       map_view_t *bg, *spri, *mask;//, *tmp;
+       map_view_db_t pgid[4];
        byte *dpal, *gpal;\r
        byte *ptr;\r
        byte *mappalptr;\r
@@ -201,7 +207,10 @@ void main() {
        /* set up paging */\r
        bg = &mv;\r
        spri = &mv2;\r
-       mask = &mv3;\r
+       mask = &mv3;
+       pgid[0].mv = &mv;
+       pgid[1].mv = &mv2;
+       pgid[2].mv = &mv3;\r
 \r
 //TODO: LOAD map data and position the map in the middle of the screen if smaller then screen\r
        mapGoTo(bg, 0, 0);\r
@@ -256,8 +265,8 @@ void main() {
                                INC_PER_FRAME;\r
                                //animatePlayer(bg, spri, mask, 1, 1, player.x, player.y, persist_aniframe, q, &ptmp);\r
                                animatePlayer(bg, spri, player.d-1, 1, player.x, player.y, persist_aniframe, player.q, &ptmp);\r
-                               mapScrollRight(bg, SPEED);\r
-                               mapScrollRight(spri, SPEED);\r
+                               mapScrollRight(pgid, SPEED, 0);\r
+                               mapScrollRight(pgid, SPEED, 1);\r
                                //mapScrollRight(mask, SPEED);\r
                                modexShowPage(spri->page);\r
                                player.q++;\r
@@ -702,25 +711,27 @@ initMap(map_t *map) {
 \r
 \r
 void\r
-mapScrollRight(map_view_t *mv, byte offset) {\r
+mapScrollRight(map_view_db_t *mvdb, byte offset, word id) {\r
        word x, y;  /* coordinate for drawing */\r
 \r
        /* increment the pixel position and update the page */\r
-       mv->page->dx += offset;\r
+       mvdb[id].mv->page->dx += offset;\r
 \r
        /* check to see if this changes the tile */\r
-       if(mv->page->dx >= mv->dxThresh ) {\r
+       if(mvdb[id].mv->page->dx >= mvdb[id].mv->dxThresh ) {\r
        /* go forward one tile */\r
-       mv->tx++;\r
+       mvdb[id].mv->tx++;\r
        /* Snap the origin forward */\r
-       mv->page->data += 4;\r
-       mv->page->dx = mv->map->tiles->tileWidth;\r
-       //}\r
+       mvdb[id].mv->page->data += 4;\r
+       mvdb[id].mv->page->dx = mvdb[id].mv->map->tiles->tileWidth;\r
 \r
        /* draw the next column */\r
-       x= SCREEN_WIDTH + mv->map->tiles->tileWidth;\r
-               if(mv->page->id==0)\r
-               mapDrawCol(mv, mv->tx + 20 , mv->ty-1, x);\r
+       x= SCREEN_WIDTH + mvdb[id].mv->map->tiles->tileWidth;\r
+               if(mvdb[id].mv->page->id==0)
+                       mapDrawCol(mvdb[id].mv, mvdb[id].mv->tx + 20 , mvdb[id].mv->ty-1, x);
+               else
+                       modexCopyPageRegion(mvdb[id].mv->page, mvdb[0].mv->page, x, 0, x, 0, mvdb[id].mv->map->tiles->tileWidth, mvdb[id].mv->map->tiles->tileHeight*17);
+//              mv[0]\r
        }\r
 }\r
 \r
index 13eadb07f503668bc69c1bc138a33ea71241cfe2..79a5b31d52401ad82679ae4cb1f569e0b9b58314 100644 (file)
Binary files a/test.exe and b/test.exe differ
index bfc3938a8a9fecc9364d6a65a6eeba298a59fa25..7d62d246d19db31630cc4f48bc4f9acde4d2d37e 100644 (file)
Binary files a/test2.exe and b/test2.exe differ