forked from teamhimeh/simutrans
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simsys.h
176 lines (126 loc) · 3.03 KB
/
simsys.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
/*
* Copyright (c) 2001 Hansjörg Malthaner
*
* Usage for Iso-Angband is granted. Usage in other projects is not
* permitted without the agreement of the author.
*/
#ifndef simsys_h
#define simsys_h
#ifdef __cplusplus
extern "C" {
#endif
#ifndef TRUE
#define TRUE 1
#define FALSE 0
#endif
/* Variablen zur Messageverarbeitung */
/* Klassen */
#define SIM_NOEVENT 0
#define SIM_MOUSE_BUTTONS 1
#define SIM_KEYBOARD 2
#define SIM_MOUSE_MOVE 3
#define SIM_SYSTEM 254
#define SIM_IGNORE_EVENT 255
/* Aktionen */ /* added RIGHTUP and MIDUP */
#define SIM_MOUSE_LEFTUP 1
#define SIM_MOUSE_RIGHTUP 2
#define SIM_MOUSE_MIDUP 3
#define SIM_MOUSE_LEFTBUTTON 4
#define SIM_MOUSE_RIGHTBUTTON 5
#define SIM_MOUSE_MIDBUTTON 6
#define SIM_MOUSE_MOVED 7
#define SIM_MOUSE_WHEELUP 8 //2003-11-04 hsiegeln added
#define SIM_MOUSE_WHEELDOWN 9 //2003-11-04 hsiegeln added
#define SIM_SYSTEM_QUIT 1
#define SIM_F1 256
/* Globale Variablen zur Messagebearbeitung */
struct sys_event
{
unsigned long type;
unsigned long code;
int mx; /* es sind negative Koodinaten mgl */
int my;
unsigned int key_mod; /* key mod, like ALT, STRG, SHIFT */
};
extern struct sys_event sys_event;
int dr_os_init(int n, int *parameter);
int dr_os_open(int w, int h);
int dr_os_close();
/**
* MIDI initialisation routine
*/
void dr_init_midi();
/**
* Sound initialisation routine
*/
void dr_init_sound();
unsigned char * dr_textur_init();
/**
* Does this system wrapper need software cursor?
* @return true if a software cursor is needed
* @author Hj. Malthaner
*/
int dr_use_softpointer();
void dr_textur(int xp, int yp, int w, int h);
void dr_flush();
void dr_setRGB8multi(int first, int count, unsigned char * data);
void show_pointer(int yesno);
void move_pointer(int x, int y);
void ex_ord_update_mx_my();
void GetEvents();
void GetEventsNoWait();
unsigned long dr_time(void);
void dr_sleep(unsigned long usec);
/**
* loads a sample
* @return a handle for that sample or -1 on failure
* @author Hj. Malthaner
*/
int dr_load_sample(const char *filename);
/**
* plays a sample
* @param key the key for the sample to be played
* @author Hj. Malthaner
*/
void dr_play_sample(int key, int volume);
/**
* sets midi playback volume
* @param vol volume in range 0..255
* @author Hj. Malthaner
*/
void dr_set_midi_volume(int vol);
/**
* gets midi title
* @author Hj. Malthaner
*/
const char * dr_get_midi_title(int index);
/**
* MIDI playing routines
* @author Owen Rudge
*/
int dr_load_midi(const char *filename);
/**
* MIDI playing routines
* @author Owen Rudge
*/
void dr_play_midi(int key);
/**
* MIDI playing routines
* @author Owen Rudge
*/
void dr_stop_midi();
/**
* MIDI playing routines
* @author Owen Rudge
*/
long dr_midi_pos();
/**
* Midi shutdown/cleanup
* @author Owen Rudge
*/
void dr_destroy_midi();
void set_midi_pos(int);
#ifdef __cplusplus
}
#endif
#endif