From: sparky4 Date: Fri, 31 Jul 2015 06:37:38 +0000 (-0500) Subject: damn!! hmmm i think ther eis something wrong with the presistant animation stuff X-Git-Url: http://4ch.mooo.com/gitweb/?p=16.git;a=commitdiff_plain;h=3dc6dfae836293380daf9e7dbd7c04d211a2cb16 damn!! hmmm i think ther eis something wrong with the presistant animation stuff modified: 16.exe modified: data/g.pal modified: inputest.exe modified: scroll.exe modified: sountest.exe modified: src/lib/16_in.c modified: src/lib/16_in.h modified: src/lib/scroll16.c modified: src/scroll.c --- diff --git a/16.exe b/16.exe index 14810f35..2b6f3549 100644 Binary files a/16.exe and b/16.exe differ diff --git a/data/g.pal b/data/g.pal index 98c7a214..cf668e35 100644 Binary files a/data/g.pal and b/data/g.pal differ diff --git a/inputest.exe b/inputest.exe index c9ce4abe..dc7103f5 100644 Binary files a/inputest.exe and b/inputest.exe differ diff --git a/scroll.exe b/scroll.exe index c1e26bc0..2f2da6b0 100644 Binary files a/scroll.exe and b/scroll.exe differ diff --git a/sountest.exe b/sountest.exe index 40741b6f..d15c9b98 100644 Binary files a/sountest.exe and b/sountest.exe differ diff --git a/src/lib/16_in.c b/src/lib/16_in.c index fd812ff0..f07a694f 100644 --- a/src/lib/16_in.c +++ b/src/lib/16_in.c @@ -799,7 +799,7 @@ IN_ReadCursor(CursorInfo *info) /////////////////////////////////////////////////////////////////////////// void IN_ReadControl(int playnum,player_t *player) -{ +{ boolean realdelta; byte dbyte; word buttons; @@ -811,7 +811,7 @@ register KeyboardDef *def; dx = dy = 0; mx = my = motion_None; - buttons = 0; + buttons = 0; #if DEMO0 if (DemoMode == demo_Playback) @@ -849,18 +849,16 @@ register KeyboardDef *def; mx = motion_Left,my = motion_Down; else if (Keyboard[def->downright]) mx = motion_Right,my = motion_Down;*/ - if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){ - if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down] && player[playnum].info.dir == 2) || player[playnum].info.dir == 0) - my = motion_Up; - if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up] && player[playnum].info.dir == 2) || player[playnum].info.dir == 4) - my = motion_Down; - + if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down] && player[playnum].d == 2))// || player[playnum].info.dir == 0) + my = motion_Up; + if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up] && player[playnum].d == 2))// || player[playnum].info.dir == 4) + my = motion_Down; }else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){ - if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right] && player[playnum].info.dir == 2) || player[playnum].info.dir == 1) - mx = motion_Left; - if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left] && player[playnum].info.dir == 2) || player[playnum].info.dir == 3) - mx = motion_Right; + if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right] && player[playnum].d == 2))// || player[playnum].info.dir == 1) + mx = motion_Left; + if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left] && player[playnum].d == 2))// || player[playnum].info.dir == 3) + mx = motion_Right; } if (inpu.Keyboard[def->button0]) buttons += 1 << 0; @@ -895,10 +893,10 @@ register KeyboardDef *def; } else { - dx = mx * 127; - dy = my * 127; + dx = mx;// * 127; + dy = my;// * 127; } - + player[playnum].info.x = dx; player[playnum].info.xaxis = mx; player[playnum].info.y = dy; @@ -910,7 +908,11 @@ register KeyboardDef *def; // player[playnum].info.dir = DirTable[((my + 1) * 3) + (mx + 1)]; conpee=(((my + 1) * 2) + (mx + 1)); if(conpee) conpee--; - player[playnum].info.dir = DirTable[conpee]; + player[playnum].info.dir = DirTable[conpee]; + if(player[playnum].q==1 && (mx!=motion_None || my!=motion_None)) + { + player[playnum].d = player[playnum].info.dir; + } #if DEMO0 if (DemoMode == demo_Record) diff --git a/src/lib/16_in.h b/src/lib/16_in.h index e092c1d4..2ac18893 100644 --- a/src/lib/16_in.h +++ b/src/lib/16_in.h @@ -215,7 +215,8 @@ typedef struct int triggerx; //player's trigger box tile position on the viewable map int triggery; //player's trigger box tile position on the viewable map int setx; //NOT USED YET! player sprite sheet set on the image x - int sety; //NOT USED YET! player sprite sheet set on the image y + int sety; //NOT USED YET! player sprite sheet set on the image y + word d; //direction!! wwww word q; //loop variable word speed; //player speed! bitmap_t data; //supposively the sprite sheet data diff --git a/src/lib/scroll16.c b/src/lib/scroll16.c index 24cb139b..3b6d5bb0 100644 --- a/src/lib/scroll16.c +++ b/src/lib/scroll16.c @@ -27,7 +27,7 @@ void walk(map_view_t *pip, player_t *player, word pn) { #define INC_PER_FRAME if(player[pn].q&1) player[pn].persist_aniframe++; if(player[pn].persist_aniframe>4) player[pn].persist_aniframe = 1; - switch(player[pn].info.dir) + switch(player[pn].d) { //right movement case 3: @@ -42,7 +42,7 @@ void walk(map_view_t *pip, player_t *player, word pn) mapScrollRight(pip, player, 1, pn); modexShowPage(pip[1].page); player[pn].q++; - } else { player[pn].q = 1; player[pn].info.dir = 2; player[pn].tx++; } + } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; } } else if(player[pn].tx < pip[0].map->width && !(pip[0].map->data[(player[pn].tx)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx+1 == TRIGGX && player[pn].ty == TRIGGY)) { @@ -53,7 +53,7 @@ void walk(map_view_t *pip, player_t *player, word pn) animatePlayer(pip, player, pn, 0); modexShowPage(pip[1].page); player[pn].q++; - } else { player[pn].q = 1; player[pn].info.dir = 2; player[pn].tx++; } + } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx++; } } else { @@ -64,7 +64,7 @@ void walk(map_view_t *pip, player_t *player, word pn) modexClearRegion(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 14); #endif modexShowPage(pip[1].page); - player[pn].info.dir = 2; + player[pn].d = 2; } player[pn].triggerx = player[pn].tx+1; player[pn].triggery = player[pn].ty; @@ -83,7 +83,7 @@ void walk(map_view_t *pip, player_t *player, word pn) mapScrollLeft(pip, player, 1, pn); modexShowPage(pip[1].page); player[pn].q++; - } else { player[pn].q = 1; player[pn].info.dir = 2; player[pn].tx--; } + } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; } } else if(player[pn].tx > 1 && !(pip[0].map->data[(player[pn].tx-2)+(pip[0].map->width*(player[pn].ty-1))] == 0))//!(player[pn].tx-1 == TRIGGX && player[pn].ty == TRIGGY)) { @@ -95,7 +95,7 @@ void walk(map_view_t *pip, player_t *player, word pn) animatePlayer(pip, player, pn, 0); modexShowPage(pip[1].page); player[pn].q++; - } else { player[pn].q = 1; player[pn].info.dir = 2; player[pn].tx--; } + } else { player[pn].q = 1; player[pn].d = 2; player[pn].tx--; } } else { @@ -106,7 +106,7 @@ void walk(map_view_t *pip, player_t *player, word pn) modexClearRegion(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 10); #endif modexShowPage(pip[1].page); - player[pn].info.dir = 2; + player[pn].d = 2; } player[pn].triggerx = player[pn].tx-1; player[pn].triggery = player[pn].ty; @@ -125,7 +125,7 @@ void walk(map_view_t *pip, player_t *player, word pn) mapScrollDown(pip, player, 1, pn); modexShowPage(pip[1].page); player[pn].q++; - } else { player[pn].q = 1; player[pn].info.dir = 2; player[pn].ty++; } + } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; } } else if(player[pn].ty < pip[0].map->height && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty+1 == TRIGGY)) { @@ -136,7 +136,7 @@ void walk(map_view_t *pip, player_t *player, word pn) animatePlayer(pip, player, pn, 0); modexShowPage(pip[1].page); player[pn].q++; - } else { player[pn].q = 1; player[pn].info.dir = 2; player[pn].ty++; } + } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty++; } } else { @@ -147,7 +147,7 @@ void walk(map_view_t *pip, player_t *player, word pn) modexClearRegion(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 9); #endif modexShowPage(pip[1].page); - player[pn].info.dir = 2; + player[pn].d = 2; } player[pn].triggerx = player[pn].tx; player[pn].triggery = player[pn].ty+1; @@ -166,7 +166,7 @@ void walk(map_view_t *pip, player_t *player, word pn) mapScrollUp(pip, player, 1, pn); modexShowPage(pip[1].page); player[pn].q++; - } else { player[pn].q = 1; player[pn].info.dir = 2; player[pn].ty--; } + } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; } } else if(player[pn].ty > 1 && !(pip[0].map->data[(player[pn].tx-1)+(pip[0].map->width*(player[pn].ty-2))] == 0))//!(player[pn].tx == TRIGGX && player[pn].ty-1 == TRIGGY)) { @@ -178,7 +178,7 @@ void walk(map_view_t *pip, player_t *player, word pn) animatePlayer(pip, player, 0, pn); modexShowPage(pip[1].page); player[pn].q++; - } else { player[pn].q = 1; player[pn].info.dir = 2; player[pn].ty--; } + } else { player[pn].q = 1; player[pn].d = 2; player[pn].ty--; } } else { @@ -189,7 +189,7 @@ void walk(map_view_t *pip, player_t *player, word pn) modexClearRegion(pip[1].page, player[pn].x-4, player[pn].y-TILEWH, 24, 32, 12); #endif modexShowPage(pip[1].page); - player[pn].info.dir = 2; + player[pn].d = 2; } player[pn].triggerx = player[pn].tx; player[pn].triggery = player[pn].ty-1; @@ -607,17 +607,17 @@ void animatePlayer(map_view_t *pip, player_t *player, word playnum, sword scroll if(!scrollswitch) qq = 0; else qq = ((ls)*player[playnum].speed); - switch (player[playnum].info.dir) + switch (player[playnum].d) { case 0: //up - dire*=player[playnum].info.dir; + dire*=player[playnum].d; x-=4; y-=(qq-TILEWH); break; case 3: // right - dire*=(player[playnum].info.dir-2); + dire*=(player[playnum].d-2); x+=(qq-4); y-=TILEWH; break; @@ -625,13 +625,13 @@ void animatePlayer(map_view_t *pip, player_t *player, word playnum, sword scroll break; case 4: //down - dire*=(player[playnum].info.dir-2); + dire*=(player[playnum].d-2); x-=4; y+=(qq-TILEWH); break; case 1: //left - dire*=(player[playnum].info.dir+2); + dire*=(player[playnum].d+2); x-=(qq-4); y-=TILEWH; break; diff --git a/src/scroll.c b/src/scroll.c index 726753e1..7919971a 100644 --- a/src/scroll.c +++ b/src/scroll.c @@ -156,11 +156,14 @@ void main() player[0].y = player[0].ty*TILEWH; player[0].triggerx = player[0].tx; player[0].triggery = player[0].ty+1; +/* player[0].info.x = player[0].tx; + player[0].info.xaxis = player[0].tx*TILEWH; + player[0].info.y = player[0].ty; + player[0].info.yaxis = player[0].ty*TILEWH;*/ player[0].q=1; - player[0].info.dir=2; + player[0].d=2; player[0].hp=4; - player[0].speed=4; - player[0].persist_aniframe=0; +// player[0].persist_aniframe=0; //npc /*npc0.tx = bg->tx + 1; npc0.ty = bg->ty + 1; @@ -373,7 +376,7 @@ void main() //else printf("\nplayer[0].y: %d\n", player[0].y); printf("player[0].tx: %d", player[0].tx); printf(" player[0].ty: %d\n", player[0].ty); printf("player[0].triggx: %d", player[0].triggerx); printf(" player[0].triggy: %d\n", player[0].triggery); - printf("player[0].hp: %d", (player[0].hp)); printf(" player[0].q: %d", player[0].q); printf(" player[0].info.dir: %d\n", player[0].info.dir); + printf("player[0].hp: %d", (player[0].hp)); printf(" player[0].q: %d", player[0].q); printf(" player[0].info.dir: %d", player[0].info.dir); printf(" player[0].d: %d\n", player[0].d); printf("tile data value at player trigger position: %d\n", bg->map->data[(player[0].triggerx-1)+(map.width*(player[0].triggery-1))]); printf("palette offset: %d\n", paloffset/3); //++++ printf("Total used: %zu\n", oldfreemem-GetFreeSize()); @@ -383,6 +386,9 @@ void main() printf("Screen: %dx", screen.width); printf("%d\n", screen.height); printf("Screen2: %dx", screen2.width); printf("%d\n", screen2.height); printf("map: %dx%d\n", map.width, map.height); + printf("\n"); +// printf("player[0].info.x: %d", player[0].info.xaxis); printf(" player[0].info.y: %d\n", player[0].info.yaxis); +// printf("player[0].info.tx: %d", player[0].info.x); printf(" player[0].info.ty: %d\n", player[0].info.y); //printf("map.width=%d map.height=%d map.data[0]=%d\n", bg->map->width, bg->map->height, bg->map->data[0]); //xmsfree(&map); //xmsfree(bg);