int x = event->x, y = event->y;
int width = event->width, height = event->height;
- if (setup.direct_draw_on && game_status==PLAYING)
+ if (setup.direct_draw && game_status==PLAYING)
{
int xx,yy;
int x1 = (x-SX)/TILEX, y1 = (y-SY)/TILEY;
SetDrawtoField(DRAW_DIRECT);
}
- if (setup.soft_scrolling_on && game_status == PLAYING)
+ if (setup.soft_scrolling && game_status == PLAYING)
{
int fx = FX, fy = FY;
if (key_status == KEY_PRESSED)
{
if (network_playing)
- local_player->action |= key_action;
+ stored_player[pnr].potential_action |= key_action;
else
stored_player[pnr].action |= key_action;
}
else
{
if (network_playing)
- local_player->action &= ~key_action;
+ stored_player[pnr].potential_action &= ~key_action;
else
stored_player[pnr].action &= ~key_action;
}
local_player->dynamite = 1000;
break;
+
+
+#if 0
+
case XK_x:
{
break;
-
-#if 0
case XK_y:
/*
{
}
*/
- printf("direct_draw_on == %d\n", setup.direct_draw_on);
+ printf("direct_draw == %d\n", setup.direct_draw);
break;
-#endif
-
case XK_z:
{
}
break;
+#endif
#endif
default:
}
}
+static int HandleJoystickForAllPlayers()
+{
+ int i;
+ int result = 0;
+
+ for (i=0; i<MAX_PLAYERS; i++)
+ {
+ byte joy_action = 0;
+
+ if (!setup.input[i].use_joystick)
+ continue;
+
+ joy_action = Joystick(i);
+
+ result |= joy_action;
+
+ if (network_playing)
+ stored_player[i].potential_action = joy_action;
+ else
+ stored_player[i].action = joy_action;
+ }
+
+ return result;
+}
+
void HandleJoystick()
{
- int joystick = Joystick();
+ int joystick = HandleJoystickForAllPlayers();
int keyboard = key_joystick_mapping;
int joy = (joystick | keyboard);
int left = joy & JOY_LEFT;
int up = joy & JOY_UP;
int down = joy & JOY_DOWN;
int button = joy & JOY_BUTTON;
- int newbutton = (JoystickButton() == JOY_BUTTON_NEW_PRESSED);
+ int newbutton = (AnyJoystickButton() == JOY_BUTTON_NEW_PRESSED);
int dx = (left ? -1 : right ? 1 : 0);
int dy = (up ? -1 : down ? 1 : 0);
return;
}
- /*
- if (tape.pausing || AllPlayersGone)
- {
- int i;
-
- for (i=0; i<MAX_PLAYERS; i++)
- stored_player[i].action = 0;
- }
- */
-
HandleGameActions();
break;