From 0ee10557cce8cdd51153aba56a67108047737978 Mon Sep 17 00:00:00 2001 From: Eugenio Favalli Date: Fri, 26 Nov 2004 17:52:41 +0000 Subject: Auto detect keyboard WIN32 --- src/game.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/game.cpp') 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) { -- cgit v1.2.3-70-g09d2