]> 4ch.mooo.com Git - 16.git/commitdiff
damn!! hmmm i think ther eis something wrong with the presistant animation stuff
authorsparky4 <sparky4@cock.li>
Fri, 31 Jul 2015 06:37:38 +0000 (01:37 -0500)
committersparky4 <sparky4@cock.li>
Fri, 31 Jul 2015 06:37:38 +0000 (01:37 -0500)
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

16.exe
data/g.pal
inputest.exe
scroll.exe
sountest.exe
src/lib/16_in.c
src/lib/16_in.h
src/lib/scroll16.c
src/scroll.c

diff --git a/16.exe b/16.exe
index 14810f35827d9422f3038beced3696b117531b17..2b6f354912d01c53a43c66174a53e5920f0ea103 100644 (file)
Binary files a/16.exe and b/16.exe differ
index 98c7a21485993fd776b1b35fdb1946cb0f8502e2..cf668e3509805fa4ec96876045fe2f979a02ab37 100644 (file)
Binary files a/data/g.pal and b/data/g.pal differ
index c9ce4abe1c3f8ad7b3f4dce70060149c3ea9f2e4..dc7103f559b9dcd0ad55903bd4e949cd78416997 100644 (file)
Binary files a/inputest.exe and b/inputest.exe differ
index c1e26bc0f29577c4e3764f181311919db36c0006..2f2da6b0246253afc873b0c994708ad2c8cde0fa 100644 (file)
Binary files a/scroll.exe and b/scroll.exe differ
index 40741b6fd6483ffceafb677aa574a2fbf736a753..d15c9b986e175aea3cb032176e685ca6f7ff4d8a 100644 (file)
Binary files a/sountest.exe and b/sountest.exe differ
index fd812ff091a1551b1b4cc2187f50cc2828ae3b55..f07a694f4ea7bd03f85923ed492731913c46a59f 100644 (file)
@@ -799,7 +799,7 @@ IN_ReadCursor(CursorInfo *info)
 ///////////////////////////////////////////////////////////////////////////\r
 void\r
 IN_ReadControl(int playnum,player_t *player)\r
-{\r
+{
                        boolean         realdelta;\r
                        byte            dbyte;\r
                        word            buttons;\r
@@ -811,7 +811,7 @@ register    KeyboardDef     *def;
 \r
        dx = dy = 0;\r
        mx = my = motion_None;\r
-       buttons = 0;\r
+       buttons = 0;
 \r
 #if DEMO0\r
        if (DemoMode == demo_Playback)\r
@@ -849,18 +849,16 @@ register  KeyboardDef     *def;
                                mx = motion_Left,my = motion_Down;\r
                        else if (Keyboard[def->downright])\r
                                mx = motion_Right,my = motion_Down;*/\r
-\r
                        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)\r
-                               my = motion_Up;\r
-                       if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up] && player[playnum].info.dir == 2) || player[playnum].info.dir == 4)\r
-                               my = motion_Down;\r
-\r
+                       if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down] && player[playnum].d == 2))// || player[playnum].info.dir == 0)\r
+                               my = motion_Up;
+                       if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up] && player[playnum].d == 2))// || player[playnum].info.dir == 4)\r
+                               my = motion_Down;
                        }else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){\r
-                       if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right] && player[playnum].info.dir == 2) || player[playnum].info.dir == 1)\r
-                               mx = motion_Left;\r
-                       if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left] && player[playnum].info.dir == 2) || player[playnum].info.dir == 3)\r
-                               mx = motion_Right;\r
+                       if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right] && player[playnum].d == 2))// || player[playnum].info.dir == 1)\r
+                               mx = motion_Left;
+                       if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left] && player[playnum].d == 2))// || player[playnum].info.dir == 3)\r
+                               mx = motion_Right;
                        }\r
                        if (inpu.Keyboard[def->button0])\r
                                buttons += 1 << 0;\r
@@ -895,10 +893,10 @@ register  KeyboardDef     *def;
        }\r
        else\r
        {\r
-               dx = mx * 127;\r
-               dy = my * 127;\r
+               dx = mx;// * 127;\r
+               dy = my;// * 127;\r
        }\r
-\r
+
        player[playnum].info.x = dx;\r
        player[playnum].info.xaxis = mx;\r
        player[playnum].info.y = dy;\r
@@ -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];\r
+       player[playnum].info.dir = DirTable[conpee];
+       if(player[playnum].q==1 && (mx!=motion_None || my!=motion_None))
+       {
+               player[playnum].d = player[playnum].info.dir;
+       }
 \r
 #if DEMO0\r
        if (DemoMode == demo_Record)\r
index e092c1d40e8164dd546dac2776238179cd5cdbe5..2ac1889337d37c542bfafef4fe73e9b93adf5bb5 100644 (file)
@@ -215,7 +215,8 @@ typedef     struct
        int triggerx; //player's trigger box tile position on the viewable map\r
        int triggery; //player's trigger box tile position on the viewable map\r
        int setx; //NOT USED YET! player sprite sheet set on the image x\r
-       int sety; //NOT USED YET! player sprite sheet set on the image y\r
+       int sety; //NOT USED YET! player sprite sheet set on the image y
+       word d; //direction!! wwww\r
        word q; //loop variable
        word speed;             //player speed!\r
        bitmap_t data; //supposively the sprite sheet data\r
index 24cb139b91f316576b9f6321caefe221af68e584..3b6d5bb0cb3ff29f3e65b9417d53ddd218bda97d 100644 (file)
@@ -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;
index 726753e1f02900fe493bc4c08c07bcdedec9c174..7919971abc6a8e4aedf4a3fd07386ced07588c0d 100644 (file)
@@ -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);