local_player->mouse_action.ly = ly;
local_player->mouse_action.button = button;
- if (tape.recording && tape.pausing && tape.event_mask == GAME_EVENTS_MOUSE)
+ if (tape.recording && tape.pausing && (tape.event_mask & GAME_EVENTS_MOUSE))
{
// un-pause a paused game only if mouse button was newly pressed down
if (new_button)
{
if (strEqual(setup.touch.control_type, TOUCH_CONTROL_FOLLOW_FINGER))
HandleButtonOrFinger_FollowFinger(mx, my, button);
- else if (game.event_mask == GAME_EVENTS_MOUSE && valid_mouse_event)
+ else if ((game.event_mask & GAME_EVENTS_MOUSE) && valid_mouse_event)
SetPlayerMouseAction(mx, my, button);
}
}
if (stored_player[pnr].snap_action)
stored_player[pnr].action |= JOY_BUTTON_SNAP;
- if (tape.recording && tape.pausing && tape.event_mask == GAME_EVENTS_KEYS)
+ if (tape.recording && tape.pausing && (tape.event_mask & GAME_EVENTS_KEYS))
{
if (tape.single_step)
{
return;
}
- if (tape.recording && tape.pausing && tape.event_mask == GAME_EVENTS_KEYS)
+ if (tape.recording && tape.pausing && (tape.event_mask & GAME_EVENTS_KEYS))
{
if (tape.single_step)
{
{
int tape_pos_size = 0;
- if (tape->event_mask == GAME_EVENTS_KEYS)
+ if (tape->event_mask & GAME_EVENTS_KEYS)
tape_pos_size += tape->num_participating_players;
- else
+
+ if (tape->event_mask & GAME_EVENTS_MOUSE)
tape_pos_size += 3; // x and y position and mouse button mask
tape_pos_size += 1; // tape action delay value
break;
}
- if (tape->event_mask == GAME_EVENTS_MOUSE)
- {
- tape->pos[i].action[TAPE_ACTION_LX] = getFile8Bit(file);
- tape->pos[i].action[TAPE_ACTION_LY] = getFile8Bit(file);
- tape->pos[i].action[TAPE_ACTION_BUTTON] = getFile8Bit(file);
-
- tape->pos[i].action[TAPE_ACTION_UNUSED] = 0;
- }
- else
+ if (tape->event_mask & GAME_EVENTS_KEYS)
{
for (j = 0; j < MAX_PLAYERS; j++)
{
}
}
+ if (tape->event_mask & GAME_EVENTS_MOUSE)
+ {
+ tape->pos[i].action[TAPE_ACTION_LX] = getFile8Bit(file);
+ tape->pos[i].action[TAPE_ACTION_LY] = getFile8Bit(file);
+ tape->pos[i].action[TAPE_ACTION_BUTTON] = getFile8Bit(file);
+ }
+
tape->pos[i].delay = getFile8Bit(file);
if (tape->file_version == FILE_VERSION_1_0)
for (i = 0; i < tape->length; i++)
{
- if (tape->event_mask == GAME_EVENTS_MOUSE)
- {
- putFile8Bit(file, tape->pos[i].action[TAPE_ACTION_LX]);
- putFile8Bit(file, tape->pos[i].action[TAPE_ACTION_LY]);
- putFile8Bit(file, tape->pos[i].action[TAPE_ACTION_BUTTON]);
- }
- else
+ if (tape->event_mask & GAME_EVENTS_KEYS)
{
for (j = 0; j < MAX_PLAYERS; j++)
if (tape->player_participates[j])
putFile8Bit(file, tape->pos[i].action[j]);
}
+ if (tape->event_mask & GAME_EVENTS_MOUSE)
+ {
+ putFile8Bit(file, tape->pos[i].action[TAPE_ACTION_LX]);
+ putFile8Bit(file, tape->pos[i].action[TAPE_ACTION_LY]);
+ putFile8Bit(file, tape->pos[i].action[TAPE_ACTION_BUTTON]);
+ }
+
putFile8Bit(file, tape->pos[i].delay);
}
}
HAS_CHANGE_EVENT(element, CE_PRESSED_BY_MOUSE) ||
HAS_CHANGE_EVENT(element, CE_MOUSE_CLICKED_ON_X) ||
HAS_CHANGE_EVENT(element, CE_MOUSE_PRESSED_ON_X))
- game.event_mask = GAME_EVENTS_MOUSE;
+ game.event_mask = GAME_EVENTS_KEYS | GAME_EVENTS_MOUSE;
}
}
}
static void SetMouseActionFromTapeAction(struct MouseActionInfo *mouse_action,
byte *tape_action)
{
- if (tape.event_mask != GAME_EVENTS_MOUSE)
+ if (!(tape.event_mask & GAME_EVENTS_MOUSE))
return;
mouse_action->lx = tape_action[TAPE_ACTION_LX];
static void SetTapeActionFromMouseAction(byte *tape_action,
struct MouseActionInfo *mouse_action)
{
- if (tape.event_mask != GAME_EVENTS_MOUSE)
+ if (!(tape.event_mask & GAME_EVENTS_MOUSE))
return;
tape_action[TAPE_ACTION_LX] = mouse_action->lx;
{
int new_button = (mouse_action.button && mouse_action_last.button == 0);
- x = local_player->mouse_action.lx;
- y = local_player->mouse_action.ly;
+ x = mouse_action.lx;
+ y = mouse_action.ly;
element = Feld[x][y];
if (new_button)
for (i = 0; i < MAX_TAPE_ACTIONS; i++)
action[i] = action_raw[i];
- if (tape.event_mask == GAME_EVENTS_KEYS && tape.set_centered_player)
+ if ((tape.event_mask & GAME_EVENTS_KEYS) && tape.set_centered_player)
{
for (i = 0; i < MAX_PLAYERS; i++)
if (tape.centered_player_nr_next == i ||
tape.set_centered_player = FALSE;
tape.centered_player_nr_next = -999;
- if (tape.event_mask == GAME_EVENTS_KEYS)
+ if (tape.event_mask & GAME_EVENTS_KEYS)
{
for (i = 0; i < MAX_PLAYERS; i++)
{
#define MAX_TAPE_LEN (1000 * FRAMES_PER_SECOND) // max.time x fps
// values for tape mouse actions
-#define TAPE_ACTION_LX 0
-#define TAPE_ACTION_LY 1
-#define TAPE_ACTION_BUTTON 2
-#define TAPE_ACTION_UNUSED 3
+#define TAPE_ACTION_LX (MAX_PLAYERS + 0)
+#define TAPE_ACTION_LY (MAX_PLAYERS + 1)
+#define TAPE_ACTION_BUTTON (MAX_PLAYERS + 2)
-#define MAX_TAPE_ACTIONS 4
+#define MAX_TAPE_ACTIONS (MAX_PLAYERS + 3)
// values for tape action events stored in tape file
#define TAPE_EVENTS_KEYS_ONLY 0