summaryrefslogtreecommitdiff
path: root/src/game.cpp
diff options
context:
space:
mode:
authorEugenio Favalli <elvenprogrammer@gmail.com>2004-11-26 17:52:41 +0000
committerEugenio Favalli <elvenprogrammer@gmail.com>2004-11-26 17:52:41 +0000
commit0ee10557cce8cdd51153aba56a67108047737978 (patch)
tree586830811979edb03697eba90e3dbac20b0a8759 /src/game.cpp
parent11f77c84cdbe8cb0f3968e4008a875b2411a7834 (diff)
downloadmana-client-0ee10557cce8cdd51153aba56a67108047737978.tar.gz
mana-client-0ee10557cce8cdd51153aba56a67108047737978.tar.bz2
mana-client-0ee10557cce8cdd51153aba56a67108047737978.tar.xz
mana-client-0ee10557cce8cdd51153aba56a67108047737978.zip
Auto detect keyboard WIN32
Diffstat (limited to 'src/game.cpp')
-rw-r--r--src/game.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/game.cpp b/src/game.cpp
index a1fb7a54..37f0a000 100644
--- a/src/game.cpp
+++ b/src/game.cpp
@@ -96,7 +96,7 @@ void game() {
status("INIT");
do_init();
init_graphic();
- while(state!=EXIT) {
+ while(state!=EXIT) {
status("INPUT");
do_input();
status("GRAPHIC");
@@ -106,7 +106,7 @@ void game() {
status("FLUSH");
flush();
- rest(1); // This one should work only in Win32
+ //rest(1); // This one should work only in Win32
}
exit_graphic();
@@ -164,7 +164,7 @@ void do_input() {
int x = get_x(player_node->coordinates);
int y = get_y(player_node->coordinates);
- if(key[KEY_UP]) {
+ if(key[KEY_8_PAD]) {
if(get_walk(x, y-1)!=0) {
walk(x, y-1, NORTH);
walk_status = 1;
@@ -174,7 +174,7 @@ void do_input() {
player_node->tick_time = tick_time;
set_coordinates(player_node->coordinates, x, y-1, NORTH);
} else set_coordinates(player_node->coordinates, x, y, NORTH);
- } else if(key[KEY_DOWN]) {
+ } else if(key[KEY_2_PAD]) {
if(get_walk(x, y+1)!=0) {
walk(x, y+1, SOUTH);
walk_status = 1;
@@ -184,7 +184,7 @@ void do_input() {
player_node->tick_time = tick_time;
set_coordinates(player_node->coordinates, x, y+1, SOUTH);
} else set_coordinates(player_node->coordinates, x, y, SOUTH);
- } else if(key[KEY_LEFT]) {
+ } else if(key[KEY_4_PAD]) {
if(get_walk(x-1, y)!=0) {
walk(x-1, y, WEST);
walk_status = 1;
@@ -194,7 +194,7 @@ void do_input() {
player_node->tick_time = tick_time;
set_coordinates(player_node->coordinates, x-1, y, WEST);
} else set_coordinates(player_node->coordinates, x, y, WEST);
- } else if(key[KEY_RIGHT]) {
+ } else if(key[KEY_6_PAD]) {
if(get_walk(x+1, y)!=0) {
walk(x+1, y, EAST);
walk_status = 1;
@@ -347,9 +347,11 @@ void do_parse() {
if((i+1)%10==0)fprintf(file, "\n");
}
fclose(file);*/
+#ifdef DEBUG
FILE *file = fopen("./docs/packet.list", "ab");
fprintf(file, "%x\n", RFIFOW(0));
fclose(file);
+#endif
// Parse packet based on their id
switch(id) {