From: sparky4 Date: Mon, 1 Dec 2014 06:37:08 +0000 (-0600) Subject: deleted: makefile~ X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=bb469ec3b28468c0370f4fce239fad4375850a8d;p=16.git deleted: makefile~ modified: scroll.exe modified: src/scroll.c --- diff --git a/makefile~ b/makefile~ deleted file mode 100644 index 6ef7ecd1..00000000 --- a/makefile~ +++ /dev/null @@ -1,37 +0,0 @@ -FLAGS=-0 -d2 -all: test.exe pcxtest.exe test2.exe scroll.exe - -scroll.exe: scroll.obj modex16.obj dos_kb.obj bitmap.obj - wcl $(FLAGS) scroll.obj modex16.obj dos_kb.obj bitmap.obj -scroll.obj: src\scroll.c - wcl $(FLAGS) -c src\scroll.c -test.exe: test.obj modex16.obj bitmap.obj - wcl $(FLAGS) test.obj modex16.obj bitmap.obj - -test2.exe: test2.obj modex16.obj bitmap.obj - wcl $(FLAGS) test2.obj modex16.obj bitmap.obj - -pcxtest.exe: pcxtest.obj modex16.obj bitmap.obj - wcl $(FLAGS) pcxtest.obj modex16.obj bitmap.obj - -test.obj: src\test.c src\lib\modex16.h - wcl $(FLAGS) -c src\test.c - -test2.obj: src\test2.c src\lib\modex16.h - wcl $(FLAGS) -c src\test2.c - -pcxtest.obj: src\pcxtest.c src\lib\modex16.h - wcl $(FLAGS) -c src\pcxtest.c - -modex16.obj: src\lib\modex16.h src\lib\modex16.c - wcl $(FLAGS) -c src\lib\modex16.c - -dos_kb.obj: src\lib\dos_kb.h src\lib\dos_kb.c - wcl $(FLAGS) -c src\lib\dos_kb.c - -bitmap.obj: src\lib\bitmap.h src\lib\bitmap.c - wcl $(FLAGS) -c src\lib\bitmap.c - -clean: - del *.obj -# del *.exe diff --git a/scroll.exe b/scroll.exe index beb750e1..afcb2529 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/src/scroll.c b/src/scroll.c index 3ce484db..12230d94 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -46,14 +46,16 @@ struct { map_t allocMap(int w, int h); void initMap(map_t *map); -void mapScrollRight(map_view_t *mv, byte offset); -void mapScrollLeft(map_view_t *mv, byte offest); -void mapScrollUp(map_view_t *mv, byte offset); -void mapScrollDown(map_view_t *mv, byte offset); +void mapScrollRight(map_view_t *mv, byte offset, short lp); +void mapScrollLeft(map_view_t *mv, byte offest, short lp); +void mapScrollUp(map_view_t *mv, byte offset, short lp); +void mapScrollDown(map_view_t *mv, byte offset, short lp); void mapGoTo(map_view_t *mv, int tx, int ty); void mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y); -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 mapDrawRow(map_view_t *mv, int tx, int ty, word y, word poopoffset); +void mapDrawCol(map_view_t *mv, int tx, int ty, word x, word poopoffset); +void mapDrawWRow(map_view_t *mv, int tx, int ty, word y); +void mapDrawWCol(map_view_t *mv, int tx, int ty, word x); void animatePlayer(map_view_t *src, map_view_t *dest, /*map_view_t *top, */short d1, short d2, int x, int y, int ls, int lp, bitmap_t *bmp); #define TILEWH 16 @@ -172,8 +174,8 @@ break; INC_PER_FRAME; //animatePlayer(bg, spri, mask, 1, 1, player.x, player.y, persist_aniframe, q, &ptmp); animatePlayer(bg, spri, 1, 1, player.x, player.y, persist_aniframe, q, &ptmp); - mapScrollRight(bg, SPEED); - mapScrollRight(spri, SPEED); + mapScrollRight(bg, SPEED, q); + mapScrollRight(spri, SPEED, q); //mapScrollRight(mask, SPEED); modexShowPage(spri->page); } @@ -210,8 +212,8 @@ break; INC_PER_FRAME; //animatePlayer(bg, spri, mask, 3, 1, player.x, player.y, persist_aniframe, q, &ptmp); animatePlayer(bg, spri, 3, 1, player.x, player.y, persist_aniframe, q, &ptmp); - mapScrollLeft(bg, SPEED); - mapScrollLeft(spri, SPEED); + mapScrollLeft(bg, SPEED, q); + mapScrollLeft(spri, SPEED, q); //mapScrollLeft(mask, SPEED); modexShowPage(spri->page); } @@ -248,8 +250,8 @@ break; INC_PER_FRAME; //animatePlayer(bg, spri, mask, 2, 1, player.x, player.y, persist_aniframe, q, &ptmp); animatePlayer(bg, spri, 2, 1, player.x, player.y, persist_aniframe, q, &ptmp); - mapScrollDown(bg, SPEED); - mapScrollDown(spri, SPEED); + mapScrollDown(bg, SPEED, q); + mapScrollDown(spri, SPEED, q); //mapScrollDown(mask, SPEED); modexShowPage(spri->page); } @@ -286,8 +288,8 @@ break; INC_PER_FRAME; //animatePlayer(bg, spri, mask, 0, 1, player.x, player.y, persist_aniframe, q, &ptmp); animatePlayer(bg, spri, 0, 1, player.x, player.y, persist_aniframe, q, &ptmp); - mapScrollUp(bg, SPEED); - mapScrollUp(spri, SPEED); + mapScrollUp(bg, SPEED, q); + mapScrollUp(spri, SPEED, q); //mapScrollUp(mask, SPEED); modexShowPage(spri->page); } @@ -408,7 +410,7 @@ initMap(map_t *map) { void -mapScrollRight(map_view_t *mv, byte offset) { +mapScrollRight(map_view_t *mv, byte offset, short lp) { word x, y; /* coordinate for drawing */ /* increment the pixel position and update the page */ @@ -421,17 +423,18 @@ mapScrollRight(map_view_t *mv, byte offset) { /* Snap the origin forward */ mv->page->data += 4; mv->page->dx = mv->map->tiles->tileWidth; - + } /* draw the next column */ x= SCREEN_WIDTH + mv->map->tiles->tileWidth; - mapDrawCol(mv, mv->tx + 20 , mv->ty-1, x); - } + if(lp%2) + mapDrawCol(mv, mv->tx + 20 , mv->ty-1, x, mv->page->dx); + //} } void -mapScrollLeft(map_view_t *mv, byte offset) { +mapScrollLeft(map_view_t *mv, byte offset, short lp) { word x, y; /* coordinate for drawing */ /* increment the pixel position and update the page */ @@ -445,15 +448,16 @@ mapScrollLeft(map_view_t *mv, byte offset) { /* Snap the origin backward */ mv->page->data -= 4; mv->page->dx = mv->map->tiles->tileWidth; - - /* draw the next column */ - mapDrawCol(mv, mv->tx-1, mv->ty-1, 0); } + /* draw the next column */ + if(lp%2) + mapDrawCol(mv, mv->tx-1, mv->ty-1, 0, mv->page->dx); + //} } void -mapScrollUp(map_view_t *mv, byte offset) { +mapScrollUp(map_view_t *mv, byte offset, short lp) { word x, y; /* coordinate for drawing */ /* increment the pixel position and update the page */ @@ -466,17 +470,18 @@ mapScrollUp(map_view_t *mv, byte offset) { /* Snap the origin downward */ mv->page->data -= mv->page->width*4; mv->page->dy = mv->map->tiles->tileHeight; - + } /* draw the next row */ y= 0; - mapDrawRow(mv, mv->tx-1 , mv->ty-1, y); - } + if(lp%3) + mapDrawRow(mv, mv->tx-1 , mv->ty-1, y, mv->page->dy); + //} } void -mapScrollDown(map_view_t *mv, byte offset) { +mapScrollDown(map_view_t *mv, byte offset, short lp) { word x, y; /* coordinate for drawing */ /* increment the pixel position and update the page */ @@ -489,12 +494,13 @@ mapScrollDown(map_view_t *mv, byte offset) { /* Snap the origin downward */ mv->page->data += mv->page->width*4; mv->page->dy = mv->map->tiles->tileHeight; - + } /* draw the next row */ y= SCREEN_HEIGHT + mv->map->tiles->tileHeight; - mapDrawRow(mv, mv->tx-1 , mv->ty+15, y); - } + if(lp%3) + mapDrawRow(mv, mv->tx-1 , mv->ty+15, y, mv->page->dy); + //} } @@ -519,7 +525,7 @@ mapGoTo(map_view_t *mv, int tx, int ty) { py=0; i=mv->ty * mv->map->width + mv->tx; for(ty=mv->ty-1; py < SCREEN_HEIGHT+mv->dyThresh && ty < mv->map->height; ty++, py+=mv->map->tiles->tileHeight) { - mapDrawRow(mv, tx-1, ty, py); + mapDrawWRow(mv, tx-1, ty, py); i+=mv->map->width - tx; } } @@ -536,13 +542,14 @@ mapDrawTile(tiles_t *t, word i, page_t *page, word x, word y) { void -mapDrawRow(map_view_t *mv, int tx, int ty, word y) { +mapDrawRow(map_view_t *mv, int tx, int ty, word y, word poopoffset) { word x; int i; + poopoffset%=6; /* the position within the map array */ i=ty * mv->map->width + tx; - for(x=0; xdxThresh && tx < mv->map->width; x+=mv->map->tiles->tileWidth, tx++) { + for(x=poopoffset; x<(SCREEN_WIDTH+mv->dxThresh)/(poopoffset+1) && tx < mv->map->width; x+=mv->map->tiles->tileWidth, tx++) { if(i>=0) { /* we are in the map, so copy! */ mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y); @@ -553,7 +560,43 @@ mapDrawRow(map_view_t *mv, int tx, int ty, word y) { void -mapDrawCol(map_view_t *mv, int tx, int ty, word x) { +mapDrawCol(map_view_t *mv, int tx, int ty, word x, word poopoffset) { + int y; + int i; + poopoffset%=4; + + /* location in the map array */ + i=ty * mv->map->width + tx; + + /* We'll copy all of the columns in the screen, + i + 1 row above and one below */ + for(y=poopoffset; y<(SCREEN_HEIGHT+mv->dyThresh)/(poopoffset+1) && ty < mv->map->height; y+=mv->map->tiles->tileHeight, ty++) { + if(i>=0) { + /* we are in the map, so copy away! */ + mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y); + } + i += mv->map->width; + } +} + +void +mapDrawWRow(map_view_t *mv, int tx, int ty, word y) { + word x; + int i; + + /* the position within the map array */ + i=ty * mv->map->width + tx; + for(x=0; xdxThresh && tx < mv->map->width; x+=mv->map->tiles->tileWidth, tx++) { + if(i>=0) { + /* we are in the map, so copy! */ + mapDrawTile(mv->map->tiles, mv->map->data[i], mv->page, x, y); + } + i++; /* next! */ + } +} + +void +mapDrawWCol(map_view_t *mv, int tx, int ty, word x) { int y; int i;