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
|
|
|
|
|
2015-02-11 05:22:19 +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-12 22:10:36 +00:00
|
|
|
|
2014-04-13 03:20:17 +00:00
|
|
|
#define PRECISIONSHOOTFACTOR 0.3f
|
|
|
|
|
|
|
|
// where do these numbers come from?
|
2015-03-24 00:40:01 +00:00
|
|
|
#define ANDROIDMOVEFACTOR 6400
|
|
|
|
#define ANDROIDLOOKFACTOR 160000
|
2014-04-15 19:02:48 +00:00
|
|
|
|
|
|
|
#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 {
|
2014-07-06 00:10:33 +00:00
|
|
|
READ_SCREEN_MODE,
|
2014-04-12 22:10:36 +00:00
|
|
|
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,
|
2014-10-29 17:03:50 +00:00
|
|
|
READ_PAUSED,
|
2015-02-11 05:22:19 +00:00
|
|
|
READ_IS_DEAD,
|
|
|
|
READ_INVENTORY,
|
|
|
|
READ_SOMETHINGONPLAYER
|
2014-04-12 22:10:36 +00:00
|
|
|
} portableread_t;
|
|
|
|
|
2014-07-06 00:10:33 +00:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
TOUCH_SCREEN_BLANK, //Nothing on screen (not used)
|
|
|
|
TOUCH_SCREEN_BLANK_TAP, //One button filling screen with no graphic, tap to send Enter key
|
|
|
|
TOUCH_SCREEN_YES_NO, //Yes/No buttons on screen, sends Enter or Esc
|
|
|
|
TOUCH_SCREEN_MENU, //Normal Menu arrows and Enter Esc keys
|
|
|
|
TOUCH_SCREEN_GAME, //Normal game screen
|
|
|
|
TOUCH_SCREEN_AUTOMAP, //When auto map is up (not used yet)
|
|
|
|
TOUCH_SCREEN_CONSOLE //When Console is up
|
|
|
|
} touchscreemode_t;
|
|
|
|
|
|
|
|
|
2014-04-12 22:10:36 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
int32_t crouchToggleState;
|
|
|
|
int32_t lastWeapon;
|
2015-02-11 05:22:19 +00:00
|
|
|
int32_t toggleCrouch;
|
|
|
|
int32_t quickSelectWeapon;
|
2014-04-12 22:10:36 +00:00
|
|
|
|
|
|
|
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;
|
|
|
|
|
2015-02-11 05:22:19 +00:00
|
|
|
int32_t invertLook, hideStick;
|
|
|
|
|
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;
|
2015-02-11 05:22:19 +00:00
|
|
|
|
|
|
|
float gameControlsAlpha;
|
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-10-29 17:03:50 +00:00
|
|
|
|
2015-07-08 03:34:24 +00:00
|
|
|
int PortableTimer(int tics);
|
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);
|
|
|
|
|
2015-02-11 05:22:19 +00:00
|
|
|
void PortableMouseMenu(float x,float y);
|
|
|
|
void PortableMouseMenuButton(int state,int button);
|
|
|
|
|
2014-04-12 22:10:36 +00:00
|
|
|
void PortableMove(float fwd, float strafe);
|
2015-03-24 00:40:01 +00:00
|
|
|
void PortableLook(float yaw, float pitch);
|
|
|
|
void PortableLookJoystick(float yaw, float pitch);
|
2014-04-12 22:10:36 +00:00
|
|
|
void PortableCommand(const char * cmd);
|
|
|
|
|
2014-10-29 17:03:50 +00:00
|
|
|
void PortableAutomapControl(float zoom,float dx,float dy);
|
|
|
|
|
2014-04-12 22:10:36 +00:00
|
|
|
void PortableInit(int argc, const char ** argv);
|
2014-03-22 09:25:51 +00:00
|
|
|
|
2014-10-29 17:03:50 +00:00
|
|
|
void AndroidSetConsoleShown(int onf);
|
|
|
|
|
|
|
|
|
2014-03-22 09:25:51 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|