Subversion Repositories eduke32

Rev

Rev 4989 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4386 terminx 1
#include "function.h"
4433 terminx 2
#include "compat.h"
4386 terminx 3
 
4
#ifdef __cplusplus
5
extern "C"
6
{
7
#endif
8
 
4434 terminx 9
#define MENU_UP                  0x200
10
#define MENU_DOWN                0x201
11
#define MENU_LEFT                0x202
12
#define MENU_RIGHT               0x203
13
#define MENU_SELECT              0x204
14
#define MENU_BACK                0x205
4386 terminx 15
 
4436 terminx 16
#define KEY_QUICK_CMD    0x1005
17
#define KEY_SHOW_KBRD    0x1008
18
#define KEY_SHOW_INVEN    0x1009
19
#define KEY_QUICK_SAVE    0x100A
20
#define KEY_QUICK_LOAD    0x100B
21
 
22
#define KEY_QUICK_KEY1    0x1011
23
#define KEY_QUICK_KEY2    0x1012
24
#define KEY_QUICK_KEY3    0x1013
25
#define KEY_QUICK_KEY4    0x1014
26
 
4989 terminx 27
// #define BUTTONSET(x,value) (CONTROL_ButtonState |= ((uint64_t)value<<((uint64_t)(x))))
28
// #define BUTTONCLEAR(x) (CONTROL_ButtonState &= ~((uint64_t)1<<((uint64_t)(x))))
4386 terminx 29
 
4436 terminx 30
#define PRECISIONSHOOTFACTOR        0.3f
4386 terminx 31
 
4436 terminx 32
// where do these numbers come from?
5066 terminx 33
#define ANDROIDMOVEFACTOR           6400
34
#define ANDROIDLOOKFACTOR          160000
4436 terminx 35
 
4440 terminx 36
#define ANDROIDPITCHFACTORJOYSTICK          2000
37
#define ANDROIDYAWFACTORJOYSTICK            4000
38
 
39
 
4436 terminx 40
#define MINCONTROLALPHA             0.25f
41
 
4434 terminx 42
typedef enum {
4529 terminx 43
    READ_SCREEN_MODE,
4434 terminx 44
    READ_WEAPONS,
45
    READ_AUTOMAP,
4436 terminx 46
    READ_MAPFOLLOWMODE,
4434 terminx 47
    READ_RENDERER,
48
    READ_LASTWEAPON,
4693 terminx 49
    READ_PAUSED,
4989 terminx 50
    READ_IS_DEAD,
51
    READ_INVENTORY,
52
    READ_SOMETHINGONPLAYER
4434 terminx 53
} portableread_t;
4386 terminx 54
 
4529 terminx 55
 
56
typedef enum {
57
    TOUCH_SCREEN_BLANK, //Nothing on screen (not used)
58
    TOUCH_SCREEN_BLANK_TAP, //One button filling screen with no graphic, tap to send Enter key
59
    TOUCH_SCREEN_YES_NO, //Yes/No buttons on screen, sends Enter or Esc
60
    TOUCH_SCREEN_MENU, //Normal Menu arrows and Enter Esc keys
61
    TOUCH_SCREEN_GAME, //Normal game screen
62
    TOUCH_SCREEN_AUTOMAP, //When auto map is up (not used yet)
63
    TOUCH_SCREEN_CONSOLE //When Console is up
64
} touchscreemode_t;
65
 
66
 
4434 terminx 67
typedef struct
68
{
69
    int32_t crouchToggleState;
70
    int32_t lastWeapon;
4989 terminx 71
    int32_t toggleCrouch;
72
    int32_t quickSelectWeapon;
4386 terminx 73
 
4434 terminx 74
    uint64_t functionSticky; //To let at least one tick
75
    uint64_t functionHeld;
4386 terminx 76
 
4439 terminx 77
    int32_t left_double_action;
78
    int32_t right_double_action;
79
 
4989 terminx 80
    int32_t invertLook, hideStick;
81
 
4434 terminx 82
    double pitch, yaw;
4440 terminx 83
    double pitch_joystick, yaw_joystick;
4434 terminx 84
    float forwardmove, sidemove;
4439 terminx 85
 
86
    // set by configuration UI
87
    float strafe_sens, forward_sens;
88
    float pitch_sens, yaw_sens;
4989 terminx 89
 
90
    float gameControlsAlpha;
4434 terminx 91
} droidinput_t;
4386 terminx 92
 
4436 terminx 93
typedef struct  
94
{
95
    int32_t audio_sample_rate;
96
    int32_t audio_buffer_size;
97
    uint16_t screen_width, screen_height;
98
} droidsysinfo_t;
99
 
4439 terminx 100
extern droidinput_t droidinput;
4436 terminx 101
extern droidsysinfo_t droidinfo;
102
 
4693 terminx 103
 
4434 terminx 104
int PortableKeyEvent(int state, int code, int unicode);
105
int PortableRead(portableread_t r);
106
 
107
void PortableAction(int state, int action);
108
 
4989 terminx 109
void PortableMouseMenu(float x,float y);
110
void PortableMouseMenuButton(int state,int button);
111
 
4434 terminx 112
void PortableMove(float fwd, float strafe);
5066 terminx 113
void PortableLook(float yaw, float pitch);
114
void PortableLookJoystick(float yaw, float pitch);
4434 terminx 115
void PortableCommand(const char * cmd);
116
 
4693 terminx 117
void PortableAutomapControl(float zoom,float dx,float dy);
118
 
4434 terminx 119
void PortableInit(int argc, const char ** argv);
120
 
4693 terminx 121
void AndroidSetConsoleShown(int onf);
122
 
123
 
4386 terminx 124
#ifdef __cplusplus
125
}
126
#endif