+2010-07-12
+ * added level selection screen (when clicking on main menu level number)
+
2010-06-24
* added alternative game mode for playing with half size playfield tiles
* fixed another memory violation bug in the native Supaplex game engine
FONT_TEXT_1, GFX_SPECIAL_ARG_LEVELS,
IMG_FONT_TEXT_1_LEVELS
},
+ {
+ FONT_TEXT_1, GFX_SPECIAL_ARG_LEVELNR,
+ IMG_FONT_TEXT_1_LEVELNR
+ },
{
FONT_TEXT_1, GFX_SPECIAL_ARG_SETUP,
IMG_FONT_TEXT_1_SETUP
FONT_TEXT_2, GFX_SPECIAL_ARG_LEVELS,
IMG_FONT_TEXT_2_LEVELS
},
+ {
+ FONT_TEXT_2, GFX_SPECIAL_ARG_LEVELNR,
+ IMG_FONT_TEXT_2_LEVELNR
+ },
{
FONT_TEXT_2, GFX_SPECIAL_ARG_SETUP,
IMG_FONT_TEXT_2_SETUP
FONT_TEXT_3, GFX_SPECIAL_ARG_LEVELS,
IMG_FONT_TEXT_3_LEVELS
},
+ {
+ FONT_TEXT_3, GFX_SPECIAL_ARG_LEVELNR,
+ IMG_FONT_TEXT_3_LEVELNR
+ },
{
FONT_TEXT_3, GFX_SPECIAL_ARG_SETUP,
IMG_FONT_TEXT_3_SETUP
FONT_TEXT_4, GFX_SPECIAL_ARG_LEVELS,
IMG_FONT_TEXT_4_LEVELS
},
+ {
+ FONT_TEXT_4, GFX_SPECIAL_ARG_LEVELNR,
+ IMG_FONT_TEXT_4_LEVELNR
+ },
{
FONT_TEXT_4, GFX_SPECIAL_ARG_SETUP,
IMG_FONT_TEXT_4_SETUP
{ "font.text_1.LEVELS.y", "0" },
{ "font.text_1.LEVELS.width", "16" },
{ "font.text_1.LEVELS.height", "32" },
+ { "font.text_1.LEVELNR", UNDEFINED_FILENAME },
+ { "font.text_1.LEVELNR.clone_from", "font.text_1.LEVELS" },
{ "font.text_1.SETUP", UNDEFINED_FILENAME },
{ "font.text_1.SETUP.clone_from", "font.text_1.LEVELS" },
{ "font.text_1.PREVIEW", "RocksFontEM.pcx" },
{ "font.text_2.LEVELS.y", "160" },
{ "font.text_2.LEVELS.width", "16" },
{ "font.text_2.LEVELS.height", "32" },
+ { "font.text_2.LEVELNR", UNDEFINED_FILENAME },
+ { "font.text_2.LEVELNR.clone_from", "font.text_2.LEVELS" },
{ "font.text_2.SETUP", UNDEFINED_FILENAME },
{ "font.text_2.SETUP.clone_from", "font.text_2.LEVELS" },
{ "font.text_2.PREVIEW", "RocksFontEM.pcx" },
{ "font.text_3.LEVELS.y", "320" },
{ "font.text_3.LEVELS.width", "16" },
{ "font.text_3.LEVELS.height", "32" },
+ { "font.text_3.LEVELNR", UNDEFINED_FILENAME },
+ { "font.text_3.LEVELNR.clone_from", "font.text_3.LEVELS" },
{ "font.text_3.SETUP", UNDEFINED_FILENAME },
{ "font.text_3.SETUP.clone_from", "font.text_3.LEVELS" },
{ "font.text_3.PREVIEW", "RocksFontEM.pcx" },
{ "font.text_4.LEVELS.y", "480" },
{ "font.text_4.LEVELS.width", "16" },
{ "font.text_4.LEVELS.height", "32" },
+ { "font.text_4.LEVELNR", UNDEFINED_FILENAME },
+ { "font.text_4.LEVELNR.clone_from", "font.text_4.LEVELS" },
{ "font.text_4.SETUP", UNDEFINED_FILENAME },
{ "font.text_4.SETUP.clone_from", "font.text_4.LEVELS" },
{ "font.text_4.SCORES", "RocksFontMedium.pcx" },
{ "background.TITLE", UNDEFINED_FILENAME },
{ "background.MAIN", UNDEFINED_FILENAME },
{ "background.LEVELS", UNDEFINED_FILENAME },
+ { "background.LEVELNR", UNDEFINED_FILENAME },
{ "background.SCORES", UNDEFINED_FILENAME },
{ "background.EDITOR", UNDEFINED_FILENAME },
{ "background.INFO", UNDEFINED_FILENAME },
{ "border.draw_masked.TITLE", "false" },
{ "border.draw_masked.MAIN", "false" },
{ "border.draw_masked.LEVELS", "false" },
+ { "border.draw_masked.LEVELNR", "false" },
{ "border.draw_masked.SCORES", "false" },
{ "border.draw_masked.EDITOR", "false" },
{ "border.draw_masked.INFO", "false" },
{ "menu.draw_yoffset.MAIN", "0" },
{ "menu.draw_xoffset.LEVELS", "0" },
{ "menu.draw_yoffset.LEVELS", "0" },
+ { "menu.draw_xoffset.LEVELNR", "0" },
+ { "menu.draw_yoffset.LEVELNR", "0" },
{ "menu.draw_xoffset.SCORES", "0" },
{ "menu.draw_yoffset.SCORES", "0" },
{ "menu.draw_xoffset.EDITOR", "0" },
{ "menu.list_size", "-1" },
{ "menu.list_size.LEVELS", "-1" },
+ { "menu.list_size.LEVELNR", "-1" },
{ "menu.list_size.SCORES", "-1" },
{ "menu.list_size.INFO", "-1" },
{ "menu.list_size.SETUP", "-1" },
#define IMG_FONT_TEXT_1 1726
#define IMG_FONT_TEXT_1_MAIN 1727
#define IMG_FONT_TEXT_1_LEVELS 1728
-#define IMG_FONT_TEXT_1_SETUP 1729
-#define IMG_FONT_TEXT_1_PREVIEW 1730
-#define IMG_FONT_TEXT_1_SCORES 1731
-#define IMG_FONT_TEXT_1_ACTIVE_SCORES 1732
-#define IMG_FONT_TEXT_1_PANEL 1733
-#define IMG_FONT_TEXT_1_DOOR 1734
-#define IMG_FONT_TEXT_2 1735
-#define IMG_FONT_TEXT_2_MAIN 1736
-#define IMG_FONT_TEXT_2_LEVELS 1737
-#define IMG_FONT_TEXT_2_SETUP 1738
-#define IMG_FONT_TEXT_2_PREVIEW 1739
-#define IMG_FONT_TEXT_2_SCORES 1740
-#define IMG_FONT_TEXT_2_ACTIVE_SCORES 1741
-#define IMG_FONT_TEXT_3 1742
-#define IMG_FONT_TEXT_3_LEVELS 1743
-#define IMG_FONT_TEXT_3_SETUP 1744
-#define IMG_FONT_TEXT_3_PREVIEW 1745
-#define IMG_FONT_TEXT_3_SCORES 1746
-#define IMG_FONT_TEXT_3_ACTIVE_SCORES 1747
-#define IMG_FONT_TEXT_4 1748
-#define IMG_FONT_TEXT_4_MAIN 1749
-#define IMG_FONT_TEXT_4_LEVELS 1750
-#define IMG_FONT_TEXT_4_SETUP 1751
-#define IMG_FONT_TEXT_4_SCORES 1752
-#define IMG_FONT_TEXT_4_ACTIVE_SCORES 1753
-#define IMG_FONT_ENVELOPE_1 1754
-#define IMG_FONT_ENVELOPE_2 1755
-#define IMG_FONT_ENVELOPE_3 1756
-#define IMG_FONT_ENVELOPE_4 1757
-#define IMG_FONT_INPUT_1 1758
-#define IMG_FONT_INPUT_1_MAIN 1759
-#define IMG_FONT_INPUT_1_ACTIVE 1760
-#define IMG_FONT_INPUT_1_ACTIVE_MAIN 1761
-#define IMG_FONT_INPUT_1_ACTIVE_SETUP 1762
-#define IMG_FONT_INPUT_2 1763
-#define IMG_FONT_INPUT_2_ACTIVE 1764
-#define IMG_FONT_OPTION_OFF 1765
-#define IMG_FONT_OPTION_ON 1766
-#define IMG_FONT_VALUE_1 1767
-#define IMG_FONT_VALUE_2 1768
-#define IMG_FONT_VALUE_OLD 1769
-#define IMG_FONT_LEVEL_NUMBER 1770
-#define IMG_FONT_LEVEL_NUMBER_ACTIVE 1771
-#define IMG_FONT_TAPE_RECORDER 1772
-#define IMG_FONT_GAME_INFO 1773
-#define IMG_FONT_INFO_ELEMENTS 1774
-#define IMG_FONT_INFO_LEVELSET 1775
-#define IMG_GLOBAL_BORDER 1776
-#define IMG_GLOBAL_DOOR 1777
-#define IMG_GLOBAL_BUSY 1778
-#define IMG_EDITOR_ELEMENT_BORDER 1779
-#define IMG_EDITOR_ELEMENT_BORDER_INPUT 1780
-#define IMG_EDITOR_CASCADE_LIST 1781
-#define IMG_EDITOR_CASCADE_LIST_ACTIVE 1782
-#define IMG_BACKGROUND 1783
-#define IMG_BACKGROUND_TITLE_INITIAL 1784
-#define IMG_BACKGROUND_TITLE 1785
-#define IMG_BACKGROUND_MAIN 1786
-#define IMG_BACKGROUND_LEVELS 1787
-#define IMG_BACKGROUND_SCORES 1788
-#define IMG_BACKGROUND_EDITOR 1789
-#define IMG_BACKGROUND_INFO 1790
-#define IMG_BACKGROUND_INFO_ELEMENTS 1791
-#define IMG_BACKGROUND_INFO_MUSIC 1792
-#define IMG_BACKGROUND_INFO_CREDITS 1793
-#define IMG_BACKGROUND_INFO_PROGRAM 1794
-#define IMG_BACKGROUND_INFO_VERSION 1795
-#define IMG_BACKGROUND_INFO_LEVELSET 1796
-#define IMG_BACKGROUND_SETUP 1797
-#define IMG_BACKGROUND_PLAYING 1798
-#define IMG_BACKGROUND_DOOR 1799
-#define IMG_BACKGROUND_TAPE 1800
-#define IMG_BACKGROUND_PANEL 1801
-#define IMG_BACKGROUND_TITLESCREEN_INITIAL_1 1802
-#define IMG_BACKGROUND_TITLESCREEN_INITIAL_2 1803
-#define IMG_BACKGROUND_TITLESCREEN_INITIAL_3 1804
-#define IMG_BACKGROUND_TITLESCREEN_INITIAL_4 1805
-#define IMG_BACKGROUND_TITLESCREEN_INITIAL_5 1806
-#define IMG_BACKGROUND_TITLESCREEN_1 1807
-#define IMG_BACKGROUND_TITLESCREEN_2 1808
-#define IMG_BACKGROUND_TITLESCREEN_3 1809
-#define IMG_BACKGROUND_TITLESCREEN_4 1810
-#define IMG_BACKGROUND_TITLESCREEN_5 1811
-#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_1 1812
-#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_2 1813
-#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_3 1814
-#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_4 1815
-#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_5 1816
-#define IMG_BACKGROUND_TITLEMESSAGE_1 1817
-#define IMG_BACKGROUND_TITLEMESSAGE_2 1818
-#define IMG_BACKGROUND_TITLEMESSAGE_3 1819
-#define IMG_BACKGROUND_TITLEMESSAGE_4 1820
-#define IMG_BACKGROUND_TITLEMESSAGE_5 1821
-#define IMG_BACKGROUND_ENVELOPE_1 1822
-#define IMG_BACKGROUND_ENVELOPE_2 1823
-#define IMG_BACKGROUND_ENVELOPE_3 1824
-#define IMG_BACKGROUND_ENVELOPE_4 1825
-#define IMG_TITLESCREEN_INITIAL_1 1826
-#define IMG_TITLESCREEN_INITIAL_2 1827
-#define IMG_TITLESCREEN_INITIAL_3 1828
-#define IMG_TITLESCREEN_INITIAL_4 1829
-#define IMG_TITLESCREEN_INITIAL_5 1830
-#define IMG_TITLESCREEN_1 1831
-#define IMG_TITLESCREEN_2 1832
-#define IMG_TITLESCREEN_3 1833
-#define IMG_TITLESCREEN_4 1834
-#define IMG_TITLESCREEN_5 1835
+#define IMG_FONT_TEXT_1_LEVELNR 1729
+#define IMG_FONT_TEXT_1_SETUP 1730
+#define IMG_FONT_TEXT_1_PREVIEW 1731
+#define IMG_FONT_TEXT_1_SCORES 1732
+#define IMG_FONT_TEXT_1_ACTIVE_SCORES 1733
+#define IMG_FONT_TEXT_1_PANEL 1734
+#define IMG_FONT_TEXT_1_DOOR 1735
+#define IMG_FONT_TEXT_2 1736
+#define IMG_FONT_TEXT_2_MAIN 1737
+#define IMG_FONT_TEXT_2_LEVELS 1738
+#define IMG_FONT_TEXT_2_LEVELNR 1739
+#define IMG_FONT_TEXT_2_SETUP 1740
+#define IMG_FONT_TEXT_2_PREVIEW 1741
+#define IMG_FONT_TEXT_2_SCORES 1742
+#define IMG_FONT_TEXT_2_ACTIVE_SCORES 1743
+#define IMG_FONT_TEXT_3 1744
+#define IMG_FONT_TEXT_3_LEVELS 1745
+#define IMG_FONT_TEXT_3_LEVELNR 1746
+#define IMG_FONT_TEXT_3_SETUP 1747
+#define IMG_FONT_TEXT_3_PREVIEW 1748
+#define IMG_FONT_TEXT_3_SCORES 1749
+#define IMG_FONT_TEXT_3_ACTIVE_SCORES 1750
+#define IMG_FONT_TEXT_4 1751
+#define IMG_FONT_TEXT_4_MAIN 1752
+#define IMG_FONT_TEXT_4_LEVELS 1753
+#define IMG_FONT_TEXT_4_LEVELNR 1754
+#define IMG_FONT_TEXT_4_SETUP 1755
+#define IMG_FONT_TEXT_4_SCORES 1756
+#define IMG_FONT_TEXT_4_ACTIVE_SCORES 1757
+#define IMG_FONT_ENVELOPE_1 1758
+#define IMG_FONT_ENVELOPE_2 1759
+#define IMG_FONT_ENVELOPE_3 1760
+#define IMG_FONT_ENVELOPE_4 1761
+#define IMG_FONT_INPUT_1 1762
+#define IMG_FONT_INPUT_1_MAIN 1763
+#define IMG_FONT_INPUT_1_ACTIVE 1764
+#define IMG_FONT_INPUT_1_ACTIVE_MAIN 1765
+#define IMG_FONT_INPUT_1_ACTIVE_SETUP 1766
+#define IMG_FONT_INPUT_2 1767
+#define IMG_FONT_INPUT_2_ACTIVE 1768
+#define IMG_FONT_OPTION_OFF 1769
+#define IMG_FONT_OPTION_ON 1770
+#define IMG_FONT_VALUE_1 1771
+#define IMG_FONT_VALUE_2 1772
+#define IMG_FONT_VALUE_OLD 1773
+#define IMG_FONT_LEVEL_NUMBER 1774
+#define IMG_FONT_LEVEL_NUMBER_ACTIVE 1775
+#define IMG_FONT_TAPE_RECORDER 1776
+#define IMG_FONT_GAME_INFO 1777
+#define IMG_FONT_INFO_ELEMENTS 1778
+#define IMG_FONT_INFO_LEVELSET 1779
+#define IMG_GLOBAL_BORDER 1780
+#define IMG_GLOBAL_DOOR 1781
+#define IMG_GLOBAL_BUSY 1782
+#define IMG_EDITOR_ELEMENT_BORDER 1783
+#define IMG_EDITOR_ELEMENT_BORDER_INPUT 1784
+#define IMG_EDITOR_CASCADE_LIST 1785
+#define IMG_EDITOR_CASCADE_LIST_ACTIVE 1786
+#define IMG_BACKGROUND 1787
+#define IMG_BACKGROUND_TITLE_INITIAL 1788
+#define IMG_BACKGROUND_TITLE 1789
+#define IMG_BACKGROUND_MAIN 1790
+#define IMG_BACKGROUND_LEVELS 1791
+#define IMG_BACKGROUND_LEVELNR 1792
+#define IMG_BACKGROUND_SCORES 1793
+#define IMG_BACKGROUND_EDITOR 1794
+#define IMG_BACKGROUND_INFO 1795
+#define IMG_BACKGROUND_INFO_ELEMENTS 1796
+#define IMG_BACKGROUND_INFO_MUSIC 1797
+#define IMG_BACKGROUND_INFO_CREDITS 1798
+#define IMG_BACKGROUND_INFO_PROGRAM 1799
+#define IMG_BACKGROUND_INFO_VERSION 1800
+#define IMG_BACKGROUND_INFO_LEVELSET 1801
+#define IMG_BACKGROUND_SETUP 1802
+#define IMG_BACKGROUND_PLAYING 1803
+#define IMG_BACKGROUND_DOOR 1804
+#define IMG_BACKGROUND_TAPE 1805
+#define IMG_BACKGROUND_PANEL 1806
+#define IMG_BACKGROUND_TITLESCREEN_INITIAL_1 1807
+#define IMG_BACKGROUND_TITLESCREEN_INITIAL_2 1808
+#define IMG_BACKGROUND_TITLESCREEN_INITIAL_3 1809
+#define IMG_BACKGROUND_TITLESCREEN_INITIAL_4 1810
+#define IMG_BACKGROUND_TITLESCREEN_INITIAL_5 1811
+#define IMG_BACKGROUND_TITLESCREEN_1 1812
+#define IMG_BACKGROUND_TITLESCREEN_2 1813
+#define IMG_BACKGROUND_TITLESCREEN_3 1814
+#define IMG_BACKGROUND_TITLESCREEN_4 1815
+#define IMG_BACKGROUND_TITLESCREEN_5 1816
+#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_1 1817
+#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_2 1818
+#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_3 1819
+#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_4 1820
+#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_5 1821
+#define IMG_BACKGROUND_TITLEMESSAGE_1 1822
+#define IMG_BACKGROUND_TITLEMESSAGE_2 1823
+#define IMG_BACKGROUND_TITLEMESSAGE_3 1824
+#define IMG_BACKGROUND_TITLEMESSAGE_4 1825
+#define IMG_BACKGROUND_TITLEMESSAGE_5 1826
+#define IMG_BACKGROUND_ENVELOPE_1 1827
+#define IMG_BACKGROUND_ENVELOPE_2 1828
+#define IMG_BACKGROUND_ENVELOPE_3 1829
+#define IMG_BACKGROUND_ENVELOPE_4 1830
+#define IMG_TITLESCREEN_INITIAL_1 1831
+#define IMG_TITLESCREEN_INITIAL_2 1832
+#define IMG_TITLESCREEN_INITIAL_3 1833
+#define IMG_TITLESCREEN_INITIAL_4 1834
+#define IMG_TITLESCREEN_INITIAL_5 1835
+#define IMG_TITLESCREEN_1 1836
+#define IMG_TITLESCREEN_2 1837
+#define IMG_TITLESCREEN_3 1838
+#define IMG_TITLESCREEN_4 1839
+#define IMG_TITLESCREEN_5 1840
-#define NUM_IMAGE_FILES 1836
+#define NUM_IMAGE_FILES 1841
#endif /* CONF_GFX_H */
"border.draw_masked.LEVELS",
&border.draw_masked[GFX_SPECIAL_ARG_LEVELS]
},
+ {
+ "border.draw_masked.LEVELNR",
+ &border.draw_masked[GFX_SPECIAL_ARG_LEVELNR]
+ },
{
"border.draw_masked.SCORES",
&border.draw_masked[GFX_SPECIAL_ARG_SCORES]
"menu.draw_yoffset.LEVELS",
&menu.draw_yoffset[GFX_SPECIAL_ARG_LEVELS]
},
+ {
+ "menu.draw_xoffset.LEVELNR",
+ &menu.draw_xoffset[GFX_SPECIAL_ARG_LEVELNR]
+ },
+ {
+ "menu.draw_yoffset.LEVELNR",
+ &menu.draw_yoffset[GFX_SPECIAL_ARG_LEVELNR]
+ },
{
"menu.draw_xoffset.SCORES",
&menu.draw_xoffset[GFX_SPECIAL_ARG_SCORES]
"menu.list_size.LEVELS",
&menu.list_size[GFX_SPECIAL_ARG_LEVELS]
},
+ {
+ "menu.list_size.LEVELNR",
+ &menu.list_size[GFX_SPECIAL_ARG_LEVELNR]
+ },
{
"menu.list_size.SCORES",
&menu.list_size[GFX_SPECIAL_ARG_SCORES]
-#define COMPILE_DATE_STRING "2010-07-08 15:40"
+#define COMPILE_DATE_STRING "2010-07-12 15:47"
break;
case GAME_MODE_LEVELS:
- HandleChooseLevel(mx, my, 0, 0, button);
+ HandleChooseLevelSet(mx, my, 0, 0, button);
+ break;
+
+ case GAME_MODE_LEVELNR:
+ HandleChooseLevelNr(mx, my, 0, 0, button);
break;
case GAME_MODE_SCORES:
case GAME_MODE_TITLE:
case GAME_MODE_MAIN:
case GAME_MODE_LEVELS:
+ case GAME_MODE_LEVELNR:
case GAME_MODE_SETUP:
case GAME_MODE_INFO:
case GAME_MODE_SCORES:
else if (game_status == GAME_MODE_MAIN)
HandleMainMenu(0, 0, 0, 0, MB_MENU_CHOICE);
else if (game_status == GAME_MODE_LEVELS)
- HandleChooseLevel(0, 0, 0, 0, MB_MENU_CHOICE);
+ HandleChooseLevelSet(0, 0, 0, 0, MB_MENU_CHOICE);
+ else if (game_status == GAME_MODE_LEVELNR)
+ HandleChooseLevelNr(0, 0, 0, 0, MB_MENU_CHOICE);
else if (game_status == GAME_MODE_SETUP)
HandleSetupScreen(0, 0, 0, 0, MB_MENU_CHOICE);
else if (game_status == GAME_MODE_INFO)
if (game_status == GAME_MODE_TITLE)
HandleTitleScreen(0, 0, 0, 0, MB_MENU_LEAVE);
else if (game_status == GAME_MODE_LEVELS)
- HandleChooseLevel(0, 0, 0, 0, MB_MENU_LEAVE);
+ HandleChooseLevelSet(0, 0, 0, 0, MB_MENU_LEAVE);
+ else if (game_status == GAME_MODE_LEVELNR)
+ HandleChooseLevelNr(0, 0, 0, 0, MB_MENU_LEAVE);
else if (game_status == GAME_MODE_SETUP)
HandleSetupScreen(0, 0, 0, 0, MB_MENU_LEAVE);
else if (game_status == GAME_MODE_INFO)
case KSYM_Page_Up:
if (game_status == GAME_MODE_LEVELS)
- HandleChooseLevel(0, 0, 0, -1 * SCROLL_PAGE, MB_MENU_MARK);
+ HandleChooseLevelSet(0, 0, 0, -1 * SCROLL_PAGE, MB_MENU_MARK);
+ else if (game_status == GAME_MODE_LEVELNR)
+ HandleChooseLevelNr(0, 0, 0, -1 * SCROLL_PAGE, MB_MENU_MARK);
else if (game_status == GAME_MODE_SETUP)
HandleSetupScreen(0, 0, 0, -1 * SCROLL_PAGE, MB_MENU_MARK);
else if (game_status == GAME_MODE_INFO)
case KSYM_Page_Down:
if (game_status == GAME_MODE_LEVELS)
- HandleChooseLevel(0, 0, 0, +1 * SCROLL_PAGE, MB_MENU_MARK);
+ HandleChooseLevelSet(0, 0, 0, +1 * SCROLL_PAGE, MB_MENU_MARK);
+ else if (game_status == GAME_MODE_LEVELNR)
+ HandleChooseLevelNr(0, 0, 0, +1 * SCROLL_PAGE, MB_MENU_MARK);
else if (game_status == GAME_MODE_SETUP)
HandleSetupScreen(0, 0, 0, +1 * SCROLL_PAGE, MB_MENU_MARK);
else if (game_status == GAME_MODE_INFO)
case GAME_MODE_TITLE:
case GAME_MODE_MAIN:
case GAME_MODE_LEVELS:
+ case GAME_MODE_LEVELNR:
case GAME_MODE_SETUP:
case GAME_MODE_INFO:
{
else if (game_status == GAME_MODE_MAIN)
HandleMainMenu(0,0,dx,dy, newbutton ? MB_MENU_CHOICE : MB_MENU_MARK);
else if (game_status == GAME_MODE_LEVELS)
- HandleChooseLevel(0,0,dx,dy, newbutton ? MB_MENU_CHOICE : MB_MENU_MARK);
+ HandleChooseLevelSet(0,0,dx,dy,newbutton?MB_MENU_CHOICE : MB_MENU_MARK);
+ else if (game_status == GAME_MODE_LEVELNR)
+ HandleChooseLevelNr(0,0,dx,dy,newbutton? MB_MENU_CHOICE : MB_MENU_MARK);
else if (game_status == GAME_MODE_SETUP)
HandleSetupScreen(0,0,dx,dy, newbutton ? MB_MENU_CHOICE : MB_MENU_MARK);
else if (game_status == GAME_MODE_INFO)
change->post_change_function = NULL;
}
-static void setLevelInfoToDefaults(struct LevelInfo *level)
+#if 1
+
+static void setLevelInfoToDefaults_Level(struct LevelInfo *level)
+{
+ int i, x, y;
+
+ li = *level; /* copy level data into temporary buffer */
+ setConfigToDefaultsFromConfigList(chunk_config_INFO);
+ *level = li; /* copy temporary buffer back to level data */
+
+ setLevelInfoToDefaults_EM();
+ setLevelInfoToDefaults_SP();
+
+ level->native_em_level = &native_em_level;
+ level->native_sp_level = &native_sp_level;
+
+ level->file_version = FILE_VERSION_ACTUAL;
+ level->game_version = GAME_VERSION_ACTUAL;
+
+ level->creation_date = getCurrentDate();
+
+ level->encoding_16bit_field = TRUE;
+ level->encoding_16bit_yamyam = TRUE;
+ level->encoding_16bit_amoeba = TRUE;
+
+ for (x = 0; x < MAX_LEV_FIELDX; x++)
+ for (y = 0; y < MAX_LEV_FIELDY; y++)
+ level->field[x][y] = EL_SAND;
+
+ for (i = 0; i < MAX_LEVEL_NAME_LEN; i++)
+ level->name[i] = '\0';
+ for (i = 0; i < MAX_LEVEL_AUTHOR_LEN; i++)
+ level->author[i] = '\0';
+
+ strcpy(level->name, NAMELESS_LEVEL_NAME);
+ strcpy(level->author, ANONYMOUS_NAME);
+
+ level->field[0][0] = EL_PLAYER_1;
+ level->field[STD_LEV_FIELDX - 1][STD_LEV_FIELDY - 1] = EL_EXIT_CLOSED;
+
+ BorderElement = EL_STEELWALL;
+
+ /* set all bug compatibility flags to "false" => do not emulate this bug */
+ level->use_action_after_change_bug = FALSE;
+
+ if (leveldir_current)
+ {
+ /* try to determine better author name than 'anonymous' */
+ if (!strEqual(leveldir_current->author, ANONYMOUS_NAME))
+ {
+ strncpy(level->author, leveldir_current->author, MAX_LEVEL_AUTHOR_LEN);
+ level->author[MAX_LEVEL_AUTHOR_LEN] = '\0';
+ }
+ else
+ {
+ switch (LEVELCLASS(leveldir_current))
+ {
+ case LEVELCLASS_TUTORIAL:
+ strcpy(level->author, PROGRAM_AUTHOR_STRING);
+ break;
+
+ case LEVELCLASS_CONTRIB:
+ strncpy(level->author, leveldir_current->name, MAX_LEVEL_AUTHOR_LEN);
+ level->author[MAX_LEVEL_AUTHOR_LEN] = '\0';
+ break;
+
+ case LEVELCLASS_PRIVATE:
+ strncpy(level->author, getRealName(), MAX_LEVEL_AUTHOR_LEN);
+ level->author[MAX_LEVEL_AUTHOR_LEN] = '\0';
+ break;
+
+ default:
+ /* keep default value */
+ break;
+ }
+ }
+ }
+}
+
+static void setLevelInfoToDefaults_Elements(struct LevelInfo *level)
+{
+ static boolean clipboard_elements_initialized = FALSE;
+ int i;
+
+ InitElementPropertiesStatic();
+
+ li = *level; /* copy level data into temporary buffer */
+ setConfigToDefaultsFromConfigList(chunk_config_ELEM);
+ *level = li; /* copy temporary buffer back to level data */
+
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
+ {
+ int element = i;
+ struct ElementInfo *ei = &element_info[element];
+
+ /* never initialize clipboard elements after the very first time */
+ /* (to be able to use clipboard elements between several levels) */
+ if (IS_CLIPBOARD_ELEMENT(element) && clipboard_elements_initialized)
+ continue;
+
+ if (IS_ENVELOPE(element))
+ {
+ int envelope_nr = element - EL_ENVELOPE_1;
+
+ setConfigToDefaultsFromConfigList(chunk_config_NOTE);
+
+ level->envelope[envelope_nr] = xx_envelope;
+ }
+
+ if (IS_CUSTOM_ELEMENT(element) ||
+ IS_GROUP_ELEMENT(element) ||
+ IS_INTERNAL_ELEMENT(element))
+ {
+ xx_ei = *ei; /* copy element data into temporary buffer */
+
+ setConfigToDefaultsFromConfigList(chunk_config_CUSX_base);
+
+ *ei = xx_ei;
+ }
+
+ setElementChangePages(ei, 1);
+ setElementChangeInfoToDefaults(ei->change);
+
+ if (IS_CUSTOM_ELEMENT(element) ||
+ IS_GROUP_ELEMENT(element) ||
+ IS_INTERNAL_ELEMENT(element))
+ {
+ setElementDescriptionToDefault(ei);
+
+ ei->modified_settings = FALSE;
+ }
+
+ if (IS_CUSTOM_ELEMENT(element) ||
+ IS_INTERNAL_ELEMENT(element))
+ {
+ /* internal values used in level editor */
+
+ ei->access_type = 0;
+ ei->access_layer = 0;
+ ei->access_protected = 0;
+ ei->walk_to_action = 0;
+ ei->smash_targets = 0;
+ ei->deadliness = 0;
+
+ ei->can_explode_by_fire = FALSE;
+ ei->can_explode_smashed = FALSE;
+ ei->can_explode_impact = FALSE;
+
+ ei->current_change_page = 0;
+ }
+
+ if (IS_GROUP_ELEMENT(element) ||
+ IS_INTERNAL_ELEMENT(element))
+ {
+ struct ElementGroupInfo *group;
+
+ /* initialize memory for list of elements in group */
+ if (ei->group == NULL)
+ ei->group = checked_malloc(sizeof(struct ElementGroupInfo));
+
+ group = ei->group;
+
+ xx_group = *group; /* copy group data into temporary buffer */
+
+ setConfigToDefaultsFromConfigList(chunk_config_GRPX);
+
+ *group = xx_group;
+ }
+ }
+
+ clipboard_elements_initialized = TRUE;
+}
+
+static void setLevelInfoToDefaults(struct LevelInfo *level,
+ boolean level_info_only)
+{
+ setLevelInfoToDefaults_Level(level);
+
+ if (!level_info_only)
+ setLevelInfoToDefaults_Elements(level);
+
+ level->no_valid_file = FALSE;
+
+ level->changed = FALSE;
+}
+
+#else
+
+static void setLevelInfoToDefaults(struct LevelInfo *level,
+ boolean level_info_only)
{
static boolean clipboard_elements_initialized = FALSE;
int i, x, y;
+ if (level_info_only)
+ return;
+
InitElementPropertiesStatic();
li = *level; /* copy level data into temporary buffer */
/* set all bug compatibility flags to "false" => do not emulate this bug */
level->use_action_after_change_bug = FALSE;
- if (leveldir_current == NULL) /* only when dumping level */
- return;
-
- /* try to determine better author name than 'anonymous' */
- if (!strEqual(leveldir_current->author, ANONYMOUS_NAME))
- {
- strncpy(level->author, leveldir_current->author, MAX_LEVEL_AUTHOR_LEN);
- level->author[MAX_LEVEL_AUTHOR_LEN] = '\0';
- }
- else
+ if (leveldir_current)
{
- switch (LEVELCLASS(leveldir_current))
+ /* try to determine better author name than 'anonymous' */
+ if (!strEqual(leveldir_current->author, ANONYMOUS_NAME))
{
- case LEVELCLASS_TUTORIAL:
- strcpy(level->author, PROGRAM_AUTHOR_STRING);
- break;
-
- case LEVELCLASS_CONTRIB:
- strncpy(level->author, leveldir_current->name, MAX_LEVEL_AUTHOR_LEN);
- level->author[MAX_LEVEL_AUTHOR_LEN] = '\0';
- break;
-
- case LEVELCLASS_PRIVATE:
- strncpy(level->author, getRealName(), MAX_LEVEL_AUTHOR_LEN);
- level->author[MAX_LEVEL_AUTHOR_LEN] = '\0';
- break;
-
- default:
- /* keep default value */
- break;
+ strncpy(level->author, leveldir_current->author, MAX_LEVEL_AUTHOR_LEN);
+ level->author[MAX_LEVEL_AUTHOR_LEN] = '\0';
+ }
+ else
+ {
+ switch (LEVELCLASS(leveldir_current))
+ {
+ case LEVELCLASS_TUTORIAL:
+ strcpy(level->author, PROGRAM_AUTHOR_STRING);
+ break;
+
+ case LEVELCLASS_CONTRIB:
+ strncpy(level->author, leveldir_current->name, MAX_LEVEL_AUTHOR_LEN);
+ level->author[MAX_LEVEL_AUTHOR_LEN] = '\0';
+ break;
+
+ case LEVELCLASS_PRIVATE:
+ strncpy(level->author, getRealName(), MAX_LEVEL_AUTHOR_LEN);
+ level->author[MAX_LEVEL_AUTHOR_LEN] = '\0';
+ break;
+
+ default:
+ /* keep default value */
+ break;
+ }
}
}
}
+#endif
+
static void setFileInfoToDefaults(struct LevelFileInfo *level_file_info)
{
level_file_info->nr = 0;
}
static void LoadLevelFromFileInfo_RND(struct LevelInfo *level,
- struct LevelFileInfo *level_file_info)
+ struct LevelFileInfo *level_file_info,
+ boolean level_info_only)
{
char *filename = level_file_info->filename;
char cookie[MAX_LINE_LEN];
level->no_valid_file = TRUE;
#if 1
- Error(ERR_WARN, "cannot read level '%s' -- using empty level", filename);
+ if (!level_info_only)
+ Error(ERR_WARN, "cannot read level '%s' -- using empty level", filename);
#else
if (level != &level_template)
Error(ERR_WARN, "cannot read level '%s' -- using empty level", filename);
}
static void LoadLevelFromFileInfo_SP(struct LevelInfo *level,
- struct LevelFileInfo *level_file_info)
+ struct LevelFileInfo *level_file_info,
+ boolean level_info_only)
{
char *filename = level_file_info->filename;
FILE *file;
{
level->no_valid_file = TRUE;
- Error(ERR_WARN, "cannot read level '%s' -- using empty level", filename);
+ if (!level_info_only)
+ Error(ERR_WARN, "cannot read level '%s' -- using empty level", filename);
return;
}
}
static void LoadLevelFromFileInfo_DC(struct LevelInfo *level,
- struct LevelFileInfo *level_file_info)
+ struct LevelFileInfo *level_file_info,
+ boolean level_info_only)
{
char *filename = level_file_info->filename;
FILE *file;
{
level->no_valid_file = TRUE;
- Error(ERR_WARN, "cannot read level '%s' -- using empty level", filename);
+ if (!level_info_only)
+ Error(ERR_WARN, "cannot read level '%s' -- using empty level", filename);
return;
}
{
level->no_valid_file = TRUE;
- Error(ERR_WARN, "cannot read level '%s' -- using empty level", filename);
+ if (!level_info_only)
+ Error(ERR_WARN, "cannot read level '%s' -- using empty level", filename);
return;
}
}
static void LoadLevelFromFileInfo_SB(struct LevelInfo *level,
- struct LevelFileInfo *level_file_info)
+ struct LevelFileInfo *level_file_info,
+ boolean level_info_only)
{
char *filename = level_file_info->filename;
char line[MAX_LINE_LEN], line_raw[MAX_LINE_LEN], previous_line[MAX_LINE_LEN];
{
level->no_valid_file = TRUE;
- Error(ERR_WARN, "cannot read level '%s' -- using empty level", filename);
+ if (!level_info_only)
+ Error(ERR_WARN, "cannot read level '%s' -- using empty level", filename);
return;
}
/* ------------------------------------------------------------------------- */
static void LoadLevelFromFileInfo_EM(struct LevelInfo *level,
- struct LevelFileInfo *level_file_info)
+ struct LevelFileInfo *level_file_info,
+ boolean level_info_only)
{
- if (!LoadNativeLevel_EM(level_file_info->filename))
+ if (!LoadNativeLevel_EM(level_file_info->filename, level_info_only))
level->no_valid_file = TRUE;
}
static void LoadLevelFromFileInfo_SP(struct LevelInfo *level,
- struct LevelFileInfo *level_file_info)
+ struct LevelFileInfo *level_file_info,
+ boolean level_info_only)
{
int pos = 0;
if (level_file_info->packed)
pos = level_file_info->nr - leveldir_current->first_level;
- if (!LoadNativeLevel_SP(level_file_info->filename, pos))
+ if (!LoadNativeLevel_SP(level_file_info->filename, pos, level_info_only))
level->no_valid_file = TRUE;
}
/* functions for loading generic level */
/* ------------------------------------------------------------------------- */
-void LoadLevelFromFileInfo(struct LevelInfo *level,
- struct LevelFileInfo *level_file_info)
+static void LoadLevelFromFileInfo(struct LevelInfo *level,
+ struct LevelFileInfo *level_file_info,
+ boolean level_info_only)
{
/* always start with reliable default values */
- setLevelInfoToDefaults(level);
+ setLevelInfoToDefaults(level, level_info_only);
switch (level_file_info->type)
{
case LEVEL_FILE_TYPE_RND:
- LoadLevelFromFileInfo_RND(level, level_file_info);
+ LoadLevelFromFileInfo_RND(level, level_file_info, level_info_only);
break;
case LEVEL_FILE_TYPE_EM:
- LoadLevelFromFileInfo_EM(level, level_file_info);
+ LoadLevelFromFileInfo_EM(level, level_file_info, level_info_only);
level->game_engine_type = GAME_ENGINE_TYPE_EM;
break;
case LEVEL_FILE_TYPE_SP:
- LoadLevelFromFileInfo_SP(level, level_file_info);
+ LoadLevelFromFileInfo_SP(level, level_file_info, level_info_only);
level->game_engine_type = GAME_ENGINE_TYPE_SP;
break;
case LEVEL_FILE_TYPE_DC:
- LoadLevelFromFileInfo_DC(level, level_file_info);
+ LoadLevelFromFileInfo_DC(level, level_file_info, level_info_only);
break;
case LEVEL_FILE_TYPE_SB:
- LoadLevelFromFileInfo_SB(level, level_file_info);
+ LoadLevelFromFileInfo_SB(level, level_file_info, level_info_only);
break;
default:
- LoadLevelFromFileInfo_RND(level, level_file_info);
+ LoadLevelFromFileInfo_RND(level, level_file_info, level_info_only);
break;
}
/* if level file is invalid, restore level structure to default values */
if (level->no_valid_file)
- setLevelInfoToDefaults(level);
+ setLevelInfoToDefaults(level, level_info_only);
if (level->game_engine_type == GAME_ENGINE_TYPE_UNKNOWN)
level->game_engine_type = GAME_ENGINE_TYPE_RND;
level_file_info.type = LEVEL_FILE_TYPE_RND; /* no others supported yet */
level_file_info.filename = filename;
- LoadLevelFromFileInfo(level, &level_file_info);
+ LoadLevelFromFileInfo(level, &level_file_info, FALSE);
}
static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename)
setLevelFileInfo(&level_template.file_info, nr);
filename = level_template.file_info.filename;
- LoadLevelFromFileInfo(&level_template, &level_template.file_info);
+ LoadLevelFromFileInfo(&level_template, &level_template.file_info, FALSE);
LoadLevel_InitVersion(&level_template, filename);
LoadLevel_InitElements(&level_template, filename);
setLevelFileInfo(&level.file_info, nr);
filename = level.file_info.filename;
- LoadLevelFromFileInfo(&level, &level.file_info);
+ LoadLevelFromFileInfo(&level, &level.file_info, FALSE);
if (level.use_custom_template)
LoadLevelTemplate(-1);
LoadLevel_InitNativeEngines(&level, filename);
}
+void LoadLevelInfoOnly(int nr)
+{
+ char *filename;
+
+ setLevelFileInfo(&level.file_info, nr);
+ filename = level.file_info.filename;
+
+ LoadLevelFromFileInfo(&level, &level.file_info, TRUE);
+}
+
static int SaveLevel_VERS(FILE *file, struct LevelInfo *level)
{
int chunk_size = 0;
void LoadLevelFromFilename(struct LevelInfo *, char *);
void LoadLevel(int);
void LoadLevelTemplate(int);
+void LoadLevelInfoOnly(int);
void SaveLevel(int);
void SaveLevelTemplate();
void SaveNativeLevel(struct LevelInfo *);
#define MAX_EM_LEVEL_SIZE 16384
-boolean LoadNativeLevel_EM(char *filename)
+boolean LoadNativeLevel_EM(char *filename, boolean level_info_only)
{
unsigned char raw_leveldata[MAX_EM_LEVEL_SIZE];
int raw_leveldata_length;
if (!(file = fopen(filename, MODE_READ)))
{
- Error(ERR_WARN, "cannot open level '%s' -- using empty level", filename);
+ if (!level_info_only)
+ Error(ERR_WARN, "cannot open level '%s' -- using empty level", filename);
return FALSE;
}
extern unsigned int InitEngineRandom_EM(long);
extern void setLevelInfoToDefaults_EM();
-extern boolean LoadNativeLevel_EM(char *);
+extern boolean LoadNativeLevel_EM(char *, boolean);
extern void BackToFront_EM(void);
extern void BlitScreenToBitmap_EM(Bitmap *);
void sound_play(void);
int cave_convert(char *);
-boolean LoadNativeLevel_EM(char *);
void game_init_vars(void);
void game_play_init(int, char *);
extern void setLevelInfoToDefaults_SP();
extern void copyInternalEngineVars_SP();
-extern boolean LoadNativeLevel_SP(char *, int);
+extern boolean LoadNativeLevel_SP(char *, int, boolean);
extern void SaveNativeLevel_SP(char *);
extern void BackToFront_SP(void);
}
}
-boolean LoadNativeLevel_SP(char *filename, int level_pos)
+boolean LoadNativeLevel_SP(char *filename, int level_pos,
+ boolean level_info_only)
{
FILE *file;
int i, l, x, y;
if (!(file = fopen(filename, MODE_READ)))
{
- Error(ERR_WARN, "cannot open file '%s' -- using empty level", filename);
+ if (!level_info_only)
+ Error(ERR_WARN, "cannot open file '%s' -- using empty level", filename);
return FALSE;
}
IMG_BACKGROUND_TITLE,
IMG_BACKGROUND_MAIN,
IMG_BACKGROUND_LEVELS,
+ IMG_BACKGROUND_LEVELNR,
IMG_BACKGROUND_SCORES,
IMG_BACKGROUND_EDITOR,
IMG_BACKGROUND_INFO,
return ti_copy;
}
-static void freeTreeInfo(TreeInfo *ti)
+void freeTreeInfo(TreeInfo *ti)
{
if (ti == NULL)
return;
int (*compare_function)(const void *,
const void *));
void sortTreeInfo(TreeInfo **);
+void freeTreeInfo(TreeInfo *);
char *getHomeDir(void);
char *getCommonDataDir(void);
#define TREE_TYPE_SOUNDS_DIR ARTWORK_TYPE_SOUNDS
#define TREE_TYPE_MUSIC_DIR ARTWORK_TYPE_MUSIC
#define TREE_TYPE_LEVEL_DIR 3
+#define TREE_TYPE_LEVEL_NR 4
-#define NUM_TREE_TYPES 4
+#define NUM_TREE_TYPES 5
#define INFOTEXT_UNDEFINED ""
#define INFOTEXT_GRAPHICS_DIR "Custom Graphics"
#define INFOTEXT_SOUNDS_DIR "Custom Sounds"
#define INFOTEXT_MUSIC_DIR "Custom Music"
#define INFOTEXT_LEVEL_DIR "Level Sets"
+#define INFOTEXT_LEVEL_NR "Levels"
-#define TREE_INFOTEXT(t) ((t) == TREE_TYPE_LEVEL_DIR ? \
+#define TREE_INFOTEXT(t) ((t) == TREE_TYPE_LEVEL_NR ? \
+ INFOTEXT_LEVEL_NR : \
+ (t) == TREE_TYPE_LEVEL_DIR ? \
INFOTEXT_LEVEL_DIR : \
(t) == TREE_TYPE_GRAPHICS_DIR ? \
INFOTEXT_GRAPHICS_DIR : \
{ ".TITLE", GFX_SPECIAL_ARG_TITLE, },
{ ".MAIN", GFX_SPECIAL_ARG_MAIN, },
{ ".LEVELS", GFX_SPECIAL_ARG_LEVELS },
+ { ".LEVELNR", GFX_SPECIAL_ARG_LEVELNR },
{ ".SCORES", GFX_SPECIAL_ARG_SCORES, },
{ ".EDITOR", GFX_SPECIAL_ARG_EDITOR, },
{ ".INFO", GFX_SPECIAL_ARG_INFO, },
#define GFX_SPECIAL_ARG_TITLE 3
#define GFX_SPECIAL_ARG_MAIN 4
#define GFX_SPECIAL_ARG_LEVELS 5
-#define GFX_SPECIAL_ARG_SCORES 6
-#define GFX_SPECIAL_ARG_EDITOR 7
-#define GFX_SPECIAL_ARG_INFO 8
-#define GFX_SPECIAL_ARG_SETUP 9
-#define GFX_SPECIAL_ARG_PLAYING 10
-#define GFX_SPECIAL_ARG_DOOR 11
-#define GFX_SPECIAL_ARG_TAPE 12
-#define GFX_SPECIAL_ARG_PANEL 13
-#define GFX_SPECIAL_ARG_PREVIEW 14
-#define GFX_SPECIAL_ARG_CRUMBLED 15
-
-#define NUM_SPECIAL_GFX_ARGS 16
+#define GFX_SPECIAL_ARG_LEVELNR 6
+#define GFX_SPECIAL_ARG_SCORES 7
+#define GFX_SPECIAL_ARG_EDITOR 8
+#define GFX_SPECIAL_ARG_INFO 9
+#define GFX_SPECIAL_ARG_SETUP 10
+#define GFX_SPECIAL_ARG_PLAYING 11
+#define GFX_SPECIAL_ARG_DOOR 12
+#define GFX_SPECIAL_ARG_TAPE 13
+#define GFX_SPECIAL_ARG_PANEL 14
+#define GFX_SPECIAL_ARG_PREVIEW 15
+#define GFX_SPECIAL_ARG_CRUMBLED 16
+
+#define NUM_SPECIAL_GFX_ARGS 17
/* these additional definitions are currently only used for draw offsets */
#define GFX_SPECIAL_ARG_INFO_MAIN 0
#define GAME_MODE_TITLE 3
#define GAME_MODE_MAIN 4
#define GAME_MODE_LEVELS 5
-#define GAME_MODE_SCORES 6
-#define GAME_MODE_EDITOR 7
-#define GAME_MODE_INFO 8
-#define GAME_MODE_SETUP 9
-#define GAME_MODE_PLAYING 10
-#define GAME_MODE_PSEUDO_DOOR 11
-#define GAME_MODE_PSEUDO_TAPE 12
-#define GAME_MODE_PSEUDO_PANEL 13
-#define GAME_MODE_PSEUDO_PREVIEW 14
-#define GAME_MODE_PSEUDO_CRUMBLED 15
+#define GAME_MODE_LEVELNR 6
+#define GAME_MODE_SCORES 7
+#define GAME_MODE_EDITOR 8
+#define GAME_MODE_INFO 9
+#define GAME_MODE_SETUP 10
+#define GAME_MODE_PLAYING 11
+#define GAME_MODE_PSEUDO_DOOR 12
+#define GAME_MODE_PSEUDO_TAPE 13
+#define GAME_MODE_PSEUDO_PANEL 14
+#define GAME_MODE_PSEUDO_PREVIEW 15
+#define GAME_MODE_PSEUDO_CRUMBLED 16
/* there are no special config file suffixes for these modes */
-#define GAME_MODE_PSEUDO_TYPENAME 16
-#define GAME_MODE_QUIT 17
+#define GAME_MODE_PSEUDO_TYPENAME 17
+#define GAME_MODE_QUIT 18
/* special definitions currently only used for custom artwork configuration */
#define MUSIC_PREFIX_BACKGROUND 0
static void execSetupArtwork(void);
static void HandleChooseTree(int, int, int, int, int, TreeInfo **);
-static void DrawChooseLevel(void);
+static void DrawChooseLevelSet(void);
+static void DrawChooseLevelNr(void);
static void DrawInfoScreen(void);
static void DrawAndFadeInInfoScreen(int);
static void DrawSetupScreen(void);
static TreeInfo *game_speeds = NULL;
static TreeInfo *game_speed_current = NULL;
+static TreeInfo *level_number = NULL;
+static TreeInfo *level_number_current = NULL;
+
static struct
{
int value;
if (pos_text != NULL) /* (x/y may be -1/-1 here) */
{
+#if 1
+ /* calculate size for non-clickable text -- needed for text alignment */
+ boolean calculate_text_size = (pos_button == NULL && text != NULL);
+#else
/* calculate width for non-clickable text -- needed for text alignment */
boolean calculate_text_width = (pos_button == NULL && text != NULL);
+#endif
if (visibleMenuPos(pos_button))
{
pos_text->y = pos_button->y;
}
+#if 1
+ if (pos_text->width == -1 || calculate_text_size)
+ pos_text->width = text_width;
+ if (pos_text->height == -1 || calculate_text_size)
+ pos_text->height = text_height;
+#else
if (pos_text->width == -1 || calculate_text_width)
pos_text->width = text_width;
if (pos_text->height == -1)
pos_text->height = text_height;
+#endif
}
if (pos_input != NULL) /* (x/y may be -1/-1 here) */
int rect_x = ALIGNED_TEXT_XPOS(rect);
int rect_y = ALIGNED_TEXT_YPOS(rect);
+#if 0
+ printf("::: insideTextPosRect: (%d, %d), (%d, %d) [%d, %d] (%d, %d) => %d\n",
+ x, y, rect_x, rect_y, rect->x, rect->y, rect->width, rect->height,
+ (x >= rect_x && x < rect_x + rect->width &&
+ y >= rect_y && y < rect_y + rect->height));
+#endif
+
return (x >= rect_x && x < rect_x + rect->width &&
y >= rect_y && y < rect_y + rect->height);
}
for (i = 0; main_controls[i].nr != -1; i++)
{
+#if 0
+ printf("::: check click (%d, %d) for %d [%d] ...\n",
+ mx - mSX, my - mSY, i, main_controls[i].nr);
+#endif
+
if (insideMenuPosRect(main_controls[i].pos_button, mx - mSX, my - mSY) ||
insideTextPosRect(main_controls[i].pos_text, mx - mSX, my - mSY) ||
insideTextPosRect(main_controls[i].pos_input, mx - mSX, my - mSY))
{
+#if 0
+ printf("::: inside %d\n", i);
+#endif
+
pos = main_controls[i].nr;
break;
{
HandleMainMenu_SelectLevel(1, dx < 0 ? -1 : +1);
}
+ else if (pos == MAIN_CONTROL_FIRST_LEVEL && !button)
+ {
+ HandleMainMenu_SelectLevel(MAX_LEVELS, -1);
+ }
+ else if (pos == MAIN_CONTROL_LAST_LEVEL && !button)
+ {
+ HandleMainMenu_SelectLevel(MAX_LEVELS, +1);
+ }
+ else if (pos == MAIN_CONTROL_LEVEL_NUMBER && !button)
+ {
+ game_status = GAME_MODE_LEVELNR;
+
+ DrawChooseLevelNr();
+ }
else if (pos >= MAIN_CONTROL_NAME && pos <= MAIN_CONTROL_QUIT)
{
if (button)
gotoTopLevelDir();
#endif
- DrawChooseLevel();
+ DrawChooseLevelSet();
}
}
else if (pos == MAIN_CONTROL_SCORES)
char *title_string = NULL;
int yoffset_sets = MENU_TITLE1_YPOS;
int yoffset_setup = 16;
- int yoffset = (ti->type == TREE_TYPE_LEVEL_DIR ? yoffset_sets :
- yoffset_setup);
+ int yoffset = (ti->type == TREE_TYPE_LEVEL_DIR ||
+ ti->type == TREE_TYPE_LEVEL_NR ? yoffset_sets : yoffset_setup);
int last_game_status = game_status; /* save current game status */
title_string = ti->infotext;
int ypos = MENU_TITLE2_YPOS;
int font_nr = FONT_TITLE_2;
+ if (ti->type == TREE_TYPE_LEVEL_NR)
+ DrawTextFCentered(ypos, font_nr, leveldir_current->name);
+
if (ti->type != TREE_TYPE_LEVEL_DIR)
return;
DrawBackgroundForFont(SX, SY + ypos, SXSIZE, getFontHeight(font_nr), font_nr);
+#if 1
+ if (node->parent_link)
+ DrawTextFCentered(ypos, font_nr, "leave \"%s\"",
+ node->node_parent->name);
+ else if (node->level_group)
+ DrawTextFCentered(ypos, font_nr, "enter \"%s\"",
+ node->name);
+ else if (ti->type == TREE_TYPE_LEVEL_DIR)
+ DrawTextFCentered(ypos, font_nr, "%3d %s (%s)",
+ node->levels, (node->levels > 1 ? "levels" : "level"),
+ node->class_desc);
+#else
if (node->parent_link)
DrawTextFCentered(ypos, font_nr, "leave group \"%s\"",
node->class_desc);
else if (ti->type == TREE_TYPE_LEVEL_DIR)
DrawTextFCentered(ypos, font_nr, "%3d levels (%s)",
node->levels, node->class_desc);
+#endif
/* let BackToFront() redraw only what is needed */
redraw_mask = last_redraw_mask | REDRAW_TILES;
}
else
{
+ if (game_status == GAME_MODE_LEVELNR)
+ level_nr = atoi(level_number_current->identifier);
+
game_status = GAME_MODE_MAIN;
DrawMainMenuExt(REDRAW_FIELD, FALSE);
}
else
{
+ if (game_status == GAME_MODE_LEVELNR)
+ level_nr = atoi(level_number_current->identifier);
+
game_status = GAME_MODE_MAIN;
+
DrawMainMenu();
}
}
}
}
-void DrawChooseLevel()
+void DrawChooseLevelSet()
{
SetMainBackgroundImage(IMG_BACKGROUND_LEVELS);
PlayMenuMusic();
}
-void HandleChooseLevel(int mx, int my, int dx, int dy, int button)
+void HandleChooseLevelSet(int mx, int my, int dx, int dy, int button)
{
HandleChooseTree(mx, my, dx, dy, button, &leveldir_current);
DoAnimation();
}
+void DrawChooseLevelNr()
+{
+ int i;
+
+ if (level_number != NULL)
+ {
+ freeTreeInfo(level_number);
+
+ level_number = NULL;
+ }
+
+ for (i = leveldir_current->first_level; i <= leveldir_current->last_level;i++)
+ {
+ TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_LEVEL_NR);
+ char identifier[32], name[32];
+ int value = i;
+
+ /* temporarily load level info to get level name */
+ LoadLevelInfoOnly(i);
+
+ ti->node_top = &level_number;
+ ti->sort_priority = 10000 + value;
+
+ sprintf(identifier, "%d", value);
+ sprintf(name, "%03d: %s", value, level.name);
+
+ setString(&ti->identifier, identifier);
+ setString(&ti->name, name);
+ setString(&ti->name_sorting, name);
+
+ pushTreeInfo(&level_number, ti);
+ }
+
+ /* sort level number values to start with lowest level number */
+ sortTreeInfo(&level_number);
+
+ /* set current level number to current level number */
+ level_number_current =
+ getTreeInfoFromIdentifier(level_number, i_to_a(level_nr));
+
+ /* if that also fails, set current level number to first available level */
+ if (level_number_current == NULL)
+ level_number_current = level_number;
+
+ SetMainBackgroundImage(IMG_BACKGROUND_LEVELNR);
+
+#if 1
+ DrawChooseTree(&level_number_current);
+#else
+ DrawChooseTree(&leveldir_current);
+#endif
+
+ PlayMenuSound();
+ PlayMenuMusic();
+}
+
+void HandleChooseLevelNr(int mx, int my, int dx, int dy, int button)
+{
+#if 1
+ HandleChooseTree(mx, my, dx, dy, button, &level_number_current);
+#else
+ HandleChooseTree(mx, my, dx, dy, button, &leveldir_current);
+#endif
+
+ DoAnimation();
+}
+
void DrawHallOfFame(int highlight_position)
{
UnmapAllGadgets();
case SCREEN_CTRL_ID_SCROLL_UP:
if (game_status == GAME_MODE_LEVELS)
- HandleChooseLevel(0,0, 0, -1 * SCROLL_LINE, MB_MENU_MARK);
+ HandleChooseLevelSet(0,0, 0, -1 * SCROLL_LINE, MB_MENU_MARK);
+ else if (game_status == GAME_MODE_LEVELNR)
+ HandleChooseLevelNr(0,0, 0, -1 * SCROLL_LINE, MB_MENU_MARK);
else if (game_status == GAME_MODE_SETUP)
HandleSetupScreen(0,0, 0, -1 * SCROLL_LINE, MB_MENU_MARK);
break;
case SCREEN_CTRL_ID_SCROLL_DOWN:
if (game_status == GAME_MODE_LEVELS)
- HandleChooseLevel(0,0, 0, +1 * SCROLL_LINE, MB_MENU_MARK);
+ HandleChooseLevelSet(0,0, 0, +1 * SCROLL_LINE, MB_MENU_MARK);
+ else if (game_status == GAME_MODE_LEVELNR)
+ HandleChooseLevelNr(0,0, 0, +1 * SCROLL_LINE, MB_MENU_MARK);
else if (game_status == GAME_MODE_SETUP)
HandleSetupScreen(0,0, 0, +1 * SCROLL_LINE, MB_MENU_MARK);
break;
case SCREEN_CTRL_ID_SCROLL_VERTICAL:
if (game_status == GAME_MODE_LEVELS)
- HandleChooseLevel(0,0, 999,gi->event.item_position,MB_MENU_INITIALIZE);
+ HandleChooseLevelSet(0,0,999,gi->event.item_position,MB_MENU_INITIALIZE);
+ else if (game_status == GAME_MODE_LEVELNR)
+ HandleChooseLevelNr(0,0,999,gi->event.item_position,MB_MENU_INITIALIZE);
else if (game_status == GAME_MODE_SETUP)
HandleSetupScreen(0,0, 999,gi->event.item_position,MB_MENU_INITIALIZE);
break;
void HandleTitleScreen(int, int, int, int, int);
void HandleMainMenu(int, int, int, int, int);
-void HandleChooseLevel(int, int, int, int, int);
+void HandleChooseLevelSet(int, int, int, int, int);
+void HandleChooseLevelNr(int, int, int, int, int);
void HandleHallOfFame(int, int, int, int, int);
void HandleInfoScreen(int, int, int, int, int);
void HandleSetupScreen(int, int, int, int, int);