… | |
… | |
9 | #include <string.h> |
9 | #include <string.h> |
10 | #include <stdio.h> |
10 | #include <stdio.h> |
11 | |
11 | |
12 | #include <SDL.h> |
12 | #include <SDL.h> |
13 | #include <SDL_image.h> |
13 | #include <SDL_image.h> |
|
|
14 | #include <SDL_mixer.h> |
14 | #include <SDL_opengl.h> |
15 | #include <SDL_opengl.h> |
15 | |
16 | |
16 | #include <glib/gmacros.h> |
17 | #include <glib/gmacros.h> |
17 | |
18 | |
18 | #include <pango/pango.h> |
19 | #include <pango/pango.h> |
… | |
… | |
36 | |
37 | |
37 | #define FOW_DARKNESS 32 |
38 | #define FOW_DARKNESS 32 |
38 | |
39 | |
39 | #define MAP_EXTEND_X 32 |
40 | #define MAP_EXTEND_X 32 |
40 | #define MAP_EXTEND_Y 512 |
41 | #define MAP_EXTEND_Y 512 |
|
|
42 | |
|
|
43 | typedef Mix_Chunk *CFClient__MixChunk; |
|
|
44 | typedef Mix_Music *CFClient__MixMusic; |
41 | |
45 | |
42 | static PangoContext *context; |
46 | static PangoContext *context; |
43 | static PangoFontMap *fontmap; |
47 | static PangoFontMap *fontmap; |
44 | |
48 | |
45 | typedef struct cf_layout { |
49 | typedef struct cf_layout { |
… | |
… | |
406 | ); |
410 | ); |
407 | SDL_WM_SetCaption ("Crossfire+ Client " VERSION, "Crossfire+"); |
411 | SDL_WM_SetCaption ("Crossfire+ Client " VERSION, "Crossfire+"); |
408 | OUTPUT: |
412 | OUTPUT: |
409 | RETVAL |
413 | RETVAL |
410 | |
414 | |
|
|
415 | int |
|
|
416 | Mix_VolumeMusic (int newvol = -1) |
|
|
417 | |
|
|
418 | int |
|
|
419 | Mix_OpenAudio (int frequency = 22050, int format = MIX_DEFAULT_FORMAT, int channels = 1, int chunksize = 512) |
|
|
420 | |
|
|
421 | void |
|
|
422 | Mix_CloseAudio () |
|
|
423 | |
|
|
424 | int |
|
|
425 | Mix_AllocateChannels (int numchans = -1) |
|
|
426 | |
411 | void |
427 | void |
412 | lowdelay (int fd, int val = 1) |
428 | lowdelay (int fd, int val = 1) |
413 | CODE: |
429 | CODE: |
414 | #ifndef _WIN32 |
430 | #ifndef _WIN32 |
415 | setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof (val)); |
431 | setsockopt (fd, IPPROTO_TCP, TCP_NODELAY, &val, sizeof (val)); |
… | |
… | |
1151 | } |
1167 | } |
1152 | } |
1168 | } |
1153 | } |
1169 | } |
1154 | } |
1170 | } |
1155 | |
1171 | |
|
|
1172 | MODULE = CFClient PACKAGE = CFClient::MixChunk |
|
|
1173 | |
|
|
1174 | CFClient::MixChunk |
|
|
1175 | new_from_file (SV *class, char *path) |
|
|
1176 | CODE: |
|
|
1177 | RETVAL = Mix_LoadWAV (path); |
|
|
1178 | OUTPUT: |
|
|
1179 | RETVAL |
|
|
1180 | |
|
|
1181 | void |
|
|
1182 | DESTROY (CFClient::MixChunk self) |
|
|
1183 | CODE: |
|
|
1184 | Mix_FreeChunk (self); |
|
|
1185 | |
|
|
1186 | int |
|
|
1187 | volume (CFClient::MixChunk self, int volume = -1) |
|
|
1188 | CODE: |
|
|
1189 | RETVAL = Mix_VolumeChunk (self, volume); |
|
|
1190 | OUTPUT: |
|
|
1191 | RETVAL |
|
|
1192 | |
|
|
1193 | int |
|
|
1194 | play (CFClient::MixChunk self, int channel = -1, int loops = 0, int ticks = -1) |
|
|
1195 | CODE: |
|
|
1196 | RETVAL = Mix_PlayChannelTimed (channel, self, loops, ticks); |
|
|
1197 | OUTPUT: |
|
|
1198 | RETVAL |
|
|
1199 | |
|
|
1200 | MODULE = CFClient PACKAGE = CFClient::MixMusic |
|
|
1201 | |
|
|
1202 | int |
|
|
1203 | volume (int volume = -1) |
|
|
1204 | CODE: |
|
|
1205 | RETVAL = Mix_VolumeMusic (volume); |
|
|
1206 | OUTPUT: |
|
|
1207 | RETVAL |
|
|
1208 | |
|
|
1209 | CFClient::MixMusic |
|
|
1210 | new_from_file (SV *class, char *path) |
|
|
1211 | CODE: |
|
|
1212 | RETVAL = Mix_LoadMUS (path); |
|
|
1213 | OUTPUT: |
|
|
1214 | RETVAL |
|
|
1215 | |
|
|
1216 | void |
|
|
1217 | DESTROY (CFClient::MixMusic self) |
|
|
1218 | CODE: |
|
|
1219 | Mix_FreeMusic (self); |
|
|
1220 | |
|
|
1221 | int |
|
|
1222 | play (CFClient::MixMusic self, int loops = -1) |
|
|
1223 | CODE: |
|
|
1224 | RETVAL = Mix_PlayMusic (self, loops); |
|
|
1225 | OUTPUT: |
|
|
1226 | RETVAL |
|
|
1227 | |