summaryrefslogtreecommitdiff
path: root/src/client/control.c
diff options
context:
space:
mode:
authorDusan Durech <dusan.d@Centrum.sk>2009-06-24 20:05:18 +0200
committerDusan Durech <dusan.d@Centrum.sk>2009-06-24 20:05:18 +0200
commita8607be978f1288a8541b120eae60965f544ec58 (patch)
tree0a78f83f156f033d46b208744d682e0ffc86f069 /src/client/control.c
parent0f02f6efd455329fdcdd4737801b3c1e6cc536d3 (diff)
fix coding style
Diffstat (limited to 'src/client/control.c')
-rw-r--r--src/client/control.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/src/client/control.c b/src/client/control.c
index 5d99c66..342dba5 100644
--- a/src/client/control.c
+++ b/src/client/control.c
@@ -1,4 +1,3 @@
-
#include <SDL.h>
#include <limits.h>
#include <assert.h>
@@ -36,26 +35,21 @@ int control_get_key_route(control_t *my_control)
mapa = SDL_GetKeyState(NULL);
- for (i = 0; i<CONTROL_KEY_COUNT_ROUTE; i++)
- {
- if (mapa[my_control->key[i]] == SDL_PRESSED)
- {
+ for (i = 0; i<CONTROL_KEY_COUNT_ROUTE; i++) {
+ if (mapa[my_control->key[i]] == SDL_PRESSED) {
my_control->count[i]++;
}
- else
- {
+ else {
my_control->count[i] = 0;
}
}
z = INT_MAX;
- for (i = 0; i<CONTROL_KEY_COUNT_ROUTE; i++)
- {
+ for (i = 0; i<CONTROL_KEY_COUNT_ROUTE; i++) {
if ( my_control->count[i] > 0 &&
my_control->count[i] < z &&
- mapa[my_control->key[i]] == SDL_PRESSED )
- {
+ mapa[my_control->key[i]] == SDL_PRESSED ) {
z = my_control->count[i];
ret_key = i;
}
@@ -75,13 +69,11 @@ int control_get_key_action(control_t *my_control)
mapa = SDL_GetKeyState(NULL);
- if (mapa[my_control->key[CONTROL_SHOT]] == SDL_PRESSED)
- {
+ if (mapa[my_control->key[CONTROL_SHOT]] == SDL_PRESSED) {
return CONTROL_SHOT;
}
- if (mapa[my_control->key[CONTROL_SWITCH]] == SDL_PRESSED)
- {
+ if (mapa[my_control->key[CONTROL_SWITCH]] == SDL_PRESSED) {
return CONTROL_SWITCH;
}