\r
static Direction DirTable[] = // Quick lookup for total direction\r
{\r
- //dir_Nortinest,
- dir_North,
+ //dir_Nortinest,\r
+ dir_North,\r
dir_West,\r
- dir_None, \r
- dir_East,
- dir_South
+ dir_None,\r
+ dir_East,\r
+ dir_South\r
//dir_NorthEast,\r
//dir_Soutinest,\r
//,dir_SouthEast\r
// player and fills in the control info struct\r
//\r
///////////////////////////////////////////////////////////////////////////\r
-void\r
+void near\r
IN_ReadControl(int playnum,player_t *player)\r
-{
+{\r
boolean realdelta;\r
byte dbyte;\r
word buttons;\r
int dx,dy;\r
Motion mx,my;\r
- ControlType type;
+ ControlType type;\r
sword conpee;\r
register KeyboardDef *def;\r
\r
dx = dy = 0;\r
mx = my = motion_None;\r
- buttons = 0;
+ buttons = 0;\r
\r
#if DEMO0\r
if (DemoMode == demo_Playback)\r
mx = motion_Left,my = motion_Down;\r
else if (Keyboard[def->downright])\r
mx = motion_Right,my = motion_Down;*/\r
- if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){
+ if(!inpu.Keyboard[def->left] && !inpu.Keyboard[def->right]){\r
if((inpu.Keyboard[def->up] && !inpu.Keyboard[def->down] && player[playnum].d == 2))// || player[playnum].info.dir == 0)\r
- my = motion_Up;
+ my = motion_Up;\r
if((inpu.Keyboard[def->down] && !inpu.Keyboard[def->up] && player[playnum].d == 2))// || player[playnum].info.dir == 4)\r
- my = motion_Down;
+ my = motion_Down;\r
}else if(!inpu.Keyboard[def->up] && !inpu.Keyboard[def->down]){\r
if((inpu.Keyboard[def->left] && !inpu.Keyboard[def->right] && player[playnum].d == 2))// || player[playnum].info.dir == 1)\r
- mx = motion_Left;
+ mx = motion_Left;\r
if((inpu.Keyboard[def->right] && !inpu.Keyboard[def->left] && player[playnum].d == 2))// || player[playnum].info.dir == 3)\r
- mx = motion_Right;
+ mx = motion_Right;\r
}\r
if (inpu.Keyboard[def->button0])\r
buttons += 1 << 0;\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
player[playnum].info.button1 = buttons & (1 << 1);\r
player[playnum].info.button2 = buttons & (1 << 2);\r
player[playnum].info.button3 = buttons & (1 << 3);\r
-// 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];
- if(player[playnum].q==1 && (mx!=motion_None || my!=motion_None))
- {
- player[playnum].d = player[playnum].info.dir;
- }
+// player[playnum].info.dir = DirTable[((my + 1) * 3) + (mx + 1)];\r
+ conpee=(((my + 1) * 2) + (mx + 1));\r
+ if(conpee) conpee--;\r
+ player[playnum].info.dir = DirTable[conpee];\r
+ if(player[playnum].q==1 && (mx!=motion_None || my!=motion_None))\r
+ {\r
+ player[playnum].d = player[playnum].info.dir;\r
+ }\r
\r
#if DEMO0\r
if (DemoMode == demo_Record)\r
}\r
}\r
#endif\r
-#ifdef TESTCONTROLNOISY
-if((inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right])&& player[playnum].info.dir!=2)
-{
- printf("(mx)=%d ", mx);
- printf("(my)=%d ", my);
- printf("dir=%d\n", player[playnum].info.dir);
+#ifdef TESTCONTROLNOISY\r
+if((inpu.Keyboard[def->up] || inpu.Keyboard[def->down] || inpu.Keyboard[def->left] || inpu.Keyboard[def->right])&& player[playnum].info.dir!=2)\r
+{\r
+ printf("(mx)=%d ", mx);\r
+ printf("(my)=%d ", my);\r
+ printf("dir=%d\n", player[playnum].info.dir);\r
}\r
#endif\r
}\r
}\r
\r
boolean IN_qb(byte kee)\r
-{
+{\r
#ifdef TESTKEYIN\r
- printf("%u\n", inpu.Keyboard[kee]);
+ printf("%u\n", inpu.Keyboard[kee]);\r
#endif\r
if(inpu.Keyboard[kee]==true) return 1;\r
else return 0;\r
#define __16_IN__\r
\r
#include <string.h>\r
-#include "src/lib/16_head.h"
+#include "src/lib/16_head.h"\r
#include "src/lib/bitmap.h"\r
\r
#ifdef __DEBUG__\r
dir_South,//dir_Soutinest,\r
} Direction;\r
typedef struct {\r
- boolean button0,button1,button2,button3;\r
- int x,y;\r
- Motion xaxis,yaxis;\r
- Direction dir;\r
+ boolean near button0,button1,button2,button3;\r
+ int near x,y;\r
+ Motion near xaxis,yaxis;\r
+ Direction near dir;\r
} CursorInfo;\r
\r
typedef struct {\r
- ScanCode button0,button1,\r
+ ScanCode near button0,button1,\r
//upleft,\r
up,\r
down,\r
;\r
} KeyboardDef;\r
typedef struct {\r
- word joyMinX,joyMinY,\r
+ word near joyMinX,joyMinY,\r
threshMinX,threshMinY,\r
threshMaxX,threshMaxY,\r
joyMaxX,joyMaxY,\r
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 sheetsetx; //NOT USED YET! player sprite sheet set on the image x\r
- int sheetsety; //NOT USED YET! player sprite sheet set on the image y
+ int sheetsety; //NOT USED YET! player sprite sheet set on the image y\r
word d; //direction!! wwww\r
- word q; //loop variable
+ word q; //loop variable\r
word speed; //player speed!\r
bitmap_t data; //supposively the sprite sheet data\r
- sword hp; //hitpoints of the player
+ sword hp; //hitpoints of the player\r
int persist_aniframe; /* gonna be increased to 1 before being used, so 0 is ok for default */\r
CursorInfo info;\r
- ControlType Controls;
+ ControlType Controls;\r
} player_t;\r
\r
/*\r
extern void IN_ClearKeysDown();\r
//static void INL_AdjustCursor(CursorInfo *info,word buttons,int dx,int dy);\r
extern void IN_ReadCursor(CursorInfo *info);\r
-extern void IN_ReadControl(int playnum,player_t *player);\r
+extern void near IN_ReadControl(int playnum,player_t *player);\r
extern void IN_SetControlType(word playnum,player_t *player,ControlType type);\r
#if DEMO0\r
extern boolean IN_StartDemoRecord(word bufsize);\r