+2010-03-13
+ * integrated playing sound effects into native Supaplex game engine
+
2010-03-10
* added configurable key shortcuts for the tape recorder buttons
{ "menu.draw_yoffset.SETUP[SHORTCUTS_2]", "0" },
{ "menu.draw_xoffset.SETUP[SHORTCUTS_3]", "0" },
{ "menu.draw_yoffset.SETUP[SHORTCUTS_3]", "0" },
+ { "menu.draw_xoffset.SETUP[SHORTCUTS_4]", "0" },
+ { "menu.draw_yoffset.SETUP[SHORTCUTS_4]", "0" },
{ "menu.draw_xoffset.SETUP[CHOOSE_ARTWORK]", "0" },
{ "menu.draw_yoffset.SETUP[CHOOSE_ARTWORK]", "0" },
{ "menu.draw_xoffset.SETUP[CHOOSE_OTHER]", "0" },
"menu.draw_yoffset.SETUP[SHORTCUTS_3]",
&menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_SHORTCUTS_3]
},
+ {
+ "menu.draw_xoffset.SETUP[SHORTCUTS_4]",
+ &menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_SHORTCUTS_4]
+ },
+ {
+ "menu.draw_yoffset.SETUP[SHORTCUTS_4]",
+ &menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_SHORTCUTS_4]
+ },
{
"menu.draw_xoffset.SETUP[CHOOSE_ARTWORK]",
&menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK]
-#define COMPILE_DATE_STRING "2010-03-10 14:11"
+#define COMPILE_DATE_STRING "2010-03-13 15:52"
TapeTogglePause(TAPE_TOGGLE_MANUAL);
HandleTapeButtonKeys(key);
+ HandleSoundButtonKeys(key);
}
if (game_status == GAME_MODE_PLAYING && !network_playing)
level_sp->height = level->fieldy;
for (x = 0; x < level->fieldx; x++)
- {
for (y = 0; y < level->fieldy; y++)
- {
- int element_old = level->field[x][y];
- int element_new;
-
- if (element_old >= EL_SP_START &&
- element_old <= EL_SP_END)
- element_new = element_old - EL_SP_START;
- else if (element_old == EL_EMPTY_SPACE)
- element_new = 0x00;
- else if (element_old == EL_INVISIBLE_WALL)
- element_new = 0x28;
- else
- element_new = 0x20; /* map unknown elements to yellow "hardware" */
-
- level_sp->playfield[x][y] = element_new;
- }
- }
+ level_sp->playfield[x][y] = map_element_RND_to_SP(level->field[x][y]);
header->InitialGravity = (level->initial_player_gravity[0] ? 1 : 0);
for (y = 0; y < level->fieldy; y++)
{
int element_old = level_sp->playfield[x][y];
- int element_new;
+ int element_new = getMappedElement(map_element_SP_to_RND(element_old));
- if (element_old <= 0x27)
- element_new = getMappedElement(EL_SP_START + element_old);
- else if (element_old == 0x28)
- element_new = EL_INVISIBLE_WALL;
- else
- {
+ if (element_new == EL_UNKNOWN)
Error(ERR_WARN, "invalid element %d at position %d, %d",
element_old, x, y);
- element_new = EL_UNKNOWN;
- }
-
level->field[x][y] = element_new;
}
}
#define SETUP_TOKEN_SHORTCUT_TAPE_PAUSE 10
#define SETUP_TOKEN_SHORTCUT_TAPE_RECORD 11
#define SETUP_TOKEN_SHORTCUT_TAPE_PLAY 12
+#define SETUP_TOKEN_SHORTCUT_SOUND_SIMPLE 13
+#define SETUP_TOKEN_SHORTCUT_SOUND_LOOPS 14
+#define SETUP_TOKEN_SHORTCUT_SOUND_MUSIC 15
-#define NUM_SHORTCUT_SETUP_TOKENS 13
+#define NUM_SHORTCUT_SETUP_TOKENS 16
/* player setup */
#define SETUP_TOKEN_PLAYER_USE_JOYSTICK 0
{ TYPE_KEY_X11, &ssi.tape_pause, "shortcut.tape_pause" },
{ TYPE_KEY_X11, &ssi.tape_record, "shortcut.tape_record" },
{ TYPE_KEY_X11, &ssi.tape_play, "shortcut.tape_play" },
+ { TYPE_KEY_X11, &ssi.sound_simple, "shortcut.sound_simple" },
+ { TYPE_KEY_X11, &ssi.sound_loops, "shortcut.sound_loops" },
+ { TYPE_KEY_X11, &ssi.sound_music, "shortcut.sound_music" },
};
static struct TokenInfo player_setup_tokens[] =
si->shortcut.tape_record = DEFAULT_KEY_TAPE_RECORD;
si->shortcut.tape_play = DEFAULT_KEY_TAPE_PLAY;
+ si->shortcut.sound_simple = DEFAULT_KEY_SOUND_SIMPLE;
+ si->shortcut.sound_loops = DEFAULT_KEY_SOUND_LOOPS;
+ si->shortcut.sound_music = DEFAULT_KEY_SOUND_MUSIC;
+
for (i = 0; i < MAX_PLAYERS; i++)
{
si->input[i].use_joystick = FALSE;
}
}
+void PlayLevelSound_SP(int xx, int yy, int element_sp, int action_sp)
+{
+ int element = map_element_SP_to_RND(element_sp);
+ int action = map_action_SP_to_RND(action_sp);
+ int offset = (setup.sp_show_border_elements ? 0 : 1);
+ int x = xx - offset;
+ int y = yy - offset;
+
+#if 0
+ printf("::: %d -> %d\n", element_sp, action_sp);
+#endif
+
+ PlayLevelSoundElementAction(x, y, element, action);
+}
+
#if 0
void ChangeTime(int value)
{
RedrawGadget(game_gadget[i]);
}
-static void HandleGameButtons(struct GadgetInfo *gi)
+static void HandleGameButtonsExt(int id)
{
- int id = gi->custom_id;
-
if (game_status != GAME_MODE_PLAYING)
return;
if (setup.sound_music)
{
setup.sound_music = FALSE;
+
FadeMusic();
}
else if (audio.music_available)
else if (audio.loops_available)
{
setup.sound = setup.sound_loops = TRUE;
+
SetAudioMode(setup.sound);
}
break;
else if (audio.sound_available)
{
setup.sound = setup.sound_simple = TRUE;
+
SetAudioMode(setup.sound);
}
break;
break;
}
}
+
+static void HandleGameButtons(struct GadgetInfo *gi)
+{
+ HandleGameButtonsExt(gi->custom_id);
+}
+
+void HandleSoundButtonKeys(Key key)
+{
+#if 1
+ if (key == setup.shortcut.sound_simple)
+ ClickOnGadget(game_gadget[SOUND_CTRL_ID_SIMPLE], MB_LEFTBUTTON);
+ else if (key == setup.shortcut.sound_loops)
+ ClickOnGadget(game_gadget[SOUND_CTRL_ID_LOOPS], MB_LEFTBUTTON);
+ else if (key == setup.shortcut.sound_music)
+ ClickOnGadget(game_gadget[SOUND_CTRL_ID_MUSIC], MB_LEFTBUTTON);
+#else
+ if (key == setup.shortcut.sound_simple)
+ HandleGameButtonsExt(SOUND_CTRL_ID_SIMPLE);
+ else if (key == setup.shortcut.sound_loops)
+ HandleGameButtonsExt(SOUND_CTRL_ID_LOOPS);
+ else if (key == setup.shortcut.sound_music)
+ HandleGameButtonsExt(SOUND_CTRL_ID_MUSIC);
+#endif
+}
void InitPlayLevelSound();
void PlayLevelSound_EM(int, int, int, int);
+void PlayLevelSound_SP(int, int, int, int);
void RaiseScore(int);
void RaiseScoreElement(int);
void UnmapGameButtons();
void RedrawGameButtons();
+void HandleSoundButtonKeys(Key);
+
#endif
#endif
// now the bug is active! Beware Murphy!
- if ((ByteMask && PlayField16[si - FieldWidth - 1]) == fiMurphy)
+ if ((ByteMask & PlayField16[si - FieldWidth - 1]) == fiMurphy)
goto markPlaySound;
- if ((ByteMask && PlayField16[si - FieldWidth]) == fiMurphy)
+ if ((ByteMask & PlayField16[si - FieldWidth]) == fiMurphy)
goto markPlaySound;
- if ((ByteMask && PlayField16[si - FieldWidth + 1]) == fiMurphy)
+ if ((ByteMask & PlayField16[si - FieldWidth + 1]) == fiMurphy)
goto markPlaySound;
- if ((ByteMask && PlayField16[si - 1]) == fiMurphy)
+ if ((ByteMask & PlayField16[si - 1]) == fiMurphy)
goto markPlaySound;
- if ((ByteMask && PlayField16[si + 1]) == fiMurphy)
+ if ((ByteMask & PlayField16[si + 1]) == fiMurphy)
goto markPlaySound;
- if ((ByteMask && PlayField16[si + FieldWidth - 1]) == fiMurphy)
+ if ((ByteMask & PlayField16[si + FieldWidth - 1]) == fiMurphy)
goto markPlaySound;
- if ((ByteMask && PlayField16[si + FieldWidth]) == fiMurphy)
+ if ((ByteMask & PlayField16[si + FieldWidth]) == fiMurphy)
goto markPlaySound;
- if ((ByteMask && PlayField16[si + FieldWidth + 1]) == fiMurphy)
+ if ((ByteMask & PlayField16[si + FieldWidth + 1]) == fiMurphy)
goto markPlaySound;
goto markDisplay;
markPlaySound:
+#if 1
+ subSoundFX(si, fiBug, actActive); // play dangerous sound
+#else
subSoundFXBug(); // play dangerous sound
+#endif
markDisplay:
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
GfxGraphic[GetX(si)][GetY(si)] = -1; // restart for chain-explosions
// loc_g_2C3B:
+#if 1
+ subSoundFX(si, ax, actExploding);
+#else
subSoundFXExplosion();
+#endif
} // ExplodeFieldSP
static void LetExplodeFieldSP(int tsi, int cx, int dh)
if (ax == fiOrangeDisk) // orange disk hit
goto loc_g_1386;
+#if 1
+
+#if 1
+ // play the infotron sound, 'cause infotron hits something "hard"
+ subSoundFX(si, fiInfotron, actImpact);
+#else
+ // play the zonk sound, 'cause zonk hits something "hard"
+ subSoundFX(si, fiZonk, actImpact);
+#endif
+
+#else
subSoundFXZonk(); // play the zonk sound,'cause zonk hits something "hard"
+#endif
if (! (ax == fiZonk || ax == fiInfotron || ax == fiRAM))
return subAnimateInfotrons;
// ==========================================================================
loc_g_63D3:
+#if 1
+ subSoundFX(*si, fiBase, actDigging);
+#else
subSoundFXBase();
+#endif
+
dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyDigUpRight : aniMurphyDigUpLeft);
PlayField16[*si - FieldWidth] = 0x503;
// ==========================================================================
loc_g_641C:
+#if 1
+ subSoundFX(*si, fiBase, actDigging);
+#else
subSoundFXBase();
+#endif
+
dx = aniFramesMurphyEatLeft;
dx1 = aniMurphyDigLeft;
PlayField16[*si - 1] = 0x203;
// ==========================================================================
loc_g_6459:
+#if 1
+ subSoundFX(*si, fiBase, actDigging);
+#else
subSoundFXBase();
+#endif
+
dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyDigUpRight : aniMurphyDigUpLeft);
PlayField16[*si + FieldWidth] = 0x703;
// ==========================================================================
loc_g_64A2:
+#if 1
+ subSoundFX(*si, fiBase, actDigging);
+#else
subSoundFXBase();
+#endif
+
dx = aniFramesMurphyEatRight;
dx1 = aniMurphyDigRight;
PlayField16[*si + 1] = 0x803;
loc_g_64DF:
subCopyImageToScreen(*si, aniMurphyTouchUp);
+#if 1
+ subSoundFX(*si, fiBase, actDigging);
+#else
subSoundFXBase();
+#endif
+
dx = aniFramesTouchBase;
dx1 = aniTouchBase;
dxPos = *si - FieldWidth;
loc_g_651D:
subCopyImageToScreen(*si, aniMurphyTouchLeft);
+#if 1
+ subSoundFX(*si, fiBase, actDigging);
+#else
subSoundFXBase();
+#endif
+
dx = aniFramesTouchBase;
dx1 = aniTouchBase;
dxPos = *si - 1;
loc_g_655B:
subCopyImageToScreen(*si, aniMurphyTouchDown);
+#if 1
+ subSoundFX(*si, fiBase, actDigging);
+#else
subSoundFXBase();
+#endif
+
dx = aniFramesTouchBase;
dx1 = aniTouchBase;
dxPos = *si + FieldWidth;
loc_g_6599:
subCopyImageToScreen(*si, aniMurphyTouchRight);
+#if 1
+ subSoundFX(*si, fiBase, actDigging);
+#else
subSoundFXBase();
+#endif
+
dx = aniFramesTouchBase;
dx1 = aniTouchBase;
dxPos = *si + 1;
// ==========================================================================
loc_g_65C6:
+#if 1
+ subSoundFX(*si, fiInfotron, actCollecting);
+#else
subSoundFXInfotron();
+#endif
+
dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
PlayField16[*si - FieldWidth] = 0x903;
// ==========================================================================
loc_g_65FE:
+#if 1
+ subSoundFX(*si, fiInfotron, actCollecting);
+#else
subSoundFXInfotron();
+#endif
+
dx = aniFramesEatInfotronLeft;
dx1 = aniEatInfotronLeft;
#if 0
// ==========================================================================
loc_g_662A:
+#if 1
+ subSoundFX(*si, fiInfotron, actCollecting);
+#else
subSoundFXInfotron();
+#endif
+
dx = (MurphyVarFaceLeft == 0 ? aniFramesMurphyEatUpRight : aniFramesMurphyEatUpLeft);
dx1 = (MurphyVarFaceLeft == 0 ? aniMurphyEatUpRight : aniMurphyEatUpLeft);
PlayField16[*si + FieldWidth] = 0xB03;
// ==========================================================================
loc_g_6662:
+#if 1
+ subSoundFX(*si, fiInfotron, actCollecting);
+#else
subSoundFXInfotron();
+#endif
+
dx = aniFramesEatInfotronRight;
dx1 = aniEatInfotronRight;
#if 0
loc_g_668E:
subCopyImageToScreen(*si, aniMurphyTouchUp);
+#if 1
+ subSoundFX(*si, fiInfotron, actCollecting);
+#else
subSoundFXInfotron();
+#endif
+
dx = aniFramesTouchInfotron;
dx1 = aniTouchInfotron;
MovHighByte(&PlayField16[*si], 0x14);
loc_g_66C0:
subCopyImageToScreen(*si, aniMurphyTouchLeft);
+#if 1
+ subSoundFX(*si, fiInfotron, actCollecting);
+#else
subSoundFXInfotron();
+#endif
+
dx = aniFramesTouchInfotron;
dx1 = aniTouchInfotron;
MovHighByte(&PlayField16[*si], 0x15);
loc_g_66F2:
subCopyImageToScreen(*si, aniMurphyTouchDown);
+#if 1
+ subSoundFX(*si, fiInfotron, actCollecting);
+#else
subSoundFXInfotron();
+#endif
+
dx = aniFramesTouchInfotron;
dx1 = aniTouchInfotron;
MovHighByte(&PlayField16[*si], 0x16);
loc_g_6724:
subCopyImageToScreen(*si, aniMurphyTouchRight);
+#if 1
+ subSoundFX(*si, fiInfotron, actCollecting);
+#else
subSoundFXInfotron();
+#endif
+
dx = aniFramesTouchInfotron;
dx1 = aniTouchInfotron;
MovHighByte(&PlayField16[*si], 0x17);
game_sp.LevelSolved = TRUE;
#endif
+#if 1
+ subSoundFX(*si, fiExit, actPassing);
+#else
subSoundFXExit();
+#endif
+
data_h_DemoDone = 1; // EP set level success bytes
LevelStatus = 1; // set Level Status DONE
EP_GameDemoVar0DAA = 0; // force demo for lead-out
ax = ax - 1; // next picture of sequence
MovingPictureSequencePhase = ax; // store for later
+
if (ax == 0) // Sound effects
+#if 1
+ {
+ switch (HighByte(PlayField16[*si]))
+ {
+ case 0xE:
+ case 0xF:
+ subSoundFX(*si, fiZonk, actPushing);
+ break;
+
+ case 0x28:
+ case 0x29:
+ subSoundFX(*si, fiOrangeDisk, actPushing);
+ break;
+
+ case 0x24:
+ case 0x25:
+ case 0x26:
+ case 0x27:
+ subSoundFX(*si, fiYellowDisk, actPushing);
+ break;
+
+ default:
+ break;
+ }
+ }
+#else
subSoundFXPush();
+#endif
bl = HighByte(PlayField16[*si]);
if (bl == 0xE) // Push Zonk to left
RedDiskReleasePhase = 2;
RedDiskCount = RedDiskCount - 1;
subDisplayRedDiskCount();
+
+#if 1
+ subSoundFX(*si, fiRedDisk, actDropping);
+#else
subSoundFXPush(); // Sound effects
+#endif
} // subAnimateMurphy
// ==========================================================================
#endif
}
+void subSoundFX(int si, int element, int action)
+{
+ int x = GetX(si);
+ int y = GetY(si);
+
+ PlayLevelSound_SP(x, y, element, action);
+}
+
void subMusicInit()
{
}
extern void subSoundFXPush();
extern void subSoundFXZonk();
+extern void subSoundFX(int, int, int);
+
extern int FXOnFlag;
extern int MusicOnFlag;
if (ax == fiOrangeDisk) // OrangeDisk explodes 'loc_g_0E95:
goto loc_g_0F75;
+#if 1
+ // play the zonk sound, 'cause zonk hits something "hard"
+ subSoundFX(si, fiZonk, actImpact);
+#else
subSoundFXZonk(); // play the zonk sound,'cause zonk hits something "hard"
+#endif
if (! (ax == fiZonk || ax == fiInfotron || ax == fiRAM))
return subAnimateZonks;
#define SP_MAX_TAPE_LEN 64010 /* (see "spfix63.doc") */
+/* sound actions */
+
+#define actActive 0
+#define actImpact 1
+#define actExploding 2
+#define actDigging 3
+#define actSnapping 4
+#define actCollecting 5
+#define actPassing 6
+#define actPushing 7
+#define actDropping 8
+
+
/* ------------------------------------------------------------------------- */
/* data structure definitions */
/* ------------------------------------------------------------------------- */
byte single_player_action = action[0];
int x, y;
+ UpdateEngineValues(mScrollX / TILEX, mScrollY / TILEY);
+
subMainGameLoop_Main(single_player_action, warp_mode);
RedrawPlayfield_SP(FALSE);
#define DEFAULT_KEY_TAPE_PAUSE KSYM_UNDEFINED
#define DEFAULT_KEY_TAPE_RECORD KSYM_UNDEFINED
#define DEFAULT_KEY_TAPE_PLAY KSYM_UNDEFINED
+#define DEFAULT_KEY_SOUND_SIMPLE KSYM_UNDEFINED
+#define DEFAULT_KEY_SOUND_LOOPS KSYM_UNDEFINED
+#define DEFAULT_KEY_SOUND_MUSIC KSYM_UNDEFINED
/* values for key_status */
#define KEY_NOT_PRESSED FALSE
Key tape_pause;
Key tape_record;
Key tape_play;
+
+ Key sound_simple;
+ Key sound_loops;
+ Key sound_music;
};
struct SetupSystemInfo
#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_1 8
#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_2 9
#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_3 10
-#define GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK 11
-#define GFX_SPECIAL_ARG_SETUP_CHOOSE_OTHER 12
+#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_4 11
+#define GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK 12
+#define GFX_SPECIAL_ARG_SETUP_CHOOSE_OTHER 13
-#define NUM_SPECIAL_GFX_SETUP_ARGS 13
+#define NUM_SPECIAL_GFX_SETUP_ARGS 14
/* values for image configuration suffixes */
#define SETUP_MODE_SHORTCUTS_1 8
#define SETUP_MODE_SHORTCUTS_2 9
#define SETUP_MODE_SHORTCUTS_3 10
+#define SETUP_MODE_SHORTCUTS_4 11
/* sub-screens on the setup screen (generic) */
-#define SETUP_MODE_CHOOSE_ARTWORK 11
-#define SETUP_MODE_CHOOSE_OTHER 12
+#define SETUP_MODE_CHOOSE_ARTWORK 12
+#define SETUP_MODE_CHOOSE_OTHER 13
/* sub-screens on the setup screen (specific) */
-#define SETUP_MODE_CHOOSE_GAME_SPEED 13
-#define SETUP_MODE_CHOOSE_SCREEN_MODE 14
-#define SETUP_MODE_CHOOSE_SCROLL_DELAY 15
-#define SETUP_MODE_CHOOSE_GRAPHICS 16
-#define SETUP_MODE_CHOOSE_SOUNDS 17
-#define SETUP_MODE_CHOOSE_MUSIC 18
+#define SETUP_MODE_CHOOSE_GAME_SPEED 14
+#define SETUP_MODE_CHOOSE_SCREEN_MODE 15
+#define SETUP_MODE_CHOOSE_SCROLL_DELAY 16
+#define SETUP_MODE_CHOOSE_GRAPHICS 17
+#define SETUP_MODE_CHOOSE_SOUNDS 18
+#define SETUP_MODE_CHOOSE_MUSIC 19
-#define MAX_SETUP_MODES 19
+#define MAX_SETUP_MODES 20
/* for input setup functions */
#define SETUPINPUT_SCREEN_POS_START 0
INFO_MODE_MAIN)
#define DRAW_MODE_SETUP(i) ((i) >= SETUP_MODE_MAIN && \
- (i) <= SETUP_MODE_SHORTCUTS_3 ? (i) : \
+ (i) <= SETUP_MODE_SHORTCUTS_4 ? (i) : \
(i) >= SETUP_MODE_CHOOSE_GRAPHICS && \
(i) <= SETUP_MODE_CHOOSE_MUSIC ? \
SETUP_MODE_CHOOSE_ARTWORK : \
DrawSetupScreen();
}
+static void execSetupShortcuts4()
+{
+ setup_mode = SETUP_MODE_SHORTCUTS_4;
+
+ DrawSetupScreen();
+}
+
static void execExitSetup()
{
game_status = GAME_MODE_MAIN;
{ TYPE_ENTER_MENU, execSetupShortcuts1, "Various Keys" },
{ TYPE_ENTER_MENU, execSetupShortcuts2, "Player Focus" },
{ TYPE_ENTER_MENU, execSetupShortcuts3, "Tape Buttons" },
+ { TYPE_ENTER_MENU, execSetupShortcuts4, "Sound & Music" },
{ TYPE_EMPTY, NULL, "" },
{ TYPE_LEAVE_MENU, execSetupMain, "Back" },
static struct TokenInfo setup_info_shortcuts_3[] =
{
- { TYPE_KEYTEXT, NULL, "Tape Eject:", },
+ { TYPE_KEYTEXT, NULL, "Tape Eject:", },
{ TYPE_KEY, &setup.shortcut.tape_eject, "" },
- { TYPE_KEYTEXT, NULL, "Tape Stop:", },
+ { TYPE_KEYTEXT, NULL, "Tape Stop:", },
{ TYPE_KEY, &setup.shortcut.tape_stop, "" },
- { TYPE_KEYTEXT, NULL, "Tape Pause:", },
+ { TYPE_KEYTEXT, NULL, "Tape Pause:", },
{ TYPE_KEY, &setup.shortcut.tape_pause, "" },
- { TYPE_KEYTEXT, NULL, "Tape Record:", },
+ { TYPE_KEYTEXT, NULL, "Tape Record:", },
{ TYPE_KEY, &setup.shortcut.tape_record, "" },
- { TYPE_KEYTEXT, NULL, "Tape Play:", },
+ { TYPE_KEYTEXT, NULL, "Tape Play:", },
{ TYPE_KEY, &setup.shortcut.tape_play, "" },
{ TYPE_EMPTY, NULL, "" },
{ TYPE_LEAVE_MENU, execSetupShortcuts, "Back" },
{ 0, NULL, NULL }
};
+static struct TokenInfo setup_info_shortcuts_4[] =
+{
+ { TYPE_KEYTEXT, NULL, "Sound Effects (Normal):", },
+ { TYPE_KEY, &setup.shortcut.sound_simple, "" },
+ { TYPE_KEYTEXT, NULL, "Sound Effects (Looping):", },
+ { TYPE_KEY, &setup.shortcut.sound_loops, "" },
+ { TYPE_KEYTEXT, NULL, "Music:", },
+ { TYPE_KEY, &setup.shortcut.sound_music, "" },
+ { TYPE_EMPTY, NULL, "" },
+ { TYPE_LEAVE_MENU, execSetupShortcuts, "Back" },
+
+ { 0, NULL, NULL }
+};
+
static Key getSetupKey()
{
Key key = KSYM_UNDEFINED;
setup_info = setup_info_shortcuts_3;
title_string = "Setup Shortcuts";
}
+ else if (setup_mode == SETUP_MODE_SHORTCUTS_4)
+ {
+ setup_info = setup_info_shortcuts_4;
+ title_string = "Setup Shortcuts";
+ }
DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, title_string);
MV_NONE);
}
+int map_element_RND_to_SP(int element_rnd)
+{
+ int element_sp = 0x20; /* map unknown elements to yellow "hardware" */
+
+ if (element_rnd >= EL_SP_START &&
+ element_rnd <= EL_SP_END)
+ element_sp = element_rnd - EL_SP_START;
+ else if (element_rnd == EL_EMPTY_SPACE)
+ element_sp = 0x00;
+ else if (element_rnd == EL_INVISIBLE_WALL)
+ element_sp = 0x28;
+
+ return element_sp;
+}
+
+int map_element_SP_to_RND(int element_sp)
+{
+ int element_rnd = EL_UNKNOWN;
+
+ if (element_sp >= 0x00 &&
+ element_sp <= 0x27)
+ element_rnd = EL_SP_START + element_sp;
+ else if (element_sp == 0x28)
+ element_rnd = EL_INVISIBLE_WALL;
+
+ return element_rnd;
+}
+
+int map_action_SP_to_RND(int action_sp)
+{
+ switch (action_sp)
+ {
+ case actActive: return ACTION_ACTIVE;
+ case actImpact: return ACTION_IMPACT;
+ case actExploding: return ACTION_EXPLODING;
+ case actDigging: return ACTION_DIGGING;
+ case actSnapping: return ACTION_SNAPPING;
+ case actCollecting: return ACTION_COLLECTING;
+ case actPassing: return ACTION_PASSING;
+ case actPushing: return ACTION_PUSHING;
+ case actDropping: return ACTION_DROPPING;
+
+ default: return ACTION_DEFAULT;
+ }
+}
+
int get_next_element(int element)
{
switch (element)
void map_android_clone_elements_RND_to_EM(struct LevelInfo *);
void map_android_clone_elements_EM_to_RND(struct LevelInfo *);
+int map_element_RND_to_SP(int);
+int map_element_SP_to_RND(int);
+int map_action_SP_to_RND(int);
+
int get_next_element(int);
int el_act_dir2img(int, int, int);
int el_act2img(int, int);