annotate src/projectm/sdltoprojectM.h @ 1872:50f1c5a40a7d

adplug -> new buildsys. Untested, please test!
author Jonathan Schleifer <js@h3c.de>
date Tue, 25 Sep 2007 18:03:21 +0200
parents bc3bae2880ec
children 032053ca08ab
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
358
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
1 /**
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
2 * $Id: sdltoprojectM.h,v 1.1.1.1 2005/12/23 18:42:00 psperl Exp $
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
3 *
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
4 * Translates SDL -> projectM variables
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
5 *
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
6 * $Log: sdltoprojectM.h,v $
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
7 * Revision 1.1.1.1 2005/12/23 18:42:00 psperl
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
8 * Initial Import
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
9 *
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
10 * Revision 1.1 2004/10/08 00:35:28 cvs
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
11 * Moved and imported
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
12 *
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
13 * Revision 1.1.1.1 2004/10/04 12:56:00 cvs
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
14 * Imported
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
15 *
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
16 */
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
17
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
18 #ifndef _SDLTOPROJECTM_H
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
19 #define _SDLTOPROJECTM_H
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
20
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
21 #include "projectM/event.h"
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
22 #ifdef WIN32
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
23 #include <SDL.h>
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
24 #else
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
25 #include <SDL/SDL.h>
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
26 #endif
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
27
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
28 projectMEvent sdl2pmEvent( SDL_Event event ) { \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
29
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
30 switch ( event.type ) { \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
31 case SDL_VIDEORESIZE:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
32 return PROJECTM_VIDEORESIZE; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
33 case SDL_KEYUP: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
34 return PROJECTM_KEYUP; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
35 case SDL_KEYDOWN: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
36 return PROJECTM_KEYDOWN; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
37 case SDL_QUIT: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
38 return PROJECTM_VIDEOQUIT; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
39 default:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
40 return PROJECTM_KEYUP; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
41 } \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
42 } \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
43
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
44 projectMKeycode sdl2pmKeycode( SDLKey keysym ) { \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
45 switch ( keysym ) { \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
46 case SDLK_F1: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
47 return PROJECTM_K_F1; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
48 case SDLK_F2: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
49 return PROJECTM_K_F2; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
50 case SDLK_F3: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
51 return PROJECTM_K_F3; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
52 case SDLK_F4: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
53 return PROJECTM_K_F4; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
54 case SDLK_F5: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
55 return PROJECTM_K_F5; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
56 case SDLK_F6: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
57 return PROJECTM_K_F6; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
58 case SDLK_F7: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
59 return PROJECTM_K_F7; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
60 case SDLK_F8: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
61 return PROJECTM_K_F8; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
62 case SDLK_F9: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
63 return PROJECTM_K_F9; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
64 case SDLK_F10: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
65 return PROJECTM_K_F10; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
66 case SDLK_F11: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
67 return PROJECTM_K_F11; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
68 case SDLK_F12: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
69 return PROJECTM_K_F12; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
70 case SDLK_ESCAPE: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
71 return PROJECTM_K_ESCAPE;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
72 case SDLK_a:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
73 return PROJECTM_K_a;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
74 case SDLK_b:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
75 return PROJECTM_K_b;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
76 case SDLK_c:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
77 return PROJECTM_K_c;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
78 case SDLK_d:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
79 return PROJECTM_K_d;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
80 case SDLK_e:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
81 return PROJECTM_K_e;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
82 case SDLK_f:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
83 return PROJECTM_K_f;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
84 case SDLK_g:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
85 return PROJECTM_K_g;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
86 case SDLK_h:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
87 return PROJECTM_K_h;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
88 case SDLK_i:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
89 return PROJECTM_K_i;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
90 case SDLK_j:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
91 return PROJECTM_K_j;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
92 case SDLK_k:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
93 return PROJECTM_K_k;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
94 case SDLK_l:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
95 return PROJECTM_K_l;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
96 case SDLK_m:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
97 return PROJECTM_K_m;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
98 case SDLK_n:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
99 return PROJECTM_K_n;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
100 case SDLK_o:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
101 return PROJECTM_K_o;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
102 case SDLK_p:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
103 return PROJECTM_K_p;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
104 case SDLK_q:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
105 return PROJECTM_K_q;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
106 case SDLK_r:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
107 return PROJECTM_K_r;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
108 case SDLK_s:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
109 return PROJECTM_K_s;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
110 case SDLK_t:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
111 return PROJECTM_K_t;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
112 case SDLK_u:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
113 return PROJECTM_K_u;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
114 case SDLK_v:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
115 return PROJECTM_K_v;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
116 case SDLK_w:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
117 return PROJECTM_K_w;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
118 case SDLK_x:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
119 return PROJECTM_K_x;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
120 case SDLK_y:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
121 return PROJECTM_K_y;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
122 case SDLK_z:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
123 return PROJECTM_K_z;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
124 case SDLK_UP:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
125 return PROJECTM_K_UP;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
126 case SDLK_RETURN:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
127 return PROJECTM_K_RETURN;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
128 case SDLK_RIGHT:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
129 return PROJECTM_K_RIGHT;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
130 case SDLK_LEFT:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
131 return PROJECTM_K_LEFT;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
132 case SDLK_DOWN:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
133 return PROJECTM_K_DOWN;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
134 case SDLK_PAGEUP:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
135 return PROJECTM_K_PAGEUP;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
136 case SDLK_PAGEDOWN:
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
137 return PROJECTM_K_PAGEDOWN;
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
138
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
139 default: \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
140 return PROJECTM_K_NONE; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
141 } \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
142 } \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
143
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
144 projectMModifier sdl2pmModifier( SDLMod mod ) { \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
145 return PROJECTM_KMOD_LSHIFT; \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
146 } \
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
147
bc3bae2880ec [svn] - add support for projectM
nenolod
parents:
diff changeset
148 #endif /** _SDLTOPROJECTM_H */