2014-03-22 09:25:51 +00:00
|
|
|
#include "function.h"
|
2014-04-12 08:45:50 +00:00
|
|
|
#include "compat.h"
|
2014-03-22 09:25:51 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C"
|
|
|
|
{
|
|
|
|
#endif
|
|
|
|
|
2014-04-12 22:10:36 +00:00
|
|
|
#define MENU_UP 0x200
|
|
|
|
#define MENU_DOWN 0x201
|
|
|
|
#define MENU_LEFT 0x202
|
|
|
|
#define MENU_RIGHT 0x203
|
|
|
|
#define MENU_SELECT 0x204
|
|
|
|
#define MENU_BACK 0x205
|
|
|
|
|
2014-04-13 03:20:17 +00:00
|
|
|
#define KEY_QUICK_CMD 0x1005
|
|
|
|
#define KEY_SHOW_KBRD 0x1008
|
|
|
|
#define KEY_SHOW_INVEN 0x1009
|
|
|
|
#define KEY_QUICK_SAVE 0x100A
|
|
|
|
#define KEY_QUICK_LOAD 0x100B
|
|
|
|
|
|
|
|
#define KEY_QUICK_KEY1 0x1011
|
|
|
|
#define KEY_QUICK_KEY2 0x1012
|
|
|
|
#define KEY_QUICK_KEY3 0x1013
|
|
|
|
#define KEY_QUICK_KEY4 0x1014
|
|
|
|
|
2014-04-12 22:10:36 +00:00
|
|
|
#define BUTTONSET(x,value) (CONTROL_ButtonState |= ((uint64_t)value<<((uint64_t)(x))))
|
|
|
|
#define BUTTONCLEAR(x) (CONTROL_ButtonState &= ~((uint64_t)1<<((uint64_t)(x))))
|
|
|
|
|
2014-04-13 03:20:17 +00:00
|
|
|
#define PRECISIONSHOOTFACTOR 0.3f
|
|
|
|
|
|
|
|
// where do these numbers come from?
|
|
|
|
#define ANDROIDFORWARDMOVEFACTOR 5000
|
|
|
|
#define ANDROIDSIDEMOVEFACTOR 200
|
|
|
|
#define ANDROIDPITCHFACTOR 100000
|
2014-04-15 19:02:48 +00:00
|
|
|
#define ANDROIDYAWFACTOR 160000
|
|
|
|
|
|
|
|
#define ANDROIDPITCHFACTORJOYSTICK 2000
|
|
|
|
#define ANDROIDYAWFACTORJOYSTICK 4000
|
|
|
|
|
2014-04-13 03:20:17 +00:00
|
|
|
|
|
|
|
#define MINCONTROLALPHA 0.25f
|
2014-04-12 22:10:36 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
READ_MENU,
|
|
|
|
READ_WEAPONS,
|
|
|
|
READ_AUTOMAP,
|
2014-04-13 03:20:17 +00:00
|
|
|
READ_MAPFOLLOWMODE,
|
2014-04-12 22:10:36 +00:00
|
|
|
READ_RENDERER,
|
|
|
|
READ_LASTWEAPON,
|
|
|
|
READ_PAUSED
|
|
|
|
} portableread_t;
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int32_t crouchToggleState;
|
|
|
|
int32_t lastWeapon;
|
|
|
|
|
|
|
|
uint64_t functionSticky; //To let at least one tick
|
|
|
|
uint64_t functionHeld;
|
|
|
|
|
2014-04-14 16:30:23 +00:00
|
|
|
int32_t left_double_action;
|
|
|
|
int32_t right_double_action;
|
|
|
|
|
2014-04-12 22:10:36 +00:00
|
|
|
double pitch, yaw;
|
2014-04-15 19:02:48 +00:00
|
|
|
double pitch_joystick, yaw_joystick;
|
2014-04-12 22:10:36 +00:00
|
|
|
float forwardmove, sidemove;
|
2014-04-14 16:30:23 +00:00
|
|
|
|
|
|
|
// set by configuration UI
|
|
|
|
float strafe_sens, forward_sens;
|
|
|
|
float pitch_sens, yaw_sens;
|
2014-04-12 22:10:36 +00:00
|
|
|
} droidinput_t;
|
|
|
|
|
2014-04-13 03:20:17 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int32_t audio_sample_rate;
|
|
|
|
int32_t audio_buffer_size;
|
|
|
|
uint16_t screen_width, screen_height;
|
|
|
|
} droidsysinfo_t;
|
|
|
|
|
2014-04-14 16:30:23 +00:00
|
|
|
extern droidinput_t droidinput;
|
2014-04-13 03:20:17 +00:00
|
|
|
extern droidsysinfo_t droidinfo;
|
2014-04-15 19:02:48 +00:00
|
|
|
extern char toggleCrouch;
|
2014-04-13 03:20:17 +00:00
|
|
|
|
2014-04-12 22:10:36 +00:00
|
|
|
int PortableKeyEvent(int state, int code, int unicode);
|
|
|
|
int PortableRead(portableread_t r);
|
|
|
|
|
|
|
|
void PortableAction(int state, int action);
|
|
|
|
|
|
|
|
void PortableMove(float fwd, float strafe);
|
|
|
|
void PortableLook(double yaw, double pitch);
|
2014-04-15 19:02:48 +00:00
|
|
|
void PortableLookJoystick(double yaw, double pitch);
|
2014-04-12 22:10:36 +00:00
|
|
|
void PortableCommand(const char * cmd);
|
|
|
|
|
|
|
|
void PortableInit(int argc, const char ** argv);
|
2014-03-22 09:25:51 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|