From: sparky4 Date: Mon, 24 Nov 2014 07:06:45 +0000 (-0600) Subject: modified: BITMAP.C X-Git-Url: http://4ch.mooo.com/gitweb/?a=commitdiff_plain;h=223378457fa5f386bc056f7162bba6c523d6164f;p=16.git modified: BITMAP.C modified: Project 16.bfproject modified: pcxtest.exe modified: scroll.c modified: scroll.exe modified: test.exe modified: test2.exe --- diff --git a/BITMAP.C b/BITMAP.C index 8287e57d..191b460b 100644 --- a/BITMAP.C +++ b/BITMAP.C @@ -79,10 +79,10 @@ bitmapLoadPcx(char *filename) { /* open the PCX file for reading */ file = fopen(filename, "rb"); - if(!file) { + /*if(!file) { printf("Could not open %s for reading.\n", filename); exit(-2); - } + }*/ /* load the first part of the pcx file */ loadPcxStage1(file, &result); diff --git a/Project 16.bfproject b/Project 16.bfproject index 5e39df7f..4a4078c1 100644 --- a/Project 16.bfproject +++ b/Project 16.bfproject @@ -1,7 +1,7 @@ c2e.convert_special: 0 e2c.convert_num: 0 openfiles: /dos/z/16/doc/project.txt:102:0:0: -openfiles: /dos/z/16/scroll.c:12991:12348:1: +openfiles: /dos/z/16/scroll.c:3426:2959:1: openfiles: /dos/z/16/modex16.c:9475:0:0: openfiles: /dos/z/16/modex16.h:1512:344:0: openfiles: /dos/z/16/pcxtest.c:1339:442:0: @@ -22,7 +22,7 @@ c2e.convert_iso: 0 opendir: file:///dos/z/16/lib wrap_text_default: 0 bookmarks_filename_mode: 1 -ssearch_text: modexDrawSpriteRegion +ssearch_text: )*2 snr_casesens: 1 view_blocks: 1 name: project 16 @@ -115,9 +115,6 @@ snr_escape_chars: 0 htmlbar_view: 0 spell_lang: en ssearch_dotmatchall: 0 -searchlist: w->page -searchlist: modexShowPage(spri -searchlist: howPage(draw searchlist: wPage(draw searchlist: 32); searchlist: 33) @@ -130,6 +127,9 @@ searchlist: mv searchlist: animatePlayer(spri, bg, searchlist: clearpl searchlist: modexDrawSpriteRegion +searchlist: bg +searchlist: )*- +searchlist: )*2 autocomplete: 1 outputb_show_all_output: 0 bookmarks_show_mode: 0 diff --git a/pcxtest.exe b/pcxtest.exe index de765ece..d1d39402 100644 Binary files a/pcxtest.exe and b/pcxtest.exe differ diff --git a/scroll.c b/scroll.c index 2e27dbc3..057a5ee5 100644 --- a/scroll.c +++ b/scroll.c @@ -63,7 +63,7 @@ void animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, #define SWAP(a, b) tmp=a; a=b; b=tmp; void main() { bitmap_t ptmp; // player sprite - int q=0; + int q=1; page_t screen, screen2; map_t map; map_view_t mv, mv2; @@ -118,7 +118,7 @@ void main() { { if(bg->tx >= 0 && bg->tx+20 < MAPX && player.tx == bg->tx + 10) { - for(q=0; q<(TILEWH/SPEED); q++) + for(q=1; q<=(TILEWH/SPEED); q++) { animatePlayer(bg, spri, 1, 1, player.x, player.y, q, &ptmp); mapScrollRight(bg, SPEED); @@ -129,7 +129,7 @@ void main() { } else if(player.tx < MAPX) { - for(q=0; q<(TILEWH/SPEED); q++) + for(q=1; q<=(TILEWH/SPEED); q++) { player.x+=SPEED; animatePlayer(bg, spri, 1, 0, player.x, player.y, q, &ptmp); @@ -149,7 +149,7 @@ void main() { { if(bg->tx > 0 && bg->tx+20 <= MAPX && player.tx == bg->tx + 10) { - for(q=0; q<(TILEWH/SPEED); q++) + for(q=1; q<=(TILEWH/SPEED); q++) { animatePlayer(bg, spri, 3, 1, player.x, player.y, q, &ptmp); @@ -161,7 +161,7 @@ void main() { } else if(player.tx > 1) { - for(q=0; q<(TILEWH/SPEED); q++) + for(q=1; q<=(TILEWH/SPEED); q++) { player.x-=SPEED; animatePlayer(bg, spri, 3, 0, player.x, player.y, q, &ptmp); @@ -181,7 +181,7 @@ void main() { { if(bg->ty >= 0 && bg->ty+15 < MAPY && player.ty == bg->ty + 8) { - for(q=0; q<(TILEWH/SPEED); q++) + for(q=1; q<=(TILEWH/SPEED); q++) { animatePlayer(bg, spri, 2, 1, player.x, player.y, q, &ptmp); mapScrollDown(bg, SPEED); @@ -192,7 +192,7 @@ void main() { } else if(player.ty < MAPY) { - for(q=0; q<(TILEWH/SPEED); q++) + for(q=1; q<=(TILEWH/SPEED); q++) { player.y+=SPEED; animatePlayer(bg, spri, 2, 0, player.x, player.y, q, &ptmp); @@ -212,7 +212,7 @@ void main() { { if(bg->ty > 0 && bg->ty+15 <= MAPY && player.ty == bg->ty + 8) { - for(q=0; q<(TILEWH/SPEED); q++) + for(q=1; q<=(TILEWH/SPEED); q++) { animatePlayer(bg, spri, 0, 1, player.x, player.y, q, &ptmp); mapScrollUp(bg, SPEED); @@ -223,7 +223,7 @@ void main() { } else if(player.ty > 1) { - for(q=0; q<(TILEWH/SPEED); q++) + for(q=1; q<=(TILEWH/SPEED); q++) { player.y-=SPEED; animatePlayer(bg, spri, 0, 0, player.x, player.y, q, &ptmp); @@ -472,11 +472,11 @@ mapDrawCol(map_view_t *mv, int tx, int ty, word x) { void animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, int y, int ls, bitmap_t *bmp) -{ +{ short dire=32*d1; short qq; short lo = ((TILEWH / SPEED) / 3); - short loo = (ls + lo); + short loo = (ls + lo); if(d2==0) qq = 0; else qq = ((ls+1)*SPEED); @@ -504,13 +504,13 @@ animatePlayer(map_view_t *src, map_view_t *dest, short d1, short d2, int x, int break; } //TODO: make flexible animation thingy - if(2>ls && ls>=0) { modexCopyPageRegion(dest->page, src->page, x-2, y-4, x-2, y-4, 28, 40); + if(2>ls && ls>=1) { modexCopyPageRegion(dest->page, src->page, x-2, y-4, x-2, y-4, 28, 40); modexDrawSpriteRegion(dest->page, x, y, 48, dire, 24, 32, bmp); }else - if(4>ls && ls>=2) { modexCopyPageRegion(dest->page, src->page, x-2, y-4, x-2, y-4, 28, 40); + if(3>ls && ls>=2) { modexCopyPageRegion(dest->page, src->page, x-2, y-4, x-2, y-4, 28, 40); modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); }else - if(6>ls && ls>=4) { modexCopyPageRegion(dest->page, src->page, x-2, y-4, x-2, y-4, 28, 40); + if(4>ls && ls>=3) { modexCopyPageRegion(dest->page, src->page, x-2, y-4, x-2, y-4, 28, 40); modexDrawSpriteRegion(dest->page, x, y, 0, dire, 24, 32, bmp); }else - if(8>ls && ls>=6) { modexCopyPageRegion(dest->page, src->page, x-2, y-4, x-2, y-4, 28, 40); - modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); }else ls-=ls; + if(5>ls && ls>=4) { modexCopyPageRegion(dest->page, src->page, x-2, y-4, x-2, y-4, 28, 40); + modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); } modexWaitBorder(); } diff --git a/scroll.exe b/scroll.exe index 28987bc3..98e9290d 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/test.exe b/test.exe index 99404b1a..b417dca2 100644 Binary files a/test.exe and b/test.exe differ diff --git a/test2.exe b/test2.exe index 2b870eff..b061884d 100644 Binary files a/test2.exe and b/test2.exe differ