]> 4ch.mooo.com Git - 16.git/commitdiff
wwww porting~
authorsparky4 <sparky4@cock.li>
Mon, 29 Jun 2015 18:28:17 +0000 (13:28 -0500)
committersparky4 <sparky4@cock.li>
Mon, 29 Jun 2015 18:28:17 +0000 (13:28 -0500)
modified:   inputest.exe
modified:   src/lib/16_in.c
modified:   src/lib/16_in.h
modified:   src/lib/scroll16.c
modified:   src/lib/scroll16.h

inputest.exe
src/lib/16_in.c
src/lib/16_in.h
src/lib/scroll16.c
src/lib/scroll16.h

index 5b6c428d0d1fb400a0b5a8346a724376ae0a65ea..e48d05c4da524c63c0dabe98ab8e24b63218b220 100644 (file)
Binary files a/inputest.exe and b/inputest.exe differ
index ff9c576e8925d9106255c3f6d9975883a21657a1..2878be77c71f4c15d9eb6c645f1b4c26a7432bef 100644 (file)
@@ -849,18 +849,19 @@ register  KeyboardDef     *def;
                        else if (Keyboard[def->downright])\r
                                mx = motion_Right,my = motion_Down;*/\r
 \r
-                       if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){\r
-                       if (inpu.Keyboard[def->up])\r
+                       //if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){
+                       \r
+                       if((inpu.Keyboard[def->up] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 0)\r
                                my = motion_Up;\r
-                       else if (inpu.Keyboard[def->down])\r
+                       else if((inpu.Keyboard[def->down] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 4)\r
                                my = motion_Down;\r
 \r
-                       }else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){\r
-                       if (inpu.Keyboard[def->left])\r
+                       //}else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){\r
+                       if((inpu.Keyboard[def->left] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 1)\r
                                mx = motion_Left;\r
-                       else if (inpu.Keyboard[def->right])\r
+                       else if((inpu.Keyboard[def->right] && player[playnum].info.dir == 2))// || player[playnum].info.dir == 3)\r
                                mx = motion_Right;\r
-                       }\r
+                       //}\r
                        if (inpu.Keyboard[def->button0])\r
                                buttons += 1 << 0;\r
                        if (inpu.Keyboard[def->button1])\r
index 5aeecc077fe4d043ae836b52fd58d3aeadabc4a6..1036b6ec8eeaaa7e9294e8fbaa3ee21823a2c50d 100644 (file)
@@ -207,6 +207,18 @@ typedef    struct
 
 typedef        struct
 {
+       int x; //player exact position on the viewable map
+       int y; //player exact position on the viewable map
+       int tx; //player tile position on the viewable map
+       int ty; //player tile position on the viewable map
+       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
+       word q; //loop variable
+//     word d; //direction
+       //bitmap_t data; //supposively the sprite sheet data
+       int hp; //hitpoints of the player
        CursorInfo      info;
        ControlType     Controls;
 } player_t;
index f02a5be14bd1b375b5b528668bb4ca7431e95c26..40acf484e58b9cf82166540325cd6c3058075a4b 100644 (file)
        scroll16 library~
 */
 #include "src/lib/scroll16.h"
+
+/*void animatePlayer(player_t *player,word playnum, short scrolloffsetswitch, int ls, bitmap_t *bmp)
+{
+       sword dire=32; //direction
+       sword qq; //scroll offset
+
+       if(scrolloffsetswitch==0) qq = 0;
+       else qq = ((player[playnum]->p)*player[playnum]->speed);
+       switch (player[playnum]->dir)
+       {
+               case 0:
+                       //up
+                       dire*=player[playnum]->dir;
+                       player[playnum]->x=player[playnum]->x-4;
+                       player[playnum]->y=player[playnum]->y-qq-TILEWH;
+               break;
+               case 1:
+                       // right
+                       dire*=(player[playnum]->dir-2);
+                       player[playnum]->x=player[playnum]->x+qq-4;
+                       player[playnum]->y=player[playnum]->y-TILEWH;
+               break;
+               case 2:
+               break;
+               case 3:
+                       //down
+                       dire*=(player[playnum]->dir-2)
+                       player[playnum]->x=player[playnum]->x-4;
+                       player[playnum]->y=player[playnum]->y+qq-TILEWH;
+               break;
+               case 4:
+                       //left
+                       dire*=(player[playnum]->dir+2)
+                       player[playnum]->x=player[playnum]->x-qq-4;
+                       player[playnum]->y=player[playnum]->y-TILEWH;
+               break;
+       }
+//     modexCopyPageRegion(dest->page, src->page, x-4, y-4, x-4, y-4, 28, 40);
+//     if(2>ls && ls>=1) { modexDrawSpriteRegion(dest->page, x, y, 48, dire, 24, 32, bmp); }else
+//     if(3>ls && ls>=2) { modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); }else
+//     if(4>ls && ls>=3) { modexDrawSpriteRegion(dest->page, x, y, 0, dire, 24, 32, bmp); }else
+//     if(5>ls && ls>=4) { modexDrawSpriteRegion(dest->page, x, y, 24, dire, 24, 32, bmp); }
+       //TODO: mask copy //modexCopyPageRegion(dest->page, src->page, x-4, y-4, x-4, y-4, 28, 40);
+       //modexClearRegion(top->page, 66, 66, 2, 40, 0);
+       //modexCopyPageRegion(dest->page, top->page, 66, 66, 66, 66, 2, 40);
+       //turn this off if XT
+       //XTif(detectcpu() > 0)
+//     modexWaitBorder();
+}*/
index baac6a8ff34bf1ee398e038cfa8d4e282eea38d4..e7fa1e166ce8492ad94d7cfa31117f81215133c0 100644 (file)
 #ifndef __SCROLL16_H_
 #define __SCROLL16_H_
 
+#include "src/lib/16_in.h"
+
+//#define TILEWH 16
+//#define SPEED 4
+
+//void animatePlayer(player_t *player, short scrolloffsetswitch, int ls, bitmap_t *bmp);
 
 #endif /*__SCROLL16_H_*/