}
}
+void ClearPlayerAction()
+{
+ int i;
+
+ /* simulate key release events for still pressed keys */
+ key_joystick_mapping = 0;
+ for (i=0; i<MAX_PLAYERS; i++)
+ stored_player[i].action = 0;
+}
+
void SleepWhileUnmapped()
{
boolean window_unmapped = TRUE;
if (event->type == EVENT_FOCUSOUT)
{
- int i;
-
KeyboardAutoRepeatOn();
old_joystick_status = joystick.status;
joystick.status = JOYSTICK_NOT_AVAILABLE;
- /* simulate key release events for still pressed keys */
- key_joystick_mapping = 0;
- for (i=0; i<MAX_PLAYERS; i++)
- stored_player[i].action = 0;
+ ClearPlayerAction();
}
else if (event->type == EVENT_FOCUSIN)
{
joy_action = Joystick(i);
result |= joy_action;
-
if (!setup.input[i].use_joystick)
continue;
-
stored_player[i].action = joy_action;
}
void EventLoop(void);
void HandleOtherEvents(Event *);
void ClearEventQueue(void);
+void ClearPlayerAction(void);
void SleepWhileUnmapped(void);
void HandleExposeEvent(ExposeEvent *);
}
}
+void DrawGameDoorValues()
+{
+ DrawText(DX + XX_EMERALDS, DY + YY_EMERALDS,
+ int2str(local_player->gems_still_needed, 3), FS_SMALL, FC_YELLOW);
+ DrawText(DX + XX_DYNAMITE, DY + YY_DYNAMITE,
+ int2str(local_player->dynamite, 3), FS_SMALL, FC_YELLOW);
+ DrawText(DX + XX_SCORE, DY + YY_SCORE,
+ int2str(local_player->score, 5), FS_SMALL, FC_YELLOW);
+ DrawText(DX + XX_TIME, DY + YY_TIME,
+ int2str(TimeLeft, 3), FS_SMALL, FC_YELLOW);
+}
+
void InitGame()
{
int i, j, x, y;
DX + XX_LEVEL - 1, DY + YY_LEVEL + 1);
}
+#if 1
+ DrawGameDoorValues();
+#else
DrawText(DX + XX_EMERALDS, DY + YY_EMERALDS,
int2str(local_player->gems_still_needed, 3), FS_SMALL, FC_YELLOW);
DrawText(DX + XX_DYNAMITE, DY + YY_DYNAMITE,
int2str(local_player->score, 5), FS_SMALL, FC_YELLOW);
DrawText(DX + XX_TIME, DY + YY_TIME,
int2str(TimeLeft, 3), FS_SMALL, FC_YELLOW);
+#endif
UnmapGameButtons();
UnmapTapeButtons();
#define SC_ZEITBONUS 10
void GetPlayerConfig(void);
+void DrawGameDoorValues(void);
void InitGame(void);
void InitMovDir(int, int);
void InitAmoebaNr(int, int);
{
struct SoundControl snd_ctrl = emptySoundControl;
- if (!audio.sound_available || !audio.sound_enabled)
+ if (!audio.sound_available ||
+ !audio.sound_enabled ||
+ audio.sound_deactivated)
return;
if (volume<PSND_MIN_VOLUME)
if ((gfx.draw_deactivation_mask & REDRAW_FIELD) &&
x < gfx.sx + gfx.sxsize)
return TRUE;
+ else if ((gfx.draw_deactivation_mask & REDRAW_DOORS) &&
+ x > gfx.dx)
+ {
+ if ((gfx.draw_deactivation_mask & REDRAW_DOOR_1) &&
+ y < gfx.dy + gfx.dysize)
+ return TRUE;
+ else if ((gfx.draw_deactivation_mask & REDRAW_DOOR_2) &&
+ y > gfx.vy)
+ return TRUE;
+ }
}
return FALSE;
audio.mods_available = FALSE;
audio.sound_enabled = FALSE;
+ audio.sound_deactivated = FALSE;
+
audio.soundserver_pipe[0] = audio.soundserver_pipe[1] = 0;
audio.soundserver_pid = -1;
audio.device_name = NULL;
boolean mods_available;
boolean sound_enabled;
+ boolean sound_deactivated; /* for temporarily disabling sound */
+
int soundserver_pipe[2];
int soundserver_pid;
char *device_name;
KeyboardAutoRepeatOn();
ActivateJoystick();
SetDrawDeactivationMask(REDRAW_NONE);
+ audio.sound_deactivated = FALSE;
/* needed if last screen was the playing screen, invoked from level editor */
if (level_editor_test_game)
MapTapeIndexButton();
SetDrawDeactivationMask(REDRAW_NONE);
+ audio.sound_deactivated = FALSE;
}
static void TapeStartGameRecording()
return;
tape.counter++;
+ tape.pos[tape.counter].delay = 0;
+
tape.length = tape.counter;
tape.length_seconds = GetTapeLength();
}
DrawVideoDisplay(state, 0);
- if (tape.index_search)
- {
- SetDrawDeactivationMask(REDRAW_NONE);
- RedrawPlayfield(TRUE, 0,0,0,0);
- }
-
if (tape.index_search)
{
tape.index_search = FALSE;
SetDrawDeactivationMask(REDRAW_NONE);
+ audio.sound_deactivated = FALSE;
+
RedrawPlayfield(TRUE, 0,0,0,0);
+ DrawGameDoorValues();
if (tape.quick_resume)
{
MapTapeIndexButton();
SetDrawDeactivationMask(REDRAW_NONE);
+ audio.sound_deactivated = FALSE;
}
static void TapeStartGamePlaying()
tape.index_search = TRUE;
if (!tape.fast_forward || tape.pause_before_death)
- SetDrawDeactivationMask(REDRAW_FIELD);
+ {
+ SetDrawDeactivationMask(REDRAW_FIELD | REDRAW_DOOR_1);
+ audio.sound_deactivated = TRUE;
+ }
}
void TapeQuickSave()
-#define COMPILE_DATE_STRING "[2002-04-07 21:03]"
+#define COMPILE_DATE_STRING "[2002-04-17 00:07]"
break;
case EVENT_KEYRELEASE:
- key_joystick_mapping = 0;
+ ClearPlayerAction();
break;
default: