From: Holger Schemel Date: Sat, 30 Aug 2014 08:56:16 +0000 (+0200) Subject: Merge branch 'master' into releases X-Git-Tag: 3.2.4 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=refs%2Ftags%2F3.2.4;hp=8cbfc8a88d2eeb5400bad0ff556af7486532188f;p=rocksndiamonds.git Merge branch 'master' into releases --- diff --git a/ChangeLog b/ChangeLog index 4f8bd9d1..094f9847 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,354 @@ +2007-09-13 + * version 3.2.4 released + +2007-09-13 + * fixed crash bug in toon drawing functions for large step offset values + +2007-09-12 + * fixed some problems with displaying game panel when quick-loading tape + +2007-09-07 + * fixed (experimental only) redrawing of every tile per frame (even if + unneeded) for the extended (R'n'D based) EMC graphics engine + * added optimization to only calculate element count for panel display + if really needed (that is, if element count values defined on panel) + * fixed problem with special editor door redraw when entering main menu + +2007-09-03 + * fixed bug with displaying background for title messages on info screen + * some code cleanup for the extended (R'n'D based) EMC graphics engine + +2007-09-01 + * fixed bug with CE action "move player" always resulting in player 4 + if there was a CE action with no trigger player (because the player + element was calculated by using log_2() from trigger player bits with + the value PLAYER_BITS_ANY) -- this is now fixed by also storing the + triggering player bit mask and handling all players in "move player" + * fixed bug when defined artwork cannot be found for artwork that has + default artwork cloned from other artwork (without default filename) + * added several fixes to the extended (R'n'D based) EMC graphics engine + +2007-08-26 + * fixed broken editor copy and paste for custom elements between levels + +2007-08-25 + * title messages are now also searched in graphics artwork directory; + those found in graphics directory have precendence over those found + in level directory -- this handles title messages stored in graphics + directories as part of the artwork set, just like title images; this + makes sense, as corresponding special font definitions for messages + are usually defined in the same graphics artwork directory, and also + because title images and title messages that are combined in a level + set introduction should usually not be separated when the level set + is used with a different artwork set (e.g. using "override graphics") + * fixed problem with door borders on main screen by first drawing doors + and then the corresponding border masks, but not vice versa + * fixed problem with artwork config entries using the value "[DEFAULT]"; + this does not what one might expect, but sets the value to an invalid + value -- solution: simply ignore such entries, which results in this + value keeping its previous (real) default value (in general, entries + that should use their default value should just not be defined here) + * fixed problem with wrong fading area size from main menu to setup menu + +2007-08-22 + * fixed problem with broken crumbled graphics after level set changes + when using R'n'D custom artwork with level sets using the EMC engine + +2007-05-07 + * fixed invisible "joysticks deactivated ..." text on setup input screen + +2007-04-27 + * added use of hashes created from static lists (element tokens, image + config, font tokens) to speed up lookup of configuration parameters + * fixed bug where element and graphic config token lookup was mixed up + +2007-04-26 + * added "busy" animation when initializing program and loading artwork + * added initialization profiling for program startup (debugging only) + +2007-04-25 + * fixed(?) very strange bug apparently triggered by memset() when code + was cross-compiled with MinGW cross-compiler for Windows XP platform + (this only happened when using SDL.dll also self-compiled with MinGW) + +2007-04-19 + * added graphics engine directive "border.draw_masked_when_fading" that + enables/disables drawing of border mask over screen that is just faded + +2007-04-18 + * fixed small problem with separate fading definition for game screen + +2007-04-14 + * added additional configuration directives for setup screen draw offset + menu.draw_xoffset.SETUP[XXX] and menu.draw_yoffset.SETUP[XXX] with XXX + in GAME, EDITOR, GRAPHICS, SOUND, ARTWORK, INPUT, SHORTCUTS_1, + SHORTCUTS_2, CHOOSE_ARTWORK, CHOOSE_OTHER (where "CHOOSE_ARTWORK" is + used to define draw offset on custom artwork selection screens and + "CHOOSE_OTHER" is used on all other list style selection screens, like + choosing game speed or screen mode for fullscreen mode) + * added additional configuration directives to define main menu buttons: + - menu.button_name and menu.button_name.active + - menu.button_levels and menu.button_levels.active + - menu.button_scores and menu.button_scores.active + - menu.button_editor and menu.button_editor.active + - menu.button_info and menu.button_info.active + - menu.button_game and menu.button_game.active + - menu.button_setup and menu.button_setup.active + - menu.button_quit and menu.button_quit.active + * added eight pure decoration graphic definitions for the game panel + +2007-04-08 + * added support for accessing native Diamond Caves II level packages + * fixed displaying of game panel values for Emerald Mine game engine + * fixed displaying end-of-level time and score values on new game panel + +2007-04-07 + * added game panel control to display arbitrary elements on game panel + * added game panel control to display custom element score (globally + unique for identical custom elements) either as value or as element + * added ".draw_masked" and ".draw_order" to game panel control drawing + +2007-04-05 + * fixed some general bugs with handling of ".active" elements and fonts + +2007-04-04 + * cleanup of game panel elements (some elements were not really needed) + * added displaying of gravity state (on/off) as new game panel control + * added animation for game panel elements (similar to game elements) + +2007-04-03 + * added new pseudo game mode "PANEL" to define panel fonts and graphics + - panel fonts now use ".PANEL" suffix instead of ".PLAYING" suffix + - panel graphics now use ".PANEL" suffix instead of ".DOOR" suffix + (else graphics would have to use ".PLAYING", which would be confusing) + * fixed bug when fading out to game screen with border mask defined + +2007-04-02 + * added attribute ".tile_size" for element style game panel controls + +2007-04-01 + * added key as additional valid key to use for confirm requester + +2007-03-31 + * improved menu fading, adding separate fading definitions for entering + and leaving a "content" screen (in general), and optional definitions + for the special "content" screens SCORES, EDITOR, INFO and PLAYING + +2007-03-30 + * added (currently invisible) setup option to define scroll delay value + * fixed small bug in priority handling when auto-detecting level start + position in levels without player element (but player from CE etc.) + * added option "game.forced_scroll_delay_value" to override user choice + of scroll delay value for certain level sets with "graphicsinfo.conf" + * replaced setup option "scroll delay: on/off" by new setup option that + directly allows selecting the desired scroll delay value from 0 to 8 + +2007-03-28 + * added displaying of most game panel control elements (not animated) + +2007-03-26 + * added new configuration directives to display additional game engine + values on the game control panel, like the following examples: + - game.panel.time_hh/time_mm/time_ss - level time in HH/MM/SS format + - game.panel.penguins - number of penguins to rescue + - game.panel.level_name - level name of current level + +2007-03-24 + * added support for preview tile sizes "1" and "2" (1x1 and 2x2 pixels) + +2007-03-23 + * added new player option "no centering when relocating" for "invisible" + teleportations to level areas that look exactly the same, giving the + illusion that the player did not relocate at all (this was the default + since 3.2.3, but caused visual problems with room creation in "Zelda") + * added new menu fading effect "melt", shamelessly stolen from "DOOM" + +2007-03-21 + * improved menu fading, adding separate fading definitions for entering + and leaving a menu and for fading between menu and "content" screens + * fixed small bug with recognizing also ".font_xyz" style definitions + +2007-03-20 + * improved menu fading, adding separate fading definitions for fading + between menu screens and fading between menu and "destination" screens + +2007-03-19 + * titlemessage_initial_x and titlemessage_x set to "[DEFAULT]" in static + configuration (set from "[titlemessage_initial]" and "[titlemessage]") + * fading settings of "[titlemessage_initial]" and "[titlemessage]" set + to "[DEFAULT]" in static configuration (set from "[title_initial]" and + "[title]") + * improved title fading, allowing fading animation types "none", "fade" + and "crossfade" (including cross-fading of last title to main menu) + +2007-03-18 + * added configurability of graphics, sounds and music for title screens, + which are separated into initial title screens (only shown once at + program startup) and title screens shown for a given level set; these + title screens can be composed of up to five title images and up to + five title text messages (each drawn using an optional background + image), also using background music and/or sounds; aspects like + background images, sounds and music of title screens can either be + defined generally (valid for all title screens) or specifically (and + therefore differently for each title screen) using these directives: + + to define a background image, sound or music file for all screens: + - background.TITLE_INITIAL (for all title screens for game startup) + - background.TITLE (for all title screens for level sets) + + to define a background image, sound or music file for a single screen: + - background.titlescreen_initial_x (with x in 1,2,3,4,5) + - background.titlescreen_x (with x in 1,2,3,4,5) + - background.titlemessage_initial_x (with x in 1,2,3,4,5) + - background.titlemessage_x (with x in 1,2,3,4,5) + + to define the title screen images: + - titlescreen_initial_x (with x in 1,2,3,4,5) + - titlescreen_x (with x in 1,2,3,4,5) + + to define the title text messages, place text files into the level set + directory that have the following file names: + - titlemessage_initial_x.txt (with x in 1,2,3,4,5) + - titlemessage_x.txt (with x in 1,2,3,4,5) + + to define the properties of the text messages, either use directives + that affect all text messages: + - [titlemessage_initial]. + - [titlemessage]. + or use directives that affect single text messages: + - titlemessage_initial_x. (with x in 1,2,3,4,5) + - titlemessage_x. (with x in 1,2,3,4,5) + + valid values for are the same as for readme. below; + use ".sort_priority" (default: 0) to define an arbitrary order for + title images and title messages (which can therefore be mixed) + +2007-03-14 + * added full configurability of "readme.txt" screen appearance: + - readme.x: + - readme.y: + - readme.width: + - readme.height: + - readme.chars: + - readme.lines: + - readme.align: left,center,right (default: center) + - readme.top: top,middle,bottom (default: top) + - readme.font: font name + - readme.autowrap: true,false (default: true) + - readme.centered: true,false (default: false) + - readme.parse_comments: true,false (default: true) + - readme.sort_priority: (not used here, but only for title screens) + when "readme.chars" and/or "readme.lines" is set to "-1" (this is the + default), they are automatically determined from "readme.width" and + "readme.height" accordingly; when they are not "-1", they have + precedence over "readme.width" and "readme.height" + * added internal ad-hoc config settings for displaying text files like + title messages or "readme.txt" style level set info files: + - .font: font name (default: readme.font) + - .autowrap: true,false (default: readme.autowrap) + - .centered: true,false (default: readme.centered) + - .parse_comments: true,false (default: readme.parse_comments) + (the leading '.' and the separating ':' are mandatory here); to use + these ad-hoc settings, they have to be written inside a comment, like + "# .autowrap: false" or "# .centered: true"; these settings then + override the above global settings (they can even be used more than + once, like "# .centered: true", then some text that should be drawn + centered, then "# .centered: false" to go back to non-centered text; + important note: after using "# .parse_comments: false", or when using + "readme.parse_comments: false", detecting and parsing comments inside + the file is disabled and comments are just printed like normal text; + also be aware that all automatic text size calculations are done with + the font defined in "readme.font", while using different fonts using + "# .font: " inside the text file may cause unexpected results + +2007-03-08 + * changed some numerical limits in the level editor from 255 to 999 + +2007-03-07 + * added option "system.sdl_videodriver" to select SDL video driver + * added output of SDL video and audio driver to "version info" page + +2007-03-06 + * added group element drawing to IntelliDraw drawing functions + * fixed animation resetting problem again (last try broke Snake Bite) + * fixed diagonal scrolling in screen scrolling (last try broke Pac Man) + +2007-03-01 + * added new (special) "include: " directive that works in all + configuration files (like "graphicsinfo.conf") and that has the same + effect as if that directive would be replaced with the content of the + specified file (this can be useful to split large configuration files + into several smaller ones and include them from one main file, or to + store configuration settings that always stay the same into a separate + file, while including it and only add those parts that really change) + +2007-02-24 + * fixed minor bug (screen redraw of player tiles) in EMC graphics engine + +2007-02-23 + * fixed bug in "InitMovingField()" where treating an integer array as + boolean caused wrong resetting of animations while elements are moving + * fixed problem with resetting animations when starting element change + +2007-02-08 + * added sort priority for order of title screens and title messages + +2007-02-07 + * changed end of game again: do not wait for the user to press a key + anymore, but directly ask/confirm tape saving and go to hall of fame + * re-enabled quitting of lost game by pressing space or return again + * added blanking of mouse pointer when displaying title screens + * added remaining menu draw offset definitions for info sub-screens + +2007-02-05 + * added setup option to select game speed (from very slow to very fast) + * improved handling of title text messages (initial and for level set) + +2007-02-03 + * added new options "auto-wrap" and "centered" for DC2 style envelopes + +2007-01-31 + * fixed displaying and typing of player name when it is centered + * added special characters to be allowed for player name (not only A-Z) + +2007-01-25 + * fixed blit in ScrollLevel() to same bitmap to not overlap anymore + (newer versions of the SDL library seem to not like this anymore) + +2007-01-23 + * added code for configuration directives for control of game panel + +2007-01-21 + * fixed small cosmetical bug with underlining property tabs in editor + +2007-01-20 + * fixed small drawing bug in X11FadeRectangle + * added new elements for newly supported Diamond Caves II levels: + - EM/DC style exits that disappear after passing + - white key and gate (one white key needed for each white gate) + - fake gate (there is no key to open/pass this kind of gate!) + - extended magic wall which also handles pearls and crystals + - fast quicksand + +2007-01-14 + * changed maximum value for endless loop detection to a higher value + (some levels really used very deep recursion without being endless) + +2007-01-13 + * added new elements for newly supported Diamond Caves II levels: + - growing steel walls + - snappable land mine + +2007-01-08 + * added new elements for newly supported Diamond Caves II levels: + - steel text elements + +2007-01-06 + * added level file loader for native Diamond Caves II levels + +2007-01-05 + * version number set to 3.2.4 + 2007-01-05 * version 3.2.3 released diff --git a/Makefile b/Makefile index 7e91482d..a7a30e7d 100644 --- a/Makefile +++ b/Makefile @@ -91,6 +91,10 @@ cross-msdos: cross-win32: @PATH=$(CROSS_PATH_WIN32)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-win32 +cross-win32-jue: + @PATH=$(CROSS_PATH_WIN32)/bin:${PATH} $(MAKE_CMD) PLATFORM=cross-win32 \ + SPECIAL_ICON=jue + clean: @$(MAKE_CMD) clean diff --git a/src/Makefile b/src/Makefile index 7b6345e1..9fb3a9a9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -55,6 +55,7 @@ PLATFORM = unix endif ifeq ($(PLATFORM),macosx) +EXTRA_LDFLAGS = -lstdc++ PLATFORM = unix TARGET = sdl endif @@ -195,7 +196,9 @@ CNFS = conf_gfx.h \ conf_e2s.c \ conf_fnt.c \ conf_g2s.c \ - conf_g2m.c + conf_g2m.c \ + conf_var.c \ + conf_act.c CNFS_CMD = ../Scripts/create_element_defs.pl @@ -211,7 +214,12 @@ RNDLIBS = $(LIBGAME) $(GAME_EM) ICONBASE = windows_icon ifeq ($(PLATFORM),cross-win32) -ICON32X32 = ../graphics/$(ICONBASE)_32x32.bmp +ifdef SPECIAL_ICON +ICONSUFFIX = 32x32_$(SPECIAL_ICON) +else +ICONSUFFIX = 32x32 +endif +ICON32X32 = ../graphics/$(ICONBASE)_$(ICONSUFFIX).bmp ICON = $(ICONBASE).o endif @@ -251,7 +259,7 @@ conf_mus.h: conf_mus.c @$(MAKE) auto-conf $(TIMESTAMP_FILE): $(SRCS) $(LIBGAME) $(GAME_EM) - @date '+"[%Y-%m-%d %H:%M]"' \ + @date '+"%Y-%m-%d %H:%M"' \ | sed -e 's/^/#define COMPILE_DATE_STRING /' \ > $(TIMESTAMP_FILE) diff --git a/src/cartoons.c b/src/cartoons.c index c2b6e76a..70d6d3d5 100644 --- a/src/cartoons.c +++ b/src/cartoons.c @@ -31,21 +31,6 @@ static void PrepareBackbuffer() return; } - /* fill empty backbuffer for animation functions */ - if (setup.direct_draw && game_status == GAME_MODE_PLAYING) - { - int xx, yy; - - SetDrawtoField(DRAW_BACKBUFFER); - - for (xx = 0; xx < SCR_FIELDX; xx++) - for (yy = 0; yy < SCR_FIELDY; yy++) - DrawScreenField(xx, yy); - DrawAllPlayers(); - - SetDrawtoField(DRAW_DIRECT); - } - if (setup.soft_scrolling && game_status == GAME_MODE_PLAYING) { int fx = FX, fy = FY; @@ -95,7 +80,11 @@ void InitToons() toons[i].position = image->parameter[GFX_ARG_POSITION]; } +#if 1 + InitToonScreen(bitmap_db_toons, +#else InitToonScreen(bitmap_db_door, +#endif BackToFront, PrepareBackbuffer, ToonNeedsRedraw, toons, num_toons, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE, diff --git a/src/conf_act.c b/src/conf_act.c new file mode 100644 index 00000000..60c69b02 --- /dev/null +++ b/src/conf_act.c @@ -0,0 +1,442 @@ +/*********************************************************** +* Rocks'n'Diamonds -- McDuffin Strikes Back! * +*----------------------------------------------------------* +* (c) 1995-2006 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * +*----------------------------------------------------------* +* conf_act.c * +***********************************************************/ + +/* ----- this file was automatically generated -- do not edit by hand ----- */ + +#ifndef CONF_ACT_C +#define CONF_ACT_C + +/* values for active states of elements and fonts */ + +static struct +{ + int element; + int element_active; +} +element_with_active_state[] = +{ + { + EL_BD_MAGIC_WALL, + EL_BD_MAGIC_WALL_ACTIVE + }, + { + EL_CONVEYOR_BELT_1_LEFT, + EL_CONVEYOR_BELT_1_LEFT_ACTIVE + }, + { + EL_CONVEYOR_BELT_1_MIDDLE, + EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE + }, + { + EL_CONVEYOR_BELT_1_RIGHT, + EL_CONVEYOR_BELT_1_RIGHT_ACTIVE + }, + { + EL_CONVEYOR_BELT_2_LEFT, + EL_CONVEYOR_BELT_2_LEFT_ACTIVE + }, + { + EL_CONVEYOR_BELT_2_MIDDLE, + EL_CONVEYOR_BELT_2_MIDDLE_ACTIVE + }, + { + EL_CONVEYOR_BELT_2_RIGHT, + EL_CONVEYOR_BELT_2_RIGHT_ACTIVE + }, + { + EL_CONVEYOR_BELT_3_LEFT, + EL_CONVEYOR_BELT_3_LEFT_ACTIVE + }, + { + EL_CONVEYOR_BELT_3_MIDDLE, + EL_CONVEYOR_BELT_3_MIDDLE_ACTIVE + }, + { + EL_CONVEYOR_BELT_3_RIGHT, + EL_CONVEYOR_BELT_3_RIGHT_ACTIVE + }, + { + EL_CONVEYOR_BELT_4_LEFT, + EL_CONVEYOR_BELT_4_LEFT_ACTIVE + }, + { + EL_CONVEYOR_BELT_4_MIDDLE, + EL_CONVEYOR_BELT_4_MIDDLE_ACTIVE + }, + { + EL_CONVEYOR_BELT_4_RIGHT, + EL_CONVEYOR_BELT_4_RIGHT_ACTIVE + }, + { + EL_DC_GATE_WHITE_GRAY, + EL_DC_GATE_WHITE_GRAY_ACTIVE + }, + { + EL_DC_MAGIC_WALL, + EL_DC_MAGIC_WALL_ACTIVE + }, + { + EL_DC_TIMEGATE_SWITCH, + EL_DC_TIMEGATE_SWITCH_ACTIVE + }, + { + EL_DYNABOMB, + EL_DYNABOMB_ACTIVE + }, + { + EL_DYNABOMB_PLAYER_1, + EL_DYNABOMB_PLAYER_1_ACTIVE + }, + { + EL_DYNABOMB_PLAYER_2, + EL_DYNABOMB_PLAYER_2_ACTIVE + }, + { + EL_DYNABOMB_PLAYER_3, + EL_DYNABOMB_PLAYER_3_ACTIVE + }, + { + EL_DYNABOMB_PLAYER_4, + EL_DYNABOMB_PLAYER_4_ACTIVE + }, + { + EL_DYNAMITE, + EL_DYNAMITE_ACTIVE + }, + { + EL_EMC_DRIPPER, + EL_EMC_DRIPPER_ACTIVE + }, + { + EL_EMC_FAKE_GRASS, + EL_EMC_FAKE_GRASS_ACTIVE + }, + { + EL_EMC_GATE_5_GRAY, + EL_EMC_GATE_5_GRAY_ACTIVE + }, + { + EL_EMC_GATE_6_GRAY, + EL_EMC_GATE_6_GRAY_ACTIVE + }, + { + EL_EMC_GATE_7_GRAY, + EL_EMC_GATE_7_GRAY_ACTIVE + }, + { + EL_EMC_GATE_8_GRAY, + EL_EMC_GATE_8_GRAY_ACTIVE + }, + { + EL_EMC_MAGIC_BALL, + EL_EMC_MAGIC_BALL_ACTIVE + }, + { + EL_EMC_MAGIC_BALL_SWITCH, + EL_EMC_MAGIC_BALL_SWITCH_ACTIVE + }, + { + EL_EMC_SPRING_BUMPER, + EL_EMC_SPRING_BUMPER_ACTIVE + }, + { + EL_EM_DYNAMITE, + EL_EM_DYNAMITE_ACTIVE + }, + { + EL_EM_GATE_1_GRAY, + EL_EM_GATE_1_GRAY_ACTIVE + }, + { + EL_EM_GATE_2_GRAY, + EL_EM_GATE_2_GRAY_ACTIVE + }, + { + EL_EM_GATE_3_GRAY, + EL_EM_GATE_3_GRAY_ACTIVE + }, + { + EL_EM_GATE_4_GRAY, + EL_EM_GATE_4_GRAY_ACTIVE + }, + { + EL_GATE_1_GRAY, + EL_GATE_1_GRAY_ACTIVE + }, + { + EL_GATE_2_GRAY, + EL_GATE_2_GRAY_ACTIVE + }, + { + EL_GATE_3_GRAY, + EL_GATE_3_GRAY_ACTIVE + }, + { + EL_GATE_4_GRAY, + EL_GATE_4_GRAY_ACTIVE + }, + { + EL_INTERNAL_CASCADE_BD, + EL_INTERNAL_CASCADE_BD_ACTIVE + }, + { + EL_INTERNAL_CASCADE_CE, + EL_INTERNAL_CASCADE_CE_ACTIVE + }, + { + EL_INTERNAL_CASCADE_CHARS, + EL_INTERNAL_CASCADE_CHARS_ACTIVE + }, + { + EL_INTERNAL_CASCADE_DC, + EL_INTERNAL_CASCADE_DC_ACTIVE + }, + { + EL_INTERNAL_CASCADE_DX, + EL_INTERNAL_CASCADE_DX_ACTIVE + }, + { + EL_INTERNAL_CASCADE_DYNAMIC, + EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE + }, + { + EL_INTERNAL_CASCADE_EM, + EL_INTERNAL_CASCADE_EM_ACTIVE + }, + { + EL_INTERNAL_CASCADE_EMC, + EL_INTERNAL_CASCADE_EMC_ACTIVE + }, + { + EL_INTERNAL_CASCADE_GE, + EL_INTERNAL_CASCADE_GE_ACTIVE + }, + { + EL_INTERNAL_CASCADE_REF, + EL_INTERNAL_CASCADE_REF_ACTIVE + }, + { + EL_INTERNAL_CASCADE_RND, + EL_INTERNAL_CASCADE_RND_ACTIVE + }, + { + EL_INTERNAL_CASCADE_SB, + EL_INTERNAL_CASCADE_SB_ACTIVE + }, + { + EL_INTERNAL_CASCADE_SP, + EL_INTERNAL_CASCADE_SP_ACTIVE + }, + { + EL_INTERNAL_CASCADE_STEEL_CHARS, + EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE + }, + { + EL_INTERNAL_CASCADE_USER, + EL_INTERNAL_CASCADE_USER_ACTIVE + }, + { + EL_INVISIBLE_SAND, + EL_INVISIBLE_SAND_ACTIVE + }, + { + EL_INVISIBLE_STEELWALL, + EL_INVISIBLE_STEELWALL_ACTIVE + }, + { + EL_INVISIBLE_WALL, + EL_INVISIBLE_WALL_ACTIVE + }, + { + EL_LAMP, + EL_LAMP_ACTIVE + }, + { + EL_LIGHT_SWITCH, + EL_LIGHT_SWITCH_ACTIVE + }, + { + EL_MAGIC_WALL, + EL_MAGIC_WALL_ACTIVE + }, + { + EL_ROBOT_WHEEL, + EL_ROBOT_WHEEL_ACTIVE + }, + { + EL_SHIELD_DEADLY, + EL_SHIELD_DEADLY_ACTIVE + }, + { + EL_SHIELD_NORMAL, + EL_SHIELD_NORMAL_ACTIVE + }, + { + EL_SP_BUGGY_BASE, + EL_SP_BUGGY_BASE_ACTIVE + }, + { + EL_SP_DISK_RED, + EL_SP_DISK_RED_ACTIVE + }, + { + EL_SP_TERMINAL, + EL_SP_TERMINAL_ACTIVE + }, + { + EL_TIMEGATE_SWITCH, + EL_TIMEGATE_SWITCH_ACTIVE + }, + { + EL_TRAP, + EL_TRAP_ACTIVE + }, + { + -1, + -1 + }, +}; + + +static struct +{ + int button; + int button_active; +} +button_with_active_state[] = +{ + { + IMG_MENU_BUTTON, + IMG_MENU_BUTTON_ACTIVE + }, + { + IMG_MENU_BUTTON_DOWN, + IMG_MENU_BUTTON_DOWN_ACTIVE + }, + { + IMG_MENU_BUTTON_EDITOR, + IMG_MENU_BUTTON_EDITOR_ACTIVE + }, + { + IMG_MENU_BUTTON_ENTER_MENU, + IMG_MENU_BUTTON_ENTER_MENU_ACTIVE + }, + { + IMG_MENU_BUTTON_GAME, + IMG_MENU_BUTTON_GAME_ACTIVE + }, + { + IMG_MENU_BUTTON_INFO, + IMG_MENU_BUTTON_INFO_ACTIVE + }, + { + IMG_MENU_BUTTON_LEAVE_MENU, + IMG_MENU_BUTTON_LEAVE_MENU_ACTIVE + }, + { + IMG_MENU_BUTTON_LEFT, + IMG_MENU_BUTTON_LEFT_ACTIVE + }, + { + IMG_MENU_BUTTON_LEVELS, + IMG_MENU_BUTTON_LEVELS_ACTIVE + }, + { + IMG_MENU_BUTTON_NAME, + IMG_MENU_BUTTON_NAME_ACTIVE + }, + { + IMG_MENU_BUTTON_NEXT_LEVEL, + IMG_MENU_BUTTON_NEXT_LEVEL_ACTIVE + }, + { + IMG_MENU_BUTTON_PREV_LEVEL, + IMG_MENU_BUTTON_PREV_LEVEL_ACTIVE + }, + { + IMG_MENU_BUTTON_QUIT, + IMG_MENU_BUTTON_QUIT_ACTIVE + }, + { + IMG_MENU_BUTTON_RIGHT, + IMG_MENU_BUTTON_RIGHT_ACTIVE + }, + { + IMG_MENU_BUTTON_SCORES, + IMG_MENU_BUTTON_SCORES_ACTIVE + }, + { + IMG_MENU_BUTTON_SETUP, + IMG_MENU_BUTTON_SETUP_ACTIVE + }, + { + IMG_MENU_BUTTON_UP, + IMG_MENU_BUTTON_UP_ACTIVE + }, + { + -1, + -1 + }, +}; + + +static struct +{ + int font_nr; + int font_nr_active; +} +font_with_active_state[] = +{ + { + FONT_INPUT_1, + FONT_INPUT_1_ACTIVE + }, + { + FONT_INPUT_2, + FONT_INPUT_2_ACTIVE + }, + { + FONT_LEVEL_NUMBER, + FONT_LEVEL_NUMBER_ACTIVE + }, + { + FONT_MENU_1, + FONT_MENU_1_ACTIVE + }, + { + FONT_MENU_2, + FONT_MENU_2_ACTIVE + }, + { + FONT_TEXT_1, + FONT_TEXT_1_ACTIVE + }, + { + FONT_TEXT_2, + FONT_TEXT_2_ACTIVE + }, + { + FONT_TEXT_3, + FONT_TEXT_3_ACTIVE + }, + { + FONT_TEXT_4, + FONT_TEXT_4_ACTIVE + }, + { + -1, + -1 + }, +}; + +#endif /* CONF_ACT_C */ diff --git a/src/conf_chr.c b/src/conf_chr.c index a797319a..3aa42ed0 100644 --- a/src/conf_chr.c +++ b/src/conf_chr.c @@ -377,5 +377,394 @@ { "char_cursor.ypos", "4" }, { "char_cursor.frames", "1" }, + { "char_button", "RocksFontEM.pcx" }, + { "char_button.xpos", "13" }, + { "char_button.ypos", "4" }, + { "char_button.frames", "1" }, + + { "char_up", "RocksFontEM.pcx" }, + { "char_up.xpos", "14" }, + { "char_up.ypos", "4" }, + { "char_up.frames", "1" }, + + { "char_down", "RocksFontEM.pcx" }, + { "char_down.xpos", "15" }, + { "char_down.ypos", "4" }, + { "char_down.frames", "1" }, + + { "steel_char_space", "RocksFontDC.pcx" }, + { "steel_char_space.xpos", "0" }, + { "steel_char_space.ypos", "0" }, + { "steel_char_space.frames", "1" }, + { "steel_char_space.EDITOR", "RocksFontDC.pcx" }, + { "steel_char_space.EDITOR.xpos", "7" }, + { "steel_char_space.EDITOR.ypos", "4" }, + { "steel_char_space.EDITOR.frames", "1" }, + + { "steel_char_exclam", "RocksFontDC.pcx" }, + { "steel_char_exclam.xpos", "1" }, + { "steel_char_exclam.ypos", "0" }, + { "steel_char_exclam.frames", "1" }, + + { "steel_char_quotedbl", "RocksFontDC.pcx" }, + { "steel_char_quotedbl.xpos", "2" }, + { "steel_char_quotedbl.ypos", "0" }, + { "steel_char_quotedbl.frames", "1" }, + + { "steel_char_numbersign", "RocksFontDC.pcx" }, + { "steel_char_numbersign.xpos", "3" }, + { "steel_char_numbersign.ypos", "0" }, + { "steel_char_numbersign.frames", "1" }, + + { "steel_char_dollar", "RocksFontDC.pcx" }, + { "steel_char_dollar.xpos", "4" }, + { "steel_char_dollar.ypos", "0" }, + { "steel_char_dollar.frames", "1" }, + + { "steel_char_percent", "RocksFontDC.pcx" }, + { "steel_char_percent.xpos", "5" }, + { "steel_char_percent.ypos", "0" }, + { "steel_char_percent.frames", "1" }, + + { "steel_char_ampersand", "RocksFontDC.pcx" }, + { "steel_char_ampersand.xpos", "6" }, + { "steel_char_ampersand.ypos", "0" }, + { "steel_char_ampersand.frames", "1" }, + + { "steel_char_apostrophe", "RocksFontDC.pcx" }, + { "steel_char_apostrophe.xpos", "7" }, + { "steel_char_apostrophe.ypos", "0" }, + { "steel_char_apostrophe.frames", "1" }, + + { "steel_char_parenleft", "RocksFontDC.pcx" }, + { "steel_char_parenleft.xpos", "8" }, + { "steel_char_parenleft.ypos", "0" }, + { "steel_char_parenleft.frames", "1" }, + + { "steel_char_parenright", "RocksFontDC.pcx" }, + { "steel_char_parenright.xpos", "9" }, + { "steel_char_parenright.ypos", "0" }, + { "steel_char_parenright.frames", "1" }, + + { "steel_char_asterisk", "RocksFontDC.pcx" }, + { "steel_char_asterisk.xpos", "10" }, + { "steel_char_asterisk.ypos", "0" }, + { "steel_char_asterisk.frames", "1" }, + + { "steel_char_plus", "RocksFontDC.pcx" }, + { "steel_char_plus.xpos", "11" }, + { "steel_char_plus.ypos", "0" }, + { "steel_char_plus.frames", "1" }, + + { "steel_char_comma", "RocksFontDC.pcx" }, + { "steel_char_comma.xpos", "12" }, + { "steel_char_comma.ypos", "0" }, + { "steel_char_comma.frames", "1" }, + + { "steel_char_minus", "RocksFontDC.pcx" }, + { "steel_char_minus.xpos", "13" }, + { "steel_char_minus.ypos", "0" }, + { "steel_char_minus.frames", "1" }, + + { "steel_char_period", "RocksFontDC.pcx" }, + { "steel_char_period.xpos", "14" }, + { "steel_char_period.ypos", "0" }, + { "steel_char_period.frames", "1" }, + + { "steel_char_slash", "RocksFontDC.pcx" }, + { "steel_char_slash.xpos", "15" }, + { "steel_char_slash.ypos", "0" }, + { "steel_char_slash.frames", "1" }, + + { "steel_char_0", "RocksFontDC.pcx" }, + { "steel_char_0.xpos", "0" }, + { "steel_char_0.ypos", "1" }, + { "steel_char_0.frames", "1" }, + + { "steel_char_1", "RocksFontDC.pcx" }, + { "steel_char_1.xpos", "1" }, + { "steel_char_1.ypos", "1" }, + { "steel_char_1.frames", "1" }, + + { "steel_char_2", "RocksFontDC.pcx" }, + { "steel_char_2.xpos", "2" }, + { "steel_char_2.ypos", "1" }, + { "steel_char_2.frames", "1" }, + + { "steel_char_3", "RocksFontDC.pcx" }, + { "steel_char_3.xpos", "3" }, + { "steel_char_3.ypos", "1" }, + { "steel_char_3.frames", "1" }, + + { "steel_char_4", "RocksFontDC.pcx" }, + { "steel_char_4.xpos", "4" }, + { "steel_char_4.ypos", "1" }, + { "steel_char_4.frames", "1" }, + + { "steel_char_5", "RocksFontDC.pcx" }, + { "steel_char_5.xpos", "5" }, + { "steel_char_5.ypos", "1" }, + { "steel_char_5.frames", "1" }, + + { "steel_char_6", "RocksFontDC.pcx" }, + { "steel_char_6.xpos", "6" }, + { "steel_char_6.ypos", "1" }, + { "steel_char_6.frames", "1" }, + + { "steel_char_7", "RocksFontDC.pcx" }, + { "steel_char_7.xpos", "7" }, + { "steel_char_7.ypos", "1" }, + { "steel_char_7.frames", "1" }, + + { "steel_char_8", "RocksFontDC.pcx" }, + { "steel_char_8.xpos", "8" }, + { "steel_char_8.ypos", "1" }, + { "steel_char_8.frames", "1" }, + + { "steel_char_9", "RocksFontDC.pcx" }, + { "steel_char_9.xpos", "9" }, + { "steel_char_9.ypos", "1" }, + { "steel_char_9.frames", "1" }, + + { "steel_char_colon", "RocksFontDC.pcx" }, + { "steel_char_colon.xpos", "10" }, + { "steel_char_colon.ypos", "1" }, + { "steel_char_colon.frames", "1" }, + + { "steel_char_semicolon", "RocksFontDC.pcx" }, + { "steel_char_semicolon.xpos", "11" }, + { "steel_char_semicolon.ypos", "1" }, + { "steel_char_semicolon.frames", "1" }, + + { "steel_char_less", "RocksFontDC.pcx" }, + { "steel_char_less.xpos", "12" }, + { "steel_char_less.ypos", "1" }, + { "steel_char_less.frames", "1" }, + + { "steel_char_equal", "RocksFontDC.pcx" }, + { "steel_char_equal.xpos", "13" }, + { "steel_char_equal.ypos", "1" }, + { "steel_char_equal.frames", "1" }, + + { "steel_char_greater", "RocksFontDC.pcx" }, + { "steel_char_greater.xpos", "14" }, + { "steel_char_greater.ypos", "1" }, + { "steel_char_greater.frames", "1" }, + + { "steel_char_question", "RocksFontDC.pcx" }, + { "steel_char_question.xpos", "15" }, + { "steel_char_question.ypos", "1" }, + { "steel_char_question.frames", "1" }, + + { "steel_char_at", "RocksFontDC.pcx" }, + { "steel_char_at.xpos", "0" }, + { "steel_char_at.ypos", "2" }, + { "steel_char_at.frames", "1" }, + + { "steel_char_a", "RocksFontDC.pcx" }, + { "steel_char_a.xpos", "1" }, + { "steel_char_a.ypos", "2" }, + { "steel_char_a.frames", "1" }, + + { "steel_char_b", "RocksFontDC.pcx" }, + { "steel_char_b.xpos", "2" }, + { "steel_char_b.ypos", "2" }, + { "steel_char_b.frames", "1" }, + + { "steel_char_c", "RocksFontDC.pcx" }, + { "steel_char_c.xpos", "3" }, + { "steel_char_c.ypos", "2" }, + { "steel_char_c.frames", "1" }, + + { "steel_char_d", "RocksFontDC.pcx" }, + { "steel_char_d.xpos", "4" }, + { "steel_char_d.ypos", "2" }, + { "steel_char_d.frames", "1" }, + + { "steel_char_e", "RocksFontDC.pcx" }, + { "steel_char_e.xpos", "5" }, + { "steel_char_e.ypos", "2" }, + { "steel_char_e.frames", "1" }, + + { "steel_char_f", "RocksFontDC.pcx" }, + { "steel_char_f.xpos", "6" }, + { "steel_char_f.ypos", "2" }, + { "steel_char_f.frames", "1" }, + + { "steel_char_g", "RocksFontDC.pcx" }, + { "steel_char_g.xpos", "7" }, + { "steel_char_g.ypos", "2" }, + { "steel_char_g.frames", "1" }, + + { "steel_char_h", "RocksFontDC.pcx" }, + { "steel_char_h.xpos", "8" }, + { "steel_char_h.ypos", "2" }, + { "steel_char_h.frames", "1" }, + + { "steel_char_i", "RocksFontDC.pcx" }, + { "steel_char_i.xpos", "9" }, + { "steel_char_i.ypos", "2" }, + { "steel_char_i.frames", "1" }, + + { "steel_char_j", "RocksFontDC.pcx" }, + { "steel_char_j.xpos", "10" }, + { "steel_char_j.ypos", "2" }, + { "steel_char_j.frames", "1" }, + + { "steel_char_k", "RocksFontDC.pcx" }, + { "steel_char_k.xpos", "11" }, + { "steel_char_k.ypos", "2" }, + { "steel_char_k.frames", "1" }, + + { "steel_char_l", "RocksFontDC.pcx" }, + { "steel_char_l.xpos", "12" }, + { "steel_char_l.ypos", "2" }, + { "steel_char_l.frames", "1" }, + + { "steel_char_m", "RocksFontDC.pcx" }, + { "steel_char_m.xpos", "13" }, + { "steel_char_m.ypos", "2" }, + { "steel_char_m.frames", "1" }, + + { "steel_char_n", "RocksFontDC.pcx" }, + { "steel_char_n.xpos", "14" }, + { "steel_char_n.ypos", "2" }, + { "steel_char_n.frames", "1" }, + + { "steel_char_o", "RocksFontDC.pcx" }, + { "steel_char_o.xpos", "15" }, + { "steel_char_o.ypos", "2" }, + { "steel_char_o.frames", "1" }, + + { "steel_char_p", "RocksFontDC.pcx" }, + { "steel_char_p.xpos", "0" }, + { "steel_char_p.ypos", "3" }, + { "steel_char_p.frames", "1" }, + + { "steel_char_q", "RocksFontDC.pcx" }, + { "steel_char_q.xpos", "1" }, + { "steel_char_q.ypos", "3" }, + { "steel_char_q.frames", "1" }, + + { "steel_char_r", "RocksFontDC.pcx" }, + { "steel_char_r.xpos", "2" }, + { "steel_char_r.ypos", "3" }, + { "steel_char_r.frames", "1" }, + + { "steel_char_s", "RocksFontDC.pcx" }, + { "steel_char_s.xpos", "3" }, + { "steel_char_s.ypos", "3" }, + { "steel_char_s.frames", "1" }, + + { "steel_char_t", "RocksFontDC.pcx" }, + { "steel_char_t.xpos", "4" }, + { "steel_char_t.ypos", "3" }, + { "steel_char_t.frames", "1" }, + + { "steel_char_u", "RocksFontDC.pcx" }, + { "steel_char_u.xpos", "5" }, + { "steel_char_u.ypos", "3" }, + { "steel_char_u.frames", "1" }, + + { "steel_char_v", "RocksFontDC.pcx" }, + { "steel_char_v.xpos", "6" }, + { "steel_char_v.ypos", "3" }, + { "steel_char_v.frames", "1" }, + + { "steel_char_w", "RocksFontDC.pcx" }, + { "steel_char_w.xpos", "7" }, + { "steel_char_w.ypos", "3" }, + { "steel_char_w.frames", "1" }, + + { "steel_char_x", "RocksFontDC.pcx" }, + { "steel_char_x.xpos", "8" }, + { "steel_char_x.ypos", "3" }, + { "steel_char_x.frames", "1" }, + + { "steel_char_y", "RocksFontDC.pcx" }, + { "steel_char_y.xpos", "9" }, + { "steel_char_y.ypos", "3" }, + { "steel_char_y.frames", "1" }, + + { "steel_char_z", "RocksFontDC.pcx" }, + { "steel_char_z.xpos", "10" }, + { "steel_char_z.ypos", "3" }, + { "steel_char_z.frames", "1" }, + + { "steel_char_bracketleft", "RocksFontDC.pcx" }, + { "steel_char_bracketleft.xpos", "11" }, + { "steel_char_bracketleft.ypos", "3" }, + { "steel_char_bracketleft.frames", "1" }, + + { "steel_char_backslash", "RocksFontDC.pcx" }, + { "steel_char_backslash.xpos", "12" }, + { "steel_char_backslash.ypos", "3" }, + { "steel_char_backslash.frames", "1" }, + + { "steel_char_bracketright", "RocksFontDC.pcx" }, + { "steel_char_bracketright.xpos", "13" }, + { "steel_char_bracketright.ypos", "3" }, + { "steel_char_bracketright.frames", "1" }, + + { "steel_char_asciicircum", "RocksFontDC.pcx" }, + { "steel_char_asciicircum.xpos", "14" }, + { "steel_char_asciicircum.ypos", "3" }, + { "steel_char_asciicircum.frames", "1" }, + + { "steel_char_underscore", "RocksFontDC.pcx" }, + { "steel_char_underscore.xpos", "15" }, + { "steel_char_underscore.ypos", "3" }, + { "steel_char_underscore.frames", "1" }, + + { "steel_char_copyright", "RocksFontDC.pcx" }, + { "steel_char_copyright.xpos", "0" }, + { "steel_char_copyright.ypos", "4" }, + { "steel_char_copyright.frames", "1" }, + + { "steel_char_aumlaut", "RocksFontDC.pcx" }, + { "steel_char_aumlaut.xpos", "1" }, + { "steel_char_aumlaut.ypos", "4" }, + { "steel_char_aumlaut.frames", "1" }, + + { "steel_char_oumlaut", "RocksFontDC.pcx" }, + { "steel_char_oumlaut.xpos", "2" }, + { "steel_char_oumlaut.ypos", "4" }, + { "steel_char_oumlaut.frames", "1" }, + + { "steel_char_uumlaut", "RocksFontDC.pcx" }, + { "steel_char_uumlaut.xpos", "3" }, + { "steel_char_uumlaut.ypos", "4" }, + { "steel_char_uumlaut.frames", "1" }, + + { "steel_char_degree", "RocksFontDC.pcx" }, + { "steel_char_degree.xpos", "4" }, + { "steel_char_degree.ypos", "4" }, + { "steel_char_degree.frames", "1" }, + + { "steel_char_trademark", "RocksFontDC.pcx" }, + { "steel_char_trademark.xpos", "5" }, + { "steel_char_trademark.ypos", "4" }, + { "steel_char_trademark.frames", "1" }, + + { "steel_char_cursor", "RocksFontDC.pcx" }, + { "steel_char_cursor.xpos", "6" }, + { "steel_char_cursor.ypos", "4" }, + { "steel_char_cursor.frames", "1" }, + + { "steel_char_button", "RocksFontDC.pcx" }, + { "steel_char_button.xpos", "13" }, + { "steel_char_button.ypos", "4" }, + { "steel_char_button.frames", "1" }, + + { "steel_char_up", "RocksFontDC.pcx" }, + { "steel_char_up.xpos", "14" }, + { "steel_char_up.ypos", "4" }, + { "steel_char_up.frames", "1" }, + + { "steel_char_down", "RocksFontDC.pcx" }, + { "steel_char_down.xpos", "15" }, + { "steel_char_down.ypos", "4" }, + { "steel_char_down.frames", "1" }, + #endif /* CONF_CHR_C */ diff --git a/src/conf_chr.h b/src/conf_chr.h index 5c586bb3..41f01a22 100644 --- a/src/conf_chr.h +++ b/src/conf_chr.h @@ -89,5 +89,82 @@ #define EL_CHAR_DEGREE (EL_CHAR_ASCII0 + 100) #define EL_CHAR_TRADEMARK (EL_CHAR_ASCII0 + 101) #define EL_CHAR_CURSOR (EL_CHAR_ASCII0 + 102) +#define EL_CHAR_BUTTON (EL_CHAR_ASCII0 + 109) +#define EL_CHAR_UP (EL_CHAR_ASCII0 + 110) +#define EL_CHAR_DOWN (EL_CHAR_ASCII0 + 111) +#define EL_STEEL_CHAR_SPACE (EL_STEEL_CHAR_ASCII0 + 32) +#define EL_STEEL_CHAR_EXCLAM (EL_STEEL_CHAR_ASCII0 + 33) +#define EL_STEEL_CHAR_QUOTEDBL (EL_STEEL_CHAR_ASCII0 + 34) +#define EL_STEEL_CHAR_NUMBERSIGN (EL_STEEL_CHAR_ASCII0 + 35) +#define EL_STEEL_CHAR_DOLLAR (EL_STEEL_CHAR_ASCII0 + 36) +#define EL_STEEL_CHAR_PERCENT (EL_STEEL_CHAR_ASCII0 + 37) +#define EL_STEEL_CHAR_AMPERSAND (EL_STEEL_CHAR_ASCII0 + 38) +#define EL_STEEL_CHAR_APOSTROPHE (EL_STEEL_CHAR_ASCII0 + 39) +#define EL_STEEL_CHAR_PARENLEFT (EL_STEEL_CHAR_ASCII0 + 40) +#define EL_STEEL_CHAR_PARENRIGHT (EL_STEEL_CHAR_ASCII0 + 41) +#define EL_STEEL_CHAR_ASTERISK (EL_STEEL_CHAR_ASCII0 + 42) +#define EL_STEEL_CHAR_PLUS (EL_STEEL_CHAR_ASCII0 + 43) +#define EL_STEEL_CHAR_COMMA (EL_STEEL_CHAR_ASCII0 + 44) +#define EL_STEEL_CHAR_MINUS (EL_STEEL_CHAR_ASCII0 + 45) +#define EL_STEEL_CHAR_PERIOD (EL_STEEL_CHAR_ASCII0 + 46) +#define EL_STEEL_CHAR_SLASH (EL_STEEL_CHAR_ASCII0 + 47) +#define EL_STEEL_CHAR_0 (EL_STEEL_CHAR_ASCII0 + 48) +#define EL_STEEL_CHAR_1 (EL_STEEL_CHAR_ASCII0 + 49) +#define EL_STEEL_CHAR_2 (EL_STEEL_CHAR_ASCII0 + 50) +#define EL_STEEL_CHAR_3 (EL_STEEL_CHAR_ASCII0 + 51) +#define EL_STEEL_CHAR_4 (EL_STEEL_CHAR_ASCII0 + 52) +#define EL_STEEL_CHAR_5 (EL_STEEL_CHAR_ASCII0 + 53) +#define EL_STEEL_CHAR_6 (EL_STEEL_CHAR_ASCII0 + 54) +#define EL_STEEL_CHAR_7 (EL_STEEL_CHAR_ASCII0 + 55) +#define EL_STEEL_CHAR_8 (EL_STEEL_CHAR_ASCII0 + 56) +#define EL_STEEL_CHAR_9 (EL_STEEL_CHAR_ASCII0 + 57) +#define EL_STEEL_CHAR_COLON (EL_STEEL_CHAR_ASCII0 + 58) +#define EL_STEEL_CHAR_SEMICOLON (EL_STEEL_CHAR_ASCII0 + 59) +#define EL_STEEL_CHAR_LESS (EL_STEEL_CHAR_ASCII0 + 60) +#define EL_STEEL_CHAR_EQUAL (EL_STEEL_CHAR_ASCII0 + 61) +#define EL_STEEL_CHAR_GREATER (EL_STEEL_CHAR_ASCII0 + 62) +#define EL_STEEL_CHAR_QUESTION (EL_STEEL_CHAR_ASCII0 + 63) +#define EL_STEEL_CHAR_AT (EL_STEEL_CHAR_ASCII0 + 64) +#define EL_STEEL_CHAR_A (EL_STEEL_CHAR_ASCII0 + 65) +#define EL_STEEL_CHAR_B (EL_STEEL_CHAR_ASCII0 + 66) +#define EL_STEEL_CHAR_C (EL_STEEL_CHAR_ASCII0 + 67) +#define EL_STEEL_CHAR_D (EL_STEEL_CHAR_ASCII0 + 68) +#define EL_STEEL_CHAR_E (EL_STEEL_CHAR_ASCII0 + 69) +#define EL_STEEL_CHAR_F (EL_STEEL_CHAR_ASCII0 + 70) +#define EL_STEEL_CHAR_G (EL_STEEL_CHAR_ASCII0 + 71) +#define EL_STEEL_CHAR_H (EL_STEEL_CHAR_ASCII0 + 72) +#define EL_STEEL_CHAR_I (EL_STEEL_CHAR_ASCII0 + 73) +#define EL_STEEL_CHAR_J (EL_STEEL_CHAR_ASCII0 + 74) +#define EL_STEEL_CHAR_K (EL_STEEL_CHAR_ASCII0 + 75) +#define EL_STEEL_CHAR_L (EL_STEEL_CHAR_ASCII0 + 76) +#define EL_STEEL_CHAR_M (EL_STEEL_CHAR_ASCII0 + 77) +#define EL_STEEL_CHAR_N (EL_STEEL_CHAR_ASCII0 + 78) +#define EL_STEEL_CHAR_O (EL_STEEL_CHAR_ASCII0 + 79) +#define EL_STEEL_CHAR_P (EL_STEEL_CHAR_ASCII0 + 80) +#define EL_STEEL_CHAR_Q (EL_STEEL_CHAR_ASCII0 + 81) +#define EL_STEEL_CHAR_R (EL_STEEL_CHAR_ASCII0 + 82) +#define EL_STEEL_CHAR_S (EL_STEEL_CHAR_ASCII0 + 83) +#define EL_STEEL_CHAR_T (EL_STEEL_CHAR_ASCII0 + 84) +#define EL_STEEL_CHAR_U (EL_STEEL_CHAR_ASCII0 + 85) +#define EL_STEEL_CHAR_V (EL_STEEL_CHAR_ASCII0 + 86) +#define EL_STEEL_CHAR_W (EL_STEEL_CHAR_ASCII0 + 87) +#define EL_STEEL_CHAR_X (EL_STEEL_CHAR_ASCII0 + 88) +#define EL_STEEL_CHAR_Y (EL_STEEL_CHAR_ASCII0 + 89) +#define EL_STEEL_CHAR_Z (EL_STEEL_CHAR_ASCII0 + 90) +#define EL_STEEL_CHAR_BRACKETLEFT (EL_STEEL_CHAR_ASCII0 + 91) +#define EL_STEEL_CHAR_BACKSLASH (EL_STEEL_CHAR_ASCII0 + 92) +#define EL_STEEL_CHAR_BRACKETRIGHT (EL_STEEL_CHAR_ASCII0 + 93) +#define EL_STEEL_CHAR_ASCIICIRCUM (EL_STEEL_CHAR_ASCII0 + 94) +#define EL_STEEL_CHAR_UNDERSCORE (EL_STEEL_CHAR_ASCII0 + 95) +#define EL_STEEL_CHAR_COPYRIGHT (EL_STEEL_CHAR_ASCII0 + 96) +#define EL_STEEL_CHAR_AUMLAUT (EL_STEEL_CHAR_ASCII0 + 97) +#define EL_STEEL_CHAR_OUMLAUT (EL_STEEL_CHAR_ASCII0 + 98) +#define EL_STEEL_CHAR_UUMLAUT (EL_STEEL_CHAR_ASCII0 + 99) +#define EL_STEEL_CHAR_DEGREE (EL_STEEL_CHAR_ASCII0 + 100) +#define EL_STEEL_CHAR_TRADEMARK (EL_STEEL_CHAR_ASCII0 + 101) +#define EL_STEEL_CHAR_CURSOR (EL_STEEL_CHAR_ASCII0 + 102) +#define EL_STEEL_CHAR_BUTTON (EL_STEEL_CHAR_ASCII0 + 109) +#define EL_STEEL_CHAR_UP (EL_STEEL_CHAR_ASCII0 + 110) +#define EL_STEEL_CHAR_DOWN (EL_STEEL_CHAR_ASCII0 + 111) #endif /* CONF_CHR_C */ diff --git a/src/conf_e2g.c b/src/conf_e2g.c index 5f1685b4..2d49c0e2 100644 --- a/src/conf_e2g.c +++ b/src/conf_e2g.c @@ -1001,6 +1001,42 @@ element_to_graphic[] = EL_MAGIC_WALL_DEAD, -1, -1, FALSE, IMG_MAGIC_WALL_DEAD }, + { + EL_DC_MAGIC_WALL, -1, -1, FALSE, + IMG_DC_MAGIC_WALL + }, + { + EL_DC_MAGIC_WALL_ACTIVE, -1, -1, FALSE, + IMG_DC_MAGIC_WALL_ACTIVE + }, + { + EL_DC_MAGIC_WALL, ACTION_ACTIVE, -1, FALSE, + IMG_DC_MAGIC_WALL_ACTIVE + }, + { + EL_DC_MAGIC_WALL_FILLING, -1, -1, FALSE, + IMG_DC_MAGIC_WALL_FILLING + }, + { + EL_DC_MAGIC_WALL, ACTION_FILLING, -1, FALSE, + IMG_DC_MAGIC_WALL_FILLING + }, + { + EL_DC_MAGIC_WALL_FULL, -1, -1, FALSE, + IMG_DC_MAGIC_WALL_FULL + }, + { + EL_DC_MAGIC_WALL_EMPTYING, -1, -1, FALSE, + IMG_DC_MAGIC_WALL_EMPTYING + }, + { + EL_DC_MAGIC_WALL, ACTION_EMPTYING, -1, FALSE, + IMG_DC_MAGIC_WALL_EMPTYING + }, + { + EL_DC_MAGIC_WALL_DEAD, -1, -1, FALSE, + IMG_DC_MAGIC_WALL_DEAD + }, { EL_QUICKSAND_EMPTY, -1, -1, FALSE, IMG_QUICKSAND_EMPTY @@ -1017,6 +1053,22 @@ element_to_graphic[] = EL_QUICKSAND_EMPTYING, -1, -1, FALSE, IMG_QUICKSAND_EMPTYING }, + { + EL_QUICKSAND_FAST_EMPTY, -1, -1, FALSE, + IMG_QUICKSAND_FAST_EMPTY + }, + { + EL_QUICKSAND_FAST_FILLING, -1, -1, FALSE, + IMG_QUICKSAND_FAST_FILLING + }, + { + EL_QUICKSAND_FAST_FULL, -1, -1, FALSE, + IMG_QUICKSAND_FAST_FULL + }, + { + EL_QUICKSAND_FAST_EMPTYING, -1, -1, FALSE, + IMG_QUICKSAND_FAST_EMPTYING + }, { EL_ACID_POOL_TOPLEFT, -1, -1, FALSE, IMG_ACID_POOL_TOPLEFT @@ -1109,6 +1161,10 @@ element_to_graphic[] = EL_EM_KEY_4, -1, -1, FALSE, IMG_EM_KEY_4 }, + { + EL_DC_KEY_WHITE, -1, -1, FALSE, + IMG_DC_KEY_WHITE + }, { EL_EM_GATE_1, -1, -1, FALSE, IMG_EM_GATE_1 @@ -1125,6 +1181,10 @@ element_to_graphic[] = EL_EM_GATE_4, -1, -1, FALSE, IMG_EM_GATE_4 }, + { + EL_DC_GATE_WHITE, -1, -1, FALSE, + IMG_DC_GATE_WHITE + }, { EL_EM_GATE_1_GRAY, -1, -1, FALSE, IMG_EM_GATE_1_GRAY @@ -1173,6 +1233,22 @@ element_to_graphic[] = EL_EM_GATE_4_GRAY, ACTION_ACTIVE, -1, FALSE, IMG_EM_GATE_4_GRAY_ACTIVE }, + { + EL_DC_GATE_WHITE_GRAY, -1, -1, FALSE, + IMG_DC_GATE_WHITE_GRAY + }, + { + EL_DC_GATE_WHITE_GRAY_ACTIVE, -1, -1, FALSE, + IMG_DC_GATE_WHITE_GRAY_ACTIVE + }, + { + EL_DC_GATE_WHITE_GRAY, ACTION_ACTIVE, -1, FALSE, + IMG_DC_GATE_WHITE_GRAY_ACTIVE + }, + { + EL_DC_GATE_FAKE_GRAY, -1, -1, FALSE, + IMG_DC_GATE_FAKE_GRAY + }, { EL_EXIT_CLOSED, -1, -1, FALSE, IMG_EXIT_CLOSED @@ -1189,6 +1265,54 @@ element_to_graphic[] = EL_EXIT_CLOSING, -1, -1, FALSE, IMG_EXIT_CLOSING }, + { + EL_STEEL_EXIT_CLOSED, -1, -1, FALSE, + IMG_STEEL_EXIT_CLOSED + }, + { + EL_STEEL_EXIT_OPENING, -1, -1, FALSE, + IMG_STEEL_EXIT_OPENING + }, + { + EL_STEEL_EXIT_OPEN, -1, -1, FALSE, + IMG_STEEL_EXIT_OPEN + }, + { + EL_STEEL_EXIT_CLOSING, -1, -1, FALSE, + IMG_STEEL_EXIT_CLOSING + }, + { + EL_EM_EXIT_CLOSED, -1, -1, FALSE, + IMG_EM_EXIT_CLOSED + }, + { + EL_EM_EXIT_OPENING, -1, -1, FALSE, + IMG_EM_EXIT_OPENING + }, + { + EL_EM_EXIT_OPEN, -1, -1, FALSE, + IMG_EM_EXIT_OPEN + }, + { + EL_EM_EXIT_CLOSING, -1, -1, FALSE, + IMG_EM_EXIT_CLOSING + }, + { + EL_EM_STEEL_EXIT_CLOSED, -1, -1, FALSE, + IMG_EM_STEEL_EXIT_CLOSED + }, + { + EL_EM_STEEL_EXIT_OPENING, -1, -1, FALSE, + IMG_EM_STEEL_EXIT_OPENING + }, + { + EL_EM_STEEL_EXIT_OPEN, -1, -1, FALSE, + IMG_EM_STEEL_EXIT_OPEN + }, + { + EL_EM_STEEL_EXIT_CLOSING, -1, -1, FALSE, + IMG_EM_STEEL_EXIT_CLOSING + }, { EL_BALLOON, -1, -1, FALSE, IMG_BALLOON @@ -1553,6 +1677,14 @@ element_to_graphic[] = EL_SWITCHGATE_SWITCH_DOWN, -1, -1, FALSE, IMG_SWITCHGATE_SWITCH_DOWN }, + { + EL_DC_SWITCHGATE_SWITCH_UP, -1, -1, FALSE, + IMG_DC_SWITCHGATE_SWITCH_UP + }, + { + EL_DC_SWITCHGATE_SWITCH_DOWN, -1, -1, FALSE, + IMG_DC_SWITCHGATE_SWITCH_DOWN + }, { EL_LIGHT_SWITCH, -1, -1, FALSE, IMG_LIGHT_SWITCH @@ -1577,6 +1709,18 @@ element_to_graphic[] = EL_TIMEGATE_SWITCH, ACTION_ACTIVE, -1, FALSE, IMG_TIMEGATE_SWITCH_ACTIVE }, + { + EL_DC_TIMEGATE_SWITCH, -1, -1, FALSE, + IMG_DC_TIMEGATE_SWITCH + }, + { + EL_DC_TIMEGATE_SWITCH_ACTIVE, -1, -1, FALSE, + IMG_DC_TIMEGATE_SWITCH_ACTIVE + }, + { + EL_DC_TIMEGATE_SWITCH, ACTION_ACTIVE, -1, FALSE, + IMG_DC_TIMEGATE_SWITCH_ACTIVE + }, { EL_ENVELOPE_1, -1, -1, FALSE, IMG_ENVELOPE_1 @@ -1609,6 +1753,26 @@ element_to_graphic[] = EL_ENVELOPE_4, ACTION_COLLECTING, -1, FALSE, IMG_ENVELOPE_4_COLLECTING }, + { + EL_SIGN_RADIOACTIVITY, -1, -1, FALSE, + IMG_SIGN_RADIOACTIVITY + }, + { + EL_SIGN_GIVE_WAY, -1, -1, FALSE, + IMG_SIGN_GIVE_WAY + }, + { + EL_SIGN_NO_ENTRY, -1, -1, FALSE, + IMG_SIGN_NO_ENTRY + }, + { + EL_SIGN_EMERGENCY_EXIT, -1, -1, FALSE, + IMG_SIGN_EMERGENCY_EXIT + }, + { + EL_SIGN_YIN_YANG, -1, -1, FALSE, + IMG_SIGN_YIN_YANG + }, { EL_SIGN_EXCLAMATION, -1, -1, FALSE, IMG_SIGN_EXCLAMATION @@ -1617,10 +1781,66 @@ element_to_graphic[] = EL_SIGN_STOP, -1, -1, FALSE, IMG_SIGN_STOP }, + { + EL_SIGN_PARKING, -1, -1, FALSE, + IMG_SIGN_PARKING + }, + { + EL_SIGN_WHEELCHAIR, -1, -1, FALSE, + IMG_SIGN_WHEELCHAIR + }, + { + EL_SIGN_ENTRY_FORBIDDEN, -1, -1, FALSE, + IMG_SIGN_ENTRY_FORBIDDEN + }, + { + EL_SPERMS, -1, -1, FALSE, + IMG_SPERMS + }, + { + EL_BULLET, -1, -1, FALSE, + IMG_BULLET + }, + { + EL_HEART, -1, -1, FALSE, + IMG_HEART + }, + { + EL_CROSS, -1, -1, FALSE, + IMG_CROSS + }, + { + EL_FRANKIE, -1, -1, FALSE, + IMG_FRANKIE + }, + { + EL_SIGN_SPERMS, -1, -1, FALSE, + IMG_SIGN_SPERMS + }, + { + EL_SIGN_BULLET, -1, -1, FALSE, + IMG_SIGN_BULLET + }, + { + EL_SIGN_HEART, -1, -1, FALSE, + IMG_SIGN_HEART + }, + { + EL_SIGN_CROSS, -1, -1, FALSE, + IMG_SIGN_CROSS + }, + { + EL_SIGN_FRANKIE, -1, -1, FALSE, + IMG_SIGN_FRANKIE + }, { EL_LANDMINE, -1, -1, FALSE, IMG_LANDMINE }, + { + EL_DC_LANDMINE, -1, -1, FALSE, + IMG_DC_LANDMINE + }, { EL_STEELWALL_SLIPPERY, -1, -1, FALSE, IMG_STEELWALL_SLIPPERY @@ -1709,6 +1929,94 @@ element_to_graphic[] = EL_WALL_CRYSTAL, -1, -1, FALSE, IMG_WALL_CRYSTAL }, + { + EL_DC_STEELWALL_1_LEFT, -1, -1, FALSE, + IMG_DC_STEELWALL_1_LEFT + }, + { + EL_DC_STEELWALL_1_RIGHT, -1, -1, FALSE, + IMG_DC_STEELWALL_1_RIGHT + }, + { + EL_DC_STEELWALL_1_TOP, -1, -1, FALSE, + IMG_DC_STEELWALL_1_TOP + }, + { + EL_DC_STEELWALL_1_BOTTOM, -1, -1, FALSE, + IMG_DC_STEELWALL_1_BOTTOM + }, + { + EL_DC_STEELWALL_1_HORIZONTAL, -1, -1, FALSE, + IMG_DC_STEELWALL_1_HORIZONTAL + }, + { + EL_DC_STEELWALL_1_VERTICAL, -1, -1, FALSE, + IMG_DC_STEELWALL_1_VERTICAL + }, + { + EL_DC_STEELWALL_1_TOPLEFT, -1, -1, FALSE, + IMG_DC_STEELWALL_1_TOPLEFT + }, + { + EL_DC_STEELWALL_1_TOPRIGHT, -1, -1, FALSE, + IMG_DC_STEELWALL_1_TOPRIGHT + }, + { + EL_DC_STEELWALL_1_BOTTOMLEFT, -1, -1, FALSE, + IMG_DC_STEELWALL_1_BOTTOMLEFT + }, + { + EL_DC_STEELWALL_1_BOTTOMRIGHT, -1, -1, FALSE, + IMG_DC_STEELWALL_1_BOTTOMRIGHT + }, + { + EL_DC_STEELWALL_1_TOPLEFT_2, -1, -1, FALSE, + IMG_DC_STEELWALL_1_TOPLEFT_2 + }, + { + EL_DC_STEELWALL_1_TOPRIGHT_2, -1, -1, FALSE, + IMG_DC_STEELWALL_1_TOPRIGHT_2 + }, + { + EL_DC_STEELWALL_1_BOTTOMLEFT_2, -1, -1, FALSE, + IMG_DC_STEELWALL_1_BOTTOMLEFT_2 + }, + { + EL_DC_STEELWALL_1_BOTTOMRIGHT_2, -1, -1, FALSE, + IMG_DC_STEELWALL_1_BOTTOMRIGHT_2 + }, + { + EL_DC_STEELWALL_2_LEFT, -1, -1, FALSE, + IMG_DC_STEELWALL_2_LEFT + }, + { + EL_DC_STEELWALL_2_RIGHT, -1, -1, FALSE, + IMG_DC_STEELWALL_2_RIGHT + }, + { + EL_DC_STEELWALL_2_TOP, -1, -1, FALSE, + IMG_DC_STEELWALL_2_TOP + }, + { + EL_DC_STEELWALL_2_BOTTOM, -1, -1, FALSE, + IMG_DC_STEELWALL_2_BOTTOM + }, + { + EL_DC_STEELWALL_2_HORIZONTAL, -1, -1, FALSE, + IMG_DC_STEELWALL_2_HORIZONTAL + }, + { + EL_DC_STEELWALL_2_VERTICAL, -1, -1, FALSE, + IMG_DC_STEELWALL_2_VERTICAL + }, + { + EL_DC_STEELWALL_2_MIDDLE, -1, -1, FALSE, + IMG_DC_STEELWALL_2_MIDDLE + }, + { + EL_DC_STEELWALL_2_SINGLE, -1, -1, FALSE, + IMG_DC_STEELWALL_2_SINGLE + }, { EL_TUBE_RIGHT_DOWN, -1, -1, FALSE, IMG_TUBE_RIGHT_DOWN @@ -1997,6 +2305,18 @@ element_to_graphic[] = EL_EXPANDABLE_WALL_ANY, -1, -1, FALSE, IMG_EXPANDABLE_WALL_ANY }, + { + EL_EXPANDABLE_STEELWALL_HORIZONTAL, -1, -1, FALSE, + IMG_EXPANDABLE_STEELWALL_HORIZONTAL + }, + { + EL_EXPANDABLE_STEELWALL_VERTICAL, -1, -1, FALSE, + IMG_EXPANDABLE_STEELWALL_VERTICAL + }, + { + EL_EXPANDABLE_STEELWALL_ANY, -1, -1, FALSE, + IMG_EXPANDABLE_STEELWALL_ANY + }, { EL_BD_EXPANDABLE_WALL, -1, -1, FALSE, IMG_BD_EXPANDABLE_WALL @@ -2033,6 +2353,38 @@ element_to_graphic[] = EL_EXPANDABLE_WALL_GROWING, -1, MV_BIT_DOWN, FALSE, IMG_EXPANDABLE_WALL_GROWING_DOWN }, + { + EL_EXPANDABLE_STEELWALL, ACTION_GROWING, MV_BIT_LEFT, FALSE, + IMG_EXPANDABLE_STEELWALL_GROWING_LEFT + }, + { + EL_EXPANDABLE_STEELWALL_GROWING, -1, MV_BIT_LEFT, FALSE, + IMG_EXPANDABLE_STEELWALL_GROWING_LEFT + }, + { + EL_EXPANDABLE_STEELWALL, ACTION_GROWING, MV_BIT_RIGHT, FALSE, + IMG_EXPANDABLE_STEELWALL_GROWING_RIGHT + }, + { + EL_EXPANDABLE_STEELWALL_GROWING, -1, MV_BIT_RIGHT, FALSE, + IMG_EXPANDABLE_STEELWALL_GROWING_RIGHT + }, + { + EL_EXPANDABLE_STEELWALL, ACTION_GROWING, MV_BIT_UP, FALSE, + IMG_EXPANDABLE_STEELWALL_GROWING_UP + }, + { + EL_EXPANDABLE_STEELWALL_GROWING, -1, MV_BIT_UP, FALSE, + IMG_EXPANDABLE_STEELWALL_GROWING_UP + }, + { + EL_EXPANDABLE_STEELWALL, ACTION_GROWING, MV_BIT_DOWN, FALSE, + IMG_EXPANDABLE_STEELWALL_GROWING_DOWN + }, + { + EL_EXPANDABLE_STEELWALL_GROWING, -1, MV_BIT_DOWN, FALSE, + IMG_EXPANDABLE_STEELWALL_GROWING_DOWN + }, { EL_BLACK_ORB, -1, -1, FALSE, IMG_BLACK_ORB @@ -3201,6 +3553,38 @@ element_to_graphic[] = EL_EMC_DRIPPER, ACTION_ACTIVE, -1, FALSE, IMG_EMC_DRIPPER_ACTIVE }, + { + EL_GRAPHIC_1, -1, -1, FALSE, + IMG_GRAPHIC_1 + }, + { + EL_GRAPHIC_2, -1, -1, FALSE, + IMG_GRAPHIC_2 + }, + { + EL_GRAPHIC_3, -1, -1, FALSE, + IMG_GRAPHIC_3 + }, + { + EL_GRAPHIC_4, -1, -1, FALSE, + IMG_GRAPHIC_4 + }, + { + EL_GRAPHIC_5, -1, -1, FALSE, + IMG_GRAPHIC_5 + }, + { + EL_GRAPHIC_6, -1, -1, FALSE, + IMG_GRAPHIC_6 + }, + { + EL_GRAPHIC_7, -1, -1, FALSE, + IMG_GRAPHIC_7 + }, + { + EL_GRAPHIC_8, -1, -1, FALSE, + IMG_GRAPHIC_8 + }, { EL_BD_BUTTERFLY_DOWN, -1, -1, FALSE, IMG_BD_BUTTERFLY @@ -3233,14 +3617,6 @@ element_to_graphic[] = EL_BD_FIREFLY_UP, -1, -1, FALSE, IMG_BD_FIREFLY }, - { - EL_DOOR_WHITE, -1, -1, FALSE, - IMG_CHAR_QUESTION - }, - { - EL_DOOR_WHITE_GRAY, -1, -1, FALSE, - IMG_CHAR_QUESTION - }, { EL_DX_UNKNOWN_15, -1, -1, FALSE, IMG_CHAR_QUESTION @@ -3250,47 +3626,11 @@ element_to_graphic[] = IMG_CHAR_QUESTION }, { - EL_KEY_WHITE, -1, -1, FALSE, - IMG_CHAR_QUESTION - }, - { - EL_SIGN_EXIT, -1, -1, FALSE, + EL_SIGN_UNUSED_1, -1, -1, FALSE, IMG_CHAR_QUESTION }, { - EL_SIGN_HEART, -1, -1, FALSE, - IMG_CHAR_QUESTION - }, - { - EL_SIGN_ONEWAY, -1, -1, FALSE, - IMG_CHAR_QUESTION - }, - { - EL_SIGN_OTHER, -1, -1, FALSE, - IMG_CHAR_QUESTION - }, - { - EL_SIGN_PARKING, -1, -1, FALSE, - IMG_CHAR_QUESTION - }, - { - EL_SIGN_RADIOACTIVITY, -1, -1, FALSE, - IMG_CHAR_QUESTION - }, - { - EL_SIGN_ROUND, -1, -1, FALSE, - IMG_CHAR_QUESTION - }, - { - EL_SIGN_TRIANGLE, -1, -1, FALSE, - IMG_CHAR_QUESTION - }, - { - EL_SIGN_WHEELCHAIR, -1, -1, FALSE, - IMG_CHAR_QUESTION - }, - { - EL_SIGN_YINYANG, -1, -1, FALSE, + EL_SIGN_UNUSED_2, -1, -1, FALSE, IMG_CHAR_QUESTION }, { @@ -3577,6 +3917,314 @@ element_to_graphic[] = EL_CHAR_CURSOR, -1, -1, FALSE, IMG_CHAR_CURSOR }, + { + EL_CHAR_BUTTON, -1, -1, FALSE, + IMG_CHAR_BUTTON + }, + { + EL_CHAR_UP, -1, -1, FALSE, + IMG_CHAR_UP + }, + { + EL_CHAR_DOWN, -1, -1, FALSE, + IMG_CHAR_DOWN + }, + { + EL_STEEL_CHAR_SPACE, -1, -1, FALSE, + IMG_STEEL_CHAR_SPACE + }, + { + EL_STEEL_CHAR_EXCLAM, -1, -1, FALSE, + IMG_STEEL_CHAR_EXCLAM + }, + { + EL_STEEL_CHAR_QUOTEDBL, -1, -1, FALSE, + IMG_STEEL_CHAR_QUOTEDBL + }, + { + EL_STEEL_CHAR_NUMBERSIGN, -1, -1, FALSE, + IMG_STEEL_CHAR_NUMBERSIGN + }, + { + EL_STEEL_CHAR_DOLLAR, -1, -1, FALSE, + IMG_STEEL_CHAR_DOLLAR + }, + { + EL_STEEL_CHAR_PERCENT, -1, -1, FALSE, + IMG_STEEL_CHAR_PERCENT + }, + { + EL_STEEL_CHAR_AMPERSAND, -1, -1, FALSE, + IMG_STEEL_CHAR_AMPERSAND + }, + { + EL_STEEL_CHAR_APOSTROPHE, -1, -1, FALSE, + IMG_STEEL_CHAR_APOSTROPHE + }, + { + EL_STEEL_CHAR_PARENLEFT, -1, -1, FALSE, + IMG_STEEL_CHAR_PARENLEFT + }, + { + EL_STEEL_CHAR_PARENRIGHT, -1, -1, FALSE, + IMG_STEEL_CHAR_PARENRIGHT + }, + { + EL_STEEL_CHAR_ASTERISK, -1, -1, FALSE, + IMG_STEEL_CHAR_ASTERISK + }, + { + EL_STEEL_CHAR_PLUS, -1, -1, FALSE, + IMG_STEEL_CHAR_PLUS + }, + { + EL_STEEL_CHAR_COMMA, -1, -1, FALSE, + IMG_STEEL_CHAR_COMMA + }, + { + EL_STEEL_CHAR_MINUS, -1, -1, FALSE, + IMG_STEEL_CHAR_MINUS + }, + { + EL_STEEL_CHAR_PERIOD, -1, -1, FALSE, + IMG_STEEL_CHAR_PERIOD + }, + { + EL_STEEL_CHAR_SLASH, -1, -1, FALSE, + IMG_STEEL_CHAR_SLASH + }, + { + EL_STEEL_CHAR_0, -1, -1, FALSE, + IMG_STEEL_CHAR_0 + }, + { + EL_STEEL_CHAR_1, -1, -1, FALSE, + IMG_STEEL_CHAR_1 + }, + { + EL_STEEL_CHAR_2, -1, -1, FALSE, + IMG_STEEL_CHAR_2 + }, + { + EL_STEEL_CHAR_3, -1, -1, FALSE, + IMG_STEEL_CHAR_3 + }, + { + EL_STEEL_CHAR_4, -1, -1, FALSE, + IMG_STEEL_CHAR_4 + }, + { + EL_STEEL_CHAR_5, -1, -1, FALSE, + IMG_STEEL_CHAR_5 + }, + { + EL_STEEL_CHAR_6, -1, -1, FALSE, + IMG_STEEL_CHAR_6 + }, + { + EL_STEEL_CHAR_7, -1, -1, FALSE, + IMG_STEEL_CHAR_7 + }, + { + EL_STEEL_CHAR_8, -1, -1, FALSE, + IMG_STEEL_CHAR_8 + }, + { + EL_STEEL_CHAR_9, -1, -1, FALSE, + IMG_STEEL_CHAR_9 + }, + { + EL_STEEL_CHAR_COLON, -1, -1, FALSE, + IMG_STEEL_CHAR_COLON + }, + { + EL_STEEL_CHAR_SEMICOLON, -1, -1, FALSE, + IMG_STEEL_CHAR_SEMICOLON + }, + { + EL_STEEL_CHAR_LESS, -1, -1, FALSE, + IMG_STEEL_CHAR_LESS + }, + { + EL_STEEL_CHAR_EQUAL, -1, -1, FALSE, + IMG_STEEL_CHAR_EQUAL + }, + { + EL_STEEL_CHAR_GREATER, -1, -1, FALSE, + IMG_STEEL_CHAR_GREATER + }, + { + EL_STEEL_CHAR_QUESTION, -1, -1, FALSE, + IMG_STEEL_CHAR_QUESTION + }, + { + EL_STEEL_CHAR_AT, -1, -1, FALSE, + IMG_STEEL_CHAR_AT + }, + { + EL_STEEL_CHAR_A, -1, -1, FALSE, + IMG_STEEL_CHAR_A + }, + { + EL_STEEL_CHAR_B, -1, -1, FALSE, + IMG_STEEL_CHAR_B + }, + { + EL_STEEL_CHAR_C, -1, -1, FALSE, + IMG_STEEL_CHAR_C + }, + { + EL_STEEL_CHAR_D, -1, -1, FALSE, + IMG_STEEL_CHAR_D + }, + { + EL_STEEL_CHAR_E, -1, -1, FALSE, + IMG_STEEL_CHAR_E + }, + { + EL_STEEL_CHAR_F, -1, -1, FALSE, + IMG_STEEL_CHAR_F + }, + { + EL_STEEL_CHAR_G, -1, -1, FALSE, + IMG_STEEL_CHAR_G + }, + { + EL_STEEL_CHAR_H, -1, -1, FALSE, + IMG_STEEL_CHAR_H + }, + { + EL_STEEL_CHAR_I, -1, -1, FALSE, + IMG_STEEL_CHAR_I + }, + { + EL_STEEL_CHAR_J, -1, -1, FALSE, + IMG_STEEL_CHAR_J + }, + { + EL_STEEL_CHAR_K, -1, -1, FALSE, + IMG_STEEL_CHAR_K + }, + { + EL_STEEL_CHAR_L, -1, -1, FALSE, + IMG_STEEL_CHAR_L + }, + { + EL_STEEL_CHAR_M, -1, -1, FALSE, + IMG_STEEL_CHAR_M + }, + { + EL_STEEL_CHAR_N, -1, -1, FALSE, + IMG_STEEL_CHAR_N + }, + { + EL_STEEL_CHAR_O, -1, -1, FALSE, + IMG_STEEL_CHAR_O + }, + { + EL_STEEL_CHAR_P, -1, -1, FALSE, + IMG_STEEL_CHAR_P + }, + { + EL_STEEL_CHAR_Q, -1, -1, FALSE, + IMG_STEEL_CHAR_Q + }, + { + EL_STEEL_CHAR_R, -1, -1, FALSE, + IMG_STEEL_CHAR_R + }, + { + EL_STEEL_CHAR_S, -1, -1, FALSE, + IMG_STEEL_CHAR_S + }, + { + EL_STEEL_CHAR_T, -1, -1, FALSE, + IMG_STEEL_CHAR_T + }, + { + EL_STEEL_CHAR_U, -1, -1, FALSE, + IMG_STEEL_CHAR_U + }, + { + EL_STEEL_CHAR_V, -1, -1, FALSE, + IMG_STEEL_CHAR_V + }, + { + EL_STEEL_CHAR_W, -1, -1, FALSE, + IMG_STEEL_CHAR_W + }, + { + EL_STEEL_CHAR_X, -1, -1, FALSE, + IMG_STEEL_CHAR_X + }, + { + EL_STEEL_CHAR_Y, -1, -1, FALSE, + IMG_STEEL_CHAR_Y + }, + { + EL_STEEL_CHAR_Z, -1, -1, FALSE, + IMG_STEEL_CHAR_Z + }, + { + EL_STEEL_CHAR_BRACKETLEFT, -1, -1, FALSE, + IMG_STEEL_CHAR_BRACKETLEFT + }, + { + EL_STEEL_CHAR_BACKSLASH, -1, -1, FALSE, + IMG_STEEL_CHAR_BACKSLASH + }, + { + EL_STEEL_CHAR_BRACKETRIGHT, -1, -1, FALSE, + IMG_STEEL_CHAR_BRACKETRIGHT + }, + { + EL_STEEL_CHAR_ASCIICIRCUM, -1, -1, FALSE, + IMG_STEEL_CHAR_ASCIICIRCUM + }, + { + EL_STEEL_CHAR_UNDERSCORE, -1, -1, FALSE, + IMG_STEEL_CHAR_UNDERSCORE + }, + { + EL_STEEL_CHAR_COPYRIGHT, -1, -1, FALSE, + IMG_STEEL_CHAR_COPYRIGHT + }, + { + EL_STEEL_CHAR_AUMLAUT, -1, -1, FALSE, + IMG_STEEL_CHAR_AUMLAUT + }, + { + EL_STEEL_CHAR_OUMLAUT, -1, -1, FALSE, + IMG_STEEL_CHAR_OUMLAUT + }, + { + EL_STEEL_CHAR_UUMLAUT, -1, -1, FALSE, + IMG_STEEL_CHAR_UUMLAUT + }, + { + EL_STEEL_CHAR_DEGREE, -1, -1, FALSE, + IMG_STEEL_CHAR_DEGREE + }, + { + EL_STEEL_CHAR_TRADEMARK, -1, -1, FALSE, + IMG_STEEL_CHAR_TRADEMARK + }, + { + EL_STEEL_CHAR_CURSOR, -1, -1, FALSE, + IMG_STEEL_CHAR_CURSOR + }, + { + EL_STEEL_CHAR_BUTTON, -1, -1, FALSE, + IMG_STEEL_CHAR_BUTTON + }, + { + EL_STEEL_CHAR_UP, -1, -1, FALSE, + IMG_STEEL_CHAR_UP + }, + { + EL_STEEL_CHAR_DOWN, -1, -1, FALSE, + IMG_STEEL_CHAR_DOWN + }, { EL_CUSTOM_1, -1, -1, FALSE, IMG_CUSTOM_1 diff --git a/src/conf_e2s.c b/src/conf_e2s.c index e671b394..bdcb6ac8 100644 --- a/src/conf_e2s.c +++ b/src/conf_e2s.c @@ -376,6 +376,26 @@ element_to_sound[] = EL_MAGIC_WALL, FALSE, ACTION_FILLING, SND_MAGIC_WALL_FILLING }, + { + EL_DC_MAGIC_WALL, FALSE, ACTION_ACTIVATING, + SND_DC_MAGIC_WALL_ACTIVATING + }, + { + EL_DC_MAGIC_WALL_ACTIVE, FALSE, -1, + SND_DC_MAGIC_WALL_ACTIVE + }, + { + EL_DC_MAGIC_WALL, FALSE, ACTION_ACTIVE, + SND_DC_MAGIC_WALL_ACTIVE + }, + { + EL_DC_MAGIC_WALL_FILLING, FALSE, -1, + SND_DC_MAGIC_WALL_FILLING + }, + { + EL_DC_MAGIC_WALL, FALSE, ACTION_FILLING, + SND_DC_MAGIC_WALL_FILLING + }, { EL_AMOEBA_DEAD, TRUE, ACTION_WAITING, SND_CLASS_AMOEBA_WAITING @@ -412,6 +432,42 @@ element_to_sound[] = EL_EXIT_CLOSED, TRUE, ACTION_PASSING, SND_CLASS_EXIT_PASSING }, + { + EL_STEEL_EXIT_CLOSED, TRUE, ACTION_OPENING, + SND_CLASS_STEEL_EXIT_OPENING + }, + { + EL_STEEL_EXIT_CLOSED, TRUE, ACTION_CLOSING, + SND_CLASS_STEEL_EXIT_CLOSING + }, + { + EL_STEEL_EXIT_CLOSED, TRUE, ACTION_PASSING, + SND_CLASS_STEEL_EXIT_PASSING + }, + { + EL_EM_EXIT_CLOSED, TRUE, ACTION_OPENING, + SND_CLASS_EM_EXIT_OPENING + }, + { + EL_EM_EXIT_CLOSED, TRUE, ACTION_CLOSING, + SND_CLASS_EM_EXIT_CLOSING + }, + { + EL_EM_EXIT_CLOSED, TRUE, ACTION_PASSING, + SND_CLASS_EM_EXIT_PASSING + }, + { + EL_EM_STEEL_EXIT_CLOSED, TRUE, ACTION_OPENING, + SND_CLASS_EM_STEEL_EXIT_OPENING + }, + { + EL_EM_STEEL_EXIT_CLOSED, TRUE, ACTION_CLOSING, + SND_CLASS_EM_STEEL_EXIT_CLOSING + }, + { + EL_EM_STEEL_EXIT_CLOSED, TRUE, ACTION_PASSING, + SND_CLASS_EM_STEEL_EXIT_PASSING + }, { EL_PENGUIN, FALSE, ACTION_PASSING, SND_PENGUIN_PASSING @@ -565,24 +621,20 @@ element_to_sound[] = SND_CLASS_SWITCHGATE_PASSING }, { - EL_TIMEGATE_SWITCH, FALSE, ACTION_ACTIVATING, - SND_TIMEGATE_SWITCH_ACTIVATING - }, - { - EL_TIMEGATE_SWITCH_ACTIVE, FALSE, -1, - SND_TIMEGATE_SWITCH_ACTIVE + EL_TIMEGATE_SWITCH_ACTIVE, TRUE, ACTION_ACTIVATING, + SND_CLASS_TIMEGATE_SWITCH_ACTIVATING }, { - EL_TIMEGATE_SWITCH, FALSE, ACTION_ACTIVE, - SND_TIMEGATE_SWITCH_ACTIVE + EL_TIMEGATE_SWITCH_ACTIVE, TRUE, ACTION_ACTIVE, + SND_CLASS_TIMEGATE_SWITCH_ACTIVE }, { - EL_TIMEGATE_SWITCH, FALSE, ACTION_DEACTIVATING, - SND_TIMEGATE_SWITCH_DEACTIVATING + EL_TIMEGATE_SWITCH_ACTIVE, TRUE, ACTION_DEACTIVATING, + SND_CLASS_TIMEGATE_SWITCH_DEACTIVATING }, { - EL_TIMEGATE_OPENING, FALSE, -1, - SND_TIMEGATE_OPENING + EL_TIMEGATE_OPEN, TRUE, ACTION_OPENING, + SND_CLASS_TIMEGATE_OPENING }, { EL_TIMEGATE_OPEN, TRUE, ACTION_CLOSING, diff --git a/src/conf_esg.c b/src/conf_esg.c index 29cba335..9b97510d 100644 --- a/src/conf_esg.c +++ b/src/conf_esg.c @@ -175,6 +175,10 @@ element_to_special_graphic[] = EL_QUICKSAND_FULL, GFX_SPECIAL_ARG_EDITOR, IMG_QUICKSAND_FULL_EDITOR }, + { + EL_QUICKSAND_FAST_FULL, GFX_SPECIAL_ARG_EDITOR, + IMG_QUICKSAND_FAST_FULL_EDITOR + }, { EL_AMOEBA_WET, GFX_SPECIAL_ARG_EDITOR, IMG_AMOEBA_WET_EDITOR @@ -203,6 +207,10 @@ element_to_special_graphic[] = EL_EM_GATE_4_GRAY, GFX_SPECIAL_ARG_EDITOR, IMG_EM_GATE_4_GRAY_EDITOR }, + { + EL_DC_GATE_WHITE_GRAY, GFX_SPECIAL_ARG_EDITOR, + IMG_DC_GATE_WHITE_GRAY_EDITOR + }, { EL_INVISIBLE_STEELWALL, GFX_SPECIAL_ARG_EDITOR, IMG_INVISIBLE_STEELWALL_EDITOR @@ -263,6 +271,18 @@ element_to_special_graphic[] = EL_EXPANDABLE_WALL_ANY, GFX_SPECIAL_ARG_EDITOR, IMG_EXPANDABLE_WALL_ANY_EDITOR }, + { + EL_EXPANDABLE_STEELWALL_HORIZONTAL, GFX_SPECIAL_ARG_EDITOR, + IMG_EXPANDABLE_STEELWALL_HORIZONTAL_EDITOR + }, + { + EL_EXPANDABLE_STEELWALL_VERTICAL, GFX_SPECIAL_ARG_EDITOR, + IMG_EXPANDABLE_STEELWALL_VERTICAL_EDITOR + }, + { + EL_EXPANDABLE_STEELWALL_ANY, GFX_SPECIAL_ARG_EDITOR, + IMG_EXPANDABLE_STEELWALL_ANY_EDITOR + }, { EL_BD_EXPANDABLE_WALL, GFX_SPECIAL_ARG_EDITOR, IMG_BD_EXPANDABLE_WALL_EDITOR diff --git a/src/conf_fnt.c b/src/conf_fnt.c index 35d60b91..f23bd997 100644 --- a/src/conf_fnt.c +++ b/src/conf_fnt.c @@ -51,6 +51,10 @@ font_to_graphic[] = FONT_TITLE_2, -1, IMG_FONT_TITLE_2 }, + { + FONT_TITLE_2, GFX_SPECIAL_ARG_SETUP, + IMG_FONT_TITLE_2_SETUP + }, { FONT_MENU_1, -1, IMG_FONT_MENU_1 @@ -71,10 +75,18 @@ font_to_graphic[] = FONT_TEXT_1, -1, IMG_FONT_TEXT_1 }, + { + FONT_TEXT_1, GFX_SPECIAL_ARG_MAIN, + IMG_FONT_TEXT_1_MAIN + }, { FONT_TEXT_1, GFX_SPECIAL_ARG_LEVELS, IMG_FONT_TEXT_1_LEVELS }, + { + FONT_TEXT_1, GFX_SPECIAL_ARG_SETUP, + IMG_FONT_TEXT_1_SETUP + }, { FONT_TEXT_1, GFX_SPECIAL_ARG_PREVIEW, IMG_FONT_TEXT_1_PREVIEW @@ -87,14 +99,30 @@ font_to_graphic[] = FONT_TEXT_1_ACTIVE, GFX_SPECIAL_ARG_SCORES, IMG_FONT_TEXT_1_ACTIVE_SCORES }, + { + FONT_TEXT_1, GFX_SPECIAL_ARG_PANEL, + IMG_FONT_TEXT_1_PANEL + }, + { + FONT_TEXT_1, GFX_SPECIAL_ARG_DOOR, + IMG_FONT_TEXT_1_DOOR + }, { FONT_TEXT_2, -1, IMG_FONT_TEXT_2 }, + { + FONT_TEXT_2, GFX_SPECIAL_ARG_MAIN, + IMG_FONT_TEXT_2_MAIN + }, { FONT_TEXT_2, GFX_SPECIAL_ARG_LEVELS, IMG_FONT_TEXT_2_LEVELS }, + { + FONT_TEXT_2, GFX_SPECIAL_ARG_SETUP, + IMG_FONT_TEXT_2_SETUP + }, { FONT_TEXT_2, GFX_SPECIAL_ARG_PREVIEW, IMG_FONT_TEXT_2_PREVIEW @@ -115,6 +143,10 @@ font_to_graphic[] = FONT_TEXT_3, GFX_SPECIAL_ARG_LEVELS, IMG_FONT_TEXT_3_LEVELS }, + { + FONT_TEXT_3, GFX_SPECIAL_ARG_SETUP, + IMG_FONT_TEXT_3_SETUP + }, { FONT_TEXT_3, GFX_SPECIAL_ARG_PREVIEW, IMG_FONT_TEXT_3_PREVIEW @@ -131,10 +163,18 @@ font_to_graphic[] = FONT_TEXT_4, -1, IMG_FONT_TEXT_4 }, + { + FONT_TEXT_4, GFX_SPECIAL_ARG_MAIN, + IMG_FONT_TEXT_4_MAIN + }, { FONT_TEXT_4, GFX_SPECIAL_ARG_LEVELS, IMG_FONT_TEXT_4_LEVELS }, + { + FONT_TEXT_4, GFX_SPECIAL_ARG_SETUP, + IMG_FONT_TEXT_4_SETUP + }, { FONT_TEXT_4, GFX_SPECIAL_ARG_SCORES, IMG_FONT_TEXT_4_SCORES @@ -211,6 +251,10 @@ font_to_graphic[] = FONT_LEVEL_NUMBER, -1, IMG_FONT_LEVEL_NUMBER }, + { + FONT_LEVEL_NUMBER_ACTIVE, -1, + IMG_FONT_LEVEL_NUMBER_ACTIVE + }, { FONT_TAPE_RECORDER, -1, IMG_FONT_TAPE_RECORDER @@ -219,6 +263,14 @@ font_to_graphic[] = FONT_GAME_INFO, -1, IMG_FONT_GAME_INFO }, + { + FONT_INFO_ELEMENTS, -1, + IMG_FONT_INFO_ELEMENTS + }, + { + FONT_INFO_LEVELSET, -1, + IMG_FONT_INFO_LEVELSET + }, { -1, -1, -1 diff --git a/src/conf_g2m.c b/src/conf_g2m.c index 447025c1..207525ef 100644 --- a/src/conf_g2m.c +++ b/src/conf_g2m.c @@ -31,12 +31,12 @@ gamemode_to_music[] = MUS_BACKGROUND }, { - GFX_SPECIAL_ARG_TITLE, - MUS_BACKGROUND_TITLE + GFX_SPECIAL_ARG_TITLE_INITIAL, + MUS_BACKGROUND_TITLE_INITIAL }, { - GFX_SPECIAL_ARG_MESSAGE, - MUS_BACKGROUND_MESSAGE + GFX_SPECIAL_ARG_TITLE, + MUS_BACKGROUND_TITLE }, { GFX_SPECIAL_ARG_MAIN, diff --git a/src/conf_g2s.c b/src/conf_g2s.c index b4c9ff8f..ec9ea426 100644 --- a/src/conf_g2s.c +++ b/src/conf_g2s.c @@ -27,12 +27,12 @@ static struct gamemode_to_sound[] = { { - GFX_SPECIAL_ARG_TITLE, - SND_BACKGROUND_TITLE + GFX_SPECIAL_ARG_TITLE_INITIAL, + SND_BACKGROUND_TITLE_INITIAL }, { - GFX_SPECIAL_ARG_MESSAGE, - SND_BACKGROUND_MESSAGE + GFX_SPECIAL_ARG_TITLE, + SND_BACKGROUND_TITLE }, { GFX_SPECIAL_ARG_MAIN, diff --git a/src/conf_gfx.c b/src/conf_gfx.c index 6a8faeec..f3bebdf5 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -43,8 +43,8 @@ struct ConfigTypeInfo image_config_suffix[] = { ".delay", "1", TYPE_INTEGER }, { ".anim_mode", ARG_UNDEFINED, TYPE_STRING }, { ".global_sync", "false", TYPE_BOOLEAN }, - { ".crumbled_like", ARG_UNDEFINED, TYPE_TOKEN }, - { ".diggable_like", ARG_UNDEFINED, TYPE_TOKEN }, + { ".crumbled_like", ARG_UNDEFINED, TYPE_ELEMENT }, + { ".diggable_like", ARG_UNDEFINED, TYPE_ELEMENT }, { ".border_size", ARG_UNDEFINED, TYPE_INTEGER }, { ".step_offset", "4", TYPE_INTEGER }, { ".step_delay", "1", TYPE_INTEGER }, @@ -59,10 +59,14 @@ struct ConfigTypeInfo image_config_suffix[] = { ".post_delay_random", ARG_UNDEFINED, TYPE_INTEGER }, { ".name", ARG_UNDEFINED, TYPE_STRING }, { ".scale_up_factor", ARG_UNDEFINED, TYPE_INTEGER }, - { ".clone_from", ARG_UNDEFINED, TYPE_TOKEN }, + { ".clone_from", ARG_UNDEFINED, TYPE_GRAPHIC }, + { ".fade_mode", ARG_UNDEFINED, TYPE_INTEGER }, { ".fade_delay", ARG_UNDEFINED, TYPE_INTEGER }, { ".post_delay", ARG_UNDEFINED, TYPE_INTEGER }, { ".auto_delay", ARG_UNDEFINED, TYPE_INTEGER }, + { ".align", ARG_UNDEFINED, TYPE_INTEGER }, + { ".valign", ARG_UNDEFINED, TYPE_INTEGER }, + { ".sort_priority", ARG_UNDEFINED, TYPE_INTEGER }, { NULL, NULL, 0 } }; @@ -1303,6 +1307,43 @@ struct ConfigInfo image_config[] = { "magic_wall_dead.ypos", "8" }, { "magic_wall_dead.frames", "1" }, + { "dc_magic_wall", "RocksDC2.pcx" }, + { "dc_magic_wall.xpos", "0" }, + { "dc_magic_wall.ypos", "3" }, + { "dc_magic_wall.frames", "1" }, + { "dc_magic_wall.active", "RocksDC2.pcx" }, + { "dc_magic_wall.active.xpos", "0" }, + { "dc_magic_wall.active.ypos", "3" }, + { "dc_magic_wall.active.frames", "4" }, + { "dc_magic_wall.active.anim_mode", "reverse" }, + { "dc_magic_wall.active.delay", "4" }, + { "dc_magic_wall.active.global_sync", "true" }, + { "dc_magic_wall.filling", "RocksDC2.pcx" }, + { "dc_magic_wall.filling.xpos", "0" }, + { "dc_magic_wall.filling.ypos", "3" }, + { "dc_magic_wall.filling.frames", "4" }, + { "dc_magic_wall.filling.anim_mode", "reverse" }, + { "dc_magic_wall.filling.delay", "4" }, + { "dc_magic_wall.filling.global_sync", "true" }, + { "dc_magic_wall_full", "RocksDC2.pcx" }, + { "dc_magic_wall_full.xpos", "0" }, + { "dc_magic_wall_full.ypos", "3" }, + { "dc_magic_wall_full.frames", "4" }, + { "dc_magic_wall_full.anim_mode", "reverse" }, + { "dc_magic_wall_full.delay", "4" }, + { "dc_magic_wall_full.global_sync", "true" }, + { "dc_magic_wall.emptying", "RocksDC2.pcx" }, + { "dc_magic_wall.emptying.xpos", "0" }, + { "dc_magic_wall.emptying.ypos", "3" }, + { "dc_magic_wall.emptying.frames", "4" }, + { "dc_magic_wall.emptying.anim_mode", "reverse" }, + { "dc_magic_wall.emptying.delay", "4" }, + { "dc_magic_wall.emptying.global_sync", "true" }, + { "dc_magic_wall_dead", "RocksDC2.pcx" }, + { "dc_magic_wall_dead.xpos", "0" }, + { "dc_magic_wall_dead.ypos", "3" }, + { "dc_magic_wall_dead.frames", "1" }, + { "quicksand_empty", "RocksElements.pcx" }, { "quicksand_empty.xpos", "2" }, { "quicksand_empty.ypos", "0" }, @@ -1323,6 +1364,26 @@ struct ConfigInfo image_config[] = { "quicksand.emptying.ypos", "0" }, { "quicksand.emptying.frames", "1" }, + { "quicksand_fast_empty", "RocksDC2.pcx" }, + { "quicksand_fast_empty.xpos", "4" }, + { "quicksand_fast_empty.ypos", "3" }, + { "quicksand_fast_empty.frames", "1" }, + { "quicksand_fast.filling", "RocksDC2.pcx" }, + { "quicksand_fast.filling.xpos", "4" }, + { "quicksand_fast.filling.ypos", "3" }, + { "quicksand_fast.filling.frames", "1" }, + { "quicksand_fast_full", "RocksDC2.pcx" }, + { "quicksand_fast_full.xpos", "4" }, + { "quicksand_fast_full.ypos", "3" }, + { "quicksand_fast_full.frames", "1" }, + { "quicksand_fast_full.EDITOR", "RocksDC2.pcx" }, + { "quicksand_fast_full.EDITOR.xpos", "5" }, + { "quicksand_fast_full.EDITOR.ypos", "3" }, + { "quicksand_fast.emptying", "RocksDC2.pcx" }, + { "quicksand_fast.emptying.xpos", "4" }, + { "quicksand_fast.emptying.ypos", "3" }, + { "quicksand_fast.emptying.frames", "1" }, + { "acid_pool_topleft", "RocksElements.pcx" }, { "acid_pool_topleft.xpos", "0" }, { "acid_pool_topleft.ypos", "1" }, @@ -1437,6 +1498,11 @@ struct ConfigInfo image_config[] = { "em_key_4.ypos", "6" }, { "em_key_4.frames", "1" }, + { "dc_key_white", "RocksSP.pcx" }, + { "dc_key_white.xpos", "13" }, + { "dc_key_white.ypos", "1" }, + { "dc_key_white.frames", "1" }, + { "em_gate_1", "RocksSP.pcx" }, { "em_gate_1.xpos", "0" }, { "em_gate_1.ypos", "7" }, @@ -1453,6 +1519,12 @@ struct ConfigInfo image_config[] = { "em_gate_4.xpos", "3" }, { "em_gate_4.ypos", "7" }, { "em_gate_4.frames", "1" }, + + { "dc_gate_white", "RocksSP.pcx" }, + { "dc_gate_white.xpos", "14" }, + { "dc_gate_white.ypos", "1" }, + { "dc_gate_white.frames", "1" }, + { "em_gate_1_gray", "RocksSP.pcx" }, { "em_gate_1_gray.xpos", "4" }, { "em_gate_1_gray.ypos", "7" }, @@ -1498,6 +1570,23 @@ struct ConfigInfo image_config[] = { "em_gate_4_gray.active.ypos", "7" }, { "em_gate_4_gray.active.frames", "1" }, + { "dc_gate_white_gray", "RocksSP.pcx" }, + { "dc_gate_white_gray.xpos", "7" }, + { "dc_gate_white_gray.ypos", "7" }, + { "dc_gate_white_gray.frames", "1" }, + { "dc_gate_white_gray.EDITOR", "RocksSP.pcx" }, + { "dc_gate_white_gray.EDITOR.xpos", "15" }, + { "dc_gate_white_gray.EDITOR.ypos", "1" }, + { "dc_gate_white_gray.active", "RocksSP.pcx" }, + { "dc_gate_white_gray.active.xpos", "14" }, + { "dc_gate_white_gray.active.ypos", "1" }, + { "dc_gate_white_gray.active.frames", "1" }, + + { "dc_gate_fake_gray", "RocksSP.pcx" }, + { "dc_gate_fake_gray.xpos", "7" }, + { "dc_gate_fake_gray.ypos", "7" }, + { "dc_gate_fake_gray.frames", "1" }, + { "exit_closed", "RocksElements.pcx" }, { "exit_closed.xpos", "0" }, { "exit_closed.ypos", "11" }, @@ -1521,6 +1610,75 @@ struct ConfigInfo image_config[] = { "exit.closing.delay", "6" }, { "exit.closing.anim_mode", "linear,reverse" }, + { "steel_exit_closed", "RocksDC2.pcx" }, + { "steel_exit_closed.xpos", "8" }, + { "steel_exit_closed.ypos", "0" }, + { "steel_exit_closed.frames", "1" }, + { "steel_exit.opening", "RocksDC2.pcx" }, + { "steel_exit.opening.xpos", "8" }, + { "steel_exit.opening.ypos", "0" }, + { "steel_exit.opening.frames", "5" }, + { "steel_exit.opening.delay", "6" }, + { "steel_exit.opening.anim_mode", "linear" }, + { "steel_exit_open", "RocksDC2.pcx" }, + { "steel_exit_open.xpos", "12" }, + { "steel_exit_open.ypos", "0" }, + { "steel_exit_open.frames", "4" }, + { "steel_exit_open.delay", "4" }, + { "steel_exit_open.anim_mode", "pingpong" }, + { "steel_exit.closing", "RocksDC2.pcx" }, + { "steel_exit.closing.xpos", "8" }, + { "steel_exit.closing.ypos", "0" }, + { "steel_exit.closing.frames", "5" }, + { "steel_exit.closing.delay", "6" }, + { "steel_exit.closing.anim_mode", "linear,reverse" }, + + { "em_exit_closed", "RocksDC2.pcx" }, + { "em_exit_closed.xpos", "0" }, + { "em_exit_closed.ypos", "4" }, + { "em_exit_closed.frames", "1" }, + { "em_exit.opening", "RocksDC2.pcx" }, + { "em_exit.opening.xpos", "0" }, + { "em_exit.opening.ypos", "4" }, + { "em_exit.opening.frames", "5" }, + { "em_exit.opening.delay", "6" }, + { "em_exit.opening.anim_mode", "linear" }, + { "em_exit_open", "RocksDC2.pcx" }, + { "em_exit_open.xpos", "4" }, + { "em_exit_open.ypos", "4" }, + { "em_exit_open.frames", "4" }, + { "em_exit_open.delay", "4" }, + { "em_exit_open.anim_mode", "pingpong" }, + { "em_exit.closing", "RocksDC2.pcx" }, + { "em_exit.closing.xpos", "0" }, + { "em_exit.closing.ypos", "6" }, + { "em_exit.closing.frames", "5" }, + { "em_exit.closing.delay", "6" }, + { "em_exit.closing.anim_mode", "linear" }, + + { "em_steel_exit_closed", "RocksDC2.pcx" }, + { "em_steel_exit_closed.xpos", "0" }, + { "em_steel_exit_closed.ypos", "5" }, + { "em_steel_exit_closed.frames", "1" }, + { "em_steel_exit.opening", "RocksDC2.pcx" }, + { "em_steel_exit.opening.xpos", "0" }, + { "em_steel_exit.opening.ypos", "5" }, + { "em_steel_exit.opening.frames", "5" }, + { "em_steel_exit.opening.delay", "6" }, + { "em_steel_exit.opening.anim_mode", "linear" }, + { "em_steel_exit_open", "RocksDC2.pcx" }, + { "em_steel_exit_open.xpos", "4" }, + { "em_steel_exit_open.ypos", "5" }, + { "em_steel_exit_open.frames", "4" }, + { "em_steel_exit_open.delay", "4" }, + { "em_steel_exit_open.anim_mode", "pingpong" }, + { "em_steel_exit.closing", "RocksDC2.pcx" }, + { "em_steel_exit.closing.xpos", "0" }, + { "em_steel_exit.closing.ypos", "7" }, + { "em_steel_exit.closing.frames", "5" }, + { "em_steel_exit.closing.delay", "6" }, + { "em_steel_exit.closing.anim_mode", "linear" }, + /* images for Emerald Mine Club style elements and actions */ { "balloon", "RocksDC.pcx" }, @@ -1878,6 +2036,15 @@ struct ConfigInfo image_config[] = { "switchgate_switch_down.ypos", "12" }, { "switchgate_switch_down.frames", "1" }, + { "dc_switchgate_switch_up", "RocksDC2.pcx" }, + { "dc_switchgate_switch_up.xpos", "10" }, + { "dc_switchgate_switch_up.ypos", "1" }, + { "dc_switchgate_switch_up.frames", "1" }, + { "dc_switchgate_switch_down", "RocksDC2.pcx" }, + { "dc_switchgate_switch_down.xpos", "11" }, + { "dc_switchgate_switch_down.ypos", "1" }, + { "dc_switchgate_switch_down.frames", "1" }, + { "light_switch", "RocksDC.pcx" }, { "light_switch.xpos", "6" }, { "light_switch.ypos", "12" }, @@ -1896,6 +2063,15 @@ struct ConfigInfo image_config[] = { "timegate_switch.active.ypos", "15" }, { "timegate_switch.active.frames", "4" }, + { "dc_timegate_switch", "RocksDC2.pcx" }, + { "dc_timegate_switch.xpos", "12" }, + { "dc_timegate_switch.ypos", "1" }, + { "dc_timegate_switch.frames", "1" }, + { "dc_timegate_switch.active", "RocksDC2.pcx" }, + { "dc_timegate_switch.active.xpos", "12" }, + { "dc_timegate_switch.active.ypos", "1" }, + { "dc_timegate_switch.active.frames", "4" }, + { "envelope_1", "RocksMore.pcx" }, { "envelope_1.xpos", "0" }, { "envelope_1.ypos", "4" }, @@ -1937,6 +2113,31 @@ struct ConfigInfo image_config[] = { "envelope_4.collecting.delay", "2" }, { "envelope_4.collecting.anim_mode", "linear" }, + { "sign_radioactivity", "RocksDC.pcx" }, + { "sign_radioactivity.xpos", "4" }, + { "sign_radioactivity.ypos", "13" }, + { "sign_radioactivity.frames", "1" }, + + { "sign_give_way", "RocksDC.pcx" }, + { "sign_give_way.xpos", "5" }, + { "sign_give_way.ypos", "13" }, + { "sign_give_way.frames", "1" }, + + { "sign_no_entry", "RocksDC.pcx" }, + { "sign_no_entry.xpos", "6" }, + { "sign_no_entry.ypos", "13" }, + { "sign_no_entry.frames", "1" }, + + { "sign_emergency_exit", "RocksDC.pcx" }, + { "sign_emergency_exit.xpos", "7" }, + { "sign_emergency_exit.ypos", "13" }, + { "sign_emergency_exit.frames", "1" }, + + { "sign_yin_yang", "RocksDC.pcx" }, + { "sign_yin_yang.xpos", "4" }, + { "sign_yin_yang.ypos", "14" }, + { "sign_yin_yang.frames", "1" }, + { "sign_exclamation", "RocksDC.pcx" }, { "sign_exclamation.xpos", "5" }, { "sign_exclamation.ypos", "14" }, @@ -1947,12 +2148,83 @@ struct ConfigInfo image_config[] = { "sign_stop.ypos", "14" }, { "sign_stop.frames", "1" }, + { "sign_parking", "RocksDC.pcx" }, + { "sign_parking.xpos", "6" }, + { "sign_parking.ypos", "15" }, + { "sign_parking.frames", "1" }, + + { "sign_wheelchair", "RocksDC.pcx" }, + { "sign_wheelchair.xpos", "7" }, + { "sign_wheelchair.ypos", "15" }, + { "sign_wheelchair.frames", "1" }, + + { "sign_entry_forbidden", "RocksDC.pcx" }, + { "sign_entry_forbidden.xpos", "12" }, + { "sign_entry_forbidden.ypos", "15" }, + { "sign_entry_forbidden.frames", "1" }, + + { "sperms", "RocksDC2.pcx" }, + { "sperms.xpos", "11" }, + { "sperms.ypos", "3" }, + { "sperms.frames", "1" }, + + { "bullet", "RocksDC2.pcx" }, + { "bullet.xpos", "12" }, + { "bullet.ypos", "3" }, + { "bullet.frames", "1" }, + + { "heart", "RocksDC2.pcx" }, + { "heart.xpos", "13" }, + { "heart.ypos", "3" }, + { "heart.frames", "1" }, + + { "cross", "RocksDC2.pcx" }, + { "cross.xpos", "14" }, + { "cross.ypos", "3" }, + { "cross.frames", "1" }, + + { "frankie", "RocksDC2.pcx" }, + { "frankie.xpos", "15" }, + { "frankie.ypos", "3" }, + { "frankie.frames", "1" }, + + { "sign_sperms", "RocksDC2.pcx" }, + { "sign_sperms.xpos", "11" }, + { "sign_sperms.ypos", "2" }, + { "sign_sperms.frames", "1" }, + + { "sign_bullet", "RocksDC2.pcx" }, + { "sign_bullet.xpos", "12" }, + { "sign_bullet.ypos", "2" }, + { "sign_bullet.frames", "1" }, + + { "sign_heart", "RocksDC2.pcx" }, + { "sign_heart.xpos", "13" }, + { "sign_heart.ypos", "2" }, + { "sign_heart.frames", "1" }, + + { "sign_cross", "RocksDC2.pcx" }, + { "sign_cross.xpos", "14" }, + { "sign_cross.ypos", "2" }, + { "sign_cross.frames", "1" }, + + { "sign_frankie", "RocksDC2.pcx" }, + { "sign_frankie.xpos", "15" }, + { "sign_frankie.ypos", "2" }, + { "sign_frankie.frames", "1" }, + { "landmine", "RocksDC.pcx" }, { "landmine.xpos", "7" }, { "landmine.ypos", "14" }, { "landmine.frames", "1" }, { "landmine.crumbled_like", "sand" }, + { "dc_landmine", "RocksDC.pcx" }, + { "dc_landmine.xpos", "14" }, + { "dc_landmine.ypos", "5" }, + { "dc_landmine.frames", "1" }, + { "dc_landmine.crumbled_like", "sand" }, + { "steelwall_slippery", "RocksDC.pcx" }, { "steelwall_slippery.xpos", "5" }, { "steelwall_slippery.ypos", "15" }, @@ -2054,6 +2326,96 @@ struct ConfigInfo image_config[] = { "wall_crystal.ypos", "11" }, { "wall_crystal.frames", "1" }, + { "dc_steelwall_1_left", "RocksDC2.pcx" }, + { "dc_steelwall_1_left.xpos", "5" }, + { "dc_steelwall_1_left.ypos", "1" }, + { "dc_steelwall_1_left.frames", "1" }, + { "dc_steelwall_1_right", "RocksDC2.pcx" }, + { "dc_steelwall_1_right.xpos", "3" }, + { "dc_steelwall_1_right.ypos", "1" }, + { "dc_steelwall_1_right.frames", "1" }, + { "dc_steelwall_1_top", "RocksDC2.pcx" }, + { "dc_steelwall_1_top.xpos", "4" }, + { "dc_steelwall_1_top.ypos", "2" }, + { "dc_steelwall_1_top.frames", "1" }, + { "dc_steelwall_1_bottom", "RocksDC2.pcx" }, + { "dc_steelwall_1_bottom.xpos", "4" }, + { "dc_steelwall_1_bottom.ypos", "0" }, + { "dc_steelwall_1_bottom.frames", "1" }, + { "dc_steelwall_1_horizontal", "RocksDC2.pcx" }, + { "dc_steelwall_1_horizontal.xpos", "1" }, + { "dc_steelwall_1_horizontal.ypos", "0" }, + { "dc_steelwall_1_horizontal.frames", "1" }, + { "dc_steelwall_1_vertical", "RocksDC2.pcx" }, + { "dc_steelwall_1_vertical.xpos", "0" }, + { "dc_steelwall_1_vertical.ypos", "1" }, + { "dc_steelwall_1_vertical.frames", "1" }, + { "dc_steelwall_1_topleft", "RocksDC2.pcx" }, + { "dc_steelwall_1_topleft.xpos", "0" }, + { "dc_steelwall_1_topleft.ypos", "0" }, + { "dc_steelwall_1_topleft.frames", "1" }, + { "dc_steelwall_1_topright", "RocksDC2.pcx" }, + { "dc_steelwall_1_topright.xpos", "2" }, + { "dc_steelwall_1_topright.ypos", "0" }, + { "dc_steelwall_1_topright.frames", "1" }, + { "dc_steelwall_1_bottomleft", "RocksDC2.pcx" }, + { "dc_steelwall_1_bottomleft.xpos", "0" }, + { "dc_steelwall_1_bottomleft.ypos", "2" }, + { "dc_steelwall_1_bottomleft.frames", "1" }, + { "dc_steelwall_1_bottomright", "RocksDC2.pcx" }, + { "dc_steelwall_1_bottomright.xpos", "2" }, + { "dc_steelwall_1_bottomright.ypos", "2" }, + { "dc_steelwall_1_bottomright.frames", "1" }, + { "dc_steelwall_1_topleft_2", "RocksDC2.pcx" }, + { "dc_steelwall_1_topleft_2.xpos", "5" }, + { "dc_steelwall_1_topleft_2.ypos", "2" }, + { "dc_steelwall_1_topleft_2.frames", "1" }, + { "dc_steelwall_1_topright_2", "RocksDC2.pcx" }, + { "dc_steelwall_1_topright_2.xpos", "3" }, + { "dc_steelwall_1_topright_2.ypos", "2" }, + { "dc_steelwall_1_topright_2.frames", "1" }, + { "dc_steelwall_1_bottomleft_2", "RocksDC2.pcx" }, + { "dc_steelwall_1_bottomleft_2.xpos", "5" }, + { "dc_steelwall_1_bottomleft_2.ypos", "0" }, + { "dc_steelwall_1_bottomleft_2.frames", "1" }, + { "dc_steelwall_1_bottomright_2", "RocksDC2.pcx" }, + { "dc_steelwall_1_bottomright_2.xpos", "3" }, + { "dc_steelwall_1_bottomright_2.ypos", "0" }, + { "dc_steelwall_1_bottomright_2.frames", "1" }, + + { "dc_steelwall_2_left", "RocksDC2.pcx" }, + { "dc_steelwall_2_left.xpos", "6" }, + { "dc_steelwall_2_left.ypos", "1" }, + { "dc_steelwall_2_left.frames", "1" }, + { "dc_steelwall_2_right", "RocksDC2.pcx" }, + { "dc_steelwall_2_right.xpos", "9" }, + { "dc_steelwall_2_right.ypos", "1" }, + { "dc_steelwall_2_right.frames", "1" }, + { "dc_steelwall_2_top", "RocksDC2.pcx" }, + { "dc_steelwall_2_top.xpos", "7" }, + { "dc_steelwall_2_top.ypos", "0" }, + { "dc_steelwall_2_top.frames", "1" }, + { "dc_steelwall_2_bottom", "RocksDC2.pcx" }, + { "dc_steelwall_2_bottom.xpos", "7" }, + { "dc_steelwall_2_bottom.ypos", "3" }, + { "dc_steelwall_2_bottom.frames", "1" }, + { "dc_steelwall_2_horizontal", "RocksDC2.pcx" }, + { "dc_steelwall_2_horizontal.xpos", "8" }, + { "dc_steelwall_2_horizontal.ypos", "1" }, + { "dc_steelwall_2_horizontal.frames", "1" }, + { "dc_steelwall_2_vertical", "RocksDC2.pcx" }, + { "dc_steelwall_2_vertical.xpos", "7" }, + { "dc_steelwall_2_vertical.ypos", "2" }, + { "dc_steelwall_2_vertical.frames", "1" }, + { "dc_steelwall_2_middle", "RocksDC2.pcx" }, + { "dc_steelwall_2_middle.xpos", "7" }, + { "dc_steelwall_2_middle.ypos", "1" }, + { "dc_steelwall_2_middle.frames", "1" }, + { "dc_steelwall_2_single", "RocksDC2.pcx" }, + { "dc_steelwall_2_single.xpos", "6" }, + { "dc_steelwall_2_single.ypos", "0" }, + { "dc_steelwall_2_single.frames", "1" }, + /* images for DX Boulderdash style elements and actions */ { "tube_right_down", "RocksDC.pcx" }, @@ -2384,6 +2746,28 @@ struct ConfigInfo image_config[] = { "expandable_wall_any.EDITOR.xpos", "12" }, { "expandable_wall_any.EDITOR.ypos", "13" }, + { "expandable_steelwall_horizontal", "RocksDC2.pcx" }, + { "expandable_steelwall_horizontal.xpos", "6" }, + { "expandable_steelwall_horizontal.ypos", "2" }, + { "expandable_steelwall_horizontal.frames", "1" }, + { "expandable_steelwall_horizontal.EDITOR", "RocksDC2.pcx" }, + { "expandable_steelwall_horizontal.EDITOR.xpos","9" }, + { "expandable_steelwall_horizontal.EDITOR.ypos","2" }, + { "expandable_steelwall_vertical", "RocksDC2.pcx" }, + { "expandable_steelwall_vertical.xpos", "6" }, + { "expandable_steelwall_vertical.ypos", "2" }, + { "expandable_steelwall_vertical.frames", "1" }, + { "expandable_steelwall_vertical.EDITOR", "RocksDC2.pcx" }, + { "expandable_steelwall_vertical.EDITOR.xpos","10" }, + { "expandable_steelwall_vertical.EDITOR.ypos","2" }, + { "expandable_steelwall_any", "RocksDC2.pcx" }, + { "expandable_steelwall_any.xpos", "6" }, + { "expandable_steelwall_any.ypos", "2" }, + { "expandable_steelwall_any.frames", "1" }, + { "expandable_steelwall_any.EDITOR", "RocksDC2.pcx" }, + { "expandable_steelwall_any.EDITOR.xpos", "8" }, + { "expandable_steelwall_any.EDITOR.ypos", "2" }, + { "bd_expandable_wall", "RocksElements.pcx" }, { "bd_expandable_wall.xpos", "5" }, { "bd_expandable_wall.ypos", "9" }, @@ -2417,6 +2801,31 @@ struct ConfigInfo image_config[] = { "expandable_wall.growing.down.delay", "6" }, { "expandable_wall.growing.down.anim_mode", "linear" }, + { "expandable_steelwall.growing.left", "RocksDC2.pcx" }, + { "expandable_steelwall.growing.left.xpos", "8" }, + { "expandable_steelwall.growing.left.ypos", "4" }, + { "expandable_steelwall.growing.left.frames", "4" }, + { "expandable_steelwall.growing.left.delay", "4" }, + { "expandable_steelwall.growing.left.anim_mode","linear" }, + { "expandable_steelwall.growing.right", "RocksDC2.pcx" }, + { "expandable_steelwall.growing.right.xpos", "12" }, + { "expandable_steelwall.growing.right.ypos", "4" }, + { "expandable_steelwall.growing.right.frames","4" }, + { "expandable_steelwall.growing.right.delay", "4" }, + { "expandable_steelwall.growing.right.anim_mode","linear" }, + { "expandable_steelwall.growing.up", "RocksDC2.pcx" }, + { "expandable_steelwall.growing.up.xpos", "8" }, + { "expandable_steelwall.growing.up.ypos", "5" }, + { "expandable_steelwall.growing.up.frames", "4" }, + { "expandable_steelwall.growing.up.delay", "4" }, + { "expandable_steelwall.growing.up.anim_mode","linear" }, + { "expandable_steelwall.growing.down", "RocksDC2.pcx" }, + { "expandable_steelwall.growing.down.xpos", "12" }, + { "expandable_steelwall.growing.down.ypos", "5" }, + { "expandable_steelwall.growing.down.frames", "4" }, + { "expandable_steelwall.growing.down.delay", "4" }, + { "expandable_steelwall.growing.down.anim_mode","linear" }, + { "black_orb", "RocksElements.pcx" }, { "black_orb.xpos", "13" }, { "black_orb.ypos", "9" }, @@ -3910,6 +4319,16 @@ struct ConfigInfo image_config[] = { "emc_dripper.active.ypos", "8" }, { "emc_dripper.active.frames", "1" }, + /* (these are only defined as elements to support ".PANEL" definitions) */ + { "graphic_1", UNDEFINED_FILENAME }, + { "graphic_2", UNDEFINED_FILENAME }, + { "graphic_3", UNDEFINED_FILENAME }, + { "graphic_4", UNDEFINED_FILENAME }, + { "graphic_5", UNDEFINED_FILENAME }, + { "graphic_6", UNDEFINED_FILENAME }, + { "graphic_7", UNDEFINED_FILENAME }, + { "graphic_8", UNDEFINED_FILENAME }, + #include "conf_chr.c" /* include auto-generated data structure definitions */ #include "conf_cus.c" /* include auto-generated data structure definitions */ #include "conf_grp.c" /* include auto-generated data structure definitions */ @@ -4174,24 +4593,57 @@ struct ConfigInfo image_config[] = { "menu.button_down.active.ypos", "9" }, { "menu.button_down.active.frames", "1" }, - { "menu.button_enter_menu", "RocksDC.pcx" }, + { "menu.button_enter_menu", UNDEFINED_FILENAME }, { "menu.button_enter_menu.clone_from", "menu.button_right" }, - { "menu.button_enter_menu.active", "RocksDC.pcx" }, + { "menu.button_enter_menu.active", UNDEFINED_FILENAME }, { "menu.button_enter_menu.active.clone_from", "menu.button_right.active" }, - { "menu.button_leave_menu", "RocksDC.pcx" }, + { "menu.button_leave_menu", UNDEFINED_FILENAME }, { "menu.button_leave_menu.clone_from", "menu.button_left" }, - { "menu.button_leave_menu.active", "RocksDC.pcx" }, + { "menu.button_leave_menu.active", UNDEFINED_FILENAME }, { "menu.button_leave_menu.active.clone_from", "menu.button_left.active" }, - { "menu.button_next_level", "RocksDC.pcx" }, + { "menu.button_next_level", UNDEFINED_FILENAME }, { "menu.button_next_level.clone_from", "menu.button_right" }, - { "menu.button_next_level.active", "RocksDC.pcx" }, + { "menu.button_next_level.active", UNDEFINED_FILENAME }, { "menu.button_next_level.active.clone_from", "menu.button_right.active" }, - { "menu.button_prev_level", "RocksDC.pcx" }, + { "menu.button_prev_level", UNDEFINED_FILENAME }, { "menu.button_prev_level.clone_from", "menu.button_left" }, - { "menu.button_prev_level.active", "RocksDC.pcx" }, + { "menu.button_prev_level.active", UNDEFINED_FILENAME }, { "menu.button_prev_level.active.clone_from", "menu.button_left.active" }, + { "menu.button_name", UNDEFINED_FILENAME }, + { "menu.button_name.clone_from", "menu.button" }, + { "menu.button_name.active", UNDEFINED_FILENAME }, + { "menu.button_name.active.clone_from", "menu.button.active" }, + { "menu.button_levels", UNDEFINED_FILENAME }, + { "menu.button_levels.clone_from", "menu.button_right" }, + { "menu.button_levels.active", UNDEFINED_FILENAME }, + { "menu.button_levels.active.clone_from", "menu.button_right.active" }, + { "menu.button_scores", UNDEFINED_FILENAME }, + { "menu.button_scores.clone_from", "menu.button" }, + { "menu.button_scores.active", UNDEFINED_FILENAME }, + { "menu.button_scores.active.clone_from", "menu.button.active" }, + { "menu.button_editor", UNDEFINED_FILENAME }, + { "menu.button_editor.clone_from", "menu.button" }, + { "menu.button_editor.active", UNDEFINED_FILENAME }, + { "menu.button_editor.active.clone_from", "menu.button.active" }, + { "menu.button_info", UNDEFINED_FILENAME }, + { "menu.button_info.clone_from", "menu.button_right" }, + { "menu.button_info.active", UNDEFINED_FILENAME }, + { "menu.button_info.active.clone_from", "menu.button_right.active" }, + { "menu.button_game", UNDEFINED_FILENAME }, + { "menu.button_game.clone_from", "menu.button" }, + { "menu.button_game.active", UNDEFINED_FILENAME }, + { "menu.button_game.active.clone_from", "menu.button.active" }, + { "menu.button_setup", UNDEFINED_FILENAME }, + { "menu.button_setup.clone_from", "menu.button_right" }, + { "menu.button_setup.active", UNDEFINED_FILENAME }, + { "menu.button_setup.active.clone_from", "menu.button_right.active" }, + { "menu.button_quit", UNDEFINED_FILENAME }, + { "menu.button_quit.clone_from", "menu.button" }, + { "menu.button_quit.active", UNDEFINED_FILENAME }, + { "menu.button_quit.active.clone_from", "menu.button.active" }, + { "menu.scrollbar", "RocksDC.pcx" }, { "menu.scrollbar.xpos", "8" }, { "menu.scrollbar.ypos", "10" }, @@ -4232,6 +4684,8 @@ struct ConfigInfo image_config[] = { "font.title_2.y", "0" }, { "font.title_2.width", "14" }, { "font.title_2.height", "14" }, + { "font.title_2.SETUP", UNDEFINED_FILENAME }, + { "font.title_2.SETUP.clone_from", "font.text_4" }, { "font.menu_1", "RocksFontBig.pcx" }, { "font.menu_1.x", "0" }, @@ -4259,11 +4713,15 @@ struct ConfigInfo image_config[] = { "font.text_1.y", "140" }, { "font.text_1.width", "14" }, { "font.text_1.height", "14" }, + { "font.text_1.MAIN", UNDEFINED_FILENAME }, + { "font.text_1.MAIN.clone_from", "font.text_1.PREVIEW" }, { "font.text_1.LEVELS", "RocksFontMedium.pcx" }, { "font.text_1.LEVELS.x", "0" }, { "font.text_1.LEVELS.y", "0" }, { "font.text_1.LEVELS.width", "16" }, { "font.text_1.LEVELS.height", "32" }, + { "font.text_1.SETUP", UNDEFINED_FILENAME }, + { "font.text_1.SETUP.clone_from", "font.text_1.LEVELS" }, { "font.text_1.PREVIEW", "RocksFontEM.pcx" }, { "font.text_1.PREVIEW.x", "0" }, { "font.text_1.PREVIEW.y", "160" }, @@ -4279,16 +4737,24 @@ struct ConfigInfo image_config[] = { "font.text_1.active.SCORES.y", "0" }, { "font.text_1.active.SCORES.width", "16" }, { "font.text_1.active.SCORES.height", "32" }, + { "font.text_1.PANEL", UNDEFINED_FILENAME }, + { "font.text_1.PANEL.clone_from", "font.level_number" }, + { "font.text_1.DOOR", UNDEFINED_FILENAME }, + { "font.text_1.DOOR.clone_from", "font.level_number" }, { "font.text_2", "RocksFontSmall.pcx" }, { "font.text_2.x", "0" }, { "font.text_2.y", "210" }, { "font.text_2.width", "14" }, { "font.text_2.height", "14" }, + { "font.text_2.MAIN", UNDEFINED_FILENAME }, + { "font.text_2.MAIN.clone_from", "font.text_2.PREVIEW" }, { "font.text_2.LEVELS", "RocksFontMedium.pcx" }, { "font.text_2.LEVELS.x", "0" }, { "font.text_2.LEVELS.y", "160" }, { "font.text_2.LEVELS.width", "16" }, { "font.text_2.LEVELS.height", "32" }, + { "font.text_2.SETUP", UNDEFINED_FILENAME }, + { "font.text_2.SETUP.clone_from", "font.text_2.LEVELS" }, { "font.text_2.PREVIEW", "RocksFontEM.pcx" }, { "font.text_2.PREVIEW.x", "0" }, { "font.text_2.PREVIEW.y", "160" }, @@ -4314,6 +4780,8 @@ struct ConfigInfo image_config[] = { "font.text_3.LEVELS.y", "320" }, { "font.text_3.LEVELS.width", "16" }, { "font.text_3.LEVELS.height", "32" }, + { "font.text_3.SETUP", UNDEFINED_FILENAME }, + { "font.text_3.SETUP.clone_from", "font.text_3.LEVELS" }, { "font.text_3.PREVIEW", "RocksFontEM.pcx" }, { "font.text_3.PREVIEW.x", "0" }, { "font.text_3.PREVIEW.y", "160" }, @@ -4334,11 +4802,15 @@ struct ConfigInfo image_config[] = { "font.text_4.y", "70" }, { "font.text_4.width", "14" }, { "font.text_4.height", "14" }, + { "font.text_4.MAIN", UNDEFINED_FILENAME }, + { "font.text_4.MAIN.clone_from", "font.text_3.PREVIEW" }, { "font.text_4.LEVELS", "RocksFontMedium.pcx" }, { "font.text_4.LEVELS.x", "0" }, { "font.text_4.LEVELS.y", "480" }, { "font.text_4.LEVELS.width", "16" }, { "font.text_4.LEVELS.height", "32" }, + { "font.text_4.SETUP", UNDEFINED_FILENAME }, + { "font.text_4.SETUP.clone_from", "font.text_4.LEVELS" }, { "font.text_4.SCORES", "RocksFontMedium.pcx" }, { "font.text_4.SCORES.x", "0" }, { "font.text_4.SCORES.y", "480" }, @@ -4439,6 +4911,8 @@ struct ConfigInfo image_config[] = { "font.level_number.y", "350" }, { "font.level_number.width", "10" }, { "font.level_number.height", "14" }, + { "font.level_number.active", UNDEFINED_FILENAME }, + { "font.level_number.active.clone_from", "font.level_number" }, { "font.tape_recorder", "RocksFontSmall.pcx" }, { "font.tape_recorder.x", "0" }, @@ -4451,9 +4925,24 @@ struct ConfigInfo image_config[] = { "font.game_info.ypos", "0" }, { "font.game_info.delay", "10" }, + { "font.info.elements", UNDEFINED_FILENAME }, + { "font.info.elements.clone_from", "font.level_number" }, + + { "font.info.levelset", UNDEFINED_FILENAME }, + { "font.info.levelset.clone_from", "font.level_number" }, + { "global.border", "RocksScreen.pcx" }, { "global.door", "RocksDoor.pcx" }, + { "global.busy", "RocksBusy.pcx" }, + { "global.busy.x", "0" }, + { "global.busy.y", "0" }, + { "global.busy.width", "32" }, + { "global.busy.height", "32" }, + { "global.busy.frames", "28" }, + { "global.busy.frames_per_line", "7" }, + { "global.busy.delay", "2" }, + { "editor.element_border", "RocksElements.pcx" }, { "editor.element_border.xpos", "0" }, { "editor.element_border.ypos", "0" }, @@ -4471,6 +4960,44 @@ struct ConfigInfo image_config[] = { "editor.cascade_list.active.y", "80" }, { "editor.cascade_list.active.frames", "1" }, + { "background", UNDEFINED_FILENAME }, + { "background.TITLE_INITIAL", UNDEFINED_FILENAME }, + { "background.TITLE", UNDEFINED_FILENAME }, + { "background.MAIN", UNDEFINED_FILENAME }, + { "background.LEVELS", UNDEFINED_FILENAME }, + { "background.SCORES", UNDEFINED_FILENAME }, + { "background.EDITOR", UNDEFINED_FILENAME }, + { "background.INFO", UNDEFINED_FILENAME }, + { "background.INFO[ELEMENTS]", UNDEFINED_FILENAME }, + { "background.INFO[MUSIC]", UNDEFINED_FILENAME }, + { "background.INFO[CREDITS]", UNDEFINED_FILENAME }, + { "background.INFO[PROGRAM]", UNDEFINED_FILENAME }, + { "background.INFO[VERSION]", UNDEFINED_FILENAME }, + { "background.INFO[LEVELSET]", UNDEFINED_FILENAME }, + { "background.SETUP", UNDEFINED_FILENAME }, + { "background.DOOR", UNDEFINED_FILENAME }, + + { "background.titlescreen_initial_1", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_2", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_3", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_4", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_5", UNDEFINED_FILENAME }, + { "background.titlescreen_1", UNDEFINED_FILENAME }, + { "background.titlescreen_2", UNDEFINED_FILENAME }, + { "background.titlescreen_3", UNDEFINED_FILENAME }, + { "background.titlescreen_4", UNDEFINED_FILENAME }, + { "background.titlescreen_5", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_1", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_2", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_3", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_4", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_5", UNDEFINED_FILENAME }, + { "background.titlemessage_1", UNDEFINED_FILENAME }, + { "background.titlemessage_2", UNDEFINED_FILENAME }, + { "background.titlemessage_3", UNDEFINED_FILENAME }, + { "background.titlemessage_4", UNDEFINED_FILENAME }, + { "background.titlemessage_5", UNDEFINED_FILENAME }, + { "background.envelope_1", "RocksScreen.pcx" }, { "background.envelope_1.x", "0" }, { "background.envelope_1.y", "0" }, @@ -4500,22 +5027,6 @@ struct ConfigInfo image_config[] = { "background.envelope_4.anim_mode", "default" }, { "background.envelope_4.draw_masked", "false" }, - { "background", UNDEFINED_FILENAME }, - { "background.TITLE", UNDEFINED_FILENAME }, - { "background.MESSAGE", UNDEFINED_FILENAME }, - { "background.MAIN", UNDEFINED_FILENAME }, - { "background.LEVELS", UNDEFINED_FILENAME }, - { "background.SCORES", UNDEFINED_FILENAME }, - { "background.EDITOR", UNDEFINED_FILENAME }, - { "background.INFO", UNDEFINED_FILENAME }, - { "background.INFO[ELEMENTS]", UNDEFINED_FILENAME }, - { "background.INFO[MUSIC]", UNDEFINED_FILENAME }, - { "background.INFO[CREDITS]", UNDEFINED_FILENAME }, - { "background.INFO[PROGRAM]", UNDEFINED_FILENAME }, - { "background.INFO[LEVELSET]", UNDEFINED_FILENAME }, - { "background.SETUP", UNDEFINED_FILENAME }, - { "background.DOOR", UNDEFINED_FILENAME }, - { "titlescreen_initial_1", UNDEFINED_FILENAME }, { "titlescreen_initial_2", UNDEFINED_FILENAME }, { "titlescreen_initial_3", UNDEFINED_FILENAME }, @@ -4530,6 +5041,237 @@ struct ConfigInfo image_config[] = /* the following directives are not associated with an image, but probably make sense to be defined in "graphicsinfo.conf", too */ + /* keyword to start parser: "CONFIG_VARS_START" <-- do not change! */ + + { "[title_initial].fade_mode", "fade" }, + { "[title_initial].fade_delay", "500" }, + { "[title_initial].post_delay", "250" }, + { "[title_initial].auto_delay", "-1" }, + { "[title].fade_mode", "fade" }, + { "[title].fade_delay", "500" }, + { "[title].post_delay", "250" }, + { "[title].auto_delay", "-1" }, + + { "[titlemessage_initial].x", "336" }, + { "[titlemessage_initial].y", "280" }, + { "[titlemessage_initial].width", "640" }, + { "[titlemessage_initial].height", "512" }, + { "[titlemessage_initial].chars", "-1" }, + { "[titlemessage_initial].lines", "-1" }, + { "[titlemessage_initial].align", "center" }, + { "[titlemessage_initial].valign", "middle" }, + { "[titlemessage_initial].font", "font.text_1" }, + { "[titlemessage_initial].autowrap", "false" }, + { "[titlemessage_initial].centered", "false" }, + { "[titlemessage_initial].parse_comments", "false" }, + { "[titlemessage_initial].sort_priority", "0" }, + { "[titlemessage_initial].fade_mode", ARG_DEFAULT }, + { "[titlemessage_initial].fade_delay", ARG_DEFAULT }, + { "[titlemessage_initial].post_delay", ARG_DEFAULT }, + { "[titlemessage_initial].auto_delay", ARG_DEFAULT }, + { "[titlemessage].x", "336" }, + { "[titlemessage].y", "280" }, + { "[titlemessage].width", "640" }, + { "[titlemessage].height", "512" }, + { "[titlemessage].chars", "-1" }, + { "[titlemessage].lines", "-1" }, + { "[titlemessage].align", "center" }, + { "[titlemessage].valign", "middle" }, + { "[titlemessage].font", "font.text_1" }, + { "[titlemessage].autowrap", "false" }, + { "[titlemessage].centered", "false" }, + { "[titlemessage].parse_comments", "false" }, + { "[titlemessage].sort_priority", "0" }, + { "[titlemessage].fade_mode", ARG_DEFAULT }, + { "[titlemessage].fade_delay", ARG_DEFAULT }, + { "[titlemessage].post_delay", ARG_DEFAULT }, + { "[titlemessage].auto_delay", ARG_DEFAULT }, + + { "titlemessage_initial_1.x", ARG_DEFAULT }, + { "titlemessage_initial_1.y", ARG_DEFAULT }, + { "titlemessage_initial_1.width", ARG_DEFAULT }, + { "titlemessage_initial_1.height", ARG_DEFAULT }, + { "titlemessage_initial_1.chars", ARG_DEFAULT }, + { "titlemessage_initial_1.lines", ARG_DEFAULT }, + { "titlemessage_initial_1.align", ARG_DEFAULT }, + { "titlemessage_initial_1.valign", ARG_DEFAULT }, + { "titlemessage_initial_1.font", ARG_DEFAULT }, + { "titlemessage_initial_1.autowrap", ARG_DEFAULT }, + { "titlemessage_initial_1.centered", ARG_DEFAULT }, + { "titlemessage_initial_1.parse_comments", ARG_DEFAULT }, + { "titlemessage_initial_1.sort_priority", ARG_DEFAULT }, + { "titlemessage_initial_1.fade_mode", ARG_DEFAULT }, + { "titlemessage_initial_1.fade_delay", ARG_DEFAULT }, + { "titlemessage_initial_1.post_delay", ARG_DEFAULT }, + { "titlemessage_initial_1.auto_delay", ARG_DEFAULT }, + { "titlemessage_initial_2.x", ARG_DEFAULT }, + { "titlemessage_initial_2.y", ARG_DEFAULT }, + { "titlemessage_initial_2.width", ARG_DEFAULT }, + { "titlemessage_initial_2.height", ARG_DEFAULT }, + { "titlemessage_initial_2.chars", ARG_DEFAULT }, + { "titlemessage_initial_2.lines", ARG_DEFAULT }, + { "titlemessage_initial_2.align", ARG_DEFAULT }, + { "titlemessage_initial_2.valign", ARG_DEFAULT }, + { "titlemessage_initial_2.font", ARG_DEFAULT }, + { "titlemessage_initial_2.autowrap", ARG_DEFAULT }, + { "titlemessage_initial_2.centered", ARG_DEFAULT }, + { "titlemessage_initial_2.parse_comments", ARG_DEFAULT }, + { "titlemessage_initial_2.sort_priority", ARG_DEFAULT }, + { "titlemessage_initial_2.fade_mode", ARG_DEFAULT }, + { "titlemessage_initial_2.fade_delay", ARG_DEFAULT }, + { "titlemessage_initial_2.post_delay", ARG_DEFAULT }, + { "titlemessage_initial_2.auto_delay", ARG_DEFAULT }, + { "titlemessage_initial_3.x", ARG_DEFAULT }, + { "titlemessage_initial_3.y", ARG_DEFAULT }, + { "titlemessage_initial_3.width", ARG_DEFAULT }, + { "titlemessage_initial_3.height", ARG_DEFAULT }, + { "titlemessage_initial_3.chars", ARG_DEFAULT }, + { "titlemessage_initial_3.lines", ARG_DEFAULT }, + { "titlemessage_initial_3.align", ARG_DEFAULT }, + { "titlemessage_initial_3.valign", ARG_DEFAULT }, + { "titlemessage_initial_3.font", ARG_DEFAULT }, + { "titlemessage_initial_3.autowrap", ARG_DEFAULT }, + { "titlemessage_initial_3.centered", ARG_DEFAULT }, + { "titlemessage_initial_3.parse_comments", ARG_DEFAULT }, + { "titlemessage_initial_3.sort_priority", ARG_DEFAULT }, + { "titlemessage_initial_3.fade_mode", ARG_DEFAULT }, + { "titlemessage_initial_3.fade_delay", ARG_DEFAULT }, + { "titlemessage_initial_3.post_delay", ARG_DEFAULT }, + { "titlemessage_initial_3.auto_delay", ARG_DEFAULT }, + { "titlemessage_initial_4.x", ARG_DEFAULT }, + { "titlemessage_initial_4.y", ARG_DEFAULT }, + { "titlemessage_initial_4.width", ARG_DEFAULT }, + { "titlemessage_initial_4.height", ARG_DEFAULT }, + { "titlemessage_initial_4.chars", ARG_DEFAULT }, + { "titlemessage_initial_4.lines", ARG_DEFAULT }, + { "titlemessage_initial_4.align", ARG_DEFAULT }, + { "titlemessage_initial_4.valign", ARG_DEFAULT }, + { "titlemessage_initial_4.font", ARG_DEFAULT }, + { "titlemessage_initial_4.autowrap", ARG_DEFAULT }, + { "titlemessage_initial_4.centered", ARG_DEFAULT }, + { "titlemessage_initial_4.parse_comments", ARG_DEFAULT }, + { "titlemessage_initial_4.sort_priority", ARG_DEFAULT }, + { "titlemessage_initial_4.fade_mode", ARG_DEFAULT }, + { "titlemessage_initial_4.fade_delay", ARG_DEFAULT }, + { "titlemessage_initial_4.post_delay", ARG_DEFAULT }, + { "titlemessage_initial_4.auto_delay", ARG_DEFAULT }, + { "titlemessage_initial_5.x", ARG_DEFAULT }, + { "titlemessage_initial_5.y", ARG_DEFAULT }, + { "titlemessage_initial_5.width", ARG_DEFAULT }, + { "titlemessage_initial_5.height", ARG_DEFAULT }, + { "titlemessage_initial_5.chars", ARG_DEFAULT }, + { "titlemessage_initial_5.lines", ARG_DEFAULT }, + { "titlemessage_initial_5.align", ARG_DEFAULT }, + { "titlemessage_initial_5.valign", ARG_DEFAULT }, + { "titlemessage_initial_5.font", ARG_DEFAULT }, + { "titlemessage_initial_5.autowrap", ARG_DEFAULT }, + { "titlemessage_initial_5.centered", ARG_DEFAULT }, + { "titlemessage_initial_5.parse_comments", ARG_DEFAULT }, + { "titlemessage_initial_5.sort_priority", ARG_DEFAULT }, + { "titlemessage_initial_5.fade_mode", ARG_DEFAULT }, + { "titlemessage_initial_5.fade_delay", ARG_DEFAULT }, + { "titlemessage_initial_5.post_delay", ARG_DEFAULT }, + { "titlemessage_initial_5.auto_delay", ARG_DEFAULT }, + { "titlemessage_1.x", ARG_DEFAULT }, + { "titlemessage_1.y", ARG_DEFAULT }, + { "titlemessage_1.width", ARG_DEFAULT }, + { "titlemessage_1.height", ARG_DEFAULT }, + { "titlemessage_1.chars", ARG_DEFAULT }, + { "titlemessage_1.lines", ARG_DEFAULT }, + { "titlemessage_1.align", ARG_DEFAULT }, + { "titlemessage_1.valign", ARG_DEFAULT }, + { "titlemessage_1.font", ARG_DEFAULT }, + { "titlemessage_1.autowrap", ARG_DEFAULT }, + { "titlemessage_1.centered", ARG_DEFAULT }, + { "titlemessage_1.parse_comments", ARG_DEFAULT }, + { "titlemessage_1.sort_priority", ARG_DEFAULT }, + { "titlemessage_1.fade_mode", ARG_DEFAULT }, + { "titlemessage_1.fade_delay", ARG_DEFAULT }, + { "titlemessage_1.post_delay", ARG_DEFAULT }, + { "titlemessage_1.auto_delay", ARG_DEFAULT }, + { "titlemessage_2.x", ARG_DEFAULT }, + { "titlemessage_2.y", ARG_DEFAULT }, + { "titlemessage_2.width", ARG_DEFAULT }, + { "titlemessage_2.height", ARG_DEFAULT }, + { "titlemessage_2.chars", ARG_DEFAULT }, + { "titlemessage_2.lines", ARG_DEFAULT }, + { "titlemessage_2.align", ARG_DEFAULT }, + { "titlemessage_2.valign", ARG_DEFAULT }, + { "titlemessage_2.font", ARG_DEFAULT }, + { "titlemessage_2.autowrap", ARG_DEFAULT }, + { "titlemessage_2.centered", ARG_DEFAULT }, + { "titlemessage_2.parse_comments", ARG_DEFAULT }, + { "titlemessage_2.sort_priority", ARG_DEFAULT }, + { "titlemessage_2.fade_mode", ARG_DEFAULT }, + { "titlemessage_2.fade_delay", ARG_DEFAULT }, + { "titlemessage_2.post_delay", ARG_DEFAULT }, + { "titlemessage_2.auto_delay", ARG_DEFAULT }, + { "titlemessage_3.x", ARG_DEFAULT }, + { "titlemessage_3.y", ARG_DEFAULT }, + { "titlemessage_3.width", ARG_DEFAULT }, + { "titlemessage_3.height", ARG_DEFAULT }, + { "titlemessage_3.chars", ARG_DEFAULT }, + { "titlemessage_3.lines", ARG_DEFAULT }, + { "titlemessage_3.align", ARG_DEFAULT }, + { "titlemessage_3.valign", ARG_DEFAULT }, + { "titlemessage_3.font", ARG_DEFAULT }, + { "titlemessage_3.autowrap", ARG_DEFAULT }, + { "titlemessage_3.centered", ARG_DEFAULT }, + { "titlemessage_3.parse_comments", ARG_DEFAULT }, + { "titlemessage_3.sort_priority", ARG_DEFAULT }, + { "titlemessage_3.fade_mode", ARG_DEFAULT }, + { "titlemessage_3.fade_delay", ARG_DEFAULT }, + { "titlemessage_3.post_delay", ARG_DEFAULT }, + { "titlemessage_3.auto_delay", ARG_DEFAULT }, + { "titlemessage_4.x", ARG_DEFAULT }, + { "titlemessage_4.y", ARG_DEFAULT }, + { "titlemessage_4.width", ARG_DEFAULT }, + { "titlemessage_4.height", ARG_DEFAULT }, + { "titlemessage_4.chars", ARG_DEFAULT }, + { "titlemessage_4.lines", ARG_DEFAULT }, + { "titlemessage_4.align", ARG_DEFAULT }, + { "titlemessage_4.valign", ARG_DEFAULT }, + { "titlemessage_4.font", ARG_DEFAULT }, + { "titlemessage_4.autowrap", ARG_DEFAULT }, + { "titlemessage_4.centered", ARG_DEFAULT }, + { "titlemessage_4.parse_comments", ARG_DEFAULT }, + { "titlemessage_4.sort_priority", ARG_DEFAULT }, + { "titlemessage_4.fade_mode", ARG_DEFAULT }, + { "titlemessage_4.fade_delay", ARG_DEFAULT }, + { "titlemessage_4.post_delay", ARG_DEFAULT }, + { "titlemessage_4.auto_delay", ARG_DEFAULT }, + { "titlemessage_5.x", ARG_DEFAULT }, + { "titlemessage_5.y", ARG_DEFAULT }, + { "titlemessage_5.width", ARG_DEFAULT }, + { "titlemessage_5.height", ARG_DEFAULT }, + { "titlemessage_5.chars", ARG_DEFAULT }, + { "titlemessage_5.lines", ARG_DEFAULT }, + { "titlemessage_5.align", ARG_DEFAULT }, + { "titlemessage_5.valign", ARG_DEFAULT }, + { "titlemessage_5.font", ARG_DEFAULT }, + { "titlemessage_5.autowrap", ARG_DEFAULT }, + { "titlemessage_5.centered", ARG_DEFAULT }, + { "titlemessage_5.parse_comments", ARG_DEFAULT }, + { "titlemessage_5.sort_priority", ARG_DEFAULT }, + { "titlemessage_5.fade_mode", ARG_DEFAULT }, + { "titlemessage_5.fade_delay", ARG_DEFAULT }, + { "titlemessage_5.post_delay", ARG_DEFAULT }, + { "titlemessage_5.auto_delay", ARG_DEFAULT }, + + { "readme.x", "272" }, + { "readme.y", "150" }, + { "readme.width", "480" }, + { "readme.height", "364" }, + { "readme.chars", "-1" }, + { "readme.lines", "-1" }, + { "readme.align", "center" }, + { "readme.valign", "top" }, + { "readme.font", "font.info.levelset" }, + { "readme.autowrap", "true" }, + { "readme.centered", "false" }, + { "readme.parse_comments", "true" }, + { "readme.sort_priority", "0" }, + { "global.num_toons", "20" }, { "border.draw_masked.TITLE", "false" }, @@ -4542,13 +5284,52 @@ struct ConfigInfo image_config[] = { "border.draw_masked.PLAYING", "false" }, { "border.draw_masked.DOOR", "false" }, - { "title.fade_delay", "500" }, - { "title.post_delay", "250" }, - { "title.auto_delay", "-1" }, - - { "menu.fade_delay", "250" }, - { "menu.post_delay", "125" }, - { "menu.auto_delay", "-1" }, + { "border.draw_masked_when_fading", "true" }, + + { "init.busy.x", "336" }, + { "init.busy.y", "280" }, + { "init.busy.align", "center" }, + { "init.busy.valign", "middle" }, + + { "menu.enter_menu.fade_mode", "none" }, + { "menu.enter_menu.fade_delay", "250" }, + { "menu.enter_menu.post_delay", "125" }, + { "menu.leave_menu.fade_mode", "none" }, + { "menu.leave_menu.fade_delay", "250" }, + { "menu.leave_menu.post_delay", "125" }, + { "menu.enter_screen.fade_mode", "fade" }, + { "menu.enter_screen.fade_delay", "250" }, + { "menu.enter_screen.post_delay", "125" }, + { "menu.next_screen.fade_mode", "crossfade" }, + { "menu.next_screen.fade_delay", "250" }, + { "menu.next_screen.post_delay", "125" }, + { "menu.leave_screen.fade_mode", "fade" }, + { "menu.leave_screen.fade_delay", "250" }, + { "menu.leave_screen.post_delay", "125" }, + { "menu.enter_screen.SCORES.fade_mode", ARG_DEFAULT }, + { "menu.enter_screen.SCORES.fade_delay", ARG_DEFAULT }, + { "menu.enter_screen.SCORES.post_delay", ARG_DEFAULT }, + { "menu.enter_screen.EDITOR.fade_mode", ARG_DEFAULT }, + { "menu.enter_screen.EDITOR.fade_delay", ARG_DEFAULT }, + { "menu.enter_screen.EDITOR.post_delay", ARG_DEFAULT }, + { "menu.enter_screen.INFO.fade_mode", ARG_DEFAULT }, + { "menu.enter_screen.INFO.fade_delay", ARG_DEFAULT }, + { "menu.enter_screen.INFO.post_delay", ARG_DEFAULT }, + { "menu.enter_screen.PLAYING.fade_mode", ARG_DEFAULT }, + { "menu.enter_screen.PLAYING.fade_delay", ARG_DEFAULT }, + { "menu.enter_screen.PLAYING.post_delay", ARG_DEFAULT }, + { "menu.leave_screen.SCORES.fade_mode", ARG_DEFAULT }, + { "menu.leave_screen.SCORES.fade_delay", ARG_DEFAULT }, + { "menu.leave_screen.SCORES.post_delay", ARG_DEFAULT }, + { "menu.leave_screen.EDITOR.fade_mode", ARG_DEFAULT }, + { "menu.leave_screen.EDITOR.fade_delay", ARG_DEFAULT }, + { "menu.leave_screen.EDITOR.post_delay", ARG_DEFAULT }, + { "menu.leave_screen.INFO.fade_mode", ARG_DEFAULT }, + { "menu.leave_screen.INFO.fade_delay", ARG_DEFAULT }, + { "menu.leave_screen.INFO.post_delay", ARG_DEFAULT }, + { "menu.leave_screen.PLAYING.fade_mode", ARG_DEFAULT }, + { "menu.leave_screen.PLAYING.fade_delay", ARG_DEFAULT }, + { "menu.leave_screen.PLAYING.post_delay", ARG_DEFAULT }, { "menu.draw_xoffset", "0" }, { "menu.draw_yoffset", "0" }, @@ -4570,10 +5351,32 @@ struct ConfigInfo image_config[] = { "menu.draw_yoffset.INFO[CREDITS]", "0" }, { "menu.draw_xoffset.INFO[PROGRAM]", "0" }, { "menu.draw_yoffset.INFO[PROGRAM]", "0" }, + { "menu.draw_xoffset.INFO[VERSION]", "0" }, + { "menu.draw_yoffset.INFO[VERSION]", "0" }, { "menu.draw_xoffset.INFO[LEVELSET]", "0" }, { "menu.draw_yoffset.INFO[LEVELSET]", "0" }, { "menu.draw_xoffset.SETUP", "0" }, { "menu.draw_yoffset.SETUP", "0" }, + { "menu.draw_xoffset.SETUP[GAME]", "0" }, + { "menu.draw_yoffset.SETUP[GAME]", "0" }, + { "menu.draw_xoffset.SETUP[EDITOR]", "0" }, + { "menu.draw_yoffset.SETUP[EDITOR]", "0" }, + { "menu.draw_xoffset.SETUP[GRAPHICS]", "0" }, + { "menu.draw_yoffset.SETUP[GRAPHICS]", "0" }, + { "menu.draw_xoffset.SETUP[SOUND]", "0" }, + { "menu.draw_yoffset.SETUP[SOUND]", "0" }, + { "menu.draw_xoffset.SETUP[ARTWORK]", "0" }, + { "menu.draw_yoffset.SETUP[ARTWORK]", "0" }, + { "menu.draw_xoffset.SETUP[INPUT]", "0" }, + { "menu.draw_yoffset.SETUP[INPUT]", "0" }, + { "menu.draw_xoffset.SETUP[SHORTCUTS_1]", "0" }, + { "menu.draw_yoffset.SETUP[SHORTCUTS_1]", "0" }, + { "menu.draw_xoffset.SETUP[SHORTCUTS_2]", "0" }, + { "menu.draw_yoffset.SETUP[SHORTCUTS_2]", "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[CHOOSE_OTHER]", "0" }, { "menu.scrollbar_xoffset", "0" }, @@ -4581,6 +5384,7 @@ struct ConfigInfo image_config[] = { "menu.list_size.LEVELS", "-1" }, { "menu.list_size.SCORES", "-1" }, { "menu.list_size.INFO", "-1" }, + { "menu.list_size.SETUP", "-1" }, { "main.button.name.x", "0" }, { "main.button.name.y", "64" }, @@ -4609,74 +5413,151 @@ struct ConfigInfo image_config[] = { "main.text.name.width", "-1" }, { "main.text.name.height", "-1" }, { "main.text.name.align", "left" }, + { "main.text.name.valign", "top" }, + { "main.text.name.font", "font.menu_1" }, { "main.text.levels.x", "-1" }, { "main.text.levels.y", "-1" }, { "main.text.levels.width", "-1" }, { "main.text.levels.height", "-1" }, { "main.text.levels.align", "left" }, + { "main.text.levels.valign", "top" }, + { "main.text.levels.font", "font.menu_1" }, { "main.text.scores.x", "-1" }, { "main.text.scores.y", "-1" }, { "main.text.scores.width", "-1" }, { "main.text.scores.height", "-1" }, { "main.text.scores.align", "left" }, + { "main.text.scores.valign", "top" }, + { "main.text.scores.font", "font.menu_1" }, { "main.text.editor.x", "-1" }, { "main.text.editor.y", "-1" }, { "main.text.editor.width", "-1" }, { "main.text.editor.height", "-1" }, { "main.text.editor.align", "left" }, + { "main.text.editor.valign", "top" }, + { "main.text.editor.font", "font.menu_1" }, { "main.text.info.x", "-1" }, { "main.text.info.y", "-1" }, { "main.text.info.width", "-1" }, { "main.text.info.height", "-1" }, { "main.text.info.align", "left" }, + { "main.text.info.valign", "top" }, + { "main.text.info.font", "font.menu_1" }, { "main.text.game.x", "-1" }, { "main.text.game.y", "-1" }, { "main.text.game.width", "-1" }, { "main.text.game.height", "-1" }, { "main.text.game.align", "left" }, + { "main.text.game.valign", "top" }, + { "main.text.game.font", "font.menu_1" }, { "main.text.setup.x", "-1" }, { "main.text.setup.y", "-1" }, { "main.text.setup.width", "-1" }, { "main.text.setup.height", "-1" }, { "main.text.setup.align", "left" }, + { "main.text.setup.valign", "top" }, + { "main.text.setup.font", "font.menu_1" }, { "main.text.quit.x", "-1" }, { "main.text.quit.y", "-1" }, { "main.text.quit.width", "-1" }, { "main.text.quit.height", "-1" }, { "main.text.quit.align", "left" }, + { "main.text.quit.valign", "top" }, + { "main.text.quit.font", "font.menu_1" }, - { "main.text.current_level.x", "352" }, - { "main.text.current_level.y", "96" }, - { "main.text.current_level.align", "left" }, { "main.text.first_level.x", "488" }, { "main.text.first_level.y", "98" }, { "main.text.first_level.align", "left" }, + { "main.text.first_level.valign", "top" }, + { "main.text.first_level.digits", "3" }, + { "main.text.first_level.font", "font.text_3" }, { "main.text.last_level.x", "488" }, { "main.text.last_level.y", "112" }, { "main.text.last_level.align", "left" }, + { "main.text.last_level.valign", "top" }, + { "main.text.last_level.digits", "3" }, + { "main.text.last_level.font", "font.text_3" }, + { "main.text.level_number.x", "352" }, + { "main.text.level_number.y", "96" }, + { "main.text.level_number.align", "left" }, + { "main.text.level_number.valign", "top" }, + { "main.text.level_number.digits", "3" }, + { "main.text.level_number.font", "font.value_1" }, { "main.text.level_info_1.x", "272" }, { "main.text.level_info_1.y", "352" }, { "main.text.level_info_1.align", "center" }, + { "main.text.level_info_1.valign", "top" }, + { "main.text.level_info_1.chars", "-1" }, + { "main.text.level_info_1.font", "font.text_1" }, { "main.text.level_info_2.x", "272" }, { "main.text.level_info_2.y", "523" }, { "main.text.level_info_2.align", "center" }, + { "main.text.level_info_2.valign", "top" }, + { "main.text.level_info_2.chars", "-1" }, + { "main.text.level_info_2.font", "font.text_2" }, + { "main.text.level_info_2.font_header", "font.text_4" }, + { "main.text.level_name.x", "-1" }, + { "main.text.level_name.y", "-1" }, + { "main.text.level_name.align", "left" }, + { "main.text.level_name.valign", "top" }, + { "main.text.level_name.chars", "-1" }, + { "main.text.level_name.font", "font.text_2" }, + { "main.text.level_author.x", "-1" }, + { "main.text.level_author.y", "-1" }, + { "main.text.level_author.align", "left" }, + { "main.text.level_author.valign", "top" }, + { "main.text.level_author.chars", "-1" }, + { "main.text.level_author.font", "font.text_2" }, + { "main.text.level_year.x", "-1" }, + { "main.text.level_year.y", "-1" }, + { "main.text.level_year.align", "left" }, + { "main.text.level_year.valign", "top" }, + { "main.text.level_year.digits", "-1" }, + { "main.text.level_year.font", "font.text_2" }, + { "main.text.level_imported_from.x", "-1" }, + { "main.text.level_imported_from.y", "-1" }, + { "main.text.level_imported_from.align", "left" }, + { "main.text.level_imported_from.valign", "top" }, + { "main.text.level_imported_from.chars", "-1" }, + { "main.text.level_imported_from.font", "font.text_2" }, + { "main.text.level_imported_by.x", "-1" }, + { "main.text.level_imported_by.y", "-1" }, + { "main.text.level_imported_by.align", "left" }, + { "main.text.level_imported_by.valign", "top" }, + { "main.text.level_imported_by.chars", "-1" }, + { "main.text.level_imported_by.font", "font.text_2" }, + { "main.text.level_tested_by.x", "-1" }, + { "main.text.level_tested_by.y", "-1" }, + { "main.text.level_tested_by.align", "left" }, + { "main.text.level_tested_by.valign", "top" }, + { "main.text.level_tested_by.chars", "-1" }, + { "main.text.level_tested_by.font", "font.text_2" }, { "main.text.title_1.x", "272" }, { "main.text.title_1.y", "8" }, { "main.text.title_1.align", "center" }, + { "main.text.title_1.valign", "top" }, + { "main.text.title_1.font", "font.title_1" }, { "main.text.title_2.x", "272" }, { "main.text.title_2.y", "46" }, { "main.text.title_2.align", "center" }, + { "main.text.title_2.valign", "top" }, + { "main.text.title_2.font", "font.title_2" }, { "main.text.title_3.x", "272" }, { "main.text.title_3.y", "326" }, { "main.text.title_3.align", "center" }, + { "main.text.title_3.valign", "top" }, + { "main.text.title_3.font", "font.title_2" }, { "main.input.name.x", "-1" }, { "main.input.name.y", "-1" }, { "main.input.name.align", "left" }, + { "main.input.name.valign", "top" }, + { "main.input.name.font", "font.input_1" }, { "preview.x", "272" }, { "preview.y", "380" }, { "preview.align", "center" }, + { "preview.valign", "top" }, { "preview.xsize", "66" }, { "preview.ysize", "34" }, { "preview.xoffset", "0" }, @@ -4698,18 +5579,761 @@ struct ConfigInfo image_config[] = { "door_2.step_delay", "10" }, { "door_2.anim_mode", "default" }, - { "game.panel.level.x", "37" }, - { "game.panel.level.y", "20" }, - { "game.panel.gems.x", "29" }, + { "game.panel.level_number.x", "51" }, + { "game.panel.level_number.y", "20" }, + { "game.panel.level_number.align", "center" }, + { "game.panel.level_number.valign", "top" }, + { "game.panel.level_number.digits", "-1" }, + { "game.panel.level_number.font", "font.text_2" }, + { "game.panel.level_number.font_narrow", "font.text_1" }, + { "game.panel.level_number.draw_masked", "true" }, + { "game.panel.level_number.draw_order", "0" }, + + { "game.panel.gems.x", "50" }, { "game.panel.gems.y", "54" }, - { "game.panel.inventory.x", "29" }, - { "game.panel.inventory.y", "89" }, - { "game.panel.keys.x", "18" }, - { "game.panel.keys.y", "123" }, - { "game.panel.score.x", "15" }, + { "game.panel.gems.align", "center" }, + { "game.panel.gems.valign", "top" }, + { "game.panel.gems.digits", "3" }, + { "game.panel.gems.font", "font.text_2" }, + { "game.panel.gems.draw_masked", "true" }, + { "game.panel.gems.draw_order", "0" }, + + { "game.panel.inventory_count.x", "50" }, + { "game.panel.inventory_count.y", "89" }, + { "game.panel.inventory_count.align", "center" }, + { "game.panel.inventory_count.valign", "top" }, + { "game.panel.inventory_count.digits", "3" }, + { "game.panel.inventory_count.font", "font.text_2" }, + { "game.panel.inventory_count.draw_masked", "true" }, + { "game.panel.inventory_count.draw_order", "0" }, + + { "game.panel.inventory_first_1.x", "-1" }, + { "game.panel.inventory_first_1.y", "-1" }, + { "game.panel.inventory_first_1.tile_size", "16" }, + { "game.panel.inventory_first_1.draw_masked", "false" }, + { "game.panel.inventory_first_1.draw_order", "0" }, + { "game.panel.inventory_first_2.x", "-1" }, + { "game.panel.inventory_first_2.y", "-1" }, + { "game.panel.inventory_first_2.tile_size", "16" }, + { "game.panel.inventory_first_2.draw_masked", "false" }, + { "game.panel.inventory_first_2.draw_order", "0" }, + { "game.panel.inventory_first_3.x", "-1" }, + { "game.panel.inventory_first_3.y", "-1" }, + { "game.panel.inventory_first_3.tile_size", "16" }, + { "game.panel.inventory_first_3.draw_masked", "false" }, + { "game.panel.inventory_first_3.draw_order", "0" }, + { "game.panel.inventory_first_4.x", "-1" }, + { "game.panel.inventory_first_4.y", "-1" }, + { "game.panel.inventory_first_4.tile_size", "16" }, + { "game.panel.inventory_first_4.draw_masked", "false" }, + { "game.panel.inventory_first_4.draw_order", "0" }, + { "game.panel.inventory_first_5.x", "-1" }, + { "game.panel.inventory_first_5.y", "-1" }, + { "game.panel.inventory_first_5.tile_size", "16" }, + { "game.panel.inventory_first_5.draw_masked", "false" }, + { "game.panel.inventory_first_5.draw_order", "0" }, + { "game.panel.inventory_first_6.x", "-1" }, + { "game.panel.inventory_first_6.y", "-1" }, + { "game.panel.inventory_first_6.tile_size", "16" }, + { "game.panel.inventory_first_6.draw_masked", "false" }, + { "game.panel.inventory_first_6.draw_order", "0" }, + { "game.panel.inventory_first_7.x", "-1" }, + { "game.panel.inventory_first_7.y", "-1" }, + { "game.panel.inventory_first_7.tile_size", "16" }, + { "game.panel.inventory_first_7.draw_masked", "false" }, + { "game.panel.inventory_first_7.draw_order", "0" }, + { "game.panel.inventory_first_8.x", "-1" }, + { "game.panel.inventory_first_8.y", "-1" }, + { "game.panel.inventory_first_8.tile_size", "16" }, + { "game.panel.inventory_first_8.draw_masked", "false" }, + { "game.panel.inventory_first_8.draw_order", "0" }, + + { "game.panel.inventory_last_1.x", "-1" }, + { "game.panel.inventory_last_1.y", "-1" }, + { "game.panel.inventory_last_1.tile_size", "16" }, + { "game.panel.inventory_last_1.draw_masked", "false" }, + { "game.panel.inventory_last_1.draw_order", "0" }, + { "game.panel.inventory_last_2.x", "-1" }, + { "game.panel.inventory_last_2.y", "-1" }, + { "game.panel.inventory_last_2.tile_size", "16" }, + { "game.panel.inventory_last_2.draw_masked", "false" }, + { "game.panel.inventory_last_2.draw_order", "0" }, + { "game.panel.inventory_last_3.x", "-1" }, + { "game.panel.inventory_last_3.y", "-1" }, + { "game.panel.inventory_last_3.tile_size", "16" }, + { "game.panel.inventory_last_3.draw_masked", "false" }, + { "game.panel.inventory_last_3.draw_order", "0" }, + { "game.panel.inventory_last_4.x", "-1" }, + { "game.panel.inventory_last_4.y", "-1" }, + { "game.panel.inventory_last_4.tile_size", "16" }, + { "game.panel.inventory_last_4.draw_masked", "false" }, + { "game.panel.inventory_last_4.draw_order", "0" }, + { "game.panel.inventory_last_5.x", "-1" }, + { "game.panel.inventory_last_5.y", "-1" }, + { "game.panel.inventory_last_5.tile_size", "16" }, + { "game.panel.inventory_last_5.draw_masked", "false" }, + { "game.panel.inventory_last_5.draw_order", "0" }, + { "game.panel.inventory_last_6.x", "-1" }, + { "game.panel.inventory_last_6.y", "-1" }, + { "game.panel.inventory_last_6.tile_size", "16" }, + { "game.panel.inventory_last_6.draw_masked", "false" }, + { "game.panel.inventory_last_6.draw_order", "0" }, + { "game.panel.inventory_last_7.x", "-1" }, + { "game.panel.inventory_last_7.y", "-1" }, + { "game.panel.inventory_last_7.tile_size", "16" }, + { "game.panel.inventory_last_7.draw_masked", "false" }, + { "game.panel.inventory_last_7.draw_order", "0" }, + { "game.panel.inventory_last_8.x", "-1" }, + { "game.panel.inventory_last_8.y", "-1" }, + { "game.panel.inventory_last_8.tile_size", "16" }, + { "game.panel.inventory_last_8.draw_masked", "false" }, + { "game.panel.inventory_last_8.draw_order", "0" }, + + { "game.panel.key_1.x", "18" }, + { "game.panel.key_1.y", "123" }, + { "game.panel.key_1.tile_size", "16" }, + { "game.panel.key_1.draw_masked", "false" }, + { "game.panel.key_1.draw_order", "0" }, + { "game.panel.key_2.x", "34" }, + { "game.panel.key_2.y", "123" }, + { "game.panel.key_2.tile_size", "16" }, + { "game.panel.key_2.draw_masked", "false" }, + { "game.panel.key_2.draw_order", "0" }, + { "game.panel.key_3.x", "50" }, + { "game.panel.key_3.y", "123" }, + { "game.panel.key_3.tile_size", "16" }, + { "game.panel.key_3.draw_masked", "false" }, + { "game.panel.key_3.draw_order", "0" }, + { "game.panel.key_4.x", "66" }, + { "game.panel.key_4.y", "123" }, + { "game.panel.key_4.tile_size", "16" }, + { "game.panel.key_4.draw_masked", "false" }, + { "game.panel.key_4.draw_order", "0" }, + { "game.panel.key_5.x", "-1" }, + { "game.panel.key_5.y", "-1" }, + { "game.panel.key_5.tile_size", "16" }, + { "game.panel.key_5.draw_masked", "false" }, + { "game.panel.key_5.draw_order", "0" }, + { "game.panel.key_6.x", "-1" }, + { "game.panel.key_6.y", "-1" }, + { "game.panel.key_6.tile_size", "16" }, + { "game.panel.key_6.draw_masked", "false" }, + { "game.panel.key_6.draw_order", "0" }, + { "game.panel.key_7.x", "-1" }, + { "game.panel.key_7.y", "-1" }, + { "game.panel.key_7.tile_size", "16" }, + { "game.panel.key_7.draw_masked", "false" }, + { "game.panel.key_7.draw_order", "0" }, + { "game.panel.key_8.x", "-1" }, + { "game.panel.key_8.y", "-1" }, + { "game.panel.key_8.tile_size", "16" }, + { "game.panel.key_8.draw_masked", "false" }, + { "game.panel.key_8.draw_order", "0" }, + { "game.panel.key_white.x", "-1" }, + { "game.panel.key_white.y", "-1" }, + { "game.panel.key_white.tile_size", "16" }, + { "game.panel.key_white.draw_masked", "false" }, + { "game.panel.key_white.draw_order", "0" }, + { "game.panel.key_white_count.x", "-1" }, + { "game.panel.key_white_count.y", "-1" }, + { "game.panel.key_white_count.align", "left" }, + { "game.panel.key_white_count.valign", "top" }, + { "game.panel.key_white_count.digits", "-1" }, + { "game.panel.key_white_count.font", "font.text_2" }, + { "game.panel.key_white_count.draw_masked", "true" }, + { "game.panel.key_white_count.draw_order", "0" }, + + { "game.panel.score.x", "50" }, { "game.panel.score.y", "159" }, - { "game.panel.time.x", "29" }, + { "game.panel.score.align", "center" }, + { "game.panel.score.valign", "top" }, + { "game.panel.score.digits", "5" }, + { "game.panel.score.font", "font.text_2" }, + { "game.panel.score.draw_masked", "true" }, + { "game.panel.score.draw_order", "0" }, + + { "game.panel.time.x", "50" }, { "game.panel.time.y", "194" }, + { "game.panel.time.align", "center" }, + { "game.panel.time.valign", "top" }, + { "game.panel.time.digits", "-1" }, + { "game.panel.time.font", "font.text_2" }, + { "game.panel.time.font_narrow", "font.text_1" }, + { "game.panel.time.draw_masked", "true" }, + { "game.panel.time.draw_order", "0" }, + + { "game.panel.time_hh.x", "-1" }, + { "game.panel.time_hh.y", "-1" }, + { "game.panel.time_hh.align", "left" }, + { "game.panel.time_hh.valign", "top" }, + { "game.panel.time_hh.digits", "2" }, + { "game.panel.time_hh.font", "font.text_2" }, + { "game.panel.time_hh.draw_masked", "true" }, + { "game.panel.time_hh.draw_order", "0" }, + { "game.panel.time_mm.x", "-1" }, + { "game.panel.time_mm.y", "-1" }, + { "game.panel.time_mm.align", "left" }, + { "game.panel.time_mm.valign", "top" }, + { "game.panel.time_mm.digits", "2" }, + { "game.panel.time_mm.font", "font.text_2" }, + { "game.panel.time_mm.draw_masked", "true" }, + { "game.panel.time_mm.draw_order", "0" }, + { "game.panel.time_ss.x", "-1" }, + { "game.panel.time_ss.y", "-1" }, + { "game.panel.time_ss.align", "left" }, + { "game.panel.time_ss.valign", "top" }, + { "game.panel.time_ss.digits", "2" }, + { "game.panel.time_ss.font", "font.text_2" }, + { "game.panel.time_ss.draw_masked", "true" }, + { "game.panel.time_ss.draw_order", "0" }, + + { "game.panel.shield_normal.x", "-1" }, + { "game.panel.shield_normal.y", "-1" }, + { "game.panel.shield_normal.tile_size", "16" }, + { "game.panel.shield_normal.draw_masked", "false" }, + { "game.panel.shield_normal.draw_order", "0" }, + { "game.panel.shield_normal_time.x", "-1" }, + { "game.panel.shield_normal_time.y", "-1" }, + { "game.panel.shield_normal_time.align", "left" }, + { "game.panel.shield_normal_time.valign", "top" }, + { "game.panel.shield_normal_time.digits", "-1" }, + { "game.panel.shield_normal_time.font", "font.text_2" }, + { "game.panel.shield_normal_time.draw_masked", "true" }, + { "game.panel.shield_normal_time.draw_order", "0" }, + { "game.panel.shield_deadly.x", "-1" }, + { "game.panel.shield_deadly.y", "-1" }, + { "game.panel.shield_deadly.tile_size", "16" }, + { "game.panel.shield_deadly.draw_masked", "false" }, + { "game.panel.shield_deadly.draw_order", "0" }, + { "game.panel.shield_deadly_time.x", "-1" }, + { "game.panel.shield_deadly_time.y", "-1" }, + { "game.panel.shield_deadly_time.align", "left" }, + { "game.panel.shield_deadly_time.valign", "top" }, + { "game.panel.shield_deadly_time.digits", "-1" }, + { "game.panel.shield_deadly_time.font", "font.text_2" }, + { "game.panel.shield_deadly_time.draw_masked","true" }, + { "game.panel.shield_deadly_time.draw_order", "0" }, + + { "game.panel.exit.x", "-1" }, + { "game.panel.exit.y", "-1" }, + { "game.panel.exit.tile_size", "16" }, + { "game.panel.exit.draw_masked", "false" }, + { "game.panel.exit.draw_order", "0" }, + + { "game.panel.emc_magic_ball.x", "-1" }, + { "game.panel.emc_magic_ball.y", "-1" }, + { "game.panel.emc_magic_ball.tile_size", "16" }, + { "game.panel.emc_magic_ball.draw_masked", "false" }, + { "game.panel.emc_magic_ball.draw_order", "0" }, + { "game.panel.emc_magic_ball_switch.x", "-1" }, + { "game.panel.emc_magic_ball_switch.y", "-1" }, + { "game.panel.emc_magic_ball_switch.tile_size", "16" }, + { "game.panel.emc_magic_ball_switch.draw_masked", "true" }, + { "game.panel.emc_magic_ball_switch.draw_order", "0" }, + + { "game.panel.light_switch.x", "-1" }, + { "game.panel.light_switch.y", "-1" }, + { "game.panel.light_switch.tile_size", "16" }, + { "game.panel.light_switch.draw_masked", "false" }, + { "game.panel.light_switch.draw_order", "0" }, + { "game.panel.light_switch_time.x", "-1" }, + { "game.panel.light_switch_time.y", "-1" }, + { "game.panel.light_switch_time.align", "left" }, + { "game.panel.light_switch_time.valign", "top" }, + { "game.panel.light_switch_time.digits", "-1" }, + { "game.panel.light_switch_time.font", "font.text_2" }, + { "game.panel.light_switch_time.draw_masked", "true" }, + { "game.panel.light_switch_time.draw_order", "0" }, + + { "game.panel.timegate_switch.x", "-1" }, + { "game.panel.timegate_switch.y", "-1" }, + { "game.panel.timegate_switch.tile_size", "16" }, + { "game.panel.timegate_switch.draw_masked", "false" }, + { "game.panel.timegate_switch.draw_order", "0" }, + { "game.panel.timegate_switch_time.x", "-1" }, + { "game.panel.timegate_switch_time.y", "-1" }, + { "game.panel.timegate_switch_time.align", "left" }, + { "game.panel.timegate_switch_time.valign", "top" }, + { "game.panel.timegate_switch_time.digits", "-1" }, + { "game.panel.timegate_switch_time.font", "font.text_2" }, + { "game.panel.timegate_switch_time.draw_masked", "true" }, + { "game.panel.timegate_switch_time.draw_order", "0" }, + + { "game.panel.switchgate_switch.x", "-1" }, + { "game.panel.switchgate_switch.y", "-1" }, + { "game.panel.switchgate_switch.tile_size", "16" }, + { "game.panel.switchgate_switch.draw_masked", "false" }, + { "game.panel.switchgate_switch.draw_order", "0" }, + + { "game.panel.emc_lenses.x", "-1" }, + { "game.panel.emc_lenses.y", "-1" }, + { "game.panel.emc_lenses.tile_size", "16" }, + { "game.panel.emc_lenses.draw_masked", "false" }, + { "game.panel.emc_lenses.draw_order", "0" }, + { "game.panel.emc_lenses_time.x", "-1" }, + { "game.panel.emc_lenses_time.y", "-1" }, + { "game.panel.emc_lenses_time.align", "left" }, + { "game.panel.emc_lenses_time.valign", "top" }, + { "game.panel.emc_lenses_time.digits", "-1" }, + { "game.panel.emc_lenses_time.font", "font.text_2" }, + { "game.panel.emc_lenses_time.draw_masked", "true" }, + { "game.panel.emc_lenses_time.draw_order", "0" }, + + { "game.panel.emc_magnifier.x", "-1" }, + { "game.panel.emc_magnifier.y", "-1" }, + { "game.panel.emc_magnifier.tile_size", "16" }, + { "game.panel.emc_magnifier.draw_masked", "false" }, + { "game.panel.emc_magnifier.draw_order", "0" }, + { "game.panel.emc_magnifier_time.x", "-1" }, + { "game.panel.emc_magnifier_time.y", "-1" }, + { "game.panel.emc_magnifier_time.align", "left" }, + { "game.panel.emc_magnifier_time.valign", "top" }, + { "game.panel.emc_magnifier_time.digits", "-1" }, + { "game.panel.emc_magnifier_time.font", "font.text_2" }, + { "game.panel.emc_magnifier_time.draw_masked","true" }, + { "game.panel.emc_magnifier_time.draw_order", "0" }, + + { "game.panel.balloon_switch.x", "-1" }, + { "game.panel.balloon_switch.y", "-1" }, + { "game.panel.balloon_switch.tile_size", "16" }, + { "game.panel.balloon_switch.draw_masked", "false" }, + { "game.panel.balloon_switch.draw_order", "0" }, + + { "game.panel.dynabomb_number.x", "-1" }, + { "game.panel.dynabomb_number.y", "-1" }, + { "game.panel.dynabomb_number.align", "left" }, + { "game.panel.dynabomb_number.valign", "top" }, + { "game.panel.dynabomb_number.digits", "-1" }, + { "game.panel.dynabomb_number.font", "font.text_2" }, + { "game.panel.dynabomb_number.draw_masked", "true" }, + { "game.panel.dynabomb_number.draw_order", "0" }, + { "game.panel.dynabomb_size.x", "-1" }, + { "game.panel.dynabomb_size.y", "-1" }, + { "game.panel.dynabomb_size.align", "left" }, + { "game.panel.dynabomb_size.valign", "top" }, + { "game.panel.dynabomb_size.digits", "-1" }, + { "game.panel.dynabomb_size.font", "font.text_2" }, + { "game.panel.dynabomb_size.draw_masked", "true" }, + { "game.panel.dynabomb_size.draw_order", "0" }, + { "game.panel.dynabomb_power.x", "-1" }, + { "game.panel.dynabomb_power.y", "-1" }, + { "game.panel.dynabomb_power.tile_size", "16" }, + { "game.panel.dynabomb_power.draw_masked", "false" }, + { "game.panel.dynabomb_power.draw_order", "0" }, + + { "game.panel.penguins.x", "-1" }, + { "game.panel.penguins.y", "-1" }, + { "game.panel.penguins.align", "left" }, + { "game.panel.penguins.valign", "top" }, + { "game.panel.penguins.digits", "-1" }, + { "game.panel.penguins.font", "font.text_2" }, + { "game.panel.penguins.draw_masked", "true" }, + { "game.panel.penguins.draw_order", "0" }, + + { "game.panel.sokoban_objects.x", "-1" }, + { "game.panel.sokoban_objects.y", "-1" }, + { "game.panel.sokoban_objects.align", "left" }, + { "game.panel.sokoban_objects.valign", "top" }, + { "game.panel.sokoban_objects.digits", "-1" }, + { "game.panel.sokoban_objects.font", "font.text_2" }, + { "game.panel.sokoban_objects.draw_masked", "true" }, + { "game.panel.sokoban_objects.draw_order", "0" }, + { "game.panel.sokoban_fields.x", "-1" }, + { "game.panel.sokoban_fields.y", "-1" }, + { "game.panel.sokoban_fields.align", "left" }, + { "game.panel.sokoban_fields.valign", "top" }, + { "game.panel.sokoban_fields.digits", "-1" }, + { "game.panel.sokoban_fields.font", "font.text_2" }, + { "game.panel.sokoban_fields.draw_masked", "true" }, + { "game.panel.sokoban_fields.draw_order", "0" }, + + { "game.panel.robot_wheel.x", "-1" }, + { "game.panel.robot_wheel.y", "-1" }, + { "game.panel.robot_wheel.tile_size", "16" }, + { "game.panel.robot_wheel.draw_masked", "false" }, + { "game.panel.robot_wheel.draw_order", "0" }, + + { "game.panel.conveyor_belt_1.x", "-1" }, + { "game.panel.conveyor_belt_1.y", "-1" }, + { "game.panel.conveyor_belt_1.tile_size", "16" }, + { "game.panel.conveyor_belt_1.draw_masked", "false" }, + { "game.panel.conveyor_belt_1.draw_order", "0" }, + { "game.panel.conveyor_belt_1_switch.x", "-1" }, + { "game.panel.conveyor_belt_1_switch.y", "-1" }, + { "game.panel.conveyor_belt_1_switch.tile_size", "16" }, + { "game.panel.conveyor_belt_1_switch.draw_masked", "false" }, + { "game.panel.conveyor_belt_1_switch.draw_order", "0" }, + { "game.panel.conveyor_belt_2.x", "-1" }, + { "game.panel.conveyor_belt_2.y", "-1" }, + { "game.panel.conveyor_belt_2.tile_size", "16" }, + { "game.panel.conveyor_belt_2.draw_masked", "false" }, + { "game.panel.conveyor_belt_2.draw_order", "0" }, + { "game.panel.conveyor_belt_2_switch.x", "-1" }, + { "game.panel.conveyor_belt_2_switch.y", "-1" }, + { "game.panel.conveyor_belt_2_switch.tile_size", "16" }, + { "game.panel.conveyor_belt_2_switch.draw_masked", "false" }, + { "game.panel.conveyor_belt_2_switch.draw_order", "0" }, + { "game.panel.conveyor_belt_3.x", "-1" }, + { "game.panel.conveyor_belt_3.y", "-1" }, + { "game.panel.conveyor_belt_3.tile_size", "16" }, + { "game.panel.conveyor_belt_3.draw_masked", "false" }, + { "game.panel.conveyor_belt_3.draw_order", "0" }, + { "game.panel.conveyor_belt_3_switch.x", "-1" }, + { "game.panel.conveyor_belt_3_switch.y", "-1" }, + { "game.panel.conveyor_belt_3_switch.tile_size", "16" }, + { "game.panel.conveyor_belt_3_switch.draw_masked", "false" }, + { "game.panel.conveyor_belt_3_switch.draw_order", "0" }, + { "game.panel.conveyor_belt_4.x", "-1" }, + { "game.panel.conveyor_belt_4.y", "-1" }, + { "game.panel.conveyor_belt_4.tile_size", "16" }, + { "game.panel.conveyor_belt_4.draw_masked", "false" }, + { "game.panel.conveyor_belt_4.draw_order", "0" }, + { "game.panel.conveyor_belt_4_switch.x", "-1" }, + { "game.panel.conveyor_belt_4_switch.y", "-1" }, + { "game.panel.conveyor_belt_4_switch.tile_size", "16" }, + { "game.panel.conveyor_belt_4_switch.draw_masked", "false" }, + { "game.panel.conveyor_belt_4_switch.draw_order", "0" }, + + { "game.panel.magic_wall.x", "-1" }, + { "game.panel.magic_wall.y", "-1" }, + { "game.panel.magic_wall.tile_size", "16" }, + { "game.panel.magic_wall.draw_masked", "false" }, + { "game.panel.magic_wall.draw_order", "0" }, + { "game.panel.magic_wall_time.x", "-1" }, + { "game.panel.magic_wall_time.y", "-1" }, + { "game.panel.magic_wall_time.align", "left" }, + { "game.panel.magic_wall_time.valign", "top" }, + { "game.panel.magic_wall_time.digits", "-1" }, + { "game.panel.magic_wall_time.font", "font.text_2" }, + { "game.panel.magic_wall_time.draw_masked", "true" }, + { "game.panel.magic_wall_time.draw_order", "0" }, + + { "game.panel.gravity_state.x", "-1" }, + { "game.panel.gravity_state.y", "-1" }, + { "game.panel.gravity_state.align", "left" }, + { "game.panel.gravity_state.valign", "top" }, + { "game.panel.gravity_state.chars", "-1" }, + { "game.panel.gravity_state.font", "font.text_1" }, + { "game.panel.gravity_state.font_active", "font.text_2" }, + { "game.panel.gravity_state.draw_masked", "true" }, + { "game.panel.gravity_state.draw_order", "0" }, + + { "game.panel.graphic_1.x", "-1" }, + { "game.panel.graphic_1.y", "-1" }, + { "game.panel.graphic_1.draw_masked", "true" }, + { "game.panel.graphic_1.draw_order", "0" }, + { "game.panel.graphic_2.x", "-1" }, + { "game.panel.graphic_2.y", "-1" }, + { "game.panel.graphic_2.draw_masked", "true" }, + { "game.panel.graphic_2.draw_order", "0" }, + { "game.panel.graphic_3.x", "-1" }, + { "game.panel.graphic_3.y", "-1" }, + { "game.panel.graphic_3.draw_masked", "true" }, + { "game.panel.graphic_3.draw_order", "0" }, + { "game.panel.graphic_4.x", "-1" }, + { "game.panel.graphic_4.y", "-1" }, + { "game.panel.graphic_4.draw_masked", "true" }, + { "game.panel.graphic_4.draw_order", "0" }, + { "game.panel.graphic_5.x", "-1" }, + { "game.panel.graphic_5.y", "-1" }, + { "game.panel.graphic_5.draw_masked", "true" }, + { "game.panel.graphic_5.draw_order", "0" }, + { "game.panel.graphic_6.x", "-1" }, + { "game.panel.graphic_6.y", "-1" }, + { "game.panel.graphic_6.draw_masked", "true" }, + { "game.panel.graphic_6.draw_order", "0" }, + { "game.panel.graphic_7.x", "-1" }, + { "game.panel.graphic_7.y", "-1" }, + { "game.panel.graphic_7.draw_masked", "true" }, + { "game.panel.graphic_7.draw_order", "0" }, + { "game.panel.graphic_8.x", "-1" }, + { "game.panel.graphic_8.y", "-1" }, + { "game.panel.graphic_8.draw_masked", "true" }, + { "game.panel.graphic_8.draw_order", "0" }, + + { "game.panel.element_1.x", "-1" }, + { "game.panel.element_1.y", "-1" }, + { "game.panel.element_1.tile_size", "16" }, + { "game.panel.element_1.element", "empty_space" }, + { "game.panel.element_1.draw_masked", "false" }, + { "game.panel.element_1.draw_order", "0" }, + { "game.panel.element_1_count.x", "-1" }, + { "game.panel.element_1_count.y", "-1" }, + { "game.panel.element_1_count.align", "left" }, + { "game.panel.element_1_count.valign", "top" }, + { "game.panel.element_1_count.digits", "-1" }, + { "game.panel.element_1_count.font", "font.text_2" }, + { "game.panel.element_1_count.element", "empty_space" }, + { "game.panel.element_1_count.draw_masked", "true" }, + { "game.panel.element_1_count.draw_order", "0" }, + { "game.panel.element_2.x", "-1" }, + { "game.panel.element_2.y", "-1" }, + { "game.panel.element_2.tile_size", "16" }, + { "game.panel.element_2.element", "empty_space" }, + { "game.panel.element_2.draw_masked", "false" }, + { "game.panel.element_2.draw_order", "0" }, + { "game.panel.element_2_count.x", "-1" }, + { "game.panel.element_2_count.y", "-1" }, + { "game.panel.element_2_count.align", "left" }, + { "game.panel.element_2_count.valign", "top" }, + { "game.panel.element_2_count.digits", "-1" }, + { "game.panel.element_2_count.font", "font.text_2" }, + { "game.panel.element_2_count.element", "empty_space" }, + { "game.panel.element_2_count.draw_masked", "true" }, + { "game.panel.element_2_count.draw_order", "0" }, + { "game.panel.element_3.x", "-1" }, + { "game.panel.element_3.y", "-1" }, + { "game.panel.element_3.tile_size", "16" }, + { "game.panel.element_3.element", "empty_space" }, + { "game.panel.element_3.draw_masked", "false" }, + { "game.panel.element_3.draw_order", "0" }, + { "game.panel.element_3_count.x", "-1" }, + { "game.panel.element_3_count.y", "-1" }, + { "game.panel.element_3_count.align", "left" }, + { "game.panel.element_3_count.valign", "top" }, + { "game.panel.element_3_count.digits", "-1" }, + { "game.panel.element_3_count.font", "font.text_2" }, + { "game.panel.element_3_count.element", "empty_space" }, + { "game.panel.element_3_count.draw_masked", "true" }, + { "game.panel.element_3_count.draw_order", "0" }, + { "game.panel.element_4.x", "-1" }, + { "game.panel.element_4.y", "-1" }, + { "game.panel.element_4.tile_size", "16" }, + { "game.panel.element_4.element", "empty_space" }, + { "game.panel.element_4.draw_masked", "false" }, + { "game.panel.element_4.draw_order", "0" }, + { "game.panel.element_4_count.x", "-1" }, + { "game.panel.element_4_count.y", "-1" }, + { "game.panel.element_4_count.align", "left" }, + { "game.panel.element_4_count.valign", "top" }, + { "game.panel.element_4_count.digits", "-1" }, + { "game.panel.element_4_count.font", "font.text_2" }, + { "game.panel.element_4_count.element", "empty_space" }, + { "game.panel.element_4_count.draw_masked", "true" }, + { "game.panel.element_4_count.draw_order", "0" }, + { "game.panel.element_5.x", "-1" }, + { "game.panel.element_5.y", "-1" }, + { "game.panel.element_5.tile_size", "16" }, + { "game.panel.element_5.element", "empty_space" }, + { "game.panel.element_5.draw_masked", "false" }, + { "game.panel.element_5.draw_order", "0" }, + { "game.panel.element_5_count.x", "-1" }, + { "game.panel.element_5_count.y", "-1" }, + { "game.panel.element_5_count.align", "left" }, + { "game.panel.element_5_count.valign", "top" }, + { "game.panel.element_5_count.digits", "-1" }, + { "game.panel.element_5_count.font", "font.text_2" }, + { "game.panel.element_5_count.element", "empty_space" }, + { "game.panel.element_5_count.draw_masked", "true" }, + { "game.panel.element_5_count.draw_order", "0" }, + { "game.panel.element_6.x", "-1" }, + { "game.panel.element_6.y", "-1" }, + { "game.panel.element_6.tile_size", "16" }, + { "game.panel.element_6.element", "empty_space" }, + { "game.panel.element_6.draw_masked", "false" }, + { "game.panel.element_6.draw_order", "0" }, + { "game.panel.element_6_count.x", "-1" }, + { "game.panel.element_6_count.y", "-1" }, + { "game.panel.element_6_count.align", "left" }, + { "game.panel.element_6_count.valign", "top" }, + { "game.panel.element_6_count.digits", "-1" }, + { "game.panel.element_6_count.font", "font.text_2" }, + { "game.panel.element_6_count.element", "empty_space" }, + { "game.panel.element_6_count.draw_masked", "true" }, + { "game.panel.element_6_count.draw_order", "0" }, + { "game.panel.element_7.x", "-1" }, + { "game.panel.element_7.y", "-1" }, + { "game.panel.element_7.tile_size", "16" }, + { "game.panel.element_7.element", "empty_space" }, + { "game.panel.element_7.draw_masked", "false" }, + { "game.panel.element_7.draw_order", "0" }, + { "game.panel.element_7_count.x", "-1" }, + { "game.panel.element_7_count.y", "-1" }, + { "game.panel.element_7_count.align", "left" }, + { "game.panel.element_7_count.valign", "top" }, + { "game.panel.element_7_count.digits", "-1" }, + { "game.panel.element_7_count.font", "font.text_2" }, + { "game.panel.element_7_count.element", "empty_space" }, + { "game.panel.element_7_count.draw_masked", "true" }, + { "game.panel.element_7_count.draw_order", "0" }, + { "game.panel.element_8.x", "-1" }, + { "game.panel.element_8.y", "-1" }, + { "game.panel.element_8.tile_size", "16" }, + { "game.panel.element_8.element", "empty_space" }, + { "game.panel.element_8.draw_masked", "false" }, + { "game.panel.element_8.draw_order", "0" }, + { "game.panel.element_8_count.x", "-1" }, + { "game.panel.element_8_count.y", "-1" }, + { "game.panel.element_8_count.align", "left" }, + { "game.panel.element_8_count.valign", "top" }, + { "game.panel.element_8_count.digits", "-1" }, + { "game.panel.element_8_count.font", "font.text_2" }, + { "game.panel.element_8_count.element", "empty_space" }, + { "game.panel.element_8_count.draw_masked", "true" }, + { "game.panel.element_8_count.draw_order", "0" }, + + { "game.panel.ce_score_1.x", "-1" }, + { "game.panel.ce_score_1.y", "-1" }, + { "game.panel.ce_score_1.align", "left" }, + { "game.panel.ce_score_1.valign", "top" }, + { "game.panel.ce_score_1.digits", "-1" }, + { "game.panel.ce_score_1.font", "font.text_2" }, + { "game.panel.ce_score_1.element", "empty_space" }, + { "game.panel.ce_score_1.draw_masked", "true" }, + { "game.panel.ce_score_1.draw_order", "0" }, + { "game.panel.ce_score_1_element.x", "-1" }, + { "game.panel.ce_score_1_element.y", "-1" }, + { "game.panel.ce_score_1_element.tile_size", "16" }, + { "game.panel.ce_score_1_element.element", "empty_space" }, + { "game.panel.ce_score_1_element.draw_masked","false" }, + { "game.panel.ce_score_1_element.draw_order", "0" }, + { "game.panel.ce_score_2.x", "-1" }, + { "game.panel.ce_score_2.y", "-1" }, + { "game.panel.ce_score_2.align", "left" }, + { "game.panel.ce_score_2.valign", "top" }, + { "game.panel.ce_score_2.digits", "-1" }, + { "game.panel.ce_score_2.font", "font.text_2" }, + { "game.panel.ce_score_2.element", "empty_space" }, + { "game.panel.ce_score_2.draw_masked", "true" }, + { "game.panel.ce_score_2.draw_order", "0" }, + { "game.panel.ce_score_2_element.x", "-1" }, + { "game.panel.ce_score_2_element.y", "-1" }, + { "game.panel.ce_score_2_element.tile_size", "16" }, + { "game.panel.ce_score_2_element.element", "empty_space" }, + { "game.panel.ce_score_2_element.draw_masked","false" }, + { "game.panel.ce_score_2_element.draw_order", "0" }, + { "game.panel.ce_score_3.x", "-1" }, + { "game.panel.ce_score_3.y", "-1" }, + { "game.panel.ce_score_3.align", "left" }, + { "game.panel.ce_score_3.valign", "top" }, + { "game.panel.ce_score_3.digits", "-1" }, + { "game.panel.ce_score_3.font", "font.text_2" }, + { "game.panel.ce_score_3.element", "empty_space" }, + { "game.panel.ce_score_3.draw_masked", "true" }, + { "game.panel.ce_score_3.draw_order", "0" }, + { "game.panel.ce_score_3_element.x", "-1" }, + { "game.panel.ce_score_3_element.y", "-1" }, + { "game.panel.ce_score_3_element.tile_size", "16" }, + { "game.panel.ce_score_3_element.element", "empty_space" }, + { "game.panel.ce_score_3_element.draw_masked","false" }, + { "game.panel.ce_score_3_element.draw_order", "0" }, + { "game.panel.ce_score_4.x", "-1" }, + { "game.panel.ce_score_4.y", "-1" }, + { "game.panel.ce_score_4.align", "left" }, + { "game.panel.ce_score_4.valign", "top" }, + { "game.panel.ce_score_4.digits", "-1" }, + { "game.panel.ce_score_4.font", "font.text_2" }, + { "game.panel.ce_score_4.element", "empty_space" }, + { "game.panel.ce_score_4.draw_masked", "true" }, + { "game.panel.ce_score_4.draw_order", "0" }, + { "game.panel.ce_score_4_element.x", "-1" }, + { "game.panel.ce_score_4_element.y", "-1" }, + { "game.panel.ce_score_4_element.tile_size", "16" }, + { "game.panel.ce_score_4_element.element", "empty_space" }, + { "game.panel.ce_score_4_element.draw_masked","false" }, + { "game.panel.ce_score_4_element.draw_order", "0" }, + { "game.panel.ce_score_5.x", "-1" }, + { "game.panel.ce_score_5.y", "-1" }, + { "game.panel.ce_score_5.align", "left" }, + { "game.panel.ce_score_5.valign", "top" }, + { "game.panel.ce_score_5.digits", "-1" }, + { "game.panel.ce_score_5.font", "font.text_2" }, + { "game.panel.ce_score_5.element", "empty_space" }, + { "game.panel.ce_score_5.draw_masked", "true" }, + { "game.panel.ce_score_5.draw_order", "0" }, + { "game.panel.ce_score_5_element.x", "-1" }, + { "game.panel.ce_score_5_element.y", "-1" }, + { "game.panel.ce_score_5_element.tile_size", "16" }, + { "game.panel.ce_score_5_element.element", "empty_space" }, + { "game.panel.ce_score_5_element.draw_masked","false" }, + { "game.panel.ce_score_5_element.draw_order", "0" }, + { "game.panel.ce_score_6.x", "-1" }, + { "game.panel.ce_score_6.y", "-1" }, + { "game.panel.ce_score_6.align", "left" }, + { "game.panel.ce_score_6.valign", "top" }, + { "game.panel.ce_score_6.digits", "-1" }, + { "game.panel.ce_score_6.font", "font.text_2" }, + { "game.panel.ce_score_6.element", "empty_space" }, + { "game.panel.ce_score_6.draw_masked", "true" }, + { "game.panel.ce_score_6.draw_order", "0" }, + { "game.panel.ce_score_6_element.x", "-1" }, + { "game.panel.ce_score_6_element.y", "-1" }, + { "game.panel.ce_score_6_element.tile_size", "16" }, + { "game.panel.ce_score_6_element.element", "empty_space" }, + { "game.panel.ce_score_6_element.draw_masked","false" }, + { "game.panel.ce_score_6_element.draw_order", "0" }, + { "game.panel.ce_score_7.x", "-1" }, + { "game.panel.ce_score_7.y", "-1" }, + { "game.panel.ce_score_7.align", "left" }, + { "game.panel.ce_score_7.valign", "top" }, + { "game.panel.ce_score_7.digits", "-1" }, + { "game.panel.ce_score_7.font", "font.text_2" }, + { "game.panel.ce_score_7.element", "empty_space" }, + { "game.panel.ce_score_7.draw_masked", "true" }, + { "game.panel.ce_score_7.draw_order", "0" }, + { "game.panel.ce_score_7_element.x", "-1" }, + { "game.panel.ce_score_7_element.y", "-1" }, + { "game.panel.ce_score_7_element.tile_size", "16" }, + { "game.panel.ce_score_7_element.element", "empty_space" }, + { "game.panel.ce_score_7_element.draw_masked","false" }, + { "game.panel.ce_score_7_element.draw_order", "0" }, + { "game.panel.ce_score_8.x", "-1" }, + { "game.panel.ce_score_8.y", "-1" }, + { "game.panel.ce_score_8.align", "left" }, + { "game.panel.ce_score_8.valign", "top" }, + { "game.panel.ce_score_8.digits", "-1" }, + { "game.panel.ce_score_8.font", "font.text_2" }, + { "game.panel.ce_score_8.element", "empty_space" }, + { "game.panel.ce_score_8.draw_masked", "true" }, + { "game.panel.ce_score_8.draw_order", "0" }, + { "game.panel.ce_score_8_element.x", "-1" }, + { "game.panel.ce_score_8_element.y", "-1" }, + { "game.panel.ce_score_8_element.tile_size", "16" }, + { "game.panel.ce_score_8_element.element", "empty_space" }, + { "game.panel.ce_score_8_element.draw_masked","false" }, + { "game.panel.ce_score_8_element.draw_order", "0" }, + + { "game.panel.player_name.x", "-1" }, + { "game.panel.player_name.y", "-1" }, + { "game.panel.player_name.align", "left" }, + { "game.panel.player_name.valign", "top" }, + { "game.panel.player_name.chars", "-1" }, + { "game.panel.player_name.font", "font.text_2" }, + { "game.panel.player_name.draw_masked", "true" }, + { "game.panel.player_name.draw_order", "0" }, + + { "game.panel.level_name.x", "-1" }, + { "game.panel.level_name.y", "-1" }, + { "game.panel.level_name.align", "left" }, + { "game.panel.level_name.valign", "top" }, + { "game.panel.level_name.chars", "-1" }, + { "game.panel.level_name.font", "font.text_2" }, + { "game.panel.level_name.draw_masked", "true" }, + { "game.panel.level_name.draw_order", "0" }, + { "game.panel.level_author.x", "-1" }, + { "game.panel.level_author.y", "-1" }, + { "game.panel.level_author.align", "left" }, + { "game.panel.level_author.valign", "top" }, + { "game.panel.level_author.chars", "-1" }, + { "game.panel.level_author.font", "font.text_2" }, + { "game.panel.level_author.draw_masked", "true" }, + { "game.panel.level_author.draw_order", "0" }, + + { "game.button.stop.x", "5" }, + { "game.button.stop.y", "215" }, + { "game.button.pause.x", "35" }, + { "game.button.pause.y", "215" }, + { "game.button.play.x", "65" }, + { "game.button.play.y", "215" }, + { "game.button.sound_music.x", "5" }, + { "game.button.sound_music.y", "245" }, + { "game.button.sound_loops.x", "35" }, + { "game.button.sound_loops.y", "245" }, + { "game.button.sound_simple.x", "65" }, + { "game.button.sound_simple.y", "245" }, + + { "game.forced_scroll_delay_value", "-1" }, + { "game.use_native_emc_graphics_engine", "false" }, { "[player].boring_delay_fixed", "1000" }, { "[player].boring_delay_random", "1000" }, diff --git a/src/conf_gfx.h b/src/conf_gfx.h index f5c777a3..cde81fcb 100644 --- a/src/conf_gfx.h +++ b/src/conf_gfx.h @@ -263,1333 +263,1554 @@ #define IMG_MAGIC_WALL_FULL 242 #define IMG_MAGIC_WALL_EMPTYING 243 #define IMG_MAGIC_WALL_DEAD 244 -#define IMG_QUICKSAND_EMPTY 245 -#define IMG_QUICKSAND_FILLING 246 -#define IMG_QUICKSAND_FULL 247 -#define IMG_QUICKSAND_FULL_EDITOR 248 -#define IMG_QUICKSAND_EMPTYING 249 -#define IMG_ACID_POOL_TOPLEFT 250 -#define IMG_ACID_POOL_TOPRIGHT 251 -#define IMG_ACID_POOL_BOTTOMLEFT 252 -#define IMG_ACID_POOL_BOTTOM 253 -#define IMG_ACID_POOL_BOTTOMRIGHT 254 -#define IMG_ACID 255 -#define IMG_ACID_SPLASH_LEFT 256 -#define IMG_ACID_SPLASH_RIGHT 257 -#define IMG_AMOEBA_DROP 258 -#define IMG_AMOEBA_GROWING 259 -#define IMG_AMOEBA_SHRINKING 260 -#define IMG_AMOEBA_WET 261 -#define IMG_AMOEBA_WET_EDITOR 262 -#define IMG_AMOEBA_DROPPING 263 -#define IMG_AMOEBA_DRY 264 -#define IMG_AMOEBA_FULL 265 -#define IMG_AMOEBA_FULL_EDITOR 266 -#define IMG_AMOEBA_DEAD 267 -#define IMG_AMOEBA_DEAD_EDITOR 268 -#define IMG_EM_KEY_1 269 -#define IMG_EM_KEY_2 270 -#define IMG_EM_KEY_3 271 -#define IMG_EM_KEY_4 272 -#define IMG_EM_GATE_1 273 -#define IMG_EM_GATE_2 274 -#define IMG_EM_GATE_3 275 -#define IMG_EM_GATE_4 276 -#define IMG_EM_GATE_1_GRAY 277 -#define IMG_EM_GATE_1_GRAY_EDITOR 278 -#define IMG_EM_GATE_1_GRAY_ACTIVE 279 -#define IMG_EM_GATE_2_GRAY 280 -#define IMG_EM_GATE_2_GRAY_EDITOR 281 -#define IMG_EM_GATE_2_GRAY_ACTIVE 282 -#define IMG_EM_GATE_3_GRAY 283 -#define IMG_EM_GATE_3_GRAY_EDITOR 284 -#define IMG_EM_GATE_3_GRAY_ACTIVE 285 -#define IMG_EM_GATE_4_GRAY 286 -#define IMG_EM_GATE_4_GRAY_EDITOR 287 -#define IMG_EM_GATE_4_GRAY_ACTIVE 288 -#define IMG_EXIT_CLOSED 289 -#define IMG_EXIT_OPENING 290 -#define IMG_EXIT_OPEN 291 -#define IMG_EXIT_CLOSING 292 -#define IMG_BALLOON 293 -#define IMG_BALLOON_MOVING 294 -#define IMG_BALLOON_PUSHING 295 -#define IMG_BALLOON_SWITCH_LEFT 296 -#define IMG_BALLOON_SWITCH_RIGHT 297 -#define IMG_BALLOON_SWITCH_UP 298 -#define IMG_BALLOON_SWITCH_DOWN 299 -#define IMG_BALLOON_SWITCH_ANY 300 -#define IMG_BALLOON_SWITCH_NONE 301 -#define IMG_SPRING 302 -#define IMG_EMC_STEELWALL_1 303 -#define IMG_EMC_STEELWALL_2 304 -#define IMG_EMC_STEELWALL_3 305 -#define IMG_EMC_STEELWALL_4 306 -#define IMG_EMC_WALL_1 307 -#define IMG_EMC_WALL_2 308 -#define IMG_EMC_WALL_3 309 -#define IMG_EMC_WALL_4 310 -#define IMG_EMC_WALL_5 311 -#define IMG_EMC_WALL_6 312 -#define IMG_EMC_WALL_7 313 -#define IMG_EMC_WALL_8 314 -#define IMG_INVISIBLE_STEELWALL 315 -#define IMG_INVISIBLE_STEELWALL_EDITOR 316 -#define IMG_INVISIBLE_STEELWALL_ACTIVE 317 -#define IMG_INVISIBLE_WALL 318 -#define IMG_INVISIBLE_WALL_EDITOR 319 -#define IMG_INVISIBLE_WALL_ACTIVE 320 -#define IMG_INVISIBLE_SAND 321 -#define IMG_INVISIBLE_SAND_EDITOR 322 -#define IMG_INVISIBLE_SAND_ACTIVE 323 -#define IMG_INVISIBLE_SAND_ACTIVE_CRUMBLED 324 -#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_LEFT 325 -#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_RIGHT 326 -#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_UP 327 -#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_DOWN 328 -#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_LEFT_CRUMBLED 329 -#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_RIGHT_CRUMBLED 330 -#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_UP_CRUMBLED 331 -#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_DOWN_CRUMBLED 332 -#define IMG_CONVEYOR_BELT_1_MIDDLE 333 -#define IMG_CONVEYOR_BELT_1_MIDDLE_ACTIVE 334 -#define IMG_CONVEYOR_BELT_1_LEFT 335 -#define IMG_CONVEYOR_BELT_1_LEFT_ACTIVE 336 -#define IMG_CONVEYOR_BELT_1_RIGHT 337 -#define IMG_CONVEYOR_BELT_1_RIGHT_ACTIVE 338 -#define IMG_CONVEYOR_BELT_1_SWITCH_LEFT 339 -#define IMG_CONVEYOR_BELT_1_SWITCH_MIDDLE 340 -#define IMG_CONVEYOR_BELT_1_SWITCH_RIGHT 341 -#define IMG_CONVEYOR_BELT_2_MIDDLE 342 -#define IMG_CONVEYOR_BELT_2_MIDDLE_ACTIVE 343 -#define IMG_CONVEYOR_BELT_2_LEFT 344 -#define IMG_CONVEYOR_BELT_2_LEFT_ACTIVE 345 -#define IMG_CONVEYOR_BELT_2_RIGHT 346 -#define IMG_CONVEYOR_BELT_2_RIGHT_ACTIVE 347 -#define IMG_CONVEYOR_BELT_2_SWITCH_LEFT 348 -#define IMG_CONVEYOR_BELT_2_SWITCH_MIDDLE 349 -#define IMG_CONVEYOR_BELT_2_SWITCH_RIGHT 350 -#define IMG_CONVEYOR_BELT_3_MIDDLE 351 -#define IMG_CONVEYOR_BELT_3_MIDDLE_ACTIVE 352 -#define IMG_CONVEYOR_BELT_3_LEFT 353 -#define IMG_CONVEYOR_BELT_3_LEFT_ACTIVE 354 -#define IMG_CONVEYOR_BELT_3_RIGHT 355 -#define IMG_CONVEYOR_BELT_3_RIGHT_ACTIVE 356 -#define IMG_CONVEYOR_BELT_3_SWITCH_LEFT 357 -#define IMG_CONVEYOR_BELT_3_SWITCH_MIDDLE 358 -#define IMG_CONVEYOR_BELT_3_SWITCH_RIGHT 359 -#define IMG_CONVEYOR_BELT_4_MIDDLE 360 -#define IMG_CONVEYOR_BELT_4_MIDDLE_ACTIVE 361 -#define IMG_CONVEYOR_BELT_4_LEFT 362 -#define IMG_CONVEYOR_BELT_4_LEFT_ACTIVE 363 -#define IMG_CONVEYOR_BELT_4_RIGHT 364 -#define IMG_CONVEYOR_BELT_4_RIGHT_ACTIVE 365 -#define IMG_CONVEYOR_BELT_4_SWITCH_LEFT 366 -#define IMG_CONVEYOR_BELT_4_SWITCH_MIDDLE 367 -#define IMG_CONVEYOR_BELT_4_SWITCH_RIGHT 368 -#define IMG_SWITCHGATE_SWITCH_UP 369 -#define IMG_SWITCHGATE_SWITCH_DOWN 370 -#define IMG_LIGHT_SWITCH 371 -#define IMG_LIGHT_SWITCH_ACTIVE 372 -#define IMG_TIMEGATE_SWITCH 373 -#define IMG_TIMEGATE_SWITCH_ACTIVE 374 -#define IMG_ENVELOPE_1 375 -#define IMG_ENVELOPE_1_COLLECTING 376 -#define IMG_ENVELOPE_2 377 -#define IMG_ENVELOPE_2_COLLECTING 378 -#define IMG_ENVELOPE_3 379 -#define IMG_ENVELOPE_3_COLLECTING 380 -#define IMG_ENVELOPE_4 381 -#define IMG_ENVELOPE_4_COLLECTING 382 -#define IMG_SIGN_EXCLAMATION 383 -#define IMG_SIGN_STOP 384 -#define IMG_LANDMINE 385 -#define IMG_STEELWALL_SLIPPERY 386 -#define IMG_EXTRA_TIME 387 -#define IMG_SHIELD_NORMAL 388 -#define IMG_SHIELD_NORMAL_ACTIVE 389 -#define IMG_SHIELD_DEADLY 390 -#define IMG_SHIELD_DEADLY_ACTIVE 391 -#define IMG_SWITCHGATE_CLOSED 392 -#define IMG_SWITCHGATE_OPENING 393 -#define IMG_SWITCHGATE_OPEN 394 -#define IMG_SWITCHGATE_CLOSING 395 -#define IMG_TIMEGATE_CLOSED 396 -#define IMG_TIMEGATE_OPENING 397 -#define IMG_TIMEGATE_OPEN 398 -#define IMG_TIMEGATE_CLOSING 399 -#define IMG_PEARL 400 -#define IMG_PEARL_BREAKING 401 -#define IMG_CRYSTAL 402 -#define IMG_WALL_PEARL 403 -#define IMG_WALL_CRYSTAL 404 -#define IMG_TUBE_RIGHT_DOWN 405 -#define IMG_TUBE_HORIZONTAL_DOWN 406 -#define IMG_TUBE_LEFT_DOWN 407 -#define IMG_TUBE_HORIZONTAL 408 -#define IMG_TUBE_VERTICAL_RIGHT 409 -#define IMG_TUBE_ANY 410 -#define IMG_TUBE_VERTICAL_LEFT 411 -#define IMG_TUBE_VERTICAL 412 -#define IMG_TUBE_RIGHT_UP 413 -#define IMG_TUBE_HORIZONTAL_UP 414 -#define IMG_TUBE_LEFT_UP 415 -#define IMG_TRAP 416 -#define IMG_TRAP_ACTIVE 417 -#define IMG_DX_SUPABOMB 418 -#define IMG_KEY_1 419 -#define IMG_KEY_1_EDITOR 420 -#define IMG_KEY_2 421 -#define IMG_KEY_2_EDITOR 422 -#define IMG_KEY_3 423 -#define IMG_KEY_3_EDITOR 424 -#define IMG_KEY_4 425 -#define IMG_KEY_4_EDITOR 426 -#define IMG_GATE_1 427 -#define IMG_GATE_2 428 -#define IMG_GATE_3 429 -#define IMG_GATE_4 430 -#define IMG_GATE_1_GRAY 431 -#define IMG_GATE_1_GRAY_EDITOR 432 -#define IMG_GATE_1_GRAY_ACTIVE 433 -#define IMG_GATE_2_GRAY 434 -#define IMG_GATE_2_GRAY_EDITOR 435 -#define IMG_GATE_2_GRAY_ACTIVE 436 -#define IMG_GATE_3_GRAY 437 -#define IMG_GATE_3_GRAY_EDITOR 438 -#define IMG_GATE_3_GRAY_ACTIVE 439 -#define IMG_GATE_4_GRAY 440 -#define IMG_GATE_4_GRAY_EDITOR 441 -#define IMG_GATE_4_GRAY_ACTIVE 442 -#define IMG_GAME_OF_LIFE 443 -#define IMG_BIOMAZE 444 -#define IMG_PACMAN 445 -#define IMG_PACMAN_RIGHT 446 -#define IMG_PACMAN_UP 447 -#define IMG_PACMAN_LEFT 448 -#define IMG_PACMAN_DOWN 449 -#define IMG_PACMAN_TURNING_FROM_RIGHT 450 -#define IMG_PACMAN_TURNING_FROM_UP 451 -#define IMG_PACMAN_TURNING_FROM_LEFT 452 -#define IMG_PACMAN_TURNING_FROM_DOWN 453 -#define IMG_LAMP 454 -#define IMG_LAMP_EDITOR 455 -#define IMG_LAMP_ACTIVE 456 -#define IMG_TIME_ORB_FULL 457 -#define IMG_TIME_ORB_EMPTY 458 -#define IMG_EMERALD_YELLOW 459 -#define IMG_EMERALD_YELLOW_MOVING 460 -#define IMG_EMERALD_YELLOW_FALLING 461 -#define IMG_EMERALD_RED 462 -#define IMG_EMERALD_RED_MOVING 463 -#define IMG_EMERALD_RED_FALLING 464 -#define IMG_EMERALD_PURPLE 465 -#define IMG_EMERALD_PURPLE_MOVING 466 -#define IMG_EMERALD_PURPLE_FALLING 467 -#define IMG_WALL_EMERALD_YELLOW 468 -#define IMG_WALL_EMERALD_RED 469 -#define IMG_WALL_EMERALD_PURPLE 470 -#define IMG_WALL_BD_DIAMOND 471 -#define IMG_EXPANDABLE_WALL 472 -#define IMG_EXPANDABLE_WALL_HORIZONTAL 473 -#define IMG_EXPANDABLE_WALL_HORIZONTAL_EDITOR 474 -#define IMG_EXPANDABLE_WALL_VERTICAL 475 -#define IMG_EXPANDABLE_WALL_VERTICAL_EDITOR 476 -#define IMG_EXPANDABLE_WALL_ANY 477 -#define IMG_EXPANDABLE_WALL_ANY_EDITOR 478 -#define IMG_BD_EXPANDABLE_WALL 479 -#define IMG_BD_EXPANDABLE_WALL_EDITOR 480 -#define IMG_EXPANDABLE_WALL_GROWING_LEFT 481 -#define IMG_EXPANDABLE_WALL_GROWING_RIGHT 482 -#define IMG_EXPANDABLE_WALL_GROWING_UP 483 -#define IMG_EXPANDABLE_WALL_GROWING_DOWN 484 -#define IMG_BLACK_ORB 485 -#define IMG_SPEED_PILL 486 -#define IMG_DARK_YAMYAM 487 -#define IMG_DYNABOMB 488 -#define IMG_DYNABOMB_ACTIVE 489 -#define IMG_DYNABOMB_PLAYER_1 490 -#define IMG_DYNABOMB_PLAYER_1_ACTIVE 491 -#define IMG_DYNABOMB_PLAYER_2 492 -#define IMG_DYNABOMB_PLAYER_2_ACTIVE 493 -#define IMG_DYNABOMB_PLAYER_3 494 -#define IMG_DYNABOMB_PLAYER_3_ACTIVE 495 -#define IMG_DYNABOMB_PLAYER_4 496 -#define IMG_DYNABOMB_PLAYER_4_ACTIVE 497 -#define IMG_DYNABOMB_INCREASE_NUMBER 498 -#define IMG_DYNABOMB_INCREASE_SIZE 499 -#define IMG_DYNABOMB_INCREASE_POWER 500 -#define IMG_PIG 501 -#define IMG_PIG_DOWN 502 -#define IMG_PIG_UP 503 -#define IMG_PIG_LEFT 504 -#define IMG_PIG_RIGHT 505 -#define IMG_PIG_MOVING_DOWN 506 -#define IMG_PIG_MOVING_UP 507 -#define IMG_PIG_MOVING_LEFT 508 -#define IMG_PIG_MOVING_RIGHT 509 -#define IMG_PIG_DIGGING_DOWN 510 -#define IMG_PIG_DIGGING_UP 511 -#define IMG_PIG_DIGGING_LEFT 512 -#define IMG_PIG_DIGGING_RIGHT 513 -#define IMG_DRAGON 514 -#define IMG_DRAGON_DOWN 515 -#define IMG_DRAGON_UP 516 -#define IMG_DRAGON_LEFT 517 -#define IMG_DRAGON_RIGHT 518 -#define IMG_DRAGON_MOVING_DOWN 519 -#define IMG_DRAGON_MOVING_UP 520 -#define IMG_DRAGON_MOVING_LEFT 521 -#define IMG_DRAGON_MOVING_RIGHT 522 -#define IMG_DRAGON_ATTACKING_DOWN 523 -#define IMG_DRAGON_ATTACKING_UP 524 -#define IMG_DRAGON_ATTACKING_LEFT 525 -#define IMG_DRAGON_ATTACKING_RIGHT 526 -#define IMG_MOLE 527 -#define IMG_MOLE_DOWN 528 -#define IMG_MOLE_UP 529 -#define IMG_MOLE_LEFT 530 -#define IMG_MOLE_RIGHT 531 -#define IMG_MOLE_MOVING_DOWN 532 -#define IMG_MOLE_MOVING_UP 533 -#define IMG_MOLE_MOVING_LEFT 534 -#define IMG_MOLE_MOVING_RIGHT 535 -#define IMG_MOLE_DIGGING_DOWN 536 -#define IMG_MOLE_DIGGING_UP 537 -#define IMG_MOLE_DIGGING_LEFT 538 -#define IMG_MOLE_DIGGING_RIGHT 539 -#define IMG_PENGUIN 540 -#define IMG_PENGUIN_EDITOR 541 -#define IMG_PENGUIN_DOWN 542 -#define IMG_PENGUIN_UP 543 -#define IMG_PENGUIN_LEFT 544 -#define IMG_PENGUIN_RIGHT 545 -#define IMG_PENGUIN_MOVING_DOWN 546 -#define IMG_PENGUIN_MOVING_UP 547 -#define IMG_PENGUIN_MOVING_LEFT 548 -#define IMG_PENGUIN_MOVING_RIGHT 549 -#define IMG_SATELLITE 550 -#define IMG_FLAMES_1_LEFT 551 -#define IMG_FLAMES_2_LEFT 552 -#define IMG_FLAMES_3_LEFT 553 -#define IMG_FLAMES_1_RIGHT 554 -#define IMG_FLAMES_2_RIGHT 555 -#define IMG_FLAMES_3_RIGHT 556 -#define IMG_FLAMES_1_UP 557 -#define IMG_FLAMES_2_UP 558 -#define IMG_FLAMES_3_UP 559 -#define IMG_FLAMES_1_DOWN 560 -#define IMG_FLAMES_2_DOWN 561 -#define IMG_FLAMES_3_DOWN 562 -#define IMG_STONEBLOCK 563 -#define IMG_PLAYER_1 564 -#define IMG_PLAYER_1_EDITOR 565 -#define IMG_PLAYER_1_DOWN 566 -#define IMG_PLAYER_1_UP 567 -#define IMG_PLAYER_1_LEFT 568 -#define IMG_PLAYER_1_RIGHT 569 -#define IMG_PLAYER_1_MOVING_DOWN 570 -#define IMG_PLAYER_1_MOVING_UP 571 -#define IMG_PLAYER_1_MOVING_LEFT 572 -#define IMG_PLAYER_1_MOVING_RIGHT 573 -#define IMG_PLAYER_1_DIGGING_DOWN 574 -#define IMG_PLAYER_1_DIGGING_UP 575 -#define IMG_PLAYER_1_DIGGING_LEFT 576 -#define IMG_PLAYER_1_DIGGING_RIGHT 577 -#define IMG_PLAYER_1_COLLECTING_DOWN 578 -#define IMG_PLAYER_1_COLLECTING_UP 579 -#define IMG_PLAYER_1_COLLECTING_LEFT 580 -#define IMG_PLAYER_1_COLLECTING_RIGHT 581 -#define IMG_PLAYER_1_PUSHING_DOWN 582 -#define IMG_PLAYER_1_PUSHING_UP 583 -#define IMG_PLAYER_1_PUSHING_LEFT 584 -#define IMG_PLAYER_1_PUSHING_RIGHT 585 -#define IMG_PLAYER_1_SNAPPING_DOWN 586 -#define IMG_PLAYER_1_SNAPPING_UP 587 -#define IMG_PLAYER_1_SNAPPING_LEFT 588 -#define IMG_PLAYER_1_SNAPPING_RIGHT 589 -#define IMG_PLAYER_2 590 -#define IMG_PLAYER_2_EDITOR 591 -#define IMG_PLAYER_2_DOWN 592 -#define IMG_PLAYER_2_UP 593 -#define IMG_PLAYER_2_LEFT 594 -#define IMG_PLAYER_2_RIGHT 595 -#define IMG_PLAYER_2_MOVING_DOWN 596 -#define IMG_PLAYER_2_MOVING_UP 597 -#define IMG_PLAYER_2_MOVING_LEFT 598 -#define IMG_PLAYER_2_MOVING_RIGHT 599 -#define IMG_PLAYER_2_DIGGING_DOWN 600 -#define IMG_PLAYER_2_DIGGING_UP 601 -#define IMG_PLAYER_2_DIGGING_LEFT 602 -#define IMG_PLAYER_2_DIGGING_RIGHT 603 -#define IMG_PLAYER_2_COLLECTING_DOWN 604 -#define IMG_PLAYER_2_COLLECTING_UP 605 -#define IMG_PLAYER_2_COLLECTING_LEFT 606 -#define IMG_PLAYER_2_COLLECTING_RIGHT 607 -#define IMG_PLAYER_2_PUSHING_DOWN 608 -#define IMG_PLAYER_2_PUSHING_UP 609 -#define IMG_PLAYER_2_PUSHING_LEFT 610 -#define IMG_PLAYER_2_PUSHING_RIGHT 611 -#define IMG_PLAYER_2_SNAPPING_DOWN 612 -#define IMG_PLAYER_2_SNAPPING_UP 613 -#define IMG_PLAYER_2_SNAPPING_LEFT 614 -#define IMG_PLAYER_2_SNAPPING_RIGHT 615 -#define IMG_PLAYER_3 616 -#define IMG_PLAYER_3_EDITOR 617 -#define IMG_PLAYER_3_DOWN 618 -#define IMG_PLAYER_3_UP 619 -#define IMG_PLAYER_3_LEFT 620 -#define IMG_PLAYER_3_RIGHT 621 -#define IMG_PLAYER_3_MOVING_DOWN 622 -#define IMG_PLAYER_3_MOVING_UP 623 -#define IMG_PLAYER_3_MOVING_LEFT 624 -#define IMG_PLAYER_3_MOVING_RIGHT 625 -#define IMG_PLAYER_3_DIGGING_DOWN 626 -#define IMG_PLAYER_3_DIGGING_UP 627 -#define IMG_PLAYER_3_DIGGING_LEFT 628 -#define IMG_PLAYER_3_DIGGING_RIGHT 629 -#define IMG_PLAYER_3_COLLECTING_DOWN 630 -#define IMG_PLAYER_3_COLLECTING_UP 631 -#define IMG_PLAYER_3_COLLECTING_LEFT 632 -#define IMG_PLAYER_3_COLLECTING_RIGHT 633 -#define IMG_PLAYER_3_PUSHING_DOWN 634 -#define IMG_PLAYER_3_PUSHING_UP 635 -#define IMG_PLAYER_3_PUSHING_LEFT 636 -#define IMG_PLAYER_3_PUSHING_RIGHT 637 -#define IMG_PLAYER_3_SNAPPING_DOWN 638 -#define IMG_PLAYER_3_SNAPPING_UP 639 -#define IMG_PLAYER_3_SNAPPING_LEFT 640 -#define IMG_PLAYER_3_SNAPPING_RIGHT 641 -#define IMG_PLAYER_4 642 -#define IMG_PLAYER_4_EDITOR 643 -#define IMG_PLAYER_4_DOWN 644 -#define IMG_PLAYER_4_UP 645 -#define IMG_PLAYER_4_LEFT 646 -#define IMG_PLAYER_4_RIGHT 647 -#define IMG_PLAYER_4_MOVING_DOWN 648 -#define IMG_PLAYER_4_MOVING_UP 649 -#define IMG_PLAYER_4_MOVING_LEFT 650 -#define IMG_PLAYER_4_MOVING_RIGHT 651 -#define IMG_PLAYER_4_DIGGING_DOWN 652 -#define IMG_PLAYER_4_DIGGING_UP 653 -#define IMG_PLAYER_4_DIGGING_LEFT 654 -#define IMG_PLAYER_4_DIGGING_RIGHT 655 -#define IMG_PLAYER_4_COLLECTING_DOWN 656 -#define IMG_PLAYER_4_COLLECTING_UP 657 -#define IMG_PLAYER_4_COLLECTING_LEFT 658 -#define IMG_PLAYER_4_COLLECTING_RIGHT 659 -#define IMG_PLAYER_4_PUSHING_DOWN 660 -#define IMG_PLAYER_4_PUSHING_UP 661 -#define IMG_PLAYER_4_PUSHING_LEFT 662 -#define IMG_PLAYER_4_PUSHING_RIGHT 663 -#define IMG_PLAYER_4_SNAPPING_DOWN 664 -#define IMG_PLAYER_4_SNAPPING_UP 665 -#define IMG_PLAYER_4_SNAPPING_LEFT 666 -#define IMG_PLAYER_4_SNAPPING_RIGHT 667 -#define IMG_DEFAULT_EXPLODING 668 -#define IMG_TWINKLE_BLUE 669 -#define IMG_TWINKLE_WHITE 670 -#define IMG_STEELWALL_TOPLEFT 671 -#define IMG_STEELWALL_TOPRIGHT 672 -#define IMG_STEELWALL_BOTTOMLEFT 673 -#define IMG_STEELWALL_BOTTOMRIGHT 674 -#define IMG_STEELWALL_HORIZONTAL 675 -#define IMG_STEELWALL_VERTICAL 676 -#define IMG_STEELWALL_TOPLEFT_EDITOR 677 -#define IMG_STEELWALL_TOPRIGHT_EDITOR 678 -#define IMG_STEELWALL_BOTTOMLEFT_EDITOR 679 -#define IMG_STEELWALL_BOTTOMRIGHT_EDITOR 680 -#define IMG_STEELWALL_HORIZONTAL_EDITOR 681 -#define IMG_STEELWALL_VERTICAL_EDITOR 682 -#define IMG_INVISIBLE_STEELWALL_TOPLEFT 683 -#define IMG_INVISIBLE_STEELWALL_TOPRIGHT 684 -#define IMG_INVISIBLE_STEELWALL_BOTTOMLEFT 685 -#define IMG_INVISIBLE_STEELWALL_BOTTOMRIGHT 686 -#define IMG_INVISIBLE_STEELWALL_HORIZONTAL 687 -#define IMG_INVISIBLE_STEELWALL_VERTICAL 688 -#define IMG_INVISIBLE_STEELWALL_TOPLEFT_EDITOR 689 -#define IMG_INVISIBLE_STEELWALL_TOPRIGHT_EDITOR 690 -#define IMG_INVISIBLE_STEELWALL_BOTTOMLEFT_EDITOR 691 -#define IMG_INVISIBLE_STEELWALL_BOTTOMRIGHT_EDITOR 692 -#define IMG_INVISIBLE_STEELWALL_HORIZONTAL_EDITOR 693 -#define IMG_INVISIBLE_STEELWALL_VERTICAL_EDITOR 694 -#define IMG_ARROW_LEFT 695 -#define IMG_ARROW_RIGHT 696 -#define IMG_ARROW_UP 697 -#define IMG_ARROW_DOWN 698 -#define IMG_UNKNOWN 699 -#define IMG_TRIGGER_ELEMENT 700 -#define IMG_TRIGGER_PLAYER 701 -#define IMG_TRIGGER_CE_VALUE 702 -#define IMG_TRIGGER_CE_SCORE 703 -#define IMG_CURRENT_CE_VALUE 704 -#define IMG_CURRENT_CE_SCORE 705 -#define IMG_PREV_CE_1 706 -#define IMG_PREV_CE_2 707 -#define IMG_PREV_CE_3 708 -#define IMG_PREV_CE_4 709 -#define IMG_PREV_CE_5 710 -#define IMG_PREV_CE_6 711 -#define IMG_PREV_CE_7 712 -#define IMG_PREV_CE_8 713 -#define IMG_NEXT_CE_1 714 -#define IMG_NEXT_CE_2 715 -#define IMG_NEXT_CE_3 716 -#define IMG_NEXT_CE_4 717 -#define IMG_NEXT_CE_5 718 -#define IMG_NEXT_CE_6 719 -#define IMG_NEXT_CE_7 720 -#define IMG_NEXT_CE_8 721 -#define IMG_SELF 722 -#define IMG_ANY_ELEMENT 723 -#define IMG_EMC_KEY_5 724 -#define IMG_EMC_KEY_6 725 -#define IMG_EMC_KEY_7 726 -#define IMG_EMC_KEY_8 727 -#define IMG_EMC_GATE_5 728 -#define IMG_EMC_GATE_6 729 -#define IMG_EMC_GATE_7 730 -#define IMG_EMC_GATE_8 731 -#define IMG_EMC_GATE_5_GRAY 732 -#define IMG_EMC_GATE_5_GRAY_EDITOR 733 -#define IMG_EMC_GATE_5_GRAY_ACTIVE 734 -#define IMG_EMC_GATE_6_GRAY 735 -#define IMG_EMC_GATE_6_GRAY_EDITOR 736 -#define IMG_EMC_GATE_6_GRAY_ACTIVE 737 -#define IMG_EMC_GATE_7_GRAY 738 -#define IMG_EMC_GATE_7_GRAY_EDITOR 739 -#define IMG_EMC_GATE_7_GRAY_ACTIVE 740 -#define IMG_EMC_GATE_8_GRAY 741 -#define IMG_EMC_GATE_8_GRAY_EDITOR 742 -#define IMG_EMC_GATE_8_GRAY_ACTIVE 743 -#define IMG_EMC_ANDROID 744 -#define IMG_EMC_ANDROID_SHRINKING_UPLEFT 745 -#define IMG_EMC_ANDROID_GROWING_DOWNRIGHT 746 -#define IMG_EMC_ANDROID_SHRINKING_DOWNLEFT 747 -#define IMG_EMC_ANDROID_GROWING_UPRIGHT 748 -#define IMG_EMC_ANDROID_SHRINKING_UPRIGHT 749 -#define IMG_EMC_ANDROID_GROWING_DOWNLEFT 750 -#define IMG_EMC_ANDROID_SHRINKING_DOWNRIGHT 751 -#define IMG_EMC_ANDROID_GROWING_UPLEFT 752 -#define IMG_EMC_GRASS 753 -#define IMG_EMC_GRASS_CRUMBLED 754 -#define IMG_EMC_GRASS_DIGGING_LEFT 755 -#define IMG_EMC_GRASS_DIGGING_RIGHT 756 -#define IMG_EMC_GRASS_DIGGING_UP 757 -#define IMG_EMC_GRASS_DIGGING_DOWN 758 -#define IMG_EMC_GRASS_DIGGING_LEFT_CRUMBLED 759 -#define IMG_EMC_GRASS_DIGGING_RIGHT_CRUMBLED 760 -#define IMG_EMC_GRASS_DIGGING_UP_CRUMBLED 761 -#define IMG_EMC_GRASS_DIGGING_DOWN_CRUMBLED 762 -#define IMG_EMC_MAGIC_BALL 763 -#define IMG_EMC_MAGIC_BALL_ACTIVE 764 -#define IMG_EMC_MAGIC_BALL_DROPPING 765 -#define IMG_EMC_MAGIC_BALL_SWITCH 766 -#define IMG_EMC_MAGIC_BALL_SWITCH_ACTIVE 767 -#define IMG_EMC_SPRING_BUMPER 768 -#define IMG_EMC_SPRING_BUMPER_ACTIVE 769 -#define IMG_EMC_PLANT 770 -#define IMG_EMC_PLANT_CRUMBLED 771 -#define IMG_EMC_LENSES 772 -#define IMG_EMC_MAGNIFIER 773 -#define IMG_EMC_WALL_9 774 -#define IMG_EMC_WALL_10 775 -#define IMG_EMC_WALL_11 776 -#define IMG_EMC_WALL_12 777 -#define IMG_EMC_WALL_13 778 -#define IMG_EMC_WALL_14 779 -#define IMG_EMC_WALL_15 780 -#define IMG_EMC_WALL_16 781 -#define IMG_EMC_WALL_SLIPPERY_1 782 -#define IMG_EMC_WALL_SLIPPERY_2 783 -#define IMG_EMC_WALL_SLIPPERY_3 784 -#define IMG_EMC_WALL_SLIPPERY_4 785 -#define IMG_EMC_FAKE_GRASS 786 -#define IMG_EMC_FAKE_GRASS_CRUMBLED 787 -#define IMG_EMC_FAKE_GRASS_ACTIVE 788 -#define IMG_EMC_FAKE_GRASS_ACTIVE_CRUMBLED 789 -#define IMG_EMC_FAKE_GRASS_EDITOR 790 -#define IMG_EMC_FAKE_ACID 791 -#define IMG_EMC_DRIPPER 792 -#define IMG_EMC_DRIPPER_EDITOR 793 -#define IMG_EMC_DRIPPER_ACTIVE 794 -#define IMG_CHAR_SPACE 795 -#define IMG_CHAR_SPACE_EDITOR 796 -#define IMG_CHAR_EXCLAM 797 -#define IMG_CHAR_QUOTEDBL 798 -#define IMG_CHAR_NUMBERSIGN 799 -#define IMG_CHAR_DOLLAR 800 -#define IMG_CHAR_PERCENT 801 -#define IMG_CHAR_AMPERSAND 802 -#define IMG_CHAR_APOSTROPHE 803 -#define IMG_CHAR_PARENLEFT 804 -#define IMG_CHAR_PARENRIGHT 805 -#define IMG_CHAR_ASTERISK 806 -#define IMG_CHAR_PLUS 807 -#define IMG_CHAR_COMMA 808 -#define IMG_CHAR_MINUS 809 -#define IMG_CHAR_PERIOD 810 -#define IMG_CHAR_SLASH 811 -#define IMG_CHAR_0 812 -#define IMG_CHAR_1 813 -#define IMG_CHAR_2 814 -#define IMG_CHAR_3 815 -#define IMG_CHAR_4 816 -#define IMG_CHAR_5 817 -#define IMG_CHAR_6 818 -#define IMG_CHAR_7 819 -#define IMG_CHAR_8 820 -#define IMG_CHAR_9 821 -#define IMG_CHAR_COLON 822 -#define IMG_CHAR_SEMICOLON 823 -#define IMG_CHAR_LESS 824 -#define IMG_CHAR_EQUAL 825 -#define IMG_CHAR_GREATER 826 -#define IMG_CHAR_QUESTION 827 -#define IMG_CHAR_AT 828 -#define IMG_CHAR_A 829 -#define IMG_CHAR_B 830 -#define IMG_CHAR_C 831 -#define IMG_CHAR_D 832 -#define IMG_CHAR_E 833 -#define IMG_CHAR_F 834 -#define IMG_CHAR_G 835 -#define IMG_CHAR_H 836 -#define IMG_CHAR_I 837 -#define IMG_CHAR_J 838 -#define IMG_CHAR_K 839 -#define IMG_CHAR_L 840 -#define IMG_CHAR_M 841 -#define IMG_CHAR_N 842 -#define IMG_CHAR_O 843 -#define IMG_CHAR_P 844 -#define IMG_CHAR_Q 845 -#define IMG_CHAR_R 846 -#define IMG_CHAR_S 847 -#define IMG_CHAR_T 848 -#define IMG_CHAR_U 849 -#define IMG_CHAR_V 850 -#define IMG_CHAR_W 851 -#define IMG_CHAR_X 852 -#define IMG_CHAR_Y 853 -#define IMG_CHAR_Z 854 -#define IMG_CHAR_BRACKETLEFT 855 -#define IMG_CHAR_BACKSLASH 856 -#define IMG_CHAR_BRACKETRIGHT 857 -#define IMG_CHAR_ASCIICIRCUM 858 -#define IMG_CHAR_UNDERSCORE 859 -#define IMG_CHAR_COPYRIGHT 860 -#define IMG_CHAR_AUMLAUT 861 -#define IMG_CHAR_OUMLAUT 862 -#define IMG_CHAR_UUMLAUT 863 -#define IMG_CHAR_DEGREE 864 -#define IMG_CHAR_TRADEMARK 865 -#define IMG_CHAR_CURSOR 866 -#define IMG_CUSTOM_1 867 -#define IMG_CUSTOM_1_EDITOR 868 -#define IMG_CUSTOM_2 869 -#define IMG_CUSTOM_2_EDITOR 870 -#define IMG_CUSTOM_3 871 -#define IMG_CUSTOM_3_EDITOR 872 -#define IMG_CUSTOM_4 873 -#define IMG_CUSTOM_4_EDITOR 874 -#define IMG_CUSTOM_5 875 -#define IMG_CUSTOM_5_EDITOR 876 -#define IMG_CUSTOM_6 877 -#define IMG_CUSTOM_6_EDITOR 878 -#define IMG_CUSTOM_7 879 -#define IMG_CUSTOM_7_EDITOR 880 -#define IMG_CUSTOM_8 881 -#define IMG_CUSTOM_8_EDITOR 882 -#define IMG_CUSTOM_9 883 -#define IMG_CUSTOM_9_EDITOR 884 -#define IMG_CUSTOM_10 885 -#define IMG_CUSTOM_10_EDITOR 886 -#define IMG_CUSTOM_11 887 -#define IMG_CUSTOM_11_EDITOR 888 -#define IMG_CUSTOM_12 889 -#define IMG_CUSTOM_12_EDITOR 890 -#define IMG_CUSTOM_13 891 -#define IMG_CUSTOM_13_EDITOR 892 -#define IMG_CUSTOM_14 893 -#define IMG_CUSTOM_14_EDITOR 894 -#define IMG_CUSTOM_15 895 -#define IMG_CUSTOM_15_EDITOR 896 -#define IMG_CUSTOM_16 897 -#define IMG_CUSTOM_16_EDITOR 898 -#define IMG_CUSTOM_17 899 -#define IMG_CUSTOM_17_EDITOR 900 -#define IMG_CUSTOM_18 901 -#define IMG_CUSTOM_18_EDITOR 902 -#define IMG_CUSTOM_19 903 -#define IMG_CUSTOM_19_EDITOR 904 -#define IMG_CUSTOM_20 905 -#define IMG_CUSTOM_20_EDITOR 906 -#define IMG_CUSTOM_21 907 -#define IMG_CUSTOM_21_EDITOR 908 -#define IMG_CUSTOM_22 909 -#define IMG_CUSTOM_22_EDITOR 910 -#define IMG_CUSTOM_23 911 -#define IMG_CUSTOM_23_EDITOR 912 -#define IMG_CUSTOM_24 913 -#define IMG_CUSTOM_24_EDITOR 914 -#define IMG_CUSTOM_25 915 -#define IMG_CUSTOM_25_EDITOR 916 -#define IMG_CUSTOM_26 917 -#define IMG_CUSTOM_26_EDITOR 918 -#define IMG_CUSTOM_27 919 -#define IMG_CUSTOM_27_EDITOR 920 -#define IMG_CUSTOM_28 921 -#define IMG_CUSTOM_28_EDITOR 922 -#define IMG_CUSTOM_29 923 -#define IMG_CUSTOM_29_EDITOR 924 -#define IMG_CUSTOM_30 925 -#define IMG_CUSTOM_30_EDITOR 926 -#define IMG_CUSTOM_31 927 -#define IMG_CUSTOM_31_EDITOR 928 -#define IMG_CUSTOM_32 929 -#define IMG_CUSTOM_32_EDITOR 930 -#define IMG_CUSTOM_33 931 -#define IMG_CUSTOM_33_EDITOR 932 -#define IMG_CUSTOM_34 933 -#define IMG_CUSTOM_34_EDITOR 934 -#define IMG_CUSTOM_35 935 -#define IMG_CUSTOM_35_EDITOR 936 -#define IMG_CUSTOM_36 937 -#define IMG_CUSTOM_36_EDITOR 938 -#define IMG_CUSTOM_37 939 -#define IMG_CUSTOM_37_EDITOR 940 -#define IMG_CUSTOM_38 941 -#define IMG_CUSTOM_38_EDITOR 942 -#define IMG_CUSTOM_39 943 -#define IMG_CUSTOM_39_EDITOR 944 -#define IMG_CUSTOM_40 945 -#define IMG_CUSTOM_40_EDITOR 946 -#define IMG_CUSTOM_41 947 -#define IMG_CUSTOM_41_EDITOR 948 -#define IMG_CUSTOM_42 949 -#define IMG_CUSTOM_42_EDITOR 950 -#define IMG_CUSTOM_43 951 -#define IMG_CUSTOM_43_EDITOR 952 -#define IMG_CUSTOM_44 953 -#define IMG_CUSTOM_44_EDITOR 954 -#define IMG_CUSTOM_45 955 -#define IMG_CUSTOM_45_EDITOR 956 -#define IMG_CUSTOM_46 957 -#define IMG_CUSTOM_46_EDITOR 958 -#define IMG_CUSTOM_47 959 -#define IMG_CUSTOM_47_EDITOR 960 -#define IMG_CUSTOM_48 961 -#define IMG_CUSTOM_48_EDITOR 962 -#define IMG_CUSTOM_49 963 -#define IMG_CUSTOM_49_EDITOR 964 -#define IMG_CUSTOM_50 965 -#define IMG_CUSTOM_50_EDITOR 966 -#define IMG_CUSTOM_51 967 -#define IMG_CUSTOM_51_EDITOR 968 -#define IMG_CUSTOM_52 969 -#define IMG_CUSTOM_52_EDITOR 970 -#define IMG_CUSTOM_53 971 -#define IMG_CUSTOM_53_EDITOR 972 -#define IMG_CUSTOM_54 973 -#define IMG_CUSTOM_54_EDITOR 974 -#define IMG_CUSTOM_55 975 -#define IMG_CUSTOM_55_EDITOR 976 -#define IMG_CUSTOM_56 977 -#define IMG_CUSTOM_56_EDITOR 978 -#define IMG_CUSTOM_57 979 -#define IMG_CUSTOM_57_EDITOR 980 -#define IMG_CUSTOM_58 981 -#define IMG_CUSTOM_58_EDITOR 982 -#define IMG_CUSTOM_59 983 -#define IMG_CUSTOM_59_EDITOR 984 -#define IMG_CUSTOM_60 985 -#define IMG_CUSTOM_60_EDITOR 986 -#define IMG_CUSTOM_61 987 -#define IMG_CUSTOM_61_EDITOR 988 -#define IMG_CUSTOM_62 989 -#define IMG_CUSTOM_62_EDITOR 990 -#define IMG_CUSTOM_63 991 -#define IMG_CUSTOM_63_EDITOR 992 -#define IMG_CUSTOM_64 993 -#define IMG_CUSTOM_64_EDITOR 994 -#define IMG_CUSTOM_65 995 -#define IMG_CUSTOM_65_EDITOR 996 -#define IMG_CUSTOM_66 997 -#define IMG_CUSTOM_66_EDITOR 998 -#define IMG_CUSTOM_67 999 -#define IMG_CUSTOM_67_EDITOR 1000 -#define IMG_CUSTOM_68 1001 -#define IMG_CUSTOM_68_EDITOR 1002 -#define IMG_CUSTOM_69 1003 -#define IMG_CUSTOM_69_EDITOR 1004 -#define IMG_CUSTOM_70 1005 -#define IMG_CUSTOM_70_EDITOR 1006 -#define IMG_CUSTOM_71 1007 -#define IMG_CUSTOM_71_EDITOR 1008 -#define IMG_CUSTOM_72 1009 -#define IMG_CUSTOM_72_EDITOR 1010 -#define IMG_CUSTOM_73 1011 -#define IMG_CUSTOM_73_EDITOR 1012 -#define IMG_CUSTOM_74 1013 -#define IMG_CUSTOM_74_EDITOR 1014 -#define IMG_CUSTOM_75 1015 -#define IMG_CUSTOM_75_EDITOR 1016 -#define IMG_CUSTOM_76 1017 -#define IMG_CUSTOM_76_EDITOR 1018 -#define IMG_CUSTOM_77 1019 -#define IMG_CUSTOM_77_EDITOR 1020 -#define IMG_CUSTOM_78 1021 -#define IMG_CUSTOM_78_EDITOR 1022 -#define IMG_CUSTOM_79 1023 -#define IMG_CUSTOM_79_EDITOR 1024 -#define IMG_CUSTOM_80 1025 -#define IMG_CUSTOM_80_EDITOR 1026 -#define IMG_CUSTOM_81 1027 -#define IMG_CUSTOM_81_EDITOR 1028 -#define IMG_CUSTOM_82 1029 -#define IMG_CUSTOM_82_EDITOR 1030 -#define IMG_CUSTOM_83 1031 -#define IMG_CUSTOM_83_EDITOR 1032 -#define IMG_CUSTOM_84 1033 -#define IMG_CUSTOM_84_EDITOR 1034 -#define IMG_CUSTOM_85 1035 -#define IMG_CUSTOM_85_EDITOR 1036 -#define IMG_CUSTOM_86 1037 -#define IMG_CUSTOM_86_EDITOR 1038 -#define IMG_CUSTOM_87 1039 -#define IMG_CUSTOM_87_EDITOR 1040 -#define IMG_CUSTOM_88 1041 -#define IMG_CUSTOM_88_EDITOR 1042 -#define IMG_CUSTOM_89 1043 -#define IMG_CUSTOM_89_EDITOR 1044 -#define IMG_CUSTOM_90 1045 -#define IMG_CUSTOM_90_EDITOR 1046 -#define IMG_CUSTOM_91 1047 -#define IMG_CUSTOM_91_EDITOR 1048 -#define IMG_CUSTOM_92 1049 -#define IMG_CUSTOM_92_EDITOR 1050 -#define IMG_CUSTOM_93 1051 -#define IMG_CUSTOM_93_EDITOR 1052 -#define IMG_CUSTOM_94 1053 -#define IMG_CUSTOM_94_EDITOR 1054 -#define IMG_CUSTOM_95 1055 -#define IMG_CUSTOM_95_EDITOR 1056 -#define IMG_CUSTOM_96 1057 -#define IMG_CUSTOM_96_EDITOR 1058 -#define IMG_CUSTOM_97 1059 -#define IMG_CUSTOM_97_EDITOR 1060 -#define IMG_CUSTOM_98 1061 -#define IMG_CUSTOM_98_EDITOR 1062 -#define IMG_CUSTOM_99 1063 -#define IMG_CUSTOM_99_EDITOR 1064 -#define IMG_CUSTOM_100 1065 -#define IMG_CUSTOM_100_EDITOR 1066 -#define IMG_CUSTOM_101 1067 -#define IMG_CUSTOM_101_EDITOR 1068 -#define IMG_CUSTOM_102 1069 -#define IMG_CUSTOM_102_EDITOR 1070 -#define IMG_CUSTOM_103 1071 -#define IMG_CUSTOM_103_EDITOR 1072 -#define IMG_CUSTOM_104 1073 -#define IMG_CUSTOM_104_EDITOR 1074 -#define IMG_CUSTOM_105 1075 -#define IMG_CUSTOM_105_EDITOR 1076 -#define IMG_CUSTOM_106 1077 -#define IMG_CUSTOM_106_EDITOR 1078 -#define IMG_CUSTOM_107 1079 -#define IMG_CUSTOM_107_EDITOR 1080 -#define IMG_CUSTOM_108 1081 -#define IMG_CUSTOM_108_EDITOR 1082 -#define IMG_CUSTOM_109 1083 -#define IMG_CUSTOM_109_EDITOR 1084 -#define IMG_CUSTOM_110 1085 -#define IMG_CUSTOM_110_EDITOR 1086 -#define IMG_CUSTOM_111 1087 -#define IMG_CUSTOM_111_EDITOR 1088 -#define IMG_CUSTOM_112 1089 -#define IMG_CUSTOM_112_EDITOR 1090 -#define IMG_CUSTOM_113 1091 -#define IMG_CUSTOM_113_EDITOR 1092 -#define IMG_CUSTOM_114 1093 -#define IMG_CUSTOM_114_EDITOR 1094 -#define IMG_CUSTOM_115 1095 -#define IMG_CUSTOM_115_EDITOR 1096 -#define IMG_CUSTOM_116 1097 -#define IMG_CUSTOM_116_EDITOR 1098 -#define IMG_CUSTOM_117 1099 -#define IMG_CUSTOM_117_EDITOR 1100 -#define IMG_CUSTOM_118 1101 -#define IMG_CUSTOM_118_EDITOR 1102 -#define IMG_CUSTOM_119 1103 -#define IMG_CUSTOM_119_EDITOR 1104 -#define IMG_CUSTOM_120 1105 -#define IMG_CUSTOM_120_EDITOR 1106 -#define IMG_CUSTOM_121 1107 -#define IMG_CUSTOM_121_EDITOR 1108 -#define IMG_CUSTOM_122 1109 -#define IMG_CUSTOM_122_EDITOR 1110 -#define IMG_CUSTOM_123 1111 -#define IMG_CUSTOM_123_EDITOR 1112 -#define IMG_CUSTOM_124 1113 -#define IMG_CUSTOM_124_EDITOR 1114 -#define IMG_CUSTOM_125 1115 -#define IMG_CUSTOM_125_EDITOR 1116 -#define IMG_CUSTOM_126 1117 -#define IMG_CUSTOM_126_EDITOR 1118 -#define IMG_CUSTOM_127 1119 -#define IMG_CUSTOM_127_EDITOR 1120 -#define IMG_CUSTOM_128 1121 -#define IMG_CUSTOM_128_EDITOR 1122 -#define IMG_CUSTOM_129 1123 -#define IMG_CUSTOM_129_EDITOR 1124 -#define IMG_CUSTOM_130 1125 -#define IMG_CUSTOM_130_EDITOR 1126 -#define IMG_CUSTOM_131 1127 -#define IMG_CUSTOM_131_EDITOR 1128 -#define IMG_CUSTOM_132 1129 -#define IMG_CUSTOM_132_EDITOR 1130 -#define IMG_CUSTOM_133 1131 -#define IMG_CUSTOM_133_EDITOR 1132 -#define IMG_CUSTOM_134 1133 -#define IMG_CUSTOM_134_EDITOR 1134 -#define IMG_CUSTOM_135 1135 -#define IMG_CUSTOM_135_EDITOR 1136 -#define IMG_CUSTOM_136 1137 -#define IMG_CUSTOM_136_EDITOR 1138 -#define IMG_CUSTOM_137 1139 -#define IMG_CUSTOM_137_EDITOR 1140 -#define IMG_CUSTOM_138 1141 -#define IMG_CUSTOM_138_EDITOR 1142 -#define IMG_CUSTOM_139 1143 -#define IMG_CUSTOM_139_EDITOR 1144 -#define IMG_CUSTOM_140 1145 -#define IMG_CUSTOM_140_EDITOR 1146 -#define IMG_CUSTOM_141 1147 -#define IMG_CUSTOM_141_EDITOR 1148 -#define IMG_CUSTOM_142 1149 -#define IMG_CUSTOM_142_EDITOR 1150 -#define IMG_CUSTOM_143 1151 -#define IMG_CUSTOM_143_EDITOR 1152 -#define IMG_CUSTOM_144 1153 -#define IMG_CUSTOM_144_EDITOR 1154 -#define IMG_CUSTOM_145 1155 -#define IMG_CUSTOM_145_EDITOR 1156 -#define IMG_CUSTOM_146 1157 -#define IMG_CUSTOM_146_EDITOR 1158 -#define IMG_CUSTOM_147 1159 -#define IMG_CUSTOM_147_EDITOR 1160 -#define IMG_CUSTOM_148 1161 -#define IMG_CUSTOM_148_EDITOR 1162 -#define IMG_CUSTOM_149 1163 -#define IMG_CUSTOM_149_EDITOR 1164 -#define IMG_CUSTOM_150 1165 -#define IMG_CUSTOM_150_EDITOR 1166 -#define IMG_CUSTOM_151 1167 -#define IMG_CUSTOM_151_EDITOR 1168 -#define IMG_CUSTOM_152 1169 -#define IMG_CUSTOM_152_EDITOR 1170 -#define IMG_CUSTOM_153 1171 -#define IMG_CUSTOM_153_EDITOR 1172 -#define IMG_CUSTOM_154 1173 -#define IMG_CUSTOM_154_EDITOR 1174 -#define IMG_CUSTOM_155 1175 -#define IMG_CUSTOM_155_EDITOR 1176 -#define IMG_CUSTOM_156 1177 -#define IMG_CUSTOM_156_EDITOR 1178 -#define IMG_CUSTOM_157 1179 -#define IMG_CUSTOM_157_EDITOR 1180 -#define IMG_CUSTOM_158 1181 -#define IMG_CUSTOM_158_EDITOR 1182 -#define IMG_CUSTOM_159 1183 -#define IMG_CUSTOM_159_EDITOR 1184 -#define IMG_CUSTOM_160 1185 -#define IMG_CUSTOM_160_EDITOR 1186 -#define IMG_CUSTOM_161 1187 -#define IMG_CUSTOM_161_EDITOR 1188 -#define IMG_CUSTOM_162 1189 -#define IMG_CUSTOM_162_EDITOR 1190 -#define IMG_CUSTOM_163 1191 -#define IMG_CUSTOM_163_EDITOR 1192 -#define IMG_CUSTOM_164 1193 -#define IMG_CUSTOM_164_EDITOR 1194 -#define IMG_CUSTOM_165 1195 -#define IMG_CUSTOM_165_EDITOR 1196 -#define IMG_CUSTOM_166 1197 -#define IMG_CUSTOM_166_EDITOR 1198 -#define IMG_CUSTOM_167 1199 -#define IMG_CUSTOM_167_EDITOR 1200 -#define IMG_CUSTOM_168 1201 -#define IMG_CUSTOM_168_EDITOR 1202 -#define IMG_CUSTOM_169 1203 -#define IMG_CUSTOM_169_EDITOR 1204 -#define IMG_CUSTOM_170 1205 -#define IMG_CUSTOM_170_EDITOR 1206 -#define IMG_CUSTOM_171 1207 -#define IMG_CUSTOM_171_EDITOR 1208 -#define IMG_CUSTOM_172 1209 -#define IMG_CUSTOM_172_EDITOR 1210 -#define IMG_CUSTOM_173 1211 -#define IMG_CUSTOM_173_EDITOR 1212 -#define IMG_CUSTOM_174 1213 -#define IMG_CUSTOM_174_EDITOR 1214 -#define IMG_CUSTOM_175 1215 -#define IMG_CUSTOM_175_EDITOR 1216 -#define IMG_CUSTOM_176 1217 -#define IMG_CUSTOM_176_EDITOR 1218 -#define IMG_CUSTOM_177 1219 -#define IMG_CUSTOM_177_EDITOR 1220 -#define IMG_CUSTOM_178 1221 -#define IMG_CUSTOM_178_EDITOR 1222 -#define IMG_CUSTOM_179 1223 -#define IMG_CUSTOM_179_EDITOR 1224 -#define IMG_CUSTOM_180 1225 -#define IMG_CUSTOM_180_EDITOR 1226 -#define IMG_CUSTOM_181 1227 -#define IMG_CUSTOM_181_EDITOR 1228 -#define IMG_CUSTOM_182 1229 -#define IMG_CUSTOM_182_EDITOR 1230 -#define IMG_CUSTOM_183 1231 -#define IMG_CUSTOM_183_EDITOR 1232 -#define IMG_CUSTOM_184 1233 -#define IMG_CUSTOM_184_EDITOR 1234 -#define IMG_CUSTOM_185 1235 -#define IMG_CUSTOM_185_EDITOR 1236 -#define IMG_CUSTOM_186 1237 -#define IMG_CUSTOM_186_EDITOR 1238 -#define IMG_CUSTOM_187 1239 -#define IMG_CUSTOM_187_EDITOR 1240 -#define IMG_CUSTOM_188 1241 -#define IMG_CUSTOM_188_EDITOR 1242 -#define IMG_CUSTOM_189 1243 -#define IMG_CUSTOM_189_EDITOR 1244 -#define IMG_CUSTOM_190 1245 -#define IMG_CUSTOM_190_EDITOR 1246 -#define IMG_CUSTOM_191 1247 -#define IMG_CUSTOM_191_EDITOR 1248 -#define IMG_CUSTOM_192 1249 -#define IMG_CUSTOM_192_EDITOR 1250 -#define IMG_CUSTOM_193 1251 -#define IMG_CUSTOM_193_EDITOR 1252 -#define IMG_CUSTOM_194 1253 -#define IMG_CUSTOM_194_EDITOR 1254 -#define IMG_CUSTOM_195 1255 -#define IMG_CUSTOM_195_EDITOR 1256 -#define IMG_CUSTOM_196 1257 -#define IMG_CUSTOM_196_EDITOR 1258 -#define IMG_CUSTOM_197 1259 -#define IMG_CUSTOM_197_EDITOR 1260 -#define IMG_CUSTOM_198 1261 -#define IMG_CUSTOM_198_EDITOR 1262 -#define IMG_CUSTOM_199 1263 -#define IMG_CUSTOM_199_EDITOR 1264 -#define IMG_CUSTOM_200 1265 -#define IMG_CUSTOM_200_EDITOR 1266 -#define IMG_CUSTOM_201 1267 -#define IMG_CUSTOM_201_EDITOR 1268 -#define IMG_CUSTOM_202 1269 -#define IMG_CUSTOM_202_EDITOR 1270 -#define IMG_CUSTOM_203 1271 -#define IMG_CUSTOM_203_EDITOR 1272 -#define IMG_CUSTOM_204 1273 -#define IMG_CUSTOM_204_EDITOR 1274 -#define IMG_CUSTOM_205 1275 -#define IMG_CUSTOM_205_EDITOR 1276 -#define IMG_CUSTOM_206 1277 -#define IMG_CUSTOM_206_EDITOR 1278 -#define IMG_CUSTOM_207 1279 -#define IMG_CUSTOM_207_EDITOR 1280 -#define IMG_CUSTOM_208 1281 -#define IMG_CUSTOM_208_EDITOR 1282 -#define IMG_CUSTOM_209 1283 -#define IMG_CUSTOM_209_EDITOR 1284 -#define IMG_CUSTOM_210 1285 -#define IMG_CUSTOM_210_EDITOR 1286 -#define IMG_CUSTOM_211 1287 -#define IMG_CUSTOM_211_EDITOR 1288 -#define IMG_CUSTOM_212 1289 -#define IMG_CUSTOM_212_EDITOR 1290 -#define IMG_CUSTOM_213 1291 -#define IMG_CUSTOM_213_EDITOR 1292 -#define IMG_CUSTOM_214 1293 -#define IMG_CUSTOM_214_EDITOR 1294 -#define IMG_CUSTOM_215 1295 -#define IMG_CUSTOM_215_EDITOR 1296 -#define IMG_CUSTOM_216 1297 -#define IMG_CUSTOM_216_EDITOR 1298 -#define IMG_CUSTOM_217 1299 -#define IMG_CUSTOM_217_EDITOR 1300 -#define IMG_CUSTOM_218 1301 -#define IMG_CUSTOM_218_EDITOR 1302 -#define IMG_CUSTOM_219 1303 -#define IMG_CUSTOM_219_EDITOR 1304 -#define IMG_CUSTOM_220 1305 -#define IMG_CUSTOM_220_EDITOR 1306 -#define IMG_CUSTOM_221 1307 -#define IMG_CUSTOM_221_EDITOR 1308 -#define IMG_CUSTOM_222 1309 -#define IMG_CUSTOM_222_EDITOR 1310 -#define IMG_CUSTOM_223 1311 -#define IMG_CUSTOM_223_EDITOR 1312 -#define IMG_CUSTOM_224 1313 -#define IMG_CUSTOM_224_EDITOR 1314 -#define IMG_CUSTOM_225 1315 -#define IMG_CUSTOM_225_EDITOR 1316 -#define IMG_CUSTOM_226 1317 -#define IMG_CUSTOM_226_EDITOR 1318 -#define IMG_CUSTOM_227 1319 -#define IMG_CUSTOM_227_EDITOR 1320 -#define IMG_CUSTOM_228 1321 -#define IMG_CUSTOM_228_EDITOR 1322 -#define IMG_CUSTOM_229 1323 -#define IMG_CUSTOM_229_EDITOR 1324 -#define IMG_CUSTOM_230 1325 -#define IMG_CUSTOM_230_EDITOR 1326 -#define IMG_CUSTOM_231 1327 -#define IMG_CUSTOM_231_EDITOR 1328 -#define IMG_CUSTOM_232 1329 -#define IMG_CUSTOM_232_EDITOR 1330 -#define IMG_CUSTOM_233 1331 -#define IMG_CUSTOM_233_EDITOR 1332 -#define IMG_CUSTOM_234 1333 -#define IMG_CUSTOM_234_EDITOR 1334 -#define IMG_CUSTOM_235 1335 -#define IMG_CUSTOM_235_EDITOR 1336 -#define IMG_CUSTOM_236 1337 -#define IMG_CUSTOM_236_EDITOR 1338 -#define IMG_CUSTOM_237 1339 -#define IMG_CUSTOM_237_EDITOR 1340 -#define IMG_CUSTOM_238 1341 -#define IMG_CUSTOM_238_EDITOR 1342 -#define IMG_CUSTOM_239 1343 -#define IMG_CUSTOM_239_EDITOR 1344 -#define IMG_CUSTOM_240 1345 -#define IMG_CUSTOM_240_EDITOR 1346 -#define IMG_CUSTOM_241 1347 -#define IMG_CUSTOM_241_EDITOR 1348 -#define IMG_CUSTOM_242 1349 -#define IMG_CUSTOM_242_EDITOR 1350 -#define IMG_CUSTOM_243 1351 -#define IMG_CUSTOM_243_EDITOR 1352 -#define IMG_CUSTOM_244 1353 -#define IMG_CUSTOM_244_EDITOR 1354 -#define IMG_CUSTOM_245 1355 -#define IMG_CUSTOM_245_EDITOR 1356 -#define IMG_CUSTOM_246 1357 -#define IMG_CUSTOM_246_EDITOR 1358 -#define IMG_CUSTOM_247 1359 -#define IMG_CUSTOM_247_EDITOR 1360 -#define IMG_CUSTOM_248 1361 -#define IMG_CUSTOM_248_EDITOR 1362 -#define IMG_CUSTOM_249 1363 -#define IMG_CUSTOM_249_EDITOR 1364 -#define IMG_CUSTOM_250 1365 -#define IMG_CUSTOM_250_EDITOR 1366 -#define IMG_CUSTOM_251 1367 -#define IMG_CUSTOM_251_EDITOR 1368 -#define IMG_CUSTOM_252 1369 -#define IMG_CUSTOM_252_EDITOR 1370 -#define IMG_CUSTOM_253 1371 -#define IMG_CUSTOM_253_EDITOR 1372 -#define IMG_CUSTOM_254 1373 -#define IMG_CUSTOM_254_EDITOR 1374 -#define IMG_CUSTOM_255 1375 -#define IMG_CUSTOM_255_EDITOR 1376 -#define IMG_CUSTOM_256 1377 -#define IMG_CUSTOM_256_EDITOR 1378 -#define IMG_GROUP_1 1379 -#define IMG_GROUP_1_EDITOR 1380 -#define IMG_GROUP_2 1381 -#define IMG_GROUP_2_EDITOR 1382 -#define IMG_GROUP_3 1383 -#define IMG_GROUP_3_EDITOR 1384 -#define IMG_GROUP_4 1385 -#define IMG_GROUP_4_EDITOR 1386 -#define IMG_GROUP_5 1387 -#define IMG_GROUP_5_EDITOR 1388 -#define IMG_GROUP_6 1389 -#define IMG_GROUP_6_EDITOR 1390 -#define IMG_GROUP_7 1391 -#define IMG_GROUP_7_EDITOR 1392 -#define IMG_GROUP_8 1393 -#define IMG_GROUP_8_EDITOR 1394 -#define IMG_GROUP_9 1395 -#define IMG_GROUP_9_EDITOR 1396 -#define IMG_GROUP_10 1397 -#define IMG_GROUP_10_EDITOR 1398 -#define IMG_GROUP_11 1399 -#define IMG_GROUP_11_EDITOR 1400 -#define IMG_GROUP_12 1401 -#define IMG_GROUP_12_EDITOR 1402 -#define IMG_GROUP_13 1403 -#define IMG_GROUP_13_EDITOR 1404 -#define IMG_GROUP_14 1405 -#define IMG_GROUP_14_EDITOR 1406 -#define IMG_GROUP_15 1407 -#define IMG_GROUP_15_EDITOR 1408 -#define IMG_GROUP_16 1409 -#define IMG_GROUP_16_EDITOR 1410 -#define IMG_GROUP_17 1411 -#define IMG_GROUP_17_EDITOR 1412 -#define IMG_GROUP_18 1413 -#define IMG_GROUP_18_EDITOR 1414 -#define IMG_GROUP_19 1415 -#define IMG_GROUP_19_EDITOR 1416 -#define IMG_GROUP_20 1417 -#define IMG_GROUP_20_EDITOR 1418 -#define IMG_GROUP_21 1419 -#define IMG_GROUP_21_EDITOR 1420 -#define IMG_GROUP_22 1421 -#define IMG_GROUP_22_EDITOR 1422 -#define IMG_GROUP_23 1423 -#define IMG_GROUP_23_EDITOR 1424 -#define IMG_GROUP_24 1425 -#define IMG_GROUP_24_EDITOR 1426 -#define IMG_GROUP_25 1427 -#define IMG_GROUP_25_EDITOR 1428 -#define IMG_GROUP_26 1429 -#define IMG_GROUP_26_EDITOR 1430 -#define IMG_GROUP_27 1431 -#define IMG_GROUP_27_EDITOR 1432 -#define IMG_GROUP_28 1433 -#define IMG_GROUP_28_EDITOR 1434 -#define IMG_GROUP_29 1435 -#define IMG_GROUP_29_EDITOR 1436 -#define IMG_GROUP_30 1437 -#define IMG_GROUP_30_EDITOR 1438 -#define IMG_GROUP_31 1439 -#define IMG_GROUP_31_EDITOR 1440 -#define IMG_GROUP_32 1441 -#define IMG_GROUP_32_EDITOR 1442 -#define IMG_EMC_OBJECT 1443 -#define IMG_EMC_SPRITE 1444 -#define IMG_TOON_1 1445 -#define IMG_TOON_2 1446 -#define IMG_TOON_3 1447 -#define IMG_TOON_4 1448 -#define IMG_TOON_5 1449 -#define IMG_TOON_6 1450 -#define IMG_TOON_7 1451 -#define IMG_TOON_8 1452 -#define IMG_TOON_9 1453 -#define IMG_TOON_10 1454 -#define IMG_TOON_11 1455 -#define IMG_TOON_12 1456 -#define IMG_TOON_13 1457 -#define IMG_TOON_14 1458 -#define IMG_TOON_15 1459 -#define IMG_TOON_16 1460 -#define IMG_TOON_17 1461 -#define IMG_TOON_18 1462 -#define IMG_TOON_19 1463 -#define IMG_TOON_20 1464 -#define IMG_MENU_CALIBRATE_RED 1465 -#define IMG_MENU_CALIBRATE_BLUE 1466 -#define IMG_MENU_CALIBRATE_YELLOW 1467 -#define IMG_MENU_BUTTON 1468 -#define IMG_MENU_BUTTON_ACTIVE 1469 -#define IMG_MENU_BUTTON_LEFT 1470 -#define IMG_MENU_BUTTON_LEFT_ACTIVE 1471 -#define IMG_MENU_BUTTON_RIGHT 1472 -#define IMG_MENU_BUTTON_RIGHT_ACTIVE 1473 -#define IMG_MENU_BUTTON_UP 1474 -#define IMG_MENU_BUTTON_UP_ACTIVE 1475 -#define IMG_MENU_BUTTON_DOWN 1476 -#define IMG_MENU_BUTTON_DOWN_ACTIVE 1477 -#define IMG_MENU_BUTTON_ENTER_MENU 1478 -#define IMG_MENU_BUTTON_ENTER_MENU_ACTIVE 1479 -#define IMG_MENU_BUTTON_LEAVE_MENU 1480 -#define IMG_MENU_BUTTON_LEAVE_MENU_ACTIVE 1481 -#define IMG_MENU_BUTTON_NEXT_LEVEL 1482 -#define IMG_MENU_BUTTON_NEXT_LEVEL_ACTIVE 1483 -#define IMG_MENU_BUTTON_PREV_LEVEL 1484 -#define IMG_MENU_BUTTON_PREV_LEVEL_ACTIVE 1485 -#define IMG_MENU_SCROLLBAR 1486 -#define IMG_MENU_SCROLLBAR_ACTIVE 1487 -#define IMG_FONT_INITIAL_1 1488 -#define IMG_FONT_INITIAL_2 1489 -#define IMG_FONT_INITIAL_3 1490 -#define IMG_FONT_INITIAL_4 1491 -#define IMG_FONT_TITLE_1 1492 -#define IMG_FONT_TITLE_2 1493 -#define IMG_FONT_MENU_1 1494 -#define IMG_FONT_MENU_1_ACTIVE 1495 -#define IMG_FONT_MENU_2 1496 -#define IMG_FONT_MENU_2_ACTIVE 1497 -#define IMG_FONT_TEXT_1 1498 -#define IMG_FONT_TEXT_1_LEVELS 1499 -#define IMG_FONT_TEXT_1_PREVIEW 1500 -#define IMG_FONT_TEXT_1_SCORES 1501 -#define IMG_FONT_TEXT_1_ACTIVE_SCORES 1502 -#define IMG_FONT_TEXT_2 1503 -#define IMG_FONT_TEXT_2_LEVELS 1504 -#define IMG_FONT_TEXT_2_PREVIEW 1505 -#define IMG_FONT_TEXT_2_SCORES 1506 -#define IMG_FONT_TEXT_2_ACTIVE_SCORES 1507 -#define IMG_FONT_TEXT_3 1508 -#define IMG_FONT_TEXT_3_LEVELS 1509 -#define IMG_FONT_TEXT_3_PREVIEW 1510 -#define IMG_FONT_TEXT_3_SCORES 1511 -#define IMG_FONT_TEXT_3_ACTIVE_SCORES 1512 -#define IMG_FONT_TEXT_4 1513 -#define IMG_FONT_TEXT_4_LEVELS 1514 -#define IMG_FONT_TEXT_4_SCORES 1515 -#define IMG_FONT_TEXT_4_ACTIVE_SCORES 1516 -#define IMG_FONT_ENVELOPE_1 1517 -#define IMG_FONT_ENVELOPE_2 1518 -#define IMG_FONT_ENVELOPE_3 1519 -#define IMG_FONT_ENVELOPE_4 1520 -#define IMG_FONT_INPUT_1 1521 -#define IMG_FONT_INPUT_1_MAIN 1522 -#define IMG_FONT_INPUT_1_ACTIVE 1523 -#define IMG_FONT_INPUT_1_ACTIVE_MAIN 1524 -#define IMG_FONT_INPUT_1_ACTIVE_SETUP 1525 -#define IMG_FONT_INPUT_2 1526 -#define IMG_FONT_INPUT_2_ACTIVE 1527 -#define IMG_FONT_OPTION_OFF 1528 -#define IMG_FONT_OPTION_ON 1529 -#define IMG_FONT_VALUE_1 1530 -#define IMG_FONT_VALUE_2 1531 -#define IMG_FONT_VALUE_OLD 1532 -#define IMG_FONT_LEVEL_NUMBER 1533 -#define IMG_FONT_TAPE_RECORDER 1534 -#define IMG_FONT_GAME_INFO 1535 -#define IMG_GLOBAL_BORDER 1536 -#define IMG_GLOBAL_DOOR 1537 -#define IMG_EDITOR_ELEMENT_BORDER 1538 -#define IMG_EDITOR_ELEMENT_BORDER_INPUT 1539 -#define IMG_EDITOR_CASCADE_LIST 1540 -#define IMG_EDITOR_CASCADE_LIST_ACTIVE 1541 -#define IMG_BACKGROUND_ENVELOPE_1 1542 -#define IMG_BACKGROUND_ENVELOPE_2 1543 -#define IMG_BACKGROUND_ENVELOPE_3 1544 -#define IMG_BACKGROUND_ENVELOPE_4 1545 -#define IMG_BACKGROUND 1546 -#define IMG_BACKGROUND_TITLE 1547 -#define IMG_BACKGROUND_MESSAGE 1548 -#define IMG_BACKGROUND_MAIN 1549 -#define IMG_BACKGROUND_LEVELS 1550 -#define IMG_BACKGROUND_SCORES 1551 -#define IMG_BACKGROUND_EDITOR 1552 -#define IMG_BACKGROUND_INFO 1553 -#define IMG_BACKGROUND_INFO_ELEMENTS 1554 -#define IMG_BACKGROUND_INFO_MUSIC 1555 -#define IMG_BACKGROUND_INFO_CREDITS 1556 -#define IMG_BACKGROUND_INFO_PROGRAM 1557 -#define IMG_BACKGROUND_INFO_LEVELSET 1558 -#define IMG_BACKGROUND_SETUP 1559 -#define IMG_BACKGROUND_DOOR 1560 -#define IMG_TITLESCREEN_INITIAL_1 1561 -#define IMG_TITLESCREEN_INITIAL_2 1562 -#define IMG_TITLESCREEN_INITIAL_3 1563 -#define IMG_TITLESCREEN_INITIAL_4 1564 -#define IMG_TITLESCREEN_INITIAL_5 1565 -#define IMG_TITLESCREEN_1 1566 -#define IMG_TITLESCREEN_2 1567 -#define IMG_TITLESCREEN_3 1568 -#define IMG_TITLESCREEN_4 1569 -#define IMG_TITLESCREEN_5 1570 +#define IMG_DC_MAGIC_WALL 245 +#define IMG_DC_MAGIC_WALL_ACTIVE 246 +#define IMG_DC_MAGIC_WALL_FILLING 247 +#define IMG_DC_MAGIC_WALL_FULL 248 +#define IMG_DC_MAGIC_WALL_EMPTYING 249 +#define IMG_DC_MAGIC_WALL_DEAD 250 +#define IMG_QUICKSAND_EMPTY 251 +#define IMG_QUICKSAND_FILLING 252 +#define IMG_QUICKSAND_FULL 253 +#define IMG_QUICKSAND_FULL_EDITOR 254 +#define IMG_QUICKSAND_EMPTYING 255 +#define IMG_QUICKSAND_FAST_EMPTY 256 +#define IMG_QUICKSAND_FAST_FILLING 257 +#define IMG_QUICKSAND_FAST_FULL 258 +#define IMG_QUICKSAND_FAST_FULL_EDITOR 259 +#define IMG_QUICKSAND_FAST_EMPTYING 260 +#define IMG_ACID_POOL_TOPLEFT 261 +#define IMG_ACID_POOL_TOPRIGHT 262 +#define IMG_ACID_POOL_BOTTOMLEFT 263 +#define IMG_ACID_POOL_BOTTOM 264 +#define IMG_ACID_POOL_BOTTOMRIGHT 265 +#define IMG_ACID 266 +#define IMG_ACID_SPLASH_LEFT 267 +#define IMG_ACID_SPLASH_RIGHT 268 +#define IMG_AMOEBA_DROP 269 +#define IMG_AMOEBA_GROWING 270 +#define IMG_AMOEBA_SHRINKING 271 +#define IMG_AMOEBA_WET 272 +#define IMG_AMOEBA_WET_EDITOR 273 +#define IMG_AMOEBA_DROPPING 274 +#define IMG_AMOEBA_DRY 275 +#define IMG_AMOEBA_FULL 276 +#define IMG_AMOEBA_FULL_EDITOR 277 +#define IMG_AMOEBA_DEAD 278 +#define IMG_AMOEBA_DEAD_EDITOR 279 +#define IMG_EM_KEY_1 280 +#define IMG_EM_KEY_2 281 +#define IMG_EM_KEY_3 282 +#define IMG_EM_KEY_4 283 +#define IMG_DC_KEY_WHITE 284 +#define IMG_EM_GATE_1 285 +#define IMG_EM_GATE_2 286 +#define IMG_EM_GATE_3 287 +#define IMG_EM_GATE_4 288 +#define IMG_DC_GATE_WHITE 289 +#define IMG_EM_GATE_1_GRAY 290 +#define IMG_EM_GATE_1_GRAY_EDITOR 291 +#define IMG_EM_GATE_1_GRAY_ACTIVE 292 +#define IMG_EM_GATE_2_GRAY 293 +#define IMG_EM_GATE_2_GRAY_EDITOR 294 +#define IMG_EM_GATE_2_GRAY_ACTIVE 295 +#define IMG_EM_GATE_3_GRAY 296 +#define IMG_EM_GATE_3_GRAY_EDITOR 297 +#define IMG_EM_GATE_3_GRAY_ACTIVE 298 +#define IMG_EM_GATE_4_GRAY 299 +#define IMG_EM_GATE_4_GRAY_EDITOR 300 +#define IMG_EM_GATE_4_GRAY_ACTIVE 301 +#define IMG_DC_GATE_WHITE_GRAY 302 +#define IMG_DC_GATE_WHITE_GRAY_EDITOR 303 +#define IMG_DC_GATE_WHITE_GRAY_ACTIVE 304 +#define IMG_DC_GATE_FAKE_GRAY 305 +#define IMG_EXIT_CLOSED 306 +#define IMG_EXIT_OPENING 307 +#define IMG_EXIT_OPEN 308 +#define IMG_EXIT_CLOSING 309 +#define IMG_STEEL_EXIT_CLOSED 310 +#define IMG_STEEL_EXIT_OPENING 311 +#define IMG_STEEL_EXIT_OPEN 312 +#define IMG_STEEL_EXIT_CLOSING 313 +#define IMG_EM_EXIT_CLOSED 314 +#define IMG_EM_EXIT_OPENING 315 +#define IMG_EM_EXIT_OPEN 316 +#define IMG_EM_EXIT_CLOSING 317 +#define IMG_EM_STEEL_EXIT_CLOSED 318 +#define IMG_EM_STEEL_EXIT_OPENING 319 +#define IMG_EM_STEEL_EXIT_OPEN 320 +#define IMG_EM_STEEL_EXIT_CLOSING 321 +#define IMG_BALLOON 322 +#define IMG_BALLOON_MOVING 323 +#define IMG_BALLOON_PUSHING 324 +#define IMG_BALLOON_SWITCH_LEFT 325 +#define IMG_BALLOON_SWITCH_RIGHT 326 +#define IMG_BALLOON_SWITCH_UP 327 +#define IMG_BALLOON_SWITCH_DOWN 328 +#define IMG_BALLOON_SWITCH_ANY 329 +#define IMG_BALLOON_SWITCH_NONE 330 +#define IMG_SPRING 331 +#define IMG_EMC_STEELWALL_1 332 +#define IMG_EMC_STEELWALL_2 333 +#define IMG_EMC_STEELWALL_3 334 +#define IMG_EMC_STEELWALL_4 335 +#define IMG_EMC_WALL_1 336 +#define IMG_EMC_WALL_2 337 +#define IMG_EMC_WALL_3 338 +#define IMG_EMC_WALL_4 339 +#define IMG_EMC_WALL_5 340 +#define IMG_EMC_WALL_6 341 +#define IMG_EMC_WALL_7 342 +#define IMG_EMC_WALL_8 343 +#define IMG_INVISIBLE_STEELWALL 344 +#define IMG_INVISIBLE_STEELWALL_EDITOR 345 +#define IMG_INVISIBLE_STEELWALL_ACTIVE 346 +#define IMG_INVISIBLE_WALL 347 +#define IMG_INVISIBLE_WALL_EDITOR 348 +#define IMG_INVISIBLE_WALL_ACTIVE 349 +#define IMG_INVISIBLE_SAND 350 +#define IMG_INVISIBLE_SAND_EDITOR 351 +#define IMG_INVISIBLE_SAND_ACTIVE 352 +#define IMG_INVISIBLE_SAND_ACTIVE_CRUMBLED 353 +#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_LEFT 354 +#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_RIGHT 355 +#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_UP 356 +#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_DOWN 357 +#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_LEFT_CRUMBLED 358 +#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_RIGHT_CRUMBLED 359 +#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_UP_CRUMBLED 360 +#define IMG_INVISIBLE_SAND_ACTIVE_DIGGING_DOWN_CRUMBLED 361 +#define IMG_CONVEYOR_BELT_1_MIDDLE 362 +#define IMG_CONVEYOR_BELT_1_MIDDLE_ACTIVE 363 +#define IMG_CONVEYOR_BELT_1_LEFT 364 +#define IMG_CONVEYOR_BELT_1_LEFT_ACTIVE 365 +#define IMG_CONVEYOR_BELT_1_RIGHT 366 +#define IMG_CONVEYOR_BELT_1_RIGHT_ACTIVE 367 +#define IMG_CONVEYOR_BELT_1_SWITCH_LEFT 368 +#define IMG_CONVEYOR_BELT_1_SWITCH_MIDDLE 369 +#define IMG_CONVEYOR_BELT_1_SWITCH_RIGHT 370 +#define IMG_CONVEYOR_BELT_2_MIDDLE 371 +#define IMG_CONVEYOR_BELT_2_MIDDLE_ACTIVE 372 +#define IMG_CONVEYOR_BELT_2_LEFT 373 +#define IMG_CONVEYOR_BELT_2_LEFT_ACTIVE 374 +#define IMG_CONVEYOR_BELT_2_RIGHT 375 +#define IMG_CONVEYOR_BELT_2_RIGHT_ACTIVE 376 +#define IMG_CONVEYOR_BELT_2_SWITCH_LEFT 377 +#define IMG_CONVEYOR_BELT_2_SWITCH_MIDDLE 378 +#define IMG_CONVEYOR_BELT_2_SWITCH_RIGHT 379 +#define IMG_CONVEYOR_BELT_3_MIDDLE 380 +#define IMG_CONVEYOR_BELT_3_MIDDLE_ACTIVE 381 +#define IMG_CONVEYOR_BELT_3_LEFT 382 +#define IMG_CONVEYOR_BELT_3_LEFT_ACTIVE 383 +#define IMG_CONVEYOR_BELT_3_RIGHT 384 +#define IMG_CONVEYOR_BELT_3_RIGHT_ACTIVE 385 +#define IMG_CONVEYOR_BELT_3_SWITCH_LEFT 386 +#define IMG_CONVEYOR_BELT_3_SWITCH_MIDDLE 387 +#define IMG_CONVEYOR_BELT_3_SWITCH_RIGHT 388 +#define IMG_CONVEYOR_BELT_4_MIDDLE 389 +#define IMG_CONVEYOR_BELT_4_MIDDLE_ACTIVE 390 +#define IMG_CONVEYOR_BELT_4_LEFT 391 +#define IMG_CONVEYOR_BELT_4_LEFT_ACTIVE 392 +#define IMG_CONVEYOR_BELT_4_RIGHT 393 +#define IMG_CONVEYOR_BELT_4_RIGHT_ACTIVE 394 +#define IMG_CONVEYOR_BELT_4_SWITCH_LEFT 395 +#define IMG_CONVEYOR_BELT_4_SWITCH_MIDDLE 396 +#define IMG_CONVEYOR_BELT_4_SWITCH_RIGHT 397 +#define IMG_SWITCHGATE_SWITCH_UP 398 +#define IMG_SWITCHGATE_SWITCH_DOWN 399 +#define IMG_DC_SWITCHGATE_SWITCH_UP 400 +#define IMG_DC_SWITCHGATE_SWITCH_DOWN 401 +#define IMG_LIGHT_SWITCH 402 +#define IMG_LIGHT_SWITCH_ACTIVE 403 +#define IMG_TIMEGATE_SWITCH 404 +#define IMG_TIMEGATE_SWITCH_ACTIVE 405 +#define IMG_DC_TIMEGATE_SWITCH 406 +#define IMG_DC_TIMEGATE_SWITCH_ACTIVE 407 +#define IMG_ENVELOPE_1 408 +#define IMG_ENVELOPE_1_COLLECTING 409 +#define IMG_ENVELOPE_2 410 +#define IMG_ENVELOPE_2_COLLECTING 411 +#define IMG_ENVELOPE_3 412 +#define IMG_ENVELOPE_3_COLLECTING 413 +#define IMG_ENVELOPE_4 414 +#define IMG_ENVELOPE_4_COLLECTING 415 +#define IMG_SIGN_RADIOACTIVITY 416 +#define IMG_SIGN_GIVE_WAY 417 +#define IMG_SIGN_NO_ENTRY 418 +#define IMG_SIGN_EMERGENCY_EXIT 419 +#define IMG_SIGN_YIN_YANG 420 +#define IMG_SIGN_EXCLAMATION 421 +#define IMG_SIGN_STOP 422 +#define IMG_SIGN_PARKING 423 +#define IMG_SIGN_WHEELCHAIR 424 +#define IMG_SIGN_ENTRY_FORBIDDEN 425 +#define IMG_SPERMS 426 +#define IMG_BULLET 427 +#define IMG_HEART 428 +#define IMG_CROSS 429 +#define IMG_FRANKIE 430 +#define IMG_SIGN_SPERMS 431 +#define IMG_SIGN_BULLET 432 +#define IMG_SIGN_HEART 433 +#define IMG_SIGN_CROSS 434 +#define IMG_SIGN_FRANKIE 435 +#define IMG_LANDMINE 436 +#define IMG_DC_LANDMINE 437 +#define IMG_STEELWALL_SLIPPERY 438 +#define IMG_EXTRA_TIME 439 +#define IMG_SHIELD_NORMAL 440 +#define IMG_SHIELD_NORMAL_ACTIVE 441 +#define IMG_SHIELD_DEADLY 442 +#define IMG_SHIELD_DEADLY_ACTIVE 443 +#define IMG_SWITCHGATE_CLOSED 444 +#define IMG_SWITCHGATE_OPENING 445 +#define IMG_SWITCHGATE_OPEN 446 +#define IMG_SWITCHGATE_CLOSING 447 +#define IMG_TIMEGATE_CLOSED 448 +#define IMG_TIMEGATE_OPENING 449 +#define IMG_TIMEGATE_OPEN 450 +#define IMG_TIMEGATE_CLOSING 451 +#define IMG_PEARL 452 +#define IMG_PEARL_BREAKING 453 +#define IMG_CRYSTAL 454 +#define IMG_WALL_PEARL 455 +#define IMG_WALL_CRYSTAL 456 +#define IMG_DC_STEELWALL_1_LEFT 457 +#define IMG_DC_STEELWALL_1_RIGHT 458 +#define IMG_DC_STEELWALL_1_TOP 459 +#define IMG_DC_STEELWALL_1_BOTTOM 460 +#define IMG_DC_STEELWALL_1_HORIZONTAL 461 +#define IMG_DC_STEELWALL_1_VERTICAL 462 +#define IMG_DC_STEELWALL_1_TOPLEFT 463 +#define IMG_DC_STEELWALL_1_TOPRIGHT 464 +#define IMG_DC_STEELWALL_1_BOTTOMLEFT 465 +#define IMG_DC_STEELWALL_1_BOTTOMRIGHT 466 +#define IMG_DC_STEELWALL_1_TOPLEFT_2 467 +#define IMG_DC_STEELWALL_1_TOPRIGHT_2 468 +#define IMG_DC_STEELWALL_1_BOTTOMLEFT_2 469 +#define IMG_DC_STEELWALL_1_BOTTOMRIGHT_2 470 +#define IMG_DC_STEELWALL_2_LEFT 471 +#define IMG_DC_STEELWALL_2_RIGHT 472 +#define IMG_DC_STEELWALL_2_TOP 473 +#define IMG_DC_STEELWALL_2_BOTTOM 474 +#define IMG_DC_STEELWALL_2_HORIZONTAL 475 +#define IMG_DC_STEELWALL_2_VERTICAL 476 +#define IMG_DC_STEELWALL_2_MIDDLE 477 +#define IMG_DC_STEELWALL_2_SINGLE 478 +#define IMG_TUBE_RIGHT_DOWN 479 +#define IMG_TUBE_HORIZONTAL_DOWN 480 +#define IMG_TUBE_LEFT_DOWN 481 +#define IMG_TUBE_HORIZONTAL 482 +#define IMG_TUBE_VERTICAL_RIGHT 483 +#define IMG_TUBE_ANY 484 +#define IMG_TUBE_VERTICAL_LEFT 485 +#define IMG_TUBE_VERTICAL 486 +#define IMG_TUBE_RIGHT_UP 487 +#define IMG_TUBE_HORIZONTAL_UP 488 +#define IMG_TUBE_LEFT_UP 489 +#define IMG_TRAP 490 +#define IMG_TRAP_ACTIVE 491 +#define IMG_DX_SUPABOMB 492 +#define IMG_KEY_1 493 +#define IMG_KEY_1_EDITOR 494 +#define IMG_KEY_2 495 +#define IMG_KEY_2_EDITOR 496 +#define IMG_KEY_3 497 +#define IMG_KEY_3_EDITOR 498 +#define IMG_KEY_4 499 +#define IMG_KEY_4_EDITOR 500 +#define IMG_GATE_1 501 +#define IMG_GATE_2 502 +#define IMG_GATE_3 503 +#define IMG_GATE_4 504 +#define IMG_GATE_1_GRAY 505 +#define IMG_GATE_1_GRAY_EDITOR 506 +#define IMG_GATE_1_GRAY_ACTIVE 507 +#define IMG_GATE_2_GRAY 508 +#define IMG_GATE_2_GRAY_EDITOR 509 +#define IMG_GATE_2_GRAY_ACTIVE 510 +#define IMG_GATE_3_GRAY 511 +#define IMG_GATE_3_GRAY_EDITOR 512 +#define IMG_GATE_3_GRAY_ACTIVE 513 +#define IMG_GATE_4_GRAY 514 +#define IMG_GATE_4_GRAY_EDITOR 515 +#define IMG_GATE_4_GRAY_ACTIVE 516 +#define IMG_GAME_OF_LIFE 517 +#define IMG_BIOMAZE 518 +#define IMG_PACMAN 519 +#define IMG_PACMAN_RIGHT 520 +#define IMG_PACMAN_UP 521 +#define IMG_PACMAN_LEFT 522 +#define IMG_PACMAN_DOWN 523 +#define IMG_PACMAN_TURNING_FROM_RIGHT 524 +#define IMG_PACMAN_TURNING_FROM_UP 525 +#define IMG_PACMAN_TURNING_FROM_LEFT 526 +#define IMG_PACMAN_TURNING_FROM_DOWN 527 +#define IMG_LAMP 528 +#define IMG_LAMP_EDITOR 529 +#define IMG_LAMP_ACTIVE 530 +#define IMG_TIME_ORB_FULL 531 +#define IMG_TIME_ORB_EMPTY 532 +#define IMG_EMERALD_YELLOW 533 +#define IMG_EMERALD_YELLOW_MOVING 534 +#define IMG_EMERALD_YELLOW_FALLING 535 +#define IMG_EMERALD_RED 536 +#define IMG_EMERALD_RED_MOVING 537 +#define IMG_EMERALD_RED_FALLING 538 +#define IMG_EMERALD_PURPLE 539 +#define IMG_EMERALD_PURPLE_MOVING 540 +#define IMG_EMERALD_PURPLE_FALLING 541 +#define IMG_WALL_EMERALD_YELLOW 542 +#define IMG_WALL_EMERALD_RED 543 +#define IMG_WALL_EMERALD_PURPLE 544 +#define IMG_WALL_BD_DIAMOND 545 +#define IMG_EXPANDABLE_WALL 546 +#define IMG_EXPANDABLE_WALL_HORIZONTAL 547 +#define IMG_EXPANDABLE_WALL_HORIZONTAL_EDITOR 548 +#define IMG_EXPANDABLE_WALL_VERTICAL 549 +#define IMG_EXPANDABLE_WALL_VERTICAL_EDITOR 550 +#define IMG_EXPANDABLE_WALL_ANY 551 +#define IMG_EXPANDABLE_WALL_ANY_EDITOR 552 +#define IMG_EXPANDABLE_STEELWALL_HORIZONTAL 553 +#define IMG_EXPANDABLE_STEELWALL_HORIZONTAL_EDITOR 554 +#define IMG_EXPANDABLE_STEELWALL_VERTICAL 555 +#define IMG_EXPANDABLE_STEELWALL_VERTICAL_EDITOR 556 +#define IMG_EXPANDABLE_STEELWALL_ANY 557 +#define IMG_EXPANDABLE_STEELWALL_ANY_EDITOR 558 +#define IMG_BD_EXPANDABLE_WALL 559 +#define IMG_BD_EXPANDABLE_WALL_EDITOR 560 +#define IMG_EXPANDABLE_WALL_GROWING_LEFT 561 +#define IMG_EXPANDABLE_WALL_GROWING_RIGHT 562 +#define IMG_EXPANDABLE_WALL_GROWING_UP 563 +#define IMG_EXPANDABLE_WALL_GROWING_DOWN 564 +#define IMG_EXPANDABLE_STEELWALL_GROWING_LEFT 565 +#define IMG_EXPANDABLE_STEELWALL_GROWING_RIGHT 566 +#define IMG_EXPANDABLE_STEELWALL_GROWING_UP 567 +#define IMG_EXPANDABLE_STEELWALL_GROWING_DOWN 568 +#define IMG_BLACK_ORB 569 +#define IMG_SPEED_PILL 570 +#define IMG_DARK_YAMYAM 571 +#define IMG_DYNABOMB 572 +#define IMG_DYNABOMB_ACTIVE 573 +#define IMG_DYNABOMB_PLAYER_1 574 +#define IMG_DYNABOMB_PLAYER_1_ACTIVE 575 +#define IMG_DYNABOMB_PLAYER_2 576 +#define IMG_DYNABOMB_PLAYER_2_ACTIVE 577 +#define IMG_DYNABOMB_PLAYER_3 578 +#define IMG_DYNABOMB_PLAYER_3_ACTIVE 579 +#define IMG_DYNABOMB_PLAYER_4 580 +#define IMG_DYNABOMB_PLAYER_4_ACTIVE 581 +#define IMG_DYNABOMB_INCREASE_NUMBER 582 +#define IMG_DYNABOMB_INCREASE_SIZE 583 +#define IMG_DYNABOMB_INCREASE_POWER 584 +#define IMG_PIG 585 +#define IMG_PIG_DOWN 586 +#define IMG_PIG_UP 587 +#define IMG_PIG_LEFT 588 +#define IMG_PIG_RIGHT 589 +#define IMG_PIG_MOVING_DOWN 590 +#define IMG_PIG_MOVING_UP 591 +#define IMG_PIG_MOVING_LEFT 592 +#define IMG_PIG_MOVING_RIGHT 593 +#define IMG_PIG_DIGGING_DOWN 594 +#define IMG_PIG_DIGGING_UP 595 +#define IMG_PIG_DIGGING_LEFT 596 +#define IMG_PIG_DIGGING_RIGHT 597 +#define IMG_DRAGON 598 +#define IMG_DRAGON_DOWN 599 +#define IMG_DRAGON_UP 600 +#define IMG_DRAGON_LEFT 601 +#define IMG_DRAGON_RIGHT 602 +#define IMG_DRAGON_MOVING_DOWN 603 +#define IMG_DRAGON_MOVING_UP 604 +#define IMG_DRAGON_MOVING_LEFT 605 +#define IMG_DRAGON_MOVING_RIGHT 606 +#define IMG_DRAGON_ATTACKING_DOWN 607 +#define IMG_DRAGON_ATTACKING_UP 608 +#define IMG_DRAGON_ATTACKING_LEFT 609 +#define IMG_DRAGON_ATTACKING_RIGHT 610 +#define IMG_MOLE 611 +#define IMG_MOLE_DOWN 612 +#define IMG_MOLE_UP 613 +#define IMG_MOLE_LEFT 614 +#define IMG_MOLE_RIGHT 615 +#define IMG_MOLE_MOVING_DOWN 616 +#define IMG_MOLE_MOVING_UP 617 +#define IMG_MOLE_MOVING_LEFT 618 +#define IMG_MOLE_MOVING_RIGHT 619 +#define IMG_MOLE_DIGGING_DOWN 620 +#define IMG_MOLE_DIGGING_UP 621 +#define IMG_MOLE_DIGGING_LEFT 622 +#define IMG_MOLE_DIGGING_RIGHT 623 +#define IMG_PENGUIN 624 +#define IMG_PENGUIN_EDITOR 625 +#define IMG_PENGUIN_DOWN 626 +#define IMG_PENGUIN_UP 627 +#define IMG_PENGUIN_LEFT 628 +#define IMG_PENGUIN_RIGHT 629 +#define IMG_PENGUIN_MOVING_DOWN 630 +#define IMG_PENGUIN_MOVING_UP 631 +#define IMG_PENGUIN_MOVING_LEFT 632 +#define IMG_PENGUIN_MOVING_RIGHT 633 +#define IMG_SATELLITE 634 +#define IMG_FLAMES_1_LEFT 635 +#define IMG_FLAMES_2_LEFT 636 +#define IMG_FLAMES_3_LEFT 637 +#define IMG_FLAMES_1_RIGHT 638 +#define IMG_FLAMES_2_RIGHT 639 +#define IMG_FLAMES_3_RIGHT 640 +#define IMG_FLAMES_1_UP 641 +#define IMG_FLAMES_2_UP 642 +#define IMG_FLAMES_3_UP 643 +#define IMG_FLAMES_1_DOWN 644 +#define IMG_FLAMES_2_DOWN 645 +#define IMG_FLAMES_3_DOWN 646 +#define IMG_STONEBLOCK 647 +#define IMG_PLAYER_1 648 +#define IMG_PLAYER_1_EDITOR 649 +#define IMG_PLAYER_1_DOWN 650 +#define IMG_PLAYER_1_UP 651 +#define IMG_PLAYER_1_LEFT 652 +#define IMG_PLAYER_1_RIGHT 653 +#define IMG_PLAYER_1_MOVING_DOWN 654 +#define IMG_PLAYER_1_MOVING_UP 655 +#define IMG_PLAYER_1_MOVING_LEFT 656 +#define IMG_PLAYER_1_MOVING_RIGHT 657 +#define IMG_PLAYER_1_DIGGING_DOWN 658 +#define IMG_PLAYER_1_DIGGING_UP 659 +#define IMG_PLAYER_1_DIGGING_LEFT 660 +#define IMG_PLAYER_1_DIGGING_RIGHT 661 +#define IMG_PLAYER_1_COLLECTING_DOWN 662 +#define IMG_PLAYER_1_COLLECTING_UP 663 +#define IMG_PLAYER_1_COLLECTING_LEFT 664 +#define IMG_PLAYER_1_COLLECTING_RIGHT 665 +#define IMG_PLAYER_1_PUSHING_DOWN 666 +#define IMG_PLAYER_1_PUSHING_UP 667 +#define IMG_PLAYER_1_PUSHING_LEFT 668 +#define IMG_PLAYER_1_PUSHING_RIGHT 669 +#define IMG_PLAYER_1_SNAPPING_DOWN 670 +#define IMG_PLAYER_1_SNAPPING_UP 671 +#define IMG_PLAYER_1_SNAPPING_LEFT 672 +#define IMG_PLAYER_1_SNAPPING_RIGHT 673 +#define IMG_PLAYER_2 674 +#define IMG_PLAYER_2_EDITOR 675 +#define IMG_PLAYER_2_DOWN 676 +#define IMG_PLAYER_2_UP 677 +#define IMG_PLAYER_2_LEFT 678 +#define IMG_PLAYER_2_RIGHT 679 +#define IMG_PLAYER_2_MOVING_DOWN 680 +#define IMG_PLAYER_2_MOVING_UP 681 +#define IMG_PLAYER_2_MOVING_LEFT 682 +#define IMG_PLAYER_2_MOVING_RIGHT 683 +#define IMG_PLAYER_2_DIGGING_DOWN 684 +#define IMG_PLAYER_2_DIGGING_UP 685 +#define IMG_PLAYER_2_DIGGING_LEFT 686 +#define IMG_PLAYER_2_DIGGING_RIGHT 687 +#define IMG_PLAYER_2_COLLECTING_DOWN 688 +#define IMG_PLAYER_2_COLLECTING_UP 689 +#define IMG_PLAYER_2_COLLECTING_LEFT 690 +#define IMG_PLAYER_2_COLLECTING_RIGHT 691 +#define IMG_PLAYER_2_PUSHING_DOWN 692 +#define IMG_PLAYER_2_PUSHING_UP 693 +#define IMG_PLAYER_2_PUSHING_LEFT 694 +#define IMG_PLAYER_2_PUSHING_RIGHT 695 +#define IMG_PLAYER_2_SNAPPING_DOWN 696 +#define IMG_PLAYER_2_SNAPPING_UP 697 +#define IMG_PLAYER_2_SNAPPING_LEFT 698 +#define IMG_PLAYER_2_SNAPPING_RIGHT 699 +#define IMG_PLAYER_3 700 +#define IMG_PLAYER_3_EDITOR 701 +#define IMG_PLAYER_3_DOWN 702 +#define IMG_PLAYER_3_UP 703 +#define IMG_PLAYER_3_LEFT 704 +#define IMG_PLAYER_3_RIGHT 705 +#define IMG_PLAYER_3_MOVING_DOWN 706 +#define IMG_PLAYER_3_MOVING_UP 707 +#define IMG_PLAYER_3_MOVING_LEFT 708 +#define IMG_PLAYER_3_MOVING_RIGHT 709 +#define IMG_PLAYER_3_DIGGING_DOWN 710 +#define IMG_PLAYER_3_DIGGING_UP 711 +#define IMG_PLAYER_3_DIGGING_LEFT 712 +#define IMG_PLAYER_3_DIGGING_RIGHT 713 +#define IMG_PLAYER_3_COLLECTING_DOWN 714 +#define IMG_PLAYER_3_COLLECTING_UP 715 +#define IMG_PLAYER_3_COLLECTING_LEFT 716 +#define IMG_PLAYER_3_COLLECTING_RIGHT 717 +#define IMG_PLAYER_3_PUSHING_DOWN 718 +#define IMG_PLAYER_3_PUSHING_UP 719 +#define IMG_PLAYER_3_PUSHING_LEFT 720 +#define IMG_PLAYER_3_PUSHING_RIGHT 721 +#define IMG_PLAYER_3_SNAPPING_DOWN 722 +#define IMG_PLAYER_3_SNAPPING_UP 723 +#define IMG_PLAYER_3_SNAPPING_LEFT 724 +#define IMG_PLAYER_3_SNAPPING_RIGHT 725 +#define IMG_PLAYER_4 726 +#define IMG_PLAYER_4_EDITOR 727 +#define IMG_PLAYER_4_DOWN 728 +#define IMG_PLAYER_4_UP 729 +#define IMG_PLAYER_4_LEFT 730 +#define IMG_PLAYER_4_RIGHT 731 +#define IMG_PLAYER_4_MOVING_DOWN 732 +#define IMG_PLAYER_4_MOVING_UP 733 +#define IMG_PLAYER_4_MOVING_LEFT 734 +#define IMG_PLAYER_4_MOVING_RIGHT 735 +#define IMG_PLAYER_4_DIGGING_DOWN 736 +#define IMG_PLAYER_4_DIGGING_UP 737 +#define IMG_PLAYER_4_DIGGING_LEFT 738 +#define IMG_PLAYER_4_DIGGING_RIGHT 739 +#define IMG_PLAYER_4_COLLECTING_DOWN 740 +#define IMG_PLAYER_4_COLLECTING_UP 741 +#define IMG_PLAYER_4_COLLECTING_LEFT 742 +#define IMG_PLAYER_4_COLLECTING_RIGHT 743 +#define IMG_PLAYER_4_PUSHING_DOWN 744 +#define IMG_PLAYER_4_PUSHING_UP 745 +#define IMG_PLAYER_4_PUSHING_LEFT 746 +#define IMG_PLAYER_4_PUSHING_RIGHT 747 +#define IMG_PLAYER_4_SNAPPING_DOWN 748 +#define IMG_PLAYER_4_SNAPPING_UP 749 +#define IMG_PLAYER_4_SNAPPING_LEFT 750 +#define IMG_PLAYER_4_SNAPPING_RIGHT 751 +#define IMG_DEFAULT_EXPLODING 752 +#define IMG_TWINKLE_BLUE 753 +#define IMG_TWINKLE_WHITE 754 +#define IMG_STEELWALL_TOPLEFT 755 +#define IMG_STEELWALL_TOPRIGHT 756 +#define IMG_STEELWALL_BOTTOMLEFT 757 +#define IMG_STEELWALL_BOTTOMRIGHT 758 +#define IMG_STEELWALL_HORIZONTAL 759 +#define IMG_STEELWALL_VERTICAL 760 +#define IMG_STEELWALL_TOPLEFT_EDITOR 761 +#define IMG_STEELWALL_TOPRIGHT_EDITOR 762 +#define IMG_STEELWALL_BOTTOMLEFT_EDITOR 763 +#define IMG_STEELWALL_BOTTOMRIGHT_EDITOR 764 +#define IMG_STEELWALL_HORIZONTAL_EDITOR 765 +#define IMG_STEELWALL_VERTICAL_EDITOR 766 +#define IMG_INVISIBLE_STEELWALL_TOPLEFT 767 +#define IMG_INVISIBLE_STEELWALL_TOPRIGHT 768 +#define IMG_INVISIBLE_STEELWALL_BOTTOMLEFT 769 +#define IMG_INVISIBLE_STEELWALL_BOTTOMRIGHT 770 +#define IMG_INVISIBLE_STEELWALL_HORIZONTAL 771 +#define IMG_INVISIBLE_STEELWALL_VERTICAL 772 +#define IMG_INVISIBLE_STEELWALL_TOPLEFT_EDITOR 773 +#define IMG_INVISIBLE_STEELWALL_TOPRIGHT_EDITOR 774 +#define IMG_INVISIBLE_STEELWALL_BOTTOMLEFT_EDITOR 775 +#define IMG_INVISIBLE_STEELWALL_BOTTOMRIGHT_EDITOR 776 +#define IMG_INVISIBLE_STEELWALL_HORIZONTAL_EDITOR 777 +#define IMG_INVISIBLE_STEELWALL_VERTICAL_EDITOR 778 +#define IMG_ARROW_LEFT 779 +#define IMG_ARROW_RIGHT 780 +#define IMG_ARROW_UP 781 +#define IMG_ARROW_DOWN 782 +#define IMG_UNKNOWN 783 +#define IMG_TRIGGER_ELEMENT 784 +#define IMG_TRIGGER_PLAYER 785 +#define IMG_TRIGGER_CE_VALUE 786 +#define IMG_TRIGGER_CE_SCORE 787 +#define IMG_CURRENT_CE_VALUE 788 +#define IMG_CURRENT_CE_SCORE 789 +#define IMG_PREV_CE_1 790 +#define IMG_PREV_CE_2 791 +#define IMG_PREV_CE_3 792 +#define IMG_PREV_CE_4 793 +#define IMG_PREV_CE_5 794 +#define IMG_PREV_CE_6 795 +#define IMG_PREV_CE_7 796 +#define IMG_PREV_CE_8 797 +#define IMG_NEXT_CE_1 798 +#define IMG_NEXT_CE_2 799 +#define IMG_NEXT_CE_3 800 +#define IMG_NEXT_CE_4 801 +#define IMG_NEXT_CE_5 802 +#define IMG_NEXT_CE_6 803 +#define IMG_NEXT_CE_7 804 +#define IMG_NEXT_CE_8 805 +#define IMG_SELF 806 +#define IMG_ANY_ELEMENT 807 +#define IMG_EMC_KEY_5 808 +#define IMG_EMC_KEY_6 809 +#define IMG_EMC_KEY_7 810 +#define IMG_EMC_KEY_8 811 +#define IMG_EMC_GATE_5 812 +#define IMG_EMC_GATE_6 813 +#define IMG_EMC_GATE_7 814 +#define IMG_EMC_GATE_8 815 +#define IMG_EMC_GATE_5_GRAY 816 +#define IMG_EMC_GATE_5_GRAY_EDITOR 817 +#define IMG_EMC_GATE_5_GRAY_ACTIVE 818 +#define IMG_EMC_GATE_6_GRAY 819 +#define IMG_EMC_GATE_6_GRAY_EDITOR 820 +#define IMG_EMC_GATE_6_GRAY_ACTIVE 821 +#define IMG_EMC_GATE_7_GRAY 822 +#define IMG_EMC_GATE_7_GRAY_EDITOR 823 +#define IMG_EMC_GATE_7_GRAY_ACTIVE 824 +#define IMG_EMC_GATE_8_GRAY 825 +#define IMG_EMC_GATE_8_GRAY_EDITOR 826 +#define IMG_EMC_GATE_8_GRAY_ACTIVE 827 +#define IMG_EMC_ANDROID 828 +#define IMG_EMC_ANDROID_SHRINKING_UPLEFT 829 +#define IMG_EMC_ANDROID_GROWING_DOWNRIGHT 830 +#define IMG_EMC_ANDROID_SHRINKING_DOWNLEFT 831 +#define IMG_EMC_ANDROID_GROWING_UPRIGHT 832 +#define IMG_EMC_ANDROID_SHRINKING_UPRIGHT 833 +#define IMG_EMC_ANDROID_GROWING_DOWNLEFT 834 +#define IMG_EMC_ANDROID_SHRINKING_DOWNRIGHT 835 +#define IMG_EMC_ANDROID_GROWING_UPLEFT 836 +#define IMG_EMC_GRASS 837 +#define IMG_EMC_GRASS_CRUMBLED 838 +#define IMG_EMC_GRASS_DIGGING_LEFT 839 +#define IMG_EMC_GRASS_DIGGING_RIGHT 840 +#define IMG_EMC_GRASS_DIGGING_UP 841 +#define IMG_EMC_GRASS_DIGGING_DOWN 842 +#define IMG_EMC_GRASS_DIGGING_LEFT_CRUMBLED 843 +#define IMG_EMC_GRASS_DIGGING_RIGHT_CRUMBLED 844 +#define IMG_EMC_GRASS_DIGGING_UP_CRUMBLED 845 +#define IMG_EMC_GRASS_DIGGING_DOWN_CRUMBLED 846 +#define IMG_EMC_MAGIC_BALL 847 +#define IMG_EMC_MAGIC_BALL_ACTIVE 848 +#define IMG_EMC_MAGIC_BALL_DROPPING 849 +#define IMG_EMC_MAGIC_BALL_SWITCH 850 +#define IMG_EMC_MAGIC_BALL_SWITCH_ACTIVE 851 +#define IMG_EMC_SPRING_BUMPER 852 +#define IMG_EMC_SPRING_BUMPER_ACTIVE 853 +#define IMG_EMC_PLANT 854 +#define IMG_EMC_PLANT_CRUMBLED 855 +#define IMG_EMC_LENSES 856 +#define IMG_EMC_MAGNIFIER 857 +#define IMG_EMC_WALL_9 858 +#define IMG_EMC_WALL_10 859 +#define IMG_EMC_WALL_11 860 +#define IMG_EMC_WALL_12 861 +#define IMG_EMC_WALL_13 862 +#define IMG_EMC_WALL_14 863 +#define IMG_EMC_WALL_15 864 +#define IMG_EMC_WALL_16 865 +#define IMG_EMC_WALL_SLIPPERY_1 866 +#define IMG_EMC_WALL_SLIPPERY_2 867 +#define IMG_EMC_WALL_SLIPPERY_3 868 +#define IMG_EMC_WALL_SLIPPERY_4 869 +#define IMG_EMC_FAKE_GRASS 870 +#define IMG_EMC_FAKE_GRASS_CRUMBLED 871 +#define IMG_EMC_FAKE_GRASS_ACTIVE 872 +#define IMG_EMC_FAKE_GRASS_ACTIVE_CRUMBLED 873 +#define IMG_EMC_FAKE_GRASS_EDITOR 874 +#define IMG_EMC_FAKE_ACID 875 +#define IMG_EMC_DRIPPER 876 +#define IMG_EMC_DRIPPER_EDITOR 877 +#define IMG_EMC_DRIPPER_ACTIVE 878 +#define IMG_GRAPHIC_1 879 +#define IMG_GRAPHIC_2 880 +#define IMG_GRAPHIC_3 881 +#define IMG_GRAPHIC_4 882 +#define IMG_GRAPHIC_5 883 +#define IMG_GRAPHIC_6 884 +#define IMG_GRAPHIC_7 885 +#define IMG_GRAPHIC_8 886 +#define IMG_CHAR_SPACE 887 +#define IMG_CHAR_SPACE_EDITOR 888 +#define IMG_CHAR_EXCLAM 889 +#define IMG_CHAR_QUOTEDBL 890 +#define IMG_CHAR_NUMBERSIGN 891 +#define IMG_CHAR_DOLLAR 892 +#define IMG_CHAR_PERCENT 893 +#define IMG_CHAR_AMPERSAND 894 +#define IMG_CHAR_APOSTROPHE 895 +#define IMG_CHAR_PARENLEFT 896 +#define IMG_CHAR_PARENRIGHT 897 +#define IMG_CHAR_ASTERISK 898 +#define IMG_CHAR_PLUS 899 +#define IMG_CHAR_COMMA 900 +#define IMG_CHAR_MINUS 901 +#define IMG_CHAR_PERIOD 902 +#define IMG_CHAR_SLASH 903 +#define IMG_CHAR_0 904 +#define IMG_CHAR_1 905 +#define IMG_CHAR_2 906 +#define IMG_CHAR_3 907 +#define IMG_CHAR_4 908 +#define IMG_CHAR_5 909 +#define IMG_CHAR_6 910 +#define IMG_CHAR_7 911 +#define IMG_CHAR_8 912 +#define IMG_CHAR_9 913 +#define IMG_CHAR_COLON 914 +#define IMG_CHAR_SEMICOLON 915 +#define IMG_CHAR_LESS 916 +#define IMG_CHAR_EQUAL 917 +#define IMG_CHAR_GREATER 918 +#define IMG_CHAR_QUESTION 919 +#define IMG_CHAR_AT 920 +#define IMG_CHAR_A 921 +#define IMG_CHAR_B 922 +#define IMG_CHAR_C 923 +#define IMG_CHAR_D 924 +#define IMG_CHAR_E 925 +#define IMG_CHAR_F 926 +#define IMG_CHAR_G 927 +#define IMG_CHAR_H 928 +#define IMG_CHAR_I 929 +#define IMG_CHAR_J 930 +#define IMG_CHAR_K 931 +#define IMG_CHAR_L 932 +#define IMG_CHAR_M 933 +#define IMG_CHAR_N 934 +#define IMG_CHAR_O 935 +#define IMG_CHAR_P 936 +#define IMG_CHAR_Q 937 +#define IMG_CHAR_R 938 +#define IMG_CHAR_S 939 +#define IMG_CHAR_T 940 +#define IMG_CHAR_U 941 +#define IMG_CHAR_V 942 +#define IMG_CHAR_W 943 +#define IMG_CHAR_X 944 +#define IMG_CHAR_Y 945 +#define IMG_CHAR_Z 946 +#define IMG_CHAR_BRACKETLEFT 947 +#define IMG_CHAR_BACKSLASH 948 +#define IMG_CHAR_BRACKETRIGHT 949 +#define IMG_CHAR_ASCIICIRCUM 950 +#define IMG_CHAR_UNDERSCORE 951 +#define IMG_CHAR_COPYRIGHT 952 +#define IMG_CHAR_AUMLAUT 953 +#define IMG_CHAR_OUMLAUT 954 +#define IMG_CHAR_UUMLAUT 955 +#define IMG_CHAR_DEGREE 956 +#define IMG_CHAR_TRADEMARK 957 +#define IMG_CHAR_CURSOR 958 +#define IMG_CHAR_BUTTON 959 +#define IMG_CHAR_UP 960 +#define IMG_CHAR_DOWN 961 +#define IMG_STEEL_CHAR_SPACE 962 +#define IMG_STEEL_CHAR_SPACE_EDITOR 963 +#define IMG_STEEL_CHAR_EXCLAM 964 +#define IMG_STEEL_CHAR_QUOTEDBL 965 +#define IMG_STEEL_CHAR_NUMBERSIGN 966 +#define IMG_STEEL_CHAR_DOLLAR 967 +#define IMG_STEEL_CHAR_PERCENT 968 +#define IMG_STEEL_CHAR_AMPERSAND 969 +#define IMG_STEEL_CHAR_APOSTROPHE 970 +#define IMG_STEEL_CHAR_PARENLEFT 971 +#define IMG_STEEL_CHAR_PARENRIGHT 972 +#define IMG_STEEL_CHAR_ASTERISK 973 +#define IMG_STEEL_CHAR_PLUS 974 +#define IMG_STEEL_CHAR_COMMA 975 +#define IMG_STEEL_CHAR_MINUS 976 +#define IMG_STEEL_CHAR_PERIOD 977 +#define IMG_STEEL_CHAR_SLASH 978 +#define IMG_STEEL_CHAR_0 979 +#define IMG_STEEL_CHAR_1 980 +#define IMG_STEEL_CHAR_2 981 +#define IMG_STEEL_CHAR_3 982 +#define IMG_STEEL_CHAR_4 983 +#define IMG_STEEL_CHAR_5 984 +#define IMG_STEEL_CHAR_6 985 +#define IMG_STEEL_CHAR_7 986 +#define IMG_STEEL_CHAR_8 987 +#define IMG_STEEL_CHAR_9 988 +#define IMG_STEEL_CHAR_COLON 989 +#define IMG_STEEL_CHAR_SEMICOLON 990 +#define IMG_STEEL_CHAR_LESS 991 +#define IMG_STEEL_CHAR_EQUAL 992 +#define IMG_STEEL_CHAR_GREATER 993 +#define IMG_STEEL_CHAR_QUESTION 994 +#define IMG_STEEL_CHAR_AT 995 +#define IMG_STEEL_CHAR_A 996 +#define IMG_STEEL_CHAR_B 997 +#define IMG_STEEL_CHAR_C 998 +#define IMG_STEEL_CHAR_D 999 +#define IMG_STEEL_CHAR_E 1000 +#define IMG_STEEL_CHAR_F 1001 +#define IMG_STEEL_CHAR_G 1002 +#define IMG_STEEL_CHAR_H 1003 +#define IMG_STEEL_CHAR_I 1004 +#define IMG_STEEL_CHAR_J 1005 +#define IMG_STEEL_CHAR_K 1006 +#define IMG_STEEL_CHAR_L 1007 +#define IMG_STEEL_CHAR_M 1008 +#define IMG_STEEL_CHAR_N 1009 +#define IMG_STEEL_CHAR_O 1010 +#define IMG_STEEL_CHAR_P 1011 +#define IMG_STEEL_CHAR_Q 1012 +#define IMG_STEEL_CHAR_R 1013 +#define IMG_STEEL_CHAR_S 1014 +#define IMG_STEEL_CHAR_T 1015 +#define IMG_STEEL_CHAR_U 1016 +#define IMG_STEEL_CHAR_V 1017 +#define IMG_STEEL_CHAR_W 1018 +#define IMG_STEEL_CHAR_X 1019 +#define IMG_STEEL_CHAR_Y 1020 +#define IMG_STEEL_CHAR_Z 1021 +#define IMG_STEEL_CHAR_BRACKETLEFT 1022 +#define IMG_STEEL_CHAR_BACKSLASH 1023 +#define IMG_STEEL_CHAR_BRACKETRIGHT 1024 +#define IMG_STEEL_CHAR_ASCIICIRCUM 1025 +#define IMG_STEEL_CHAR_UNDERSCORE 1026 +#define IMG_STEEL_CHAR_COPYRIGHT 1027 +#define IMG_STEEL_CHAR_AUMLAUT 1028 +#define IMG_STEEL_CHAR_OUMLAUT 1029 +#define IMG_STEEL_CHAR_UUMLAUT 1030 +#define IMG_STEEL_CHAR_DEGREE 1031 +#define IMG_STEEL_CHAR_TRADEMARK 1032 +#define IMG_STEEL_CHAR_CURSOR 1033 +#define IMG_STEEL_CHAR_BUTTON 1034 +#define IMG_STEEL_CHAR_UP 1035 +#define IMG_STEEL_CHAR_DOWN 1036 +#define IMG_CUSTOM_1 1037 +#define IMG_CUSTOM_1_EDITOR 1038 +#define IMG_CUSTOM_2 1039 +#define IMG_CUSTOM_2_EDITOR 1040 +#define IMG_CUSTOM_3 1041 +#define IMG_CUSTOM_3_EDITOR 1042 +#define IMG_CUSTOM_4 1043 +#define IMG_CUSTOM_4_EDITOR 1044 +#define IMG_CUSTOM_5 1045 +#define IMG_CUSTOM_5_EDITOR 1046 +#define IMG_CUSTOM_6 1047 +#define IMG_CUSTOM_6_EDITOR 1048 +#define IMG_CUSTOM_7 1049 +#define IMG_CUSTOM_7_EDITOR 1050 +#define IMG_CUSTOM_8 1051 +#define IMG_CUSTOM_8_EDITOR 1052 +#define IMG_CUSTOM_9 1053 +#define IMG_CUSTOM_9_EDITOR 1054 +#define IMG_CUSTOM_10 1055 +#define IMG_CUSTOM_10_EDITOR 1056 +#define IMG_CUSTOM_11 1057 +#define IMG_CUSTOM_11_EDITOR 1058 +#define IMG_CUSTOM_12 1059 +#define IMG_CUSTOM_12_EDITOR 1060 +#define IMG_CUSTOM_13 1061 +#define IMG_CUSTOM_13_EDITOR 1062 +#define IMG_CUSTOM_14 1063 +#define IMG_CUSTOM_14_EDITOR 1064 +#define IMG_CUSTOM_15 1065 +#define IMG_CUSTOM_15_EDITOR 1066 +#define IMG_CUSTOM_16 1067 +#define IMG_CUSTOM_16_EDITOR 1068 +#define IMG_CUSTOM_17 1069 +#define IMG_CUSTOM_17_EDITOR 1070 +#define IMG_CUSTOM_18 1071 +#define IMG_CUSTOM_18_EDITOR 1072 +#define IMG_CUSTOM_19 1073 +#define IMG_CUSTOM_19_EDITOR 1074 +#define IMG_CUSTOM_20 1075 +#define IMG_CUSTOM_20_EDITOR 1076 +#define IMG_CUSTOM_21 1077 +#define IMG_CUSTOM_21_EDITOR 1078 +#define IMG_CUSTOM_22 1079 +#define IMG_CUSTOM_22_EDITOR 1080 +#define IMG_CUSTOM_23 1081 +#define IMG_CUSTOM_23_EDITOR 1082 +#define IMG_CUSTOM_24 1083 +#define IMG_CUSTOM_24_EDITOR 1084 +#define IMG_CUSTOM_25 1085 +#define IMG_CUSTOM_25_EDITOR 1086 +#define IMG_CUSTOM_26 1087 +#define IMG_CUSTOM_26_EDITOR 1088 +#define IMG_CUSTOM_27 1089 +#define IMG_CUSTOM_27_EDITOR 1090 +#define IMG_CUSTOM_28 1091 +#define IMG_CUSTOM_28_EDITOR 1092 +#define IMG_CUSTOM_29 1093 +#define IMG_CUSTOM_29_EDITOR 1094 +#define IMG_CUSTOM_30 1095 +#define IMG_CUSTOM_30_EDITOR 1096 +#define IMG_CUSTOM_31 1097 +#define IMG_CUSTOM_31_EDITOR 1098 +#define IMG_CUSTOM_32 1099 +#define IMG_CUSTOM_32_EDITOR 1100 +#define IMG_CUSTOM_33 1101 +#define IMG_CUSTOM_33_EDITOR 1102 +#define IMG_CUSTOM_34 1103 +#define IMG_CUSTOM_34_EDITOR 1104 +#define IMG_CUSTOM_35 1105 +#define IMG_CUSTOM_35_EDITOR 1106 +#define IMG_CUSTOM_36 1107 +#define IMG_CUSTOM_36_EDITOR 1108 +#define IMG_CUSTOM_37 1109 +#define IMG_CUSTOM_37_EDITOR 1110 +#define IMG_CUSTOM_38 1111 +#define IMG_CUSTOM_38_EDITOR 1112 +#define IMG_CUSTOM_39 1113 +#define IMG_CUSTOM_39_EDITOR 1114 +#define IMG_CUSTOM_40 1115 +#define IMG_CUSTOM_40_EDITOR 1116 +#define IMG_CUSTOM_41 1117 +#define IMG_CUSTOM_41_EDITOR 1118 +#define IMG_CUSTOM_42 1119 +#define IMG_CUSTOM_42_EDITOR 1120 +#define IMG_CUSTOM_43 1121 +#define IMG_CUSTOM_43_EDITOR 1122 +#define IMG_CUSTOM_44 1123 +#define IMG_CUSTOM_44_EDITOR 1124 +#define IMG_CUSTOM_45 1125 +#define IMG_CUSTOM_45_EDITOR 1126 +#define IMG_CUSTOM_46 1127 +#define IMG_CUSTOM_46_EDITOR 1128 +#define IMG_CUSTOM_47 1129 +#define IMG_CUSTOM_47_EDITOR 1130 +#define IMG_CUSTOM_48 1131 +#define IMG_CUSTOM_48_EDITOR 1132 +#define IMG_CUSTOM_49 1133 +#define IMG_CUSTOM_49_EDITOR 1134 +#define IMG_CUSTOM_50 1135 +#define IMG_CUSTOM_50_EDITOR 1136 +#define IMG_CUSTOM_51 1137 +#define IMG_CUSTOM_51_EDITOR 1138 +#define IMG_CUSTOM_52 1139 +#define IMG_CUSTOM_52_EDITOR 1140 +#define IMG_CUSTOM_53 1141 +#define IMG_CUSTOM_53_EDITOR 1142 +#define IMG_CUSTOM_54 1143 +#define IMG_CUSTOM_54_EDITOR 1144 +#define IMG_CUSTOM_55 1145 +#define IMG_CUSTOM_55_EDITOR 1146 +#define IMG_CUSTOM_56 1147 +#define IMG_CUSTOM_56_EDITOR 1148 +#define IMG_CUSTOM_57 1149 +#define IMG_CUSTOM_57_EDITOR 1150 +#define IMG_CUSTOM_58 1151 +#define IMG_CUSTOM_58_EDITOR 1152 +#define IMG_CUSTOM_59 1153 +#define IMG_CUSTOM_59_EDITOR 1154 +#define IMG_CUSTOM_60 1155 +#define IMG_CUSTOM_60_EDITOR 1156 +#define IMG_CUSTOM_61 1157 +#define IMG_CUSTOM_61_EDITOR 1158 +#define IMG_CUSTOM_62 1159 +#define IMG_CUSTOM_62_EDITOR 1160 +#define IMG_CUSTOM_63 1161 +#define IMG_CUSTOM_63_EDITOR 1162 +#define IMG_CUSTOM_64 1163 +#define IMG_CUSTOM_64_EDITOR 1164 +#define IMG_CUSTOM_65 1165 +#define IMG_CUSTOM_65_EDITOR 1166 +#define IMG_CUSTOM_66 1167 +#define IMG_CUSTOM_66_EDITOR 1168 +#define IMG_CUSTOM_67 1169 +#define IMG_CUSTOM_67_EDITOR 1170 +#define IMG_CUSTOM_68 1171 +#define IMG_CUSTOM_68_EDITOR 1172 +#define IMG_CUSTOM_69 1173 +#define IMG_CUSTOM_69_EDITOR 1174 +#define IMG_CUSTOM_70 1175 +#define IMG_CUSTOM_70_EDITOR 1176 +#define IMG_CUSTOM_71 1177 +#define IMG_CUSTOM_71_EDITOR 1178 +#define IMG_CUSTOM_72 1179 +#define IMG_CUSTOM_72_EDITOR 1180 +#define IMG_CUSTOM_73 1181 +#define IMG_CUSTOM_73_EDITOR 1182 +#define IMG_CUSTOM_74 1183 +#define IMG_CUSTOM_74_EDITOR 1184 +#define IMG_CUSTOM_75 1185 +#define IMG_CUSTOM_75_EDITOR 1186 +#define IMG_CUSTOM_76 1187 +#define IMG_CUSTOM_76_EDITOR 1188 +#define IMG_CUSTOM_77 1189 +#define IMG_CUSTOM_77_EDITOR 1190 +#define IMG_CUSTOM_78 1191 +#define IMG_CUSTOM_78_EDITOR 1192 +#define IMG_CUSTOM_79 1193 +#define IMG_CUSTOM_79_EDITOR 1194 +#define IMG_CUSTOM_80 1195 +#define IMG_CUSTOM_80_EDITOR 1196 +#define IMG_CUSTOM_81 1197 +#define IMG_CUSTOM_81_EDITOR 1198 +#define IMG_CUSTOM_82 1199 +#define IMG_CUSTOM_82_EDITOR 1200 +#define IMG_CUSTOM_83 1201 +#define IMG_CUSTOM_83_EDITOR 1202 +#define IMG_CUSTOM_84 1203 +#define IMG_CUSTOM_84_EDITOR 1204 +#define IMG_CUSTOM_85 1205 +#define IMG_CUSTOM_85_EDITOR 1206 +#define IMG_CUSTOM_86 1207 +#define IMG_CUSTOM_86_EDITOR 1208 +#define IMG_CUSTOM_87 1209 +#define IMG_CUSTOM_87_EDITOR 1210 +#define IMG_CUSTOM_88 1211 +#define IMG_CUSTOM_88_EDITOR 1212 +#define IMG_CUSTOM_89 1213 +#define IMG_CUSTOM_89_EDITOR 1214 +#define IMG_CUSTOM_90 1215 +#define IMG_CUSTOM_90_EDITOR 1216 +#define IMG_CUSTOM_91 1217 +#define IMG_CUSTOM_91_EDITOR 1218 +#define IMG_CUSTOM_92 1219 +#define IMG_CUSTOM_92_EDITOR 1220 +#define IMG_CUSTOM_93 1221 +#define IMG_CUSTOM_93_EDITOR 1222 +#define IMG_CUSTOM_94 1223 +#define IMG_CUSTOM_94_EDITOR 1224 +#define IMG_CUSTOM_95 1225 +#define IMG_CUSTOM_95_EDITOR 1226 +#define IMG_CUSTOM_96 1227 +#define IMG_CUSTOM_96_EDITOR 1228 +#define IMG_CUSTOM_97 1229 +#define IMG_CUSTOM_97_EDITOR 1230 +#define IMG_CUSTOM_98 1231 +#define IMG_CUSTOM_98_EDITOR 1232 +#define IMG_CUSTOM_99 1233 +#define IMG_CUSTOM_99_EDITOR 1234 +#define IMG_CUSTOM_100 1235 +#define IMG_CUSTOM_100_EDITOR 1236 +#define IMG_CUSTOM_101 1237 +#define IMG_CUSTOM_101_EDITOR 1238 +#define IMG_CUSTOM_102 1239 +#define IMG_CUSTOM_102_EDITOR 1240 +#define IMG_CUSTOM_103 1241 +#define IMG_CUSTOM_103_EDITOR 1242 +#define IMG_CUSTOM_104 1243 +#define IMG_CUSTOM_104_EDITOR 1244 +#define IMG_CUSTOM_105 1245 +#define IMG_CUSTOM_105_EDITOR 1246 +#define IMG_CUSTOM_106 1247 +#define IMG_CUSTOM_106_EDITOR 1248 +#define IMG_CUSTOM_107 1249 +#define IMG_CUSTOM_107_EDITOR 1250 +#define IMG_CUSTOM_108 1251 +#define IMG_CUSTOM_108_EDITOR 1252 +#define IMG_CUSTOM_109 1253 +#define IMG_CUSTOM_109_EDITOR 1254 +#define IMG_CUSTOM_110 1255 +#define IMG_CUSTOM_110_EDITOR 1256 +#define IMG_CUSTOM_111 1257 +#define IMG_CUSTOM_111_EDITOR 1258 +#define IMG_CUSTOM_112 1259 +#define IMG_CUSTOM_112_EDITOR 1260 +#define IMG_CUSTOM_113 1261 +#define IMG_CUSTOM_113_EDITOR 1262 +#define IMG_CUSTOM_114 1263 +#define IMG_CUSTOM_114_EDITOR 1264 +#define IMG_CUSTOM_115 1265 +#define IMG_CUSTOM_115_EDITOR 1266 +#define IMG_CUSTOM_116 1267 +#define IMG_CUSTOM_116_EDITOR 1268 +#define IMG_CUSTOM_117 1269 +#define IMG_CUSTOM_117_EDITOR 1270 +#define IMG_CUSTOM_118 1271 +#define IMG_CUSTOM_118_EDITOR 1272 +#define IMG_CUSTOM_119 1273 +#define IMG_CUSTOM_119_EDITOR 1274 +#define IMG_CUSTOM_120 1275 +#define IMG_CUSTOM_120_EDITOR 1276 +#define IMG_CUSTOM_121 1277 +#define IMG_CUSTOM_121_EDITOR 1278 +#define IMG_CUSTOM_122 1279 +#define IMG_CUSTOM_122_EDITOR 1280 +#define IMG_CUSTOM_123 1281 +#define IMG_CUSTOM_123_EDITOR 1282 +#define IMG_CUSTOM_124 1283 +#define IMG_CUSTOM_124_EDITOR 1284 +#define IMG_CUSTOM_125 1285 +#define IMG_CUSTOM_125_EDITOR 1286 +#define IMG_CUSTOM_126 1287 +#define IMG_CUSTOM_126_EDITOR 1288 +#define IMG_CUSTOM_127 1289 +#define IMG_CUSTOM_127_EDITOR 1290 +#define IMG_CUSTOM_128 1291 +#define IMG_CUSTOM_128_EDITOR 1292 +#define IMG_CUSTOM_129 1293 +#define IMG_CUSTOM_129_EDITOR 1294 +#define IMG_CUSTOM_130 1295 +#define IMG_CUSTOM_130_EDITOR 1296 +#define IMG_CUSTOM_131 1297 +#define IMG_CUSTOM_131_EDITOR 1298 +#define IMG_CUSTOM_132 1299 +#define IMG_CUSTOM_132_EDITOR 1300 +#define IMG_CUSTOM_133 1301 +#define IMG_CUSTOM_133_EDITOR 1302 +#define IMG_CUSTOM_134 1303 +#define IMG_CUSTOM_134_EDITOR 1304 +#define IMG_CUSTOM_135 1305 +#define IMG_CUSTOM_135_EDITOR 1306 +#define IMG_CUSTOM_136 1307 +#define IMG_CUSTOM_136_EDITOR 1308 +#define IMG_CUSTOM_137 1309 +#define IMG_CUSTOM_137_EDITOR 1310 +#define IMG_CUSTOM_138 1311 +#define IMG_CUSTOM_138_EDITOR 1312 +#define IMG_CUSTOM_139 1313 +#define IMG_CUSTOM_139_EDITOR 1314 +#define IMG_CUSTOM_140 1315 +#define IMG_CUSTOM_140_EDITOR 1316 +#define IMG_CUSTOM_141 1317 +#define IMG_CUSTOM_141_EDITOR 1318 +#define IMG_CUSTOM_142 1319 +#define IMG_CUSTOM_142_EDITOR 1320 +#define IMG_CUSTOM_143 1321 +#define IMG_CUSTOM_143_EDITOR 1322 +#define IMG_CUSTOM_144 1323 +#define IMG_CUSTOM_144_EDITOR 1324 +#define IMG_CUSTOM_145 1325 +#define IMG_CUSTOM_145_EDITOR 1326 +#define IMG_CUSTOM_146 1327 +#define IMG_CUSTOM_146_EDITOR 1328 +#define IMG_CUSTOM_147 1329 +#define IMG_CUSTOM_147_EDITOR 1330 +#define IMG_CUSTOM_148 1331 +#define IMG_CUSTOM_148_EDITOR 1332 +#define IMG_CUSTOM_149 1333 +#define IMG_CUSTOM_149_EDITOR 1334 +#define IMG_CUSTOM_150 1335 +#define IMG_CUSTOM_150_EDITOR 1336 +#define IMG_CUSTOM_151 1337 +#define IMG_CUSTOM_151_EDITOR 1338 +#define IMG_CUSTOM_152 1339 +#define IMG_CUSTOM_152_EDITOR 1340 +#define IMG_CUSTOM_153 1341 +#define IMG_CUSTOM_153_EDITOR 1342 +#define IMG_CUSTOM_154 1343 +#define IMG_CUSTOM_154_EDITOR 1344 +#define IMG_CUSTOM_155 1345 +#define IMG_CUSTOM_155_EDITOR 1346 +#define IMG_CUSTOM_156 1347 +#define IMG_CUSTOM_156_EDITOR 1348 +#define IMG_CUSTOM_157 1349 +#define IMG_CUSTOM_157_EDITOR 1350 +#define IMG_CUSTOM_158 1351 +#define IMG_CUSTOM_158_EDITOR 1352 +#define IMG_CUSTOM_159 1353 +#define IMG_CUSTOM_159_EDITOR 1354 +#define IMG_CUSTOM_160 1355 +#define IMG_CUSTOM_160_EDITOR 1356 +#define IMG_CUSTOM_161 1357 +#define IMG_CUSTOM_161_EDITOR 1358 +#define IMG_CUSTOM_162 1359 +#define IMG_CUSTOM_162_EDITOR 1360 +#define IMG_CUSTOM_163 1361 +#define IMG_CUSTOM_163_EDITOR 1362 +#define IMG_CUSTOM_164 1363 +#define IMG_CUSTOM_164_EDITOR 1364 +#define IMG_CUSTOM_165 1365 +#define IMG_CUSTOM_165_EDITOR 1366 +#define IMG_CUSTOM_166 1367 +#define IMG_CUSTOM_166_EDITOR 1368 +#define IMG_CUSTOM_167 1369 +#define IMG_CUSTOM_167_EDITOR 1370 +#define IMG_CUSTOM_168 1371 +#define IMG_CUSTOM_168_EDITOR 1372 +#define IMG_CUSTOM_169 1373 +#define IMG_CUSTOM_169_EDITOR 1374 +#define IMG_CUSTOM_170 1375 +#define IMG_CUSTOM_170_EDITOR 1376 +#define IMG_CUSTOM_171 1377 +#define IMG_CUSTOM_171_EDITOR 1378 +#define IMG_CUSTOM_172 1379 +#define IMG_CUSTOM_172_EDITOR 1380 +#define IMG_CUSTOM_173 1381 +#define IMG_CUSTOM_173_EDITOR 1382 +#define IMG_CUSTOM_174 1383 +#define IMG_CUSTOM_174_EDITOR 1384 +#define IMG_CUSTOM_175 1385 +#define IMG_CUSTOM_175_EDITOR 1386 +#define IMG_CUSTOM_176 1387 +#define IMG_CUSTOM_176_EDITOR 1388 +#define IMG_CUSTOM_177 1389 +#define IMG_CUSTOM_177_EDITOR 1390 +#define IMG_CUSTOM_178 1391 +#define IMG_CUSTOM_178_EDITOR 1392 +#define IMG_CUSTOM_179 1393 +#define IMG_CUSTOM_179_EDITOR 1394 +#define IMG_CUSTOM_180 1395 +#define IMG_CUSTOM_180_EDITOR 1396 +#define IMG_CUSTOM_181 1397 +#define IMG_CUSTOM_181_EDITOR 1398 +#define IMG_CUSTOM_182 1399 +#define IMG_CUSTOM_182_EDITOR 1400 +#define IMG_CUSTOM_183 1401 +#define IMG_CUSTOM_183_EDITOR 1402 +#define IMG_CUSTOM_184 1403 +#define IMG_CUSTOM_184_EDITOR 1404 +#define IMG_CUSTOM_185 1405 +#define IMG_CUSTOM_185_EDITOR 1406 +#define IMG_CUSTOM_186 1407 +#define IMG_CUSTOM_186_EDITOR 1408 +#define IMG_CUSTOM_187 1409 +#define IMG_CUSTOM_187_EDITOR 1410 +#define IMG_CUSTOM_188 1411 +#define IMG_CUSTOM_188_EDITOR 1412 +#define IMG_CUSTOM_189 1413 +#define IMG_CUSTOM_189_EDITOR 1414 +#define IMG_CUSTOM_190 1415 +#define IMG_CUSTOM_190_EDITOR 1416 +#define IMG_CUSTOM_191 1417 +#define IMG_CUSTOM_191_EDITOR 1418 +#define IMG_CUSTOM_192 1419 +#define IMG_CUSTOM_192_EDITOR 1420 +#define IMG_CUSTOM_193 1421 +#define IMG_CUSTOM_193_EDITOR 1422 +#define IMG_CUSTOM_194 1423 +#define IMG_CUSTOM_194_EDITOR 1424 +#define IMG_CUSTOM_195 1425 +#define IMG_CUSTOM_195_EDITOR 1426 +#define IMG_CUSTOM_196 1427 +#define IMG_CUSTOM_196_EDITOR 1428 +#define IMG_CUSTOM_197 1429 +#define IMG_CUSTOM_197_EDITOR 1430 +#define IMG_CUSTOM_198 1431 +#define IMG_CUSTOM_198_EDITOR 1432 +#define IMG_CUSTOM_199 1433 +#define IMG_CUSTOM_199_EDITOR 1434 +#define IMG_CUSTOM_200 1435 +#define IMG_CUSTOM_200_EDITOR 1436 +#define IMG_CUSTOM_201 1437 +#define IMG_CUSTOM_201_EDITOR 1438 +#define IMG_CUSTOM_202 1439 +#define IMG_CUSTOM_202_EDITOR 1440 +#define IMG_CUSTOM_203 1441 +#define IMG_CUSTOM_203_EDITOR 1442 +#define IMG_CUSTOM_204 1443 +#define IMG_CUSTOM_204_EDITOR 1444 +#define IMG_CUSTOM_205 1445 +#define IMG_CUSTOM_205_EDITOR 1446 +#define IMG_CUSTOM_206 1447 +#define IMG_CUSTOM_206_EDITOR 1448 +#define IMG_CUSTOM_207 1449 +#define IMG_CUSTOM_207_EDITOR 1450 +#define IMG_CUSTOM_208 1451 +#define IMG_CUSTOM_208_EDITOR 1452 +#define IMG_CUSTOM_209 1453 +#define IMG_CUSTOM_209_EDITOR 1454 +#define IMG_CUSTOM_210 1455 +#define IMG_CUSTOM_210_EDITOR 1456 +#define IMG_CUSTOM_211 1457 +#define IMG_CUSTOM_211_EDITOR 1458 +#define IMG_CUSTOM_212 1459 +#define IMG_CUSTOM_212_EDITOR 1460 +#define IMG_CUSTOM_213 1461 +#define IMG_CUSTOM_213_EDITOR 1462 +#define IMG_CUSTOM_214 1463 +#define IMG_CUSTOM_214_EDITOR 1464 +#define IMG_CUSTOM_215 1465 +#define IMG_CUSTOM_215_EDITOR 1466 +#define IMG_CUSTOM_216 1467 +#define IMG_CUSTOM_216_EDITOR 1468 +#define IMG_CUSTOM_217 1469 +#define IMG_CUSTOM_217_EDITOR 1470 +#define IMG_CUSTOM_218 1471 +#define IMG_CUSTOM_218_EDITOR 1472 +#define IMG_CUSTOM_219 1473 +#define IMG_CUSTOM_219_EDITOR 1474 +#define IMG_CUSTOM_220 1475 +#define IMG_CUSTOM_220_EDITOR 1476 +#define IMG_CUSTOM_221 1477 +#define IMG_CUSTOM_221_EDITOR 1478 +#define IMG_CUSTOM_222 1479 +#define IMG_CUSTOM_222_EDITOR 1480 +#define IMG_CUSTOM_223 1481 +#define IMG_CUSTOM_223_EDITOR 1482 +#define IMG_CUSTOM_224 1483 +#define IMG_CUSTOM_224_EDITOR 1484 +#define IMG_CUSTOM_225 1485 +#define IMG_CUSTOM_225_EDITOR 1486 +#define IMG_CUSTOM_226 1487 +#define IMG_CUSTOM_226_EDITOR 1488 +#define IMG_CUSTOM_227 1489 +#define IMG_CUSTOM_227_EDITOR 1490 +#define IMG_CUSTOM_228 1491 +#define IMG_CUSTOM_228_EDITOR 1492 +#define IMG_CUSTOM_229 1493 +#define IMG_CUSTOM_229_EDITOR 1494 +#define IMG_CUSTOM_230 1495 +#define IMG_CUSTOM_230_EDITOR 1496 +#define IMG_CUSTOM_231 1497 +#define IMG_CUSTOM_231_EDITOR 1498 +#define IMG_CUSTOM_232 1499 +#define IMG_CUSTOM_232_EDITOR 1500 +#define IMG_CUSTOM_233 1501 +#define IMG_CUSTOM_233_EDITOR 1502 +#define IMG_CUSTOM_234 1503 +#define IMG_CUSTOM_234_EDITOR 1504 +#define IMG_CUSTOM_235 1505 +#define IMG_CUSTOM_235_EDITOR 1506 +#define IMG_CUSTOM_236 1507 +#define IMG_CUSTOM_236_EDITOR 1508 +#define IMG_CUSTOM_237 1509 +#define IMG_CUSTOM_237_EDITOR 1510 +#define IMG_CUSTOM_238 1511 +#define IMG_CUSTOM_238_EDITOR 1512 +#define IMG_CUSTOM_239 1513 +#define IMG_CUSTOM_239_EDITOR 1514 +#define IMG_CUSTOM_240 1515 +#define IMG_CUSTOM_240_EDITOR 1516 +#define IMG_CUSTOM_241 1517 +#define IMG_CUSTOM_241_EDITOR 1518 +#define IMG_CUSTOM_242 1519 +#define IMG_CUSTOM_242_EDITOR 1520 +#define IMG_CUSTOM_243 1521 +#define IMG_CUSTOM_243_EDITOR 1522 +#define IMG_CUSTOM_244 1523 +#define IMG_CUSTOM_244_EDITOR 1524 +#define IMG_CUSTOM_245 1525 +#define IMG_CUSTOM_245_EDITOR 1526 +#define IMG_CUSTOM_246 1527 +#define IMG_CUSTOM_246_EDITOR 1528 +#define IMG_CUSTOM_247 1529 +#define IMG_CUSTOM_247_EDITOR 1530 +#define IMG_CUSTOM_248 1531 +#define IMG_CUSTOM_248_EDITOR 1532 +#define IMG_CUSTOM_249 1533 +#define IMG_CUSTOM_249_EDITOR 1534 +#define IMG_CUSTOM_250 1535 +#define IMG_CUSTOM_250_EDITOR 1536 +#define IMG_CUSTOM_251 1537 +#define IMG_CUSTOM_251_EDITOR 1538 +#define IMG_CUSTOM_252 1539 +#define IMG_CUSTOM_252_EDITOR 1540 +#define IMG_CUSTOM_253 1541 +#define IMG_CUSTOM_253_EDITOR 1542 +#define IMG_CUSTOM_254 1543 +#define IMG_CUSTOM_254_EDITOR 1544 +#define IMG_CUSTOM_255 1545 +#define IMG_CUSTOM_255_EDITOR 1546 +#define IMG_CUSTOM_256 1547 +#define IMG_CUSTOM_256_EDITOR 1548 +#define IMG_GROUP_1 1549 +#define IMG_GROUP_1_EDITOR 1550 +#define IMG_GROUP_2 1551 +#define IMG_GROUP_2_EDITOR 1552 +#define IMG_GROUP_3 1553 +#define IMG_GROUP_3_EDITOR 1554 +#define IMG_GROUP_4 1555 +#define IMG_GROUP_4_EDITOR 1556 +#define IMG_GROUP_5 1557 +#define IMG_GROUP_5_EDITOR 1558 +#define IMG_GROUP_6 1559 +#define IMG_GROUP_6_EDITOR 1560 +#define IMG_GROUP_7 1561 +#define IMG_GROUP_7_EDITOR 1562 +#define IMG_GROUP_8 1563 +#define IMG_GROUP_8_EDITOR 1564 +#define IMG_GROUP_9 1565 +#define IMG_GROUP_9_EDITOR 1566 +#define IMG_GROUP_10 1567 +#define IMG_GROUP_10_EDITOR 1568 +#define IMG_GROUP_11 1569 +#define IMG_GROUP_11_EDITOR 1570 +#define IMG_GROUP_12 1571 +#define IMG_GROUP_12_EDITOR 1572 +#define IMG_GROUP_13 1573 +#define IMG_GROUP_13_EDITOR 1574 +#define IMG_GROUP_14 1575 +#define IMG_GROUP_14_EDITOR 1576 +#define IMG_GROUP_15 1577 +#define IMG_GROUP_15_EDITOR 1578 +#define IMG_GROUP_16 1579 +#define IMG_GROUP_16_EDITOR 1580 +#define IMG_GROUP_17 1581 +#define IMG_GROUP_17_EDITOR 1582 +#define IMG_GROUP_18 1583 +#define IMG_GROUP_18_EDITOR 1584 +#define IMG_GROUP_19 1585 +#define IMG_GROUP_19_EDITOR 1586 +#define IMG_GROUP_20 1587 +#define IMG_GROUP_20_EDITOR 1588 +#define IMG_GROUP_21 1589 +#define IMG_GROUP_21_EDITOR 1590 +#define IMG_GROUP_22 1591 +#define IMG_GROUP_22_EDITOR 1592 +#define IMG_GROUP_23 1593 +#define IMG_GROUP_23_EDITOR 1594 +#define IMG_GROUP_24 1595 +#define IMG_GROUP_24_EDITOR 1596 +#define IMG_GROUP_25 1597 +#define IMG_GROUP_25_EDITOR 1598 +#define IMG_GROUP_26 1599 +#define IMG_GROUP_26_EDITOR 1600 +#define IMG_GROUP_27 1601 +#define IMG_GROUP_27_EDITOR 1602 +#define IMG_GROUP_28 1603 +#define IMG_GROUP_28_EDITOR 1604 +#define IMG_GROUP_29 1605 +#define IMG_GROUP_29_EDITOR 1606 +#define IMG_GROUP_30 1607 +#define IMG_GROUP_30_EDITOR 1608 +#define IMG_GROUP_31 1609 +#define IMG_GROUP_31_EDITOR 1610 +#define IMG_GROUP_32 1611 +#define IMG_GROUP_32_EDITOR 1612 +#define IMG_EMC_OBJECT 1613 +#define IMG_EMC_SPRITE 1614 +#define IMG_TOON_1 1615 +#define IMG_TOON_2 1616 +#define IMG_TOON_3 1617 +#define IMG_TOON_4 1618 +#define IMG_TOON_5 1619 +#define IMG_TOON_6 1620 +#define IMG_TOON_7 1621 +#define IMG_TOON_8 1622 +#define IMG_TOON_9 1623 +#define IMG_TOON_10 1624 +#define IMG_TOON_11 1625 +#define IMG_TOON_12 1626 +#define IMG_TOON_13 1627 +#define IMG_TOON_14 1628 +#define IMG_TOON_15 1629 +#define IMG_TOON_16 1630 +#define IMG_TOON_17 1631 +#define IMG_TOON_18 1632 +#define IMG_TOON_19 1633 +#define IMG_TOON_20 1634 +#define IMG_MENU_CALIBRATE_RED 1635 +#define IMG_MENU_CALIBRATE_BLUE 1636 +#define IMG_MENU_CALIBRATE_YELLOW 1637 +#define IMG_MENU_BUTTON 1638 +#define IMG_MENU_BUTTON_ACTIVE 1639 +#define IMG_MENU_BUTTON_LEFT 1640 +#define IMG_MENU_BUTTON_LEFT_ACTIVE 1641 +#define IMG_MENU_BUTTON_RIGHT 1642 +#define IMG_MENU_BUTTON_RIGHT_ACTIVE 1643 +#define IMG_MENU_BUTTON_UP 1644 +#define IMG_MENU_BUTTON_UP_ACTIVE 1645 +#define IMG_MENU_BUTTON_DOWN 1646 +#define IMG_MENU_BUTTON_DOWN_ACTIVE 1647 +#define IMG_MENU_BUTTON_ENTER_MENU 1648 +#define IMG_MENU_BUTTON_ENTER_MENU_ACTIVE 1649 +#define IMG_MENU_BUTTON_LEAVE_MENU 1650 +#define IMG_MENU_BUTTON_LEAVE_MENU_ACTIVE 1651 +#define IMG_MENU_BUTTON_NEXT_LEVEL 1652 +#define IMG_MENU_BUTTON_NEXT_LEVEL_ACTIVE 1653 +#define IMG_MENU_BUTTON_PREV_LEVEL 1654 +#define IMG_MENU_BUTTON_PREV_LEVEL_ACTIVE 1655 +#define IMG_MENU_BUTTON_NAME 1656 +#define IMG_MENU_BUTTON_NAME_ACTIVE 1657 +#define IMG_MENU_BUTTON_LEVELS 1658 +#define IMG_MENU_BUTTON_LEVELS_ACTIVE 1659 +#define IMG_MENU_BUTTON_SCORES 1660 +#define IMG_MENU_BUTTON_SCORES_ACTIVE 1661 +#define IMG_MENU_BUTTON_EDITOR 1662 +#define IMG_MENU_BUTTON_EDITOR_ACTIVE 1663 +#define IMG_MENU_BUTTON_INFO 1664 +#define IMG_MENU_BUTTON_INFO_ACTIVE 1665 +#define IMG_MENU_BUTTON_GAME 1666 +#define IMG_MENU_BUTTON_GAME_ACTIVE 1667 +#define IMG_MENU_BUTTON_SETUP 1668 +#define IMG_MENU_BUTTON_SETUP_ACTIVE 1669 +#define IMG_MENU_BUTTON_QUIT 1670 +#define IMG_MENU_BUTTON_QUIT_ACTIVE 1671 +#define IMG_MENU_SCROLLBAR 1672 +#define IMG_MENU_SCROLLBAR_ACTIVE 1673 +#define IMG_FONT_INITIAL_1 1674 +#define IMG_FONT_INITIAL_2 1675 +#define IMG_FONT_INITIAL_3 1676 +#define IMG_FONT_INITIAL_4 1677 +#define IMG_FONT_TITLE_1 1678 +#define IMG_FONT_TITLE_2 1679 +#define IMG_FONT_TITLE_2_SETUP 1680 +#define IMG_FONT_MENU_1 1681 +#define IMG_FONT_MENU_1_ACTIVE 1682 +#define IMG_FONT_MENU_2 1683 +#define IMG_FONT_MENU_2_ACTIVE 1684 +#define IMG_FONT_TEXT_1 1685 +#define IMG_FONT_TEXT_1_MAIN 1686 +#define IMG_FONT_TEXT_1_LEVELS 1687 +#define IMG_FONT_TEXT_1_SETUP 1688 +#define IMG_FONT_TEXT_1_PREVIEW 1689 +#define IMG_FONT_TEXT_1_SCORES 1690 +#define IMG_FONT_TEXT_1_ACTIVE_SCORES 1691 +#define IMG_FONT_TEXT_1_PANEL 1692 +#define IMG_FONT_TEXT_1_DOOR 1693 +#define IMG_FONT_TEXT_2 1694 +#define IMG_FONT_TEXT_2_MAIN 1695 +#define IMG_FONT_TEXT_2_LEVELS 1696 +#define IMG_FONT_TEXT_2_SETUP 1697 +#define IMG_FONT_TEXT_2_PREVIEW 1698 +#define IMG_FONT_TEXT_2_SCORES 1699 +#define IMG_FONT_TEXT_2_ACTIVE_SCORES 1700 +#define IMG_FONT_TEXT_3 1701 +#define IMG_FONT_TEXT_3_LEVELS 1702 +#define IMG_FONT_TEXT_3_SETUP 1703 +#define IMG_FONT_TEXT_3_PREVIEW 1704 +#define IMG_FONT_TEXT_3_SCORES 1705 +#define IMG_FONT_TEXT_3_ACTIVE_SCORES 1706 +#define IMG_FONT_TEXT_4 1707 +#define IMG_FONT_TEXT_4_MAIN 1708 +#define IMG_FONT_TEXT_4_LEVELS 1709 +#define IMG_FONT_TEXT_4_SETUP 1710 +#define IMG_FONT_TEXT_4_SCORES 1711 +#define IMG_FONT_TEXT_4_ACTIVE_SCORES 1712 +#define IMG_FONT_ENVELOPE_1 1713 +#define IMG_FONT_ENVELOPE_2 1714 +#define IMG_FONT_ENVELOPE_3 1715 +#define IMG_FONT_ENVELOPE_4 1716 +#define IMG_FONT_INPUT_1 1717 +#define IMG_FONT_INPUT_1_MAIN 1718 +#define IMG_FONT_INPUT_1_ACTIVE 1719 +#define IMG_FONT_INPUT_1_ACTIVE_MAIN 1720 +#define IMG_FONT_INPUT_1_ACTIVE_SETUP 1721 +#define IMG_FONT_INPUT_2 1722 +#define IMG_FONT_INPUT_2_ACTIVE 1723 +#define IMG_FONT_OPTION_OFF 1724 +#define IMG_FONT_OPTION_ON 1725 +#define IMG_FONT_VALUE_1 1726 +#define IMG_FONT_VALUE_2 1727 +#define IMG_FONT_VALUE_OLD 1728 +#define IMG_FONT_LEVEL_NUMBER 1729 +#define IMG_FONT_LEVEL_NUMBER_ACTIVE 1730 +#define IMG_FONT_TAPE_RECORDER 1731 +#define IMG_FONT_GAME_INFO 1732 +#define IMG_FONT_INFO_ELEMENTS 1733 +#define IMG_FONT_INFO_LEVELSET 1734 +#define IMG_GLOBAL_BORDER 1735 +#define IMG_GLOBAL_DOOR 1736 +#define IMG_GLOBAL_BUSY 1737 +#define IMG_EDITOR_ELEMENT_BORDER 1738 +#define IMG_EDITOR_ELEMENT_BORDER_INPUT 1739 +#define IMG_EDITOR_CASCADE_LIST 1740 +#define IMG_EDITOR_CASCADE_LIST_ACTIVE 1741 +#define IMG_BACKGROUND 1742 +#define IMG_BACKGROUND_TITLE_INITIAL 1743 +#define IMG_BACKGROUND_TITLE 1744 +#define IMG_BACKGROUND_MAIN 1745 +#define IMG_BACKGROUND_LEVELS 1746 +#define IMG_BACKGROUND_SCORES 1747 +#define IMG_BACKGROUND_EDITOR 1748 +#define IMG_BACKGROUND_INFO 1749 +#define IMG_BACKGROUND_INFO_ELEMENTS 1750 +#define IMG_BACKGROUND_INFO_MUSIC 1751 +#define IMG_BACKGROUND_INFO_CREDITS 1752 +#define IMG_BACKGROUND_INFO_PROGRAM 1753 +#define IMG_BACKGROUND_INFO_VERSION 1754 +#define IMG_BACKGROUND_INFO_LEVELSET 1755 +#define IMG_BACKGROUND_SETUP 1756 +#define IMG_BACKGROUND_DOOR 1757 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_1 1758 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_2 1759 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_3 1760 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_4 1761 +#define IMG_BACKGROUND_TITLESCREEN_INITIAL_5 1762 +#define IMG_BACKGROUND_TITLESCREEN_1 1763 +#define IMG_BACKGROUND_TITLESCREEN_2 1764 +#define IMG_BACKGROUND_TITLESCREEN_3 1765 +#define IMG_BACKGROUND_TITLESCREEN_4 1766 +#define IMG_BACKGROUND_TITLESCREEN_5 1767 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_1 1768 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_2 1769 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_3 1770 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_4 1771 +#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_5 1772 +#define IMG_BACKGROUND_TITLEMESSAGE_1 1773 +#define IMG_BACKGROUND_TITLEMESSAGE_2 1774 +#define IMG_BACKGROUND_TITLEMESSAGE_3 1775 +#define IMG_BACKGROUND_TITLEMESSAGE_4 1776 +#define IMG_BACKGROUND_TITLEMESSAGE_5 1777 +#define IMG_BACKGROUND_ENVELOPE_1 1778 +#define IMG_BACKGROUND_ENVELOPE_2 1779 +#define IMG_BACKGROUND_ENVELOPE_3 1780 +#define IMG_BACKGROUND_ENVELOPE_4 1781 +#define IMG_TITLESCREEN_INITIAL_1 1782 +#define IMG_TITLESCREEN_INITIAL_2 1783 +#define IMG_TITLESCREEN_INITIAL_3 1784 +#define IMG_TITLESCREEN_INITIAL_4 1785 +#define IMG_TITLESCREEN_INITIAL_5 1786 +#define IMG_TITLESCREEN_1 1787 +#define IMG_TITLESCREEN_2 1788 +#define IMG_TITLESCREEN_3 1789 +#define IMG_TITLESCREEN_4 1790 +#define IMG_TITLESCREEN_5 1791 -#define NUM_IMAGE_FILES 1571 +#define NUM_IMAGE_FILES 1792 #endif /* CONF_GFX_H */ diff --git a/src/conf_mus.c b/src/conf_mus.c index 2d2cd8a9..934fd825 100644 --- a/src/conf_mus.c +++ b/src/conf_mus.c @@ -29,8 +29,8 @@ struct ConfigTypeInfo music_config_suffix[] = struct ConfigInfo music_config[] = { { "background", UNDEFINED_FILENAME }, + { "background.TITLE_INITIAL", UNDEFINED_FILENAME }, { "background.TITLE", UNDEFINED_FILENAME }, - { "background.MESSAGE", UNDEFINED_FILENAME }, { "background.MAIN", UNDEFINED_FILENAME }, { "background.LEVELS", UNDEFINED_FILENAME }, { "background.SCORES", UNDEFINED_FILENAME }, @@ -38,6 +38,27 @@ struct ConfigInfo music_config[] = { "background.INFO", "rhythmloop.wav" }, { "background.SETUP", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_1", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_2", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_3", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_4", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_5", UNDEFINED_FILENAME }, + { "background.titlescreen_1", UNDEFINED_FILENAME }, + { "background.titlescreen_2", UNDEFINED_FILENAME }, + { "background.titlescreen_3", UNDEFINED_FILENAME }, + { "background.titlescreen_4", UNDEFINED_FILENAME }, + { "background.titlescreen_5", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_1",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_2",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_3",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_4",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_5",UNDEFINED_FILENAME }, + { "background.titlemessage_1", UNDEFINED_FILENAME }, + { "background.titlemessage_2", UNDEFINED_FILENAME }, + { "background.titlemessage_3", UNDEFINED_FILENAME }, + { "background.titlemessage_4", UNDEFINED_FILENAME }, + { "background.titlemessage_5", UNDEFINED_FILENAME }, + /* there is no definition for "background.PLAYING", because this would prevent selecting music from music directory that is not defined in "musicinfo.conf", when no default music is defined here */ diff --git a/src/conf_mus.h b/src/conf_mus.h index 6c7f9352..1c3c5531 100644 --- a/src/conf_mus.h +++ b/src/conf_mus.h @@ -19,15 +19,35 @@ /* values for music configuration */ #define MUS_BACKGROUND 0 -#define MUS_BACKGROUND_TITLE 1 -#define MUS_BACKGROUND_MESSAGE 2 +#define MUS_BACKGROUND_TITLE_INITIAL 1 +#define MUS_BACKGROUND_TITLE 2 #define MUS_BACKGROUND_MAIN 3 #define MUS_BACKGROUND_LEVELS 4 #define MUS_BACKGROUND_SCORES 5 #define MUS_BACKGROUND_EDITOR 6 #define MUS_BACKGROUND_INFO 7 #define MUS_BACKGROUND_SETUP 8 +#define MUS_BACKGROUND_TITLESCREEN_INITIAL_1 9 +#define MUS_BACKGROUND_TITLESCREEN_INITIAL_2 10 +#define MUS_BACKGROUND_TITLESCREEN_INITIAL_3 11 +#define MUS_BACKGROUND_TITLESCREEN_INITIAL_4 12 +#define MUS_BACKGROUND_TITLESCREEN_INITIAL_5 13 +#define MUS_BACKGROUND_TITLESCREEN_1 14 +#define MUS_BACKGROUND_TITLESCREEN_2 15 +#define MUS_BACKGROUND_TITLESCREEN_3 16 +#define MUS_BACKGROUND_TITLESCREEN_4 17 +#define MUS_BACKGROUND_TITLESCREEN_5 18 +#define MUS_BACKGROUND_TITLEMESSAGE_INITIAL_1 19 +#define MUS_BACKGROUND_TITLEMESSAGE_INITIAL_2 20 +#define MUS_BACKGROUND_TITLEMESSAGE_INITIAL_3 21 +#define MUS_BACKGROUND_TITLEMESSAGE_INITIAL_4 22 +#define MUS_BACKGROUND_TITLEMESSAGE_INITIAL_5 23 +#define MUS_BACKGROUND_TITLEMESSAGE_1 24 +#define MUS_BACKGROUND_TITLEMESSAGE_2 25 +#define MUS_BACKGROUND_TITLEMESSAGE_3 26 +#define MUS_BACKGROUND_TITLEMESSAGE_4 27 +#define MUS_BACKGROUND_TITLEMESSAGE_5 28 -#define NUM_MUSIC_FILES 9 +#define NUM_MUSIC_FILES 29 #endif /* CONF_MUS_H */ diff --git a/src/conf_snd.c b/src/conf_snd.c index 01696a0f..763f31d9 100644 --- a/src/conf_snd.c +++ b/src/conf_snd.c @@ -121,6 +121,9 @@ struct ConfigInfo sound_config[] = { "magic_wall.activating", "quirk.wav" }, { "magic_wall.active", "miep.wav" }, { "magic_wall.filling", "quirk.wav" }, + { "dc_magic_wall.activating", "quirk.wav" }, + { "dc_magic_wall.active", "miep.wav" }, + { "dc_magic_wall.filling", "quirk.wav" }, { "[amoeba].waiting", UNDEFINED_FILENAME }, { "[amoeba].growing", "amoebe.wav" }, { "[amoeba].dropping", UNDEFINED_FILENAME }, @@ -130,6 +133,15 @@ struct ConfigInfo sound_config[] = { "[exit].opening", "oeffnen.wav" }, { "[exit].closing", "oeffnen.wav" }, { "[exit].passing", "buing.wav" }, + { "[steel_exit].opening", "oeffnen.wav" }, + { "[steel_exit].closing", "oeffnen.wav" }, + { "[steel_exit].passing", "buing.wav" }, + { "[em_exit].opening", "gong.wav" }, + { "[em_exit].closing", UNDEFINED_FILENAME }, + { "[em_exit].passing", "buing.wav" }, + { "[em_steel_exit].opening", "gong.wav" }, + { "[em_steel_exit].closing", UNDEFINED_FILENAME }, + { "[em_steel_exit].passing", "buing.wav" }, { "penguin.passing", "buing.wav" }, /* sounds for Emerald Mine Club style elements and actions */ @@ -170,10 +182,10 @@ struct ConfigInfo sound_config[] = { "[switchgate].opening", "oeffnen.wav" }, { "[switchgate].closing", "oeffnen.wav" }, { "[switchgate].passing", "gate.wav" }, - { "timegate_switch.activating", "deng.wav" }, - { "timegate_switch.active", "miep.wav" }, - { "timegate_switch.deactivating", UNDEFINED_FILENAME }, - { "timegate.opening", "oeffnen.wav" }, + { "[timegate_switch].activating", "deng.wav" }, + { "[timegate_switch].active", "miep.wav" }, + { "[timegate_switch].deactivating", UNDEFINED_FILENAME }, + { "[timegate].opening", "oeffnen.wav" }, { "[timegate].closing", "oeffnen.wav" }, { "[timegate].passing", "gate.wav" }, { "[conveyor_belt_switch].activating",UNDEFINED_FILENAME }, @@ -244,8 +256,8 @@ struct ConfigInfo sound_config[] = { "menu.item.activating", "empty.wav" }, { "menu.item.selecting", "base.wav" }, + { "background.TITLE_INITIAL", UNDEFINED_FILENAME }, { "background.TITLE", UNDEFINED_FILENAME }, - { "background.MESSAGE", UNDEFINED_FILENAME }, { "background.MAIN", UNDEFINED_FILENAME }, { "background.LEVELS", UNDEFINED_FILENAME }, { "background.SCORES", "halloffame.wav" }, @@ -254,6 +266,27 @@ struct ConfigInfo sound_config[] = { "background.INFO", UNDEFINED_FILENAME }, { "background.SETUP", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_1", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_2", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_3", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_4", UNDEFINED_FILENAME }, + { "background.titlescreen_initial_5", UNDEFINED_FILENAME }, + { "background.titlescreen_1", UNDEFINED_FILENAME }, + { "background.titlescreen_2", UNDEFINED_FILENAME }, + { "background.titlescreen_3", UNDEFINED_FILENAME }, + { "background.titlescreen_4", UNDEFINED_FILENAME }, + { "background.titlescreen_5", UNDEFINED_FILENAME }, + { "background.titlemessage_initial_1",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_2",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_3",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_4",UNDEFINED_FILENAME }, + { "background.titlemessage_initial_5",UNDEFINED_FILENAME }, + { "background.titlemessage_1", UNDEFINED_FILENAME }, + { "background.titlemessage_2", UNDEFINED_FILENAME }, + { "background.titlemessage_3", UNDEFINED_FILENAME }, + { "background.titlemessage_4", UNDEFINED_FILENAME }, + { "background.titlemessage_5", UNDEFINED_FILENAME }, + #if 0 { "[not used]", "antigrav.wav" }, { "[not used]", "bong.wav" }, diff --git a/src/conf_snd.h b/src/conf_snd.h index 164c2a91..08fe1a95 100644 --- a/src/conf_snd.h +++ b/src/conf_snd.h @@ -98,119 +98,151 @@ #define SND_MAGIC_WALL_ACTIVATING 77 #define SND_MAGIC_WALL_ACTIVE 78 #define SND_MAGIC_WALL_FILLING 79 -#define SND_CLASS_AMOEBA_WAITING 80 -#define SND_CLASS_AMOEBA_GROWING 81 -#define SND_CLASS_AMOEBA_DROPPING 82 -#define SND_ACID_SPLASHING 83 -#define SND_CLASS_QUICKSAND_FILLING 84 -#define SND_CLASS_QUICKSAND_EMPTYING 85 -#define SND_CLASS_EXIT_OPENING 86 -#define SND_CLASS_EXIT_CLOSING 87 -#define SND_CLASS_EXIT_PASSING 88 -#define SND_PENGUIN_PASSING 89 -#define SND_BALLOON_MOVING 90 -#define SND_BALLOON_WAITING 91 -#define SND_BALLOON_PUSHING 92 -#define SND_CLASS_BALLOON_SWITCH_ACTIVATING 93 -#define SND_SPRING_MOVING 94 -#define SND_SPRING_PUSHING 95 -#define SND_SPRING_IMPACT 96 -#define SND_CLASS_WALL_GROWING 97 -#define SND_EMC_ANDROID_PUSHING 98 -#define SND_EMC_ANDROID_MOVING 99 -#define SND_EMC_ANDROID_DROPPING 100 -#define SND_EMC_MAGIC_BALL_DROPPING 101 -#define SND_PEARL_COLLECTING 102 -#define SND_PEARL_BREAKING 103 -#define SND_PEARL_IMPACT 104 -#define SND_CRYSTAL_COLLECTING 105 -#define SND_CRYSTAL_IMPACT 106 -#define SND_CLASS_ENVELOPE_COLLECTING 107 -#define SND_CLASS_ENVELOPE_OPENING 108 -#define SND_CLASS_ENVELOPE_CLOSING 109 -#define SND_INVISIBLE_SAND_DIGGING 110 -#define SND_INVISIBLE_SAND_ACTIVE_DIGGING 111 -#define SND_SHIELD_NORMAL_COLLECTING 112 -#define SND_SHIELD_NORMAL_ACTIVE 113 -#define SND_SHIELD_DEADLY_COLLECTING 114 -#define SND_SHIELD_DEADLY_ACTIVE 115 -#define SND_EXTRA_TIME_COLLECTING 116 -#define SND_MOLE_MOVING 117 -#define SND_MOLE_WAITING 118 -#define SND_MOLE_DIGGING 119 -#define SND_CLASS_SWITCHGATE_SWITCH_ACTIVATING 120 -#define SND_CLASS_SWITCHGATE_OPENING 121 -#define SND_CLASS_SWITCHGATE_CLOSING 122 -#define SND_CLASS_SWITCHGATE_PASSING 123 -#define SND_TIMEGATE_SWITCH_ACTIVATING 124 -#define SND_TIMEGATE_SWITCH_ACTIVE 125 -#define SND_TIMEGATE_SWITCH_DEACTIVATING 126 -#define SND_TIMEGATE_OPENING 127 -#define SND_CLASS_TIMEGATE_CLOSING 128 -#define SND_CLASS_TIMEGATE_PASSING 129 -#define SND_CLASS_CONVEYOR_BELT_SWITCH_ACTIVATING 130 -#define SND_CLASS_CONVEYOR_BELT_ACTIVE 131 -#define SND_CLASS_CONVEYOR_BELT_SWITCH_DEACTIVATING 132 -#define SND_LIGHT_SWITCH_ACTIVATING 133 -#define SND_LIGHT_SWITCH_DEACTIVATING 134 -#define SND_DX_SUPABOMB_PUSHING 135 -#define SND_TRAP_DIGGING 136 -#define SND_TRAP_ACTIVATING 137 -#define SND_CLASS_TUBE_WALKING 138 -#define SND_AMOEBA_TURNING_TO_GEM 139 -#define SND_AMOEBA_TURNING_TO_ROCK 140 -#define SND_SPEED_PILL_COLLECTING 141 -#define SND_DYNABOMB_INCREASE_NUMBER_COLLECTING 142 -#define SND_DYNABOMB_INCREASE_SIZE_COLLECTING 143 -#define SND_DYNABOMB_INCREASE_POWER_COLLECTING 144 -#define SND_CLASS_DYNABOMB_DROPPING 145 -#define SND_CLASS_DYNABOMB_ACTIVE 146 -#define SND_SATELLITE_MOVING 147 -#define SND_SATELLITE_WAITING 148 -#define SND_SATELLITE_PUSHING 149 -#define SND_LAMP_ACTIVATING 150 -#define SND_LAMP_DEACTIVATING 151 -#define SND_TIME_ORB_FULL_COLLECTING 152 -#define SND_TIME_ORB_FULL_IMPACT 153 -#define SND_TIME_ORB_EMPTY_PUSHING 154 -#define SND_TIME_ORB_EMPTY_IMPACT 155 -#define SND_GAME_OF_LIFE_WAITING 156 -#define SND_GAME_OF_LIFE_GROWING 157 -#define SND_BIOMAZE_WAITING 158 -#define SND_BIOMAZE_GROWING 159 -#define SND_PACMAN_MOVING 160 -#define SND_PACMAN_WAITING 161 -#define SND_PACMAN_DIGGING 162 -#define SND_DARK_YAMYAM_MOVING 163 -#define SND_DARK_YAMYAM_WAITING 164 -#define SND_DARK_YAMYAM_DIGGING 165 -#define SND_PENGUIN_MOVING 166 -#define SND_PENGUIN_WAITING 167 -#define SND_PIG_MOVING 168 -#define SND_PIG_WAITING 169 -#define SND_PIG_DIGGING 170 -#define SND_DRAGON_MOVING 171 -#define SND_DRAGON_WAITING 172 -#define SND_DRAGON_ATTACKING 173 -#define SND_GAME_STARTING 174 -#define SND_GAME_RUNNING_OUT_OF_TIME 175 -#define SND_GAME_LEVELTIME_BONUS 176 -#define SND_GAME_LOSING 177 -#define SND_GAME_WINNING 178 -#define SND_GAME_SOKOBAN_SOLVING 179 -#define SND_DOOR_OPENING 180 -#define SND_DOOR_CLOSING 181 -#define SND_MENU_ITEM_ACTIVATING 182 -#define SND_MENU_ITEM_SELECTING 183 -#define SND_BACKGROUND_TITLE 184 -#define SND_BACKGROUND_MESSAGE 185 -#define SND_BACKGROUND_MAIN 186 -#define SND_BACKGROUND_LEVELS 187 -#define SND_BACKGROUND_SCORES 188 -#define SND_BACKGROUND_EDITOR 189 -#define SND_BACKGROUND_INFO 190 -#define SND_BACKGROUND_SETUP 191 +#define SND_DC_MAGIC_WALL_ACTIVATING 80 +#define SND_DC_MAGIC_WALL_ACTIVE 81 +#define SND_DC_MAGIC_WALL_FILLING 82 +#define SND_CLASS_AMOEBA_WAITING 83 +#define SND_CLASS_AMOEBA_GROWING 84 +#define SND_CLASS_AMOEBA_DROPPING 85 +#define SND_ACID_SPLASHING 86 +#define SND_CLASS_QUICKSAND_FILLING 87 +#define SND_CLASS_QUICKSAND_EMPTYING 88 +#define SND_CLASS_EXIT_OPENING 89 +#define SND_CLASS_EXIT_CLOSING 90 +#define SND_CLASS_EXIT_PASSING 91 +#define SND_CLASS_STEEL_EXIT_OPENING 92 +#define SND_CLASS_STEEL_EXIT_CLOSING 93 +#define SND_CLASS_STEEL_EXIT_PASSING 94 +#define SND_CLASS_EM_EXIT_OPENING 95 +#define SND_CLASS_EM_EXIT_CLOSING 96 +#define SND_CLASS_EM_EXIT_PASSING 97 +#define SND_CLASS_EM_STEEL_EXIT_OPENING 98 +#define SND_CLASS_EM_STEEL_EXIT_CLOSING 99 +#define SND_CLASS_EM_STEEL_EXIT_PASSING 100 +#define SND_PENGUIN_PASSING 101 +#define SND_BALLOON_MOVING 102 +#define SND_BALLOON_WAITING 103 +#define SND_BALLOON_PUSHING 104 +#define SND_CLASS_BALLOON_SWITCH_ACTIVATING 105 +#define SND_SPRING_MOVING 106 +#define SND_SPRING_PUSHING 107 +#define SND_SPRING_IMPACT 108 +#define SND_CLASS_WALL_GROWING 109 +#define SND_EMC_ANDROID_PUSHING 110 +#define SND_EMC_ANDROID_MOVING 111 +#define SND_EMC_ANDROID_DROPPING 112 +#define SND_EMC_MAGIC_BALL_DROPPING 113 +#define SND_PEARL_COLLECTING 114 +#define SND_PEARL_BREAKING 115 +#define SND_PEARL_IMPACT 116 +#define SND_CRYSTAL_COLLECTING 117 +#define SND_CRYSTAL_IMPACT 118 +#define SND_CLASS_ENVELOPE_COLLECTING 119 +#define SND_CLASS_ENVELOPE_OPENING 120 +#define SND_CLASS_ENVELOPE_CLOSING 121 +#define SND_INVISIBLE_SAND_DIGGING 122 +#define SND_INVISIBLE_SAND_ACTIVE_DIGGING 123 +#define SND_SHIELD_NORMAL_COLLECTING 124 +#define SND_SHIELD_NORMAL_ACTIVE 125 +#define SND_SHIELD_DEADLY_COLLECTING 126 +#define SND_SHIELD_DEADLY_ACTIVE 127 +#define SND_EXTRA_TIME_COLLECTING 128 +#define SND_MOLE_MOVING 129 +#define SND_MOLE_WAITING 130 +#define SND_MOLE_DIGGING 131 +#define SND_CLASS_SWITCHGATE_SWITCH_ACTIVATING 132 +#define SND_CLASS_SWITCHGATE_OPENING 133 +#define SND_CLASS_SWITCHGATE_CLOSING 134 +#define SND_CLASS_SWITCHGATE_PASSING 135 +#define SND_CLASS_TIMEGATE_SWITCH_ACTIVATING 136 +#define SND_CLASS_TIMEGATE_SWITCH_ACTIVE 137 +#define SND_CLASS_TIMEGATE_SWITCH_DEACTIVATING 138 +#define SND_CLASS_TIMEGATE_OPENING 139 +#define SND_CLASS_TIMEGATE_CLOSING 140 +#define SND_CLASS_TIMEGATE_PASSING 141 +#define SND_CLASS_CONVEYOR_BELT_SWITCH_ACTIVATING 142 +#define SND_CLASS_CONVEYOR_BELT_ACTIVE 143 +#define SND_CLASS_CONVEYOR_BELT_SWITCH_DEACTIVATING 144 +#define SND_LIGHT_SWITCH_ACTIVATING 145 +#define SND_LIGHT_SWITCH_DEACTIVATING 146 +#define SND_DX_SUPABOMB_PUSHING 147 +#define SND_TRAP_DIGGING 148 +#define SND_TRAP_ACTIVATING 149 +#define SND_CLASS_TUBE_WALKING 150 +#define SND_AMOEBA_TURNING_TO_GEM 151 +#define SND_AMOEBA_TURNING_TO_ROCK 152 +#define SND_SPEED_PILL_COLLECTING 153 +#define SND_DYNABOMB_INCREASE_NUMBER_COLLECTING 154 +#define SND_DYNABOMB_INCREASE_SIZE_COLLECTING 155 +#define SND_DYNABOMB_INCREASE_POWER_COLLECTING 156 +#define SND_CLASS_DYNABOMB_DROPPING 157 +#define SND_CLASS_DYNABOMB_ACTIVE 158 +#define SND_SATELLITE_MOVING 159 +#define SND_SATELLITE_WAITING 160 +#define SND_SATELLITE_PUSHING 161 +#define SND_LAMP_ACTIVATING 162 +#define SND_LAMP_DEACTIVATING 163 +#define SND_TIME_ORB_FULL_COLLECTING 164 +#define SND_TIME_ORB_FULL_IMPACT 165 +#define SND_TIME_ORB_EMPTY_PUSHING 166 +#define SND_TIME_ORB_EMPTY_IMPACT 167 +#define SND_GAME_OF_LIFE_WAITING 168 +#define SND_GAME_OF_LIFE_GROWING 169 +#define SND_BIOMAZE_WAITING 170 +#define SND_BIOMAZE_GROWING 171 +#define SND_PACMAN_MOVING 172 +#define SND_PACMAN_WAITING 173 +#define SND_PACMAN_DIGGING 174 +#define SND_DARK_YAMYAM_MOVING 175 +#define SND_DARK_YAMYAM_WAITING 176 +#define SND_DARK_YAMYAM_DIGGING 177 +#define SND_PENGUIN_MOVING 178 +#define SND_PENGUIN_WAITING 179 +#define SND_PIG_MOVING 180 +#define SND_PIG_WAITING 181 +#define SND_PIG_DIGGING 182 +#define SND_DRAGON_MOVING 183 +#define SND_DRAGON_WAITING 184 +#define SND_DRAGON_ATTACKING 185 +#define SND_GAME_STARTING 186 +#define SND_GAME_RUNNING_OUT_OF_TIME 187 +#define SND_GAME_LEVELTIME_BONUS 188 +#define SND_GAME_LOSING 189 +#define SND_GAME_WINNING 190 +#define SND_GAME_SOKOBAN_SOLVING 191 +#define SND_DOOR_OPENING 192 +#define SND_DOOR_CLOSING 193 +#define SND_MENU_ITEM_ACTIVATING 194 +#define SND_MENU_ITEM_SELECTING 195 +#define SND_BACKGROUND_TITLE_INITIAL 196 +#define SND_BACKGROUND_TITLE 197 +#define SND_BACKGROUND_MAIN 198 +#define SND_BACKGROUND_LEVELS 199 +#define SND_BACKGROUND_SCORES 200 +#define SND_BACKGROUND_EDITOR 201 +#define SND_BACKGROUND_INFO 202 +#define SND_BACKGROUND_SETUP 203 +#define SND_BACKGROUND_TITLESCREEN_INITIAL_1 204 +#define SND_BACKGROUND_TITLESCREEN_INITIAL_2 205 +#define SND_BACKGROUND_TITLESCREEN_INITIAL_3 206 +#define SND_BACKGROUND_TITLESCREEN_INITIAL_4 207 +#define SND_BACKGROUND_TITLESCREEN_INITIAL_5 208 +#define SND_BACKGROUND_TITLESCREEN_1 209 +#define SND_BACKGROUND_TITLESCREEN_2 210 +#define SND_BACKGROUND_TITLESCREEN_3 211 +#define SND_BACKGROUND_TITLESCREEN_4 212 +#define SND_BACKGROUND_TITLESCREEN_5 213 +#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_1 214 +#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_2 215 +#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_3 216 +#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_4 217 +#define SND_BACKGROUND_TITLEMESSAGE_INITIAL_5 218 +#define SND_BACKGROUND_TITLEMESSAGE_1 219 +#define SND_BACKGROUND_TITLEMESSAGE_2 220 +#define SND_BACKGROUND_TITLEMESSAGE_3 221 +#define SND_BACKGROUND_TITLEMESSAGE_4 222 +#define SND_BACKGROUND_TITLEMESSAGE_5 223 -#define NUM_SOUND_FILES 192 +#define NUM_SOUND_FILES 224 #endif /* CONF_SND_H */ diff --git a/src/conf_var.c b/src/conf_var.c new file mode 100644 index 00000000..4a6389ad --- /dev/null +++ b/src/conf_var.c @@ -0,0 +1,5005 @@ +/*********************************************************** +* Rocks'n'Diamonds -- McDuffin Strikes Back! * +*----------------------------------------------------------* +* (c) 1995-2006 Artsoft Entertainment * +* Holger Schemel * +* Detmolder Strasse 189 * +* 33604 Bielefeld * +* Germany * +* e-mail: info@artsoft.org * +*----------------------------------------------------------* +* conf_var.c * +***********************************************************/ + +/* ----- this file was automatically generated -- do not edit by hand ----- */ + +#ifndef CONF_VAR_C +#define CONF_VAR_C + +/* values for image and layout parameter configuration */ + +struct TokenIntPtrInfo image_config_vars[] = +{ + { + "[title_initial].fade_mode", + &title_initial_default.fade_mode + }, + { + "[title_initial].fade_delay", + &title_initial_default.fade_delay + }, + { + "[title_initial].post_delay", + &title_initial_default.post_delay + }, + { + "[title_initial].auto_delay", + &title_initial_default.auto_delay + }, + { + "[title].fade_mode", + &title_default.fade_mode + }, + { + "[title].fade_delay", + &title_default.fade_delay + }, + { + "[title].post_delay", + &title_default.post_delay + }, + { + "[title].auto_delay", + &title_default.auto_delay + }, + { + "[titlemessage_initial].x", + &titlemessage_initial_default.x + }, + { + "[titlemessage_initial].y", + &titlemessage_initial_default.y + }, + { + "[titlemessage_initial].width", + &titlemessage_initial_default.width + }, + { + "[titlemessage_initial].height", + &titlemessage_initial_default.height + }, + { + "[titlemessage_initial].chars", + &titlemessage_initial_default.chars + }, + { + "[titlemessage_initial].lines", + &titlemessage_initial_default.lines + }, + { + "[titlemessage_initial].align", + &titlemessage_initial_default.align + }, + { + "[titlemessage_initial].valign", + &titlemessage_initial_default.valign + }, + { + "[titlemessage_initial].font", + &titlemessage_initial_default.font + }, + { + "[titlemessage_initial].autowrap", + &titlemessage_initial_default.autowrap + }, + { + "[titlemessage_initial].centered", + &titlemessage_initial_default.centered + }, + { + "[titlemessage_initial].parse_comments", + &titlemessage_initial_default.parse_comments + }, + { + "[titlemessage_initial].sort_priority", + &titlemessage_initial_default.sort_priority + }, + { + "[titlemessage_initial].fade_mode", + &titlemessage_initial_default.fade_mode + }, + { + "[titlemessage_initial].fade_delay", + &titlemessage_initial_default.fade_delay + }, + { + "[titlemessage_initial].post_delay", + &titlemessage_initial_default.post_delay + }, + { + "[titlemessage_initial].auto_delay", + &titlemessage_initial_default.auto_delay + }, + { + "[titlemessage].x", + &titlemessage_default.x + }, + { + "[titlemessage].y", + &titlemessage_default.y + }, + { + "[titlemessage].width", + &titlemessage_default.width + }, + { + "[titlemessage].height", + &titlemessage_default.height + }, + { + "[titlemessage].chars", + &titlemessage_default.chars + }, + { + "[titlemessage].lines", + &titlemessage_default.lines + }, + { + "[titlemessage].align", + &titlemessage_default.align + }, + { + "[titlemessage].valign", + &titlemessage_default.valign + }, + { + "[titlemessage].font", + &titlemessage_default.font + }, + { + "[titlemessage].autowrap", + &titlemessage_default.autowrap + }, + { + "[titlemessage].centered", + &titlemessage_default.centered + }, + { + "[titlemessage].parse_comments", + &titlemessage_default.parse_comments + }, + { + "[titlemessage].sort_priority", + &titlemessage_default.sort_priority + }, + { + "[titlemessage].fade_mode", + &titlemessage_default.fade_mode + }, + { + "[titlemessage].fade_delay", + &titlemessage_default.fade_delay + }, + { + "[titlemessage].post_delay", + &titlemessage_default.post_delay + }, + { + "[titlemessage].auto_delay", + &titlemessage_default.auto_delay + }, + { + "titlemessage_initial_1.x", + &titlemessage_initial[0].x + }, + { + "titlemessage_initial_1.y", + &titlemessage_initial[0].y + }, + { + "titlemessage_initial_1.width", + &titlemessage_initial[0].width + }, + { + "titlemessage_initial_1.height", + &titlemessage_initial[0].height + }, + { + "titlemessage_initial_1.chars", + &titlemessage_initial[0].chars + }, + { + "titlemessage_initial_1.lines", + &titlemessage_initial[0].lines + }, + { + "titlemessage_initial_1.align", + &titlemessage_initial[0].align + }, + { + "titlemessage_initial_1.valign", + &titlemessage_initial[0].valign + }, + { + "titlemessage_initial_1.font", + &titlemessage_initial[0].font + }, + { + "titlemessage_initial_1.autowrap", + &titlemessage_initial[0].autowrap + }, + { + "titlemessage_initial_1.centered", + &titlemessage_initial[0].centered + }, + { + "titlemessage_initial_1.parse_comments", + &titlemessage_initial[0].parse_comments + }, + { + "titlemessage_initial_1.sort_priority", + &titlemessage_initial[0].sort_priority + }, + { + "titlemessage_initial_1.fade_mode", + &titlemessage_initial[0].fade_mode + }, + { + "titlemessage_initial_1.fade_delay", + &titlemessage_initial[0].fade_delay + }, + { + "titlemessage_initial_1.post_delay", + &titlemessage_initial[0].post_delay + }, + { + "titlemessage_initial_1.auto_delay", + &titlemessage_initial[0].auto_delay + }, + { + "titlemessage_initial_2.x", + &titlemessage_initial[1].x + }, + { + "titlemessage_initial_2.y", + &titlemessage_initial[1].y + }, + { + "titlemessage_initial_2.width", + &titlemessage_initial[1].width + }, + { + "titlemessage_initial_2.height", + &titlemessage_initial[1].height + }, + { + "titlemessage_initial_2.chars", + &titlemessage_initial[1].chars + }, + { + "titlemessage_initial_2.lines", + &titlemessage_initial[1].lines + }, + { + "titlemessage_initial_2.align", + &titlemessage_initial[1].align + }, + { + "titlemessage_initial_2.valign", + &titlemessage_initial[1].valign + }, + { + "titlemessage_initial_2.font", + &titlemessage_initial[1].font + }, + { + "titlemessage_initial_2.autowrap", + &titlemessage_initial[1].autowrap + }, + { + "titlemessage_initial_2.centered", + &titlemessage_initial[1].centered + }, + { + "titlemessage_initial_2.parse_comments", + &titlemessage_initial[1].parse_comments + }, + { + "titlemessage_initial_2.sort_priority", + &titlemessage_initial[1].sort_priority + }, + { + "titlemessage_initial_2.fade_mode", + &titlemessage_initial[1].fade_mode + }, + { + "titlemessage_initial_2.fade_delay", + &titlemessage_initial[1].fade_delay + }, + { + "titlemessage_initial_2.post_delay", + &titlemessage_initial[1].post_delay + }, + { + "titlemessage_initial_2.auto_delay", + &titlemessage_initial[1].auto_delay + }, + { + "titlemessage_initial_3.x", + &titlemessage_initial[2].x + }, + { + "titlemessage_initial_3.y", + &titlemessage_initial[2].y + }, + { + "titlemessage_initial_3.width", + &titlemessage_initial[2].width + }, + { + "titlemessage_initial_3.height", + &titlemessage_initial[2].height + }, + { + "titlemessage_initial_3.chars", + &titlemessage_initial[2].chars + }, + { + "titlemessage_initial_3.lines", + &titlemessage_initial[2].lines + }, + { + "titlemessage_initial_3.align", + &titlemessage_initial[2].align + }, + { + "titlemessage_initial_3.valign", + &titlemessage_initial[2].valign + }, + { + "titlemessage_initial_3.font", + &titlemessage_initial[2].font + }, + { + "titlemessage_initial_3.autowrap", + &titlemessage_initial[2].autowrap + }, + { + "titlemessage_initial_3.centered", + &titlemessage_initial[2].centered + }, + { + "titlemessage_initial_3.parse_comments", + &titlemessage_initial[2].parse_comments + }, + { + "titlemessage_initial_3.sort_priority", + &titlemessage_initial[2].sort_priority + }, + { + "titlemessage_initial_3.fade_mode", + &titlemessage_initial[2].fade_mode + }, + { + "titlemessage_initial_3.fade_delay", + &titlemessage_initial[2].fade_delay + }, + { + "titlemessage_initial_3.post_delay", + &titlemessage_initial[2].post_delay + }, + { + "titlemessage_initial_3.auto_delay", + &titlemessage_initial[2].auto_delay + }, + { + "titlemessage_initial_4.x", + &titlemessage_initial[3].x + }, + { + "titlemessage_initial_4.y", + &titlemessage_initial[3].y + }, + { + "titlemessage_initial_4.width", + &titlemessage_initial[3].width + }, + { + "titlemessage_initial_4.height", + &titlemessage_initial[3].height + }, + { + "titlemessage_initial_4.chars", + &titlemessage_initial[3].chars + }, + { + "titlemessage_initial_4.lines", + &titlemessage_initial[3].lines + }, + { + "titlemessage_initial_4.align", + &titlemessage_initial[3].align + }, + { + "titlemessage_initial_4.valign", + &titlemessage_initial[3].valign + }, + { + "titlemessage_initial_4.font", + &titlemessage_initial[3].font + }, + { + "titlemessage_initial_4.autowrap", + &titlemessage_initial[3].autowrap + }, + { + "titlemessage_initial_4.centered", + &titlemessage_initial[3].centered + }, + { + "titlemessage_initial_4.parse_comments", + &titlemessage_initial[3].parse_comments + }, + { + "titlemessage_initial_4.sort_priority", + &titlemessage_initial[3].sort_priority + }, + { + "titlemessage_initial_4.fade_mode", + &titlemessage_initial[3].fade_mode + }, + { + "titlemessage_initial_4.fade_delay", + &titlemessage_initial[3].fade_delay + }, + { + "titlemessage_initial_4.post_delay", + &titlemessage_initial[3].post_delay + }, + { + "titlemessage_initial_4.auto_delay", + &titlemessage_initial[3].auto_delay + }, + { + "titlemessage_initial_5.x", + &titlemessage_initial[4].x + }, + { + "titlemessage_initial_5.y", + &titlemessage_initial[4].y + }, + { + "titlemessage_initial_5.width", + &titlemessage_initial[4].width + }, + { + "titlemessage_initial_5.height", + &titlemessage_initial[4].height + }, + { + "titlemessage_initial_5.chars", + &titlemessage_initial[4].chars + }, + { + "titlemessage_initial_5.lines", + &titlemessage_initial[4].lines + }, + { + "titlemessage_initial_5.align", + &titlemessage_initial[4].align + }, + { + "titlemessage_initial_5.valign", + &titlemessage_initial[4].valign + }, + { + "titlemessage_initial_5.font", + &titlemessage_initial[4].font + }, + { + "titlemessage_initial_5.autowrap", + &titlemessage_initial[4].autowrap + }, + { + "titlemessage_initial_5.centered", + &titlemessage_initial[4].centered + }, + { + "titlemessage_initial_5.parse_comments", + &titlemessage_initial[4].parse_comments + }, + { + "titlemessage_initial_5.sort_priority", + &titlemessage_initial[4].sort_priority + }, + { + "titlemessage_initial_5.fade_mode", + &titlemessage_initial[4].fade_mode + }, + { + "titlemessage_initial_5.fade_delay", + &titlemessage_initial[4].fade_delay + }, + { + "titlemessage_initial_5.post_delay", + &titlemessage_initial[4].post_delay + }, + { + "titlemessage_initial_5.auto_delay", + &titlemessage_initial[4].auto_delay + }, + { + "titlemessage_1.x", + &titlemessage[0].x + }, + { + "titlemessage_1.y", + &titlemessage[0].y + }, + { + "titlemessage_1.width", + &titlemessage[0].width + }, + { + "titlemessage_1.height", + &titlemessage[0].height + }, + { + "titlemessage_1.chars", + &titlemessage[0].chars + }, + { + "titlemessage_1.lines", + &titlemessage[0].lines + }, + { + "titlemessage_1.align", + &titlemessage[0].align + }, + { + "titlemessage_1.valign", + &titlemessage[0].valign + }, + { + "titlemessage_1.font", + &titlemessage[0].font + }, + { + "titlemessage_1.autowrap", + &titlemessage[0].autowrap + }, + { + "titlemessage_1.centered", + &titlemessage[0].centered + }, + { + "titlemessage_1.parse_comments", + &titlemessage[0].parse_comments + }, + { + "titlemessage_1.sort_priority", + &titlemessage[0].sort_priority + }, + { + "titlemessage_1.fade_mode", + &titlemessage[0].fade_mode + }, + { + "titlemessage_1.fade_delay", + &titlemessage[0].fade_delay + }, + { + "titlemessage_1.post_delay", + &titlemessage[0].post_delay + }, + { + "titlemessage_1.auto_delay", + &titlemessage[0].auto_delay + }, + { + "titlemessage_2.x", + &titlemessage[1].x + }, + { + "titlemessage_2.y", + &titlemessage[1].y + }, + { + "titlemessage_2.width", + &titlemessage[1].width + }, + { + "titlemessage_2.height", + &titlemessage[1].height + }, + { + "titlemessage_2.chars", + &titlemessage[1].chars + }, + { + "titlemessage_2.lines", + &titlemessage[1].lines + }, + { + "titlemessage_2.align", + &titlemessage[1].align + }, + { + "titlemessage_2.valign", + &titlemessage[1].valign + }, + { + "titlemessage_2.font", + &titlemessage[1].font + }, + { + "titlemessage_2.autowrap", + &titlemessage[1].autowrap + }, + { + "titlemessage_2.centered", + &titlemessage[1].centered + }, + { + "titlemessage_2.parse_comments", + &titlemessage[1].parse_comments + }, + { + "titlemessage_2.sort_priority", + &titlemessage[1].sort_priority + }, + { + "titlemessage_2.fade_mode", + &titlemessage[1].fade_mode + }, + { + "titlemessage_2.fade_delay", + &titlemessage[1].fade_delay + }, + { + "titlemessage_2.post_delay", + &titlemessage[1].post_delay + }, + { + "titlemessage_2.auto_delay", + &titlemessage[1].auto_delay + }, + { + "titlemessage_3.x", + &titlemessage[2].x + }, + { + "titlemessage_3.y", + &titlemessage[2].y + }, + { + "titlemessage_3.width", + &titlemessage[2].width + }, + { + "titlemessage_3.height", + &titlemessage[2].height + }, + { + "titlemessage_3.chars", + &titlemessage[2].chars + }, + { + "titlemessage_3.lines", + &titlemessage[2].lines + }, + { + "titlemessage_3.align", + &titlemessage[2].align + }, + { + "titlemessage_3.valign", + &titlemessage[2].valign + }, + { + "titlemessage_3.font", + &titlemessage[2].font + }, + { + "titlemessage_3.autowrap", + &titlemessage[2].autowrap + }, + { + "titlemessage_3.centered", + &titlemessage[2].centered + }, + { + "titlemessage_3.parse_comments", + &titlemessage[2].parse_comments + }, + { + "titlemessage_3.sort_priority", + &titlemessage[2].sort_priority + }, + { + "titlemessage_3.fade_mode", + &titlemessage[2].fade_mode + }, + { + "titlemessage_3.fade_delay", + &titlemessage[2].fade_delay + }, + { + "titlemessage_3.post_delay", + &titlemessage[2].post_delay + }, + { + "titlemessage_3.auto_delay", + &titlemessage[2].auto_delay + }, + { + "titlemessage_4.x", + &titlemessage[3].x + }, + { + "titlemessage_4.y", + &titlemessage[3].y + }, + { + "titlemessage_4.width", + &titlemessage[3].width + }, + { + "titlemessage_4.height", + &titlemessage[3].height + }, + { + "titlemessage_4.chars", + &titlemessage[3].chars + }, + { + "titlemessage_4.lines", + &titlemessage[3].lines + }, + { + "titlemessage_4.align", + &titlemessage[3].align + }, + { + "titlemessage_4.valign", + &titlemessage[3].valign + }, + { + "titlemessage_4.font", + &titlemessage[3].font + }, + { + "titlemessage_4.autowrap", + &titlemessage[3].autowrap + }, + { + "titlemessage_4.centered", + &titlemessage[3].centered + }, + { + "titlemessage_4.parse_comments", + &titlemessage[3].parse_comments + }, + { + "titlemessage_4.sort_priority", + &titlemessage[3].sort_priority + }, + { + "titlemessage_4.fade_mode", + &titlemessage[3].fade_mode + }, + { + "titlemessage_4.fade_delay", + &titlemessage[3].fade_delay + }, + { + "titlemessage_4.post_delay", + &titlemessage[3].post_delay + }, + { + "titlemessage_4.auto_delay", + &titlemessage[3].auto_delay + }, + { + "titlemessage_5.x", + &titlemessage[4].x + }, + { + "titlemessage_5.y", + &titlemessage[4].y + }, + { + "titlemessage_5.width", + &titlemessage[4].width + }, + { + "titlemessage_5.height", + &titlemessage[4].height + }, + { + "titlemessage_5.chars", + &titlemessage[4].chars + }, + { + "titlemessage_5.lines", + &titlemessage[4].lines + }, + { + "titlemessage_5.align", + &titlemessage[4].align + }, + { + "titlemessage_5.valign", + &titlemessage[4].valign + }, + { + "titlemessage_5.font", + &titlemessage[4].font + }, + { + "titlemessage_5.autowrap", + &titlemessage[4].autowrap + }, + { + "titlemessage_5.centered", + &titlemessage[4].centered + }, + { + "titlemessage_5.parse_comments", + &titlemessage[4].parse_comments + }, + { + "titlemessage_5.sort_priority", + &titlemessage[4].sort_priority + }, + { + "titlemessage_5.fade_mode", + &titlemessage[4].fade_mode + }, + { + "titlemessage_5.fade_delay", + &titlemessage[4].fade_delay + }, + { + "titlemessage_5.post_delay", + &titlemessage[4].post_delay + }, + { + "titlemessage_5.auto_delay", + &titlemessage[4].auto_delay + }, + { + "readme.x", + &readme.x + }, + { + "readme.y", + &readme.y + }, + { + "readme.width", + &readme.width + }, + { + "readme.height", + &readme.height + }, + { + "readme.chars", + &readme.chars + }, + { + "readme.lines", + &readme.lines + }, + { + "readme.align", + &readme.align + }, + { + "readme.valign", + &readme.valign + }, + { + "readme.font", + &readme.font + }, + { + "readme.autowrap", + &readme.autowrap + }, + { + "readme.centered", + &readme.centered + }, + { + "readme.parse_comments", + &readme.parse_comments + }, + { + "readme.sort_priority", + &readme.sort_priority + }, + { + "global.num_toons", + &global.num_toons + }, + { + "border.draw_masked.TITLE", + &border.draw_masked[GFX_SPECIAL_ARG_TITLE] + }, + { + "border.draw_masked.MAIN", + &border.draw_masked[GFX_SPECIAL_ARG_MAIN] + }, + { + "border.draw_masked.LEVELS", + &border.draw_masked[GFX_SPECIAL_ARG_LEVELS] + }, + { + "border.draw_masked.SCORES", + &border.draw_masked[GFX_SPECIAL_ARG_SCORES] + }, + { + "border.draw_masked.EDITOR", + &border.draw_masked[GFX_SPECIAL_ARG_EDITOR] + }, + { + "border.draw_masked.INFO", + &border.draw_masked[GFX_SPECIAL_ARG_INFO] + }, + { + "border.draw_masked.SETUP", + &border.draw_masked[GFX_SPECIAL_ARG_SETUP] + }, + { + "border.draw_masked.PLAYING", + &border.draw_masked[GFX_SPECIAL_ARG_PLAYING] + }, + { + "border.draw_masked.DOOR", + &border.draw_masked[GFX_SPECIAL_ARG_DOOR] + }, + { + "border.draw_masked_when_fading", + &border.draw_masked_when_fading + }, + { + "init.busy.x", + &init.busy.x + }, + { + "init.busy.y", + &init.busy.y + }, + { + "init.busy.align", + &init.busy.align + }, + { + "init.busy.valign", + &init.busy.valign + }, + { + "menu.enter_menu.fade_mode", + &menu.enter_menu.fade_mode + }, + { + "menu.enter_menu.fade_delay", + &menu.enter_menu.fade_delay + }, + { + "menu.enter_menu.post_delay", + &menu.enter_menu.post_delay + }, + { + "menu.leave_menu.fade_mode", + &menu.leave_menu.fade_mode + }, + { + "menu.leave_menu.fade_delay", + &menu.leave_menu.fade_delay + }, + { + "menu.leave_menu.post_delay", + &menu.leave_menu.post_delay + }, + { + "menu.enter_screen.fade_mode", + &menu.enter_screen[GFX_SPECIAL_ARG_DEFAULT].fade_mode + }, + { + "menu.enter_screen.fade_delay", + &menu.enter_screen[GFX_SPECIAL_ARG_DEFAULT].fade_delay + }, + { + "menu.enter_screen.post_delay", + &menu.enter_screen[GFX_SPECIAL_ARG_DEFAULT].post_delay + }, + { + "menu.next_screen.fade_mode", + &menu.next_screen.fade_mode + }, + { + "menu.next_screen.fade_delay", + &menu.next_screen.fade_delay + }, + { + "menu.next_screen.post_delay", + &menu.next_screen.post_delay + }, + { + "menu.leave_screen.fade_mode", + &menu.leave_screen[GFX_SPECIAL_ARG_DEFAULT].fade_mode + }, + { + "menu.leave_screen.fade_delay", + &menu.leave_screen[GFX_SPECIAL_ARG_DEFAULT].fade_delay + }, + { + "menu.leave_screen.post_delay", + &menu.leave_screen[GFX_SPECIAL_ARG_DEFAULT].post_delay + }, + { + "menu.enter_screen.SCORES.fade_mode", + &menu.enter_screen[GFX_SPECIAL_ARG_SCORES].fade_mode + }, + { + "menu.enter_screen.SCORES.fade_delay", + &menu.enter_screen[GFX_SPECIAL_ARG_SCORES].fade_delay + }, + { + "menu.enter_screen.SCORES.post_delay", + &menu.enter_screen[GFX_SPECIAL_ARG_SCORES].post_delay + }, + { + "menu.enter_screen.EDITOR.fade_mode", + &menu.enter_screen[GFX_SPECIAL_ARG_EDITOR].fade_mode + }, + { + "menu.enter_screen.EDITOR.fade_delay", + &menu.enter_screen[GFX_SPECIAL_ARG_EDITOR].fade_delay + }, + { + "menu.enter_screen.EDITOR.post_delay", + &menu.enter_screen[GFX_SPECIAL_ARG_EDITOR].post_delay + }, + { + "menu.enter_screen.INFO.fade_mode", + &menu.enter_screen[GFX_SPECIAL_ARG_INFO].fade_mode + }, + { + "menu.enter_screen.INFO.fade_delay", + &menu.enter_screen[GFX_SPECIAL_ARG_INFO].fade_delay + }, + { + "menu.enter_screen.INFO.post_delay", + &menu.enter_screen[GFX_SPECIAL_ARG_INFO].post_delay + }, + { + "menu.enter_screen.PLAYING.fade_mode", + &menu.enter_screen[GFX_SPECIAL_ARG_PLAYING].fade_mode + }, + { + "menu.enter_screen.PLAYING.fade_delay", + &menu.enter_screen[GFX_SPECIAL_ARG_PLAYING].fade_delay + }, + { + "menu.enter_screen.PLAYING.post_delay", + &menu.enter_screen[GFX_SPECIAL_ARG_PLAYING].post_delay + }, + { + "menu.leave_screen.SCORES.fade_mode", + &menu.leave_screen[GFX_SPECIAL_ARG_SCORES].fade_mode + }, + { + "menu.leave_screen.SCORES.fade_delay", + &menu.leave_screen[GFX_SPECIAL_ARG_SCORES].fade_delay + }, + { + "menu.leave_screen.SCORES.post_delay", + &menu.leave_screen[GFX_SPECIAL_ARG_SCORES].post_delay + }, + { + "menu.leave_screen.EDITOR.fade_mode", + &menu.leave_screen[GFX_SPECIAL_ARG_EDITOR].fade_mode + }, + { + "menu.leave_screen.EDITOR.fade_delay", + &menu.leave_screen[GFX_SPECIAL_ARG_EDITOR].fade_delay + }, + { + "menu.leave_screen.EDITOR.post_delay", + &menu.leave_screen[GFX_SPECIAL_ARG_EDITOR].post_delay + }, + { + "menu.leave_screen.INFO.fade_mode", + &menu.leave_screen[GFX_SPECIAL_ARG_INFO].fade_mode + }, + { + "menu.leave_screen.INFO.fade_delay", + &menu.leave_screen[GFX_SPECIAL_ARG_INFO].fade_delay + }, + { + "menu.leave_screen.INFO.post_delay", + &menu.leave_screen[GFX_SPECIAL_ARG_INFO].post_delay + }, + { + "menu.leave_screen.PLAYING.fade_mode", + &menu.leave_screen[GFX_SPECIAL_ARG_PLAYING].fade_mode + }, + { + "menu.leave_screen.PLAYING.fade_delay", + &menu.leave_screen[GFX_SPECIAL_ARG_PLAYING].fade_delay + }, + { + "menu.leave_screen.PLAYING.post_delay", + &menu.leave_screen[GFX_SPECIAL_ARG_PLAYING].post_delay + }, + { + "menu.draw_xoffset", + &menu.draw_xoffset[GFX_SPECIAL_ARG_DEFAULT] + }, + { + "menu.draw_yoffset", + &menu.draw_yoffset[GFX_SPECIAL_ARG_DEFAULT] + }, + { + "menu.draw_xoffset.MAIN", + &menu.draw_xoffset[GFX_SPECIAL_ARG_MAIN] + }, + { + "menu.draw_yoffset.MAIN", + &menu.draw_yoffset[GFX_SPECIAL_ARG_MAIN] + }, + { + "menu.draw_xoffset.LEVELS", + &menu.draw_xoffset[GFX_SPECIAL_ARG_LEVELS] + }, + { + "menu.draw_yoffset.LEVELS", + &menu.draw_yoffset[GFX_SPECIAL_ARG_LEVELS] + }, + { + "menu.draw_xoffset.SCORES", + &menu.draw_xoffset[GFX_SPECIAL_ARG_SCORES] + }, + { + "menu.draw_yoffset.SCORES", + &menu.draw_yoffset[GFX_SPECIAL_ARG_SCORES] + }, + { + "menu.draw_xoffset.EDITOR", + &menu.draw_xoffset[GFX_SPECIAL_ARG_EDITOR] + }, + { + "menu.draw_yoffset.EDITOR", + &menu.draw_yoffset[GFX_SPECIAL_ARG_EDITOR] + }, + { + "menu.draw_xoffset.INFO", + &menu.draw_xoffset[GFX_SPECIAL_ARG_INFO] + }, + { + "menu.draw_yoffset.INFO", + &menu.draw_yoffset[GFX_SPECIAL_ARG_INFO] + }, + { + "menu.draw_xoffset.INFO[ELEMENTS]", + &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_ELEMENTS] + }, + { + "menu.draw_yoffset.INFO[ELEMENTS]", + &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_ELEMENTS] + }, + { + "menu.draw_xoffset.INFO[MUSIC]", + &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_MUSIC] + }, + { + "menu.draw_yoffset.INFO[MUSIC]", + &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_MUSIC] + }, + { + "menu.draw_xoffset.INFO[CREDITS]", + &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_CREDITS] + }, + { + "menu.draw_yoffset.INFO[CREDITS]", + &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_CREDITS] + }, + { + "menu.draw_xoffset.INFO[PROGRAM]", + &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_PROGRAM] + }, + { + "menu.draw_yoffset.INFO[PROGRAM]", + &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_PROGRAM] + }, + { + "menu.draw_xoffset.INFO[VERSION]", + &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_VERSION] + }, + { + "menu.draw_yoffset.INFO[VERSION]", + &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_VERSION] + }, + { + "menu.draw_xoffset.INFO[LEVELSET]", + &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_LEVELSET] + }, + { + "menu.draw_yoffset.INFO[LEVELSET]", + &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_LEVELSET] + }, + { + "menu.draw_xoffset.SETUP", + &menu.draw_xoffset[GFX_SPECIAL_ARG_SETUP] + }, + { + "menu.draw_yoffset.SETUP", + &menu.draw_yoffset[GFX_SPECIAL_ARG_SETUP] + }, + { + "menu.draw_xoffset.SETUP[GAME]", + &menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_GAME] + }, + { + "menu.draw_yoffset.SETUP[GAME]", + &menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_GAME] + }, + { + "menu.draw_xoffset.SETUP[EDITOR]", + &menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_EDITOR] + }, + { + "menu.draw_yoffset.SETUP[EDITOR]", + &menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_EDITOR] + }, + { + "menu.draw_xoffset.SETUP[GRAPHICS]", + &menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_GRAPHICS] + }, + { + "menu.draw_yoffset.SETUP[GRAPHICS]", + &menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_GRAPHICS] + }, + { + "menu.draw_xoffset.SETUP[SOUND]", + &menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_SOUND] + }, + { + "menu.draw_yoffset.SETUP[SOUND]", + &menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_SOUND] + }, + { + "menu.draw_xoffset.SETUP[ARTWORK]", + &menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_ARTWORK] + }, + { + "menu.draw_yoffset.SETUP[ARTWORK]", + &menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_ARTWORK] + }, + { + "menu.draw_xoffset.SETUP[INPUT]", + &menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_INPUT] + }, + { + "menu.draw_yoffset.SETUP[INPUT]", + &menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_INPUT] + }, + { + "menu.draw_xoffset.SETUP[SHORTCUTS_1]", + &menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_SHORTCUTS_1] + }, + { + "menu.draw_yoffset.SETUP[SHORTCUTS_1]", + &menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_SHORTCUTS_1] + }, + { + "menu.draw_xoffset.SETUP[SHORTCUTS_2]", + &menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_SHORTCUTS_2] + }, + { + "menu.draw_yoffset.SETUP[SHORTCUTS_2]", + &menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_SHORTCUTS_2] + }, + { + "menu.draw_xoffset.SETUP[CHOOSE_ARTWORK]", + &menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK] + }, + { + "menu.draw_yoffset.SETUP[CHOOSE_ARTWORK]", + &menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK] + }, + { + "menu.draw_xoffset.SETUP[CHOOSE_OTHER]", + &menu.draw_xoffset_setup[GFX_SPECIAL_ARG_SETUP_CHOOSE_OTHER] + }, + { + "menu.draw_yoffset.SETUP[CHOOSE_OTHER]", + &menu.draw_yoffset_setup[GFX_SPECIAL_ARG_SETUP_CHOOSE_OTHER] + }, + { + "menu.scrollbar_xoffset", + &menu.scrollbar_xoffset + }, + { + "menu.list_size", + &menu.list_size[GFX_SPECIAL_ARG_DEFAULT] + }, + { + "menu.list_size.LEVELS", + &menu.list_size[GFX_SPECIAL_ARG_LEVELS] + }, + { + "menu.list_size.SCORES", + &menu.list_size[GFX_SPECIAL_ARG_SCORES] + }, + { + "menu.list_size.INFO", + &menu.list_size[GFX_SPECIAL_ARG_INFO] + }, + { + "menu.list_size.SETUP", + &menu.list_size[GFX_SPECIAL_ARG_SETUP] + }, + { + "main.button.name.x", + &menu.main.button.name.x + }, + { + "main.button.name.y", + &menu.main.button.name.y + }, + { + "main.button.levels.x", + &menu.main.button.levels.x + }, + { + "main.button.levels.y", + &menu.main.button.levels.y + }, + { + "main.button.scores.x", + &menu.main.button.scores.x + }, + { + "main.button.scores.y", + &menu.main.button.scores.y + }, + { + "main.button.editor.x", + &menu.main.button.editor.x + }, + { + "main.button.editor.y", + &menu.main.button.editor.y + }, + { + "main.button.info.x", + &menu.main.button.info.x + }, + { + "main.button.info.y", + &menu.main.button.info.y + }, + { + "main.button.game.x", + &menu.main.button.game.x + }, + { + "main.button.game.y", + &menu.main.button.game.y + }, + { + "main.button.setup.x", + &menu.main.button.setup.x + }, + { + "main.button.setup.y", + &menu.main.button.setup.y + }, + { + "main.button.quit.x", + &menu.main.button.quit.x + }, + { + "main.button.quit.y", + &menu.main.button.quit.y + }, + { + "main.button.prev_level.x", + &menu.main.button.prev_level.x + }, + { + "main.button.prev_level.y", + &menu.main.button.prev_level.y + }, + { + "main.button.next_level.x", + &menu.main.button.next_level.x + }, + { + "main.button.next_level.y", + &menu.main.button.next_level.y + }, + { + "main.text.name.x", + &menu.main.text.name.x + }, + { + "main.text.name.y", + &menu.main.text.name.y + }, + { + "main.text.name.width", + &menu.main.text.name.width + }, + { + "main.text.name.height", + &menu.main.text.name.height + }, + { + "main.text.name.align", + &menu.main.text.name.align + }, + { + "main.text.name.valign", + &menu.main.text.name.valign + }, + { + "main.text.name.font", + &menu.main.text.name.font + }, + { + "main.text.levels.x", + &menu.main.text.levels.x + }, + { + "main.text.levels.y", + &menu.main.text.levels.y + }, + { + "main.text.levels.width", + &menu.main.text.levels.width + }, + { + "main.text.levels.height", + &menu.main.text.levels.height + }, + { + "main.text.levels.align", + &menu.main.text.levels.align + }, + { + "main.text.levels.valign", + &menu.main.text.levels.valign + }, + { + "main.text.levels.font", + &menu.main.text.levels.font + }, + { + "main.text.scores.x", + &menu.main.text.scores.x + }, + { + "main.text.scores.y", + &menu.main.text.scores.y + }, + { + "main.text.scores.width", + &menu.main.text.scores.width + }, + { + "main.text.scores.height", + &menu.main.text.scores.height + }, + { + "main.text.scores.align", + &menu.main.text.scores.align + }, + { + "main.text.scores.valign", + &menu.main.text.scores.valign + }, + { + "main.text.scores.font", + &menu.main.text.scores.font + }, + { + "main.text.editor.x", + &menu.main.text.editor.x + }, + { + "main.text.editor.y", + &menu.main.text.editor.y + }, + { + "main.text.editor.width", + &menu.main.text.editor.width + }, + { + "main.text.editor.height", + &menu.main.text.editor.height + }, + { + "main.text.editor.align", + &menu.main.text.editor.align + }, + { + "main.text.editor.valign", + &menu.main.text.editor.valign + }, + { + "main.text.editor.font", + &menu.main.text.editor.font + }, + { + "main.text.info.x", + &menu.main.text.info.x + }, + { + "main.text.info.y", + &menu.main.text.info.y + }, + { + "main.text.info.width", + &menu.main.text.info.width + }, + { + "main.text.info.height", + &menu.main.text.info.height + }, + { + "main.text.info.align", + &menu.main.text.info.align + }, + { + "main.text.info.valign", + &menu.main.text.info.valign + }, + { + "main.text.info.font", + &menu.main.text.info.font + }, + { + "main.text.game.x", + &menu.main.text.game.x + }, + { + "main.text.game.y", + &menu.main.text.game.y + }, + { + "main.text.game.width", + &menu.main.text.game.width + }, + { + "main.text.game.height", + &menu.main.text.game.height + }, + { + "main.text.game.align", + &menu.main.text.game.align + }, + { + "main.text.game.valign", + &menu.main.text.game.valign + }, + { + "main.text.game.font", + &menu.main.text.game.font + }, + { + "main.text.setup.x", + &menu.main.text.setup.x + }, + { + "main.text.setup.y", + &menu.main.text.setup.y + }, + { + "main.text.setup.width", + &menu.main.text.setup.width + }, + { + "main.text.setup.height", + &menu.main.text.setup.height + }, + { + "main.text.setup.align", + &menu.main.text.setup.align + }, + { + "main.text.setup.valign", + &menu.main.text.setup.valign + }, + { + "main.text.setup.font", + &menu.main.text.setup.font + }, + { + "main.text.quit.x", + &menu.main.text.quit.x + }, + { + "main.text.quit.y", + &menu.main.text.quit.y + }, + { + "main.text.quit.width", + &menu.main.text.quit.width + }, + { + "main.text.quit.height", + &menu.main.text.quit.height + }, + { + "main.text.quit.align", + &menu.main.text.quit.align + }, + { + "main.text.quit.valign", + &menu.main.text.quit.valign + }, + { + "main.text.quit.font", + &menu.main.text.quit.font + }, + { + "main.text.first_level.x", + &menu.main.text.first_level.x + }, + { + "main.text.first_level.y", + &menu.main.text.first_level.y + }, + { + "main.text.first_level.align", + &menu.main.text.first_level.align + }, + { + "main.text.first_level.valign", + &menu.main.text.first_level.valign + }, + { + "main.text.first_level.digits", + &menu.main.text.first_level.size + }, + { + "main.text.first_level.font", + &menu.main.text.first_level.font + }, + { + "main.text.last_level.x", + &menu.main.text.last_level.x + }, + { + "main.text.last_level.y", + &menu.main.text.last_level.y + }, + { + "main.text.last_level.align", + &menu.main.text.last_level.align + }, + { + "main.text.last_level.valign", + &menu.main.text.last_level.valign + }, + { + "main.text.last_level.digits", + &menu.main.text.last_level.size + }, + { + "main.text.last_level.font", + &menu.main.text.last_level.font + }, + { + "main.text.level_number.x", + &menu.main.text.level_number.x + }, + { + "main.text.level_number.y", + &menu.main.text.level_number.y + }, + { + "main.text.level_number.align", + &menu.main.text.level_number.align + }, + { + "main.text.level_number.valign", + &menu.main.text.level_number.valign + }, + { + "main.text.level_number.digits", + &menu.main.text.level_number.size + }, + { + "main.text.level_number.font", + &menu.main.text.level_number.font + }, + { + "main.text.level_info_1.x", + &menu.main.text.level_info_1.x + }, + { + "main.text.level_info_1.y", + &menu.main.text.level_info_1.y + }, + { + "main.text.level_info_1.align", + &menu.main.text.level_info_1.align + }, + { + "main.text.level_info_1.valign", + &menu.main.text.level_info_1.valign + }, + { + "main.text.level_info_1.chars", + &menu.main.text.level_info_1.size + }, + { + "main.text.level_info_1.font", + &menu.main.text.level_info_1.font + }, + { + "main.text.level_info_2.x", + &menu.main.text.level_info_2.x + }, + { + "main.text.level_info_2.y", + &menu.main.text.level_info_2.y + }, + { + "main.text.level_info_2.align", + &menu.main.text.level_info_2.align + }, + { + "main.text.level_info_2.valign", + &menu.main.text.level_info_2.valign + }, + { + "main.text.level_info_2.chars", + &menu.main.text.level_info_2.size + }, + { + "main.text.level_info_2.font", + &menu.main.text.level_info_2.font + }, + { + "main.text.level_info_2.font_header", + &menu.main.text.level_info_2.font_alt + }, + { + "main.text.level_name.x", + &menu.main.text.level_name.x + }, + { + "main.text.level_name.y", + &menu.main.text.level_name.y + }, + { + "main.text.level_name.align", + &menu.main.text.level_name.align + }, + { + "main.text.level_name.valign", + &menu.main.text.level_name.valign + }, + { + "main.text.level_name.chars", + &menu.main.text.level_name.size + }, + { + "main.text.level_name.font", + &menu.main.text.level_name.font + }, + { + "main.text.level_author.x", + &menu.main.text.level_author.x + }, + { + "main.text.level_author.y", + &menu.main.text.level_author.y + }, + { + "main.text.level_author.align", + &menu.main.text.level_author.align + }, + { + "main.text.level_author.valign", + &menu.main.text.level_author.valign + }, + { + "main.text.level_author.chars", + &menu.main.text.level_author.size + }, + { + "main.text.level_author.font", + &menu.main.text.level_author.font + }, + { + "main.text.level_year.x", + &menu.main.text.level_year.x + }, + { + "main.text.level_year.y", + &menu.main.text.level_year.y + }, + { + "main.text.level_year.align", + &menu.main.text.level_year.align + }, + { + "main.text.level_year.valign", + &menu.main.text.level_year.valign + }, + { + "main.text.level_year.digits", + &menu.main.text.level_year.size + }, + { + "main.text.level_year.font", + &menu.main.text.level_year.font + }, + { + "main.text.level_imported_from.x", + &menu.main.text.level_imported_from.x + }, + { + "main.text.level_imported_from.y", + &menu.main.text.level_imported_from.y + }, + { + "main.text.level_imported_from.align", + &menu.main.text.level_imported_from.align + }, + { + "main.text.level_imported_from.valign", + &menu.main.text.level_imported_from.valign + }, + { + "main.text.level_imported_from.chars", + &menu.main.text.level_imported_from.size + }, + { + "main.text.level_imported_from.font", + &menu.main.text.level_imported_from.font + }, + { + "main.text.level_imported_by.x", + &menu.main.text.level_imported_by.x + }, + { + "main.text.level_imported_by.y", + &menu.main.text.level_imported_by.y + }, + { + "main.text.level_imported_by.align", + &menu.main.text.level_imported_by.align + }, + { + "main.text.level_imported_by.valign", + &menu.main.text.level_imported_by.valign + }, + { + "main.text.level_imported_by.chars", + &menu.main.text.level_imported_by.size + }, + { + "main.text.level_imported_by.font", + &menu.main.text.level_imported_by.font + }, + { + "main.text.level_tested_by.x", + &menu.main.text.level_tested_by.x + }, + { + "main.text.level_tested_by.y", + &menu.main.text.level_tested_by.y + }, + { + "main.text.level_tested_by.align", + &menu.main.text.level_tested_by.align + }, + { + "main.text.level_tested_by.valign", + &menu.main.text.level_tested_by.valign + }, + { + "main.text.level_tested_by.chars", + &menu.main.text.level_tested_by.size + }, + { + "main.text.level_tested_by.font", + &menu.main.text.level_tested_by.font + }, + { + "main.text.title_1.x", + &menu.main.text.title_1.x + }, + { + "main.text.title_1.y", + &menu.main.text.title_1.y + }, + { + "main.text.title_1.align", + &menu.main.text.title_1.align + }, + { + "main.text.title_1.valign", + &menu.main.text.title_1.valign + }, + { + "main.text.title_1.font", + &menu.main.text.title_1.font + }, + { + "main.text.title_2.x", + &menu.main.text.title_2.x + }, + { + "main.text.title_2.y", + &menu.main.text.title_2.y + }, + { + "main.text.title_2.align", + &menu.main.text.title_2.align + }, + { + "main.text.title_2.valign", + &menu.main.text.title_2.valign + }, + { + "main.text.title_2.font", + &menu.main.text.title_2.font + }, + { + "main.text.title_3.x", + &menu.main.text.title_3.x + }, + { + "main.text.title_3.y", + &menu.main.text.title_3.y + }, + { + "main.text.title_3.align", + &menu.main.text.title_3.align + }, + { + "main.text.title_3.valign", + &menu.main.text.title_3.valign + }, + { + "main.text.title_3.font", + &menu.main.text.title_3.font + }, + { + "main.input.name.x", + &menu.main.input.name.x + }, + { + "main.input.name.y", + &menu.main.input.name.y + }, + { + "main.input.name.align", + &menu.main.input.name.align + }, + { + "main.input.name.valign", + &menu.main.input.name.valign + }, + { + "main.input.name.font", + &menu.main.input.name.font + }, + { + "preview.x", + &preview.x + }, + { + "preview.y", + &preview.y + }, + { + "preview.align", + &preview.align + }, + { + "preview.valign", + &preview.valign + }, + { + "preview.xsize", + &preview.xsize + }, + { + "preview.ysize", + &preview.ysize + }, + { + "preview.xoffset", + &preview.xoffset + }, + { + "preview.yoffset", + &preview.yoffset + }, + { + "preview.tile_size", + &preview.tile_size + }, + { + "preview.step_offset", + &preview.step_offset + }, + { + "preview.step_delay", + &preview.step_delay + }, + { + "preview.anim_mode", + &preview.anim_mode + }, + { + "door_1.width", + &door_1.width + }, + { + "door_1.height", + &door_1.height + }, + { + "door_1.step_offset", + &door_1.step_offset + }, + { + "door_1.step_delay", + &door_1.step_delay + }, + { + "door_1.anim_mode", + &door_1.anim_mode + }, + { + "door_2.width", + &door_2.width + }, + { + "door_2.height", + &door_2.height + }, + { + "door_2.step_offset", + &door_2.step_offset + }, + { + "door_2.step_delay", + &door_2.step_delay + }, + { + "door_2.anim_mode", + &door_2.anim_mode + }, + { + "game.panel.level_number.x", + &game.panel.level_number.x + }, + { + "game.panel.level_number.y", + &game.panel.level_number.y + }, + { + "game.panel.level_number.align", + &game.panel.level_number.align + }, + { + "game.panel.level_number.valign", + &game.panel.level_number.valign + }, + { + "game.panel.level_number.digits", + &game.panel.level_number.size + }, + { + "game.panel.level_number.font", + &game.panel.level_number.font + }, + { + "game.panel.level_number.font_narrow", + &game.panel.level_number.font_alt + }, + { + "game.panel.level_number.draw_masked", + &game.panel.level_number.draw_masked + }, + { + "game.panel.level_number.draw_order", + &game.panel.level_number.sort_priority + }, + { + "game.panel.gems.x", + &game.panel.gems.x + }, + { + "game.panel.gems.y", + &game.panel.gems.y + }, + { + "game.panel.gems.align", + &game.panel.gems.align + }, + { + "game.panel.gems.valign", + &game.panel.gems.valign + }, + { + "game.panel.gems.digits", + &game.panel.gems.size + }, + { + "game.panel.gems.font", + &game.panel.gems.font + }, + { + "game.panel.gems.draw_masked", + &game.panel.gems.draw_masked + }, + { + "game.panel.gems.draw_order", + &game.panel.gems.sort_priority + }, + { + "game.panel.inventory_count.x", + &game.panel.inventory_count.x + }, + { + "game.panel.inventory_count.y", + &game.panel.inventory_count.y + }, + { + "game.panel.inventory_count.align", + &game.panel.inventory_count.align + }, + { + "game.panel.inventory_count.valign", + &game.panel.inventory_count.valign + }, + { + "game.panel.inventory_count.digits", + &game.panel.inventory_count.size + }, + { + "game.panel.inventory_count.font", + &game.panel.inventory_count.font + }, + { + "game.panel.inventory_count.draw_masked", + &game.panel.inventory_count.draw_masked + }, + { + "game.panel.inventory_count.draw_order", + &game.panel.inventory_count.sort_priority + }, + { + "game.panel.inventory_first_1.x", + &game.panel.inventory_first[0].x + }, + { + "game.panel.inventory_first_1.y", + &game.panel.inventory_first[0].y + }, + { + "game.panel.inventory_first_1.tile_size", + &game.panel.inventory_first[0].size + }, + { + "game.panel.inventory_first_1.draw_masked", + &game.panel.inventory_first[0].draw_masked + }, + { + "game.panel.inventory_first_1.draw_order", + &game.panel.inventory_first[0].sort_priority + }, + { + "game.panel.inventory_first_2.x", + &game.panel.inventory_first[1].x + }, + { + "game.panel.inventory_first_2.y", + &game.panel.inventory_first[1].y + }, + { + "game.panel.inventory_first_2.tile_size", + &game.panel.inventory_first[1].size + }, + { + "game.panel.inventory_first_2.draw_masked", + &game.panel.inventory_first[1].draw_masked + }, + { + "game.panel.inventory_first_2.draw_order", + &game.panel.inventory_first[1].sort_priority + }, + { + "game.panel.inventory_first_3.x", + &game.panel.inventory_first[2].x + }, + { + "game.panel.inventory_first_3.y", + &game.panel.inventory_first[2].y + }, + { + "game.panel.inventory_first_3.tile_size", + &game.panel.inventory_first[2].size + }, + { + "game.panel.inventory_first_3.draw_masked", + &game.panel.inventory_first[2].draw_masked + }, + { + "game.panel.inventory_first_3.draw_order", + &game.panel.inventory_first[2].sort_priority + }, + { + "game.panel.inventory_first_4.x", + &game.panel.inventory_first[3].x + }, + { + "game.panel.inventory_first_4.y", + &game.panel.inventory_first[3].y + }, + { + "game.panel.inventory_first_4.tile_size", + &game.panel.inventory_first[3].size + }, + { + "game.panel.inventory_first_4.draw_masked", + &game.panel.inventory_first[3].draw_masked + }, + { + "game.panel.inventory_first_4.draw_order", + &game.panel.inventory_first[3].sort_priority + }, + { + "game.panel.inventory_first_5.x", + &game.panel.inventory_first[4].x + }, + { + "game.panel.inventory_first_5.y", + &game.panel.inventory_first[4].y + }, + { + "game.panel.inventory_first_5.tile_size", + &game.panel.inventory_first[4].size + }, + { + "game.panel.inventory_first_5.draw_masked", + &game.panel.inventory_first[4].draw_masked + }, + { + "game.panel.inventory_first_5.draw_order", + &game.panel.inventory_first[4].sort_priority + }, + { + "game.panel.inventory_first_6.x", + &game.panel.inventory_first[5].x + }, + { + "game.panel.inventory_first_6.y", + &game.panel.inventory_first[5].y + }, + { + "game.panel.inventory_first_6.tile_size", + &game.panel.inventory_first[5].size + }, + { + "game.panel.inventory_first_6.draw_masked", + &game.panel.inventory_first[5].draw_masked + }, + { + "game.panel.inventory_first_6.draw_order", + &game.panel.inventory_first[5].sort_priority + }, + { + "game.panel.inventory_first_7.x", + &game.panel.inventory_first[6].x + }, + { + "game.panel.inventory_first_7.y", + &game.panel.inventory_first[6].y + }, + { + "game.panel.inventory_first_7.tile_size", + &game.panel.inventory_first[6].size + }, + { + "game.panel.inventory_first_7.draw_masked", + &game.panel.inventory_first[6].draw_masked + }, + { + "game.panel.inventory_first_7.draw_order", + &game.panel.inventory_first[6].sort_priority + }, + { + "game.panel.inventory_first_8.x", + &game.panel.inventory_first[7].x + }, + { + "game.panel.inventory_first_8.y", + &game.panel.inventory_first[7].y + }, + { + "game.panel.inventory_first_8.tile_size", + &game.panel.inventory_first[7].size + }, + { + "game.panel.inventory_first_8.draw_masked", + &game.panel.inventory_first[7].draw_masked + }, + { + "game.panel.inventory_first_8.draw_order", + &game.panel.inventory_first[7].sort_priority + }, + { + "game.panel.inventory_last_1.x", + &game.panel.inventory_last[0].x + }, + { + "game.panel.inventory_last_1.y", + &game.panel.inventory_last[0].y + }, + { + "game.panel.inventory_last_1.tile_size", + &game.panel.inventory_last[0].size + }, + { + "game.panel.inventory_last_1.draw_masked", + &game.panel.inventory_last[0].draw_masked + }, + { + "game.panel.inventory_last_1.draw_order", + &game.panel.inventory_last[0].sort_priority + }, + { + "game.panel.inventory_last_2.x", + &game.panel.inventory_last[1].x + }, + { + "game.panel.inventory_last_2.y", + &game.panel.inventory_last[1].y + }, + { + "game.panel.inventory_last_2.tile_size", + &game.panel.inventory_last[1].size + }, + { + "game.panel.inventory_last_2.draw_masked", + &game.panel.inventory_last[1].draw_masked + }, + { + "game.panel.inventory_last_2.draw_order", + &game.panel.inventory_last[1].sort_priority + }, + { + "game.panel.inventory_last_3.x", + &game.panel.inventory_last[2].x + }, + { + "game.panel.inventory_last_3.y", + &game.panel.inventory_last[2].y + }, + { + "game.panel.inventory_last_3.tile_size", + &game.panel.inventory_last[2].size + }, + { + "game.panel.inventory_last_3.draw_masked", + &game.panel.inventory_last[2].draw_masked + }, + { + "game.panel.inventory_last_3.draw_order", + &game.panel.inventory_last[2].sort_priority + }, + { + "game.panel.inventory_last_4.x", + &game.panel.inventory_last[3].x + }, + { + "game.panel.inventory_last_4.y", + &game.panel.inventory_last[3].y + }, + { + "game.panel.inventory_last_4.tile_size", + &game.panel.inventory_last[3].size + }, + { + "game.panel.inventory_last_4.draw_masked", + &game.panel.inventory_last[3].draw_masked + }, + { + "game.panel.inventory_last_4.draw_order", + &game.panel.inventory_last[3].sort_priority + }, + { + "game.panel.inventory_last_5.x", + &game.panel.inventory_last[4].x + }, + { + "game.panel.inventory_last_5.y", + &game.panel.inventory_last[4].y + }, + { + "game.panel.inventory_last_5.tile_size", + &game.panel.inventory_last[4].size + }, + { + "game.panel.inventory_last_5.draw_masked", + &game.panel.inventory_last[4].draw_masked + }, + { + "game.panel.inventory_last_5.draw_order", + &game.panel.inventory_last[4].sort_priority + }, + { + "game.panel.inventory_last_6.x", + &game.panel.inventory_last[5].x + }, + { + "game.panel.inventory_last_6.y", + &game.panel.inventory_last[5].y + }, + { + "game.panel.inventory_last_6.tile_size", + &game.panel.inventory_last[5].size + }, + { + "game.panel.inventory_last_6.draw_masked", + &game.panel.inventory_last[5].draw_masked + }, + { + "game.panel.inventory_last_6.draw_order", + &game.panel.inventory_last[5].sort_priority + }, + { + "game.panel.inventory_last_7.x", + &game.panel.inventory_last[6].x + }, + { + "game.panel.inventory_last_7.y", + &game.panel.inventory_last[6].y + }, + { + "game.panel.inventory_last_7.tile_size", + &game.panel.inventory_last[6].size + }, + { + "game.panel.inventory_last_7.draw_masked", + &game.panel.inventory_last[6].draw_masked + }, + { + "game.panel.inventory_last_7.draw_order", + &game.panel.inventory_last[6].sort_priority + }, + { + "game.panel.inventory_last_8.x", + &game.panel.inventory_last[7].x + }, + { + "game.panel.inventory_last_8.y", + &game.panel.inventory_last[7].y + }, + { + "game.panel.inventory_last_8.tile_size", + &game.panel.inventory_last[7].size + }, + { + "game.panel.inventory_last_8.draw_masked", + &game.panel.inventory_last[7].draw_masked + }, + { + "game.panel.inventory_last_8.draw_order", + &game.panel.inventory_last[7].sort_priority + }, + { + "game.panel.key_1.x", + &game.panel.key[0].x + }, + { + "game.panel.key_1.y", + &game.panel.key[0].y + }, + { + "game.panel.key_1.tile_size", + &game.panel.key[0].size + }, + { + "game.panel.key_1.draw_masked", + &game.panel.key[0].draw_masked + }, + { + "game.panel.key_1.draw_order", + &game.panel.key[0].sort_priority + }, + { + "game.panel.key_2.x", + &game.panel.key[1].x + }, + { + "game.panel.key_2.y", + &game.panel.key[1].y + }, + { + "game.panel.key_2.tile_size", + &game.panel.key[1].size + }, + { + "game.panel.key_2.draw_masked", + &game.panel.key[1].draw_masked + }, + { + "game.panel.key_2.draw_order", + &game.panel.key[1].sort_priority + }, + { + "game.panel.key_3.x", + &game.panel.key[2].x + }, + { + "game.panel.key_3.y", + &game.panel.key[2].y + }, + { + "game.panel.key_3.tile_size", + &game.panel.key[2].size + }, + { + "game.panel.key_3.draw_masked", + &game.panel.key[2].draw_masked + }, + { + "game.panel.key_3.draw_order", + &game.panel.key[2].sort_priority + }, + { + "game.panel.key_4.x", + &game.panel.key[3].x + }, + { + "game.panel.key_4.y", + &game.panel.key[3].y + }, + { + "game.panel.key_4.tile_size", + &game.panel.key[3].size + }, + { + "game.panel.key_4.draw_masked", + &game.panel.key[3].draw_masked + }, + { + "game.panel.key_4.draw_order", + &game.panel.key[3].sort_priority + }, + { + "game.panel.key_5.x", + &game.panel.key[4].x + }, + { + "game.panel.key_5.y", + &game.panel.key[4].y + }, + { + "game.panel.key_5.tile_size", + &game.panel.key[4].size + }, + { + "game.panel.key_5.draw_masked", + &game.panel.key[4].draw_masked + }, + { + "game.panel.key_5.draw_order", + &game.panel.key[4].sort_priority + }, + { + "game.panel.key_6.x", + &game.panel.key[5].x + }, + { + "game.panel.key_6.y", + &game.panel.key[5].y + }, + { + "game.panel.key_6.tile_size", + &game.panel.key[5].size + }, + { + "game.panel.key_6.draw_masked", + &game.panel.key[5].draw_masked + }, + { + "game.panel.key_6.draw_order", + &game.panel.key[5].sort_priority + }, + { + "game.panel.key_7.x", + &game.panel.key[6].x + }, + { + "game.panel.key_7.y", + &game.panel.key[6].y + }, + { + "game.panel.key_7.tile_size", + &game.panel.key[6].size + }, + { + "game.panel.key_7.draw_masked", + &game.panel.key[6].draw_masked + }, + { + "game.panel.key_7.draw_order", + &game.panel.key[6].sort_priority + }, + { + "game.panel.key_8.x", + &game.panel.key[7].x + }, + { + "game.panel.key_8.y", + &game.panel.key[7].y + }, + { + "game.panel.key_8.tile_size", + &game.panel.key[7].size + }, + { + "game.panel.key_8.draw_masked", + &game.panel.key[7].draw_masked + }, + { + "game.panel.key_8.draw_order", + &game.panel.key[7].sort_priority + }, + { + "game.panel.key_white.x", + &game.panel.key_white.x + }, + { + "game.panel.key_white.y", + &game.panel.key_white.y + }, + { + "game.panel.key_white.tile_size", + &game.panel.key_white.size + }, + { + "game.panel.key_white.draw_masked", + &game.panel.key_white.draw_masked + }, + { + "game.panel.key_white.draw_order", + &game.panel.key_white.sort_priority + }, + { + "game.panel.key_white_count.x", + &game.panel.key_white_count.x + }, + { + "game.panel.key_white_count.y", + &game.panel.key_white_count.y + }, + { + "game.panel.key_white_count.align", + &game.panel.key_white_count.align + }, + { + "game.panel.key_white_count.valign", + &game.panel.key_white_count.valign + }, + { + "game.panel.key_white_count.digits", + &game.panel.key_white_count.size + }, + { + "game.panel.key_white_count.font", + &game.panel.key_white_count.font + }, + { + "game.panel.key_white_count.draw_masked", + &game.panel.key_white_count.draw_masked + }, + { + "game.panel.key_white_count.draw_order", + &game.panel.key_white_count.sort_priority + }, + { + "game.panel.score.x", + &game.panel.score.x + }, + { + "game.panel.score.y", + &game.panel.score.y + }, + { + "game.panel.score.align", + &game.panel.score.align + }, + { + "game.panel.score.valign", + &game.panel.score.valign + }, + { + "game.panel.score.digits", + &game.panel.score.size + }, + { + "game.panel.score.font", + &game.panel.score.font + }, + { + "game.panel.score.draw_masked", + &game.panel.score.draw_masked + }, + { + "game.panel.score.draw_order", + &game.panel.score.sort_priority + }, + { + "game.panel.time.x", + &game.panel.time.x + }, + { + "game.panel.time.y", + &game.panel.time.y + }, + { + "game.panel.time.align", + &game.panel.time.align + }, + { + "game.panel.time.valign", + &game.panel.time.valign + }, + { + "game.panel.time.digits", + &game.panel.time.size + }, + { + "game.panel.time.font", + &game.panel.time.font + }, + { + "game.panel.time.font_narrow", + &game.panel.time.font_alt + }, + { + "game.panel.time.draw_masked", + &game.panel.time.draw_masked + }, + { + "game.panel.time.draw_order", + &game.panel.time.sort_priority + }, + { + "game.panel.time_hh.x", + &game.panel.time_hh.x + }, + { + "game.panel.time_hh.y", + &game.panel.time_hh.y + }, + { + "game.panel.time_hh.align", + &game.panel.time_hh.align + }, + { + "game.panel.time_hh.valign", + &game.panel.time_hh.valign + }, + { + "game.panel.time_hh.digits", + &game.panel.time_hh.size + }, + { + "game.panel.time_hh.font", + &game.panel.time_hh.font + }, + { + "game.panel.time_hh.draw_masked", + &game.panel.time_hh.draw_masked + }, + { + "game.panel.time_hh.draw_order", + &game.panel.time_hh.sort_priority + }, + { + "game.panel.time_mm.x", + &game.panel.time_mm.x + }, + { + "game.panel.time_mm.y", + &game.panel.time_mm.y + }, + { + "game.panel.time_mm.align", + &game.panel.time_mm.align + }, + { + "game.panel.time_mm.valign", + &game.panel.time_mm.valign + }, + { + "game.panel.time_mm.digits", + &game.panel.time_mm.size + }, + { + "game.panel.time_mm.font", + &game.panel.time_mm.font + }, + { + "game.panel.time_mm.draw_masked", + &game.panel.time_mm.draw_masked + }, + { + "game.panel.time_mm.draw_order", + &game.panel.time_mm.sort_priority + }, + { + "game.panel.time_ss.x", + &game.panel.time_ss.x + }, + { + "game.panel.time_ss.y", + &game.panel.time_ss.y + }, + { + "game.panel.time_ss.align", + &game.panel.time_ss.align + }, + { + "game.panel.time_ss.valign", + &game.panel.time_ss.valign + }, + { + "game.panel.time_ss.digits", + &game.panel.time_ss.size + }, + { + "game.panel.time_ss.font", + &game.panel.time_ss.font + }, + { + "game.panel.time_ss.draw_masked", + &game.panel.time_ss.draw_masked + }, + { + "game.panel.time_ss.draw_order", + &game.panel.time_ss.sort_priority + }, + { + "game.panel.shield_normal.x", + &game.panel.shield_normal.x + }, + { + "game.panel.shield_normal.y", + &game.panel.shield_normal.y + }, + { + "game.panel.shield_normal.tile_size", + &game.panel.shield_normal.size + }, + { + "game.panel.shield_normal.draw_masked", + &game.panel.shield_normal.draw_masked + }, + { + "game.panel.shield_normal.draw_order", + &game.panel.shield_normal.sort_priority + }, + { + "game.panel.shield_normal_time.x", + &game.panel.shield_normal_time.x + }, + { + "game.panel.shield_normal_time.y", + &game.panel.shield_normal_time.y + }, + { + "game.panel.shield_normal_time.align", + &game.panel.shield_normal_time.align + }, + { + "game.panel.shield_normal_time.valign", + &game.panel.shield_normal_time.valign + }, + { + "game.panel.shield_normal_time.digits", + &game.panel.shield_normal_time.size + }, + { + "game.panel.shield_normal_time.font", + &game.panel.shield_normal_time.font + }, + { + "game.panel.shield_normal_time.draw_masked", + &game.panel.shield_normal_time.draw_masked + }, + { + "game.panel.shield_normal_time.draw_order", + &game.panel.shield_normal_time.sort_priority + }, + { + "game.panel.shield_deadly.x", + &game.panel.shield_deadly.x + }, + { + "game.panel.shield_deadly.y", + &game.panel.shield_deadly.y + }, + { + "game.panel.shield_deadly.tile_size", + &game.panel.shield_deadly.size + }, + { + "game.panel.shield_deadly.draw_masked", + &game.panel.shield_deadly.draw_masked + }, + { + "game.panel.shield_deadly.draw_order", + &game.panel.shield_deadly.sort_priority + }, + { + "game.panel.shield_deadly_time.x", + &game.panel.shield_deadly_time.x + }, + { + "game.panel.shield_deadly_time.y", + &game.panel.shield_deadly_time.y + }, + { + "game.panel.shield_deadly_time.align", + &game.panel.shield_deadly_time.align + }, + { + "game.panel.shield_deadly_time.valign", + &game.panel.shield_deadly_time.valign + }, + { + "game.panel.shield_deadly_time.digits", + &game.panel.shield_deadly_time.size + }, + { + "game.panel.shield_deadly_time.font", + &game.panel.shield_deadly_time.font + }, + { + "game.panel.shield_deadly_time.draw_masked", + &game.panel.shield_deadly_time.draw_masked + }, + { + "game.panel.shield_deadly_time.draw_order", + &game.panel.shield_deadly_time.sort_priority + }, + { + "game.panel.exit.x", + &game.panel.exit.x + }, + { + "game.panel.exit.y", + &game.panel.exit.y + }, + { + "game.panel.exit.tile_size", + &game.panel.exit.size + }, + { + "game.panel.exit.draw_masked", + &game.panel.exit.draw_masked + }, + { + "game.panel.exit.draw_order", + &game.panel.exit.sort_priority + }, + { + "game.panel.emc_magic_ball.x", + &game.panel.emc_magic_ball.x + }, + { + "game.panel.emc_magic_ball.y", + &game.panel.emc_magic_ball.y + }, + { + "game.panel.emc_magic_ball.tile_size", + &game.panel.emc_magic_ball.size + }, + { + "game.panel.emc_magic_ball.draw_masked", + &game.panel.emc_magic_ball.draw_masked + }, + { + "game.panel.emc_magic_ball.draw_order", + &game.panel.emc_magic_ball.sort_priority + }, + { + "game.panel.emc_magic_ball_switch.x", + &game.panel.emc_magic_ball_switch.x + }, + { + "game.panel.emc_magic_ball_switch.y", + &game.panel.emc_magic_ball_switch.y + }, + { + "game.panel.emc_magic_ball_switch.tile_size", + &game.panel.emc_magic_ball_switch.size + }, + { + "game.panel.emc_magic_ball_switch.draw_masked", + &game.panel.emc_magic_ball_switch.draw_masked + }, + { + "game.panel.emc_magic_ball_switch.draw_order", + &game.panel.emc_magic_ball_switch.sort_priority + }, + { + "game.panel.light_switch.x", + &game.panel.light_switch.x + }, + { + "game.panel.light_switch.y", + &game.panel.light_switch.y + }, + { + "game.panel.light_switch.tile_size", + &game.panel.light_switch.size + }, + { + "game.panel.light_switch.draw_masked", + &game.panel.light_switch.draw_masked + }, + { + "game.panel.light_switch.draw_order", + &game.panel.light_switch.sort_priority + }, + { + "game.panel.light_switch_time.x", + &game.panel.light_switch_time.x + }, + { + "game.panel.light_switch_time.y", + &game.panel.light_switch_time.y + }, + { + "game.panel.light_switch_time.align", + &game.panel.light_switch_time.align + }, + { + "game.panel.light_switch_time.valign", + &game.panel.light_switch_time.valign + }, + { + "game.panel.light_switch_time.digits", + &game.panel.light_switch_time.size + }, + { + "game.panel.light_switch_time.font", + &game.panel.light_switch_time.font + }, + { + "game.panel.light_switch_time.draw_masked", + &game.panel.light_switch_time.draw_masked + }, + { + "game.panel.light_switch_time.draw_order", + &game.panel.light_switch_time.sort_priority + }, + { + "game.panel.timegate_switch.x", + &game.panel.timegate_switch.x + }, + { + "game.panel.timegate_switch.y", + &game.panel.timegate_switch.y + }, + { + "game.panel.timegate_switch.tile_size", + &game.panel.timegate_switch.size + }, + { + "game.panel.timegate_switch.draw_masked", + &game.panel.timegate_switch.draw_masked + }, + { + "game.panel.timegate_switch.draw_order", + &game.panel.timegate_switch.sort_priority + }, + { + "game.panel.timegate_switch_time.x", + &game.panel.timegate_switch_time.x + }, + { + "game.panel.timegate_switch_time.y", + &game.panel.timegate_switch_time.y + }, + { + "game.panel.timegate_switch_time.align", + &game.panel.timegate_switch_time.align + }, + { + "game.panel.timegate_switch_time.valign", + &game.panel.timegate_switch_time.valign + }, + { + "game.panel.timegate_switch_time.digits", + &game.panel.timegate_switch_time.size + }, + { + "game.panel.timegate_switch_time.font", + &game.panel.timegate_switch_time.font + }, + { + "game.panel.timegate_switch_time.draw_masked", + &game.panel.timegate_switch_time.draw_masked + }, + { + "game.panel.timegate_switch_time.draw_order", + &game.panel.timegate_switch_time.sort_priority + }, + { + "game.panel.switchgate_switch.x", + &game.panel.switchgate_switch.x + }, + { + "game.panel.switchgate_switch.y", + &game.panel.switchgate_switch.y + }, + { + "game.panel.switchgate_switch.tile_size", + &game.panel.switchgate_switch.size + }, + { + "game.panel.switchgate_switch.draw_masked", + &game.panel.switchgate_switch.draw_masked + }, + { + "game.panel.switchgate_switch.draw_order", + &game.panel.switchgate_switch.sort_priority + }, + { + "game.panel.emc_lenses.x", + &game.panel.emc_lenses.x + }, + { + "game.panel.emc_lenses.y", + &game.panel.emc_lenses.y + }, + { + "game.panel.emc_lenses.tile_size", + &game.panel.emc_lenses.size + }, + { + "game.panel.emc_lenses.draw_masked", + &game.panel.emc_lenses.draw_masked + }, + { + "game.panel.emc_lenses.draw_order", + &game.panel.emc_lenses.sort_priority + }, + { + "game.panel.emc_lenses_time.x", + &game.panel.emc_lenses_time.x + }, + { + "game.panel.emc_lenses_time.y", + &game.panel.emc_lenses_time.y + }, + { + "game.panel.emc_lenses_time.align", + &game.panel.emc_lenses_time.align + }, + { + "game.panel.emc_lenses_time.valign", + &game.panel.emc_lenses_time.valign + }, + { + "game.panel.emc_lenses_time.digits", + &game.panel.emc_lenses_time.size + }, + { + "game.panel.emc_lenses_time.font", + &game.panel.emc_lenses_time.font + }, + { + "game.panel.emc_lenses_time.draw_masked", + &game.panel.emc_lenses_time.draw_masked + }, + { + "game.panel.emc_lenses_time.draw_order", + &game.panel.emc_lenses_time.sort_priority + }, + { + "game.panel.emc_magnifier.x", + &game.panel.emc_magnifier.x + }, + { + "game.panel.emc_magnifier.y", + &game.panel.emc_magnifier.y + }, + { + "game.panel.emc_magnifier.tile_size", + &game.panel.emc_magnifier.size + }, + { + "game.panel.emc_magnifier.draw_masked", + &game.panel.emc_magnifier.draw_masked + }, + { + "game.panel.emc_magnifier.draw_order", + &game.panel.emc_magnifier.sort_priority + }, + { + "game.panel.emc_magnifier_time.x", + &game.panel.emc_magnifier_time.x + }, + { + "game.panel.emc_magnifier_time.y", + &game.panel.emc_magnifier_time.y + }, + { + "game.panel.emc_magnifier_time.align", + &game.panel.emc_magnifier_time.align + }, + { + "game.panel.emc_magnifier_time.valign", + &game.panel.emc_magnifier_time.valign + }, + { + "game.panel.emc_magnifier_time.digits", + &game.panel.emc_magnifier_time.size + }, + { + "game.panel.emc_magnifier_time.font", + &game.panel.emc_magnifier_time.font + }, + { + "game.panel.emc_magnifier_time.draw_masked", + &game.panel.emc_magnifier_time.draw_masked + }, + { + "game.panel.emc_magnifier_time.draw_order", + &game.panel.emc_magnifier_time.sort_priority + }, + { + "game.panel.balloon_switch.x", + &game.panel.balloon_switch.x + }, + { + "game.panel.balloon_switch.y", + &game.panel.balloon_switch.y + }, + { + "game.panel.balloon_switch.tile_size", + &game.panel.balloon_switch.size + }, + { + "game.panel.balloon_switch.draw_masked", + &game.panel.balloon_switch.draw_masked + }, + { + "game.panel.balloon_switch.draw_order", + &game.panel.balloon_switch.sort_priority + }, + { + "game.panel.dynabomb_number.x", + &game.panel.dynabomb_number.x + }, + { + "game.panel.dynabomb_number.y", + &game.panel.dynabomb_number.y + }, + { + "game.panel.dynabomb_number.align", + &game.panel.dynabomb_number.align + }, + { + "game.panel.dynabomb_number.valign", + &game.panel.dynabomb_number.valign + }, + { + "game.panel.dynabomb_number.digits", + &game.panel.dynabomb_number.size + }, + { + "game.panel.dynabomb_number.font", + &game.panel.dynabomb_number.font + }, + { + "game.panel.dynabomb_number.draw_masked", + &game.panel.dynabomb_number.draw_masked + }, + { + "game.panel.dynabomb_number.draw_order", + &game.panel.dynabomb_number.sort_priority + }, + { + "game.panel.dynabomb_size.x", + &game.panel.dynabomb_size.x + }, + { + "game.panel.dynabomb_size.y", + &game.panel.dynabomb_size.y + }, + { + "game.panel.dynabomb_size.align", + &game.panel.dynabomb_size.align + }, + { + "game.panel.dynabomb_size.valign", + &game.panel.dynabomb_size.valign + }, + { + "game.panel.dynabomb_size.digits", + &game.panel.dynabomb_size.size + }, + { + "game.panel.dynabomb_size.font", + &game.panel.dynabomb_size.font + }, + { + "game.panel.dynabomb_size.draw_masked", + &game.panel.dynabomb_size.draw_masked + }, + { + "game.panel.dynabomb_size.draw_order", + &game.panel.dynabomb_size.sort_priority + }, + { + "game.panel.dynabomb_power.x", + &game.panel.dynabomb_power.x + }, + { + "game.panel.dynabomb_power.y", + &game.panel.dynabomb_power.y + }, + { + "game.panel.dynabomb_power.tile_size", + &game.panel.dynabomb_power.size + }, + { + "game.panel.dynabomb_power.draw_masked", + &game.panel.dynabomb_power.draw_masked + }, + { + "game.panel.dynabomb_power.draw_order", + &game.panel.dynabomb_power.sort_priority + }, + { + "game.panel.penguins.x", + &game.panel.penguins.x + }, + { + "game.panel.penguins.y", + &game.panel.penguins.y + }, + { + "game.panel.penguins.align", + &game.panel.penguins.align + }, + { + "game.panel.penguins.valign", + &game.panel.penguins.valign + }, + { + "game.panel.penguins.digits", + &game.panel.penguins.size + }, + { + "game.panel.penguins.font", + &game.panel.penguins.font + }, + { + "game.panel.penguins.draw_masked", + &game.panel.penguins.draw_masked + }, + { + "game.panel.penguins.draw_order", + &game.panel.penguins.sort_priority + }, + { + "game.panel.sokoban_objects.x", + &game.panel.sokoban_objects.x + }, + { + "game.panel.sokoban_objects.y", + &game.panel.sokoban_objects.y + }, + { + "game.panel.sokoban_objects.align", + &game.panel.sokoban_objects.align + }, + { + "game.panel.sokoban_objects.valign", + &game.panel.sokoban_objects.valign + }, + { + "game.panel.sokoban_objects.digits", + &game.panel.sokoban_objects.size + }, + { + "game.panel.sokoban_objects.font", + &game.panel.sokoban_objects.font + }, + { + "game.panel.sokoban_objects.draw_masked", + &game.panel.sokoban_objects.draw_masked + }, + { + "game.panel.sokoban_objects.draw_order", + &game.panel.sokoban_objects.sort_priority + }, + { + "game.panel.sokoban_fields.x", + &game.panel.sokoban_fields.x + }, + { + "game.panel.sokoban_fields.y", + &game.panel.sokoban_fields.y + }, + { + "game.panel.sokoban_fields.align", + &game.panel.sokoban_fields.align + }, + { + "game.panel.sokoban_fields.valign", + &game.panel.sokoban_fields.valign + }, + { + "game.panel.sokoban_fields.digits", + &game.panel.sokoban_fields.size + }, + { + "game.panel.sokoban_fields.font", + &game.panel.sokoban_fields.font + }, + { + "game.panel.sokoban_fields.draw_masked", + &game.panel.sokoban_fields.draw_masked + }, + { + "game.panel.sokoban_fields.draw_order", + &game.panel.sokoban_fields.sort_priority + }, + { + "game.panel.robot_wheel.x", + &game.panel.robot_wheel.x + }, + { + "game.panel.robot_wheel.y", + &game.panel.robot_wheel.y + }, + { + "game.panel.robot_wheel.tile_size", + &game.panel.robot_wheel.size + }, + { + "game.panel.robot_wheel.draw_masked", + &game.panel.robot_wheel.draw_masked + }, + { + "game.panel.robot_wheel.draw_order", + &game.panel.robot_wheel.sort_priority + }, + { + "game.panel.conveyor_belt_1.x", + &game.panel.conveyor_belt[0].x + }, + { + "game.panel.conveyor_belt_1.y", + &game.panel.conveyor_belt[0].y + }, + { + "game.panel.conveyor_belt_1.tile_size", + &game.panel.conveyor_belt[0].size + }, + { + "game.panel.conveyor_belt_1.draw_masked", + &game.panel.conveyor_belt[0].draw_masked + }, + { + "game.panel.conveyor_belt_1.draw_order", + &game.panel.conveyor_belt[0].sort_priority + }, + { + "game.panel.conveyor_belt_1_switch.x", + &game.panel.conveyor_belt_switch[0].x + }, + { + "game.panel.conveyor_belt_1_switch.y", + &game.panel.conveyor_belt_switch[0].y + }, + { + "game.panel.conveyor_belt_1_switch.tile_size", + &game.panel.conveyor_belt_switch[0].size + }, + { + "game.panel.conveyor_belt_1_switch.draw_masked", + &game.panel.conveyor_belt_switch[0].draw_masked + }, + { + "game.panel.conveyor_belt_1_switch.draw_order", + &game.panel.conveyor_belt_switch[0].sort_priority + }, + { + "game.panel.conveyor_belt_2.x", + &game.panel.conveyor_belt[1].x + }, + { + "game.panel.conveyor_belt_2.y", + &game.panel.conveyor_belt[1].y + }, + { + "game.panel.conveyor_belt_2.tile_size", + &game.panel.conveyor_belt[1].size + }, + { + "game.panel.conveyor_belt_2.draw_masked", + &game.panel.conveyor_belt[1].draw_masked + }, + { + "game.panel.conveyor_belt_2.draw_order", + &game.panel.conveyor_belt[1].sort_priority + }, + { + "game.panel.conveyor_belt_2_switch.x", + &game.panel.conveyor_belt_switch[1].x + }, + { + "game.panel.conveyor_belt_2_switch.y", + &game.panel.conveyor_belt_switch[1].y + }, + { + "game.panel.conveyor_belt_2_switch.tile_size", + &game.panel.conveyor_belt_switch[1].size + }, + { + "game.panel.conveyor_belt_2_switch.draw_masked", + &game.panel.conveyor_belt_switch[1].draw_masked + }, + { + "game.panel.conveyor_belt_2_switch.draw_order", + &game.panel.conveyor_belt_switch[1].sort_priority + }, + { + "game.panel.conveyor_belt_3.x", + &game.panel.conveyor_belt[2].x + }, + { + "game.panel.conveyor_belt_3.y", + &game.panel.conveyor_belt[2].y + }, + { + "game.panel.conveyor_belt_3.tile_size", + &game.panel.conveyor_belt[2].size + }, + { + "game.panel.conveyor_belt_3.draw_masked", + &game.panel.conveyor_belt[2].draw_masked + }, + { + "game.panel.conveyor_belt_3.draw_order", + &game.panel.conveyor_belt[2].sort_priority + }, + { + "game.panel.conveyor_belt_3_switch.x", + &game.panel.conveyor_belt_switch[2].x + }, + { + "game.panel.conveyor_belt_3_switch.y", + &game.panel.conveyor_belt_switch[2].y + }, + { + "game.panel.conveyor_belt_3_switch.tile_size", + &game.panel.conveyor_belt_switch[2].size + }, + { + "game.panel.conveyor_belt_3_switch.draw_masked", + &game.panel.conveyor_belt_switch[2].draw_masked + }, + { + "game.panel.conveyor_belt_3_switch.draw_order", + &game.panel.conveyor_belt_switch[2].sort_priority + }, + { + "game.panel.conveyor_belt_4.x", + &game.panel.conveyor_belt[3].x + }, + { + "game.panel.conveyor_belt_4.y", + &game.panel.conveyor_belt[3].y + }, + { + "game.panel.conveyor_belt_4.tile_size", + &game.panel.conveyor_belt[3].size + }, + { + "game.panel.conveyor_belt_4.draw_masked", + &game.panel.conveyor_belt[3].draw_masked + }, + { + "game.panel.conveyor_belt_4.draw_order", + &game.panel.conveyor_belt[3].sort_priority + }, + { + "game.panel.conveyor_belt_4_switch.x", + &game.panel.conveyor_belt_switch[3].x + }, + { + "game.panel.conveyor_belt_4_switch.y", + &game.panel.conveyor_belt_switch[3].y + }, + { + "game.panel.conveyor_belt_4_switch.tile_size", + &game.panel.conveyor_belt_switch[3].size + }, + { + "game.panel.conveyor_belt_4_switch.draw_masked", + &game.panel.conveyor_belt_switch[3].draw_masked + }, + { + "game.panel.conveyor_belt_4_switch.draw_order", + &game.panel.conveyor_belt_switch[3].sort_priority + }, + { + "game.panel.magic_wall.x", + &game.panel.magic_wall.x + }, + { + "game.panel.magic_wall.y", + &game.panel.magic_wall.y + }, + { + "game.panel.magic_wall.tile_size", + &game.panel.magic_wall.size + }, + { + "game.panel.magic_wall.draw_masked", + &game.panel.magic_wall.draw_masked + }, + { + "game.panel.magic_wall.draw_order", + &game.panel.magic_wall.sort_priority + }, + { + "game.panel.magic_wall_time.x", + &game.panel.magic_wall_time.x + }, + { + "game.panel.magic_wall_time.y", + &game.panel.magic_wall_time.y + }, + { + "game.panel.magic_wall_time.align", + &game.panel.magic_wall_time.align + }, + { + "game.panel.magic_wall_time.valign", + &game.panel.magic_wall_time.valign + }, + { + "game.panel.magic_wall_time.digits", + &game.panel.magic_wall_time.size + }, + { + "game.panel.magic_wall_time.font", + &game.panel.magic_wall_time.font + }, + { + "game.panel.magic_wall_time.draw_masked", + &game.panel.magic_wall_time.draw_masked + }, + { + "game.panel.magic_wall_time.draw_order", + &game.panel.magic_wall_time.sort_priority + }, + { + "game.panel.gravity_state.x", + &game.panel.gravity_state.x + }, + { + "game.panel.gravity_state.y", + &game.panel.gravity_state.y + }, + { + "game.panel.gravity_state.align", + &game.panel.gravity_state.align + }, + { + "game.panel.gravity_state.valign", + &game.panel.gravity_state.valign + }, + { + "game.panel.gravity_state.chars", + &game.panel.gravity_state.size + }, + { + "game.panel.gravity_state.font", + &game.panel.gravity_state.font + }, + { + "game.panel.gravity_state.font_active", + &game.panel.gravity_state.font_alt + }, + { + "game.panel.gravity_state.draw_masked", + &game.panel.gravity_state.draw_masked + }, + { + "game.panel.gravity_state.draw_order", + &game.panel.gravity_state.sort_priority + }, + { + "game.panel.graphic_1.x", + &game.panel.graphic[0].x + }, + { + "game.panel.graphic_1.y", + &game.panel.graphic[0].y + }, + { + "game.panel.graphic_1.draw_masked", + &game.panel.graphic[0].draw_masked + }, + { + "game.panel.graphic_1.draw_order", + &game.panel.graphic[0].sort_priority + }, + { + "game.panel.graphic_2.x", + &game.panel.graphic[1].x + }, + { + "game.panel.graphic_2.y", + &game.panel.graphic[1].y + }, + { + "game.panel.graphic_2.draw_masked", + &game.panel.graphic[1].draw_masked + }, + { + "game.panel.graphic_2.draw_order", + &game.panel.graphic[1].sort_priority + }, + { + "game.panel.graphic_3.x", + &game.panel.graphic[2].x + }, + { + "game.panel.graphic_3.y", + &game.panel.graphic[2].y + }, + { + "game.panel.graphic_3.draw_masked", + &game.panel.graphic[2].draw_masked + }, + { + "game.panel.graphic_3.draw_order", + &game.panel.graphic[2].sort_priority + }, + { + "game.panel.graphic_4.x", + &game.panel.graphic[3].x + }, + { + "game.panel.graphic_4.y", + &game.panel.graphic[3].y + }, + { + "game.panel.graphic_4.draw_masked", + &game.panel.graphic[3].draw_masked + }, + { + "game.panel.graphic_4.draw_order", + &game.panel.graphic[3].sort_priority + }, + { + "game.panel.graphic_5.x", + &game.panel.graphic[4].x + }, + { + "game.panel.graphic_5.y", + &game.panel.graphic[4].y + }, + { + "game.panel.graphic_5.draw_masked", + &game.panel.graphic[4].draw_masked + }, + { + "game.panel.graphic_5.draw_order", + &game.panel.graphic[4].sort_priority + }, + { + "game.panel.graphic_6.x", + &game.panel.graphic[5].x + }, + { + "game.panel.graphic_6.y", + &game.panel.graphic[5].y + }, + { + "game.panel.graphic_6.draw_masked", + &game.panel.graphic[5].draw_masked + }, + { + "game.panel.graphic_6.draw_order", + &game.panel.graphic[5].sort_priority + }, + { + "game.panel.graphic_7.x", + &game.panel.graphic[6].x + }, + { + "game.panel.graphic_7.y", + &game.panel.graphic[6].y + }, + { + "game.panel.graphic_7.draw_masked", + &game.panel.graphic[6].draw_masked + }, + { + "game.panel.graphic_7.draw_order", + &game.panel.graphic[6].sort_priority + }, + { + "game.panel.graphic_8.x", + &game.panel.graphic[7].x + }, + { + "game.panel.graphic_8.y", + &game.panel.graphic[7].y + }, + { + "game.panel.graphic_8.draw_masked", + &game.panel.graphic[7].draw_masked + }, + { + "game.panel.graphic_8.draw_order", + &game.panel.graphic[7].sort_priority + }, + { + "game.panel.element_1.x", + &game.panel.element[0].x + }, + { + "game.panel.element_1.y", + &game.panel.element[0].y + }, + { + "game.panel.element_1.tile_size", + &game.panel.element[0].size + }, + { + "game.panel.element_1.element", + &game.panel.element[0].id + }, + { + "game.panel.element_1.draw_masked", + &game.panel.element[0].draw_masked + }, + { + "game.panel.element_1.draw_order", + &game.panel.element[0].sort_priority + }, + { + "game.panel.element_1_count.x", + &game.panel.element_count[0].x + }, + { + "game.panel.element_1_count.y", + &game.panel.element_count[0].y + }, + { + "game.panel.element_1_count.align", + &game.panel.element_count[0].align + }, + { + "game.panel.element_1_count.valign", + &game.panel.element_count[0].valign + }, + { + "game.panel.element_1_count.digits", + &game.panel.element_count[0].size + }, + { + "game.panel.element_1_count.font", + &game.panel.element_count[0].font + }, + { + "game.panel.element_1_count.element", + &game.panel.element_count[0].id + }, + { + "game.panel.element_1_count.draw_masked", + &game.panel.element_count[0].draw_masked + }, + { + "game.panel.element_1_count.draw_order", + &game.panel.element_count[0].sort_priority + }, + { + "game.panel.element_2.x", + &game.panel.element[1].x + }, + { + "game.panel.element_2.y", + &game.panel.element[1].y + }, + { + "game.panel.element_2.tile_size", + &game.panel.element[1].size + }, + { + "game.panel.element_2.element", + &game.panel.element[1].id + }, + { + "game.panel.element_2.draw_masked", + &game.panel.element[1].draw_masked + }, + { + "game.panel.element_2.draw_order", + &game.panel.element[1].sort_priority + }, + { + "game.panel.element_2_count.x", + &game.panel.element_count[1].x + }, + { + "game.panel.element_2_count.y", + &game.panel.element_count[1].y + }, + { + "game.panel.element_2_count.align", + &game.panel.element_count[1].align + }, + { + "game.panel.element_2_count.valign", + &game.panel.element_count[1].valign + }, + { + "game.panel.element_2_count.digits", + &game.panel.element_count[1].size + }, + { + "game.panel.element_2_count.font", + &game.panel.element_count[1].font + }, + { + "game.panel.element_2_count.element", + &game.panel.element_count[1].id + }, + { + "game.panel.element_2_count.draw_masked", + &game.panel.element_count[1].draw_masked + }, + { + "game.panel.element_2_count.draw_order", + &game.panel.element_count[1].sort_priority + }, + { + "game.panel.element_3.x", + &game.panel.element[2].x + }, + { + "game.panel.element_3.y", + &game.panel.element[2].y + }, + { + "game.panel.element_3.tile_size", + &game.panel.element[2].size + }, + { + "game.panel.element_3.element", + &game.panel.element[2].id + }, + { + "game.panel.element_3.draw_masked", + &game.panel.element[2].draw_masked + }, + { + "game.panel.element_3.draw_order", + &game.panel.element[2].sort_priority + }, + { + "game.panel.element_3_count.x", + &game.panel.element_count[2].x + }, + { + "game.panel.element_3_count.y", + &game.panel.element_count[2].y + }, + { + "game.panel.element_3_count.align", + &game.panel.element_count[2].align + }, + { + "game.panel.element_3_count.valign", + &game.panel.element_count[2].valign + }, + { + "game.panel.element_3_count.digits", + &game.panel.element_count[2].size + }, + { + "game.panel.element_3_count.font", + &game.panel.element_count[2].font + }, + { + "game.panel.element_3_count.element", + &game.panel.element_count[2].id + }, + { + "game.panel.element_3_count.draw_masked", + &game.panel.element_count[2].draw_masked + }, + { + "game.panel.element_3_count.draw_order", + &game.panel.element_count[2].sort_priority + }, + { + "game.panel.element_4.x", + &game.panel.element[3].x + }, + { + "game.panel.element_4.y", + &game.panel.element[3].y + }, + { + "game.panel.element_4.tile_size", + &game.panel.element[3].size + }, + { + "game.panel.element_4.element", + &game.panel.element[3].id + }, + { + "game.panel.element_4.draw_masked", + &game.panel.element[3].draw_masked + }, + { + "game.panel.element_4.draw_order", + &game.panel.element[3].sort_priority + }, + { + "game.panel.element_4_count.x", + &game.panel.element_count[3].x + }, + { + "game.panel.element_4_count.y", + &game.panel.element_count[3].y + }, + { + "game.panel.element_4_count.align", + &game.panel.element_count[3].align + }, + { + "game.panel.element_4_count.valign", + &game.panel.element_count[3].valign + }, + { + "game.panel.element_4_count.digits", + &game.panel.element_count[3].size + }, + { + "game.panel.element_4_count.font", + &game.panel.element_count[3].font + }, + { + "game.panel.element_4_count.element", + &game.panel.element_count[3].id + }, + { + "game.panel.element_4_count.draw_masked", + &game.panel.element_count[3].draw_masked + }, + { + "game.panel.element_4_count.draw_order", + &game.panel.element_count[3].sort_priority + }, + { + "game.panel.element_5.x", + &game.panel.element[4].x + }, + { + "game.panel.element_5.y", + &game.panel.element[4].y + }, + { + "game.panel.element_5.tile_size", + &game.panel.element[4].size + }, + { + "game.panel.element_5.element", + &game.panel.element[4].id + }, + { + "game.panel.element_5.draw_masked", + &game.panel.element[4].draw_masked + }, + { + "game.panel.element_5.draw_order", + &game.panel.element[4].sort_priority + }, + { + "game.panel.element_5_count.x", + &game.panel.element_count[4].x + }, + { + "game.panel.element_5_count.y", + &game.panel.element_count[4].y + }, + { + "game.panel.element_5_count.align", + &game.panel.element_count[4].align + }, + { + "game.panel.element_5_count.valign", + &game.panel.element_count[4].valign + }, + { + "game.panel.element_5_count.digits", + &game.panel.element_count[4].size + }, + { + "game.panel.element_5_count.font", + &game.panel.element_count[4].font + }, + { + "game.panel.element_5_count.element", + &game.panel.element_count[4].id + }, + { + "game.panel.element_5_count.draw_masked", + &game.panel.element_count[4].draw_masked + }, + { + "game.panel.element_5_count.draw_order", + &game.panel.element_count[4].sort_priority + }, + { + "game.panel.element_6.x", + &game.panel.element[5].x + }, + { + "game.panel.element_6.y", + &game.panel.element[5].y + }, + { + "game.panel.element_6.tile_size", + &game.panel.element[5].size + }, + { + "game.panel.element_6.element", + &game.panel.element[5].id + }, + { + "game.panel.element_6.draw_masked", + &game.panel.element[5].draw_masked + }, + { + "game.panel.element_6.draw_order", + &game.panel.element[5].sort_priority + }, + { + "game.panel.element_6_count.x", + &game.panel.element_count[5].x + }, + { + "game.panel.element_6_count.y", + &game.panel.element_count[5].y + }, + { + "game.panel.element_6_count.align", + &game.panel.element_count[5].align + }, + { + "game.panel.element_6_count.valign", + &game.panel.element_count[5].valign + }, + { + "game.panel.element_6_count.digits", + &game.panel.element_count[5].size + }, + { + "game.panel.element_6_count.font", + &game.panel.element_count[5].font + }, + { + "game.panel.element_6_count.element", + &game.panel.element_count[5].id + }, + { + "game.panel.element_6_count.draw_masked", + &game.panel.element_count[5].draw_masked + }, + { + "game.panel.element_6_count.draw_order", + &game.panel.element_count[5].sort_priority + }, + { + "game.panel.element_7.x", + &game.panel.element[6].x + }, + { + "game.panel.element_7.y", + &game.panel.element[6].y + }, + { + "game.panel.element_7.tile_size", + &game.panel.element[6].size + }, + { + "game.panel.element_7.element", + &game.panel.element[6].id + }, + { + "game.panel.element_7.draw_masked", + &game.panel.element[6].draw_masked + }, + { + "game.panel.element_7.draw_order", + &game.panel.element[6].sort_priority + }, + { + "game.panel.element_7_count.x", + &game.panel.element_count[6].x + }, + { + "game.panel.element_7_count.y", + &game.panel.element_count[6].y + }, + { + "game.panel.element_7_count.align", + &game.panel.element_count[6].align + }, + { + "game.panel.element_7_count.valign", + &game.panel.element_count[6].valign + }, + { + "game.panel.element_7_count.digits", + &game.panel.element_count[6].size + }, + { + "game.panel.element_7_count.font", + &game.panel.element_count[6].font + }, + { + "game.panel.element_7_count.element", + &game.panel.element_count[6].id + }, + { + "game.panel.element_7_count.draw_masked", + &game.panel.element_count[6].draw_masked + }, + { + "game.panel.element_7_count.draw_order", + &game.panel.element_count[6].sort_priority + }, + { + "game.panel.element_8.x", + &game.panel.element[7].x + }, + { + "game.panel.element_8.y", + &game.panel.element[7].y + }, + { + "game.panel.element_8.tile_size", + &game.panel.element[7].size + }, + { + "game.panel.element_8.element", + &game.panel.element[7].id + }, + { + "game.panel.element_8.draw_masked", + &game.panel.element[7].draw_masked + }, + { + "game.panel.element_8.draw_order", + &game.panel.element[7].sort_priority + }, + { + "game.panel.element_8_count.x", + &game.panel.element_count[7].x + }, + { + "game.panel.element_8_count.y", + &game.panel.element_count[7].y + }, + { + "game.panel.element_8_count.align", + &game.panel.element_count[7].align + }, + { + "game.panel.element_8_count.valign", + &game.panel.element_count[7].valign + }, + { + "game.panel.element_8_count.digits", + &game.panel.element_count[7].size + }, + { + "game.panel.element_8_count.font", + &game.panel.element_count[7].font + }, + { + "game.panel.element_8_count.element", + &game.panel.element_count[7].id + }, + { + "game.panel.element_8_count.draw_masked", + &game.panel.element_count[7].draw_masked + }, + { + "game.panel.element_8_count.draw_order", + &game.panel.element_count[7].sort_priority + }, + { + "game.panel.ce_score_1.x", + &game.panel.ce_score[0].x + }, + { + "game.panel.ce_score_1.y", + &game.panel.ce_score[0].y + }, + { + "game.panel.ce_score_1.align", + &game.panel.ce_score[0].align + }, + { + "game.panel.ce_score_1.valign", + &game.panel.ce_score[0].valign + }, + { + "game.panel.ce_score_1.digits", + &game.panel.ce_score[0].size + }, + { + "game.panel.ce_score_1.font", + &game.panel.ce_score[0].font + }, + { + "game.panel.ce_score_1.element", + &game.panel.ce_score[0].id + }, + { + "game.panel.ce_score_1.draw_masked", + &game.panel.ce_score[0].draw_masked + }, + { + "game.panel.ce_score_1.draw_order", + &game.panel.ce_score[0].sort_priority + }, + { + "game.panel.ce_score_1_element.x", + &game.panel.ce_score_element[0].x + }, + { + "game.panel.ce_score_1_element.y", + &game.panel.ce_score_element[0].y + }, + { + "game.panel.ce_score_1_element.tile_size", + &game.panel.ce_score_element[0].size + }, + { + "game.panel.ce_score_1_element.element", + &game.panel.ce_score_element[0].id + }, + { + "game.panel.ce_score_1_element.draw_masked", + &game.panel.ce_score_element[0].draw_masked + }, + { + "game.panel.ce_score_1_element.draw_order", + &game.panel.ce_score_element[0].sort_priority + }, + { + "game.panel.ce_score_2.x", + &game.panel.ce_score[1].x + }, + { + "game.panel.ce_score_2.y", + &game.panel.ce_score[1].y + }, + { + "game.panel.ce_score_2.align", + &game.panel.ce_score[1].align + }, + { + "game.panel.ce_score_2.valign", + &game.panel.ce_score[1].valign + }, + { + "game.panel.ce_score_2.digits", + &game.panel.ce_score[1].size + }, + { + "game.panel.ce_score_2.font", + &game.panel.ce_score[1].font + }, + { + "game.panel.ce_score_2.element", + &game.panel.ce_score[1].id + }, + { + "game.panel.ce_score_2.draw_masked", + &game.panel.ce_score[1].draw_masked + }, + { + "game.panel.ce_score_2.draw_order", + &game.panel.ce_score[1].sort_priority + }, + { + "game.panel.ce_score_2_element.x", + &game.panel.ce_score_element[1].x + }, + { + "game.panel.ce_score_2_element.y", + &game.panel.ce_score_element[1].y + }, + { + "game.panel.ce_score_2_element.tile_size", + &game.panel.ce_score_element[1].size + }, + { + "game.panel.ce_score_2_element.element", + &game.panel.ce_score_element[1].id + }, + { + "game.panel.ce_score_2_element.draw_masked", + &game.panel.ce_score_element[1].draw_masked + }, + { + "game.panel.ce_score_2_element.draw_order", + &game.panel.ce_score_element[1].sort_priority + }, + { + "game.panel.ce_score_3.x", + &game.panel.ce_score[2].x + }, + { + "game.panel.ce_score_3.y", + &game.panel.ce_score[2].y + }, + { + "game.panel.ce_score_3.align", + &game.panel.ce_score[2].align + }, + { + "game.panel.ce_score_3.valign", + &game.panel.ce_score[2].valign + }, + { + "game.panel.ce_score_3.digits", + &game.panel.ce_score[2].size + }, + { + "game.panel.ce_score_3.font", + &game.panel.ce_score[2].font + }, + { + "game.panel.ce_score_3.element", + &game.panel.ce_score[2].id + }, + { + "game.panel.ce_score_3.draw_masked", + &game.panel.ce_score[2].draw_masked + }, + { + "game.panel.ce_score_3.draw_order", + &game.panel.ce_score[2].sort_priority + }, + { + "game.panel.ce_score_3_element.x", + &game.panel.ce_score_element[2].x + }, + { + "game.panel.ce_score_3_element.y", + &game.panel.ce_score_element[2].y + }, + { + "game.panel.ce_score_3_element.tile_size", + &game.panel.ce_score_element[2].size + }, + { + "game.panel.ce_score_3_element.element", + &game.panel.ce_score_element[2].id + }, + { + "game.panel.ce_score_3_element.draw_masked", + &game.panel.ce_score_element[2].draw_masked + }, + { + "game.panel.ce_score_3_element.draw_order", + &game.panel.ce_score_element[2].sort_priority + }, + { + "game.panel.ce_score_4.x", + &game.panel.ce_score[3].x + }, + { + "game.panel.ce_score_4.y", + &game.panel.ce_score[3].y + }, + { + "game.panel.ce_score_4.align", + &game.panel.ce_score[3].align + }, + { + "game.panel.ce_score_4.valign", + &game.panel.ce_score[3].valign + }, + { + "game.panel.ce_score_4.digits", + &game.panel.ce_score[3].size + }, + { + "game.panel.ce_score_4.font", + &game.panel.ce_score[3].font + }, + { + "game.panel.ce_score_4.element", + &game.panel.ce_score[3].id + }, + { + "game.panel.ce_score_4.draw_masked", + &game.panel.ce_score[3].draw_masked + }, + { + "game.panel.ce_score_4.draw_order", + &game.panel.ce_score[3].sort_priority + }, + { + "game.panel.ce_score_4_element.x", + &game.panel.ce_score_element[3].x + }, + { + "game.panel.ce_score_4_element.y", + &game.panel.ce_score_element[3].y + }, + { + "game.panel.ce_score_4_element.tile_size", + &game.panel.ce_score_element[3].size + }, + { + "game.panel.ce_score_4_element.element", + &game.panel.ce_score_element[3].id + }, + { + "game.panel.ce_score_4_element.draw_masked", + &game.panel.ce_score_element[3].draw_masked + }, + { + "game.panel.ce_score_4_element.draw_order", + &game.panel.ce_score_element[3].sort_priority + }, + { + "game.panel.ce_score_5.x", + &game.panel.ce_score[4].x + }, + { + "game.panel.ce_score_5.y", + &game.panel.ce_score[4].y + }, + { + "game.panel.ce_score_5.align", + &game.panel.ce_score[4].align + }, + { + "game.panel.ce_score_5.valign", + &game.panel.ce_score[4].valign + }, + { + "game.panel.ce_score_5.digits", + &game.panel.ce_score[4].size + }, + { + "game.panel.ce_score_5.font", + &game.panel.ce_score[4].font + }, + { + "game.panel.ce_score_5.element", + &game.panel.ce_score[4].id + }, + { + "game.panel.ce_score_5.draw_masked", + &game.panel.ce_score[4].draw_masked + }, + { + "game.panel.ce_score_5.draw_order", + &game.panel.ce_score[4].sort_priority + }, + { + "game.panel.ce_score_5_element.x", + &game.panel.ce_score_element[4].x + }, + { + "game.panel.ce_score_5_element.y", + &game.panel.ce_score_element[4].y + }, + { + "game.panel.ce_score_5_element.tile_size", + &game.panel.ce_score_element[4].size + }, + { + "game.panel.ce_score_5_element.element", + &game.panel.ce_score_element[4].id + }, + { + "game.panel.ce_score_5_element.draw_masked", + &game.panel.ce_score_element[4].draw_masked + }, + { + "game.panel.ce_score_5_element.draw_order", + &game.panel.ce_score_element[4].sort_priority + }, + { + "game.panel.ce_score_6.x", + &game.panel.ce_score[5].x + }, + { + "game.panel.ce_score_6.y", + &game.panel.ce_score[5].y + }, + { + "game.panel.ce_score_6.align", + &game.panel.ce_score[5].align + }, + { + "game.panel.ce_score_6.valign", + &game.panel.ce_score[5].valign + }, + { + "game.panel.ce_score_6.digits", + &game.panel.ce_score[5].size + }, + { + "game.panel.ce_score_6.font", + &game.panel.ce_score[5].font + }, + { + "game.panel.ce_score_6.element", + &game.panel.ce_score[5].id + }, + { + "game.panel.ce_score_6.draw_masked", + &game.panel.ce_score[5].draw_masked + }, + { + "game.panel.ce_score_6.draw_order", + &game.panel.ce_score[5].sort_priority + }, + { + "game.panel.ce_score_6_element.x", + &game.panel.ce_score_element[5].x + }, + { + "game.panel.ce_score_6_element.y", + &game.panel.ce_score_element[5].y + }, + { + "game.panel.ce_score_6_element.tile_size", + &game.panel.ce_score_element[5].size + }, + { + "game.panel.ce_score_6_element.element", + &game.panel.ce_score_element[5].id + }, + { + "game.panel.ce_score_6_element.draw_masked", + &game.panel.ce_score_element[5].draw_masked + }, + { + "game.panel.ce_score_6_element.draw_order", + &game.panel.ce_score_element[5].sort_priority + }, + { + "game.panel.ce_score_7.x", + &game.panel.ce_score[6].x + }, + { + "game.panel.ce_score_7.y", + &game.panel.ce_score[6].y + }, + { + "game.panel.ce_score_7.align", + &game.panel.ce_score[6].align + }, + { + "game.panel.ce_score_7.valign", + &game.panel.ce_score[6].valign + }, + { + "game.panel.ce_score_7.digits", + &game.panel.ce_score[6].size + }, + { + "game.panel.ce_score_7.font", + &game.panel.ce_score[6].font + }, + { + "game.panel.ce_score_7.element", + &game.panel.ce_score[6].id + }, + { + "game.panel.ce_score_7.draw_masked", + &game.panel.ce_score[6].draw_masked + }, + { + "game.panel.ce_score_7.draw_order", + &game.panel.ce_score[6].sort_priority + }, + { + "game.panel.ce_score_7_element.x", + &game.panel.ce_score_element[6].x + }, + { + "game.panel.ce_score_7_element.y", + &game.panel.ce_score_element[6].y + }, + { + "game.panel.ce_score_7_element.tile_size", + &game.panel.ce_score_element[6].size + }, + { + "game.panel.ce_score_7_element.element", + &game.panel.ce_score_element[6].id + }, + { + "game.panel.ce_score_7_element.draw_masked", + &game.panel.ce_score_element[6].draw_masked + }, + { + "game.panel.ce_score_7_element.draw_order", + &game.panel.ce_score_element[6].sort_priority + }, + { + "game.panel.ce_score_8.x", + &game.panel.ce_score[7].x + }, + { + "game.panel.ce_score_8.y", + &game.panel.ce_score[7].y + }, + { + "game.panel.ce_score_8.align", + &game.panel.ce_score[7].align + }, + { + "game.panel.ce_score_8.valign", + &game.panel.ce_score[7].valign + }, + { + "game.panel.ce_score_8.digits", + &game.panel.ce_score[7].size + }, + { + "game.panel.ce_score_8.font", + &game.panel.ce_score[7].font + }, + { + "game.panel.ce_score_8.element", + &game.panel.ce_score[7].id + }, + { + "game.panel.ce_score_8.draw_masked", + &game.panel.ce_score[7].draw_masked + }, + { + "game.panel.ce_score_8.draw_order", + &game.panel.ce_score[7].sort_priority + }, + { + "game.panel.ce_score_8_element.x", + &game.panel.ce_score_element[7].x + }, + { + "game.panel.ce_score_8_element.y", + &game.panel.ce_score_element[7].y + }, + { + "game.panel.ce_score_8_element.tile_size", + &game.panel.ce_score_element[7].size + }, + { + "game.panel.ce_score_8_element.element", + &game.panel.ce_score_element[7].id + }, + { + "game.panel.ce_score_8_element.draw_masked", + &game.panel.ce_score_element[7].draw_masked + }, + { + "game.panel.ce_score_8_element.draw_order", + &game.panel.ce_score_element[7].sort_priority + }, + { + "game.panel.player_name.x", + &game.panel.player_name.x + }, + { + "game.panel.player_name.y", + &game.panel.player_name.y + }, + { + "game.panel.player_name.align", + &game.panel.player_name.align + }, + { + "game.panel.player_name.valign", + &game.panel.player_name.valign + }, + { + "game.panel.player_name.chars", + &game.panel.player_name.size + }, + { + "game.panel.player_name.font", + &game.panel.player_name.font + }, + { + "game.panel.player_name.draw_masked", + &game.panel.player_name.draw_masked + }, + { + "game.panel.player_name.draw_order", + &game.panel.player_name.sort_priority + }, + { + "game.panel.level_name.x", + &game.panel.level_name.x + }, + { + "game.panel.level_name.y", + &game.panel.level_name.y + }, + { + "game.panel.level_name.align", + &game.panel.level_name.align + }, + { + "game.panel.level_name.valign", + &game.panel.level_name.valign + }, + { + "game.panel.level_name.chars", + &game.panel.level_name.size + }, + { + "game.panel.level_name.font", + &game.panel.level_name.font + }, + { + "game.panel.level_name.draw_masked", + &game.panel.level_name.draw_masked + }, + { + "game.panel.level_name.draw_order", + &game.panel.level_name.sort_priority + }, + { + "game.panel.level_author.x", + &game.panel.level_author.x + }, + { + "game.panel.level_author.y", + &game.panel.level_author.y + }, + { + "game.panel.level_author.align", + &game.panel.level_author.align + }, + { + "game.panel.level_author.valign", + &game.panel.level_author.valign + }, + { + "game.panel.level_author.chars", + &game.panel.level_author.size + }, + { + "game.panel.level_author.font", + &game.panel.level_author.font + }, + { + "game.panel.level_author.draw_masked", + &game.panel.level_author.draw_masked + }, + { + "game.panel.level_author.draw_order", + &game.panel.level_author.sort_priority + }, + { + "game.button.stop.x", + &game.button.stop.x + }, + { + "game.button.stop.y", + &game.button.stop.y + }, + { + "game.button.pause.x", + &game.button.pause.x + }, + { + "game.button.pause.y", + &game.button.pause.y + }, + { + "game.button.play.x", + &game.button.play.x + }, + { + "game.button.play.y", + &game.button.play.y + }, + { + "game.button.sound_music.x", + &game.button.sound_music.x + }, + { + "game.button.sound_music.y", + &game.button.sound_music.y + }, + { + "game.button.sound_loops.x", + &game.button.sound_loops.x + }, + { + "game.button.sound_loops.y", + &game.button.sound_loops.y + }, + { + "game.button.sound_simple.x", + &game.button.sound_simple.x + }, + { + "game.button.sound_simple.y", + &game.button.sound_simple.y + }, + { + "game.forced_scroll_delay_value", + &game.forced_scroll_delay_value + }, + { + "game.use_native_emc_graphics_engine", + &game.use_native_emc_graphics_engine + }, + { + "[player].boring_delay_fixed", + &game.player_boring_delay_fixed + }, + { + "[player].boring_delay_random", + &game.player_boring_delay_random + }, + { + "[player].sleeping_delay_fixed", + &game.player_sleeping_delay_fixed + }, + { + "[player].sleeping_delay_random", + &game.player_sleeping_delay_random + }, + { + NULL, + NULL + }, +}; + +#endif /* CONF_VAR_C */ diff --git a/src/config.c b/src/config.c index deea1f84..5e8add2a 100644 --- a/src/config.c +++ b/src/config.c @@ -17,22 +17,41 @@ #include "conftime.h" -char *getProgramVersionString() +char *getCompileDateString() +{ + return COMPILE_DATE_STRING; +} + +char *getProgramReleaseVersionString() +{ + static char program_version_string[32]; + + sprintf(program_version_string, "%d.%d.%d", + PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, PROGRAM_VERSION_PATCH); + + return program_version_string; +} + +char *getProgramFullVersionString() { static char program_version_string[32]; -#ifdef DEBUG sprintf(program_version_string, "%d.%d.%d-%d", PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, PROGRAM_VERSION_PATCH, PROGRAM_VERSION_BUILD); -#else - sprintf(program_version_string, "%d.%d.%d", - PROGRAM_VERSION_MAJOR, PROGRAM_VERSION_MINOR, PROGRAM_VERSION_PATCH); -#endif return program_version_string; } +char *getProgramVersionString() +{ +#ifdef DEBUG + return getProgramFullVersionString(); +#else + return getProgramReleaseVersionString(); +#endif +} + char *getProgramInitString() { static char *program_init_string = NULL; @@ -58,10 +77,10 @@ char *getWindowTitleString() if (window_title_string == NULL) { window_title_string = checked_malloc(strlen(getProgramInitString()) + 1 + - strlen(COMPILE_DATE_STRING) + 1); + strlen(getCompileDateString()) + 2 +1); - sprintf(window_title_string, "%s %s", - getProgramInitString(), COMPILE_DATE_STRING); + sprintf(window_title_string, "%s [%s]", + getProgramInitString(), getCompileDateString()); } return window_title_string; diff --git a/src/config.h b/src/config.h index 326ca276..ac24bb1f 100644 --- a/src/config.h +++ b/src/config.h @@ -16,6 +16,9 @@ #include "main.h" +char *getCompileDateString(void); +char *getProgramReleaseVersionString(void); +char *getProgramFullVersionString(void); char *getProgramVersionString(void); char *getProgramInitString(void); char *getWindowTitleString(void); diff --git a/src/conftime.h b/src/conftime.h index a0dcbff6..5926ae2c 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2007-01-05 13:11]" +#define COMPILE_DATE_STRING "2007-09-13 23:31" diff --git a/src/editor.c b/src/editor.c index 7ace5ece..fe8976f2 100644 --- a/src/editor.c +++ b/src/editor.c @@ -324,7 +324,7 @@ #define GADGET_ID_CUSTOM_COPY (GADGET_ID_TOOLBOX_FIRST + 25) #define GADGET_ID_CUSTOM_PASTE (GADGET_ID_TOOLBOX_FIRST + 26) -/* counter button identifiers */ +/* counter gadget identifiers */ #define GADGET_ID_COUNTER_FIRST (GADGET_ID_TOOLBOX_FIRST + 27) #define GADGET_ID_SELECT_LEVEL_DOWN (GADGET_ID_COUNTER_FIRST + 0) @@ -559,42 +559,45 @@ #define GADGET_ID_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 12) #define GADGET_ID_SP_BLOCK_LAST_FIELD (GADGET_ID_CHECKBUTTON_FIRST + 13) #define GADGET_ID_INSTANT_RELOCATION (GADGET_ID_CHECKBUTTON_FIRST + 14) -#define GADGET_ID_USE_START_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 15) -#define GADGET_ID_USE_ARTWORK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 16) -#define GADGET_ID_USE_EXPLOSION_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 17) -#define GADGET_ID_INITIAL_GRAVITY (GADGET_ID_CHECKBUTTON_FIRST + 18) -#define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 19) -#define GADGET_ID_CAN_FALL_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 20) -#define GADGET_ID_CAN_MOVE_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 21) -#define GADGET_ID_DONT_COLLIDE_WITH (GADGET_ID_CHECKBUTTON_FIRST + 22) -#define GADGET_ID_CUSTOM_INDESTRUCTIBLE (GADGET_ID_CHECKBUTTON_FIRST + 23) -#define GADGET_ID_CUSTOM_CAN_EXPLODE (GADGET_ID_CHECKBUTTON_FIRST + 24) -#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 25) -#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 26) -#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 27) -#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 28) -#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 29) -#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 30) -#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 31) -#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 32) -#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 33) -#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 34) -#define GADGET_ID_CUSTOM_GRAV_REACHABLE (GADGET_ID_CHECKBUTTON_FIRST + 35) -#define GADGET_ID_CUSTOM_USE_LAST_VALUE (GADGET_ID_CHECKBUTTON_FIRST + 36) -#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 37) -#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 38) -#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 39) -#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 40) -#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 41) -#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 42) -#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 43) -#define GADGET_ID_CHANGE_HAS_ACTION (GADGET_ID_CHECKBUTTON_FIRST + 44) -#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 45) -#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 46) -#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 47) +#define GADGET_ID_SHIFTED_RELOCATION (GADGET_ID_CHECKBUTTON_FIRST + 15) +#define GADGET_ID_USE_START_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 16) +#define GADGET_ID_USE_ARTWORK_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 17) +#define GADGET_ID_USE_EXPLOSION_ELEMENT (GADGET_ID_CHECKBUTTON_FIRST + 18) +#define GADGET_ID_INITIAL_GRAVITY (GADGET_ID_CHECKBUTTON_FIRST + 19) +#define GADGET_ID_CAN_PASS_TO_WALKABLE (GADGET_ID_CHECKBUTTON_FIRST + 20) +#define GADGET_ID_CAN_FALL_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 21) +#define GADGET_ID_CAN_MOVE_INTO_ACID (GADGET_ID_CHECKBUTTON_FIRST + 22) +#define GADGET_ID_DONT_COLLIDE_WITH (GADGET_ID_CHECKBUTTON_FIRST + 23) +#define GADGET_ID_ENVELOPE_AUTOWRAP (GADGET_ID_CHECKBUTTON_FIRST + 24) +#define GADGET_ID_ENVELOPE_CENTERED (GADGET_ID_CHECKBUTTON_FIRST + 25) +#define GADGET_ID_CUSTOM_INDESTRUCTIBLE (GADGET_ID_CHECKBUTTON_FIRST + 26) +#define GADGET_ID_CUSTOM_CAN_EXPLODE (GADGET_ID_CHECKBUTTON_FIRST + 27) +#define GADGET_ID_CUSTOM_EXPLODE_FIRE (GADGET_ID_CHECKBUTTON_FIRST + 28) +#define GADGET_ID_CUSTOM_EXPLODE_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 29) +#define GADGET_ID_CUSTOM_EXPLODE_IMPACT (GADGET_ID_CHECKBUTTON_FIRST + 30) +#define GADGET_ID_CUSTOM_WALK_TO_OBJECT (GADGET_ID_CHECKBUTTON_FIRST + 31) +#define GADGET_ID_CUSTOM_DEADLY (GADGET_ID_CHECKBUTTON_FIRST + 32) +#define GADGET_ID_CUSTOM_CAN_MOVE (GADGET_ID_CHECKBUTTON_FIRST + 33) +#define GADGET_ID_CUSTOM_CAN_FALL (GADGET_ID_CHECKBUTTON_FIRST + 34) +#define GADGET_ID_CUSTOM_CAN_SMASH (GADGET_ID_CHECKBUTTON_FIRST + 35) +#define GADGET_ID_CUSTOM_SLIPPERY (GADGET_ID_CHECKBUTTON_FIRST + 36) +#define GADGET_ID_CUSTOM_ACCESSIBLE (GADGET_ID_CHECKBUTTON_FIRST + 37) +#define GADGET_ID_CUSTOM_GRAV_REACHABLE (GADGET_ID_CHECKBUTTON_FIRST + 38) +#define GADGET_ID_CUSTOM_USE_LAST_VALUE (GADGET_ID_CHECKBUTTON_FIRST + 39) +#define GADGET_ID_CUSTOM_USE_GRAPHIC (GADGET_ID_CHECKBUTTON_FIRST + 40) +#define GADGET_ID_CUSTOM_USE_TEMPLATE (GADGET_ID_CHECKBUTTON_FIRST + 41) +#define GADGET_ID_CUSTOM_CAN_CHANGE (GADGET_ID_CHECKBUTTON_FIRST + 42) +#define GADGET_ID_CHANGE_USE_CONTENT (GADGET_ID_CHECKBUTTON_FIRST + 43) +#define GADGET_ID_CHANGE_USE_EXPLOSION (GADGET_ID_CHECKBUTTON_FIRST + 44) +#define GADGET_ID_CHANGE_ONLY_COMPLETE (GADGET_ID_CHECKBUTTON_FIRST + 45) +#define GADGET_ID_CHANGE_USE_RANDOM (GADGET_ID_CHECKBUTTON_FIRST + 46) +#define GADGET_ID_CHANGE_HAS_ACTION (GADGET_ID_CHECKBUTTON_FIRST + 47) +#define GADGET_ID_CHANGE_DELAY (GADGET_ID_CHECKBUTTON_FIRST + 48) +#define GADGET_ID_CHANGE_BY_DIRECT_ACT (GADGET_ID_CHECKBUTTON_FIRST + 49) +#define GADGET_ID_CHANGE_BY_OTHER_ACT (GADGET_ID_CHECKBUTTON_FIRST + 50) /* gadgets for buttons in element list */ -#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 48) +#define GADGET_ID_ELEMENTLIST_FIRST (GADGET_ID_CHECKBUTTON_FIRST + 51) #define GADGET_ID_ELEMENTLIST_LAST (GADGET_ID_ELEMENTLIST_FIRST + \ ED_NUM_ELEMENTLIST_BUTTONS - 1) @@ -784,41 +787,44 @@ #define ED_CHECKBUTTON_ID_BLOCK_LAST_FIELD 10 #define ED_CHECKBUTTON_ID_SP_BLOCK_LAST_FIELD 11 #define ED_CHECKBUTTON_ID_INSTANT_RELOCATION 12 -#define ED_CHECKBUTTON_ID_USE_START_ELEMENT 13 -#define ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT 14 -#define ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT 15 -#define ED_CHECKBUTTON_ID_INITIAL_GRAVITY 16 -#define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 17 -#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID 18 -#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID 19 -#define ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH 20 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 21 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 22 -#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 23 -#define ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE 24 -#define ED_CHECKBUTTON_ID_CUSTOM_USE_LAST_VALUE 25 -#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 26 -#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 27 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 28 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 29 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 30 -#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 31 -#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 32 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE 33 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 34 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 35 -#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 36 -#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 37 -#define ED_CHECKBUTTON_ID_CHANGE_DELAY 38 -#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 39 -#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 40 -#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 41 -#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 42 -#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 43 -#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 44 -#define ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION 45 - -#define ED_NUM_CHECKBUTTONS 46 +#define ED_CHECKBUTTON_ID_SHIFTED_RELOCATION 13 +#define ED_CHECKBUTTON_ID_USE_START_ELEMENT 14 +#define ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT 15 +#define ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT 16 +#define ED_CHECKBUTTON_ID_INITIAL_GRAVITY 17 +#define ED_CHECKBUTTON_ID_CAN_PASS_TO_WALKABLE 18 +#define ED_CHECKBUTTON_ID_CAN_FALL_INTO_ACID 19 +#define ED_CHECKBUTTON_ID_CAN_MOVE_INTO_ACID 20 +#define ED_CHECKBUTTON_ID_DONT_COLLIDE_WITH 21 +#define ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP 22 +#define ED_CHECKBUTTON_ID_ENVELOPE_CENTERED 23 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_GRAPHIC 24 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_TEMPLATE 25 +#define ED_CHECKBUTTON_ID_CUSTOM_ACCESSIBLE 26 +#define ED_CHECKBUTTON_ID_CUSTOM_GRAV_REACHABLE 27 +#define ED_CHECKBUTTON_ID_CUSTOM_USE_LAST_VALUE 28 +#define ED_CHECKBUTTON_ID_CUSTOM_WALK_TO_OBJECT 29 +#define ED_CHECKBUTTON_ID_CUSTOM_INDESTRUCTIBLE 30 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_MOVE 31 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_FALL 32 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_SMASH 33 +#define ED_CHECKBUTTON_ID_CUSTOM_SLIPPERY 34 +#define ED_CHECKBUTTON_ID_CUSTOM_DEADLY 35 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_EXPLODE 36 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_FIRE 37 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_SMASH 38 +#define ED_CHECKBUTTON_ID_CUSTOM_EXPLODE_IMPACT 39 +#define ED_CHECKBUTTON_ID_CUSTOM_CAN_CHANGE 40 +#define ED_CHECKBUTTON_ID_CHANGE_DELAY 41 +#define ED_CHECKBUTTON_ID_CHANGE_BY_DIRECT_ACT 42 +#define ED_CHECKBUTTON_ID_CHANGE_BY_OTHER_ACT 43 +#define ED_CHECKBUTTON_ID_CHANGE_USE_EXPLOSION 44 +#define ED_CHECKBUTTON_ID_CHANGE_USE_CONTENT 45 +#define ED_CHECKBUTTON_ID_CHANGE_ONLY_COMPLETE 46 +#define ED_CHECKBUTTON_ID_CHANGE_USE_RANDOM 47 +#define ED_CHECKBUTTON_ID_CHANGE_HAS_ACTION 48 + +#define ED_NUM_CHECKBUTTONS 49 #define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED #define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED @@ -912,11 +918,11 @@ /* values for elements with score for certain actions */ #define MIN_SCORE 0 -#define MAX_SCORE 255 +#define MAX_SCORE 999 /* values for elements with count for collecting */ #define MIN_COLLECT_COUNT 0 -#define MAX_COLLECT_COUNT 255 +#define MAX_COLLECT_COUNT 999 /* values for random placement */ #define RANDOM_USE_PERCENTAGE 0 @@ -1043,7 +1049,7 @@ static struct }, { ED_LEVEL_SETTINGS_XPOS(0), ED_LEVEL_SETTINGS_YPOS(9), - 0, 255, + 0, 999, GADGET_ID_LEVEL_TIMESCORE_DOWN, GADGET_ID_LEVEL_TIMESCORE_UP, GADGET_ID_LEVEL_TIMESCORE_TEXT, GADGET_ID_NONE, &level.score[SC_TIME_BONUS], @@ -1121,7 +1127,7 @@ static struct MIN_ENVELOPE_XSIZE, MAX_ENVELOPE_XSIZE, GADGET_ID_ENVELOPE_XSIZE_DOWN, GADGET_ID_ENVELOPE_XSIZE_UP, GADGET_ID_ENVELOPE_XSIZE_TEXT, GADGET_ID_NONE, - NULL, + NULL, /* will be set when used */ NULL, NULL, "width", }, { @@ -1129,7 +1135,7 @@ static struct MIN_ENVELOPE_YSIZE, MAX_ENVELOPE_YSIZE, GADGET_ID_ENVELOPE_YSIZE_DOWN, GADGET_ID_ENVELOPE_YSIZE_UP, GADGET_ID_ENVELOPE_YSIZE_TEXT, GADGET_ID_ENVELOPE_XSIZE_UP, - NULL, + NULL, /* will be set when used */ NULL, " ", "height", }, @@ -1169,7 +1175,7 @@ static struct }, { ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(7), - 0, 255, + 0, 999, GADGET_ID_PUSH_DELAY_FIX_DOWN, GADGET_ID_PUSH_DELAY_FIX_UP, GADGET_ID_PUSH_DELAY_FIX_TEXT, GADGET_ID_NONE, &custom_element.push_delay_fixed, @@ -1177,7 +1183,7 @@ static struct }, { -1, ED_ELEMENT_SETTINGS_YPOS(7), - 0, 255, + 0, 999, GADGET_ID_PUSH_DELAY_RND_DOWN, GADGET_ID_PUSH_DELAY_RND_UP, GADGET_ID_PUSH_DELAY_RND_TEXT, GADGET_ID_PUSH_DELAY_FIX_UP, &custom_element.push_delay_random, @@ -1185,7 +1191,7 @@ static struct }, { ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(8), - 0, 255, + 0, 999, GADGET_ID_DROP_DELAY_FIX_DOWN, GADGET_ID_DROP_DELAY_FIX_UP, GADGET_ID_DROP_DELAY_FIX_TEXT, GADGET_ID_NONE, &custom_element.drop_delay_fixed, @@ -1193,7 +1199,7 @@ static struct }, { -1, ED_ELEMENT_SETTINGS_YPOS(8), - 0, 255, + 0, 999, GADGET_ID_DROP_DELAY_RND_DOWN, GADGET_ID_DROP_DELAY_RND_UP, GADGET_ID_DROP_DELAY_RND_TEXT, GADGET_ID_DROP_DELAY_FIX_UP, &custom_element.drop_delay_random, @@ -1220,7 +1226,7 @@ static struct }, { ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(12), - 0, 255, + 0, 999, GADGET_ID_EXPLOSION_DELAY_DOWN, GADGET_ID_EXPLOSION_DELAY_UP, GADGET_ID_EXPLOSION_DELAY_TEXT, GADGET_ID_NONE, &custom_element.explosion_delay, @@ -1228,7 +1234,7 @@ static struct }, { ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(13), - 0, 255, + 0, 999, GADGET_ID_IGNITION_DELAY_DOWN, GADGET_ID_IGNITION_DELAY_UP, GADGET_ID_IGNITION_DELAY_TEXT, GADGET_ID_NONE, &custom_element.ignition_delay, @@ -1316,11 +1322,11 @@ static struct } textarea_info[ED_NUM_TEXTAREAS] = { { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(3), GADGET_ID_ENVELOPE_INFO, MAX_ENVELOPE_XSIZE, MAX_ENVELOPE_YSIZE, NULL, - "Envelope Info:", "Envelope Info" + "Envelope Content:", "Envelope Content" } }; @@ -2030,7 +2036,7 @@ static struct /* ---------- element settings: configure (several elements) ------------- */ { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(5), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(6), GADGET_ID_PLAYER_SPEED, GADGET_ID_NONE, -1, options_player_speed, @@ -2516,7 +2522,7 @@ static struct GADGET_ID_EM_SLIPPERY_GEMS, GADGET_ID_NONE, &level.em_slippery_gems, NULL, - "slip down from certain flat walls","use EM style slipping behaviour" + "slip down from certain flat walls","use EM/DC style slipping behaviour" }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2), @@ -2554,14 +2560,14 @@ static struct "can grow into anything diggable", "grow into more than just sand" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(7), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(8), GADGET_ID_CONTINUOUS_SNAPPING, GADGET_ID_NONE, &level.continuous_snapping, NULL, "continuos snapping", "use snapping without releasing key" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(6), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(7), GADGET_ID_BLOCK_SNAP_FIELD, GADGET_ID_NONE, &level.block_snap_field, NULL, @@ -2589,35 +2595,42 @@ static struct "no scrolling when relocating", "player gets relocated without delay" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(8), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(4), + GADGET_ID_SHIFTED_RELOCATION, GADGET_ID_NONE, + &level.shifted_relocation, + NULL, + "no centering when relocating", "level not centered after relocation" + }, + { + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(9), GADGET_ID_USE_START_ELEMENT, GADGET_ID_NONE, &level.use_start_element[0], NULL, "use level start element:", "start level at this element's position" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(9), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(10), GADGET_ID_USE_ARTWORK_ELEMENT, GADGET_ID_NONE, &level.use_artwork_element[0], NULL, "use artwork from element:", "use player artwork from other element" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(10), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(11), GADGET_ID_USE_EXPLOSION_ELEMENT, GADGET_ID_NONE, &level.use_explosion_element[0], NULL, "use explosion from element:", "use explosion properties from element" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(11), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(12), GADGET_ID_INITIAL_GRAVITY, GADGET_ID_NONE, &level.initial_player_gravity[0], NULL, "use initial gravity", "set initial player gravity" }, { - ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(4), + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(5), GADGET_ID_CAN_PASS_TO_WALKABLE, GADGET_ID_NONE, &level.can_pass_to_walkable, NULL, @@ -2644,6 +2657,20 @@ static struct NULL, "deadly when colliding with", "element is deadly when hitting player" }, + { + ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), + GADGET_ID_ENVELOPE_AUTOWRAP, GADGET_ID_NONE, + &level.envelope[0].autowrap, + NULL, + "auto-wrap", "automatically wrap envelope text" + }, + { + -1, ED_ELEMENT_SETTINGS_YPOS(1), + GADGET_ID_ENVELOPE_CENTERED, GADGET_ID_ENVELOPE_AUTOWRAP, + &level.envelope[0].centered, + " ", + "centered", "automatically center envelope text" + }, /* ---------- element settings: configure 1 (custom elements) ----------- */ @@ -2654,46 +2681,54 @@ static struct /* !!! add separate "use existing element sound" !!! */ #if 0 - NULL, "use graphic/sound of element:", "use existing graphic and sound" + NULL, + "use graphic/sound of element:", "use existing graphic and sound" #else - NULL, "use graphic of element:", "use existing element graphic" + NULL, + "use graphic of element:", "use existing element graphic" #endif }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(2), GADGET_ID_CUSTOM_USE_TEMPLATE, GADGET_ID_NONE, &level.use_custom_template, - NULL, "use template", "use template for custom properties" + NULL, + "use template", "use template for custom properties" }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(3), GADGET_ID_CUSTOM_ACCESSIBLE, GADGET_ID_NONE, &custom_element_properties[EP_ACCESSIBLE], - NULL, NULL, "player can walk to or pass this field" + NULL, + NULL, "player can walk to or pass this field" }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(10), GADGET_ID_CUSTOM_GRAV_REACHABLE, GADGET_ID_NONE, &custom_element_properties[EP_GRAVITY_REACHABLE], - NULL, "reachable despite gravity", "player can walk/dig despite gravity" + NULL, + "reachable despite gravity", "player can walk/dig despite gravity" }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(13), GADGET_ID_CUSTOM_USE_LAST_VALUE, GADGET_ID_NONE, &custom_element.use_last_ce_value, - NULL, "use last CE value after change", "use last CE value after change" + NULL, + "use last CE value after change", "use last CE value after change" }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(5), GADGET_ID_CUSTOM_WALK_TO_OBJECT, GADGET_ID_NONE, &custom_element_properties[EP_WALK_TO_OBJECT], - NULL, NULL, "player can dig/collect/push element" + NULL, + NULL, "player can dig/collect/push element" }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(9), GADGET_ID_CUSTOM_INDESTRUCTIBLE, GADGET_ID_NONE, &custom_element_properties[EP_INDESTRUCTIBLE], - NULL, "indestructible", "element is indestructible" + NULL, + "indestructible", "element is indestructible" }, /* ---------- element settings: configure 2 (custom elements) ----------- */ @@ -2702,55 +2737,64 @@ static struct ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), GADGET_ID_CUSTOM_CAN_MOVE, GADGET_ID_NONE, &custom_element_properties[EP_CAN_MOVE], - NULL, NULL, "element can move with some pattern" + NULL, + NULL, "element can move with some pattern" }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(7), GADGET_ID_CUSTOM_CAN_FALL, GADGET_ID_NONE, &custom_element_properties[EP_CAN_FALL], - NULL, "can fall", "element can fall down" + NULL, + "can fall", "element can fall down" }, { -1, ED_ELEMENT_SETTINGS_YPOS(7), GADGET_ID_CUSTOM_CAN_SMASH, GADGET_ID_CUSTOM_CAN_FALL, &custom_element_properties[EP_CAN_SMASH], - " ", NULL, "element can smash other elements" + " ", + NULL, "element can smash other elements" }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(8), GADGET_ID_CUSTOM_SLIPPERY, GADGET_ID_NONE, &custom_element_properties[EP_SLIPPERY], - NULL, NULL, "other elements can fall down from it" + NULL, + NULL, "other elements can fall down from it" }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(9), GADGET_ID_CUSTOM_DEADLY, GADGET_ID_NONE, &custom_element_properties[EP_DEADLY], - NULL, NULL, "element can kill the player" + NULL, + NULL, "element can kill the player" }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(10), GADGET_ID_CUSTOM_CAN_EXPLODE, GADGET_ID_NONE, &custom_element_properties[EP_CAN_EXPLODE], - NULL, NULL, "element can explode" + NULL, + NULL, "element can explode" }, { ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(11), GADGET_ID_CUSTOM_EXPLODE_FIRE, GADGET_ID_NONE, &custom_element_properties[EP_EXPLODES_BY_FIRE], - NULL, "by fire", "element can explode by fire/explosion" + NULL, + "by fire", "element can explode by fire/explosion" }, { -1, ED_ELEMENT_SETTINGS_YPOS(11), GADGET_ID_CUSTOM_EXPLODE_SMASH, GADGET_ID_CUSTOM_EXPLODE_FIRE, &custom_element_properties[EP_EXPLODES_SMASHED], - " ", "smashed", "element can explode when smashed" + " ", + "smashed", "element can explode when smashed" }, { -1, ED_ELEMENT_SETTINGS_YPOS(11), GADGET_ID_CUSTOM_EXPLODE_IMPACT, GADGET_ID_CUSTOM_EXPLODE_SMASH, &custom_element_properties[EP_EXPLODES_IMPACT], - " ", "impact", "element can explode on impact" + " ", + "impact", "element can explode on impact" }, /* ---------- element settings: advanced (custom elements) --------------- */ @@ -2759,55 +2803,64 @@ static struct ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(1), GADGET_ID_CUSTOM_CAN_CHANGE, GADGET_ID_NONE, &custom_element_change.can_change, - NULL, "element changes to:", "change element on specified condition" + NULL, + "element changes to:", "change element on specified condition" }, { ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(2), GADGET_ID_CHANGE_DELAY, GADGET_ID_NONE, &custom_element_change_events[CE_DELAY], - NULL, NULL, "element changes after delay" + NULL, + NULL, "element changes after delay" }, { ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(4), GADGET_ID_CHANGE_BY_DIRECT_ACT, GADGET_ID_NONE, &custom_element_change_events[CE_BY_DIRECT_ACTION], - NULL, NULL, "element changes by direct action" + NULL, + NULL, "element changes by direct action" }, { ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(5), GADGET_ID_CHANGE_BY_OTHER_ACT, GADGET_ID_NONE, &custom_element_change_events[CE_BY_OTHER_ACTION], - NULL, NULL, "element changes by other element" + NULL, + NULL, "element changes by other element" }, { ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(8), GADGET_ID_CHANGE_USE_EXPLOSION, GADGET_ID_NONE, &custom_element_change.explode, - NULL, "explode instead of change", "element explodes instead of change" + NULL, + "explode instead of change", "element explodes instead of change" }, { ED_ELEMENT_SETTINGS_XPOS(1), ED_ELEMENT_SETTINGS_YPOS(9), GADGET_ID_CHANGE_USE_CONTENT, GADGET_ID_NONE, &custom_element_change.use_target_content, - NULL, "use extended change target:","element changes to more elements" + NULL, + "use extended change target:", "element changes to more elements" }, { ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(11), GADGET_ID_CHANGE_ONLY_COMPLETE, GADGET_ID_NONE, &custom_element_change.only_if_complete, - NULL, "replace all or nothing", "only replace when all can be changed" + NULL, + "replace all or nothing", "only replace when all can be changed" }, { ED_ELEMENT_SETTINGS_XPOS(2), ED_ELEMENT_SETTINGS_YPOS(12), GADGET_ID_CHANGE_USE_RANDOM, GADGET_ID_NONE, &custom_element_change.use_random_replace, - NULL, NULL, "use percentage for random replace" + NULL, + NULL, "use percentage for random replace" }, { ED_ELEMENT_SETTINGS_XPOS(0), ED_ELEMENT_SETTINGS_YPOS(13), GADGET_ID_CHANGE_HAS_ACTION, GADGET_ID_NONE, &custom_element_change.has_action, - NULL, NULL, "execute action on specified condition" + NULL, + NULL, "execute action on specified condition" }, }; @@ -2953,7 +3006,7 @@ static struct /* ---------- level start element ---------------------------------------- */ { - -1, ED_AREA_1X1_SETTINGS_YPOS(8), + -1, ED_AREA_1X1_SETTINGS_YPOS(9), GADGET_ID_START_ELEMENT, GADGET_ID_USE_START_ELEMENT, &level.start_element[0], 1, 1, NULL, NULL, NULL, "level start element" @@ -2962,7 +3015,7 @@ static struct /* ---------- player artwork element ------------------------------------- */ { - -1, ED_AREA_1X1_SETTINGS_YPOS(9), + -1, ED_AREA_1X1_SETTINGS_YPOS(10), GADGET_ID_ARTWORK_ELEMENT, GADGET_ID_USE_ARTWORK_ELEMENT, &level.artwork_element[0], 1, 1, NULL, NULL, NULL, "element for player artwork" @@ -2971,7 +3024,7 @@ static struct /* ---------- player explosion element ----------------------------------- */ { - -1, ED_AREA_1X1_SETTINGS_YPOS(10), + -1, ED_AREA_1X1_SETTINGS_YPOS(11), GADGET_ID_EXPLOSION_ELEMENT, GADGET_ID_USE_EXPLOSION_ELEMENT, &level.explosion_element[0], 1, 1, NULL, NULL, NULL, "element for player explosion" @@ -3075,7 +3128,11 @@ static int ed_fieldx = MAX_ED_FIELDX - 1, ed_fieldy = MAX_ED_FIELDY - 1; /* actual position of level editor drawing area in level playfield */ static int level_xpos = -1, level_ypos = -1; +#if 1 +#define IN_ED_FIELD(x,y) IN_FIELD(x, y, ed_fieldx, ed_fieldy) +#else #define IN_ED_FIELD(x,y) ((x)>=0 && (x)=0 &&(y)'), + EL_STEEL_CHAR('?'), + + EL_STEEL_CHAR('@'), + EL_STEEL_CHAR('A'), + EL_STEEL_CHAR('B'), + EL_STEEL_CHAR('C'), + + EL_STEEL_CHAR('D'), + EL_STEEL_CHAR('E'), + EL_STEEL_CHAR('F'), + EL_STEEL_CHAR('G'), + + EL_STEEL_CHAR('H'), + EL_STEEL_CHAR('I'), + EL_STEEL_CHAR('J'), + EL_STEEL_CHAR('K'), + + EL_STEEL_CHAR('L'), + EL_STEEL_CHAR('M'), + EL_STEEL_CHAR('N'), + EL_STEEL_CHAR('O'), + + EL_STEEL_CHAR('P'), + EL_STEEL_CHAR('Q'), + EL_STEEL_CHAR('R'), + EL_STEEL_CHAR('S'), + + EL_STEEL_CHAR('T'), + EL_STEEL_CHAR('U'), + EL_STEEL_CHAR('V'), + EL_STEEL_CHAR('W'), + + EL_STEEL_CHAR('X'), + EL_STEEL_CHAR('Y'), + EL_STEEL_CHAR('Z'), + EL_STEEL_CHAR('['), + + EL_STEEL_CHAR('\\'), + EL_STEEL_CHAR(']'), + EL_STEEL_CHAR('^'), + EL_STEEL_CHAR('_'), + + EL_STEEL_CHAR('©'), + EL_STEEL_CHAR('Ä'), + EL_STEEL_CHAR('Ö'), + EL_STEEL_CHAR('Ãœ'), + + EL_STEEL_CHAR('°'), + EL_STEEL_CHAR('®'), + EL_STEEL_CHAR(FONT_ASCII_CURSOR), + EL_STEEL_CHAR(FONT_ASCII_BUTTON), + + EL_STEEL_CHAR(FONT_ASCII_UP), + EL_STEEL_CHAR(FONT_ASCII_DOWN), + EL_STEEL_CHAR(' '), + EL_STEEL_CHAR(' ') +}; +static int *editor_hl_steel_chars_ptr = editor_hl_steel_chars; +static int *editor_el_steel_chars_ptr = editor_el_steel_chars; +static int num_editor_hl_steel_chars = SIZEOF_ARRAY_INT(editor_hl_steel_chars); +static int num_editor_el_steel_chars = SIZEOF_ARRAY_INT(editor_el_steel_chars); + static int editor_hl_custom[] = { EL_INTERNAL_CASCADE_CE_ACTIVE, @@ -4305,6 +4560,12 @@ editor_elements_info[] = &editor_hl_chars_ptr, &num_editor_hl_chars, &editor_el_chars_ptr, &num_editor_el_chars }, + { + &setup.editor.el_steel_chars, + &setup.editor_cascade.el_steel_chars, + &editor_hl_steel_chars_ptr, &num_editor_hl_steel_chars, + &editor_el_steel_chars_ptr, &num_editor_el_steel_chars + }, { &setup.editor.el_custom, &setup.editor_cascade.el_ce, @@ -5107,8 +5368,11 @@ static void CreateCounterButtons() if (i == ED_COUNTER_ID_SELECT_LEVEL) { font_type = FONT_LEVEL_NUMBER; +#if 1 + font_type_active = FONT_LEVEL_NUMBER_ACTIVE; +#else font_type_active = FONT_LEVEL_NUMBER; - +#endif x += 2 * ED_GADGET_DISTANCE; y -= ED_GADGET_DISTANCE; @@ -6736,6 +7000,11 @@ void CheckElementDescriptions() void DrawLevelEd() { CloseDoor(DOOR_CLOSE_ALL); + +#if 1 + FadeOut(REDRAW_FIELD); +#endif + OpenDoor(DOOR_OPEN_2 | DOOR_NO_DELAY); #if DEBUG @@ -6783,12 +7052,26 @@ void DrawLevelEd() #endif MapControlButtons(); +#if 0 + FadeOut(REDRAW_FIELD); +#endif + DrawEditModeWindow(); +#if 1 + FadeIn(REDRAW_FIELD); +#endif + /* copy actual editor door content to door double buffer for OpenDoor() */ BlitBitmap(drawto, bitmap_db_door, DX, DY, DXSIZE, DYSIZE, DOOR_GFX_PAGEX1, DOOR_GFX_PAGEY1); +#if 1 + /* draw new control window (with border) to window */ + redraw_mask |= REDRAW_ALL; + BackToFront(); +#endif + OpenDoor(DOOR_OPEN_1); } @@ -7041,7 +7324,7 @@ static void DrawDrawingWindow() stick_element_properties_window = FALSE; SetMainBackgroundImage(IMG_UNDEFINED); - ClearWindow(); + ClearField(); UnmapLevelEditorWindowGadgets(); UnmapLevelEditorToolboxCustomGadgets(); @@ -7064,7 +7347,7 @@ static void DrawLevelInfoWindow() stick_element_properties_window = FALSE; SetMainBackgroundImage(IMG_BACKGROUND_EDITOR); - ClearWindow(); + ClearField(); UnmapLevelEditorWindowGadgets(); #if 0 @@ -7299,23 +7582,27 @@ static int PrintElementDescriptionFromFile(char *filename, int start_line) int max_chars_per_line = (SXSIZE - 2 * pad_x) / font_width; int max_lines_per_screen = (SYSIZE - pad_y) / font_height - 1; - return DrawTextFromFile(sx, sy, filename, font_nr, max_chars_per_line, - max_lines_per_screen, TRUE); + return DrawTextFile(sx, sy, filename, font_nr, max_chars_per_line, -1, + max_lines_per_screen, -1, TRUE, FALSE, FALSE); } static void DrawPropertiesTabulatorGadgets() { - struct GadgetInfo *gd_gi = level_editor_gadget[GADGET_ID_PROPERTIES_INFO]; - struct GadgetDesign *gd = &gd_gi->alt_design[GD_BUTTON_UNPRESSED]; - int gd_x = gd->x + gd_gi->border.width / 2; - int gd_y = gd->y + gd_gi->height - 1; + struct GadgetInfo *gd_gi1 = level_editor_gadget[GADGET_ID_PROPERTIES_INFO]; + struct GadgetInfo *gd_gi4 = level_editor_gadget[GADGET_ID_PROPERTIES_CHANGE]; + struct GadgetDesign *gd = &gd_gi1->alt_design[GD_BUTTON_UNPRESSED]; + int gd_x = gd->x + gd_gi1->border.width / 2; + int gd_y = gd->y + gd_gi1->height - 1; Pixel tab_color = GetPixel(gd->bitmap, gd_x, gd_y); int id_first = ED_TEXTBUTTON_ID_PROPERTIES_INFO; int id_last = ED_TEXTBUTTON_ID_PROPERTIES_CONFIG; +#if 1 +#else int max_tabs = 4; +#endif int i; - /* draw additional "advanced" tabulator for custom elements */ + /* draw additional "change" tabulator for custom elements */ if (IS_CUSTOM_ELEMENT(properties_element)) id_last = ED_TEXTBUTTON_ID_PROPERTIES_CHANGE; @@ -7331,21 +7618,29 @@ static void DrawPropertiesTabulatorGadgets() continue; /* draw background line below tabulator button */ - ClearRectangleOnBackground(drawto, gi->x, gi->y + gi->height, gi->width,1); + ClearRectangleOnBackground(drawto, gi->x, gi->y + gi->height, gi->width, 1); /* draw solid line below inactive tabulator buttons */ if (!active && tab_color != BLACK_PIXEL) /* black => transparent */ - FillRectangle(drawto, gi->x, gi->y + gi->height, gi->width,1, tab_color); + FillRectangle(drawto, gi->x, gi->y + gi->height, gi->width, 1, tab_color); ModifyGadget(gi, GDI_ACTIVE, active, GDI_END); MapTextbuttonGadget(i); } +#if 1 + /* draw little border line below tabulator buttons */ + if (tab_color != BLACK_PIXEL) /* black => transparent */ + FillRectangle(drawto, gd_gi1->x, gd_gi1->y + gd_gi1->height + 1, + gd_gi4->x - gd_gi1->x + gd_gi4->width, ED_GADGET_DISTANCE, + tab_color); +#else /* draw little border line below tabulator buttons */ if (tab_color != BLACK_PIXEL) /* black => transparent */ - FillRectangle(drawto, gd_gi->x, gd_gi->y + gd_gi->height + 1, - max_tabs * gd_gi->width + (max_tabs -1) * ED_GADGET_DISTANCE, + FillRectangle(drawto, gd_gi1->x, gd_gi1->y + gd_gi1->height + 1, + max_tabs * gd_gi1->width + (max_tabs -1) * ED_GADGET_DISTANCE, ED_GADGET_DISTANCE, tab_color); +#endif } static void DrawPropertiesInfo() @@ -7399,6 +7694,7 @@ static void DrawPropertiesInfo() /* pre-defined properties */ { EP_CAN_PASS_MAGIC_WALL, "- can pass magic walls" }, + { EP_CAN_PASS_DC_MAGIC_WALL,"- can pass magic walls (DC style)" }, { EP_SWITCHABLE, "- can be switched" }, #if 0 { EP_HAS_EDITOR_CONTENT, "- can contain other elements" }, @@ -7566,9 +7862,11 @@ static struct { EL_EMC_DRIPPER, &level.amoeba_speed, TEXT_AMOEBA_SPEED }, { EL_MAGIC_WALL, &level.time_magic_wall, TEXT_DURATION }, { EL_BD_MAGIC_WALL, &level.time_magic_wall, TEXT_DURATION }, + { EL_DC_MAGIC_WALL, &level.time_magic_wall, TEXT_DURATION }, { EL_ROBOT_WHEEL, &level.time_wheel, TEXT_DURATION }, - { EL_TIMEGATE_SWITCH, &level.time_timegate, TEXT_DURATION }, + { EL_TIMEGATE_SWITCH, &level.time_timegate, TEXT_DURATION }, + { EL_DC_TIMEGATE_SWITCH,&level.time_timegate, TEXT_DURATION }, { EL_LIGHT_SWITCH, &level.time_light, TEXT_DURATION }, { EL_LIGHT_SWITCH_ACTIVE, &level.time_light, TEXT_DURATION }, { EL_SHIELD_NORMAL, &level.shield_normal_time, TEXT_DURATION }, @@ -7727,6 +8025,7 @@ static void DrawPropertiesConfig() MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BLOCK_SNAP_FIELD); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_CONTINUOUS_SNAPPING); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_INSTANT_RELOCATION); + MapCheckbuttonGadget(ED_CHECKBUTTON_ID_SHIFTED_RELOCATION); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_START_ELEMENT); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_ARTWORK_ELEMENT); MapCheckbuttonGadget(ED_CHECKBUTTON_ID_USE_EXPLOSION_ELEMENT); @@ -7779,14 +8078,23 @@ static void DrawPropertiesConfig() { int counter1_id = ED_COUNTER_ID_ENVELOPE_XSIZE; int counter2_id = ED_COUNTER_ID_ENVELOPE_YSIZE; + int button1_id = ED_CHECKBUTTON_ID_ENVELOPE_AUTOWRAP; + int button2_id = ED_CHECKBUTTON_ID_ENVELOPE_CENTERED; int envelope_nr = properties_element - EL_ENVELOPE_1; counterbutton_info[counter1_id].value = &level.envelope[envelope_nr].xsize; counterbutton_info[counter2_id].value = &level.envelope[envelope_nr].ysize; + checkbutton_info[button1_id].value = &level.envelope[envelope_nr].autowrap; + checkbutton_info[button2_id].value = &level.envelope[envelope_nr].centered; + /* display counter to choose size of envelope text area */ - MapCounterButtons(ED_COUNTER_ID_ENVELOPE_XSIZE); - MapCounterButtons(ED_COUNTER_ID_ENVELOPE_YSIZE); + MapCounterButtons(counter1_id); + MapCounterButtons(counter2_id); + + /* display checkbuttons to choose auto-wrap and alignment properties */ + MapCheckbuttonGadget(button1_id); + MapCheckbuttonGadget(button2_id); DrawEnvelopeTextArea(envelope_nr); } @@ -8009,7 +8317,7 @@ static void DrawPropertiesWindow() MapLevelEditorToolboxCustomGadgets(); SetMainBackgroundImage(IMG_BACKGROUND_EDITOR); - ClearWindow(); + ClearField(); #if 0 DrawTextSCentered(ED_SETTINGS1_YPOS, FONT_TITLE_1, "Element Settings"); @@ -8058,157 +8366,1124 @@ static void UpdateCustomElementGraphicGadgets() } } -static void DrawLineElement(int sx, int sy, int element, boolean change_level) +static int getOpenDirectionFromTube(int element) { - int lx = sx + level_xpos; - int ly = sy + level_ypos; - - DrawMiniElement(sx, sy, (element < 0 ? Feld[lx][ly] : element)); + switch (element) + { + case EL_TUBE_LEFT_UP: return (MV_LEFT | MV_UP); + case EL_TUBE_LEFT_DOWN: return (MV_LEFT | MV_DOWN); + case EL_TUBE_RIGHT_UP: return (MV_RIGHT | MV_UP); + case EL_TUBE_RIGHT_DOWN: return (MV_RIGHT | MV_DOWN); + case EL_TUBE_HORIZONTAL: return (MV_HORIZONTAL); + case EL_TUBE_HORIZONTAL_UP: return (MV_HORIZONTAL | MV_UP); + case EL_TUBE_HORIZONTAL_DOWN: return (MV_HORIZONTAL | MV_DOWN); + case EL_TUBE_VERTICAL: return (MV_VERTICAL); + case EL_TUBE_VERTICAL_LEFT: return (MV_VERTICAL | MV_LEFT); + case EL_TUBE_VERTICAL_RIGHT: return (MV_VERTICAL | MV_RIGHT); + case EL_TUBE_ANY: return (MV_ANY_DIRECTION); + } - if (change_level) - Feld[lx][ly] = element; + return MV_NONE; } -static void DrawLine(int from_x, int from_y, int to_x, int to_y, - int element, boolean change_level) +static int getTubeFromOpenDirection(int direction) { - if (from_y == to_y) /* horizontal line */ + switch (direction) { - int x; - int y = from_y; - - if (from_x > to_x) - swap_numbers(&from_x, &to_x); + case (MV_LEFT | MV_UP): return EL_TUBE_LEFT_UP; + case (MV_LEFT | MV_DOWN): return EL_TUBE_LEFT_DOWN; + case (MV_RIGHT | MV_UP): return EL_TUBE_RIGHT_UP; + case (MV_RIGHT | MV_DOWN): return EL_TUBE_RIGHT_DOWN; + case (MV_HORIZONTAL): return EL_TUBE_HORIZONTAL; + case (MV_HORIZONTAL | MV_UP): return EL_TUBE_HORIZONTAL_UP; + case (MV_HORIZONTAL | MV_DOWN): return EL_TUBE_HORIZONTAL_DOWN; + case (MV_VERTICAL): return EL_TUBE_VERTICAL; + case (MV_VERTICAL | MV_LEFT): return EL_TUBE_VERTICAL_LEFT; + case (MV_VERTICAL | MV_RIGHT): return EL_TUBE_VERTICAL_RIGHT; + case (MV_ANY_DIRECTION): return EL_TUBE_ANY; - for (x = from_x; x <= to_x; x++) - DrawLineElement(x, y, element, change_level); + /* if only one direction, fall back to simple tube with that direction */ + case (MV_LEFT): return EL_TUBE_HORIZONTAL; + case (MV_RIGHT): return EL_TUBE_HORIZONTAL; + case (MV_UP): return EL_TUBE_VERTICAL; + case (MV_DOWN): return EL_TUBE_VERTICAL; } - else if (from_x == to_x) /* vertical line */ - { - int x = from_x; - int y; - if (from_y > to_y) - swap_numbers(&from_y, &to_y); + return EL_EMPTY; +} - for (y = from_y; y <= to_y; y++) - DrawLineElement(x, y, element, change_level); - } - else /* diagonal line */ - { - int len_x = ABS(to_x - from_x); - int len_y = ABS(to_y - from_y); - int x, y; +static int getTubeFromOpenDirectionNotEmpty(int direction, int element_old) +{ + int element_new = getTubeFromOpenDirection(direction); - if (len_y < len_x) /* a < 1 */ - { - float a = (float)len_y / (float)len_x; + return (element_new != EL_EMPTY ? element_new : element_old); +} - if (from_x > to_x) - swap_number_pairs(&from_x, &from_y, &to_x, &to_y); +static int getOpenDirectionFromBelt(int element) +{ + int belt_dir = getBeltDirFromBeltElement(element); - for (x = 0; x <= len_x; x++) - { - y = (int)(a * x + 0.5) * (to_y < from_y ? -1 : +1); - DrawLineElement(from_x + x, from_y + y, element, change_level); - } - } - else /* a >= 1 */ - { - float a = (float)len_x / (float)len_y; + return (belt_dir == MV_LEFT ? MV_RIGHT : + belt_dir == MV_RIGHT ? MV_LEFT : + belt_dir == MV_NONE ? MV_HORIZONTAL : belt_dir); +} - if (from_y > to_y) - swap_number_pairs(&from_x, &from_y, &to_x, &to_y); +static int getBeltFromNrAndOpenDirection(int nr, int direction) +{ + int belt_dir = (direction == MV_LEFT ? MV_RIGHT : + direction == MV_RIGHT ? MV_LEFT : + direction == MV_HORIZONTAL ? MV_NONE : direction); - for (y = 0; y <= len_y; y++) - { - x = (int)(a * y + 0.5) * (to_x < from_x ? -1 : +1); - DrawLineElement(from_x + x, from_y + y, element, change_level); - } - } - } + if (direction == MV_NONE) + return EL_EMPTY; + + return getBeltElementFromBeltNrAndBeltDir(nr, belt_dir); } -static void DrawBox(int from_x, int from_y, int to_x, int to_y, - int element, boolean change_level) +static int getBeltFromNrAndOpenDirectionNotEmpty(int nr, int direction, + int element_old) { - DrawLine(from_x, from_y, from_x, to_y, element, change_level); - DrawLine(from_x, to_y, to_x, to_y, element, change_level); - DrawLine(to_x, to_y, to_x, from_y, element, change_level); - DrawLine(to_x, from_y, from_x, from_y, element, change_level); + int element_new = getBeltFromNrAndOpenDirection(nr, direction); + + return (element_new != EL_EMPTY ? element_new : element_old); } -static void DrawFilledBox(int from_x, int from_y, int to_x, int to_y, - int element, boolean change_level) +static int getOpenDirectionFromPool(int element) { - int y; - - if (from_y > to_y) - swap_number_pairs(&from_x, &from_y, &to_x, &to_y); + switch (element) + { + case EL_ACID_POOL_TOPLEFT: return (MV_DOWN | MV_RIGHT); + case EL_ACID_POOL_TOPRIGHT: return (MV_DOWN | MV_LEFT); + case EL_ACID_POOL_BOTTOMLEFT: return (MV_UP | MV_RIGHT); + case EL_ACID_POOL_BOTTOMRIGHT: return (MV_UP | MV_LEFT); + case EL_ACID_POOL_BOTTOM: return (MV_HORIZONTAL | MV_UP); + case EL_ACID: return (MV_HORIZONTAL | MV_DOWN); + } - for (y = from_y; y <= to_y; y++) - DrawLine(from_x, y, to_x, y, element, change_level); + return MV_NONE; } -static void DrawArcExt(int from_x, int from_y, int to_x2, int to_y2, - int element, boolean change_level) +static int getPoolFromOpenDirection(int direction) { - int to_x = to_x2 - (to_x2 > from_x ? +1 : -1); - int to_y = to_y2 - (to_y2 > from_y ? +1 : -1); - int len_x = ABS(to_x - from_x); - int len_y = ABS(to_y - from_y); - int radius, x, y; + switch (direction) + { + case (MV_DOWN | MV_RIGHT): return EL_ACID_POOL_TOPLEFT; + case (MV_DOWN | MV_LEFT): return EL_ACID_POOL_TOPRIGHT; + case (MV_UP | MV_RIGHT): return EL_ACID_POOL_BOTTOMLEFT; + case (MV_UP | MV_LEFT): return EL_ACID_POOL_BOTTOMRIGHT; + case (MV_HORIZONTAL | MV_UP): return EL_ACID_POOL_BOTTOM; + case (MV_HORIZONTAL | MV_DOWN): return EL_ACID; + } - radius = (int)(sqrt((float)(len_x * len_x + len_y * len_y)) + 0.5); + return EL_EMPTY; +} - /* not optimal (some points get drawn twice) but simple, - and fast enough for the few points we are drawing */ +static int getPoolFromOpenDirectionExt(int direction, int help_element) +{ + int element = getPoolFromOpenDirection(direction); + int help_direction = getOpenDirectionFromPool(help_element); - for (x = 0; x <= radius; x++) + if (element == EL_EMPTY) { - int sx, sy, lx, ly; + int help_direction_vertical = help_direction & MV_VERTICAL; - y = (int)(sqrt((float)(radius * radius - x * x)) + 0.5); + element = getPoolFromOpenDirection(direction | help_direction_vertical); + } - sx = from_x + x * (from_x < to_x2 ? +1 : -1); - sy = from_y + y * (from_y < to_y2 ? +1 : -1); - lx = sx + level_xpos; - ly = sy + level_ypos; + if (element == EL_EMPTY) + { + int help_direction_horizontal = help_direction & MV_HORIZONTAL; - if (IN_ED_FIELD(sx, sy) && IN_LEV_FIELD(lx, ly)) - DrawLineElement(sx, sy, element, change_level); + element = getPoolFromOpenDirection(direction | help_direction_horizontal); } - for (y = 0; y <= radius; y++) - { - int sx, sy, lx, ly; + return element; +} - x = (int)(sqrt((float)(radius * radius - y * y)) + 0.5); +static int getPoolFromOpenDirectionNotEmpty(int direction, int element_old) +{ + int element_new = getPoolFromOpenDirectionExt(direction, element_old); - sx = from_x + x * (from_x < to_x2 ? +1 : -1); - sy = from_y + y * (from_y < to_y2 ? +1 : -1); - lx = sx + level_xpos; - ly = sy + level_ypos; + return (element_new != EL_EMPTY ? element_new : element_old); +} - if (IN_ED_FIELD(sx, sy) && IN_LEV_FIELD(lx, ly)) - DrawLineElement(sx, sy, element, change_level); +static int getOpenDirectionFromPillar(int element) +{ + switch (element) + { + case EL_EMC_WALL_1: return (MV_DOWN); + case EL_EMC_WALL_2: return (MV_VERTICAL); + case EL_EMC_WALL_3: return (MV_UP); } + + return MV_NONE; } -static void DrawArc(int from_x, int from_y, int to_x, int to_y, - int element, boolean change_level) +static int getPillarFromOpenDirection(int direction) { - int to_x2 = to_x + (to_x < from_x ? -1 : +1); - int to_y2 = to_y + (to_y > from_y ? +1 : -1); + switch (direction) + { + case (MV_DOWN): return EL_EMC_WALL_1; + case (MV_VERTICAL): return EL_EMC_WALL_2; + case (MV_UP): return EL_EMC_WALL_3; + } - DrawArcExt(from_x, from_y, to_x2, to_y2, element, change_level); + return EL_EMPTY; } -#define DRAW_CIRCLES_BUTTON_AVAILABLE 0 - -#if DRAW_CIRCLES_BUTTON_AVAILABLE -static void DrawCircle(int from_x, int from_y, int to_x, int to_y, - int element, boolean change_level) +static int getPillarFromOpenDirectionNotEmpty(int direction, int element_old) +{ + int element_new = getPillarFromOpenDirection(direction); + + return (element_new != EL_EMPTY ? element_new : element_old); +} + +static int getOpenDirectionFromSteel2(int element) +{ + switch (element) + { + case EL_DC_STEELWALL_2_LEFT: return (MV_RIGHT); + case EL_DC_STEELWALL_2_RIGHT: return (MV_LEFT); + case EL_DC_STEELWALL_2_TOP: return (MV_DOWN); + case EL_DC_STEELWALL_2_BOTTOM: return (MV_UP); + case EL_DC_STEELWALL_2_HORIZONTAL: return (MV_HORIZONTAL); + case EL_DC_STEELWALL_2_VERTICAL: return (MV_VERTICAL); + case EL_DC_STEELWALL_2_MIDDLE: return (MV_ANY_DIRECTION); + case EL_DC_STEELWALL_2_SINGLE: return (MV_NONE); + } + + return MV_NONE; +} + +static int getSteel2FromOpenDirection(int direction) +{ + switch (direction) + { + case (MV_RIGHT): return EL_DC_STEELWALL_2_LEFT; + case (MV_LEFT): return EL_DC_STEELWALL_2_RIGHT; + case (MV_DOWN): return EL_DC_STEELWALL_2_TOP; + case (MV_UP): return EL_DC_STEELWALL_2_BOTTOM; + case (MV_HORIZONTAL): return EL_DC_STEELWALL_2_HORIZONTAL; + case (MV_VERTICAL): return EL_DC_STEELWALL_2_VERTICAL; + case (MV_ANY_DIRECTION): return EL_DC_STEELWALL_2_MIDDLE; + case (MV_NONE): return EL_DC_STEELWALL_2_SINGLE; + } + + return EL_EMPTY; +} + +static int getSteel2FromOpenDirectionNotEmpty(int direction, int element_old) +{ + int element_new = getSteel2FromOpenDirection(direction); + + return (element_new != EL_EMPTY ? element_new : element_old); +} + +static int getOpenDirectionFromChip(int element) +{ + switch (element) + { + case EL_SP_CHIP_SINGLE: return (MV_NONE); + case EL_SP_CHIP_LEFT: return (MV_RIGHT); + case EL_SP_CHIP_RIGHT: return (MV_LEFT); + case EL_SP_CHIP_TOP: return (MV_DOWN); + case EL_SP_CHIP_BOTTOM: return (MV_UP); + } + + return MV_NONE; +} + +static int getChipFromOpenDirection(int direction) +{ + switch (direction) + { + case (MV_NONE): return EL_SP_CHIP_SINGLE; + case (MV_LEFT): return EL_SP_CHIP_RIGHT; + case (MV_RIGHT): return EL_SP_CHIP_LEFT; + case (MV_UP): return EL_SP_CHIP_BOTTOM; + case (MV_DOWN): return EL_SP_CHIP_TOP; + } + + return EL_EMPTY; +} + +static int getChipFromOpenDirectionNotEmpty(int direction, int element_old) +{ + int element_new = getChipFromOpenDirection(direction); + + return (element_new != EL_EMPTY ? element_new : element_old); +} + +static int getClosedTube(int x, int y) +{ + static int xy[4][2] = + { + { -1, 0 }, + { +1, 0 }, + { 0, -1 }, + { 0, +1 } + }; + int element_old = IntelliDrawBuffer[x][y]; + int direction_old = getOpenDirectionFromTube(element_old); + int direction_new = MV_NONE; + int i; + + for (i = 0; i < NUM_DIRECTIONS; i++) + { + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; + int dir = MV_DIR_FROM_BIT(i); + int dir_opposite = MV_DIR_OPPOSITE(dir); + + if (IN_LEV_FIELD(xx, yy) && IS_TUBE(IntelliDrawBuffer[xx][yy]) && + (direction_old & dir) && + (getOpenDirectionFromTube(IntelliDrawBuffer[xx][yy]) & dir_opposite)) + direction_new |= dir; + } + + return getTubeFromOpenDirectionNotEmpty(direction_new, element_old); +} + +static int getClosedBelt(int x, int y) +{ + static int xy[4][2] = + { + { -1, 0 }, + { +1, 0 }, + { 0, -1 }, + { 0, +1 } + }; + int element_old = IntelliDrawBuffer[x][y]; + int nr = getBeltNrFromBeltElement(element_old); + int direction_old = getOpenDirectionFromBelt(element_old); + int direction_new = MV_NONE; + int i; + + for (i = MV_BIT_LEFT; i <= MV_BIT_RIGHT; i++) + { + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; + int dir = MV_DIR_FROM_BIT(i); + int dir_opposite = MV_DIR_OPPOSITE(dir); + + if (IN_LEV_FIELD(xx, yy) && IS_BELT(IntelliDrawBuffer[xx][yy]) && + (direction_old & dir) && + (getOpenDirectionFromBelt(IntelliDrawBuffer[xx][yy]) & dir_opposite)) + direction_new |= dir; + } + + return getBeltFromNrAndOpenDirection(nr, direction_new); +} + +static int getClosedPool(int x, int y) +{ + static int xy[4][2] = + { + { -1, 0 }, + { +1, 0 }, + { 0, -1 }, + { 0, +1 } + }; + int element_old = IntelliDrawBuffer[x][y]; + int direction_old = getOpenDirectionFromPool(element_old); + int direction_new = MV_NONE; + int i; + + for (i = 0; i < NUM_DIRECTIONS; i++) + { + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; + int dir = MV_DIR_FROM_BIT(i); + int dir_opposite = MV_DIR_OPPOSITE(dir); + + if (IN_LEV_FIELD(xx, yy) && + IS_ACID_POOL_OR_ACID(IntelliDrawBuffer[xx][yy]) && + (direction_old & dir) && + (getOpenDirectionFromPool(IntelliDrawBuffer[xx][yy]) & dir_opposite)) + direction_new |= dir; + } + + return getPoolFromOpenDirectionNotEmpty(direction_new, element_old); +} + +static int getClosedPillar(int x, int y) +{ + static int xy[4][2] = + { + { -1, 0 }, + { +1, 0 }, + { 0, -1 }, + { 0, +1 } + }; + int element_old = IntelliDrawBuffer[x][y]; + int direction_old = getOpenDirectionFromPillar(element_old); + int direction_new = MV_NONE; + int i; + + for (i = MV_BIT_UP; i <= MV_BIT_DOWN; i++) + { + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; + int dir = MV_DIR_FROM_BIT(i); + int dir_opposite = MV_DIR_OPPOSITE(dir); + + if (IN_LEV_FIELD(xx, yy) && IS_EMC_PILLAR(IntelliDrawBuffer[xx][yy]) && + (direction_old & dir) && + (getOpenDirectionFromPillar(IntelliDrawBuffer[xx][yy]) & dir_opposite)) + direction_new |= dir; + } + + return getPillarFromOpenDirectionNotEmpty(direction_new, element_old); +} + +static int getClosedSteel2(int x, int y) +{ + static int xy[4][2] = + { + { -1, 0 }, + { +1, 0 }, + { 0, -1 }, + { 0, +1 } + }; + int element_old = IntelliDrawBuffer[x][y]; + int direction_old = getOpenDirectionFromSteel2(element_old); + int direction_new = MV_NONE; + int i; + + for (i = 0; i < NUM_DIRECTIONS; i++) + { + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; + int dir = MV_DIR_FROM_BIT(i); + int dir_opposite = MV_DIR_OPPOSITE(dir); + + if (IN_LEV_FIELD(xx, yy) && IS_DC_STEELWALL_2(IntelliDrawBuffer[xx][yy]) && + (direction_old & dir) && + (getOpenDirectionFromSteel2(IntelliDrawBuffer[xx][yy]) & dir_opposite)) + direction_new |= dir; + } + + return getSteel2FromOpenDirectionNotEmpty(direction_new, element_old); +} + +static int getClosedChip(int x, int y) +{ + static int xy[4][2] = + { + { -1, 0 }, + { +1, 0 }, + { 0, -1 }, + { 0, +1 } + }; + int element_old = IntelliDrawBuffer[x][y]; + int direction_old = getOpenDirectionFromChip(element_old); + int direction_new = MV_NONE; + int i; + + for (i = 0; i < NUM_DIRECTIONS; i++) + { + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; + int dir = MV_DIR_FROM_BIT(i); + int dir_opposite = MV_DIR_OPPOSITE(dir); + + if (IN_LEV_FIELD(xx, yy) && IS_SP_CHIP(IntelliDrawBuffer[xx][yy]) && + (direction_old & dir) && + (getOpenDirectionFromChip(IntelliDrawBuffer[xx][yy]) & dir_opposite)) + direction_new |= dir; + } + + return getChipFromOpenDirectionNotEmpty(direction_new, element_old); +} + +static void SetElementSimple(int x, int y, int element, boolean change_level) +{ + int sx = x - level_xpos; + int sy = y - level_ypos; + + IntelliDrawBuffer[x][y] = element; + + if (change_level) + Feld[x][y] = element; + + if (IN_ED_FIELD(sx, sy)) + DrawMiniElement(sx, sy, element); +} + +static void MergeAndCloseNeighbourElements(int x1, int y1, int *element1, + int x2, int y2, int *element2, + int (*close_function)(int, int), + boolean change_level) +{ + /* set neighbour elements to newly determined connections */ + SetElementSimple(x1, y1, *element1, change_level); + SetElementSimple(x2, y2, *element2, change_level); + + /* remove all open connections of neighbour elements */ + *element1 = close_function(x1, y1); + *element2 = close_function(x2, y2); + + /* set neighbour elements to new, minimized connections */ + SetElementSimple(x1, y1, *element1, change_level); + SetElementSimple(x2, y2, *element2, change_level); +} + +static void SetElementIntelliDraw(int x, int y, int new_element, + boolean change_level, int button) +{ + static int xy[4][2] = + { + { -1, 0 }, + { +1, 0 }, + { 0, -1 }, + { 0, +1 } + }; + static int last_x = -1; + static int last_y = -1; + int old_element = IntelliDrawBuffer[x][y]; + + if (new_element == EL_UNDEFINED) + { + last_x = -1; + last_y = -1; + + return; + } + + if (IS_TUBE(new_element)) + { + int last_element_new = EL_UNDEFINED; + int direction = MV_NONE; + int i; + + /* if old element is of same kind, keep all existing directions */ + if (IS_TUBE(old_element)) + direction |= getOpenDirectionFromTube(old_element); + + for (i = 0; i < NUM_DIRECTIONS; i++) + { + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; + + if (last_x == xx && last_y == yy && IN_LEV_FIELD(last_x, last_y) && + IS_TUBE(IntelliDrawBuffer[last_x][last_y])) + { + int dir = MV_DIR_FROM_BIT(i); + int dir_opposite = MV_DIR_OPPOSITE(dir); + int last_element_old = IntelliDrawBuffer[last_x][last_y]; + int last_direction_old = getOpenDirectionFromTube(last_element_old); + int last_direction_new = last_direction_old | dir_opposite; + + last_element_new = getTubeFromOpenDirection(last_direction_new); + + direction |= dir; + } + } + + new_element = getTubeFromOpenDirectionNotEmpty(direction, new_element); + + if (last_element_new != EL_UNDEFINED) + MergeAndCloseNeighbourElements(x, y, &new_element, + last_x, last_y, &last_element_new, + getClosedTube, change_level); + } + else if (IS_BELT(new_element)) + { + int belt_nr = getBeltNrFromBeltElement(new_element); + int last_element_new = EL_UNDEFINED; + int direction = MV_NONE; + int i; + + /* if old element is of same kind, keep all existing directions */ + if (IS_BELT(old_element)) + direction |= getOpenDirectionFromBelt(old_element); + + for (i = MV_BIT_LEFT; i <= MV_BIT_RIGHT; i++) + { + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; + + if (last_x == xx && last_y == yy && IN_LEV_FIELD(last_x, last_y) && + IS_BELT(IntelliDrawBuffer[last_x][last_y])) + { + int dir = MV_DIR_FROM_BIT(i); + int dir_opposite = MV_DIR_OPPOSITE(dir); + int last_element_old = IntelliDrawBuffer[last_x][last_y]; + int last_belt_nr = getBeltNrFromBeltElement(last_element_old); + int last_direction_old = getOpenDirectionFromBelt(last_element_old); + int last_direction_new = last_direction_old | dir_opposite; + + last_element_new = getBeltFromNrAndOpenDirection(last_belt_nr, + last_direction_new); + direction |= dir; + } + } + + new_element = getBeltFromNrAndOpenDirectionNotEmpty(belt_nr, direction, + new_element); + if (last_element_new != EL_UNDEFINED) + MergeAndCloseNeighbourElements(x, y, &new_element, + last_x, last_y, &last_element_new, + getClosedBelt, change_level); + } + else if (IS_ACID_POOL_OR_ACID(new_element)) + { + int last_element_new = EL_UNDEFINED; + int direction = MV_NONE; + int i; + + /* if old element is of same kind, keep all existing directions */ + if (IS_ACID_POOL_OR_ACID(old_element)) + direction |= getOpenDirectionFromPool(old_element); + + for (i = 0; i < NUM_DIRECTIONS; i++) + { + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; + + if (last_x == xx && last_y == yy && IN_LEV_FIELD(last_x, last_y) && + IS_ACID_POOL_OR_ACID(IntelliDrawBuffer[last_x][last_y])) + { + int dir = MV_DIR_FROM_BIT(i); + int dir_opposite = MV_DIR_OPPOSITE(dir); + int last_element_old = IntelliDrawBuffer[last_x][last_y]; + int last_direction_old = getOpenDirectionFromPool(last_element_old); + int last_direction_new = last_direction_old | dir_opposite; + + last_element_new = getPoolFromOpenDirection(last_direction_new); + + direction |= dir; + } + } + + /* special corrections needed for intuitively correct acid pool drawing */ + if (last_element_new == EL_EMPTY) + last_element_new = new_element; + else if (last_element_new != EL_UNDEFINED) + new_element = last_element_new; + + new_element = getPoolFromOpenDirectionNotEmpty(direction, new_element); + + if (last_element_new != EL_UNDEFINED) + MergeAndCloseNeighbourElements(x, y, &new_element, + last_x, last_y, &last_element_new, + getClosedPool, change_level); + } + else if (IS_EMC_PILLAR(new_element)) + { + int last_element_new = EL_UNDEFINED; + int direction = MV_NONE; + int i; + + /* if old element is of same kind, keep all existing directions */ + if (IS_EMC_PILLAR(old_element)) + direction |= getOpenDirectionFromPillar(old_element); + + for (i = MV_BIT_UP; i <= MV_BIT_DOWN; i++) + { + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; + + if (last_x == xx && last_y == yy && IN_LEV_FIELD(last_x, last_y) && + IS_EMC_PILLAR(IntelliDrawBuffer[last_x][last_y])) + { + int dir = MV_DIR_FROM_BIT(i); + int dir_opposite = MV_DIR_OPPOSITE(dir); + int last_element_old = IntelliDrawBuffer[last_x][last_y]; + int last_direction_old = getOpenDirectionFromPillar(last_element_old); + int last_direction_new = last_direction_old | dir_opposite; + + last_element_new = getPillarFromOpenDirection(last_direction_new); + + direction |= dir; + } + } + + new_element = getPillarFromOpenDirectionNotEmpty(direction, new_element); + + if (last_element_new != EL_UNDEFINED) + MergeAndCloseNeighbourElements(x, y, &new_element, + last_x, last_y, &last_element_new, + getClosedPillar, change_level); + } + else if (IS_DC_STEELWALL_2(new_element)) + { + int last_element_new = EL_UNDEFINED; + int direction = MV_NONE; + int i; + + /* if old element is of same kind, keep all existing directions */ + if (IS_DC_STEELWALL_2(old_element)) + direction |= getOpenDirectionFromSteel2(old_element); + + for (i = 0; i < NUM_DIRECTIONS; i++) + { + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; + + if (last_x == xx && last_y == yy && IN_LEV_FIELD(last_x, last_y) && + IS_DC_STEELWALL_2(IntelliDrawBuffer[last_x][last_y])) + { + int dir = MV_DIR_FROM_BIT(i); + int dir_opposite = MV_DIR_OPPOSITE(dir); + int last_element_old = IntelliDrawBuffer[last_x][last_y]; + int last_direction_old = getOpenDirectionFromSteel2(last_element_old); + int last_direction_new = last_direction_old | dir_opposite; + + last_element_new = getSteel2FromOpenDirection(last_direction_new); + + direction |= dir; + } + } + + new_element = getSteel2FromOpenDirectionNotEmpty(direction, new_element); + + if (last_element_new != EL_UNDEFINED) + MergeAndCloseNeighbourElements(x, y, &new_element, + last_x, last_y, &last_element_new, + getClosedSteel2, change_level); + } + else if (IS_SP_CHIP(new_element)) + { + int last_element_new = EL_UNDEFINED; + int direction = MV_NONE; + int i; + + /* (do not keep existing directions, regardless of kind of old element) */ + + for (i = 0; i < NUM_DIRECTIONS; i++) + { + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; + + if (last_x == xx && last_y == yy && IN_LEV_FIELD(last_x, last_y) && + IS_SP_CHIP(IntelliDrawBuffer[last_x][last_y])) + { + int dir = MV_DIR_FROM_BIT(i); + int dir_opposite = MV_DIR_OPPOSITE(dir); + int last_element_old = IntelliDrawBuffer[last_x][last_y]; + int last_direction_old = getOpenDirectionFromChip(last_element_old); + int last_direction_new = last_direction_old | dir_opposite; + + if (last_direction_old == MV_NONE) + { + last_element_new = getChipFromOpenDirection(last_direction_new); + direction |= dir; + } + else if (last_direction_old & (dir | dir_opposite)) + { + direction |= MV_DIR_OPPOSITE(last_direction_old); + } + else + { + direction |= MV_DIR_OPPOSITE(dir); + } + } + } + + new_element = getChipFromOpenDirectionNotEmpty(direction, new_element); + + if (last_element_new != EL_UNDEFINED) + MergeAndCloseNeighbourElements(x, y, &new_element, + last_x, last_y, &last_element_new, + getClosedChip, change_level); + } + else if (IS_SP_HARDWARE_BASE(new_element)) + { + int nr = GetSimpleRandom(6); + + new_element = (nr == 0 ? EL_SP_HARDWARE_BASE_1 : + nr == 1 ? EL_SP_HARDWARE_BASE_2 : + nr == 2 ? EL_SP_HARDWARE_BASE_3 : + nr == 3 ? EL_SP_HARDWARE_BASE_4 : + nr == 4 ? EL_SP_HARDWARE_BASE_5 : EL_SP_HARDWARE_BASE_6); + } + else if (new_element == EL_SP_HARDWARE_GREEN || + new_element == EL_SP_HARDWARE_BLUE || + new_element == EL_SP_HARDWARE_RED) + { + int nr = GetSimpleRandom(3); + + new_element = (nr == 0 ? EL_SP_HARDWARE_GREEN : + nr == 1 ? EL_SP_HARDWARE_BLUE : EL_SP_HARDWARE_RED); + } + else if (IS_GROUP_ELEMENT(new_element)) + { + boolean connected_drawing = FALSE; + int i; + + for (i = 0; i < NUM_DIRECTIONS; i++) + { + int xx = x + xy[i][0]; + int yy = y + xy[i][1]; + + if (last_x == xx && last_y == yy && IN_LEV_FIELD(last_x, last_y) && + IS_IN_GROUP_EL(IntelliDrawBuffer[last_x][last_y], new_element)) + connected_drawing = TRUE; + } + + if (!connected_drawing) + ResolveGroupElement(new_element); + + new_element = GetElementFromGroupElement(new_element); + } + else if (IS_BELT_SWITCH(old_element)) + { + int belt_nr = getBeltNrFromBeltSwitchElement(old_element); + int belt_dir = getBeltDirFromBeltSwitchElement(old_element); + + belt_dir = (belt_dir == MV_LEFT ? MV_NONE : + belt_dir == MV_NONE ? MV_RIGHT : MV_LEFT); + + new_element = getBeltSwitchElementFromBeltNrAndBeltDir(belt_nr, belt_dir); + } + else + { + static int swappable_elements[][2] = + { + { EL_EXIT_CLOSED, EL_EXIT_OPEN }, + { EL_DYNAMITE, EL_DYNAMITE_ACTIVE }, + { EL_EM_DYNAMITE, EL_EM_DYNAMITE_ACTIVE }, + { EL_QUICKSAND_EMPTY, EL_QUICKSAND_FULL }, + { EL_EMERALD, EL_WALL_EMERALD }, + { EL_EMERALD_YELLOW, EL_WALL_EMERALD_YELLOW }, + { EL_EMERALD_RED, EL_WALL_EMERALD_RED }, + { EL_EMERALD_PURPLE, EL_WALL_EMERALD_PURPLE }, + { EL_DIAMOND, EL_WALL_DIAMOND }, + { EL_BD_DIAMOND, EL_WALL_BD_DIAMOND }, + { EL_GATE_1, EL_GATE_1_GRAY }, + { EL_GATE_2, EL_GATE_2_GRAY }, + { EL_GATE_3, EL_GATE_3_GRAY }, + { EL_GATE_4, EL_GATE_4_GRAY }, + { EL_EM_GATE_1, EL_EM_GATE_1_GRAY }, + { EL_EM_GATE_2, EL_EM_GATE_2_GRAY }, + { EL_EM_GATE_3, EL_EM_GATE_3_GRAY }, + { EL_EM_GATE_4, EL_EM_GATE_4_GRAY }, + { EL_EMC_GATE_5, EL_EMC_GATE_5_GRAY }, + { EL_EMC_GATE_6, EL_EMC_GATE_6_GRAY }, + { EL_EMC_GATE_7, EL_EMC_GATE_7_GRAY }, + { EL_EMC_GATE_8, EL_EMC_GATE_8_GRAY }, + { EL_DC_GATE_WHITE, EL_DC_GATE_WHITE_GRAY }, + { EL_TIME_ORB_EMPTY, EL_TIME_ORB_FULL }, + { EL_LAMP, EL_LAMP_ACTIVE }, + { EL_SOKOBAN_FIELD_EMPTY, EL_SOKOBAN_FIELD_FULL }, + { EL_SP_BASE, EL_SP_BUGGY_BASE }, + { EL_PEARL, EL_WALL_PEARL }, + { EL_CRYSTAL, EL_WALL_CRYSTAL }, + { EL_TIMEGATE_CLOSED, EL_TIMEGATE_OPEN }, + { EL_SWITCHGATE_CLOSED, EL_SWITCHGATE_OPEN }, + { EL_SWITCHGATE_SWITCH_UP, EL_SWITCHGATE_SWITCH_DOWN }, + { EL_DC_SWITCHGATE_SWITCH_UP, EL_DC_SWITCHGATE_SWITCH_DOWN }, + { EL_LIGHT_SWITCH, EL_LIGHT_SWITCH_ACTIVE }, + { EL_LANDMINE, EL_DC_LANDMINE }, + { EL_SHIELD_NORMAL, EL_SHIELD_DEADLY }, + { EL_STEEL_EXIT_CLOSED, EL_STEEL_EXIT_OPEN }, + { EL_EM_EXIT_CLOSED, EL_EM_EXIT_OPEN }, + { EL_EM_STEEL_EXIT_CLOSED, EL_EM_STEEL_EXIT_OPEN }, + { EL_QUICKSAND_FAST_EMPTY, EL_QUICKSAND_FAST_FULL }, + + { -1, -1 }, + }; + static int rotatable_elements[][4] = + { + { + EL_BUG_UP, + EL_BUG_RIGHT, + EL_BUG_DOWN, + EL_BUG_LEFT + }, + + { + EL_SPACESHIP_UP, + EL_SPACESHIP_RIGHT, + EL_SPACESHIP_DOWN, + EL_SPACESHIP_LEFT + }, + + { + EL_BD_BUTTERFLY_UP, + EL_BD_BUTTERFLY_RIGHT, + EL_BD_BUTTERFLY_DOWN, + EL_BD_BUTTERFLY_LEFT + }, + + { + EL_BD_FIREFLY_UP, + EL_BD_FIREFLY_RIGHT, + EL_BD_FIREFLY_DOWN, + EL_BD_FIREFLY_LEFT + }, + + { + EL_PACMAN_UP, + EL_PACMAN_RIGHT, + EL_PACMAN_DOWN, + EL_PACMAN_LEFT + }, + + { + EL_YAMYAM_UP, + EL_YAMYAM_RIGHT, + EL_YAMYAM_DOWN, + EL_YAMYAM_LEFT + }, + + { + EL_ARROW_UP, + EL_ARROW_RIGHT, + EL_ARROW_DOWN, + EL_ARROW_LEFT + }, + + { + EL_SP_PORT_UP, + EL_SP_PORT_RIGHT, + EL_SP_PORT_DOWN, + EL_SP_PORT_LEFT + }, + + { + EL_SP_GRAVITY_PORT_UP, + EL_SP_GRAVITY_PORT_RIGHT, + EL_SP_GRAVITY_PORT_DOWN, + EL_SP_GRAVITY_PORT_LEFT + }, + + { + EL_MOLE_UP, + EL_MOLE_RIGHT, + EL_MOLE_DOWN, + EL_MOLE_LEFT + }, + + { + EL_BALLOON_SWITCH_UP, + EL_BALLOON_SWITCH_RIGHT, + EL_BALLOON_SWITCH_DOWN, + EL_BALLOON_SWITCH_LEFT + }, + + { + EL_SP_GRAVITY_ON_PORT_UP, + EL_SP_GRAVITY_ON_PORT_RIGHT, + EL_SP_GRAVITY_ON_PORT_DOWN, + EL_SP_GRAVITY_ON_PORT_LEFT + }, + + { + EL_SP_GRAVITY_OFF_PORT_UP, + EL_SP_GRAVITY_OFF_PORT_RIGHT, + EL_SP_GRAVITY_OFF_PORT_DOWN, + EL_SP_GRAVITY_OFF_PORT_LEFT + }, + + { + -1, + -1, + -1, + -1, + }, + }; + int i, j; + + for (i = 0; swappable_elements[i][0] != -1; i++) + { + int element1 = swappable_elements[i][0]; + int element2 = swappable_elements[i][1]; + + if (old_element == element1 || old_element == element2) + new_element = (old_element == element1 ? element2 : element1); + } + + for (i = 0; rotatable_elements[i][0] != -1; i++) + { + for (j = 0; j < 4; j++) + { + int element = rotatable_elements[i][j]; + + if (old_element == element) + new_element = (button == 1 ? rotatable_elements[i][(j + 3) % 4] : + button == 2 ? rotatable_elements[i][0] : + button == 3 ? rotatable_elements[i][(j + 1) % 4] : + old_element); + } + } + } + + SetElementSimple(x, y, new_element, change_level); + + last_x = x; + last_y = y; +} + +static void ResetIntelliDraw() +{ + int x, y; + + for (x = 0; x < lev_fieldx; x++) + for (y = 0; y < lev_fieldy; y++) + IntelliDrawBuffer[x][y] = Feld[x][y]; + + SetElementIntelliDraw(-1, -1, EL_UNDEFINED, FALSE, -1); +} + +static void SetElementExt(int x, int y, int element, boolean change_level, + int button) +{ + if (element < 0) + SetElementSimple(x, y, Feld[x][y], change_level); + else if (GetKeyModState() & KMOD_Shift) + SetElementIntelliDraw(x, y, element, change_level, button); + else + SetElementSimple(x, y, element, change_level); +} + +static void SetElement(int x, int y, int element) +{ + SetElementExt(x, y, element, TRUE, -1); +} + +static void SetElementButton(int x, int y, int element, int button) +{ + SetElementExt(x, y, element, TRUE, button); +} + +static void DrawLineElement(int sx, int sy, int element, boolean change_level) +{ + int lx = sx + level_xpos; + int ly = sy + level_ypos; + + SetElementExt(lx, ly, element, change_level, -1); +} + +static void DrawLine(int from_x, int from_y, int to_x, int to_y, + int element, boolean change_level) +{ + int xsize = ABS(to_x - from_x); + int ysize = ABS(to_y - from_y); + int dx = (to_x < from_x ? -1 : +1); + int dy = (to_y < from_y ? -1 : +1); + int i; + + if (from_y == to_y) /* horizontal line */ + { + for (i = 0; i <= xsize; i++) + DrawLineElement(from_x + i * dx, from_y, element, change_level); + } + else if (from_x == to_x) /* vertical line */ + { + for (i = 0; i <= ysize; i++) + DrawLineElement(from_x, from_y + i * dy, element, change_level); + } + else /* diagonal line */ + { + if (ysize < xsize) /* a < 1 */ + { + float a = (float)ysize / (float)xsize; + + for (i = 0; i <= xsize; i++) + { + int x = dx * i; + int y = dy * (int)(a * i + 0.5); + + DrawLineElement(from_x + x, from_y + y, element, change_level); + } + } + else /* a >= 1 */ + { + float a = (float)xsize / (float)ysize; + + for (i = 0; i <= ysize; i++) + { + int x = dx * (int)(a * i + 0.5); + int y = dy * i; + + DrawLineElement(from_x + x, from_y + y, element, change_level); + } + } + } +} + +static void DrawBox(int from_x, int from_y, int to_x, int to_y, + int element, boolean change_level) +{ + DrawLine(from_x, from_y, from_x, to_y, element, change_level); + DrawLine(from_x, to_y, to_x, to_y, element, change_level); + DrawLine(to_x, to_y, to_x, from_y, element, change_level); + DrawLine(to_x, from_y, from_x, from_y, element, change_level); +} + +static void DrawFilledBox(int from_x, int from_y, int to_x, int to_y, + int element, boolean change_level) +{ + int y; + + if (from_y > to_y) + swap_number_pairs(&from_x, &from_y, &to_x, &to_y); + + for (y = from_y; y <= to_y; y++) + DrawLine(from_x, y, to_x, y, element, change_level); +} + +static void DrawArcExt(int from_x, int from_y, int to_x2, int to_y2, + int element, boolean change_level) +{ + int to_x = to_x2 - (to_x2 > from_x ? +1 : -1); + int to_y = to_y2 - (to_y2 > from_y ? +1 : -1); + int len_x = ABS(to_x - from_x); + int len_y = ABS(to_y - from_y); + int radius, x, y; + + radius = (int)(sqrt((float)(len_x * len_x + len_y * len_y)) + 0.5); + + /* not optimal (some points get drawn twice) but simple, + and fast enough for the few points we are drawing */ + + for (x = 0; x <= radius; x++) + { + int sx, sy, lx, ly; + + y = (int)(sqrt((float)(radius * radius - x * x)) + 0.5); + + sx = from_x + x * (from_x < to_x2 ? +1 : -1); + sy = from_y + y * (from_y < to_y2 ? +1 : -1); + lx = sx + level_xpos; + ly = sy + level_ypos; + + if (IN_ED_FIELD(sx, sy) && IN_LEV_FIELD(lx, ly)) + DrawLineElement(sx, sy, element, change_level); + } + + for (y = 0; y <= radius; y++) + { + int sx, sy, lx, ly; + + x = (int)(sqrt((float)(radius * radius - y * y)) + 0.5); + + sx = from_x + x * (from_x < to_x2 ? +1 : -1); + sy = from_y + y * (from_y < to_y2 ? +1 : -1); + lx = sx + level_xpos; + ly = sy + level_ypos; + + if (IN_ED_FIELD(sx, sy) && IN_LEV_FIELD(lx, ly)) + DrawLineElement(sx, sy, element, change_level); + } +} + +static void DrawArc(int from_x, int from_y, int to_x, int to_y, + int element, boolean change_level) +{ + int to_x2 = to_x + (to_x < from_x ? -1 : +1); + int to_y2 = to_y + (to_y > from_y ? +1 : -1); + + DrawArcExt(from_x, from_y, to_x2, to_y2, element, change_level); +} + +#define DRAW_CIRCLES_BUTTON_AVAILABLE 0 + +#if DRAW_CIRCLES_BUTTON_AVAILABLE +static void DrawCircle(int from_x, int from_y, int to_x, int to_y, + int element, boolean change_level) { int to_x2 = to_x + (to_x < from_x ? -1 : +1); int to_y2 = to_y + (to_y > from_y ? +1 : -1); @@ -8330,7 +9605,7 @@ static void CopyBrushExt(int from_x, int from_y, int to_x, int to_y, for (y = 0; y < brush_height; y++) { - for (x=0; x < brush_width; x++) + for (x = 0; x < brush_width; x++) { brush_buffer[x][y] = Feld[from_lx + x][from_ly + y]; @@ -8435,33 +9710,7 @@ void DumpBrush_Small() static void FloodFill(int from_x, int from_y, int fill_element) { - int i,x,y; - int old_element; - static int check[4][2] = { {-1,0}, {0,-1}, {1,0}, {0,1} }; - static int safety = 0; - - /* check if starting field still has the desired content */ - if (Feld[from_x][from_y] == fill_element) - return; - - safety++; - - if (safety > lev_fieldx*lev_fieldy) - Error(ERR_EXIT, "Something went wrong in 'FloodFill()'. Please debug."); - - old_element = Feld[from_x][from_y]; - Feld[from_x][from_y] = fill_element; - - for (i = 0; i < 4; i++) - { - x = from_x + check[i][0]; - y = from_y + check[i][1]; - - if (IN_LEV_FIELD(x,y) && Feld[x][y] == old_element) - FloodFill(x, y, fill_element); - } - - safety--; + FloodFillLevel(from_x, from_y, fill_element, Feld, lev_fieldx, lev_fieldy); } /* values for DrawLevelText() modes */ @@ -8649,6 +9898,10 @@ static void RandomPlacement(int new_element) int num_percentage, num_elements; int x, y; +#if 1 + ResetIntelliDraw(); +#endif + /* determine number of free positions for randomly placing the new element */ for (x = 0; x < lev_fieldx; x++) for (y = 0; y < lev_fieldy; y++) { @@ -8672,20 +9925,28 @@ static void RandomPlacement(int new_element) for (x = 0; x < lev_fieldx; x++) for (y = 0; y < lev_fieldy; y++) if (free_position[x][y]) +#if 1 + SetElement(x, y, new_element); +#else Feld[x][y] = new_element; +#endif } else { while (num_elements > 0) { - x = RND(lev_fieldx); - y = RND(lev_fieldy); + x = GetSimpleRandom(lev_fieldx); + y = GetSimpleRandom(lev_fieldy); /* don't place element at the same position twice */ if (free_position[x][y]) { free_position[x][y] = FALSE; +#if 1 + SetElement(x, y, new_element); +#else Feld[x][y] = new_element; +#endif num_elements--; } } @@ -8786,6 +10047,12 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) actual_drawing_function = GADGET_ID_PICK_ELEMENT; } + if (GetKeyModState() & KMOD_Shift) + { + if (button_press_event || button_release_event) + ResetIntelliDraw(); + } + switch (actual_drawing_function) { case GADGET_ID_SINGLE_ITEMS: @@ -8798,17 +10065,27 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) if (edit_mode == ED_MODE_DRAWING && draw_with_brush && !inside_drawing_area) DeleteBrushFromCursor(); + +#if 0 + ResetIntelliDraw(); +#endif } - if (!button) + if (!button || button_release_event) break; if (draw_with_brush) { +#if 0 if (!button_release_event) +#endif CopyBrushToLevel(sx, sy, button); } +#if 1 + else +#else else if (new_element != Feld[lx][ly]) +#endif { if (new_element == EL_PLAYER_1) { @@ -8819,18 +10096,30 @@ static void HandleDrawingAreas(struct GadgetInfo *gi) { if (Feld[x][y] == EL_PLAYER_1) { +#if 1 + SetElement(x, y, EL_EMPTY); +#else Feld[x][y] = EL_EMPTY; +#if 1 + if (IN_ED_FIELD(x - level_xpos, y - level_ypos)) + DrawMiniElement(x - level_xpos, y - level_ypos, EL_EMPTY); +#else if (x - level_xpos >= 0 && x - level_xpos < ed_fieldx && y - level_ypos >= 0 && y - level_ypos < ed_fieldy) - DrawMiniElement(x - level_xpos, y - level_ypos, - EL_EMPTY); + DrawMiniElement(x - level_xpos, y - level_ypos, EL_EMPTY); +#endif +#endif } } } } +#if 1 + SetElementButton(lx, ly, new_element, button); +#else Feld[lx][ly] = new_element; DrawMiniElement(sx, sy, new_element); +#endif } } else @@ -9609,7 +10898,7 @@ static void HandleControlButtons(struct GadgetInfo *gi) break; case GADGET_ID_EXIT: - RequestExitLevelEditor(TRUE); /* if level has changed, ask user */ + RequestExitLevelEditor(TRUE, FALSE); /* if level has changed, ask user */ break; default: @@ -9788,7 +11077,7 @@ void HandleLevelEditorKeyInput(Key key) case KSYM_Escape: if (edit_mode == ED_MODE_DRAWING) { - RequestExitLevelEditor(setup.ask_on_escape_editor); + RequestExitLevelEditor(setup.ask_on_escape_editor, TRUE); } else if (edit_mode == ED_MODE_INFO) { @@ -10059,7 +11348,8 @@ static void HandleDrawingAreaInfo(struct GadgetInfo *gi) DrawTextS(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FONT_TEXT_2, infotext); } -void RequestExitLevelEditor(boolean ask_if_level_has_changed) +void RequestExitLevelEditor(boolean ask_if_level_has_changed, + boolean quick_quit) { if (!ask_if_level_has_changed || !LevelChanged() || @@ -10068,8 +11358,21 @@ void RequestExitLevelEditor(boolean ask_if_level_has_changed) { CloseDoor(DOOR_CLOSE_1); SetDoorState(DOOR_CLOSE_2); + +#if 1 + if (quick_quit) + FadeSkipNextFadeIn(); +#else + if (quick_quit) + fading = fading_none; +#endif + game_status = GAME_MODE_MAIN; +#if 1 + DrawAndFadeInMainMenu(REDRAW_FIELD); +#else DrawMainMenu(); +#endif } else { diff --git a/src/editor.h b/src/editor.h index 245e0566..717c07a0 100644 --- a/src/editor.h +++ b/src/editor.h @@ -23,7 +23,7 @@ void DrawLevelEd(void); void HandleLevelEditorKeyInput(Key); void HandleLevelEditorIdle(); void HandleEditorGadgetInfoText(void *ptr); -void RequestExitLevelEditor(boolean); +void RequestExitLevelEditor(boolean, boolean); void PrintEditorElementList(); void DumpBrush(); diff --git a/src/engines.h b/src/engines.h index 4f894e92..156a6398 100644 --- a/src/engines.h +++ b/src/engines.h @@ -15,6 +15,7 @@ #define ENGINES_H #include "libgame/libgame.h" +#include "game_em/export.h" /* ========================================================================= */ @@ -33,4 +34,8 @@ extern int getGameFrameDelay_EM(int); extern void PlayLevelSound_EM(int, int, int, int); extern void InitGraphicInfo_EM(void); +void SetGfxAnimation_EM(struct GraphicInfo_EM *, int, int, int, int); +void getGraphicSourceObjectExt_EM(struct GraphicInfo_EM *, int, int, int, int); +void getGraphicSourcePlayerExt_EM(struct GraphicInfo_EM *, int, int, int); + #endif /* ENGINES_H */ diff --git a/src/events.c b/src/events.c index 7ea4356b..811d8f9a 100644 --- a/src/events.c +++ b/src/events.c @@ -717,9 +717,8 @@ void HandleKey(Key key, int key_status) return; } -#if 1 - if (game_status == GAME_MODE_PLAYING && - local_player->LevelSolved_GameEnd && +#if 0 + if (game_status == GAME_MODE_PLAYING && local_player->LevelSolved_GameEnd && (key == KSYM_Return || key == setup.shortcut.toggle_pause)) #else if (game_status == GAME_MODE_PLAYING && AllPlayersGone && @@ -812,6 +811,9 @@ void HandleKey(Key key, int key_status) break; case KSYM_Escape: + if (game_status != GAME_MODE_MAIN) + FadeSkipNextFadeIn(); + if (game_status == GAME_MODE_TITLE) HandleTitleScreen(0, 0, 0, 0, MB_MENU_LEAVE); else if (game_status == GAME_MODE_LEVELS) @@ -1068,7 +1070,7 @@ void HandleJoystick() if (tape.playing || keyboard) newbutton = ((joy & JOY_BUTTON) != 0); -#if 1 +#if 0 if (local_player->LevelSolved_GameEnd && newbutton) #else if (AllPlayersGone && newbutton) diff --git a/src/files.c b/src/files.c index 55645441..48fb5865 100644 --- a/src/files.c +++ b/src/files.c @@ -264,6 +264,11 @@ static struct LevelFileConfigInfo chunk_config_ELEM[] = TYPE_BOOLEAN, CONF_VALUE_8_BIT(6), &li.continuous_snapping, TRUE }, + { + EL_PLAYER_1, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(12), + &li.shifted_relocation, FALSE + }, /* (these values are different for each player) */ { @@ -739,6 +744,17 @@ static struct LevelFileConfigInfo chunk_config_NOTE[] = &xx_envelope.ysize, MAX_ENVELOPE_YSIZE, }, + { + -1, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(3), + &xx_envelope.autowrap, FALSE + }, + { + -1, -1, + TYPE_BOOLEAN, CONF_VALUE_8_BIT(4), + &xx_envelope.centered, FALSE + }, + { -1, -1, TYPE_STRING, CONF_VALUE_BYTES(1), @@ -1677,6 +1693,11 @@ static int getFileTypeFromBasename(char *basename) strncmp(basename, "LEVELS.D", 8) == 0)) return LEVEL_FILE_TYPE_SP; + /* check for typical filename of a Diamond Caves II level package file */ + if (strSuffix(basename, ".dc") || + strSuffix(basename, ".dc2")) + return LEVEL_FILE_TYPE_DC; + /* ---------- try to determine file type from filesize ---------- */ checked_free(filename); @@ -3910,7 +3931,7 @@ static void LoadLevelFromFileInfo_SP(struct LevelInfo *level, { level->no_valid_file = TRUE; - Error(ERR_WARN, "cannot fseek level '%s' -- using empty level", filename); + Error(ERR_WARN, "cannot fseek in file '%s' -- using empty level", filename); return; } @@ -3945,7 +3966,7 @@ static void LoadLevelFromFileInfo_SP(struct LevelInfo *level, level->name[i] = '-'; /* correct trailing multipart level meta information in level name */ - for (i = SP_LEVEL_NAME_LEN - 1; i>=0 && level->name[i] == name_last; i--) + for (i = SP_LEVEL_NAME_LEN - 1; i >= 0 && level->name[i] == name_last; i--) level->name[i] = '-'; /* ---------- check for normal single level ---------- */ @@ -4060,263 +4081,2241 @@ static void LoadLevelFromFileInfo_SP(struct LevelInfo *level, *level = multipart_level; } -/* ------------------------------------------------------------------------- */ -/* functions for loading generic level */ -/* ------------------------------------------------------------------------- */ -void LoadLevelFromFileInfo(struct LevelInfo *level, - struct LevelFileInfo *level_file_info) +#define DC_LEVEL_HEADER_SIZE 344 + +unsigned short getDecodedWord_DC(unsigned short data_encoded, boolean init) { - /* always start with reliable default values */ - setLevelInfoToDefaults(level); + static int last_data_encoded; + static int offset1; + static int offset2; + int diff; + int diff_hi, diff_lo; + int data_hi, data_lo; + unsigned short data_decoded; - switch (level_file_info->type) + if (init) { - case LEVEL_FILE_TYPE_RND: - LoadLevelFromFileInfo_RND(level, level_file_info); - break; - - case LEVEL_FILE_TYPE_EM: - LoadLevelFromFileInfo_EM(level, level_file_info); - level->game_engine_type = GAME_ENGINE_TYPE_EM; - break; - - case LEVEL_FILE_TYPE_SP: - LoadLevelFromFileInfo_SP(level, level_file_info); - break; + last_data_encoded = 0; + offset1 = -1; + offset2 = 0; - default: - LoadLevelFromFileInfo_RND(level, level_file_info); - break; + return 0; } - /* if level file is invalid, restore level structure to default values */ - if (level->no_valid_file) - setLevelInfoToDefaults(level); + diff = data_encoded - last_data_encoded; + diff_hi = diff & ~0xff; + diff_lo = diff & 0xff; - if (level->game_engine_type == GAME_ENGINE_TYPE_UNKNOWN) - level->game_engine_type = GAME_ENGINE_TYPE_RND; + offset2 += diff_lo; - if (level_file_info->type != LEVEL_FILE_TYPE_RND) - CopyNativeLevel_Native_to_RND(level); -} + data_hi = diff_hi - (offset1 << 8) + (offset2 & 0xff00); + data_lo = (diff_lo + (data_hi >> 16)) & 0x00ff; + data_hi = data_hi & 0xff00; -void LoadLevelFromFilename(struct LevelInfo *level, char *filename) -{ - static struct LevelFileInfo level_file_info; + data_decoded = data_hi | data_lo; - /* always start with reliable default values */ - setFileInfoToDefaults(&level_file_info); + last_data_encoded = data_encoded; - level_file_info.nr = 0; /* unknown level number */ - level_file_info.type = LEVEL_FILE_TYPE_RND; /* no others supported yet */ - level_file_info.filename = filename; + offset1 = (offset1 + 1) % 31; + offset2 = offset2 & 0xff; - LoadLevelFromFileInfo(level, &level_file_info); + return data_decoded; } -static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) +int getMappedElement_DC(int element) { - int i, j; + switch (element) + { + case 0x0000: + element = EL_ROCK; + break; - if (leveldir_current == NULL) /* only when dumping level */ - return; + /* 0x0117 - 0x036e: (?) */ + /* EL_DIAMOND */ - /* all engine modifications also valid for levels which use latest engine */ - if (level->game_version < VERSION_IDENT(3,2,0,5)) - { - /* time bonus score was given for 10 s instead of 1 s before 3.2.0-5 */ - level->score[SC_TIME_BONUS] /= 10; - } + /* 0x042d - 0x0684: (?) */ + /* EL_EMERALD */ -#if 0 - leveldir_current->latest_engine = TRUE; /* !!! TEST ONLY !!! */ -#endif + case 0x06f1: + element = EL_NUT; + break; - if (leveldir_current->latest_engine) - { - /* ---------- use latest game engine ----------------------------------- */ + case 0x074c: + element = EL_BOMB; + break; - /* For all levels which are forced to use the latest game engine version - (normally all but user contributed, private and undefined levels), set - the game engine version to the actual version; this allows for actual - corrections in the game engine to take effect for existing, converted - levels (from "classic" or other existing games) to make the emulation - of the corresponding game more accurate, while (hopefully) not breaking - existing levels created from other players. */ + case 0x07a4: + element = EL_PEARL; + break; - level->game_version = GAME_VERSION_ACTUAL; + case 0x0823: + element = EL_CRYSTAL; + break; - /* Set special EM style gems behaviour: EM style gems slip down from - normal, steel and growing wall. As this is a more fundamental change, - it seems better to set the default behaviour to "off" (as it is more - natural) and make it configurable in the level editor (as a property - of gem style elements). Already existing converted levels (neither - private nor contributed levels) are changed to the new behaviour. */ + case 0x0e77: /* quicksand (boulder) */ + element = EL_QUICKSAND_FAST_FULL; + break; - if (level->file_version < FILE_VERSION_2_0) - level->em_slippery_gems = TRUE; + case 0x0e99: /* slow quicksand (boulder) */ + element = EL_QUICKSAND_FULL; + break; - return; - } + case 0x0ed2: + element = EL_EM_EXIT_OPEN; + break; - /* ---------- use game engine the level was created with ----------------- */ + case 0x0ee3: + element = EL_EM_EXIT_CLOSED; + break; - /* For all levels which are not forced to use the latest game engine - version (normally user contributed, private and undefined levels), - use the version of the game engine the levels were created for. + case 0x0eeb: + element = EL_EM_STEEL_EXIT_OPEN; + break; - Since 2.0.1, the game engine version is now directly stored - in the level file (chunk "VERS"), so there is no need anymore - to set the game version from the file version (except for old, - pre-2.0 levels, where the game version is still taken from the - file format version used to store the level -- see above). */ + case 0x0efc: + element = EL_EM_STEEL_EXIT_CLOSED; + break; - /* player was faster than enemies in 1.0.0 and before */ - if (level->file_version == FILE_VERSION_1_0) - for (i = 0; i < MAX_PLAYERS; i++) - level->initial_player_stepsize[i] = STEPSIZE_FAST; + case 0x0f4f: /* dynamite (lit 1) */ + element = EL_EM_DYNAMITE_ACTIVE; + break; - /* default behaviour for EM style gems was "slippery" only in 2.0.1 */ - if (level->game_version == VERSION_IDENT(2,0,1,0)) - level->em_slippery_gems = TRUE; + case 0x0f57: /* dynamite (lit 2) */ + element = EL_EM_DYNAMITE_ACTIVE; + break; - /* springs could be pushed over pits before (pre-release version) 2.2.0 */ - if (level->game_version < VERSION_IDENT(2,2,0,0)) - level->use_spring_bug = TRUE; + case 0x0f5f: /* dynamite (lit 3) */ + element = EL_EM_DYNAMITE_ACTIVE; + break; - if (level->game_version < VERSION_IDENT(3,2,0,5)) - { - /* time orb caused limited time in endless time levels before 3.2.0-5 */ - level->use_time_orb_bug = TRUE; + case 0x0f67: /* dynamite (lit 4) */ + element = EL_EM_DYNAMITE_ACTIVE; + break; - /* default behaviour for snapping was "no snap delay" before 3.2.0-5 */ - level->block_snap_field = FALSE; + case 0x0f81: + case 0x0f82: + case 0x0f83: + case 0x0f84: + element = EL_AMOEBA_WET; + break; - /* extra time score was same value as time left score before 3.2.0-5 */ - level->extra_time_score = level->score[SC_TIME_BONUS]; + case 0x0f85: + element = EL_AMOEBA_DROP; + break; -#if 0 - /* time bonus score was given for 10 s instead of 1 s before 3.2.0-5 */ - level->score[SC_TIME_BONUS] /= 10; -#endif - } + case 0x0fb9: + element = EL_DC_MAGIC_WALL; + break; - if (level->game_version < VERSION_IDENT(3,2,0,7)) - { - /* default behaviour for snapping was "not continuous" before 3.2.0-7 */ - level->continuous_snapping = FALSE; - } + case 0x0fd0: + element = EL_SPACESHIP_UP; + break; - /* only few elements were able to actively move into acid before 3.1.0 */ - /* trigger settings did not exist before 3.1.0; set to default "any" */ - if (level->game_version < VERSION_IDENT(3,1,0,0)) - { - /* correct "can move into acid" settings (all zero in old levels) */ + case 0x0fd9: + element = EL_SPACESHIP_DOWN; + break; - level->can_move_into_acid_bits = 0; /* nothing can move into acid */ - level->dont_collide_with_bits = 0; /* nothing is deadly when colliding */ + case 0x0ff1: + element = EL_SPACESHIP_LEFT; + break; - setMoveIntoAcidProperty(level, EL_ROBOT, TRUE); - setMoveIntoAcidProperty(level, EL_SATELLITE, TRUE); - setMoveIntoAcidProperty(level, EL_PENGUIN, TRUE); - setMoveIntoAcidProperty(level, EL_BALLOON, TRUE); + case 0x0ff9: + element = EL_SPACESHIP_RIGHT; + break; - for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) - SET_PROPERTY(EL_CUSTOM_START + i, EP_CAN_MOVE_INTO_ACID, TRUE); + case 0x1057: + element = EL_BUG_UP; + break; - /* correct trigger settings (stored as zero == "none" in old levels) */ + case 0x1060: + element = EL_BUG_DOWN; + break; - for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) - { - int element = EL_CUSTOM_START + i; - struct ElementInfo *ei = &element_info[element]; + case 0x1078: + element = EL_BUG_LEFT; + break; - for (j = 0; j < ei->num_change_pages; j++) - { - struct ElementChangeInfo *change = &ei->change_page[j]; + case 0x1080: + element = EL_BUG_RIGHT; + break; - change->trigger_player = CH_PLAYER_ANY; - change->trigger_page = CH_PAGE_ANY; - } - } - } + case 0x10de: + element = EL_MOLE_UP; + break; - /* try to detect and fix "Snake Bite" levels, which are broken with 3.2.0 */ - { - int element = EL_CUSTOM_START + 255; - struct ElementInfo *ei = &element_info[element]; - struct ElementChangeInfo *change = &ei->change_page[0]; + case 0x10e7: + element = EL_MOLE_DOWN; + break; - /* This is needed to fix a problem that was caused by a bugfix in function - game.c/CreateFieldExt() introduced with 3.2.0 that corrects the behaviour - when a custom element changes to EL_SOKOBAN_FIELD_PLAYER (before, it did - not replace walkable elements, but instead just placed the player on it, - without placing the Sokoban field under the player). Unfortunately, this - breaks "Snake Bite" style levels when the snake is halfway through a door - that just closes (the snake head is still alive and can be moved in this - case). This can be fixed by replacing the EL_SOKOBAN_FIELD_PLAYER by the - player (without Sokoban element) which then gets killed as designed). */ + case 0x10ff: + element = EL_MOLE_LEFT; + break; - if ((strncmp(leveldir_current->identifier, "snake_bite", 10) == 0 || - strncmp(ei->description, "pause b4 death", 14) == 0) && - change->target_element == EL_SOKOBAN_FIELD_PLAYER) - change->target_element = EL_PLAYER_1; - } -} + case 0x1107: + element = EL_MOLE_RIGHT; + break; -static void LoadLevel_InitElements(struct LevelInfo *level, char *filename) -{ - int i, j, x, y; + case 0x11c0: + element = EL_ROBOT; + break; - /* map custom element change events that have changed in newer versions - (these following values were accidentally changed in version 3.0.1) - (this seems to be needed only for 'ab_levelset3' and 'ab_levelset4') */ - if (level->game_version <= VERSION_IDENT(3,0,0,0)) - { - for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) - { - int element = EL_CUSTOM_START + i; + case 0x13f5: + element = EL_YAMYAM; + break; - /* order of checking and copying events to be mapped is important */ - /* (do not change the start and end value -- they are constant) */ - for (j = CE_BY_OTHER_ACTION; j >= CE_VALUE_GETS_ZERO; j--) - { - if (HAS_CHANGE_EVENT(element, j - 2)) - { - SET_CHANGE_EVENT(element, j - 2, FALSE); - SET_CHANGE_EVENT(element, j, TRUE); - } - } + case 0x1425: + element = EL_SWITCHGATE_OPEN; + break; - /* order of checking and copying events to be mapped is important */ - /* (do not change the start and end value -- they are constant) */ - for (j = CE_PLAYER_COLLECTS_X; j >= CE_HITTING_SOMETHING; j--) - { - if (HAS_CHANGE_EVENT(element, j - 1)) - { - SET_CHANGE_EVENT(element, j - 1, FALSE); - SET_CHANGE_EVENT(element, j, TRUE); - } - } - } - } + case 0x1426: + element = EL_SWITCHGATE_CLOSED; + break; - /* initialize "can_change" field for old levels with only one change page */ - if (level->game_version <= VERSION_IDENT(3,0,2,0)) - { - for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) - { - int element = EL_CUSTOM_START + i; + case 0x1437: + element = EL_DC_SWITCHGATE_SWITCH_UP; + break; - if (CAN_CHANGE(element)) - element_info[element].change->can_change = TRUE; - } - } + case 0x143a: + element = EL_TIMEGATE_CLOSED; + break; - /* correct custom element values (for old levels without these options) */ - if (level->game_version < VERSION_IDENT(3,1,1,0)) - { + case 0x144c: /* conveyor belt switch (green) */ + element = EL_CONVEYOR_BELT_3_SWITCH_MIDDLE; + break; + + case 0x144f: /* conveyor belt switch (red) */ + element = EL_CONVEYOR_BELT_1_SWITCH_MIDDLE; + break; + + case 0x1452: /* conveyor belt switch (blue) */ + element = EL_CONVEYOR_BELT_4_SWITCH_MIDDLE; + break; + + case 0x145b: + element = EL_CONVEYOR_BELT_3_MIDDLE; + break; + + case 0x1463: + element = EL_CONVEYOR_BELT_3_LEFT; + break; + + case 0x146b: + element = EL_CONVEYOR_BELT_3_RIGHT; + break; + + case 0x1473: + element = EL_CONVEYOR_BELT_1_MIDDLE; + break; + + case 0x147b: + element = EL_CONVEYOR_BELT_1_LEFT; + break; + + case 0x1483: + element = EL_CONVEYOR_BELT_1_RIGHT; + break; + + case 0x148b: + element = EL_CONVEYOR_BELT_4_MIDDLE; + break; + + case 0x1493: + element = EL_CONVEYOR_BELT_4_LEFT; + break; + + case 0x149b: + element = EL_CONVEYOR_BELT_4_RIGHT; + break; + + case 0x14ac: + element = EL_EXPANDABLE_WALL_HORIZONTAL; + break; + + case 0x14bd: + element = EL_EXPANDABLE_WALL_VERTICAL; + break; + + case 0x14c6: + element = EL_EXPANDABLE_WALL_ANY; + break; + + case 0x14ce: /* growing steel wall (left/right) */ + element = EL_EXPANDABLE_STEELWALL_HORIZONTAL; + break; + + case 0x14df: /* growing steel wall (up/down) */ + element = EL_EXPANDABLE_STEELWALL_VERTICAL; + break; + + case 0x14e8: /* growing steel wall (up/down/left/right) */ + element = EL_EXPANDABLE_STEELWALL_ANY; + break; + + case 0x14e9: + element = EL_SHIELD_DEADLY; + break; + + case 0x1501: + element = EL_EXTRA_TIME; + break; + + case 0x154f: + element = EL_ACID; + break; + + case 0x1577: + element = EL_EMPTY_SPACE; + break; + + case 0x1578: /* quicksand (empty) */ + element = EL_QUICKSAND_FAST_EMPTY; + break; + + case 0x1579: /* slow quicksand (empty) */ + element = EL_QUICKSAND_EMPTY; + break; + + /* 0x157c - 0x158b: */ + /* EL_SAND */ + + /* 0x1590 - 0x159f: */ + /* EL_DC_LANDMINE */ + + case 0x15a0: + element = EL_EM_DYNAMITE; + break; + + case 0x15a1: /* key (red) */ + element = EL_EM_KEY_1; + break; + + case 0x15a2: /* key (yellow) */ + element = EL_EM_KEY_2; + break; + + case 0x15a3: /* key (blue) */ + element = EL_EM_KEY_4; + break; + + case 0x15a4: /* key (green) */ + element = EL_EM_KEY_3; + break; + + case 0x15a5: /* key (white) */ + element = EL_DC_KEY_WHITE; + break; + + case 0x15a6: + element = EL_WALL_SLIPPERY; + break; + + case 0x15a7: + element = EL_WALL; + break; + + case 0x15a8: /* wall (not round) */ + element = EL_WALL; + break; + + case 0x15a9: /* (blue) */ + element = EL_CHAR_A; + break; + + case 0x15aa: /* (blue) */ + element = EL_CHAR_B; + break; + + case 0x15ab: /* (blue) */ + element = EL_CHAR_C; + break; + + case 0x15ac: /* (blue) */ + element = EL_CHAR_D; + break; + + case 0x15ad: /* (blue) */ + element = EL_CHAR_E; + break; + + case 0x15ae: /* (blue) */ + element = EL_CHAR_F; + break; + + case 0x15af: /* (blue) */ + element = EL_CHAR_G; + break; + + case 0x15b0: /* (blue) */ + element = EL_CHAR_H; + break; + + case 0x15b1: /* (blue) */ + element = EL_CHAR_I; + break; + + case 0x15b2: /* (blue) */ + element = EL_CHAR_J; + break; + + case 0x15b3: /* (blue) */ + element = EL_CHAR_K; + break; + + case 0x15b4: /* (blue) */ + element = EL_CHAR_L; + break; + + case 0x15b5: /* (blue) */ + element = EL_CHAR_M; + break; + + case 0x15b6: /* (blue) */ + element = EL_CHAR_N; + break; + + case 0x15b7: /* (blue) */ + element = EL_CHAR_O; + break; + + case 0x15b8: /* (blue) */ + element = EL_CHAR_P; + break; + + case 0x15b9: /* (blue) */ + element = EL_CHAR_Q; + break; + + case 0x15ba: /* (blue) */ + element = EL_CHAR_R; + break; + + case 0x15bb: /* (blue) */ + element = EL_CHAR_S; + break; + + case 0x15bc: /* (blue) */ + element = EL_CHAR_T; + break; + + case 0x15bd: /* (blue) */ + element = EL_CHAR_U; + break; + + case 0x15be: /* (blue) */ + element = EL_CHAR_V; + break; + + case 0x15bf: /* (blue) */ + element = EL_CHAR_W; + break; + + case 0x15c0: /* (blue) */ + element = EL_CHAR_X; + break; + + case 0x15c1: /* (blue) */ + element = EL_CHAR_Y; + break; + + case 0x15c2: /* (blue) */ + element = EL_CHAR_Z; + break; + + case 0x15c3: /* (blue) */ + element = EL_CHAR_AUMLAUT; + break; + + case 0x15c4: /* (blue) */ + element = EL_CHAR_OUMLAUT; + break; + + case 0x15c5: /* (blue) */ + element = EL_CHAR_UUMLAUT; + break; + + case 0x15c6: /* (blue) */ + element = EL_CHAR_0; + break; + + case 0x15c7: /* (blue) */ + element = EL_CHAR_1; + break; + + case 0x15c8: /* (blue) */ + element = EL_CHAR_2; + break; + + case 0x15c9: /* (blue) */ + element = EL_CHAR_3; + break; + + case 0x15ca: /* (blue) */ + element = EL_CHAR_4; + break; + + case 0x15cb: /* (blue) */ + element = EL_CHAR_5; + break; + + case 0x15cc: /* (blue) */ + element = EL_CHAR_6; + break; + + case 0x15cd: /* (blue) */ + element = EL_CHAR_7; + break; + + case 0x15ce: /* (blue) */ + element = EL_CHAR_8; + break; + + case 0x15cf: /* (blue) */ + element = EL_CHAR_9; + break; + + case 0x15d0: /* (blue) */ + element = EL_CHAR_PERIOD; + break; + + case 0x15d1: /* (blue) */ + element = EL_CHAR_EXCLAM; + break; + + case 0x15d2: /* (blue) */ + element = EL_CHAR_COLON; + break; + + case 0x15d3: /* (blue) */ + element = EL_CHAR_LESS; + break; + + case 0x15d4: /* (blue) */ + element = EL_CHAR_GREATER; + break; + + case 0x15d5: /* (blue) */ + element = EL_CHAR_QUESTION; + break; + + case 0x15d6: /* (blue) */ + element = EL_CHAR_COPYRIGHT; + break; + + case 0x15d7: /* (blue) */ + element = EL_CHAR_UP; + break; + + case 0x15d8: /* (blue) */ + element = EL_CHAR_DOWN; + break; + + case 0x15d9: /* (blue) */ + element = EL_CHAR_BUTTON; + break; + + case 0x15da: /* (blue) */ + element = EL_CHAR_PLUS; + break; + + case 0x15db: /* (blue) */ + element = EL_CHAR_MINUS; + break; + + case 0x15dc: /* (blue) */ + element = EL_CHAR_APOSTROPHE; + break; + + case 0x15dd: /* (blue) */ + element = EL_CHAR_PARENLEFT; + break; + + case 0x15de: /* (blue) */ + element = EL_CHAR_PARENRIGHT; + break; + + case 0x15df: /* (green) */ + element = EL_CHAR_A; + break; + + case 0x15e0: /* (green) */ + element = EL_CHAR_B; + break; + + case 0x15e1: /* (green) */ + element = EL_CHAR_C; + break; + + case 0x15e2: /* (green) */ + element = EL_CHAR_D; + break; + + case 0x15e3: /* (green) */ + element = EL_CHAR_E; + break; + + case 0x15e4: /* (green) */ + element = EL_CHAR_F; + break; + + case 0x15e5: /* (green) */ + element = EL_CHAR_G; + break; + + case 0x15e6: /* (green) */ + element = EL_CHAR_H; + break; + + case 0x15e7: /* (green) */ + element = EL_CHAR_I; + break; + + case 0x15e8: /* (green) */ + element = EL_CHAR_J; + break; + + case 0x15e9: /* (green) */ + element = EL_CHAR_K; + break; + + case 0x15ea: /* (green) */ + element = EL_CHAR_L; + break; + + case 0x15eb: /* (green) */ + element = EL_CHAR_M; + break; + + case 0x15ec: /* (green) */ + element = EL_CHAR_N; + break; + + case 0x15ed: /* (green) */ + element = EL_CHAR_O; + break; + + case 0x15ee: /* (green) */ + element = EL_CHAR_P; + break; + + case 0x15ef: /* (green) */ + element = EL_CHAR_Q; + break; + + case 0x15f0: /* (green) */ + element = EL_CHAR_R; + break; + + case 0x15f1: /* (green) */ + element = EL_CHAR_S; + break; + + case 0x15f2: /* (green) */ + element = EL_CHAR_T; + break; + + case 0x15f3: /* (green) */ + element = EL_CHAR_U; + break; + + case 0x15f4: /* (green) */ + element = EL_CHAR_V; + break; + + case 0x15f5: /* (green) */ + element = EL_CHAR_W; + break; + + case 0x15f6: /* (green) */ + element = EL_CHAR_X; + break; + + case 0x15f7: /* (green) */ + element = EL_CHAR_Y; + break; + + case 0x15f8: /* (green) */ + element = EL_CHAR_Z; + break; + + case 0x15f9: /* (green) */ + element = EL_CHAR_AUMLAUT; + break; + + case 0x15fa: /* (green) */ + element = EL_CHAR_OUMLAUT; + break; + + case 0x15fb: /* (green) */ + element = EL_CHAR_UUMLAUT; + break; + + case 0x15fc: /* (green) */ + element = EL_CHAR_0; + break; + + case 0x15fd: /* (green) */ + element = EL_CHAR_1; + break; + + case 0x15fe: /* (green) */ + element = EL_CHAR_2; + break; + + case 0x15ff: /* (green) */ + element = EL_CHAR_3; + break; + + case 0x1600: /* (green) */ + element = EL_CHAR_4; + break; + + case 0x1601: /* (green) */ + element = EL_CHAR_5; + break; + + case 0x1602: /* (green) */ + element = EL_CHAR_6; + break; + + case 0x1603: /* (green) */ + element = EL_CHAR_7; + break; + + case 0x1604: /* (green) */ + element = EL_CHAR_8; + break; + + case 0x1605: /* (green) */ + element = EL_CHAR_9; + break; + + case 0x1606: /* (green) */ + element = EL_CHAR_PERIOD; + break; + + case 0x1607: /* (green) */ + element = EL_CHAR_EXCLAM; + break; + + case 0x1608: /* (green) */ + element = EL_CHAR_COLON; + break; + + case 0x1609: /* (green) */ + element = EL_CHAR_LESS; + break; + + case 0x160a: /* (green) */ + element = EL_CHAR_GREATER; + break; + + case 0x160b: /* (green) */ + element = EL_CHAR_QUESTION; + break; + + case 0x160c: /* (green) */ + element = EL_CHAR_COPYRIGHT; + break; + + case 0x160d: /* (green) */ + element = EL_CHAR_UP; + break; + + case 0x160e: /* (green) */ + element = EL_CHAR_DOWN; + break; + + case 0x160f: /* (green) */ + element = EL_CHAR_BUTTON; + break; + + case 0x1610: /* (green) */ + element = EL_CHAR_PLUS; + break; + + case 0x1611: /* (green) */ + element = EL_CHAR_MINUS; + break; + + case 0x1612: /* (green) */ + element = EL_CHAR_APOSTROPHE; + break; + + case 0x1613: /* (green) */ + element = EL_CHAR_PARENLEFT; + break; + + case 0x1614: /* (green) */ + element = EL_CHAR_PARENRIGHT; + break; + + case 0x1615: /* (blue steel) */ + element = EL_STEEL_CHAR_A; + break; + + case 0x1616: /* (blue steel) */ + element = EL_STEEL_CHAR_B; + break; + + case 0x1617: /* (blue steel) */ + element = EL_STEEL_CHAR_C; + break; + + case 0x1618: /* (blue steel) */ + element = EL_STEEL_CHAR_D; + break; + + case 0x1619: /* (blue steel) */ + element = EL_STEEL_CHAR_E; + break; + + case 0x161a: /* (blue steel) */ + element = EL_STEEL_CHAR_F; + break; + + case 0x161b: /* (blue steel) */ + element = EL_STEEL_CHAR_G; + break; + + case 0x161c: /* (blue steel) */ + element = EL_STEEL_CHAR_H; + break; + + case 0x161d: /* (blue steel) */ + element = EL_STEEL_CHAR_I; + break; + + case 0x161e: /* (blue steel) */ + element = EL_STEEL_CHAR_J; + break; + + case 0x161f: /* (blue steel) */ + element = EL_STEEL_CHAR_K; + break; + + case 0x1620: /* (blue steel) */ + element = EL_STEEL_CHAR_L; + break; + + case 0x1621: /* (blue steel) */ + element = EL_STEEL_CHAR_M; + break; + + case 0x1622: /* (blue steel) */ + element = EL_STEEL_CHAR_N; + break; + + case 0x1623: /* (blue steel) */ + element = EL_STEEL_CHAR_O; + break; + + case 0x1624: /* (blue steel) */ + element = EL_STEEL_CHAR_P; + break; + + case 0x1625: /* (blue steel) */ + element = EL_STEEL_CHAR_Q; + break; + + case 0x1626: /* (blue steel) */ + element = EL_STEEL_CHAR_R; + break; + + case 0x1627: /* (blue steel) */ + element = EL_STEEL_CHAR_S; + break; + + case 0x1628: /* (blue steel) */ + element = EL_STEEL_CHAR_T; + break; + + case 0x1629: /* (blue steel) */ + element = EL_STEEL_CHAR_U; + break; + + case 0x162a: /* (blue steel) */ + element = EL_STEEL_CHAR_V; + break; + + case 0x162b: /* (blue steel) */ + element = EL_STEEL_CHAR_W; + break; + + case 0x162c: /* (blue steel) */ + element = EL_STEEL_CHAR_X; + break; + + case 0x162d: /* (blue steel) */ + element = EL_STEEL_CHAR_Y; + break; + + case 0x162e: /* (blue steel) */ + element = EL_STEEL_CHAR_Z; + break; + + case 0x162f: /* (blue steel) */ + element = EL_STEEL_CHAR_AUMLAUT; + break; + + case 0x1630: /* (blue steel) */ + element = EL_STEEL_CHAR_OUMLAUT; + break; + + case 0x1631: /* (blue steel) */ + element = EL_STEEL_CHAR_UUMLAUT; + break; + + case 0x1632: /* (blue steel) */ + element = EL_STEEL_CHAR_0; + break; + + case 0x1633: /* (blue steel) */ + element = EL_STEEL_CHAR_1; + break; + + case 0x1634: /* (blue steel) */ + element = EL_STEEL_CHAR_2; + break; + + case 0x1635: /* (blue steel) */ + element = EL_STEEL_CHAR_3; + break; + + case 0x1636: /* (blue steel) */ + element = EL_STEEL_CHAR_4; + break; + + case 0x1637: /* (blue steel) */ + element = EL_STEEL_CHAR_5; + break; + + case 0x1638: /* (blue steel) */ + element = EL_STEEL_CHAR_6; + break; + + case 0x1639: /* (blue steel) */ + element = EL_STEEL_CHAR_7; + break; + + case 0x163a: /* (blue steel) */ + element = EL_STEEL_CHAR_8; + break; + + case 0x163b: /* (blue steel) */ + element = EL_STEEL_CHAR_9; + break; + + case 0x163c: /* (blue steel) */ + element = EL_STEEL_CHAR_PERIOD; + break; + + case 0x163d: /* (blue steel) */ + element = EL_STEEL_CHAR_EXCLAM; + break; + + case 0x163e: /* (blue steel) */ + element = EL_STEEL_CHAR_COLON; + break; + + case 0x163f: /* (blue steel) */ + element = EL_STEEL_CHAR_LESS; + break; + + case 0x1640: /* (blue steel) */ + element = EL_STEEL_CHAR_GREATER; + break; + + case 0x1641: /* (blue steel) */ + element = EL_STEEL_CHAR_QUESTION; + break; + + case 0x1642: /* (blue steel) */ + element = EL_STEEL_CHAR_COPYRIGHT; + break; + + case 0x1643: /* (blue steel) */ + element = EL_STEEL_CHAR_UP; + break; + + case 0x1644: /* (blue steel) */ + element = EL_STEEL_CHAR_DOWN; + break; + + case 0x1645: /* (blue steel) */ + element = EL_STEEL_CHAR_BUTTON; + break; + + case 0x1646: /* (blue steel) */ + element = EL_STEEL_CHAR_PLUS; + break; + + case 0x1647: /* (blue steel) */ + element = EL_STEEL_CHAR_MINUS; + break; + + case 0x1648: /* (blue steel) */ + element = EL_STEEL_CHAR_APOSTROPHE; + break; + + case 0x1649: /* (blue steel) */ + element = EL_STEEL_CHAR_PARENLEFT; + break; + + case 0x164a: /* (blue steel) */ + element = EL_STEEL_CHAR_PARENRIGHT; + break; + + case 0x164b: /* (green steel) */ + element = EL_STEEL_CHAR_A; + break; + + case 0x164c: /* (green steel) */ + element = EL_STEEL_CHAR_B; + break; + + case 0x164d: /* (green steel) */ + element = EL_STEEL_CHAR_C; + break; + + case 0x164e: /* (green steel) */ + element = EL_STEEL_CHAR_D; + break; + + case 0x164f: /* (green steel) */ + element = EL_STEEL_CHAR_E; + break; + + case 0x1650: /* (green steel) */ + element = EL_STEEL_CHAR_F; + break; + + case 0x1651: /* (green steel) */ + element = EL_STEEL_CHAR_G; + break; + + case 0x1652: /* (green steel) */ + element = EL_STEEL_CHAR_H; + break; + + case 0x1653: /* (green steel) */ + element = EL_STEEL_CHAR_I; + break; + + case 0x1654: /* (green steel) */ + element = EL_STEEL_CHAR_J; + break; + + case 0x1655: /* (green steel) */ + element = EL_STEEL_CHAR_K; + break; + + case 0x1656: /* (green steel) */ + element = EL_STEEL_CHAR_L; + break; + + case 0x1657: /* (green steel) */ + element = EL_STEEL_CHAR_M; + break; + + case 0x1658: /* (green steel) */ + element = EL_STEEL_CHAR_N; + break; + + case 0x1659: /* (green steel) */ + element = EL_STEEL_CHAR_O; + break; + + case 0x165a: /* (green steel) */ + element = EL_STEEL_CHAR_P; + break; + + case 0x165b: /* (green steel) */ + element = EL_STEEL_CHAR_Q; + break; + + case 0x165c: /* (green steel) */ + element = EL_STEEL_CHAR_R; + break; + + case 0x165d: /* (green steel) */ + element = EL_STEEL_CHAR_S; + break; + + case 0x165e: /* (green steel) */ + element = EL_STEEL_CHAR_T; + break; + + case 0x165f: /* (green steel) */ + element = EL_STEEL_CHAR_U; + break; + + case 0x1660: /* (green steel) */ + element = EL_STEEL_CHAR_V; + break; + + case 0x1661: /* (green steel) */ + element = EL_STEEL_CHAR_W; + break; + + case 0x1662: /* (green steel) */ + element = EL_STEEL_CHAR_X; + break; + + case 0x1663: /* (green steel) */ + element = EL_STEEL_CHAR_Y; + break; + + case 0x1664: /* (green steel) */ + element = EL_STEEL_CHAR_Z; + break; + + case 0x1665: /* (green steel) */ + element = EL_STEEL_CHAR_AUMLAUT; + break; + + case 0x1666: /* (green steel) */ + element = EL_STEEL_CHAR_OUMLAUT; + break; + + case 0x1667: /* (green steel) */ + element = EL_STEEL_CHAR_UUMLAUT; + break; + + case 0x1668: /* (green steel) */ + element = EL_STEEL_CHAR_0; + break; + + case 0x1669: /* (green steel) */ + element = EL_STEEL_CHAR_1; + break; + + case 0x166a: /* (green steel) */ + element = EL_STEEL_CHAR_2; + break; + + case 0x166b: /* (green steel) */ + element = EL_STEEL_CHAR_3; + break; + + case 0x166c: /* (green steel) */ + element = EL_STEEL_CHAR_4; + break; + + case 0x166d: /* (green steel) */ + element = EL_STEEL_CHAR_5; + break; + + case 0x166e: /* (green steel) */ + element = EL_STEEL_CHAR_6; + break; + + case 0x166f: /* (green steel) */ + element = EL_STEEL_CHAR_7; + break; + + case 0x1670: /* (green steel) */ + element = EL_STEEL_CHAR_8; + break; + + case 0x1671: /* (green steel) */ + element = EL_STEEL_CHAR_9; + break; + + case 0x1672: /* (green steel) */ + element = EL_STEEL_CHAR_PERIOD; + break; + + case 0x1673: /* (green steel) */ + element = EL_STEEL_CHAR_EXCLAM; + break; + + case 0x1674: /* (green steel) */ + element = EL_STEEL_CHAR_COLON; + break; + + case 0x1675: /* (green steel) */ + element = EL_STEEL_CHAR_LESS; + break; + + case 0x1676: /* (green steel) */ + element = EL_STEEL_CHAR_GREATER; + break; + + case 0x1677: /* (green steel) */ + element = EL_STEEL_CHAR_QUESTION; + break; + + case 0x1678: /* (green steel) */ + element = EL_STEEL_CHAR_COPYRIGHT; + break; + + case 0x1679: /* (green steel) */ + element = EL_STEEL_CHAR_UP; + break; + + case 0x167a: /* (green steel) */ + element = EL_STEEL_CHAR_DOWN; + break; + + case 0x167b: /* (green steel) */ + element = EL_STEEL_CHAR_BUTTON; + break; + + case 0x167c: /* (green steel) */ + element = EL_STEEL_CHAR_PLUS; + break; + + case 0x167d: /* (green steel) */ + element = EL_STEEL_CHAR_MINUS; + break; + + case 0x167e: /* (green steel) */ + element = EL_STEEL_CHAR_APOSTROPHE; + break; + + case 0x167f: /* (green steel) */ + element = EL_STEEL_CHAR_PARENLEFT; + break; + + case 0x1680: /* (green steel) */ + element = EL_STEEL_CHAR_PARENRIGHT; + break; + + case 0x1681: /* gate (red) */ + element = EL_EM_GATE_1; + break; + + case 0x1682: /* secret gate (red) */ + element = EL_GATE_1_GRAY; + break; + + case 0x1683: /* gate (yellow) */ + element = EL_EM_GATE_2; + break; + + case 0x1684: /* secret gate (yellow) */ + element = EL_GATE_2_GRAY; + break; + + case 0x1685: /* gate (blue) */ + element = EL_EM_GATE_4; + break; + + case 0x1686: /* secret gate (blue) */ + element = EL_GATE_4_GRAY; + break; + + case 0x1687: /* gate (green) */ + element = EL_EM_GATE_3; + break; + + case 0x1688: /* secret gate (green) */ + element = EL_GATE_3_GRAY; + break; + + case 0x1689: /* gate (white) */ + element = EL_DC_GATE_WHITE; + break; + + case 0x168a: /* secret gate (white) */ + element = EL_DC_GATE_WHITE_GRAY; + break; + + case 0x168b: /* secret gate (no key) */ + element = EL_DC_GATE_FAKE_GRAY; + break; + + case 0x168c: + element = EL_ROBOT_WHEEL; + break; + + case 0x168d: + element = EL_DC_TIMEGATE_SWITCH; + break; + + case 0x168e: + element = EL_ACID_POOL_BOTTOM; + break; + + case 0x168f: + element = EL_ACID_POOL_TOPLEFT; + break; + + case 0x1690: + element = EL_ACID_POOL_TOPRIGHT; + break; + + case 0x1691: + element = EL_ACID_POOL_BOTTOMLEFT; + break; + + case 0x1692: + element = EL_ACID_POOL_BOTTOMRIGHT; + break; + + case 0x1693: + element = EL_STEELWALL; + break; + + case 0x1694: + element = EL_STEELWALL_SLIPPERY; + break; + + case 0x1695: /* steel wall (not round) */ + element = EL_STEELWALL; + break; + + case 0x1696: /* steel wall (left) */ + element = EL_DC_STEELWALL_1_LEFT; + break; + + case 0x1697: /* steel wall (bottom) */ + element = EL_DC_STEELWALL_1_BOTTOM; + break; + + case 0x1698: /* steel wall (right) */ + element = EL_DC_STEELWALL_1_RIGHT; + break; + + case 0x1699: /* steel wall (top) */ + element = EL_DC_STEELWALL_1_TOP; + break; + + case 0x169a: /* steel wall (left/bottom) */ + element = EL_DC_STEELWALL_1_BOTTOMLEFT; + break; + + case 0x169b: /* steel wall (right/bottom) */ + element = EL_DC_STEELWALL_1_BOTTOMRIGHT; + break; + + case 0x169c: /* steel wall (right/top) */ + element = EL_DC_STEELWALL_1_TOPRIGHT; + break; + + case 0x169d: /* steel wall (left/top) */ + element = EL_DC_STEELWALL_1_TOPLEFT; + break; + + case 0x169e: /* steel wall (right/bottom small) */ + element = EL_DC_STEELWALL_1_BOTTOMRIGHT_2; + break; + + case 0x169f: /* steel wall (left/bottom small) */ + element = EL_DC_STEELWALL_1_BOTTOMLEFT_2; + break; + + case 0x16a0: /* steel wall (right/top small) */ + element = EL_DC_STEELWALL_1_TOPRIGHT_2; + break; + + case 0x16a1: /* steel wall (left/top small) */ + element = EL_DC_STEELWALL_1_TOPLEFT_2; + break; + + case 0x16a2: /* steel wall (left/right) */ + element = EL_DC_STEELWALL_1_VERTICAL; + break; + + case 0x16a3: /* steel wall (top/bottom) */ + element = EL_DC_STEELWALL_1_HORIZONTAL; + break; + + case 0x16a4: /* steel wall 2 (left end) */ + element = EL_DC_STEELWALL_2_LEFT; + break; + + case 0x16a5: /* steel wall 2 (right end) */ + element = EL_DC_STEELWALL_2_RIGHT; + break; + + case 0x16a6: /* steel wall 2 (top end) */ + element = EL_DC_STEELWALL_2_TOP; + break; + + case 0x16a7: /* steel wall 2 (bottom end) */ + element = EL_DC_STEELWALL_2_BOTTOM; + break; + + case 0x16a8: /* steel wall 2 (left/right) */ + element = EL_DC_STEELWALL_2_HORIZONTAL; + break; + + case 0x16a9: /* steel wall 2 (up/down) */ + element = EL_DC_STEELWALL_2_VERTICAL; + break; + + case 0x16aa: /* steel wall 2 (mid) */ + element = EL_DC_STEELWALL_2_MIDDLE; + break; + + case 0x16ab: + element = EL_SIGN_EXCLAMATION; + break; + + case 0x16ac: + element = EL_SIGN_RADIOACTIVITY; + break; + + case 0x16ad: + element = EL_SIGN_STOP; + break; + + case 0x16ae: + element = EL_SIGN_WHEELCHAIR; + break; + + case 0x16af: + element = EL_SIGN_PARKING; + break; + + case 0x16b0: + element = EL_SIGN_NO_ENTRY; + break; + + case 0x16b1: + element = EL_SIGN_HEART; + break; + + case 0x16b2: + element = EL_SIGN_GIVE_WAY; + break; + + case 0x16b3: + element = EL_SIGN_ENTRY_FORBIDDEN; + break; + + case 0x16b4: + element = EL_SIGN_EMERGENCY_EXIT; + break; + + case 0x16b5: + element = EL_SIGN_YIN_YANG; + break; + + case 0x16b6: + element = EL_WALL_EMERALD; + break; + + case 0x16b7: + element = EL_WALL_DIAMOND; + break; + + case 0x16b8: + element = EL_WALL_PEARL; + break; + + case 0x16b9: + element = EL_WALL_CRYSTAL; + break; + + case 0x16ba: + element = EL_INVISIBLE_WALL; + break; + + case 0x16bb: + element = EL_INVISIBLE_STEELWALL; + break; + + /* 0x16bc - 0x16cb: */ + /* EL_INVISIBLE_SAND */ + + case 0x16cc: + element = EL_LIGHT_SWITCH; + break; + + case 0x16cd: + element = EL_ENVELOPE_1; + break; + + default: + if (element >= 0x0117 && element <= 0x036e) /* (?) */ + element = EL_DIAMOND; + else if (element >= 0x042d && element <= 0x0684) /* (?) */ + element = EL_EMERALD; + else if (element >= 0x157c && element <= 0x158b) + element = EL_SAND; + else if (element >= 0x1590 && element <= 0x159f) + element = EL_DC_LANDMINE; + else if (element >= 0x16bc && element <= 0x16cb) + element = EL_INVISIBLE_SAND; + else + { + Error(ERR_WARN, "unknown Diamond Caves element 0x%04x", element); + element = EL_UNKNOWN; + } + break; + } + + return getMappedElement(element); +} + +#if 1 + +static void LoadLevelFromFileStream_DC(FILE *file, struct LevelInfo *level, + int nr) +{ + byte header[DC_LEVEL_HEADER_SIZE]; + int envelope_size; + int envelope_header_pos = 62; + int envelope_content_pos = 94; + int level_name_pos = 251; + int level_author_pos = 292; + int envelope_header_len; + int envelope_content_len; + int level_name_len; + int level_author_len; + int fieldx, fieldy; + int num_yamyam_contents; + int i, x, y; + + getDecodedWord_DC(0, TRUE); /* initialize DC2 decoding engine */ + + for (i = 0; i < DC_LEVEL_HEADER_SIZE / 2; i++) + { + unsigned short header_word = getDecodedWord_DC(getFile16BitBE(file), FALSE); + + header[i * 2 + 0] = header_word >> 8; + header[i * 2 + 1] = header_word & 0xff; + } + + /* read some values from level header to check level decoding integrity */ + fieldx = header[6] | (header[7] << 8); + fieldy = header[8] | (header[9] << 8); + num_yamyam_contents = header[60] | (header[61] << 8); + + /* do some simple sanity checks to ensure that level was correctly decoded */ + if (fieldx < 1 || fieldx > 256 || + fieldy < 1 || fieldy > 256 || + num_yamyam_contents < 1 || num_yamyam_contents > 8) + { + level->no_valid_file = TRUE; + + Error(ERR_WARN, "cannot decode level from stream -- using empty level"); + + return; + } + + /* maximum envelope header size is 31 bytes */ + envelope_header_len = header[envelope_header_pos]; + /* maximum envelope content size is 110 (156?) bytes */ + envelope_content_len = header[envelope_content_pos]; + + /* maximum level title size is 40 bytes */ + level_name_len = MIN(header[level_name_pos], MAX_LEVEL_NAME_LEN); + /* maximum level author size is 30 (51?) bytes */ + level_author_len = MIN(header[level_author_pos], MAX_LEVEL_AUTHOR_LEN); + + envelope_size = 0; + + for (i = 0; i < envelope_header_len; i++) + if (envelope_size < MAX_ENVELOPE_TEXT_LEN) + level->envelope[0].text[envelope_size++] = + header[envelope_header_pos + 1 + i]; + + if (envelope_header_len > 0 && envelope_content_len > 0) + { + if (envelope_size < MAX_ENVELOPE_TEXT_LEN) + level->envelope[0].text[envelope_size++] = '\n'; + if (envelope_size < MAX_ENVELOPE_TEXT_LEN) + level->envelope[0].text[envelope_size++] = '\n'; + } + + for (i = 0; i < envelope_content_len; i++) + if (envelope_size < MAX_ENVELOPE_TEXT_LEN) + level->envelope[0].text[envelope_size++] = + header[envelope_content_pos + 1 + i]; + + level->envelope[0].text[envelope_size] = '\0'; + + level->envelope[0].xsize = MAX_ENVELOPE_XSIZE; + level->envelope[0].ysize = 10; + level->envelope[0].autowrap = TRUE; + level->envelope[0].centered = TRUE; + + for (i = 0; i < level_name_len; i++) + level->name[i] = header[level_name_pos + 1 + i]; + level->name[level_name_len] = '\0'; + + for (i = 0; i < level_author_len; i++) + level->author[i] = header[level_author_pos + 1 + i]; + level->author[level_author_len] = '\0'; + + num_yamyam_contents = header[60] | (header[61] << 8); + level->num_yamyam_contents = + MIN(MAX(MIN_ELEMENT_CONTENTS, num_yamyam_contents), MAX_ELEMENT_CONTENTS); + + for (i = 0; i < num_yamyam_contents; i++) + { + for (y = 0; y < 3; y++) for (x = 0; x < 3; x++) + { + unsigned short word = getDecodedWord_DC(getFile16BitBE(file), FALSE); +#if 1 + int element_dc = ((word & 0xff) << 8) | ((word >> 8) & 0xff); +#else + int element_dc = word; +#endif + + if (i < MAX_ELEMENT_CONTENTS) + level->yamyam_content[i].e[x][y] = getMappedElement_DC(element_dc); + } + } + + fieldx = header[6] | (header[7] << 8); + fieldy = header[8] | (header[9] << 8); + level->fieldx = MIN(MAX(MIN_LEV_FIELDX, fieldx), MAX_LEV_FIELDX); + level->fieldy = MIN(MAX(MIN_LEV_FIELDY, fieldy), MAX_LEV_FIELDY); + + for (y = 0; y < fieldy; y++) for (x = 0; x < fieldx; x++) + { + unsigned short word = getDecodedWord_DC(getFile16BitBE(file), FALSE); +#if 1 + int element_dc = ((word & 0xff) << 8) | ((word >> 8) & 0xff); +#else + int element_dc = word; +#endif + + if (x < MAX_LEV_FIELDX && y < MAX_LEV_FIELDY) + level->field[x][y] = getMappedElement_DC(element_dc); + } + + x = MIN(MAX(0, (header[10] | (header[11] << 8)) - 1), MAX_LEV_FIELDX - 1); + y = MIN(MAX(0, (header[12] | (header[13] << 8)) - 1), MAX_LEV_FIELDY - 1); + level->field[x][y] = EL_PLAYER_1; + + x = MIN(MAX(0, (header[14] | (header[15] << 8)) - 1), MAX_LEV_FIELDX - 1); + y = MIN(MAX(0, (header[16] | (header[17] << 8)) - 1), MAX_LEV_FIELDY - 1); + level->field[x][y] = EL_PLAYER_2; + + level->gems_needed = header[18] | (header[19] << 8); + + level->score[SC_EMERALD] = header[20] | (header[21] << 8); + level->score[SC_DIAMOND] = header[22] | (header[23] << 8); + level->score[SC_PEARL] = header[24] | (header[25] << 8); + level->score[SC_CRYSTAL] = header[26] | (header[27] << 8); + level->score[SC_NUT] = header[28] | (header[29] << 8); + level->score[SC_ROBOT] = header[30] | (header[31] << 8); + level->score[SC_SPACESHIP] = header[32] | (header[33] << 8); + level->score[SC_BUG] = header[34] | (header[35] << 8); + level->score[SC_YAMYAM] = header[36] | (header[37] << 8); + level->score[SC_DYNAMITE] = header[38] | (header[39] << 8); + level->score[SC_KEY] = header[40] | (header[41] << 8); + level->score[SC_TIME_BONUS] = header[42] | (header[43] << 8); + + level->time = header[44] | (header[45] << 8); + + level->amoeba_speed = header[46] | (header[47] << 8); + level->time_light = header[48] | (header[49] << 8); + level->time_timegate = header[50] | (header[51] << 8); + level->time_wheel = header[52] | (header[53] << 8); + level->time_magic_wall = header[54] | (header[55] << 8); + level->extra_time = header[56] | (header[57] << 8); + level->shield_normal_time = header[58] | (header[59] << 8); + + /* Diamond Caves has the same (strange) behaviour as Emerald Mine that gems + can slip down from flat walls, like normal walls and steel walls */ + level->em_slippery_gems = TRUE; + +#if 0 + /* Diamond Caves II levels are always surrounded by indestructible wall, but + not necessarily in a rectangular way -- fill with invisible steel wall */ + + /* !!! not always true !!! keep level and set BorderElement instead !!! */ + + for (y = 0; y < level->fieldy; y++) for (x = 0; x < level->fieldx; x++) + { +#if 1 + if ((x == 0 || x == level->fieldx - 1 || + y == 0 || y == level->fieldy - 1) && + level->field[x][y] == EL_EMPTY) + level->field[x][y] = EL_INVISIBLE_STEELWALL; +#else + if ((x == 0 || x == level->fieldx - 1 || + y == 0 || y == level->fieldy - 1) && + level->field[x][y] == EL_EMPTY) + FloodFillLevel(x, y, EL_INVISIBLE_STEELWALL, + level->field, level->fieldx, level->fieldy); +#endif + } +#endif +} + +static void LoadLevelFromFileInfo_DC(struct LevelInfo *level, + struct LevelFileInfo *level_file_info) +{ + char *filename = level_file_info->filename; + FILE *file; + int num_magic_bytes = 8; + char magic_bytes[num_magic_bytes + 1]; + int num_levels_to_skip = level_file_info->nr - leveldir_current->first_level; + + if (!(file = fopen(filename, MODE_READ))) + { + level->no_valid_file = TRUE; + + Error(ERR_WARN, "cannot read level '%s' -- using empty level", filename); + + return; + } + + // fseek(file, 0x0000, SEEK_SET); + + if (level_file_info->packed) + { + /* read "magic bytes" from start of file */ + fgets(magic_bytes, num_magic_bytes + 1, file); + + /* check "magic bytes" for correct file format */ + if (!strPrefix(magic_bytes, "DC2")) + { + level->no_valid_file = TRUE; + + Error(ERR_WARN, "unknown DC level file '%s' -- using empty level", + filename); + + return; + } + + if (strPrefix(magic_bytes, "DC2Win95") || + strPrefix(magic_bytes, "DC2Win98")) + { + int position_first_level = 0x00fa; + int extra_bytes = 4; + int skip_bytes; + + /* advance file stream to first level inside the level package */ + skip_bytes = position_first_level - num_magic_bytes - extra_bytes; + + /* each block of level data is followed by block of non-level data */ + num_levels_to_skip *= 2; + + /* at least skip header bytes, therefore use ">= 0" instead of "> 0" */ + while (num_levels_to_skip >= 0) + { + /* advance file stream to next level inside the level package */ + if (fseek(file, skip_bytes, SEEK_CUR) != 0) + { + level->no_valid_file = TRUE; + + Error(ERR_WARN, "cannot fseek in file '%s' -- using empty level", + filename); + + return; + } + + /* skip apparently unused extra bytes following each level */ + ReadUnusedBytesFromFile(file, extra_bytes); + + /* read size of next level in level package */ + skip_bytes = getFile32BitLE(file); + + num_levels_to_skip--; + } + } + else + { + level->no_valid_file = TRUE; + + Error(ERR_WARN, "unknown DC2 level file '%s' -- using empty level", + filename); + + return; + } + } + + LoadLevelFromFileStream_DC(file, level, level_file_info->nr); + + fclose(file); +} + +#else + +static void LoadLevelFromFileInfo_DC(struct LevelInfo *level, + struct LevelFileInfo *level_file_info) +{ + char *filename = level_file_info->filename; + FILE *file; +#if 0 + int nr = level_file_info->nr - leveldir_current->first_level; +#endif + byte header[DC_LEVEL_HEADER_SIZE]; + int envelope_size; + int envelope_header_pos = 62; + int envelope_content_pos = 94; + int level_name_pos = 251; + int level_author_pos = 292; + int envelope_header_len; + int envelope_content_len; + int level_name_len; + int level_author_len; + int fieldx, fieldy; + int num_yamyam_contents; + int i, x, y; + + if (!(file = fopen(filename, MODE_READ))) + { + level->no_valid_file = TRUE; + + Error(ERR_WARN, "cannot read level '%s' -- using empty level", filename); + + return; + } + +#if 0 + /* position file stream to the requested level inside the level package */ + if (fseek(file, nr * SP_LEVEL_SIZE, SEEK_SET) != 0) + { + level->no_valid_file = TRUE; + + Error(ERR_WARN, "cannot fseek in file '%s' -- using empty level", filename); + + return; + } +#endif + + getDecodedWord_DC(0, TRUE); /* initialize DC2 decoding engine */ + + for (i = 0; i < DC_LEVEL_HEADER_SIZE / 2; i++) + { + unsigned short header_word = getDecodedWord_DC(getFile16BitBE(file), FALSE); + + header[i * 2 + 0] = header_word >> 8; + header[i * 2 + 1] = header_word & 0xff; + } + + /* read some values from level header to check level decoding integrity */ + fieldx = header[6] | (header[7] << 8); + fieldy = header[8] | (header[9] << 8); + num_yamyam_contents = header[60] | (header[61] << 8); + + /* do some simple sanity checks to ensure that level was correctly decoded */ + if (fieldx < 1 || fieldx > 256 || + fieldy < 1 || fieldy > 256 || + num_yamyam_contents < 1 || num_yamyam_contents > 8) + { + level->no_valid_file = TRUE; + + Error(ERR_WARN, "cannot read level from file '%s' -- using empty level", + filename); + + return; + } + + /* maximum envelope header size is 31 bytes */ + envelope_header_len = header[envelope_header_pos]; + /* maximum envelope content size is 110 (156?) bytes */ + envelope_content_len = header[envelope_content_pos]; + + /* maximum level title size is 40 bytes */ + level_name_len = MIN(header[level_name_pos], MAX_LEVEL_NAME_LEN); + /* maximum level author size is 30 (51?) bytes */ + level_author_len = MIN(header[level_author_pos], MAX_LEVEL_AUTHOR_LEN); + + envelope_size = 0; + + for (i = 0; i < envelope_header_len; i++) + if (envelope_size < MAX_ENVELOPE_TEXT_LEN) + level->envelope[0].text[envelope_size++] = + header[envelope_header_pos + 1 + i]; + + if (envelope_header_len > 0 && envelope_content_len > 0) + { + if (envelope_size < MAX_ENVELOPE_TEXT_LEN) + level->envelope[0].text[envelope_size++] = '\n'; + if (envelope_size < MAX_ENVELOPE_TEXT_LEN) + level->envelope[0].text[envelope_size++] = '\n'; + } + + for (i = 0; i < envelope_content_len; i++) + if (envelope_size < MAX_ENVELOPE_TEXT_LEN) + level->envelope[0].text[envelope_size++] = + header[envelope_content_pos + 1 + i]; + + level->envelope[0].text[envelope_size] = '\0'; + + level->envelope[0].xsize = MAX_ENVELOPE_XSIZE; + level->envelope[0].ysize = 10; + level->envelope[0].autowrap = TRUE; + level->envelope[0].centered = TRUE; + + for (i = 0; i < level_name_len; i++) + level->name[i] = header[level_name_pos + 1 + i]; + level->name[level_name_len] = '\0'; + + for (i = 0; i < level_author_len; i++) + level->author[i] = header[level_author_pos + 1 + i]; + level->author[level_author_len] = '\0'; + + num_yamyam_contents = header[60] | (header[61] << 8); + level->num_yamyam_contents = + MIN(MAX(MIN_ELEMENT_CONTENTS, num_yamyam_contents), MAX_ELEMENT_CONTENTS); + + for (i = 0; i < num_yamyam_contents; i++) + { + for (y = 0; y < 3; y++) for (x = 0; x < 3; x++) + { + unsigned short word = getDecodedWord_DC(getFile16BitBE(file), FALSE); +#if 1 + int element_dc = ((word & 0xff) << 8) | ((word >> 8) & 0xff); +#else + int element_dc = word; +#endif + + if (i < MAX_ELEMENT_CONTENTS) + level->yamyam_content[i].e[x][y] = getMappedElement_DC(element_dc); + } + } + + fieldx = header[6] | (header[7] << 8); + fieldy = header[8] | (header[9] << 8); + level->fieldx = MIN(MAX(MIN_LEV_FIELDX, fieldx), MAX_LEV_FIELDX); + level->fieldy = MIN(MAX(MIN_LEV_FIELDY, fieldy), MAX_LEV_FIELDY); + + for (y = 0; y < fieldy; y++) for (x = 0; x < fieldx; x++) + { + unsigned short word = getDecodedWord_DC(getFile16BitBE(file), FALSE); +#if 1 + int element_dc = ((word & 0xff) << 8) | ((word >> 8) & 0xff); +#else + int element_dc = word; +#endif + + if (x < MAX_LEV_FIELDX && y < MAX_LEV_FIELDY) + level->field[x][y] = getMappedElement_DC(element_dc); + } + + x = MIN(MAX(0, (header[10] | (header[11] << 8)) - 1), MAX_LEV_FIELDX - 1); + y = MIN(MAX(0, (header[12] | (header[13] << 8)) - 1), MAX_LEV_FIELDY - 1); + level->field[x][y] = EL_PLAYER_1; + + x = MIN(MAX(0, (header[14] | (header[15] << 8)) - 1), MAX_LEV_FIELDX - 1); + y = MIN(MAX(0, (header[16] | (header[17] << 8)) - 1), MAX_LEV_FIELDY - 1); + level->field[x][y] = EL_PLAYER_2; + + level->gems_needed = header[18] | (header[19] << 8); + + level->score[SC_EMERALD] = header[20] | (header[21] << 8); + level->score[SC_DIAMOND] = header[22] | (header[23] << 8); + level->score[SC_PEARL] = header[24] | (header[25] << 8); + level->score[SC_CRYSTAL] = header[26] | (header[27] << 8); + level->score[SC_NUT] = header[28] | (header[29] << 8); + level->score[SC_ROBOT] = header[30] | (header[31] << 8); + level->score[SC_SPACESHIP] = header[32] | (header[33] << 8); + level->score[SC_BUG] = header[34] | (header[35] << 8); + level->score[SC_YAMYAM] = header[36] | (header[37] << 8); + level->score[SC_DYNAMITE] = header[38] | (header[39] << 8); + level->score[SC_KEY] = header[40] | (header[41] << 8); + level->score[SC_TIME_BONUS] = header[42] | (header[43] << 8); + + level->time = header[44] | (header[45] << 8); + + level->amoeba_speed = header[46] | (header[47] << 8); + level->time_light = header[48] | (header[49] << 8); + level->time_timegate = header[50] | (header[51] << 8); + level->time_wheel = header[52] | (header[53] << 8); + level->time_magic_wall = header[54] | (header[55] << 8); + level->extra_time = header[56] | (header[57] << 8); + level->shield_normal_time = header[58] | (header[59] << 8); + + fclose(file); + + /* Diamond Caves has the same (strange) behaviour as Emerald Mine that gems + can slip down from flat walls, like normal walls and steel walls */ + level->em_slippery_gems = TRUE; + +#if 0 + /* Diamond Caves II levels are always surrounded by indestructible wall, but + not necessarily in a rectangular way -- fill with invisible steel wall */ + + /* !!! not always true !!! keep level and set BorderElement instead !!! */ + + for (y = 0; y < level->fieldy; y++) for (x = 0; x < level->fieldx; x++) + { +#if 1 + if ((x == 0 || x == level->fieldx - 1 || + y == 0 || y == level->fieldy - 1) && + level->field[x][y] == EL_EMPTY) + level->field[x][y] = EL_INVISIBLE_STEELWALL; +#else + if ((x == 0 || x == level->fieldx - 1 || + y == 0 || y == level->fieldy - 1) && + level->field[x][y] == EL_EMPTY) + FloodFillLevel(x, y, EL_INVISIBLE_STEELWALL, + level->field, level->fieldx, level->fieldy); +#endif + } +#endif +} + +#endif + + +/* ------------------------------------------------------------------------- */ +/* functions for loading generic level */ +/* ------------------------------------------------------------------------- */ + +void LoadLevelFromFileInfo(struct LevelInfo *level, + struct LevelFileInfo *level_file_info) +{ + /* always start with reliable default values */ + setLevelInfoToDefaults(level); + + switch (level_file_info->type) + { + case LEVEL_FILE_TYPE_RND: + LoadLevelFromFileInfo_RND(level, level_file_info); + break; + + case LEVEL_FILE_TYPE_EM: + LoadLevelFromFileInfo_EM(level, level_file_info); + level->game_engine_type = GAME_ENGINE_TYPE_EM; + break; + + case LEVEL_FILE_TYPE_SP: + LoadLevelFromFileInfo_SP(level, level_file_info); + break; + + case LEVEL_FILE_TYPE_DC: + LoadLevelFromFileInfo_DC(level, level_file_info); + break; + + default: + LoadLevelFromFileInfo_RND(level, level_file_info); + break; + } + + /* if level file is invalid, restore level structure to default values */ + if (level->no_valid_file) + setLevelInfoToDefaults(level); + + if (level->game_engine_type == GAME_ENGINE_TYPE_UNKNOWN) + level->game_engine_type = GAME_ENGINE_TYPE_RND; + + if (level_file_info->type != LEVEL_FILE_TYPE_RND) + CopyNativeLevel_Native_to_RND(level); +} + +void LoadLevelFromFilename(struct LevelInfo *level, char *filename) +{ + static struct LevelFileInfo level_file_info; + + /* always start with reliable default values */ + setFileInfoToDefaults(&level_file_info); + + level_file_info.nr = 0; /* unknown level number */ + level_file_info.type = LEVEL_FILE_TYPE_RND; /* no others supported yet */ + level_file_info.filename = filename; + + LoadLevelFromFileInfo(level, &level_file_info); +} + +static void LoadLevel_InitVersion(struct LevelInfo *level, char *filename) +{ + int i, j; + + if (leveldir_current == NULL) /* only when dumping level */ + return; + + /* all engine modifications also valid for levels which use latest engine */ + if (level->game_version < VERSION_IDENT(3,2,0,5)) + { + /* time bonus score was given for 10 s instead of 1 s before 3.2.0-5 */ + level->score[SC_TIME_BONUS] /= 10; + } + +#if 0 + leveldir_current->latest_engine = TRUE; /* !!! TEST ONLY !!! */ +#endif + + if (leveldir_current->latest_engine) + { + /* ---------- use latest game engine ----------------------------------- */ + + /* For all levels which are forced to use the latest game engine version + (normally all but user contributed, private and undefined levels), set + the game engine version to the actual version; this allows for actual + corrections in the game engine to take effect for existing, converted + levels (from "classic" or other existing games) to make the emulation + of the corresponding game more accurate, while (hopefully) not breaking + existing levels created from other players. */ + + level->game_version = GAME_VERSION_ACTUAL; + + /* Set special EM style gems behaviour: EM style gems slip down from + normal, steel and growing wall. As this is a more fundamental change, + it seems better to set the default behaviour to "off" (as it is more + natural) and make it configurable in the level editor (as a property + of gem style elements). Already existing converted levels (neither + private nor contributed levels) are changed to the new behaviour. */ + + if (level->file_version < FILE_VERSION_2_0) + level->em_slippery_gems = TRUE; + + return; + } + + /* ---------- use game engine the level was created with ----------------- */ + + /* For all levels which are not forced to use the latest game engine + version (normally user contributed, private and undefined levels), + use the version of the game engine the levels were created for. + + Since 2.0.1, the game engine version is now directly stored + in the level file (chunk "VERS"), so there is no need anymore + to set the game version from the file version (except for old, + pre-2.0 levels, where the game version is still taken from the + file format version used to store the level -- see above). */ + + /* player was faster than enemies in 1.0.0 and before */ + if (level->file_version == FILE_VERSION_1_0) + for (i = 0; i < MAX_PLAYERS; i++) + level->initial_player_stepsize[i] = STEPSIZE_FAST; + + /* default behaviour for EM style gems was "slippery" only in 2.0.1 */ + if (level->game_version == VERSION_IDENT(2,0,1,0)) + level->em_slippery_gems = TRUE; + + /* springs could be pushed over pits before (pre-release version) 2.2.0 */ + if (level->game_version < VERSION_IDENT(2,2,0,0)) + level->use_spring_bug = TRUE; + + if (level->game_version < VERSION_IDENT(3,2,0,5)) + { + /* time orb caused limited time in endless time levels before 3.2.0-5 */ + level->use_time_orb_bug = TRUE; + + /* default behaviour for snapping was "no snap delay" before 3.2.0-5 */ + level->block_snap_field = FALSE; + + /* extra time score was same value as time left score before 3.2.0-5 */ + level->extra_time_score = level->score[SC_TIME_BONUS]; + +#if 0 + /* time bonus score was given for 10 s instead of 1 s before 3.2.0-5 */ + level->score[SC_TIME_BONUS] /= 10; +#endif + } + + if (level->game_version < VERSION_IDENT(3,2,0,7)) + { + /* default behaviour for snapping was "not continuous" before 3.2.0-7 */ + level->continuous_snapping = FALSE; + } + + /* only few elements were able to actively move into acid before 3.1.0 */ + /* trigger settings did not exist before 3.1.0; set to default "any" */ + if (level->game_version < VERSION_IDENT(3,1,0,0)) + { + /* correct "can move into acid" settings (all zero in old levels) */ + + level->can_move_into_acid_bits = 0; /* nothing can move into acid */ + level->dont_collide_with_bits = 0; /* nothing is deadly when colliding */ + + setMoveIntoAcidProperty(level, EL_ROBOT, TRUE); + setMoveIntoAcidProperty(level, EL_SATELLITE, TRUE); + setMoveIntoAcidProperty(level, EL_PENGUIN, TRUE); + setMoveIntoAcidProperty(level, EL_BALLOON, TRUE); + + for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) + SET_PROPERTY(EL_CUSTOM_START + i, EP_CAN_MOVE_INTO_ACID, TRUE); + + /* correct trigger settings (stored as zero == "none" in old levels) */ + + for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) + { + int element = EL_CUSTOM_START + i; + struct ElementInfo *ei = &element_info[element]; + + for (j = 0; j < ei->num_change_pages; j++) + { + struct ElementChangeInfo *change = &ei->change_page[j]; + + change->trigger_player = CH_PLAYER_ANY; + change->trigger_page = CH_PAGE_ANY; + } + } + } + + /* try to detect and fix "Snake Bite" levels, which are broken with 3.2.0 */ + { + int element = EL_CUSTOM_START + 255; + struct ElementInfo *ei = &element_info[element]; + struct ElementChangeInfo *change = &ei->change_page[0]; + + /* This is needed to fix a problem that was caused by a bugfix in function + game.c/CreateFieldExt() introduced with 3.2.0 that corrects the behaviour + when a custom element changes to EL_SOKOBAN_FIELD_PLAYER (before, it did + not replace walkable elements, but instead just placed the player on it, + without placing the Sokoban field under the player). Unfortunately, this + breaks "Snake Bite" style levels when the snake is halfway through a door + that just closes (the snake head is still alive and can be moved in this + case). This can be fixed by replacing the EL_SOKOBAN_FIELD_PLAYER by the + player (without Sokoban element) which then gets killed as designed). */ + + if ((strncmp(leveldir_current->identifier, "snake_bite", 10) == 0 || + strncmp(ei->description, "pause b4 death", 14) == 0) && + change->target_element == EL_SOKOBAN_FIELD_PLAYER) + change->target_element = EL_PLAYER_1; + } + + /* not centering level after relocating player was default only in 3.2.3 */ + if (level->game_version == VERSION_IDENT(3,2,3,0)) /* (no pre-releases) */ + level->shifted_relocation = TRUE; +} + +static void LoadLevel_InitElements(struct LevelInfo *level, char *filename) +{ + int i, j, x, y; + + /* map custom element change events that have changed in newer versions + (these following values were accidentally changed in version 3.0.1) + (this seems to be needed only for 'ab_levelset3' and 'ab_levelset4') */ + if (level->game_version <= VERSION_IDENT(3,0,0,0)) + { + for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) + { + int element = EL_CUSTOM_START + i; + + /* order of checking and copying events to be mapped is important */ + /* (do not change the start and end value -- they are constant) */ + for (j = CE_BY_OTHER_ACTION; j >= CE_VALUE_GETS_ZERO; j--) + { + if (HAS_CHANGE_EVENT(element, j - 2)) + { + SET_CHANGE_EVENT(element, j - 2, FALSE); + SET_CHANGE_EVENT(element, j, TRUE); + } + } + + /* order of checking and copying events to be mapped is important */ + /* (do not change the start and end value -- they are constant) */ + for (j = CE_PLAYER_COLLECTS_X; j >= CE_HITTING_SOMETHING; j--) + { + if (HAS_CHANGE_EVENT(element, j - 1)) + { + SET_CHANGE_EVENT(element, j - 1, FALSE); + SET_CHANGE_EVENT(element, j, TRUE); + } + } + } + } + + /* initialize "can_change" field for old levels with only one change page */ + if (level->game_version <= VERSION_IDENT(3,0,2,0)) + { + for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) + { + int element = EL_CUSTOM_START + i; + + if (CAN_CHANGE(element)) + element_info[element].change->can_change = TRUE; + } + } + + /* correct custom element values (for old levels without these options) */ + if (level->game_version < VERSION_IDENT(3,1,1,0)) + { for (i = 0; i < NUM_CUSTOM_ELEMENTS; i++) { int element = EL_CUSTOM_START + i; @@ -4416,7 +6415,10 @@ static void LoadLevel_InitPlayfield(struct LevelInfo *level, char *filename) lev_fieldy = level->fieldy; /* determine border element for this level */ - SetBorderElement(); + if (level->file_info.type == LEVEL_FILE_TYPE_DC) + BorderElement = EL_EMPTY; /* (in editor, SetBorderElement() is used) */ + else + SetBorderElement(); } static void LoadLevel_InitNativeEngines(struct LevelInfo *level,char *filename) @@ -5987,30 +7989,32 @@ void SaveScore(int nr) #define SETUP_TOKEN_SOUND_SIMPLE 4 #define SETUP_TOKEN_TOONS 5 #define SETUP_TOKEN_SCROLL_DELAY 6 -#define SETUP_TOKEN_SOFT_SCROLLING 7 -#define SETUP_TOKEN_FADE_SCREENS 8 -#define SETUP_TOKEN_AUTORECORD 9 -#define SETUP_TOKEN_SHOW_TITLESCREEN 10 -#define SETUP_TOKEN_QUICK_DOORS 11 -#define SETUP_TOKEN_TEAM_MODE 12 -#define SETUP_TOKEN_HANDICAP 13 -#define SETUP_TOKEN_SKIP_LEVELS 14 -#define SETUP_TOKEN_TIME_LIMIT 15 -#define SETUP_TOKEN_FULLSCREEN 16 -#define SETUP_TOKEN_FULLSCREEN_MODE 17 -#define SETUP_TOKEN_ASK_ON_ESCAPE 18 -#define SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR 19 -#define SETUP_TOKEN_QUICK_SWITCH 20 -#define SETUP_TOKEN_INPUT_ON_FOCUS 21 -#define SETUP_TOKEN_PREFER_AGA_GRAPHICS 22 -#define SETUP_TOKEN_GRAPHICS_SET 23 -#define SETUP_TOKEN_SOUNDS_SET 24 -#define SETUP_TOKEN_MUSIC_SET 25 -#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 26 -#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 27 -#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 28 - -#define NUM_GLOBAL_SETUP_TOKENS 29 +#define SETUP_TOKEN_SCROLL_DELAY_VALUE 7 +#define SETUP_TOKEN_SOFT_SCROLLING 8 +#define SETUP_TOKEN_FADE_SCREENS 9 +#define SETUP_TOKEN_AUTORECORD 10 +#define SETUP_TOKEN_SHOW_TITLESCREEN 11 +#define SETUP_TOKEN_QUICK_DOORS 12 +#define SETUP_TOKEN_TEAM_MODE 13 +#define SETUP_TOKEN_HANDICAP 14 +#define SETUP_TOKEN_SKIP_LEVELS 15 +#define SETUP_TOKEN_TIME_LIMIT 16 +#define SETUP_TOKEN_FULLSCREEN 17 +#define SETUP_TOKEN_FULLSCREEN_MODE 18 +#define SETUP_TOKEN_ASK_ON_ESCAPE 19 +#define SETUP_TOKEN_ASK_ON_ESCAPE_EDITOR 20 +#define SETUP_TOKEN_QUICK_SWITCH 21 +#define SETUP_TOKEN_INPUT_ON_FOCUS 22 +#define SETUP_TOKEN_PREFER_AGA_GRAPHICS 23 +#define SETUP_TOKEN_GAME_FRAME_DELAY 24 +#define SETUP_TOKEN_GRAPHICS_SET 25 +#define SETUP_TOKEN_SOUNDS_SET 26 +#define SETUP_TOKEN_MUSIC_SET 27 +#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 28 +#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 29 +#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 30 + +#define NUM_GLOBAL_SETUP_TOKENS 31 /* editor setup */ #define SETUP_TOKEN_EDITOR_EL_BOULDERDASH 0 @@ -6022,15 +8026,16 @@ void SaveScore(int nr) #define SETUP_TOKEN_EDITOR_EL_DIAMOND_CAVES 6 #define SETUP_TOKEN_EDITOR_EL_DX_BOULDERDASH 7 #define SETUP_TOKEN_EDITOR_EL_CHARS 8 -#define SETUP_TOKEN_EDITOR_EL_CUSTOM 9 -#define SETUP_TOKEN_EDITOR_EL_HEADLINES 10 -#define SETUP_TOKEN_EDITOR_EL_USER_DEFINED 11 -#define SETUP_TOKEN_EDITOR_EL_DYNAMIC 12 -#define SETUP_TOKEN_EDITOR_EL_BY_GAME 13 -#define SETUP_TOKEN_EDITOR_EL_BY_TYPE 14 -#define SETUP_TOKEN_EDITOR_SHOW_ELEMENT_TOKEN 15 +#define SETUP_TOKEN_EDITOR_EL_STEEL_CHARS 9 +#define SETUP_TOKEN_EDITOR_EL_CUSTOM 10 +#define SETUP_TOKEN_EDITOR_EL_HEADLINES 11 +#define SETUP_TOKEN_EDITOR_EL_USER_DEFINED 12 +#define SETUP_TOKEN_EDITOR_EL_DYNAMIC 13 +#define SETUP_TOKEN_EDITOR_EL_BY_GAME 14 +#define SETUP_TOKEN_EDITOR_EL_BY_TYPE 15 +#define SETUP_TOKEN_EDITOR_SHOW_ELEMENT_TOKEN 16 -#define NUM_EDITOR_SETUP_TOKENS 16 +#define NUM_EDITOR_SETUP_TOKENS 17 /* editor cascade setup */ #define SETUP_TOKEN_EDITOR_CASCADE_BD 0 @@ -6042,13 +8047,14 @@ void SaveScore(int nr) #define SETUP_TOKEN_EDITOR_CASCADE_DC 6 #define SETUP_TOKEN_EDITOR_CASCADE_DX 7 #define SETUP_TOKEN_EDITOR_CASCADE_TEXT 8 -#define SETUP_TOKEN_EDITOR_CASCADE_CE 9 -#define SETUP_TOKEN_EDITOR_CASCADE_GE 10 -#define SETUP_TOKEN_EDITOR_CASCADE_REF 11 -#define SETUP_TOKEN_EDITOR_CASCADE_USER 12 -#define SETUP_TOKEN_EDITOR_CASCADE_DYNAMIC 13 +#define SETUP_TOKEN_EDITOR_CASCADE_STEELTEXT 9 +#define SETUP_TOKEN_EDITOR_CASCADE_CE 10 +#define SETUP_TOKEN_EDITOR_CASCADE_GE 11 +#define SETUP_TOKEN_EDITOR_CASCADE_REF 12 +#define SETUP_TOKEN_EDITOR_CASCADE_USER 13 +#define SETUP_TOKEN_EDITOR_CASCADE_DYNAMIC 14 -#define NUM_EDITOR_CASCADE_SETUP_TOKENS 14 +#define NUM_EDITOR_CASCADE_SETUP_TOKENS 15 /* shortcut setup */ #define SETUP_TOKEN_SHORTCUT_SAVE_GAME 0 @@ -6083,10 +8089,11 @@ void SaveScore(int nr) #define NUM_PLAYER_SETUP_TOKENS 16 /* system setup */ -#define SETUP_TOKEN_SYSTEM_SDL_AUDIODRIVER 0 -#define SETUP_TOKEN_SYSTEM_AUDIO_FRAGMENT_SIZE 1 +#define SETUP_TOKEN_SYSTEM_SDL_VIDEODRIVER 0 +#define SETUP_TOKEN_SYSTEM_SDL_AUDIODRIVER 1 +#define SETUP_TOKEN_SYSTEM_AUDIO_FRAGMENT_SIZE 2 -#define NUM_SYSTEM_SETUP_TOKENS 2 +#define NUM_SYSTEM_SETUP_TOKENS 3 /* options setup */ #define SETUP_TOKEN_OPTIONS_VERBOSE 0 @@ -6111,6 +8118,7 @@ static struct TokenInfo global_setup_tokens[] = { TYPE_SWITCH, &si.sound_simple, "simple_sound_effects" }, { TYPE_SWITCH, &si.toons, "toons" }, { TYPE_SWITCH, &si.scroll_delay, "scroll_delay" }, + { TYPE_INTEGER,&si.scroll_delay_value,"scroll_delay_value" }, { TYPE_SWITCH, &si.soft_scrolling, "soft_scrolling" }, { TYPE_SWITCH, &si.fade_screens, "fade_screens" }, { TYPE_SWITCH, &si.autorecord, "automatic_tape_recording" }, @@ -6127,6 +8135,7 @@ static struct TokenInfo global_setup_tokens[] = { TYPE_SWITCH, &si.quick_switch, "quick_player_switch" }, { TYPE_SWITCH, &si.input_on_focus, "input_on_focus" }, { TYPE_SWITCH, &si.prefer_aga_graphics, "prefer_aga_graphics" }, + { TYPE_INTEGER,&si.game_frame_delay, "game_frame_delay" }, { TYPE_STRING, &si.graphics_set, "graphics_set" }, { TYPE_STRING, &si.sounds_set, "sounds_set" }, { TYPE_STRING, &si.music_set, "music_set" }, @@ -6158,6 +8167,7 @@ static struct TokenInfo editor_setup_tokens[] = { TYPE_SWITCH, &sei.el_dx_boulderdash,"editor.el_dx_boulderdash" }, #endif { TYPE_SWITCH, &sei.el_chars, "editor.el_chars" }, + { TYPE_SWITCH, &sei.el_steel_chars, "editor.el_steel_chars" }, { TYPE_SWITCH, &sei.el_custom, "editor.el_custom" }, #if 1 { TYPE_SWITCH, ¬_used, "editor.el_headlines" }, @@ -6182,6 +8192,7 @@ static struct TokenInfo editor_cascade_setup_tokens[] = { TYPE_SWITCH, &seci.el_dc, "editor.cascade.el_dc" }, { TYPE_SWITCH, &seci.el_dx, "editor.cascade.el_dx" }, { TYPE_SWITCH, &seci.el_chars, "editor.cascade.el_chars" }, + { TYPE_SWITCH, &seci.el_steel_chars, "editor.cascade.el_steel_chars" }, { TYPE_SWITCH, &seci.el_ce, "editor.cascade.el_ce" }, { TYPE_SWITCH, &seci.el_ge, "editor.cascade.el_ge" }, { TYPE_SWITCH, &seci.el_ref, "editor.cascade.el_ref" }, @@ -6223,6 +8234,7 @@ static struct TokenInfo player_setup_tokens[] = static struct TokenInfo system_setup_tokens[] = { + { TYPE_STRING, &syi.sdl_videodriver, "system.sdl_videodriver" }, { TYPE_STRING, &syi.sdl_audiodriver, "system.sdl_audiodriver" }, { TYPE_INTEGER, &syi.audio_fragment_size,"system.audio_fragment_size" }, }; @@ -6258,9 +8270,8 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->sound_music = TRUE; si->sound_simple = TRUE; si->toons = TRUE; - si->double_buffering = TRUE; - si->direct_draw = !si->double_buffering; si->scroll_delay = TRUE; + si->scroll_delay_value = STD_SCROLL_DELAY; si->soft_scrolling = TRUE; si->fade_screens = TRUE; si->autorecord = TRUE; @@ -6277,6 +8288,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->quick_switch = FALSE; si->input_on_focus = FALSE; si->prefer_aga_graphics = TRUE; + si->game_frame_delay = GAME_FRAME_DELAY; si->graphics_set = getStringCopy(GFX_CLASSIC_SUBDIR); si->sounds_set = getStringCopy(SND_CLASSIC_SUBDIR); @@ -6285,16 +8297,17 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->override_level_sounds = FALSE; si->override_level_music = FALSE; - si->editor.el_boulderdash = TRUE; - si->editor.el_emerald_mine = TRUE; - si->editor.el_emerald_mine_club = TRUE; - si->editor.el_more = TRUE; - si->editor.el_sokoban = TRUE; - si->editor.el_supaplex = TRUE; - si->editor.el_diamond_caves = TRUE; - si->editor.el_dx_boulderdash = TRUE; - si->editor.el_chars = TRUE; - si->editor.el_custom = TRUE; + si->editor.el_boulderdash = TRUE; + si->editor.el_emerald_mine = TRUE; + si->editor.el_emerald_mine_club = TRUE; + si->editor.el_more = TRUE; + si->editor.el_sokoban = TRUE; + si->editor.el_supaplex = TRUE; + si->editor.el_diamond_caves = TRUE; + si->editor.el_dx_boulderdash = TRUE; + si->editor.el_chars = TRUE; + si->editor.el_steel_chars = TRUE; + si->editor.el_custom = TRUE; si->editor.el_headlines = TRUE; si->editor.el_user_defined = FALSE; @@ -6302,15 +8315,15 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->editor.show_element_token = FALSE; - si->shortcut.save_game = DEFAULT_KEY_SAVE_GAME; - si->shortcut.load_game = DEFAULT_KEY_LOAD_GAME; - si->shortcut.toggle_pause = DEFAULT_KEY_TOGGLE_PAUSE; + si->shortcut.save_game = DEFAULT_KEY_SAVE_GAME; + si->shortcut.load_game = DEFAULT_KEY_LOAD_GAME; + si->shortcut.toggle_pause = DEFAULT_KEY_TOGGLE_PAUSE; - si->shortcut.focus_player[0] = DEFAULT_KEY_FOCUS_PLAYER_1; - si->shortcut.focus_player[1] = DEFAULT_KEY_FOCUS_PLAYER_2; - si->shortcut.focus_player[2] = DEFAULT_KEY_FOCUS_PLAYER_3; - si->shortcut.focus_player[3] = DEFAULT_KEY_FOCUS_PLAYER_4; - si->shortcut.focus_player_all = DEFAULT_KEY_FOCUS_PLAYER_ALL; + si->shortcut.focus_player[0] = DEFAULT_KEY_FOCUS_PLAYER_1; + si->shortcut.focus_player[1] = DEFAULT_KEY_FOCUS_PLAYER_2; + si->shortcut.focus_player[2] = DEFAULT_KEY_FOCUS_PLAYER_3; + si->shortcut.focus_player[3] = DEFAULT_KEY_FOCUS_PLAYER_4; + si->shortcut.focus_player_all = DEFAULT_KEY_FOCUS_PLAYER_ALL; for (i = 0; i < MAX_PLAYERS; i++) { @@ -6332,6 +8345,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->input[i].key.drop = (i == 0 ? DEFAULT_KEY_DROP : KSYM_UNDEFINED); } + si->system.sdl_videodriver = getStringCopy(ARG_DEFAULT); si->system.sdl_audiodriver = getStringCopy(ARG_DEFAULT); si->system.audio_fragment_size = DEFAULT_AUDIO_FRAGMENT_SIZE; @@ -6340,21 +8354,22 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) static void setSetupInfoToDefaults_EditorCascade(struct SetupInfo *si) { - si->editor_cascade.el_bd = TRUE; - si->editor_cascade.el_em = TRUE; - si->editor_cascade.el_emc = TRUE; - si->editor_cascade.el_rnd = TRUE; - si->editor_cascade.el_sb = TRUE; - si->editor_cascade.el_sp = TRUE; - si->editor_cascade.el_dc = TRUE; - si->editor_cascade.el_dx = TRUE; + si->editor_cascade.el_bd = TRUE; + si->editor_cascade.el_em = TRUE; + si->editor_cascade.el_emc = TRUE; + si->editor_cascade.el_rnd = TRUE; + si->editor_cascade.el_sb = TRUE; + si->editor_cascade.el_sp = TRUE; + si->editor_cascade.el_dc = TRUE; + si->editor_cascade.el_dx = TRUE; - si->editor_cascade.el_chars = FALSE; - si->editor_cascade.el_ce = FALSE; - si->editor_cascade.el_ge = FALSE; - si->editor_cascade.el_ref = FALSE; - si->editor_cascade.el_user = FALSE; - si->editor_cascade.el_dynamic = FALSE; + si->editor_cascade.el_chars = FALSE; + si->editor_cascade.el_steel_chars = FALSE; + si->editor_cascade.el_ce = FALSE; + si->editor_cascade.el_ge = FALSE; + si->editor_cascade.el_ref = FALSE; + si->editor_cascade.el_user = FALSE; + si->editor_cascade.el_dynamic = FALSE; } static void decodeSetupFileHash(SetupFileHash *setup_file_hash) @@ -6452,14 +8467,23 @@ void LoadSetup() checkSetupFileHashIdentifier(setup_file_hash, filename,getCookie("SETUP")); decodeSetupFileHash(setup_file_hash); - setup.direct_draw = !setup.double_buffering; - freeSetupFileHash(setup_file_hash); /* needed to work around problems with fixed length strings */ player_name_new = get_corrected_login_name(setup.player_name); free(setup.player_name); setup.player_name = player_name_new; + + /* "scroll_delay: on(3) / off(0)" was replaced by scroll delay value */ + if (setup.scroll_delay == FALSE) + { + setup.scroll_delay_value = MIN_SCROLL_DELAY; + setup.scroll_delay = TRUE; /* now always "on" */ + } + + /* make sure that scroll delay value stays inside valid range */ + setup.scroll_delay_value = + MIN(MAX(MIN_SCROLL_DELAY, setup.scroll_delay_value), MAX_SCROLL_DELAY); } else Error(ERR_WARN, "using default setup values"); @@ -6621,43 +8645,306 @@ void LoadCustomElementDescriptions() freeSetupFileHash(setup_file_hash); } -static void LoadSpecialMenuDesignSettingsFromFilename(char *filename) +static int getElementFromToken(char *token) +{ +#if 1 + char *value = getHashEntry(element_token_hash, token); + + if (value != NULL) + return atoi(value); +#else + int i; + + /* !!! OPTIMIZE THIS BY USING HASH !!! */ + for (i = 0; i < MAX_NUM_ELEMENTS; i++) + if (strEqual(token, element_info[i].token_name)) + return i; +#endif + + Error(ERR_WARN, "unknown element token '%s'", token); + + return EL_UNDEFINED; +} + +static int get_token_parameter_value(char *token, char *value_raw) +{ + char *suffix; + + if (token == NULL || value_raw == NULL) + return ARG_UNDEFINED_VALUE; + + suffix = strrchr(token, '.'); + if (suffix == NULL) + suffix = token; + +#if 1 + if (strEqual(suffix, ".element")) + return getElementFromToken(value_raw); +#endif + +#if 0 + if (strncmp(suffix, ".font", 5) == 0) + { + int i; + + /* !!! OPTIMIZE THIS BY USING HASH !!! */ + for (i = 0; i < NUM_FONTS; i++) + if (strEqual(value_raw, font_info[i].token_name)) + return i; + + /* if font not found, use reliable default value */ + return FONT_INITIAL_1; + } +#endif + + /* !!! USE CORRECT VALUE TYPE (currently works also for TYPE_BOOLEAN) !!! */ + return get_parameter_value(value_raw, suffix, TYPE_INTEGER); +} + +void InitMenuDesignSettings_Static() +{ +#if 0 + static SetupFileHash *image_config_hash = NULL; +#endif + int i; + +#if 0 + if (image_config_hash == NULL) + { + image_config_hash = newSetupFileHash(); + + for (i = 0; image_config[i].token != NULL; i++) + setHashEntry(image_config_hash, + image_config[i].token, + image_config[i].value); + } +#endif + +#if 1 + /* always start with reliable default values from static default config */ + for (i = 0; image_config_vars[i].token != NULL; i++) + { + char *value = getHashEntry(image_config_hash, image_config_vars[i].token); + + if (value != NULL) + *image_config_vars[i].value = + get_token_parameter_value(image_config_vars[i].token, value); + } + +#else + + int j; + + /* always start with reliable default values from static default config */ + for (i = 0; image_config_vars[i].token != NULL; i++) + for (j = 0; image_config[j].token != NULL; j++) + if (strEqual(image_config_vars[i].token, image_config[j].token)) + *image_config_vars[i].value = + get_token_parameter_value(image_config_vars[i].token, + image_config[j].value); +#endif +} + +static void InitMenuDesignSettings_SpecialPreProcessing() { - SetupFileHash *setup_file_hash; int i; + /* the following initializes hierarchical values from static configuration */ + + /* special case: initialize "ARG_DEFAULT" values in static default config */ + /* (e.g., initialize "[titlemessage].fade_mode" from "[title].fade_mode") */ + titlemessage_initial_default.fade_mode = title_initial_default.fade_mode; + titlemessage_initial_default.fade_delay = title_initial_default.fade_delay; + titlemessage_initial_default.post_delay = title_initial_default.post_delay; + titlemessage_initial_default.auto_delay = title_initial_default.auto_delay; + titlemessage_default.fade_mode = title_default.fade_mode; + titlemessage_default.fade_delay = title_default.fade_delay; + titlemessage_default.post_delay = title_default.post_delay; + titlemessage_default.auto_delay = title_default.auto_delay; + + /* special case: initialize "ARG_DEFAULT" values in static default config */ + /* (e.g., init "titlemessage_1.fade_mode" from "[titlemessage].fade_mode") */ + for (i = 0; i < MAX_NUM_TITLE_MESSAGES; i++) + { + titlemessage_initial[i] = titlemessage_initial_default; + titlemessage[i] = titlemessage_default; + } + + /* special case: initialize "ARG_DEFAULT" values in static default config */ + /* (eg, init "menu.enter_screen.SCORES.xyz" from "menu.enter_screen.xyz") */ + for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++) + { + menu.enter_screen[i] = menu.enter_screen[GFX_SPECIAL_ARG_DEFAULT]; + menu.leave_screen[i] = menu.leave_screen[GFX_SPECIAL_ARG_DEFAULT]; + } +} + +static void InitMenuDesignSettings_SpecialPostProcessing() +{ + /* special case: initialize later added SETUP list size from LEVELS value */ + if (menu.list_size[GAME_MODE_SETUP] == -1) + menu.list_size[GAME_MODE_SETUP] = menu.list_size[GAME_MODE_LEVELS]; +} + +static void LoadMenuDesignSettingsFromFilename(char *filename) +{ + static struct TitleMessageInfo tmi; + static struct TokenInfo titlemessage_tokens[] = + { + { TYPE_INTEGER, &tmi.x, ".x" }, + { TYPE_INTEGER, &tmi.y, ".y" }, + { TYPE_INTEGER, &tmi.width, ".width" }, + { TYPE_INTEGER, &tmi.height, ".height" }, + { TYPE_INTEGER, &tmi.chars, ".chars" }, + { TYPE_INTEGER, &tmi.lines, ".lines" }, + { TYPE_INTEGER, &tmi.align, ".align" }, + { TYPE_INTEGER, &tmi.valign, ".valign" }, + { TYPE_INTEGER, &tmi.font, ".font" }, + { TYPE_BOOLEAN, &tmi.autowrap, ".autowrap" }, + { TYPE_BOOLEAN, &tmi.centered, ".centered" }, + { TYPE_BOOLEAN, &tmi.parse_comments, ".parse_comments" }, + { TYPE_INTEGER, &tmi.sort_priority, ".sort_priority" }, + { TYPE_INTEGER, &tmi.fade_mode, ".fade_mode" }, + { TYPE_INTEGER, &tmi.fade_delay, ".fade_delay" }, + { TYPE_INTEGER, &tmi.post_delay, ".post_delay" }, + { TYPE_INTEGER, &tmi.auto_delay, ".auto_delay" }, + + { -1, NULL, NULL } + }; + static struct + { + struct TitleMessageInfo *array; + char *text; + } + titlemessage_arrays[] = + { + { titlemessage_initial, "[titlemessage_initial]" }, + { titlemessage, "[titlemessage]" }, + + { NULL, NULL } + }; + SetupFileHash *setup_file_hash; + int i, j, k; + #if 0 - printf("LoadSpecialMenuDesignSettings from file '%s' ...\n", filename); + printf("LoadMenuDesignSettings from file '%s' ...\n", filename); #endif if ((setup_file_hash = loadSetupFileHash(filename)) == NULL) return; + /* the following initializes hierarchical values from dynamic configuration */ + /* special case: initialize with default values that may be overwritten */ + /* (e.g., init "menu.draw_xoffset.INFO" from "menu.draw_xoffset") */ for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++) { - char *value_x = getHashEntry(setup_file_hash, "menu.draw_xoffset"); - char *value_y = getHashEntry(setup_file_hash, "menu.draw_yoffset"); - char *list_size = getHashEntry(setup_file_hash, "menu.list_size"); + char *value_1 = getHashEntry(setup_file_hash, "menu.draw_xoffset"); + char *value_2 = getHashEntry(setup_file_hash, "menu.draw_yoffset"); + char *value_3 = getHashEntry(setup_file_hash, "menu.list_size"); - if (value_x != NULL) - menu.draw_xoffset[i] = get_integer_from_string(value_x); - if (value_y != NULL) - menu.draw_yoffset[i] = get_integer_from_string(value_y); - if (list_size != NULL) - menu.list_size[i] = get_integer_from_string(list_size); + if (value_1 != NULL) + menu.draw_xoffset[i] = get_integer_from_string(value_1); + if (value_2 != NULL) + menu.draw_yoffset[i] = get_integer_from_string(value_2); + if (value_3 != NULL) + menu.list_size[i] = get_integer_from_string(value_3); } /* special case: initialize with default values that may be overwritten */ + /* (eg, init "menu.draw_xoffset.INFO[XXX]" from "menu.draw_xoffset.INFO") */ for (i = 0; i < NUM_SPECIAL_GFX_INFO_ARGS; i++) { - char *value_x = getHashEntry(setup_file_hash, "menu.draw_xoffset.INFO"); - char *value_y = getHashEntry(setup_file_hash, "menu.draw_yoffset.INFO"); + char *value_1 = getHashEntry(setup_file_hash, "menu.draw_xoffset.INFO"); + char *value_2 = getHashEntry(setup_file_hash, "menu.draw_yoffset.INFO"); + + if (value_1 != NULL) + menu.draw_xoffset_info[i] = get_integer_from_string(value_1); + if (value_2 != NULL) + menu.draw_yoffset_info[i] = get_integer_from_string(value_2); + } + + /* special case: initialize with default values that may be overwritten */ + /* (eg, init "menu.draw_xoffset.SETUP[XXX]" from "menu.draw_xoffset.SETUP") */ + for (i = 0; i < NUM_SPECIAL_GFX_SETUP_ARGS; i++) + { + char *value_1 = getHashEntry(setup_file_hash, "menu.draw_xoffset.SETUP"); + char *value_2 = getHashEntry(setup_file_hash, "menu.draw_yoffset.SETUP"); + + if (value_1 != NULL) + menu.draw_xoffset_setup[i] = get_integer_from_string(value_1); + if (value_2 != NULL) + menu.draw_yoffset_setup[i] = get_integer_from_string(value_2); + } + + /* special case: initialize with default values that may be overwritten */ + /* (eg, init "menu.enter_screen.SCORES.xyz" from "menu.enter_screen.xyz") */ + for (i = 0; i < NUM_SPECIAL_GFX_ARGS; i++) + { + char *token_1 = "menu.enter_screen.fade_mode"; + char *token_2 = "menu.enter_screen.fade_delay"; + char *token_3 = "menu.enter_screen.post_delay"; + char *token_4 = "menu.leave_screen.fade_mode"; + char *token_5 = "menu.leave_screen.fade_delay"; + char *token_6 = "menu.leave_screen.post_delay"; + char *value_1 = getHashEntry(setup_file_hash, token_1); + char *value_2 = getHashEntry(setup_file_hash, token_2); + char *value_3 = getHashEntry(setup_file_hash, token_3); + char *value_4 = getHashEntry(setup_file_hash, token_4); + char *value_5 = getHashEntry(setup_file_hash, token_5); + char *value_6 = getHashEntry(setup_file_hash, token_6); + + if (value_1 != NULL) + menu.enter_screen[i].fade_mode = get_token_parameter_value(token_1, + value_1); + if (value_2 != NULL) + menu.enter_screen[i].fade_delay = get_token_parameter_value(token_2, + value_2); + if (value_3 != NULL) + menu.enter_screen[i].post_delay = get_token_parameter_value(token_3, + value_3); + if (value_4 != NULL) + menu.leave_screen[i].fade_mode = get_token_parameter_value(token_4, + value_4); + if (value_5 != NULL) + menu.leave_screen[i].fade_delay = get_token_parameter_value(token_5, + value_5); + if (value_6 != NULL) + menu.leave_screen[i].post_delay = get_token_parameter_value(token_6, + value_6); + } + + /* special case: initialize with default values that may be overwritten */ + /* (e.g., init "titlemessage_1.fade_mode" from "[titlemessage].fade_mode") */ + for (i = 0; titlemessage_arrays[i].array != NULL; i++) + { + struct TitleMessageInfo *array = titlemessage_arrays[i].array; + char *base_token = titlemessage_arrays[i].text; + + for (j = 0; titlemessage_tokens[j].type != -1; j++) + { + char *token = getStringCat2(base_token, titlemessage_tokens[j].text); + char *value = getHashEntry(setup_file_hash, token); - if (value_x != NULL) - menu.draw_xoffset_info[i] = get_integer_from_string(value_x); - if (value_y != NULL) - menu.draw_yoffset_info[i] = get_integer_from_string(value_y); + if (value != NULL) + { + int parameter_value = get_token_parameter_value(token, value); + + for (k = 0; k < MAX_NUM_TITLE_MESSAGES; k++) + { + tmi = array[k]; + + if (titlemessage_tokens[j].type == TYPE_INTEGER) + *(boolean *)titlemessage_tokens[j].value = (boolean)parameter_value; + else + *(int *)titlemessage_tokens[j].value = (int)parameter_value; + + array[k] = tmi; + } + } + + free(token); + } } /* read (and overwrite with) values that may be specified in config file */ @@ -6665,26 +8952,21 @@ static void LoadSpecialMenuDesignSettingsFromFilename(char *filename) { char *value = getHashEntry(setup_file_hash, image_config_vars[i].token); - if (value != NULL) + /* (ignore definitions set to "[DEFAULT]" which are already initialized) */ + if (value != NULL && !strEqual(value, ARG_DEFAULT)) *image_config_vars[i].value = - get_auto_parameter_value(image_config_vars[i].token, value); + get_token_parameter_value(image_config_vars[i].token, value); } freeSetupFileHash(setup_file_hash); } -void LoadSpecialMenuDesignSettings() +void LoadMenuDesignSettings() { char *filename_base = UNDEFINED_FILENAME, *filename_local; - int i, j; - /* always start with reliable default values from default config */ - for (i = 0; image_config_vars[i].token != NULL; i++) - for (j = 0; image_config[j].token != NULL; j++) - if (strEqual(image_config_vars[i].token, image_config[j].token)) - *image_config_vars[i].value = - get_auto_parameter_value(image_config_vars[i].token, - image_config[j].value); + InitMenuDesignSettings_Static(); + InitMenuDesignSettings_SpecialPreProcessing(); if (!SETUP_OVERRIDE_ARTWORK(setup, ARTWORK_TYPE_GRAPHICS)) { @@ -6692,13 +8974,15 @@ void LoadSpecialMenuDesignSettings() filename_base = getCustomArtworkLevelConfigFilename(ARTWORK_TYPE_GRAPHICS); if (fileExists(filename_base)) - LoadSpecialMenuDesignSettingsFromFilename(filename_base); + LoadMenuDesignSettingsFromFilename(filename_base); } filename_local = getCustomArtworkConfigFilename(ARTWORK_TYPE_GRAPHICS); if (filename_local != NULL && !strEqual(filename_base, filename_local)) - LoadSpecialMenuDesignSettingsFromFilename(filename_local); + LoadMenuDesignSettingsFromFilename(filename_local); + + InitMenuDesignSettings_SpecialPostProcessing(); } void LoadUserDefinedEditorElementList(int **elements, int *num_elements) @@ -6756,19 +9040,19 @@ void LoadUserDefinedEditorElementList(int **elements, int *num_elements) { if (num_unknown_tokens == 0) { - Error(ERR_RETURN_LINE, "-"); - Error(ERR_RETURN, "warning: unknown token(s) found in config file:"); - Error(ERR_RETURN, "- config file: '%s'", filename); + Error(ERR_INFO_LINE, "-"); + Error(ERR_INFO, "warning: unknown token(s) found in config file:"); + Error(ERR_INFO, "- config file: '%s'", filename); num_unknown_tokens++; } - Error(ERR_RETURN, "- token: '%s'", list->token); + Error(ERR_INFO, "- token: '%s'", list->token); } } if (num_unknown_tokens > 0) - Error(ERR_RETURN_LINE, "-"); + Error(ERR_INFO_LINE, "-"); while (*num_elements % 4) /* pad with empty elements, if needed */ (*elements)[(*num_elements)++] = EL_EMPTY; @@ -6856,7 +9140,7 @@ static struct MusicFileInfo *get_music_file_info_ext(char *basename, int music, /* ---------- music file info found ---------- */ - memset(&tmp_music_file_info, 0, sizeof(struct MusicFileInfo)); + clear_mem(&tmp_music_file_info, sizeof(struct MusicFileInfo)); for (i = 0; token_to_value_ptr[i].token != NULL; i++) { @@ -7069,18 +9353,18 @@ void print_unknown_token(char *filename, char *token, int token_nr) { if (token_nr == 0) { - Error(ERR_RETURN_LINE, "-"); - Error(ERR_RETURN, "warning: unknown token(s) found in config file:"); - Error(ERR_RETURN, "- config file: '%s'", filename); + Error(ERR_INFO_LINE, "-"); + Error(ERR_INFO, "warning: unknown token(s) found in config file:"); + Error(ERR_INFO, "- config file: '%s'", filename); } - Error(ERR_RETURN, "- token: '%s'", token); + Error(ERR_INFO, "- token: '%s'", token); } void print_unknown_token_end(int token_nr) { if (token_nr > 0) - Error(ERR_RETURN_LINE, "-"); + Error(ERR_INFO_LINE, "-"); } void LoadHelpAnimInfo() diff --git a/src/files.h b/src/files.h index 41939ac2..51509f8c 100644 --- a/src/files.h +++ b/src/files.h @@ -61,7 +61,8 @@ void LoadSetup_EditorCascade(); void SaveSetup_EditorCascade(); void LoadCustomElementDescriptions(); -void LoadSpecialMenuDesignSettings(); +void InitMenuDesignSettings_Static(); +void LoadMenuDesignSettings(); void LoadUserDefinedEditorElementList(int **, int *); void LoadMusicInfo(); void LoadHelpAnimInfo(); diff --git a/src/game.c b/src/game.c index 00a1a090..2cd5f41f 100644 --- a/src/game.c +++ b/src/game.c @@ -59,6 +59,8 @@ #define USE_FIX_KILLED_BY_NON_WALKABLE (USE_NEW_STUFF * 1) #define USE_FIX_IMPACT_COLLISION (USE_NEW_STUFF * 1) +#define USE_GFX_RESET_WHEN_NOT_MOVING (USE_NEW_STUFF * 1) + /* for DigField() */ #define DF_NO_PUSH 0 @@ -85,27 +87,33 @@ #define EX_TYPE_DYNA (1 << 4) #define EX_TYPE_SINGLE_TILE (EX_TYPE_CENTER | EX_TYPE_BORDER) -#define PANEL_DEACTIVATED(p) ((p).x < 0 || (p).y < 0) +#define PANEL_OFF() (local_player->LevelSolved_PanelOff) +#define PANEL_DEACTIVATED(p) ((p)->x < 0 || (p)->y < 0 || PANEL_OFF()) +#define PANEL_XPOS(p) (DX + ALIGNED_TEXT_XPOS(p)) +#define PANEL_YPOS(p) (DY + ALIGNED_TEXT_YPOS(p)) /* special positions in the game control window (relative to control window) */ -#define XX_LEVEL1 (game.panel.level.x) -#define XX_LEVEL2 (game.panel.level.x - 1) -#define YY_LEVEL (game.panel.level.y) -#define XX_EMERALDS (game.panel.gems.x) -#define YY_EMERALDS (game.panel.gems.y) -#define XX_DYNAMITE (game.panel.inventory.x) -#define YY_DYNAMITE (game.panel.inventory.y) -#define XX_KEYS (game.panel.keys.x) -#define YY_KEYS (game.panel.keys.y) -#define XX_SCORE (game.panel.score.x) -#define YY_SCORE (game.panel.score.y) -#define XX_TIME1 (game.panel.time.x) -#define XX_TIME2 (game.panel.time.x + 1) -#define YY_TIME (game.panel.time.y) +#define XX_LEVEL1 (PANEL_XPOS(game.panel.level)) +#define XX_LEVEL2 (PANEL_XPOS(game.panel.level) - 1) +#define XX_LEVEL (PANEL_XPOS(game.panel.level)) +#define YY_LEVEL (PANEL_YPOS(game.panel.level)) +#define XX_EMERALDS (PANEL_XPOS(game.panel.gems)) +#define YY_EMERALDS (PANEL_YPOS(game.panel.gems)) +#define XX_DYNAMITE (PANEL_XPOS(game.panel.inventory)) +#define YY_DYNAMITE (PANEL_YPOS(game.panel.inventory)) +#define XX_KEYS (PANEL_XPOS(game.panel.keys)) +#define YY_KEYS (PANEL_YPOS(game.panel.keys)) +#define XX_SCORE (PANEL_XPOS(game.panel.score)) +#define YY_SCORE (PANEL_YPOS(game.panel.score)) +#define XX_TIME1 (PANEL_XPOS(game.panel.time)) +#define XX_TIME2 (PANEL_XPOS(game.panel.time) + 1) +#define XX_TIME (PANEL_XPOS(game.panel.time)) +#define YY_TIME (PANEL_YPOS(game.panel.time)) /* special positions in the game control window (relative to main window) */ #define DX_LEVEL1 (DX + XX_LEVEL1) #define DX_LEVEL2 (DX + XX_LEVEL2) +#define DX_LEVEL (DX + XX_LEVEL) #define DY_LEVEL (DY + YY_LEVEL) #define DX_EMERALDS (DX + XX_EMERALDS) #define DY_EMERALDS (DY + YY_EMERALDS) @@ -117,8 +125,720 @@ #define DY_SCORE (DY + YY_SCORE) #define DX_TIME1 (DX + XX_TIME1) #define DX_TIME2 (DX + XX_TIME2) +#define DX_TIME (DX + XX_TIME) #define DY_TIME (DY + YY_TIME) +#if 1 +/* game panel display and control definitions */ + +#define GAME_PANEL_LEVEL_NUMBER 0 +#define GAME_PANEL_GEMS 1 +#define GAME_PANEL_INVENTORY_COUNT 2 +#define GAME_PANEL_INVENTORY_FIRST_1 3 +#define GAME_PANEL_INVENTORY_FIRST_2 4 +#define GAME_PANEL_INVENTORY_FIRST_3 5 +#define GAME_PANEL_INVENTORY_FIRST_4 6 +#define GAME_PANEL_INVENTORY_FIRST_5 7 +#define GAME_PANEL_INVENTORY_FIRST_6 8 +#define GAME_PANEL_INVENTORY_FIRST_7 9 +#define GAME_PANEL_INVENTORY_FIRST_8 10 +#define GAME_PANEL_INVENTORY_LAST_1 11 +#define GAME_PANEL_INVENTORY_LAST_2 12 +#define GAME_PANEL_INVENTORY_LAST_3 13 +#define GAME_PANEL_INVENTORY_LAST_4 14 +#define GAME_PANEL_INVENTORY_LAST_5 15 +#define GAME_PANEL_INVENTORY_LAST_6 16 +#define GAME_PANEL_INVENTORY_LAST_7 17 +#define GAME_PANEL_INVENTORY_LAST_8 18 +#define GAME_PANEL_KEY_1 19 +#define GAME_PANEL_KEY_2 20 +#define GAME_PANEL_KEY_3 21 +#define GAME_PANEL_KEY_4 22 +#define GAME_PANEL_KEY_5 23 +#define GAME_PANEL_KEY_6 24 +#define GAME_PANEL_KEY_7 25 +#define GAME_PANEL_KEY_8 26 +#define GAME_PANEL_KEY_WHITE 27 +#define GAME_PANEL_KEY_WHITE_COUNT 28 +#define GAME_PANEL_SCORE 29 +#define GAME_PANEL_TIME 30 +#define GAME_PANEL_TIME_HH 31 +#define GAME_PANEL_TIME_MM 32 +#define GAME_PANEL_TIME_SS 33 +#define GAME_PANEL_SHIELD_NORMAL 34 +#define GAME_PANEL_SHIELD_NORMAL_TIME 35 +#define GAME_PANEL_SHIELD_DEADLY 36 +#define GAME_PANEL_SHIELD_DEADLY_TIME 37 +#define GAME_PANEL_EXIT 38 +#define GAME_PANEL_EMC_MAGIC_BALL 39 +#define GAME_PANEL_EMC_MAGIC_BALL_SWITCH 40 +#define GAME_PANEL_LIGHT_SWITCH 41 +#define GAME_PANEL_LIGHT_SWITCH_TIME 42 +#define GAME_PANEL_TIMEGATE_SWITCH 43 +#define GAME_PANEL_TIMEGATE_SWITCH_TIME 44 +#define GAME_PANEL_SWITCHGATE_SWITCH 45 +#define GAME_PANEL_EMC_LENSES 46 +#define GAME_PANEL_EMC_LENSES_TIME 47 +#define GAME_PANEL_EMC_MAGNIFIER 48 +#define GAME_PANEL_EMC_MAGNIFIER_TIME 49 +#define GAME_PANEL_BALLOON_SWITCH 50 +#define GAME_PANEL_DYNABOMB_NUMBER 51 +#define GAME_PANEL_DYNABOMB_SIZE 52 +#define GAME_PANEL_DYNABOMB_POWER 53 +#define GAME_PANEL_PENGUINS 54 +#define GAME_PANEL_SOKOBAN_OBJECTS 55 +#define GAME_PANEL_SOKOBAN_FIELDS 56 +#define GAME_PANEL_ROBOT_WHEEL 57 +#define GAME_PANEL_CONVEYOR_BELT_1 58 +#define GAME_PANEL_CONVEYOR_BELT_2 59 +#define GAME_PANEL_CONVEYOR_BELT_3 60 +#define GAME_PANEL_CONVEYOR_BELT_4 61 +#define GAME_PANEL_CONVEYOR_BELT_1_SWITCH 62 +#define GAME_PANEL_CONVEYOR_BELT_2_SWITCH 63 +#define GAME_PANEL_CONVEYOR_BELT_3_SWITCH 64 +#define GAME_PANEL_CONVEYOR_BELT_4_SWITCH 65 +#define GAME_PANEL_MAGIC_WALL 66 +#define GAME_PANEL_MAGIC_WALL_TIME 67 +#define GAME_PANEL_GRAVITY_STATE 68 +#define GAME_PANEL_GRAPHIC_1 69 +#define GAME_PANEL_GRAPHIC_2 70 +#define GAME_PANEL_GRAPHIC_3 71 +#define GAME_PANEL_GRAPHIC_4 72 +#define GAME_PANEL_GRAPHIC_5 73 +#define GAME_PANEL_GRAPHIC_6 74 +#define GAME_PANEL_GRAPHIC_7 75 +#define GAME_PANEL_GRAPHIC_8 76 +#define GAME_PANEL_ELEMENT_1 77 +#define GAME_PANEL_ELEMENT_2 78 +#define GAME_PANEL_ELEMENT_3 79 +#define GAME_PANEL_ELEMENT_4 80 +#define GAME_PANEL_ELEMENT_5 81 +#define GAME_PANEL_ELEMENT_6 82 +#define GAME_PANEL_ELEMENT_7 83 +#define GAME_PANEL_ELEMENT_8 84 +#define GAME_PANEL_ELEMENT_COUNT_1 85 +#define GAME_PANEL_ELEMENT_COUNT_2 86 +#define GAME_PANEL_ELEMENT_COUNT_3 87 +#define GAME_PANEL_ELEMENT_COUNT_4 88 +#define GAME_PANEL_ELEMENT_COUNT_5 89 +#define GAME_PANEL_ELEMENT_COUNT_6 90 +#define GAME_PANEL_ELEMENT_COUNT_7 91 +#define GAME_PANEL_ELEMENT_COUNT_8 92 +#define GAME_PANEL_CE_SCORE_1 93 +#define GAME_PANEL_CE_SCORE_2 94 +#define GAME_PANEL_CE_SCORE_3 95 +#define GAME_PANEL_CE_SCORE_4 96 +#define GAME_PANEL_CE_SCORE_5 97 +#define GAME_PANEL_CE_SCORE_6 98 +#define GAME_PANEL_CE_SCORE_7 99 +#define GAME_PANEL_CE_SCORE_8 100 +#define GAME_PANEL_CE_SCORE_1_ELEMENT 101 +#define GAME_PANEL_CE_SCORE_2_ELEMENT 102 +#define GAME_PANEL_CE_SCORE_3_ELEMENT 103 +#define GAME_PANEL_CE_SCORE_4_ELEMENT 104 +#define GAME_PANEL_CE_SCORE_5_ELEMENT 105 +#define GAME_PANEL_CE_SCORE_6_ELEMENT 106 +#define GAME_PANEL_CE_SCORE_7_ELEMENT 107 +#define GAME_PANEL_CE_SCORE_8_ELEMENT 108 +#define GAME_PANEL_PLAYER_NAME 109 +#define GAME_PANEL_LEVEL_NAME 110 +#define GAME_PANEL_LEVEL_AUTHOR 111 + +#define NUM_GAME_PANEL_CONTROLS 112 + +struct GamePanelOrderInfo +{ + int nr; + int sort_priority; +}; + +static struct GamePanelOrderInfo game_panel_order[NUM_GAME_PANEL_CONTROLS]; + +struct GamePanelControlInfo +{ + int nr; + + struct TextPosInfo *pos; + int type; + + int value, last_value; + int frame, last_frame; + int gfx_frame; + int gfx_random; +}; + +static struct GamePanelControlInfo game_panel_controls[] = +{ + { + GAME_PANEL_LEVEL_NUMBER, + &game.panel.level_number, + TYPE_INTEGER, + }, + { + GAME_PANEL_GEMS, + &game.panel.gems, + TYPE_INTEGER, + }, + { + GAME_PANEL_INVENTORY_COUNT, + &game.panel.inventory_count, + TYPE_INTEGER, + }, + { + GAME_PANEL_INVENTORY_FIRST_1, + &game.panel.inventory_first[0], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_FIRST_2, + &game.panel.inventory_first[1], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_FIRST_3, + &game.panel.inventory_first[2], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_FIRST_4, + &game.panel.inventory_first[3], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_FIRST_5, + &game.panel.inventory_first[4], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_FIRST_6, + &game.panel.inventory_first[5], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_FIRST_7, + &game.panel.inventory_first[6], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_FIRST_8, + &game.panel.inventory_first[7], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_LAST_1, + &game.panel.inventory_last[0], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_LAST_2, + &game.panel.inventory_last[1], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_LAST_3, + &game.panel.inventory_last[2], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_LAST_4, + &game.panel.inventory_last[3], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_LAST_5, + &game.panel.inventory_last[4], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_LAST_6, + &game.panel.inventory_last[5], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_LAST_7, + &game.panel.inventory_last[6], + TYPE_ELEMENT, + }, + { + GAME_PANEL_INVENTORY_LAST_8, + &game.panel.inventory_last[7], + TYPE_ELEMENT, + }, + { + GAME_PANEL_KEY_1, + &game.panel.key[0], + TYPE_ELEMENT, + }, + { + GAME_PANEL_KEY_2, + &game.panel.key[1], + TYPE_ELEMENT, + }, + { + GAME_PANEL_KEY_3, + &game.panel.key[2], + TYPE_ELEMENT, + }, + { + GAME_PANEL_KEY_4, + &game.panel.key[3], + TYPE_ELEMENT, + }, + { + GAME_PANEL_KEY_5, + &game.panel.key[4], + TYPE_ELEMENT, + }, + { + GAME_PANEL_KEY_6, + &game.panel.key[5], + TYPE_ELEMENT, + }, + { + GAME_PANEL_KEY_7, + &game.panel.key[6], + TYPE_ELEMENT, + }, + { + GAME_PANEL_KEY_8, + &game.panel.key[7], + TYPE_ELEMENT, + }, + { + GAME_PANEL_KEY_WHITE, + &game.panel.key_white, + TYPE_ELEMENT, + }, + { + GAME_PANEL_KEY_WHITE_COUNT, + &game.panel.key_white_count, + TYPE_INTEGER, + }, + { + GAME_PANEL_SCORE, + &game.panel.score, + TYPE_INTEGER, + }, + { + GAME_PANEL_TIME, + &game.panel.time, + TYPE_INTEGER, + }, + { + GAME_PANEL_TIME_HH, + &game.panel.time_hh, + TYPE_INTEGER, + }, + { + GAME_PANEL_TIME_MM, + &game.panel.time_mm, + TYPE_INTEGER, + }, + { + GAME_PANEL_TIME_SS, + &game.panel.time_ss, + TYPE_INTEGER, + }, + { + GAME_PANEL_SHIELD_NORMAL, + &game.panel.shield_normal, + TYPE_ELEMENT, + }, + { + GAME_PANEL_SHIELD_NORMAL_TIME, + &game.panel.shield_normal_time, + TYPE_INTEGER, + }, + { + GAME_PANEL_SHIELD_DEADLY, + &game.panel.shield_deadly, + TYPE_ELEMENT, + }, + { + GAME_PANEL_SHIELD_DEADLY_TIME, + &game.panel.shield_deadly_time, + TYPE_INTEGER, + }, + { + GAME_PANEL_EXIT, + &game.panel.exit, + TYPE_ELEMENT, + }, + { + GAME_PANEL_EMC_MAGIC_BALL, + &game.panel.emc_magic_ball, + TYPE_ELEMENT, + }, + { + GAME_PANEL_EMC_MAGIC_BALL_SWITCH, + &game.panel.emc_magic_ball_switch, + TYPE_ELEMENT, + }, + { + GAME_PANEL_LIGHT_SWITCH, + &game.panel.light_switch, + TYPE_ELEMENT, + }, + { + GAME_PANEL_LIGHT_SWITCH_TIME, + &game.panel.light_switch_time, + TYPE_INTEGER, + }, + { + GAME_PANEL_TIMEGATE_SWITCH, + &game.panel.timegate_switch, + TYPE_ELEMENT, + }, + { + GAME_PANEL_TIMEGATE_SWITCH_TIME, + &game.panel.timegate_switch_time, + TYPE_INTEGER, + }, + { + GAME_PANEL_SWITCHGATE_SWITCH, + &game.panel.switchgate_switch, + TYPE_ELEMENT, + }, + { + GAME_PANEL_EMC_LENSES, + &game.panel.emc_lenses, + TYPE_ELEMENT, + }, + { + GAME_PANEL_EMC_LENSES_TIME, + &game.panel.emc_lenses_time, + TYPE_INTEGER, + }, + { + GAME_PANEL_EMC_MAGNIFIER, + &game.panel.emc_magnifier, + TYPE_ELEMENT, + }, + { + GAME_PANEL_EMC_MAGNIFIER_TIME, + &game.panel.emc_magnifier_time, + TYPE_INTEGER, + }, + { + GAME_PANEL_BALLOON_SWITCH, + &game.panel.balloon_switch, + TYPE_ELEMENT, + }, + { + GAME_PANEL_DYNABOMB_NUMBER, + &game.panel.dynabomb_number, + TYPE_INTEGER, + }, + { + GAME_PANEL_DYNABOMB_SIZE, + &game.panel.dynabomb_size, + TYPE_INTEGER, + }, + { + GAME_PANEL_DYNABOMB_POWER, + &game.panel.dynabomb_power, + TYPE_ELEMENT, + }, + { + GAME_PANEL_PENGUINS, + &game.panel.penguins, + TYPE_INTEGER, + }, + { + GAME_PANEL_SOKOBAN_OBJECTS, + &game.panel.sokoban_objects, + TYPE_INTEGER, + }, + { + GAME_PANEL_SOKOBAN_FIELDS, + &game.panel.sokoban_fields, + TYPE_INTEGER, + }, + { + GAME_PANEL_ROBOT_WHEEL, + &game.panel.robot_wheel, + TYPE_ELEMENT, + }, + { + GAME_PANEL_CONVEYOR_BELT_1, + &game.panel.conveyor_belt[0], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CONVEYOR_BELT_2, + &game.panel.conveyor_belt[1], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CONVEYOR_BELT_3, + &game.panel.conveyor_belt[2], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CONVEYOR_BELT_4, + &game.panel.conveyor_belt[3], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CONVEYOR_BELT_1_SWITCH, + &game.panel.conveyor_belt_switch[0], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CONVEYOR_BELT_2_SWITCH, + &game.panel.conveyor_belt_switch[1], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CONVEYOR_BELT_3_SWITCH, + &game.panel.conveyor_belt_switch[2], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CONVEYOR_BELT_4_SWITCH, + &game.panel.conveyor_belt_switch[3], + TYPE_ELEMENT, + }, + { + GAME_PANEL_MAGIC_WALL, + &game.panel.magic_wall, + TYPE_ELEMENT, + }, + { + GAME_PANEL_MAGIC_WALL_TIME, + &game.panel.magic_wall_time, + TYPE_INTEGER, + }, + { + GAME_PANEL_GRAVITY_STATE, + &game.panel.gravity_state, + TYPE_STRING, + }, + { + GAME_PANEL_GRAPHIC_1, + &game.panel.graphic[0], + TYPE_ELEMENT, + }, + { + GAME_PANEL_GRAPHIC_2, + &game.panel.graphic[1], + TYPE_ELEMENT, + }, + { + GAME_PANEL_GRAPHIC_3, + &game.panel.graphic[2], + TYPE_ELEMENT, + }, + { + GAME_PANEL_GRAPHIC_4, + &game.panel.graphic[3], + TYPE_ELEMENT, + }, + { + GAME_PANEL_GRAPHIC_5, + &game.panel.graphic[4], + TYPE_ELEMENT, + }, + { + GAME_PANEL_GRAPHIC_6, + &game.panel.graphic[5], + TYPE_ELEMENT, + }, + { + GAME_PANEL_GRAPHIC_7, + &game.panel.graphic[6], + TYPE_ELEMENT, + }, + { + GAME_PANEL_GRAPHIC_8, + &game.panel.graphic[7], + TYPE_ELEMENT, + }, + { + GAME_PANEL_ELEMENT_1, + &game.panel.element[0], + TYPE_ELEMENT, + }, + { + GAME_PANEL_ELEMENT_2, + &game.panel.element[1], + TYPE_ELEMENT, + }, + { + GAME_PANEL_ELEMENT_3, + &game.panel.element[2], + TYPE_ELEMENT, + }, + { + GAME_PANEL_ELEMENT_4, + &game.panel.element[3], + TYPE_ELEMENT, + }, + { + GAME_PANEL_ELEMENT_5, + &game.panel.element[4], + TYPE_ELEMENT, + }, + { + GAME_PANEL_ELEMENT_6, + &game.panel.element[5], + TYPE_ELEMENT, + }, + { + GAME_PANEL_ELEMENT_7, + &game.panel.element[6], + TYPE_ELEMENT, + }, + { + GAME_PANEL_ELEMENT_8, + &game.panel.element[7], + TYPE_ELEMENT, + }, + { + GAME_PANEL_ELEMENT_COUNT_1, + &game.panel.element_count[0], + TYPE_INTEGER, + }, + { + GAME_PANEL_ELEMENT_COUNT_2, + &game.panel.element_count[1], + TYPE_INTEGER, + }, + { + GAME_PANEL_ELEMENT_COUNT_3, + &game.panel.element_count[2], + TYPE_INTEGER, + }, + { + GAME_PANEL_ELEMENT_COUNT_4, + &game.panel.element_count[3], + TYPE_INTEGER, + }, + { + GAME_PANEL_ELEMENT_COUNT_5, + &game.panel.element_count[4], + TYPE_INTEGER, + }, + { + GAME_PANEL_ELEMENT_COUNT_6, + &game.panel.element_count[5], + TYPE_INTEGER, + }, + { + GAME_PANEL_ELEMENT_COUNT_7, + &game.panel.element_count[6], + TYPE_INTEGER, + }, + { + GAME_PANEL_ELEMENT_COUNT_8, + &game.panel.element_count[7], + TYPE_INTEGER, + }, + { + GAME_PANEL_CE_SCORE_1, + &game.panel.ce_score[0], + TYPE_INTEGER, + }, + { + GAME_PANEL_CE_SCORE_2, + &game.panel.ce_score[1], + TYPE_INTEGER, + }, + { + GAME_PANEL_CE_SCORE_3, + &game.panel.ce_score[2], + TYPE_INTEGER, + }, + { + GAME_PANEL_CE_SCORE_4, + &game.panel.ce_score[3], + TYPE_INTEGER, + }, + { + GAME_PANEL_CE_SCORE_5, + &game.panel.ce_score[4], + TYPE_INTEGER, + }, + { + GAME_PANEL_CE_SCORE_6, + &game.panel.ce_score[5], + TYPE_INTEGER, + }, + { + GAME_PANEL_CE_SCORE_7, + &game.panel.ce_score[6], + TYPE_INTEGER, + }, + { + GAME_PANEL_CE_SCORE_8, + &game.panel.ce_score[7], + TYPE_INTEGER, + }, + { + GAME_PANEL_CE_SCORE_1_ELEMENT, + &game.panel.ce_score_element[0], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CE_SCORE_2_ELEMENT, + &game.panel.ce_score_element[1], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CE_SCORE_3_ELEMENT, + &game.panel.ce_score_element[2], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CE_SCORE_4_ELEMENT, + &game.panel.ce_score_element[3], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CE_SCORE_5_ELEMENT, + &game.panel.ce_score_element[4], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CE_SCORE_6_ELEMENT, + &game.panel.ce_score_element[5], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CE_SCORE_7_ELEMENT, + &game.panel.ce_score_element[6], + TYPE_ELEMENT, + }, + { + GAME_PANEL_CE_SCORE_8_ELEMENT, + &game.panel.ce_score_element[7], + TYPE_ELEMENT, + }, + { + GAME_PANEL_PLAYER_NAME, + &game.panel.player_name, + TYPE_STRING, + }, + { + GAME_PANEL_LEVEL_NAME, + &game.panel.level_name, + TYPE_STRING, + }, + { + GAME_PANEL_LEVEL_AUTHOR, + &game.panel.level_author, + TYPE_STRING, + }, + + { + -1, + NULL, + -1, + } +}; +#endif + + /* values for delayed check of falling and moving elements and for collision */ #define CHECK_DELAY_MOVING 3 #define CHECK_DELAY_FALLING CHECK_DELAY_MOVING @@ -176,6 +896,9 @@ (be) + (e) - EL_SELF > EL_CUSTOM_END ? EL_CUSTOM_END : \ (be) + (e) - EL_SELF) +#define GET_PLAYER_FROM_BITS(p) \ + (EL_PLAYER_1 + ((p) != PLAYER_BITS_ANY ? log_2(p) : 0)) + #define GET_TARGET_ELEMENT(be, e, ch, cv, cs) \ ((e) == EL_TRIGGER_PLAYER ? (ch)->actual_trigger_player : \ (e) == EL_TRIGGER_ELEMENT ? (ch)->actual_trigger_element : \ @@ -244,7 +967,10 @@ ELEMENT_CAN_ENTER_FIELD_BASE_2(e, x, y, IS_FOOD_PIG(Feld[x][y])) #define PENGUIN_CAN_ENTER_FIELD(e, x, y) \ - ELEMENT_CAN_ENTER_FIELD_BASE_2(e, x, y, (Feld[x][y] == EL_EXIT_OPEN ||\ + ELEMENT_CAN_ENTER_FIELD_BASE_2(e, x, y, (Feld[x][y] == EL_EXIT_OPEN || \ + Feld[x][y] == EL_EM_EXIT_OPEN || \ + Feld[x][y] == EL_STEEL_EXIT_OPEN || \ + Feld[x][y] == EL_EM_STEEL_EXIT_OPEN || \ IS_FOOD_PENGUIN(Feld[x][y]))) #define DRAGON_CAN_ENTER_FIELD(e, x, y) \ ELEMENT_CAN_ENTER_FIELD_BASE_2(e, x, y, 0) @@ -291,6 +1017,8 @@ static void CreateField(int, int, int); +static void ResetGfxAnimation(int, int); + static void SetPlayerWaiting(struct PlayerInfo *, boolean); static void AdvanceFrameAndPlayerCounters(int); @@ -380,8 +1108,8 @@ static int getInvisibleFromInvisibleActiveElement(int); static struct GadgetInfo *game_gadget[NUM_GAME_BUTTONS]; /* for detection of endless loops, caused by custom element programming */ -/* (using "MAX_PLAYFIELD_WIDTH" here is just a rough approximation...) */ -#define MAX_ELEMENT_CHANGE_RECURSION_DEPTH (MAX_PLAYFIELD_WIDTH) +/* (using maximal playfield width x 10 is just a rough approximation) */ +#define MAX_ELEMENT_CHANGE_RECURSION_DEPTH (MAX_PLAYFIELD_WIDTH * 10) #define RECURSION_LOOP_DETECTION_START(e, rc) \ { \ @@ -475,33 +1203,89 @@ static struct ChangingElementInfo change_delay_list[] = NULL }, { - EL_SP_EXIT_OPENING, - EL_SP_EXIT_OPEN, + EL_STEEL_EXIT_OPENING, + EL_STEEL_EXIT_OPEN, 29, NULL, NULL, NULL }, { - EL_SP_EXIT_CLOSING, - EL_SP_EXIT_CLOSED, + EL_STEEL_EXIT_CLOSING, + EL_STEEL_EXIT_CLOSED, 29, NULL, NULL, NULL }, { - EL_SWITCHGATE_OPENING, - EL_SWITCHGATE_OPEN, + EL_EM_EXIT_OPENING, + EL_EM_EXIT_OPEN, 29, NULL, NULL, NULL }, { - EL_SWITCHGATE_CLOSING, - EL_SWITCHGATE_CLOSED, - 29, + EL_EM_EXIT_CLOSING, +#if 1 + EL_EMPTY, +#else + EL_EM_EXIT_CLOSED, +#endif + 29, + NULL, + NULL, + NULL + }, + { + EL_EM_STEEL_EXIT_OPENING, + EL_EM_STEEL_EXIT_OPEN, + 29, + NULL, + NULL, + NULL + }, + { + EL_EM_STEEL_EXIT_CLOSING, +#if 1 + EL_STEELWALL, +#else + EL_EM_STEEL_EXIT_CLOSED, +#endif + 29, + NULL, + NULL, + NULL + }, + { + EL_SP_EXIT_OPENING, + EL_SP_EXIT_OPEN, + 29, + NULL, + NULL, + NULL + }, + { + EL_SP_EXIT_CLOSING, + EL_SP_EXIT_CLOSED, + 29, + NULL, + NULL, + NULL + }, + { + EL_SWITCHGATE_OPENING, + EL_SWITCHGATE_OPEN, + 29, + NULL, + NULL, + NULL + }, + { + EL_SWITCHGATE_CLOSING, + EL_SWITCHGATE_CLOSED, + 29, NULL, NULL, NULL @@ -595,6 +1379,14 @@ static struct ChangingElementInfo change_delay_list[] = RunTimegateWheel, NULL }, + { + EL_DC_TIMEGATE_SWITCH_ACTIVE, + EL_DC_TIMEGATE_SWITCH, + 0, + InitTimegateWheel, + RunTimegateWheel, + NULL + }, { EL_EMC_MAGIC_BALL_ACTIVE, EL_EMC_MAGIC_BALL_ACTIVE, @@ -667,10 +1459,14 @@ move_stepsize_list[] = { EL_AMOEBA_DROPPING, 2 }, { EL_QUICKSAND_FILLING, 1 }, { EL_QUICKSAND_EMPTYING, 1 }, + { EL_QUICKSAND_FAST_FILLING, 2 }, + { EL_QUICKSAND_FAST_EMPTYING, 2 }, { EL_MAGIC_WALL_FILLING, 2 }, - { EL_BD_MAGIC_WALL_FILLING, 2 }, { EL_MAGIC_WALL_EMPTYING, 2 }, + { EL_BD_MAGIC_WALL_FILLING, 2 }, { EL_BD_MAGIC_WALL_EMPTYING, 2 }, + { EL_DC_MAGIC_WALL_FILLING, 2 }, + { EL_DC_MAGIC_WALL_EMPTYING, 2 }, { EL_UNDEFINED, 0 }, }; @@ -757,7 +1553,7 @@ static int playfield_scan_delta_y = 1; (y) += playfield_scan_delta_y) \ for ((x) = playfield_scan_start_x; \ (x) >= 0 && (x) <= lev_fieldx - 1; \ - (x) += playfield_scan_delta_x) \ + (x) += playfield_scan_delta_x) #ifdef DEBUG void DEBUG_SetMaximumDynamite() @@ -836,6 +1632,8 @@ static void SetPlayerMoveSpeed(struct PlayerInfo *player, int move_stepsize, void GetPlayerConfig() { + GameFrameDelay = setup.game_frame_delay; + if (!audio.sound_available) setup.sound_simple = FALSE; @@ -854,58 +1652,7 @@ void GetPlayerConfig() InitJoysticks(); } -static int getBeltNrFromBeltElement(int element) -{ - return (element < EL_CONVEYOR_BELT_2_LEFT ? 0 : - element < EL_CONVEYOR_BELT_3_LEFT ? 1 : - element < EL_CONVEYOR_BELT_4_LEFT ? 2 : 3); -} - -static int getBeltNrFromBeltActiveElement(int element) -{ - return (element < EL_CONVEYOR_BELT_2_LEFT_ACTIVE ? 0 : - element < EL_CONVEYOR_BELT_3_LEFT_ACTIVE ? 1 : - element < EL_CONVEYOR_BELT_4_LEFT_ACTIVE ? 2 : 3); -} - -static int getBeltNrFromBeltSwitchElement(int element) -{ - return (element < EL_CONVEYOR_BELT_2_SWITCH_LEFT ? 0 : - element < EL_CONVEYOR_BELT_3_SWITCH_LEFT ? 1 : - element < EL_CONVEYOR_BELT_4_SWITCH_LEFT ? 2 : 3); -} - -static int getBeltDirNrFromBeltSwitchElement(int element) -{ - static int belt_base_element[4] = - { - EL_CONVEYOR_BELT_1_SWITCH_LEFT, - EL_CONVEYOR_BELT_2_SWITCH_LEFT, - EL_CONVEYOR_BELT_3_SWITCH_LEFT, - EL_CONVEYOR_BELT_4_SWITCH_LEFT - }; - - int belt_nr = getBeltNrFromBeltSwitchElement(element); - int belt_dir_nr = element - belt_base_element[belt_nr]; - - return (belt_dir_nr % 3); -} - -static int getBeltDirFromBeltSwitchElement(int element) -{ - static int belt_move_dir[3] = - { - MV_LEFT, - MV_NONE, - MV_RIGHT - }; - - int belt_dir_nr = getBeltDirNrFromBeltSwitchElement(element); - - return belt_move_dir[belt_dir_nr]; -} - -static int get_element_from_group_element(int element) +int GetElementFromGroupElement(int element) { if (IS_GROUP_ELEMENT(element)) { @@ -1160,6 +1907,11 @@ static void InitField(int x, int y, boolean init_game) if (init_game) Feld[x][y] = EL_SWITCHGATE_SWITCH_UP; break; + + case EL_DC_SWITCHGATE_SWITCH_DOWN: /* always start with same switch pos */ + if (init_game) + Feld[x][y] = EL_DC_SWITCHGATE_SWITCH_UP; + break; #endif case EL_LIGHT_SWITCH_ACTIVE: @@ -1195,73 +1947,1063 @@ static void InitField(int x, int y, boolean init_game) if (!element_info[element].use_last_ce_value || init_game) CustomValue[x][y] = GET_NEW_CE_VALUE(Feld[x][y]); #endif - } - else if (IS_GROUP_ELEMENT(element)) - { - Feld[x][y] = get_element_from_group_element(element); + } + else if (IS_GROUP_ELEMENT(element)) + { + Feld[x][y] = GetElementFromGroupElement(element); + + InitField(x, y, init_game); + } + + break; + } + + if (!init_game) + CheckTriggeredElementChange(x, y, element, CE_CREATION_OF_X); +} + +static inline void InitField_WithBug1(int x, int y, boolean init_game) +{ + InitField(x, y, init_game); + + /* not needed to call InitMovDir() -- already done by InitField()! */ + if (game.engine_version < VERSION_IDENT(3,1,0,0) && + CAN_MOVE(Feld[x][y])) + InitMovDir(x, y); +} + +static inline void InitField_WithBug2(int x, int y, boolean init_game) +{ + int old_element = Feld[x][y]; + + InitField(x, y, init_game); + + /* not needed to call InitMovDir() -- already done by InitField()! */ + if (game.engine_version < VERSION_IDENT(3,1,0,0) && + CAN_MOVE(old_element) && + (old_element < EL_MOLE_LEFT || old_element > EL_MOLE_DOWN)) + InitMovDir(x, y); + + /* this case is in fact a combination of not less than three bugs: + first, it calls InitMovDir() for elements that can move, although this is + already done by InitField(); then, it checks the element that was at this + field _before_ the call to InitField() (which can change it); lastly, it + was not called for "mole with direction" elements, which were treated as + "cannot move" due to (fixed) wrong element initialization in "src/init.c" + */ +} + +#if 1 + +static int get_key_element_from_nr(int key_nr) +{ + int key_base_element = (key_nr >= STD_NUM_KEYS ? EL_EMC_KEY_5 - STD_NUM_KEYS : + level.game_engine_type == GAME_ENGINE_TYPE_EM ? + EL_EM_KEY_1 : EL_KEY_1); + + return key_base_element + key_nr; +} + +static int get_next_dropped_element(struct PlayerInfo *player) +{ + return (player->inventory_size > 0 ? + player->inventory_element[player->inventory_size - 1] : + player->inventory_infinite_element != EL_UNDEFINED ? + player->inventory_infinite_element : + player->dynabombs_left > 0 ? + EL_DYNABOMB_PLAYER_1_ACTIVE + player->index_nr : + EL_UNDEFINED); +} + +static int get_inventory_element_from_pos(struct PlayerInfo *player, int pos) +{ + /* pos >= 0: get element from bottom of the stack; + pos < 0: get element from top of the stack */ + + if (pos < 0) + { + int min_inventory_size = -pos; + int inventory_pos = player->inventory_size - min_inventory_size; + int min_dynabombs_left = min_inventory_size - player->inventory_size; + + return (player->inventory_size >= min_inventory_size ? + player->inventory_element[inventory_pos] : + player->inventory_infinite_element != EL_UNDEFINED ? + player->inventory_infinite_element : + player->dynabombs_left >= min_dynabombs_left ? + EL_DYNABOMB_PLAYER_1 + player->index_nr : + EL_UNDEFINED); + } + else + { + int min_dynabombs_left = pos + 1; + int min_inventory_size = pos + 1 - player->dynabombs_left; + int inventory_pos = pos - player->dynabombs_left; + + return (player->inventory_infinite_element != EL_UNDEFINED ? + player->inventory_infinite_element : + player->dynabombs_left >= min_dynabombs_left ? + EL_DYNABOMB_PLAYER_1 + player->index_nr : + player->inventory_size >= min_inventory_size ? + player->inventory_element[inventory_pos] : + EL_UNDEFINED); + } +} + +static int compareGamePanelOrderInfo(const void *object1, const void *object2) +{ + const struct GamePanelOrderInfo *gpo1 = (struct GamePanelOrderInfo *)object1; + const struct GamePanelOrderInfo *gpo2 = (struct GamePanelOrderInfo *)object2; + int compare_result; + + if (gpo1->sort_priority != gpo2->sort_priority) + compare_result = gpo1->sort_priority - gpo2->sort_priority; + else + compare_result = gpo1->nr - gpo2->nr; + + return compare_result; +} + +void InitGameControlValues() +{ + int i; + + for (i = 0; game_panel_controls[i].nr != -1; i++) + { + struct GamePanelControlInfo *gpc = &game_panel_controls[i]; + struct GamePanelOrderInfo *gpo = &game_panel_order[i]; + struct TextPosInfo *pos = gpc->pos; + int nr = gpc->nr; + int type = gpc->type; + + if (nr != i) + { + Error(ERR_INFO, "'game_panel_controls' structure corrupted"); + Error(ERR_EXIT, "this should not happen -- please debug"); + } + + /* force update of game controls after initialization */ + gpc->value = gpc->last_value = -1; + gpc->frame = gpc->last_frame = -1; + gpc->gfx_frame = -1; + + /* determine panel value width for later calculation of alignment */ + if (type == TYPE_INTEGER || type == TYPE_STRING) + { + pos->width = pos->size * getFontWidth(pos->font); + pos->height = getFontHeight(pos->font); + } + else if (type == TYPE_ELEMENT) + { + pos->width = pos->size; + pos->height = pos->size; + } + + /* fill structure for game panel draw order */ + gpo->nr = gpc->nr; + gpo->sort_priority = pos->sort_priority; + } + + /* sort game panel controls according to sort_priority and control number */ + qsort(game_panel_order, NUM_GAME_PANEL_CONTROLS, + sizeof(struct GamePanelOrderInfo), compareGamePanelOrderInfo); +} + +void UpdatePlayfieldElementCount() +{ + boolean use_element_count = FALSE; + int i, j, x, y; + + /* first check if it is needed at all to calculate playfield element count */ + for (i = GAME_PANEL_ELEMENT_COUNT_1; i <= GAME_PANEL_ELEMENT_COUNT_8; i++) + if (!PANEL_DEACTIVATED(game_panel_controls[i].pos)) + use_element_count = TRUE; + + if (!use_element_count) + return; + + for (i = 0; i < MAX_NUM_ELEMENTS; i++) + element_info[i].element_count = 0; + + SCAN_PLAYFIELD(x, y) + { + element_info[Feld[x][y]].element_count++; + } + + for (i = 0; i < NUM_GROUP_ELEMENTS; i++) + for (j = 0; j < MAX_NUM_ELEMENTS; j++) + if (IS_IN_GROUP(j, i)) + element_info[EL_GROUP_START + i].element_count += + element_info[j].element_count; +} + +void UpdateGameControlValues() +{ + int i, k; + int time = (local_player->LevelSolved ? + local_player->LevelSolved_CountingTime : + level.game_engine_type == GAME_ENGINE_TYPE_EM ? + level.native_em_level->lev->time : + level.time == 0 ? TimePlayed : TimeLeft); + int score = (local_player->LevelSolved ? + local_player->LevelSolved_CountingScore : + level.game_engine_type == GAME_ENGINE_TYPE_EM ? + level.native_em_level->lev->score : + local_player->score); + int gems = (level.game_engine_type == GAME_ENGINE_TYPE_EM ? + level.native_em_level->lev->required : + local_player->gems_still_needed); + int exit_closed = (level.game_engine_type == GAME_ENGINE_TYPE_EM ? + level.native_em_level->lev->required > 0 : + local_player->gems_still_needed > 0 || + local_player->sokobanfields_still_needed > 0 || + local_player->lights_still_needed > 0); + + UpdatePlayfieldElementCount(); + + /* update game panel control values */ + + game_panel_controls[GAME_PANEL_LEVEL_NUMBER].value = level_nr; + game_panel_controls[GAME_PANEL_GEMS].value = gems; + + game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value = 0; + for (i = 0; i < MAX_NUM_KEYS; i++) + game_panel_controls[GAME_PANEL_KEY_1 + i].value = EL_EMPTY; + game_panel_controls[GAME_PANEL_KEY_WHITE].value = EL_EMPTY; + game_panel_controls[GAME_PANEL_KEY_WHITE_COUNT].value = 0; + + if (game.centered_player_nr == -1) + { + for (i = 0; i < MAX_PLAYERS; i++) + { + for (k = 0; k < MAX_NUM_KEYS; k++) + { + if (level.game_engine_type == GAME_ENGINE_TYPE_EM) + { + if (level.native_em_level->ply[i]->keys & (1 << k)) + game_panel_controls[GAME_PANEL_KEY_1 + k].value = + get_key_element_from_nr(k); + } + else if (stored_player[i].key[k]) + game_panel_controls[GAME_PANEL_KEY_1 + k].value = + get_key_element_from_nr(k); + } + + if (level.game_engine_type == GAME_ENGINE_TYPE_EM) + game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value += + level.native_em_level->ply[i]->dynamite; + else + game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value += + stored_player[i].inventory_size; + + if (stored_player[i].num_white_keys > 0) + game_panel_controls[GAME_PANEL_KEY_WHITE].value = + EL_DC_KEY_WHITE; + + game_panel_controls[GAME_PANEL_KEY_WHITE_COUNT].value += + stored_player[i].num_white_keys; + } + } + else + { + int player_nr = game.centered_player_nr; + + for (k = 0; k < MAX_NUM_KEYS; k++) + { + if (level.game_engine_type == GAME_ENGINE_TYPE_EM) + { + if (level.native_em_level->ply[player_nr]->keys & (1 << k)) + game_panel_controls[GAME_PANEL_KEY_1 + k].value = + get_key_element_from_nr(k); + } + else if (stored_player[player_nr].key[k]) + game_panel_controls[GAME_PANEL_KEY_1 + k].value = + get_key_element_from_nr(k); + } + + if (level.game_engine_type == GAME_ENGINE_TYPE_EM) + game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value += + level.native_em_level->ply[player_nr]->dynamite; + else + game_panel_controls[GAME_PANEL_INVENTORY_COUNT].value += + stored_player[player_nr].inventory_size; + + if (stored_player[player_nr].num_white_keys > 0) + game_panel_controls[GAME_PANEL_KEY_WHITE].value = EL_DC_KEY_WHITE; + + game_panel_controls[GAME_PANEL_KEY_WHITE_COUNT].value += + stored_player[player_nr].num_white_keys; + } + + for (i = 0; i < NUM_PANEL_INVENTORY; i++) + { + game_panel_controls[GAME_PANEL_INVENTORY_FIRST_1 + i].value = + get_inventory_element_from_pos(local_player, i); + game_panel_controls[GAME_PANEL_INVENTORY_LAST_1 + i].value = + get_inventory_element_from_pos(local_player, -i - 1); + } + + game_panel_controls[GAME_PANEL_SCORE].value = score; + + game_panel_controls[GAME_PANEL_TIME].value = time; + + game_panel_controls[GAME_PANEL_TIME_HH].value = time / 3600; + game_panel_controls[GAME_PANEL_TIME_MM].value = (time / 60) % 60; + game_panel_controls[GAME_PANEL_TIME_SS].value = time % 60; + + game_panel_controls[GAME_PANEL_SHIELD_NORMAL].value = + (local_player->shield_normal_time_left > 0 ? EL_SHIELD_NORMAL_ACTIVE : + EL_EMPTY); + game_panel_controls[GAME_PANEL_SHIELD_NORMAL_TIME].value = + local_player->shield_normal_time_left; + game_panel_controls[GAME_PANEL_SHIELD_DEADLY].value = + (local_player->shield_deadly_time_left > 0 ? EL_SHIELD_DEADLY_ACTIVE : + EL_EMPTY); + game_panel_controls[GAME_PANEL_SHIELD_DEADLY_TIME].value = + local_player->shield_deadly_time_left; + + game_panel_controls[GAME_PANEL_EXIT].value = + (exit_closed ? EL_EXIT_CLOSED : EL_EXIT_OPEN); + + game_panel_controls[GAME_PANEL_EMC_MAGIC_BALL].value = + (game.ball_state ? EL_EMC_MAGIC_BALL_ACTIVE : EL_EMC_MAGIC_BALL); + game_panel_controls[GAME_PANEL_EMC_MAGIC_BALL_SWITCH].value = + (game.ball_state ? EL_EMC_MAGIC_BALL_SWITCH_ACTIVE : + EL_EMC_MAGIC_BALL_SWITCH); + + game_panel_controls[GAME_PANEL_LIGHT_SWITCH].value = + (game.light_time_left > 0 ? EL_LIGHT_SWITCH_ACTIVE : EL_LIGHT_SWITCH); + game_panel_controls[GAME_PANEL_LIGHT_SWITCH_TIME].value = + game.light_time_left; + + game_panel_controls[GAME_PANEL_TIMEGATE_SWITCH].value = + (game.timegate_time_left > 0 ? EL_TIMEGATE_OPEN : EL_TIMEGATE_CLOSED); + game_panel_controls[GAME_PANEL_TIMEGATE_SWITCH_TIME].value = + game.timegate_time_left; + + game_panel_controls[GAME_PANEL_SWITCHGATE_SWITCH].value = + EL_SWITCHGATE_SWITCH_UP + game.switchgate_pos; + + game_panel_controls[GAME_PANEL_EMC_LENSES].value = + (game.lenses_time_left > 0 ? EL_EMC_LENSES : EL_EMPTY); + game_panel_controls[GAME_PANEL_EMC_LENSES_TIME].value = + game.lenses_time_left; + + game_panel_controls[GAME_PANEL_EMC_MAGNIFIER].value = + (game.magnify_time_left > 0 ? EL_EMC_MAGNIFIER : EL_EMPTY); + game_panel_controls[GAME_PANEL_EMC_MAGNIFIER_TIME].value = + game.magnify_time_left; + + game_panel_controls[GAME_PANEL_BALLOON_SWITCH].value = + (game.wind_direction == MV_LEFT ? EL_BALLOON_SWITCH_LEFT : + game.wind_direction == MV_RIGHT ? EL_BALLOON_SWITCH_RIGHT : + game.wind_direction == MV_UP ? EL_BALLOON_SWITCH_UP : + game.wind_direction == MV_DOWN ? EL_BALLOON_SWITCH_DOWN : + EL_BALLOON_SWITCH_NONE); + + game_panel_controls[GAME_PANEL_DYNABOMB_NUMBER].value = + local_player->dynabomb_count; + game_panel_controls[GAME_PANEL_DYNABOMB_SIZE].value = + local_player->dynabomb_size; + game_panel_controls[GAME_PANEL_DYNABOMB_POWER].value = + (local_player->dynabomb_xl ? EL_DYNABOMB_INCREASE_POWER : EL_EMPTY); + + game_panel_controls[GAME_PANEL_PENGUINS].value = + local_player->friends_still_needed; + + game_panel_controls[GAME_PANEL_SOKOBAN_OBJECTS].value = + local_player->sokobanfields_still_needed; + game_panel_controls[GAME_PANEL_SOKOBAN_FIELDS].value = + local_player->sokobanfields_still_needed; + + game_panel_controls[GAME_PANEL_ROBOT_WHEEL].value = + (game.robot_wheel_active ? EL_ROBOT_WHEEL_ACTIVE : EL_ROBOT_WHEEL); + + for (i = 0; i < NUM_BELTS; i++) + { + game_panel_controls[GAME_PANEL_CONVEYOR_BELT_1 + i].value = + (game.belt_dir[i] != MV_NONE ? EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE : + EL_CONVEYOR_BELT_1_MIDDLE) + i; + game_panel_controls[GAME_PANEL_CONVEYOR_BELT_1_SWITCH + i].value = + getBeltSwitchElementFromBeltNrAndBeltDir(i, game.belt_dir[i]); + } + + game_panel_controls[GAME_PANEL_MAGIC_WALL].value = + (game.magic_wall_active ? EL_MAGIC_WALL_ACTIVE : EL_MAGIC_WALL); + game_panel_controls[GAME_PANEL_MAGIC_WALL_TIME].value = + game.magic_wall_time_left; + +#if USE_PLAYER_GRAVITY + game_panel_controls[GAME_PANEL_GRAVITY_STATE].value = + local_player->gravity; +#else + game_panel_controls[GAME_PANEL_GRAVITY_STATE].value = game.gravity; +#endif + + for (i = 0; i < NUM_PANEL_GRAPHICS; i++) + game_panel_controls[GAME_PANEL_GRAPHIC_1 + i].value = EL_GRAPHIC_1 + i; + + for (i = 0; i < NUM_PANEL_ELEMENTS; i++) + game_panel_controls[GAME_PANEL_ELEMENT_1 + i].value = + (IS_DRAWABLE_ELEMENT(game.panel.element[i].id) ? + game.panel.element[i].id : EL_UNDEFINED); + + for (i = 0; i < NUM_PANEL_ELEMENTS; i++) + game_panel_controls[GAME_PANEL_ELEMENT_COUNT_1 + i].value = + (IS_VALID_ELEMENT(game.panel.element_count[i].id) ? + element_info[game.panel.element_count[i].id].element_count : 0); + + for (i = 0; i < NUM_PANEL_CE_SCORE; i++) + game_panel_controls[GAME_PANEL_CE_SCORE_1 + i].value = + (IS_CUSTOM_ELEMENT(game.panel.ce_score[i].id) ? + element_info[game.panel.ce_score[i].id].collect_score : 0); + + for (i = 0; i < NUM_PANEL_CE_SCORE; i++) + game_panel_controls[GAME_PANEL_CE_SCORE_1_ELEMENT + i].value = + (IS_CUSTOM_ELEMENT(game.panel.ce_score_element[i].id) ? + element_info[game.panel.ce_score_element[i].id].collect_score : + EL_UNDEFINED); + + game_panel_controls[GAME_PANEL_PLAYER_NAME].value = 0; + game_panel_controls[GAME_PANEL_LEVEL_NAME].value = 0; + game_panel_controls[GAME_PANEL_LEVEL_AUTHOR].value = 0; + + /* update game panel control frames */ + + for (i = 0; game_panel_controls[i].nr != -1; i++) + { + struct GamePanelControlInfo *gpc = &game_panel_controls[i]; + + if (gpc->type == TYPE_ELEMENT) + { + int last_anim_random_frame = gfx.anim_random_frame; + int element = gpc->value; + int graphic = el2panelimg(element); + + if (gpc->value != gpc->last_value) + { + gpc->gfx_frame = 0; + gpc->gfx_random = INIT_GFX_RANDOM(); + } + else + { + gpc->gfx_frame++; + + if (ANIM_MODE(graphic) == ANIM_RANDOM && + IS_NEXT_FRAME(gpc->gfx_frame, graphic)) + gpc->gfx_random = INIT_GFX_RANDOM(); + } + + if (ANIM_MODE(graphic) == ANIM_RANDOM) + gfx.anim_random_frame = gpc->gfx_random; + + if (ANIM_MODE(graphic) == ANIM_CE_SCORE) + gpc->gfx_frame = element_info[element].collect_score; + + gpc->frame = getGraphicAnimationFrame(el2panelimg(gpc->value), + gpc->gfx_frame); + + if (ANIM_MODE(graphic) == ANIM_RANDOM) + gfx.anim_random_frame = last_anim_random_frame; + } + } +} + +void DisplayGameControlValues() +{ + boolean redraw_panel = FALSE; + int i; + + for (i = 0; game_panel_controls[i].nr != -1; i++) + { + struct GamePanelControlInfo *gpc = &game_panel_controls[i]; + + if (PANEL_DEACTIVATED(gpc->pos)) + continue; + + if (gpc->value == gpc->last_value && + gpc->frame == gpc->last_frame) + continue; + + redraw_panel = TRUE; + } + + if (!redraw_panel) + return; + + /* copy default game door content to main double buffer */ + BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto, + DOOR_GFX_PAGEX5, DOOR_GFX_PAGEY1, DXSIZE, DYSIZE, DX, DY); + + /* redraw game control buttons */ +#if 1 + RedrawGameButtons(); +#else + UnmapGameButtons(); + MapGameButtons(); +#endif + + game_status = GAME_MODE_PSEUDO_PANEL; + +#if 1 + for (i = 0; i < NUM_GAME_PANEL_CONTROLS; i++) +#else + for (i = 0; game_panel_controls[i].nr != -1; i++) +#endif + { +#if 1 + int nr = game_panel_order[i].nr; + struct GamePanelControlInfo *gpc = &game_panel_controls[nr]; +#else + struct GamePanelControlInfo *gpc = &game_panel_controls[i]; + int nr = gpc->nr; +#endif + struct TextPosInfo *pos = gpc->pos; + int type = gpc->type; + int value = gpc->value; + int frame = gpc->frame; +#if 0 + int last_value = gpc->last_value; + int last_frame = gpc->last_frame; +#endif + int size = pos->size; + int font = pos->font; + boolean draw_masked = pos->draw_masked; + int mask_mode = (draw_masked ? BLIT_MASKED : BLIT_OPAQUE); + + if (PANEL_DEACTIVATED(pos)) + continue; + +#if 0 + if (value == last_value && frame == last_frame) + continue; +#endif + + gpc->last_value = value; + gpc->last_frame = frame; + +#if 0 + printf("::: value %d changed from %d to %d\n", nr, last_value, value); +#endif + + if (type == TYPE_INTEGER) + { + if (nr == GAME_PANEL_LEVEL_NUMBER || + nr == GAME_PANEL_TIME) + { + boolean use_dynamic_size = (size == -1 ? TRUE : FALSE); + + if (use_dynamic_size) /* use dynamic number of digits */ + { + int value_change = (nr == GAME_PANEL_LEVEL_NUMBER ? 100 : 1000); + int size1 = (nr == GAME_PANEL_LEVEL_NUMBER ? 2 : 3); + int size2 = size1 + 1; + int font1 = pos->font; + int font2 = pos->font_alt; + + size = (value < value_change ? size1 : size2); + font = (value < value_change ? font1 : font2); + +#if 0 + /* clear background if value just changed its size (dynamic digits) */ + if ((last_value < value_change) != (value < value_change)) + { + int width1 = size1 * getFontWidth(font1); + int width2 = size2 * getFontWidth(font2); + int max_width = MAX(width1, width2); + int max_height = MAX(getFontHeight(font1), getFontHeight(font2)); + + pos->width = max_width; + + ClearRectangleOnBackground(drawto, PANEL_XPOS(pos), PANEL_YPOS(pos), + max_width, max_height); + } +#endif + } + } + +#if 1 + /* correct text size if "digits" is zero or less */ + if (size <= 0) + size = strlen(int2str(value, size)); + + /* dynamically correct text alignment */ + pos->width = size * getFontWidth(font); +#endif + + DrawTextExt(drawto, PANEL_XPOS(pos), PANEL_YPOS(pos), + int2str(value, size), font, mask_mode); + } + else if (type == TYPE_ELEMENT) + { + int element, graphic; + Bitmap *src_bitmap; + int src_x, src_y; + int width, height; + int dst_x = PANEL_XPOS(pos); + int dst_y = PANEL_YPOS(pos); + +#if 1 + if (value != EL_UNDEFINED && value != EL_EMPTY) + { + element = value; + graphic = el2panelimg(value); + + // printf("::: %d, '%s' [%d]\n", element, EL_NAME(element), size); + +#if 1 + if (element >= EL_GRAPHIC_1 && element <= EL_GRAPHIC_8 && size == 0) + size = TILESIZE; +#endif + + getSizedGraphicSource(graphic, frame, size, &src_bitmap, + &src_x, &src_y); + + width = graphic_info[graphic].width * size / TILESIZE; + height = graphic_info[graphic].height * size / TILESIZE; + + if (draw_masked) + { + SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc, + dst_x - src_x, dst_y - src_y); + BlitBitmapMasked(src_bitmap, drawto, src_x, src_y, width, height, + dst_x, dst_y); + } + else + { + BlitBitmap(src_bitmap, drawto, src_x, src_y, width, height, + dst_x, dst_y); + } + } +#else + if (value == EL_UNDEFINED || value == EL_EMPTY) + { + element = (last_value == EL_UNDEFINED ? EL_EMPTY : last_value); + graphic = el2panelimg(element); + + src_bitmap = graphic_info[IMG_GLOBAL_DOOR].bitmap; + src_x = DOOR_GFX_PAGEX5 + ALIGNED_TEXT_XPOS(pos); + src_y = DOOR_GFX_PAGEY1 + ALIGNED_TEXT_YPOS(pos); + } + else + { + element = value; + graphic = el2panelimg(value); + + getSizedGraphicSource(graphic, frame, size, &src_bitmap, &src_x,&src_y); + } + + width = graphic_info[graphic].width * size / TILESIZE; + height = graphic_info[graphic].height * size / TILESIZE; + + BlitBitmap(src_bitmap, drawto, src_x, src_y, width, height, dst_x, dst_y); +#endif + } + else if (type == TYPE_STRING) + { + boolean active = (value != 0); + char *state_normal = "off"; + char *state_active = "on"; + char *state = (active ? state_active : state_normal); + char *s = (nr == GAME_PANEL_GRAVITY_STATE ? state : + nr == GAME_PANEL_PLAYER_NAME ? setup.player_name : + nr == GAME_PANEL_LEVEL_NAME ? level.name : + nr == GAME_PANEL_LEVEL_AUTHOR ? level.author : NULL); + + if (nr == GAME_PANEL_GRAVITY_STATE) + { + int font1 = pos->font; /* (used for normal state) */ + int font2 = pos->font_alt; /* (used for active state) */ +#if 0 + int size1 = strlen(state_normal); + int size2 = strlen(state_active); + int width1 = size1 * getFontWidth(font1); + int width2 = size2 * getFontWidth(font2); + int max_width = MAX(width1, width2); + int max_height = MAX(getFontHeight(font1), getFontHeight(font2)); + + pos->width = max_width; + + /* clear background for values that may have changed its size */ + ClearRectangleOnBackground(drawto, PANEL_XPOS(pos), PANEL_YPOS(pos), + max_width, max_height); +#endif + + font = (active ? font2 : font1); + } + + if (s != NULL) + { + char *s_cut; + +#if 1 + if (size <= 0) + { + /* don't truncate output if "chars" is zero or less */ + size = strlen(s); + + /* dynamically correct text alignment */ + pos->width = size * getFontWidth(font); + } +#endif + + s_cut = getStringCopyN(s, size); + + DrawTextExt(drawto, PANEL_XPOS(pos), PANEL_YPOS(pos), + s_cut, font, mask_mode); + + free(s_cut); + } + } + + redraw_mask |= REDRAW_DOOR_1; + } + + game_status = GAME_MODE_PLAYING; +} + +void UpdateAndDisplayGameControlValues() +{ + if (tape.warp_forward) + return; + + UpdateGameControlValues(); + DisplayGameControlValues(); +} + +void DrawGameValue_Emeralds(int value) +{ + struct TextPosInfo *pos = &game.panel.gems; +#if 1 + int font_nr = pos->font; +#else + int font_nr = FONT_TEXT_2; +#endif + int font_width = getFontWidth(font_nr); + int chars = pos->size; + +#if 1 + return; /* !!! USE NEW STUFF !!! */ +#endif + + if (PANEL_DEACTIVATED(pos)) + return; + + pos->width = chars * font_width; + + DrawText(PANEL_XPOS(pos), PANEL_YPOS(pos), int2str(value, chars), font_nr); +} + +void DrawGameValue_Dynamite(int value) +{ + struct TextPosInfo *pos = &game.panel.inventory_count; +#if 1 + int font_nr = pos->font; +#else + int font_nr = FONT_TEXT_2; +#endif + int font_width = getFontWidth(font_nr); + int chars = pos->size; + +#if 1 + return; /* !!! USE NEW STUFF !!! */ +#endif + + if (PANEL_DEACTIVATED(pos)) + return; + + pos->width = chars * font_width; + + DrawText(PANEL_XPOS(pos), PANEL_YPOS(pos), int2str(value, chars), font_nr); +} + +void DrawGameValue_Score(int value) +{ + struct TextPosInfo *pos = &game.panel.score; +#if 1 + int font_nr = pos->font; +#else + int font_nr = FONT_TEXT_2; +#endif + int font_width = getFontWidth(font_nr); + int chars = pos->size; + +#if 1 + return; /* !!! USE NEW STUFF !!! */ +#endif + + if (PANEL_DEACTIVATED(pos)) + return; + + pos->width = chars * font_width; + + DrawText(PANEL_XPOS(pos), PANEL_YPOS(pos), int2str(value, chars), font_nr); +} + +void DrawGameValue_Time(int value) +{ + struct TextPosInfo *pos = &game.panel.time; + static int last_value = -1; + int chars1 = 3; + int chars2 = 4; + int chars = pos->size; +#if 1 + int font1_nr = pos->font; + int font2_nr = pos->font_alt; +#else + int font1_nr = FONT_TEXT_2; + int font2_nr = FONT_TEXT_1; +#endif + int font_nr = font1_nr; + boolean use_dynamic_chars = (chars == -1 ? TRUE : FALSE); + +#if 1 + return; /* !!! USE NEW STUFF !!! */ +#endif + + if (PANEL_DEACTIVATED(pos)) + return; + + if (use_dynamic_chars) /* use dynamic number of chars */ + { + chars = (value < 1000 ? chars1 : chars2); + font_nr = (value < 1000 ? font1_nr : font2_nr); + } + + /* clear background if value just changed its size (dynamic chars only) */ + if (use_dynamic_chars && (last_value < 1000) != (value < 1000)) + { + int width1 = chars1 * getFontWidth(font1_nr); + int width2 = chars2 * getFontWidth(font2_nr); + int max_width = MAX(width1, width2); + int max_height = MAX(getFontHeight(font1_nr), getFontHeight(font2_nr)); + + pos->width = max_width; + + ClearRectangleOnBackground(drawto, PANEL_XPOS(pos), PANEL_YPOS(pos), + max_width, max_height); + } + + pos->width = chars * getFontWidth(font_nr); + + DrawText(PANEL_XPOS(pos), PANEL_YPOS(pos), int2str(value, chars), font_nr); + + last_value = value; +} + +void DrawGameValue_Level(int value) +{ + struct TextPosInfo *pos = &game.panel.level_number; + int chars1 = 2; + int chars2 = 3; + int chars = pos->size; +#if 1 + int font1_nr = pos->font; + int font2_nr = pos->font_alt; +#else + int font1_nr = FONT_TEXT_2; + int font2_nr = FONT_TEXT_1; +#endif + int font_nr = font1_nr; + boolean use_dynamic_chars = (chars == -1 ? TRUE : FALSE); + +#if 1 + return; /* !!! USE NEW STUFF !!! */ +#endif + + if (PANEL_DEACTIVATED(pos)) + return; + + if (use_dynamic_chars) /* use dynamic number of chars */ + { + chars = (level_nr < 100 ? chars1 : chars2); + font_nr = (level_nr < 100 ? font1_nr : font2_nr); + } + + pos->width = chars * getFontWidth(font_nr); + + DrawText(PANEL_XPOS(pos), PANEL_YPOS(pos), int2str(value, chars), font_nr); +} + +void DrawGameValue_Keys(int key[MAX_NUM_KEYS]) +{ +#if 0 + struct TextPosInfo *pos = &game.panel.keys; +#endif +#if 0 + int base_key_graphic = EL_KEY_1; +#endif + int i; + +#if 1 + return; /* !!! USE NEW STUFF !!! */ +#endif + +#if 0 + if (PANEL_DEACTIVATED(pos)) + return; +#endif + +#if 0 + if (level.game_engine_type == GAME_ENGINE_TYPE_EM) + base_key_graphic = EL_EM_KEY_1; +#endif + +#if 0 + pos->width = 4 * MINI_TILEX; +#endif + +#if 1 + for (i = 0; i < MAX_NUM_KEYS; i++) +#else + /* currently only 4 of 8 possible keys are displayed */ + for (i = 0; i < STD_NUM_KEYS; i++) +#endif + { +#if 1 + struct TextPosInfo *pos = &game.panel.key[i]; +#endif + int src_x = DOOR_GFX_PAGEX5 + 18 + (i % 4) * MINI_TILEX; + int src_y = DOOR_GFX_PAGEY1 + 123; +#if 1 + int dst_x = PANEL_XPOS(pos); + int dst_y = PANEL_YPOS(pos); +#else + int dst_x = PANEL_XPOS(pos) + i * MINI_TILEX; + int dst_y = PANEL_YPOS(pos); +#endif + +#if 1 + int element = (i >= STD_NUM_KEYS ? EL_EMC_KEY_5 - 4 : + level.game_engine_type == GAME_ENGINE_TYPE_EM ? EL_EM_KEY_1 : + EL_KEY_1) + i; + int graphic = el2edimg(element); +#endif + +#if 1 + if (PANEL_DEACTIVATED(pos)) + continue; +#endif + +#if 0 + /* masked blit with tiles from half-size scaled bitmap does not work yet + (no mask bitmap created for these sizes after loading and scaling) -- + solution: load without creating mask, scale, then create final mask */ + + BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto, src_x, src_y, + MINI_TILEX, MINI_TILEY, dst_x, dst_y); + + if (key[i]) + { +#if 0 + int graphic = el2edimg(base_key_graphic + i); +#endif + Bitmap *src_bitmap; + int src_x, src_y; + + getMiniGraphicSource(graphic, &src_bitmap, &src_x, &src_y); + + SetClipOrigin(src_bitmap, src_bitmap->stored_clip_gc, + dst_x - src_x, dst_y - src_y); + BlitBitmapMasked(src_bitmap, drawto, src_x, src_y, MINI_TILEX, MINI_TILEY, + dst_x, dst_y); + } +#else +#if 1 + if (key[i]) + DrawMiniGraphicExt(drawto, dst_x, dst_y, graphic); + else + BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto, src_x, src_y, + MINI_TILEX, MINI_TILEY, dst_x, dst_y); +#else + if (key[i]) + DrawMiniGraphicExt(drawto, dst_x, dst_y, el2edimg(base_key_graphic + i)); + else + BlitBitmap(graphic_info[IMG_GLOBAL_DOOR].bitmap, drawto, src_x, src_y, + MINI_TILEX, MINI_TILEY, dst_x, dst_y); +#endif +#endif + } +} - InitField(x, y, init_game); - } +#else - break; - } +void DrawGameValue_Emeralds(int value) +{ + int font_nr = FONT_TEXT_2; + int xpos = (3 * 14 - 3 * getFontWidth(font_nr)) / 2; - if (!init_game) - CheckTriggeredElementChange(x, y, element, CE_CREATION_OF_X); + if (PANEL_DEACTIVATED(game.panel.gems)) + return; + + DrawText(DX_EMERALDS + xpos, DY_EMERALDS, int2str(value, 3), font_nr); } -static inline void InitField_WithBug1(int x, int y, boolean init_game) +void DrawGameValue_Dynamite(int value) { - InitField(x, y, init_game); + int font_nr = FONT_TEXT_2; + int xpos = (3 * 14 - 3 * getFontWidth(font_nr)) / 2; - /* not needed to call InitMovDir() -- already done by InitField()! */ - if (game.engine_version < VERSION_IDENT(3,1,0,0) && - CAN_MOVE(Feld[x][y])) - InitMovDir(x, y); + if (PANEL_DEACTIVATED(game.panel.inventory_count)) + return; + + DrawText(DX_DYNAMITE + xpos, DY_DYNAMITE, int2str(value, 3), font_nr); } -static inline void InitField_WithBug2(int x, int y, boolean init_game) +void DrawGameValue_Score(int value) { - int old_element = Feld[x][y]; - - InitField(x, y, init_game); + int font_nr = FONT_TEXT_2; + int xpos = (5 * 14 - 5 * getFontWidth(font_nr)) / 2; - /* not needed to call InitMovDir() -- already done by InitField()! */ - if (game.engine_version < VERSION_IDENT(3,1,0,0) && - CAN_MOVE(old_element) && - (old_element < EL_MOLE_LEFT || old_element > EL_MOLE_DOWN)) - InitMovDir(x, y); + if (PANEL_DEACTIVATED(game.panel.score)) + return; - /* this case is in fact a combination of not less than three bugs: - first, it calls InitMovDir() for elements that can move, although this is - already done by InitField(); then, it checks the element that was at this - field _before_ the call to InitField() (which can change it); lastly, it - was not called for "mole with direction" elements, which were treated as - "cannot move" due to (fixed) wrong element initialization in "src/init.c" - */ + DrawText(DX_SCORE + xpos, DY_SCORE, int2str(value, 5), font_nr); } -inline void DrawGameValue_Emeralds(int value) +void DrawGameValue_Time(int value) { - int xpos = (3 * 14 - 3 * getFontWidth(FONT_TEXT_2)) / 2; + int font1_nr = FONT_TEXT_2; +#if 1 + int font2_nr = FONT_TEXT_1; +#else + int font2_nr = FONT_LEVEL_NUMBER; +#endif + int xpos3 = (3 * 14 - 3 * getFontWidth(font1_nr)) / 2; + int xpos4 = (4 * 10 - 4 * getFontWidth(font2_nr)) / 2; - if (PANEL_DEACTIVATED(game.panel.gems)) + if (PANEL_DEACTIVATED(game.panel.time)) return; - DrawText(DX_EMERALDS + xpos, DY_EMERALDS, int2str(value, 3), FONT_TEXT_2); + /* clear background if value just changed its size */ + if (value == 999 || value == 1000) + ClearRectangleOnBackground(drawto, DX_TIME1, DY_TIME, 14 * 3, 14); + + if (value < 1000) + DrawText(DX_TIME1 + xpos3, DY_TIME, int2str(value, 3), font1_nr); + else + DrawText(DX_TIME2 + xpos4, DY_TIME, int2str(value, 4), font2_nr); } -inline void DrawGameValue_Dynamite(int value) +void DrawGameValue_Level(int value) { - int xpos = (3 * 14 - 3 * getFontWidth(FONT_TEXT_2)) / 2; + int font1_nr = FONT_TEXT_2; +#if 1 + int font2_nr = FONT_TEXT_1; +#else + int font2_nr = FONT_LEVEL_NUMBER; +#endif - if (PANEL_DEACTIVATED(game.panel.inventory)) + if (PANEL_DEACTIVATED(game.panel.level)) return; - DrawText(DX_DYNAMITE + xpos, DY_DYNAMITE, int2str(value, 3), FONT_TEXT_2); + if (level_nr < 100) + DrawText(DX_LEVEL1, DY_LEVEL, int2str(value, 2), font1_nr); + else + DrawText(DX_LEVEL2, DY_LEVEL, int2str(value, 3), font2_nr); } -inline void DrawGameValue_Keys(int key[MAX_NUM_KEYS]) +void DrawGameValue_Keys(int key[MAX_NUM_KEYS]) { int base_key_graphic = EL_KEY_1; int i; @@ -1286,44 +3028,7 @@ inline void DrawGameValue_Keys(int key[MAX_NUM_KEYS]) } } -inline void DrawGameValue_Score(int value) -{ - int xpos = (5 * 14 - 5 * getFontWidth(FONT_TEXT_2)) / 2; - - if (PANEL_DEACTIVATED(game.panel.score)) - return; - - DrawText(DX_SCORE + xpos, DY_SCORE, int2str(value, 5), FONT_TEXT_2); -} - -inline void DrawGameValue_Time(int value) -{ - int xpos3 = (3 * 14 - 3 * getFontWidth(FONT_TEXT_2)) / 2; - int xpos4 = (4 * 10 - 4 * getFontWidth(FONT_LEVEL_NUMBER)) / 2; - - if (PANEL_DEACTIVATED(game.panel.time)) - return; - - /* clear background if value just changed its size */ - if (value == 999 || value == 1000) - ClearRectangleOnBackground(drawto, DX_TIME1, DY_TIME, 14 * 3, 14); - - if (value < 1000) - DrawText(DX_TIME1 + xpos3, DY_TIME, int2str(value, 3), FONT_TEXT_2); - else - DrawText(DX_TIME2 + xpos4, DY_TIME, int2str(value, 4), FONT_LEVEL_NUMBER); -} - -inline void DrawGameValue_Level(int value) -{ - if (PANEL_DEACTIVATED(game.panel.level)) - return; - - if (level_nr < 100) - DrawText(DX_LEVEL1, DY_LEVEL, int2str(value, 2), FONT_TEXT_2); - else - DrawText(DX_LEVEL2, DY_LEVEL, int2str(value, 3), FONT_LEVEL_NUMBER); -} +#endif void DrawAllGameValues(int emeralds, int dynamite, int score, int time, int key_bits) @@ -1349,7 +3054,17 @@ void DrawAllGameValues(int emeralds, int dynamite, int score, int time, DrawGameValue_Keys(key); } +void UpdateGameDoorValues() +{ + UpdateGameControlValues(); +} + void DrawGameDoorValues() +{ + DisplayGameControlValues(); +} + +void DrawGameDoorValues_OLD() { int time_value = (level.time == 0 ? TimePlayed : TimeLeft); int dynamite_value = 0; @@ -1639,6 +3354,7 @@ static void InitGameEngine() { ei->change_page[j].actual_trigger_element = EL_EMPTY; ei->change_page[j].actual_trigger_player = EL_PLAYER_1; + ei->change_page[j].actual_trigger_player_bits = CH_PLAYER_1; ei->change_page[j].actual_trigger_side = CH_SIDE_NONE; ei->change_page[j].actual_trigger_ce_value = 0; ei->change_page[j].actual_trigger_ce_score = 0; @@ -1818,6 +3534,13 @@ static void InitGameEngine() recursion_loop_depth = 0; recursion_loop_detected = FALSE; recursion_loop_element = EL_UNDEFINED; + + /* ---------- initialize graphics engine ---------------------------------- */ + game.scroll_delay_value = + (game.forced_scroll_delay_value != -1 ? game.forced_scroll_delay_value : + setup.scroll_delay ? setup.scroll_delay_value : 0); + game.scroll_delay_value = + MIN(MAX(MIN_SCROLL_DELAY, game.scroll_delay_value), MAX_SCROLL_DELAY); } int get_num_special_action(int element, int action_first, int action_last) @@ -1857,12 +3580,15 @@ void InitGame() boolean emulate_bd = TRUE; /* unless non-BOULDERDASH elements found */ boolean emulate_sb = TRUE; /* unless non-SOKOBAN elements found */ boolean emulate_sp = TRUE; /* unless non-SUPAPLEX elements found */ +#if 0 boolean do_fading = (game_status == GAME_MODE_MAIN); +#endif int i, j, x, y; game_status = GAME_MODE_PLAYING; InitGameEngine(); + InitGameControlValues(); /* don't play tapes over network */ network_playing = (options.network && !tape.playing); @@ -1894,6 +3620,8 @@ void InitGame() for (j = 0; j < MAX_NUM_KEYS; j++) player->key[j] = FALSE; + player->num_white_keys = 0; + player->dynabomb_count = 0; player->dynabomb_size = 1; player->dynabombs_left = 0; @@ -1986,9 +3714,13 @@ void InitGame() player->LevelSolved = FALSE; player->GameOver = FALSE; + player->LevelSolved_GameWon = FALSE; player->LevelSolved_GameEnd = FALSE; + player->LevelSolved_PanelOff = FALSE; player->LevelSolved_SaveTape = FALSE; player->LevelSolved_SaveScore = FALSE; + player->LevelSolved_CountingTime = 0; + player->LevelSolved_CountingScore = 0; } network_player_action_received = FALSE; @@ -2017,6 +3749,7 @@ void InitGame() AllPlayersGone = FALSE; game.yamyam_content_nr = 0; + game.robot_wheel_active = FALSE; game.magic_wall_active = FALSE; game.magic_wall_time_left = 0; game.light_time_left = 0; @@ -2103,6 +3836,8 @@ void InitGame() emulate_sp = FALSE; InitField(x, y, TRUE); + + ResetGfxAnimation(x, y); } InitBeltMovement(); @@ -2339,7 +4074,8 @@ void InitGame() content = element_info[element].change_page[i].target_element; is_player = ELEM_IS_PLAYER(content); - if (is_player && (found_rating < 3 || element < found_element)) + if (is_player && (found_rating < 3 || + (found_rating == 3 && element < found_element))) { start_x = x; start_y = y; @@ -2356,7 +4092,8 @@ void InitGame() content = element_info[element].content.e[xx][yy]; is_player = ELEM_IS_PLAYER(content); - if (is_player && (found_rating < 2 || element < found_element)) + if (is_player && (found_rating < 2 || + (found_rating == 2 && element < found_element))) { start_x = x + xx - 1; start_y = y + yy - 1; @@ -2376,7 +4113,8 @@ void InitGame() is_player = ELEM_IS_PLAYER(content); - if (is_player && (found_rating < 1 || element < found_element)) + if (is_player && (found_rating < 1 || + (found_rating == 1 && element < found_element))) { start_x = x + xx - 1; start_y = y + yy - 1; @@ -2407,13 +4145,38 @@ void InitGame() local_player->jy - MIDPOSY); } +#if 0 + /* do not use PLAYING mask for fading out from main screen */ + game_status = GAME_MODE_MAIN; +#endif + StopAnimation(); if (!game.restart_level) CloseDoor(DOOR_CLOSE_1); +#if 1 + if (level_editor_test_game) + FadeSkipNextFadeIn(); + else + FadeSetEnterScreen(); +#else + if (level_editor_test_game) + fading = fading_none; + else + fading = menu.destination; +#endif + +#if 1 + FadeOut(REDRAW_FIELD); +#else if (do_fading) FadeOut(REDRAW_FIELD); +#endif + +#if 0 + game_status = GAME_MODE_PLAYING; +#endif /* !!! FIX THIS (START) !!! */ if (level.game_engine_type == GAME_ENGINE_TYPE_EM) @@ -2440,10 +4203,14 @@ void InitGame() } /* !!! FIX THIS (END) !!! */ +#if 1 + FadeIn(REDRAW_FIELD); +#else if (do_fading) FadeIn(REDRAW_FIELD); BackToFront(); +#endif if (!game.restart_level) { @@ -2455,7 +4222,12 @@ void InitGame() SetPanelBackground(); SetDrawBackgroundMask(REDRAW_DOOR_1); +#if 1 + UpdateAndDisplayGameControlValues(); +#else + UpdateGameDoorValues(); DrawGameDoorValues(); +#endif if (!game.restart_level) { @@ -2712,16 +4484,21 @@ static void PlayerWins(struct PlayerInfo *player) player->score_final = (level.game_engine_type == GAME_ENGINE_TYPE_EM ? level.native_em_level->lev->score : player->score); + + player->LevelSolved_CountingTime = (level.time == 0 ? TimePlayed : TimeLeft); + player->LevelSolved_CountingScore = player->score_final; } void GameWon() { static int time, time_final; static int score, score_final; - static int game_over_delay = 0; - int game_over_delay_value = 50; + static int game_over_delay_1 = 0; + static int game_over_delay_2 = 0; + int game_over_delay_value_1 = 50; + int game_over_delay_value_2 = 50; - if (!local_player->LevelSolved_GameEnd) + if (!local_player->LevelSolved_GameWon) { int i; @@ -2729,7 +4506,7 @@ void GameWon() if (local_player->MovPos) return; - local_player->LevelSolved_GameEnd = TRUE; + local_player->LevelSolved_GameWon = TRUE; local_player->LevelSolved_SaveTape = tape.recording; local_player->LevelSolved_SaveScore = !tape.playing; @@ -2740,7 +4517,8 @@ void GameWon() TapeStop(); #endif - game_over_delay = game_over_delay_value; + game_over_delay_1 = game_over_delay_value_1; + game_over_delay_2 = game_over_delay_value_2; time = time_final = (level.time == 0 ? TimePlayed : TimeLeft); score = score_final = local_player->score_final; @@ -2763,8 +4541,18 @@ void GameWon() time = time_final; score = score_final; +#if 1 + local_player->LevelSolved_CountingTime = time; + local_player->LevelSolved_CountingScore = score; + + game_panel_controls[GAME_PANEL_TIME].value = time; + game_panel_controls[GAME_PANEL_SCORE].value = score; + + DisplayGameControlValues(); +#else DrawGameValue_Time(time); DrawGameValue_Score(score); +#endif } if (level.game_engine_type == GAME_ENGINE_TYPE_RND) @@ -2772,16 +4560,33 @@ void GameWon() if (ExitX >= 0 && ExitY >= 0) /* local player has left the level */ { /* close exit door after last player */ - if (AllPlayersGone && - (Feld[ExitX][ExitY] == EL_EXIT_OPEN || - Feld[ExitX][ExitY] == EL_SP_EXIT_OPEN)) + if ((AllPlayersGone && + (Feld[ExitX][ExitY] == EL_EXIT_OPEN || + Feld[ExitX][ExitY] == EL_SP_EXIT_OPEN || + Feld[ExitX][ExitY] == EL_STEEL_EXIT_OPEN)) || + Feld[ExitX][ExitY] == EL_EM_EXIT_OPEN || + Feld[ExitX][ExitY] == EL_EM_STEEL_EXIT_OPEN) { int element = Feld[ExitX][ExitY]; - Feld[ExitX][ExitY] = (element == EL_EXIT_OPEN ? EL_EXIT_CLOSING : - EL_SP_EXIT_CLOSING); - - PlayLevelSoundElementAction(ExitX, ExitY, element, ACTION_CLOSING); +#if 0 + if (element == EL_EM_EXIT_OPEN || + element == EL_EM_STEEL_EXIT_OPEN) + { + Bang(ExitX, ExitY); + } + else +#endif + { + Feld[ExitX][ExitY] = + (element == EL_EXIT_OPEN ? EL_EXIT_CLOSING : + element == EL_EM_EXIT_OPEN ? EL_EM_EXIT_CLOSING : + element == EL_SP_EXIT_OPEN ? EL_SP_EXIT_CLOSING: + element == EL_STEEL_EXIT_OPEN ? EL_STEEL_EXIT_CLOSING: + EL_EM_STEEL_EXIT_CLOSING); + + PlayLevelSoundElementAction(ExitX, ExitY, element, ACTION_CLOSING); + } } /* player disappears */ @@ -2805,9 +4610,9 @@ void GameWon() PlaySound(SND_GAME_WINNING); } - if (game_over_delay > 0) + if (game_over_delay_1 > 0) { - game_over_delay--; + game_over_delay_1--; return; } @@ -2821,8 +4626,18 @@ void GameWon() time += time_count_steps * time_count_dir; score += time_count_steps * level.score[SC_TIME_BONUS]; +#if 1 + local_player->LevelSolved_CountingTime = time; + local_player->LevelSolved_CountingScore = score; + + game_panel_controls[GAME_PANEL_TIME].value = time; + game_panel_controls[GAME_PANEL_SCORE].value = score; + + DisplayGameControlValues(); +#else DrawGameValue_Time(time); DrawGameValue_Score(score); +#endif if (time == time_final) StopSound(SND_GAME_LEVELTIME_BONUS); @@ -2830,7 +4645,22 @@ void GameWon() PlaySoundLoop(SND_GAME_LEVELTIME_BONUS); else PlaySound(SND_GAME_LEVELTIME_BONUS); + + return; + } + + local_player->LevelSolved_PanelOff = TRUE; + + if (game_over_delay_2 > 0) + { + game_over_delay_2--; + + return; } + +#if 1 + GameEnd(); +#endif } void GameEnd() @@ -2838,6 +4668,8 @@ void GameEnd() int hi_pos; boolean raise_level = FALSE; + local_player->LevelSolved_GameEnd = TRUE; + CloseDoor(DOOR_CLOSE_1); if (local_player->LevelSolved_SaveTape) @@ -2857,14 +4689,20 @@ void GameEnd() { game_status = GAME_MODE_MAIN; +#if 1 + DrawAndFadeInMainMenu(REDRAW_FIELD); +#else DrawMainMenu(); +#endif return; } if (!local_player->LevelSolved_SaveScore) { +#if 1 FadeOut(REDRAW_FIELD); +#endif game_status = GAME_MODE_MAIN; @@ -2896,7 +4734,9 @@ void GameEnd() } else { +#if 1 FadeOut(REDRAW_FIELD); +#endif game_status = GAME_MODE_MAIN; @@ -3064,7 +4904,12 @@ void InitMovingField(int x, int y, int direction) /* check if element was/is moving or being moved before/after mode change */ #if 1 +#if 1 + is_moving_before = (WasJustMoving[x][y] != 0); +#else + /* (!!! this does not work -- WasJustMoving is NOT a boolean value !!!) */ is_moving_before = WasJustMoving[x][y]; +#endif #else is_moving_before = (getElementMoveStepsizeExt(x, y, MovDir[x][y]) != 0); #endif @@ -3248,8 +5093,10 @@ void RemoveMovingField(int x, int y) if (element == EL_BLOCKED && (Feld[oldx][oldy] == EL_QUICKSAND_EMPTYING || + Feld[oldx][oldy] == EL_QUICKSAND_FAST_EMPTYING || Feld[oldx][oldy] == EL_MAGIC_WALL_EMPTYING || Feld[oldx][oldy] == EL_BD_MAGIC_WALL_EMPTYING || + Feld[oldx][oldy] == EL_DC_MAGIC_WALL_EMPTYING || Feld[oldx][oldy] == EL_AMOEBA_DROPPING)) next_element = get_next_element(Feld[oldx][oldy]); @@ -3370,12 +5217,14 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, if (quick_relocation) { - int offset = (setup.scroll_delay ? 3 : 0); + int offset = game.scroll_delay_value; if (!IN_VIS_FIELD(SCREENX(x), SCREENY(y)) || center_screen) { - if (center_screen) + if (!level.shifted_relocation || center_screen) { + /* quick relocation (without scrolling), with centering of screen */ + scroll_x = (x < SBX_Left + MIDPOSX ? SBX_Left : x > SBX_Right + MIDPOSX ? SBX_Right : x - MIDPOSX); @@ -3410,6 +5259,8 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, } else { + /* quick relocation (without scrolling), inside visible screen area */ + if ((move_dir == MV_LEFT && scroll_x > x - MIDPOSX + offset) || (move_dir == MV_RIGHT && scroll_x < x - MIDPOSX - offset)) scroll_x = x - MIDPOSX + (scroll_x < x - MIDPOSX ? -offset : +offset); @@ -3431,6 +5282,49 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, } else { +#if 1 + int scroll_xx, scroll_yy; + + if (!level.shifted_relocation || center_screen) + { + /* visible relocation (with scrolling), with centering of screen */ + + scroll_xx = (x < SBX_Left + MIDPOSX ? SBX_Left : + x > SBX_Right + MIDPOSX ? SBX_Right : + x - MIDPOSX); + + scroll_yy = (y < SBY_Upper + MIDPOSY ? SBY_Upper : + y > SBY_Lower + MIDPOSY ? SBY_Lower : + y - MIDPOSY); + } + else + { + /* visible relocation (with scrolling), but do not center screen */ + + int center_scroll_x = (old_x < SBX_Left + MIDPOSX ? SBX_Left : + old_x > SBX_Right + MIDPOSX ? SBX_Right : + old_x - MIDPOSX); + + int center_scroll_y = (old_y < SBY_Upper + MIDPOSY ? SBY_Upper : + old_y > SBY_Lower + MIDPOSY ? SBY_Lower : + old_y - MIDPOSY); + + int offset_x = x + (scroll_x - center_scroll_x); + int offset_y = y + (scroll_y - center_scroll_y); + + scroll_xx = (offset_x < SBX_Left + MIDPOSX ? SBX_Left : + offset_x > SBX_Right + MIDPOSX ? SBX_Right : + offset_x - MIDPOSX); + + scroll_yy = (offset_y < SBY_Upper + MIDPOSY ? SBY_Upper : + offset_y > SBY_Lower + MIDPOSY ? SBY_Lower : + offset_y - MIDPOSY); + } + +#else + + /* visible relocation (with scrolling), with centering of screen */ + int scroll_xx = (x < SBX_Left + MIDPOSX ? SBX_Left : x > SBX_Right + MIDPOSX ? SBX_Right : x - MIDPOSX); @@ -3438,6 +5332,7 @@ void DrawRelocateScreen(int old_x, int old_y, int x, int y, int move_dir, int scroll_yy = (y < SBY_Upper + MIDPOSY ? SBY_Upper : y > SBY_Lower + MIDPOSY ? SBY_Lower : y - MIDPOSY); +#endif ScrollScreen(NULL, SCROLL_GO_ON); /* scroll last frame to full tile */ @@ -4011,6 +5906,14 @@ void Bang(int x, int y) explosion_type = EX_TYPE_DYNA; break; + case EL_DC_LANDMINE: +#if 0 + case EL_EM_EXIT_OPEN: + case EL_EM_STEEL_EXIT_OPEN: +#endif + explosion_type = EX_TYPE_CENTER; + break; + case EL_PENGUIN: case EL_LAMP: case EL_LAMP_ACTIVE: @@ -4077,12 +5980,19 @@ static void InitBeltMovement() for (j = 0; j < NUM_BELT_PARTS; j++) { int element = belt_base_active_element[belt_nr] + j; - int graphic = el2img(element); + int graphic_1 = el2img(element); + int graphic_2 = el2panelimg(element); if (game.belt_dir[i] == MV_LEFT) - graphic_info[graphic].anim_mode &= ~ANIM_REVERSE; + { + graphic_info[graphic_1].anim_mode &= ~ANIM_REVERSE; + graphic_info[graphic_2].anim_mode &= ~ANIM_REVERSE; + } else - graphic_info[graphic].anim_mode |= ANIM_REVERSE; + { + graphic_info[graphic_1].anim_mode |= ANIM_REVERSE; + graphic_info[graphic_2].anim_mode |= ANIM_REVERSE; + } } } @@ -4158,12 +6068,19 @@ static void ToggleBeltSwitch(int x, int y) for (i = 0; i < NUM_BELT_PARTS; i++) { int element = belt_base_active_element[belt_nr] + i; - int graphic = el2img(element); + int graphic_1 = el2img(element); + int graphic_2 = el2panelimg(element); if (belt_dir == MV_LEFT) - graphic_info[graphic].anim_mode &= ~ANIM_REVERSE; + { + graphic_info[graphic_1].anim_mode &= ~ANIM_REVERSE; + graphic_info[graphic_2].anim_mode &= ~ANIM_REVERSE; + } else - graphic_info[graphic].anim_mode |= ANIM_REVERSE; + { + graphic_info[graphic_1].anim_mode |= ANIM_REVERSE; + graphic_info[graphic_2].anim_mode |= ANIM_REVERSE; + } } SCAN_PLAYFIELD(xx, yy) @@ -4224,6 +6141,12 @@ static void ToggleSwitchgateSwitch(int x, int y) Feld[xx][yy] = EL_SWITCHGATE_SWITCH_UP + game.switchgate_pos; DrawLevelField(xx, yy); } + else if (element == EL_DC_SWITCHGATE_SWITCH_UP || + element == EL_DC_SWITCHGATE_SWITCH_DOWN) + { + Feld[xx][yy] = EL_DC_SWITCHGATE_SWITCH_UP + game.switchgate_pos; + DrawLevelField(xx, yy); + } #else if (element == EL_SWITCHGATE_SWITCH_UP) { @@ -4235,6 +6158,16 @@ static void ToggleSwitchgateSwitch(int x, int y) Feld[xx][yy] = EL_SWITCHGATE_SWITCH_UP; DrawLevelField(xx, yy); } + else if (element == EL_DC_SWITCHGATE_SWITCH_UP) + { + Feld[xx][yy] = EL_DC_SWITCHGATE_SWITCH_DOWN; + DrawLevelField(xx, yy); + } + else if (element == EL_DC_SWITCHGATE_SWITCH_DOWN) + { + Feld[xx][yy] = EL_DC_SWITCHGATE_SWITCH_UP; + DrawLevelField(xx, yy); + } #endif else if (element == EL_SWITCHGATE_OPEN || element == EL_SWITCHGATE_OPENING) @@ -4451,7 +6384,7 @@ static void ActivateTimegateSwitch(int x, int y) element == EL_TIMEGATE_CLOSING) { Feld[xx][yy] = EL_TIMEGATE_OPENING; - PlayLevelSound(xx, yy, SND_TIMEGATE_OPENING); + PlayLevelSound(xx, yy, SND_CLASS_TIMEGATE_OPENING); } /* @@ -4464,7 +6397,12 @@ static void ActivateTimegateSwitch(int x, int y) } +#if 1 + Feld[x][y] = (Feld[x][y] == EL_TIMEGATE_SWITCH ? EL_TIMEGATE_SWITCH_ACTIVE : + EL_DC_TIMEGATE_SWITCH_ACTIVE); +#else Feld[x][y] = EL_TIMEGATE_SWITCH_ACTIVE; +#endif } void Impact(int x, int y) @@ -4499,6 +6437,16 @@ void Impact(int x, int y) object_hit = TRUE; } + + if (Feld[x][y + 1] == EL_QUICKSAND_FAST_EMPTYING && object_hit == FALSE) + { + RemoveMovingField(x, y + 1); + Feld[x][y + 1] = EL_QUICKSAND_FAST_EMPTY; + Feld[x][y + 2] = EL_ROCK; + DrawLevelField(x, y + 2); + + object_hit = TRUE; + } #endif if (object_hit) @@ -4527,7 +6475,8 @@ void Impact(int x, int y) Bang(x, y); return; } - else if (impact && element == EL_PEARL) + else if (impact && element == EL_PEARL && + smashed != EL_DC_MAGIC_WALL && smashed != EL_DC_MAGIC_WALL_ACTIVE) { ResetGfxAnimation(x, y); @@ -4560,26 +6509,33 @@ void Impact(int x, int y) if (object_hit) /* check which object was hit */ { - if (CAN_PASS_MAGIC_WALL(element) && - (smashed == EL_MAGIC_WALL || - smashed == EL_BD_MAGIC_WALL)) + if ((CAN_PASS_MAGIC_WALL(element) && + (smashed == EL_MAGIC_WALL || + smashed == EL_BD_MAGIC_WALL)) || + (CAN_PASS_DC_MAGIC_WALL(element) && + smashed == EL_DC_MAGIC_WALL)) { int xx, yy; int activated_magic_wall = (smashed == EL_MAGIC_WALL ? EL_MAGIC_WALL_ACTIVE : - EL_BD_MAGIC_WALL_ACTIVE); + smashed == EL_BD_MAGIC_WALL ? EL_BD_MAGIC_WALL_ACTIVE : + EL_DC_MAGIC_WALL_ACTIVE); /* activate magic wall / mill */ SCAN_PLAYFIELD(xx, yy) + { if (Feld[xx][yy] == smashed) Feld[xx][yy] = activated_magic_wall; + } game.magic_wall_time_left = level.time_magic_wall * FRAMES_PER_SECOND; game.magic_wall_active = TRUE; PlayLevelSound(x, y, (smashed == EL_MAGIC_WALL ? SND_MAGIC_WALL_ACTIVATING : - SND_BD_MAGIC_WALL_ACTIVATING)); + smashed == EL_BD_MAGIC_WALL ? + SND_BD_MAGIC_WALL_ACTIVATING : + SND_DC_MAGIC_WALL_ACTIVATING)); } if (IS_PLAYER(x, y + 1)) @@ -4659,7 +6615,9 @@ void Impact(int x, int y) ToggleBeltSwitch(x, y + 1); } else if (smashed == EL_SWITCHGATE_SWITCH_UP || - smashed == EL_SWITCHGATE_SWITCH_DOWN) + smashed == EL_SWITCHGATE_SWITCH_DOWN || + smashed == EL_DC_SWITCHGATE_SWITCH_UP || + smashed == EL_DC_SWITCHGATE_SWITCH_DOWN) { ToggleSwitchgateSwitch(x, y + 1); } @@ -4692,12 +6650,15 @@ void Impact(int x, int y) /* play sound of magic wall / mill */ if (!last_line && (Feld[x][y + 1] == EL_MAGIC_WALL_ACTIVE || - Feld[x][y + 1] == EL_BD_MAGIC_WALL_ACTIVE)) + Feld[x][y + 1] == EL_BD_MAGIC_WALL_ACTIVE || + Feld[x][y + 1] == EL_DC_MAGIC_WALL_ACTIVE)) { if (Feld[x][y + 1] == EL_MAGIC_WALL_ACTIVE) PlayLevelSound(x, y, SND_MAGIC_WALL_FILLING); else if (Feld[x][y + 1] == EL_BD_MAGIC_WALL_ACTIVE) PlayLevelSound(x, y, SND_BD_MAGIC_WALL_FILLING); + else if (Feld[x][y + 1] == EL_DC_MAGIC_WALL_ACTIVE) + PlayLevelSound(x, y, SND_DC_MAGIC_WALL_FILLING); return; } @@ -5054,7 +7015,10 @@ inline static void TurnRoundExt(int x, int y) int ex = x + xy[i][0]; int ey = y + xy[i][1]; - if (IN_LEV_FIELD(ex, ey) && Feld[ex][ey] == EL_EXIT_OPEN) + if (IN_LEV_FIELD(ex, ey) && (Feld[ex][ey] == EL_EXIT_OPEN || + Feld[ex][ey] == EL_EM_EXIT_OPEN || + Feld[ex][ey] == EL_STEEL_EXIT_OPEN || + Feld[ex][ey] == EL_EM_STEEL_EXIT_OPEN)) { attr_x = ex; attr_y = ey; @@ -5574,14 +7538,51 @@ void StartMoving(int x, int y) if (JustBeingPushed(x, y)) return; - if (element == EL_QUICKSAND_FULL) + if (element == EL_QUICKSAND_FULL) + { + if (IS_FREE(x, y + 1)) + { + InitMovingField(x, y, MV_DOWN); + started_moving = TRUE; + + Feld[x][y] = EL_QUICKSAND_EMPTYING; +#if USE_QUICKSAND_BD_ROCK_BUGFIX + if (Store[x][y] != EL_ROCK && Store[x][y] != EL_BD_ROCK) + Store[x][y] = EL_ROCK; +#else + Store[x][y] = EL_ROCK; +#endif + + PlayLevelSoundAction(x, y, ACTION_EMPTYING); + } + else if (Feld[x][y + 1] == EL_QUICKSAND_EMPTY) + { + if (!MovDelay[x][y]) + MovDelay[x][y] = TILEY + 1; + + if (MovDelay[x][y]) + { + MovDelay[x][y]--; + if (MovDelay[x][y]) + return; + } + + Feld[x][y] = EL_QUICKSAND_EMPTY; + Feld[x][y + 1] = EL_QUICKSAND_FULL; + Store[x][y + 1] = Store[x][y]; + Store[x][y] = 0; + + PlayLevelSoundAction(x, y, ACTION_FILLING); + } + } + else if (element == EL_QUICKSAND_FAST_FULL) { if (IS_FREE(x, y + 1)) { InitMovingField(x, y, MV_DOWN); started_moving = TRUE; - Feld[x][y] = EL_QUICKSAND_EMPTYING; + Feld[x][y] = EL_QUICKSAND_FAST_EMPTYING; #if USE_QUICKSAND_BD_ROCK_BUGFIX if (Store[x][y] != EL_ROCK && Store[x][y] != EL_BD_ROCK) Store[x][y] = EL_ROCK; @@ -5591,7 +7592,7 @@ void StartMoving(int x, int y) PlayLevelSoundAction(x, y, ACTION_EMPTYING); } - else if (Feld[x][y + 1] == EL_QUICKSAND_EMPTY) + else if (Feld[x][y + 1] == EL_QUICKSAND_FAST_EMPTY) { if (!MovDelay[x][y]) MovDelay[x][y] = TILEY + 1; @@ -5603,8 +7604,8 @@ void StartMoving(int x, int y) return; } - Feld[x][y] = EL_QUICKSAND_EMPTY; - Feld[x][y + 1] = EL_QUICKSAND_FULL; + Feld[x][y] = EL_QUICKSAND_FAST_EMPTY; + Feld[x][y + 1] = EL_QUICKSAND_FAST_FULL; Store[x][y + 1] = Store[x][y]; Store[x][y] = 0; @@ -5622,6 +7623,17 @@ void StartMoving(int x, int y) PlayLevelSoundAction(x, y, ACTION_FILLING); } + else if ((element == EL_ROCK || element == EL_BD_ROCK) && + Feld[x][y + 1] == EL_QUICKSAND_FAST_EMPTY) + { + InitMovingField(x, y, MV_DOWN); + started_moving = TRUE; + + Feld[x][y] = EL_QUICKSAND_FAST_FILLING; + Store[x][y] = element; + + PlayLevelSoundAction(x, y, ACTION_FILLING); + } else if (element == EL_MAGIC_WALL_FULL) { if (IS_FREE(x, y + 1)) @@ -5658,7 +7670,7 @@ void StartMoving(int x, int y) started_moving = TRUE; Feld[x][y] = EL_BD_MAGIC_WALL_EMPTYING; - Store[x][y] = EL_CHANGED2(Store[x][y]); + Store[x][y] = EL_CHANGED_BD(Store[x][y]); } else if (Feld[x][y + 1] == EL_BD_MAGIC_WALL_ACTIVE) { @@ -5674,20 +7686,52 @@ void StartMoving(int x, int y) Feld[x][y] = EL_BD_MAGIC_WALL_ACTIVE; Feld[x][y + 1] = EL_BD_MAGIC_WALL_FULL; - Store[x][y + 1] = EL_CHANGED2(Store[x][y]); + Store[x][y + 1] = EL_CHANGED_BD(Store[x][y]); + Store[x][y] = 0; + } + } + else if (element == EL_DC_MAGIC_WALL_FULL) + { + if (IS_FREE(x, y + 1)) + { + InitMovingField(x, y, MV_DOWN); + started_moving = TRUE; + + Feld[x][y] = EL_DC_MAGIC_WALL_EMPTYING; + Store[x][y] = EL_CHANGED_DC(Store[x][y]); + } + else if (Feld[x][y + 1] == EL_DC_MAGIC_WALL_ACTIVE) + { + if (!MovDelay[x][y]) + MovDelay[x][y] = TILEY/4 + 1; + + if (MovDelay[x][y]) + { + MovDelay[x][y]--; + if (MovDelay[x][y]) + return; + } + + Feld[x][y] = EL_DC_MAGIC_WALL_ACTIVE; + Feld[x][y + 1] = EL_DC_MAGIC_WALL_FULL; + Store[x][y + 1] = EL_CHANGED_DC(Store[x][y]); Store[x][y] = 0; } } - else if (CAN_PASS_MAGIC_WALL(element) && - (Feld[x][y + 1] == EL_MAGIC_WALL_ACTIVE || - Feld[x][y + 1] == EL_BD_MAGIC_WALL_ACTIVE)) + else if ((CAN_PASS_MAGIC_WALL(element) && + (Feld[x][y + 1] == EL_MAGIC_WALL_ACTIVE || + Feld[x][y + 1] == EL_BD_MAGIC_WALL_ACTIVE)) || + (CAN_PASS_DC_MAGIC_WALL(element) && + (Feld[x][y + 1] == EL_DC_MAGIC_WALL_ACTIVE))) + { InitMovingField(x, y, MV_DOWN); started_moving = TRUE; Feld[x][y] = (Feld[x][y + 1] == EL_MAGIC_WALL_ACTIVE ? EL_MAGIC_WALL_FILLING : - EL_BD_MAGIC_WALL_FILLING); + Feld[x][y + 1] == EL_BD_MAGIC_WALL_ACTIVE ? EL_BD_MAGIC_WALL_FILLING : + EL_DC_MAGIC_WALL_FILLING); Store[x][y] = element; } else if (CAN_FALL(element) && Feld[x][y + 1] == EL_ACID) @@ -6051,7 +8095,10 @@ void StartMoving(int x, int y) } else if (element == EL_PENGUIN && IN_LEV_FIELD(newx, newy)) { - if (Feld[newx][newy] == EL_EXIT_OPEN) + if (Feld[newx][newy] == EL_EXIT_OPEN || + Feld[newx][newy] == EL_EM_EXIT_OPEN || + Feld[newx][newy] == EL_STEEL_EXIT_OPEN || + Feld[newx][newy] == EL_EM_STEEL_EXIT_OPEN) { RemoveField(x, y); DrawLevelField(x, y); @@ -6469,6 +8516,17 @@ void ContinueMoving(int x, int y) if (ABS(MovPos[x][y]) < TILEX) { +#if 0 + int ee = Feld[x][y]; + int gg = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]); + int ff = getGraphicAnimationFrame(gg, GfxFrame[x][y]); + + printf("::: %d.%d: moving %d ... [%d, %d, %d] [%d, %d, %d]\n", + x, y, ABS(MovPos[x][y]), + ee, gg, ff, + GfxAction[x][y], GfxDir[x][y], GfxFrame[x][y]); +#endif + DrawLevelField(x, y); return; /* element is still moving */ @@ -6500,6 +8558,16 @@ void ContinueMoving(int x, int y) Feld[x][y] = get_next_element(element); element = Feld[newx][newy] = Store[x][y]; } + else if (element == EL_QUICKSAND_FAST_FILLING) + { + element = Feld[newx][newy] = get_next_element(element); + Store[newx][newy] = Store[x][y]; + } + else if (element == EL_QUICKSAND_FAST_EMPTYING) + { + Feld[x][y] = get_next_element(element); + element = Feld[newx][newy] = Store[x][y]; + } else if (element == EL_MAGIC_WALL_FILLING) { element = Feld[newx][newy] = get_next_element(element); @@ -6532,6 +8600,24 @@ void ContinueMoving(int x, int y) Feld[x][y] = EL_BD_MAGIC_WALL_DEAD; element = Feld[newx][newy] = Store[x][y]; +#if USE_NEW_CUSTOM_VALUE + InitField(newx, newy, FALSE); +#endif + } + else if (element == EL_DC_MAGIC_WALL_FILLING) + { + element = Feld[newx][newy] = get_next_element(element); + if (!game.magic_wall_active) + element = Feld[newx][newy] = EL_DC_MAGIC_WALL_DEAD; + Store[newx][newy] = Store[x][y]; + } + else if (element == EL_DC_MAGIC_WALL_EMPTYING) + { + Feld[x][y] = get_next_element(element); + if (!game.magic_wall_active) + Feld[x][y] = EL_DC_MAGIC_WALL_DEAD; + element = Feld[newx][newy] = Store[x][y]; + #if USE_NEW_CUSTOM_VALUE InitField(newx, newy, FALSE); #endif @@ -7035,7 +9121,8 @@ void AmoebeAbleger(int ax, int ay) if (IS_FREE(x, y) || CAN_GROW_INTO(Feld[x][y]) || - Feld[x][y] == EL_QUICKSAND_EMPTY) + Feld[x][y] == EL_QUICKSAND_EMPTY || + Feld[x][y] == EL_QUICKSAND_FAST_EMPTY) { newax = x; neway = y; @@ -7060,7 +9147,8 @@ void AmoebeAbleger(int ax, int ay) if (IS_FREE(x, y) || CAN_GROW_INTO(Feld[x][y]) || - Feld[x][y] == EL_QUICKSAND_EMPTY) + Feld[x][y] == EL_QUICKSAND_EMPTY || + Feld[x][y] == EL_QUICKSAND_FAST_EMPTY) { newax = x; neway = y; @@ -7235,7 +9323,11 @@ static void RunRobotWheel(int x, int y) static void StopRobotWheel(int x, int y) { if (ZX == x && ZY == y) + { ZX = ZY = -1; + + game.robot_wheel_active = FALSE; + } } static void InitTimegateWheel(int x, int y) @@ -7245,7 +9337,7 @@ static void InitTimegateWheel(int x, int y) static void RunTimegateWheel(int x, int y) { - PlayLevelSound(x, y, SND_TIMEGATE_SWITCH_ACTIVE); + PlayLevelSound(x, y, SND_CLASS_TIMEGATE_SWITCH_ACTIVE); } static void InitMagicBallDelay(int x, int y) @@ -7312,6 +9404,75 @@ void CheckExit(int x, int y) PlayLevelSoundNearest(x, y, SND_CLASS_EXIT_OPENING); } +void CheckExitEM(int x, int y) +{ + if (local_player->gems_still_needed > 0 || + local_player->sokobanfields_still_needed > 0 || + local_player->lights_still_needed > 0) + { + int element = Feld[x][y]; + int graphic = el2img(element); + + if (IS_ANIMATED(graphic)) + DrawLevelGraphicAnimationIfNeeded(x, y, graphic); + + return; + } + + if (AllPlayersGone) /* do not re-open exit door closed after last player */ + return; + + Feld[x][y] = EL_EM_EXIT_OPENING; + + PlayLevelSoundNearest(x, y, SND_CLASS_EM_EXIT_OPENING); +} + +void CheckExitSteel(int x, int y) +{ + if (local_player->gems_still_needed > 0 || + local_player->sokobanfields_still_needed > 0 || + local_player->lights_still_needed > 0) + { + int element = Feld[x][y]; + int graphic = el2img(element); + + if (IS_ANIMATED(graphic)) + DrawLevelGraphicAnimationIfNeeded(x, y, graphic); + + return; + } + + if (AllPlayersGone) /* do not re-open exit door closed after last player */ + return; + + Feld[x][y] = EL_STEEL_EXIT_OPENING; + + PlayLevelSoundNearest(x, y, SND_CLASS_STEEL_EXIT_OPENING); +} + +void CheckExitSteelEM(int x, int y) +{ + if (local_player->gems_still_needed > 0 || + local_player->sokobanfields_still_needed > 0 || + local_player->lights_still_needed > 0) + { + int element = Feld[x][y]; + int graphic = el2img(element); + + if (IS_ANIMATED(graphic)) + DrawLevelGraphicAnimationIfNeeded(x, y, graphic); + + return; + } + + if (AllPlayersGone) /* do not re-open exit door closed after last player */ + return; + + Feld[x][y] = EL_EM_STEEL_EXIT_OPENING; + + PlayLevelSoundNearest(x, y, SND_CLASS_EM_STEEL_EXIT_OPENING); +} + void CheckExitSP(int x, int y) { if (local_player->gems_still_needed > 0) @@ -7365,9 +9526,6 @@ void DrawTwinkleOnField(int x, int y) { MovDelay[x][y]--; - if (setup.direct_draw && MovDelay[x][y]) - SetDrawtoField(DRAW_BUFFERED); - DrawLevelElementAnimation(x, y, Feld[x][y]); if (MovDelay[x][y] != 0) @@ -7376,18 +9534,6 @@ void DrawTwinkleOnField(int x, int y) 10 - MovDelay[x][y]); DrawGraphicThruMask(SCREENX(x), SCREENY(y), IMG_TWINKLE_WHITE, frame); - - if (setup.direct_draw) - { - int dest_x, dest_y; - - dest_x = FX + SCREENX(x) * TILEX; - dest_y = FY + SCREENY(y) * TILEY; - - BlitBitmap(drawto_field, window, - dest_x, dest_y, TILEX, TILEY, dest_x, dest_y); - SetDrawtoField(DRAW_DIRECT); - } } } } @@ -7550,6 +9696,108 @@ void MauerAbleger(int ax, int ay) PlayLevelSoundAction(ax, ay, ACTION_GROWING); } +void MauerAblegerStahl(int ax, int ay) +{ + int element = Feld[ax][ay]; + int graphic = el2img(element); + boolean oben_frei = FALSE, unten_frei = FALSE; + boolean links_frei = FALSE, rechts_frei = FALSE; + boolean oben_massiv = FALSE, unten_massiv = FALSE; + boolean links_massiv = FALSE, rechts_massiv = FALSE; + boolean new_wall = FALSE; + + if (IS_ANIMATED(graphic)) + DrawLevelGraphicAnimationIfNeeded(ax, ay, graphic); + + if (!MovDelay[ax][ay]) /* start building new wall */ + MovDelay[ax][ay] = 6; + + if (MovDelay[ax][ay]) /* wait some time before building new wall */ + { + MovDelay[ax][ay]--; + if (MovDelay[ax][ay]) + return; + } + + if (IN_LEV_FIELD(ax, ay-1) && IS_FREE(ax, ay-1)) + oben_frei = TRUE; + if (IN_LEV_FIELD(ax, ay+1) && IS_FREE(ax, ay+1)) + unten_frei = TRUE; + if (IN_LEV_FIELD(ax-1, ay) && IS_FREE(ax-1, ay)) + links_frei = TRUE; + if (IN_LEV_FIELD(ax+1, ay) && IS_FREE(ax+1, ay)) + rechts_frei = TRUE; + + if (element == EL_EXPANDABLE_STEELWALL_VERTICAL || + element == EL_EXPANDABLE_STEELWALL_ANY) + { + if (oben_frei) + { + Feld[ax][ay-1] = EL_EXPANDABLE_STEELWALL_GROWING; + Store[ax][ay-1] = element; + GfxDir[ax][ay-1] = MovDir[ax][ay-1] = MV_UP; + if (IN_SCR_FIELD(SCREENX(ax), SCREENY(ay-1))) + DrawGraphic(SCREENX(ax), SCREENY(ay - 1), + IMG_EXPANDABLE_STEELWALL_GROWING_UP, 0); + new_wall = TRUE; + } + if (unten_frei) + { + Feld[ax][ay+1] = EL_EXPANDABLE_STEELWALL_GROWING; + Store[ax][ay+1] = element; + GfxDir[ax][ay+1] = MovDir[ax][ay+1] = MV_DOWN; + if (IN_SCR_FIELD(SCREENX(ax), SCREENY(ay+1))) + DrawGraphic(SCREENX(ax), SCREENY(ay + 1), + IMG_EXPANDABLE_STEELWALL_GROWING_DOWN, 0); + new_wall = TRUE; + } + } + + if (element == EL_EXPANDABLE_STEELWALL_HORIZONTAL || + element == EL_EXPANDABLE_STEELWALL_ANY) + { + if (links_frei) + { + Feld[ax-1][ay] = EL_EXPANDABLE_STEELWALL_GROWING; + Store[ax-1][ay] = element; + GfxDir[ax-1][ay] = MovDir[ax-1][ay] = MV_LEFT; + if (IN_SCR_FIELD(SCREENX(ax-1), SCREENY(ay))) + DrawGraphic(SCREENX(ax - 1), SCREENY(ay), + IMG_EXPANDABLE_STEELWALL_GROWING_LEFT, 0); + new_wall = TRUE; + } + + if (rechts_frei) + { + Feld[ax+1][ay] = EL_EXPANDABLE_STEELWALL_GROWING; + Store[ax+1][ay] = element; + GfxDir[ax+1][ay] = MovDir[ax+1][ay] = MV_RIGHT; + if (IN_SCR_FIELD(SCREENX(ax+1), SCREENY(ay))) + DrawGraphic(SCREENX(ax + 1), SCREENY(ay), + IMG_EXPANDABLE_STEELWALL_GROWING_RIGHT, 0); + new_wall = TRUE; + } + } + + if (!IN_LEV_FIELD(ax, ay-1) || IS_WALL(Feld[ax][ay-1])) + oben_massiv = TRUE; + if (!IN_LEV_FIELD(ax, ay+1) || IS_WALL(Feld[ax][ay+1])) + unten_massiv = TRUE; + if (!IN_LEV_FIELD(ax-1, ay) || IS_WALL(Feld[ax-1][ay])) + links_massiv = TRUE; + if (!IN_LEV_FIELD(ax+1, ay) || IS_WALL(Feld[ax+1][ay])) + rechts_massiv = TRUE; + + if (((oben_massiv && unten_massiv) || + element == EL_EXPANDABLE_STEELWALL_HORIZONTAL) && + ((links_massiv && rechts_massiv) || + element == EL_EXPANDABLE_STEELWALL_VERTICAL)) + Feld[ax][ay] = EL_WALL; + + if (new_wall) + PlayLevelSoundAction(ax, ay, ACTION_GROWING); +} + void CheckForDragon(int x, int y) { int i, j; @@ -7779,11 +10027,15 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) action_mode, action_arg_number, action_arg_number_min, action_arg_number_max); +#if 1 + int trigger_player_bits = change->actual_trigger_player_bits; +#else int trigger_player_bits = (change->actual_trigger_player >= EL_PLAYER_1 && change->actual_trigger_player <= EL_PLAYER_4 ? (1 << (change->actual_trigger_player - EL_PLAYER_1)) : PLAYER_BITS_ANY); +#endif int action_arg_player_bits = (action_arg >= CA_ARG_PLAYER_1 && @@ -7826,7 +10078,13 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) { TimeLeft = action_arg_number_new; +#if 1 + game_panel_controls[GAME_PANEL_TIME].value = TimeLeft; + + DisplayGameControlValues(); +#else DrawGameValue_Time(TimeLeft); +#endif if (!TimeLeft && setup.time_limit) for (i = 0; i < MAX_PLAYERS; i++) @@ -7840,7 +10098,13 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) { local_player->score = action_arg_number_new; +#if 1 + game_panel_controls[GAME_PANEL_SCORE].value = local_player->score; + + DisplayGameControlValues(); +#else DrawGameValue_Score(local_player->score); +#endif break; } @@ -7849,7 +10113,13 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) { local_player->gems_still_needed = action_arg_number_new; +#if 1 + game_panel_controls[GAME_PANEL_GEMS].value = local_player->gems_still_needed; + + DisplayGameControlValues(); +#else DrawGameValue_Emeralds(local_player->gems_still_needed); +#endif break; } @@ -8128,7 +10398,7 @@ static void ExecuteCustomElementAction(int x, int y, int element, int page) static void CreateFieldExt(int x, int y, int element, boolean is_change) { int old_element = Feld[x][y]; - int new_element = get_element_from_group_element(element); + int new_element = GetElementFromGroupElement(element); int previous_move_direction = MovDir[x][y]; #if USE_NEW_CUSTOM_VALUE int last_ce_value = CustomValue[x][y]; @@ -8271,6 +10541,7 @@ static boolean ChangeElement(int x, int y, int element, int page) /* reset actual trigger element, trigger player and action element */ change->actual_trigger_element = EL_EMPTY; change->actual_trigger_player = EL_PLAYER_1; + change->actual_trigger_player_bits = CH_PLAYER_1; change->actual_trigger_side = CH_SIDE_NONE; change->actual_trigger_ce_value = 0; change->actual_trigger_ce_score = 0; @@ -8460,8 +10731,19 @@ static void HandleElementChange(int x, int y, int page) if (change->can_change) { - ResetGfxAnimation(x, y); - ResetRandomAnimationValue(x, y); +#if 1 + /* !!! not clear why graphic animation should be reset at all here !!! */ + /* !!! UPDATE: but is needed for correct Snake Bite tail animation !!! */ +#if USE_GFX_RESET_WHEN_NOT_MOVING + /* when a custom element is about to change (for example by change delay), + do not reset graphic animation when the custom element is moving */ + if (!IS_MOVING(x, y)) +#endif + { + ResetGfxAnimation(x, y); + ResetRandomAnimationValue(x, y); + } +#endif if (change->pre_change_function) change->pre_change_function(x, y); @@ -8640,7 +10922,8 @@ static boolean CheckTriggeredElementChangeExt(int trigger_x, int trigger_y, IS_EQUAL_OR_IN_GROUP(trigger_element, change->trigger_element)) { change->actual_trigger_element = trigger_element; - change->actual_trigger_player = EL_PLAYER_1 + log_2(trigger_player); + change->actual_trigger_player = GET_PLAYER_FROM_BITS(trigger_player); + change->actual_trigger_player_bits = trigger_player; change->actual_trigger_side = trigger_side; change->actual_trigger_ce_value = CustomValue[trigger_x][trigger_y]; change->actual_trigger_ce_score = GET_CE_SCORE(trigger_element); @@ -8759,7 +11042,8 @@ static boolean CheckElementChangeExt(int x, int y, IS_EQUAL_OR_IN_GROUP(trigger_element, change->trigger_element))) { change->actual_trigger_element = trigger_element; - change->actual_trigger_player = EL_PLAYER_1 + log_2(trigger_player); + change->actual_trigger_player = GET_PLAYER_FROM_BITS(trigger_player); + change->actual_trigger_player_bits = trigger_player; change->actual_trigger_side = trigger_side; change->actual_trigger_ce_value = CustomValue[x][y]; change->actual_trigger_ce_score = GET_CE_SCORE(trigger_element); @@ -9113,7 +11397,13 @@ static void CheckLevelTime() if (TimeLeft <= 10 && setup.time_limit) PlaySound(SND_GAME_RUNNING_OUT_OF_TIME); +#if 1 + game_panel_controls[GAME_PANEL_TIME].value = TimeLeft; + + DisplayGameControlValues(); +#else DrawGameValue_Time(TimeLeft); +#endif if (!TimeLeft && setup.time_limit) { @@ -9124,8 +11414,17 @@ static void CheckLevelTime() KillPlayer(&stored_player[i]); } } +#if 1 + else if (level.time == 0 && !AllPlayersGone) /* level w/o time limit */ + { + game_panel_controls[GAME_PANEL_TIME].value = TimePlayed; + + DisplayGameControlValues(); + } +#else else if (level.time == 0 && !AllPlayersGone) /* level w/o time limit */ DrawGameValue_Time(TimePlayed); +#endif level.native_em_level->lev->time = (level.time == 0 ? TimePlayed : TimeLeft); @@ -9134,6 +11433,13 @@ static void CheckLevelTime() if (tape.recording || tape.playing) DrawVideoDisplay(VIDEO_STATE_TIME_ON, TapeTime); } + +#if 1 + UpdateAndDisplayGameControlValues(); +#else + UpdateGameDoorValues(); + DrawGameDoorValues(); +#endif } void AdvanceFrameAndPlayerCounters(int player_nr) @@ -9256,7 +11562,7 @@ void GameActions() AllPlayersGone = TRUE; } - if (local_player->LevelSolved) + if (local_player->LevelSolved && !local_player->LevelSolved_GameEnd) GameWon(); if (AllPlayersGone && !TAPE_IS_STOPPED(tape)) @@ -9493,13 +11799,15 @@ void GameActions_RND() /* continue moving after pushing (this is actually a bug) */ if (!IS_MOVING(x, y)) - { Stop[x][y] = FALSE; - } } } } +#if 0 + debug_print_timestamp(0, "start main loop profiling"); +#endif + SCAN_PLAYFIELD(x, y) { ChangeCount[x][y] = 0; @@ -9574,6 +11882,63 @@ void GameActions_RND() #endif } +#if 0 + debug_print_timestamp(0, "- time for pre-main loop:"); +#endif + +#if 0 // -------------------- !!! TEST ONLY !!! -------------------- + SCAN_PLAYFIELD(x, y) + { + element = Feld[x][y]; + graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]); + +#if 1 + { +#if 1 + int element2 = element; + int graphic2 = graphic; +#else + int element2 = Feld[x][y]; + int graphic2 = el_act_dir2img(element2, GfxAction[x][y], GfxDir[x][y]); +#endif + int last_gfx_frame = GfxFrame[x][y]; + + if (graphic_info[graphic2].anim_global_sync) + GfxFrame[x][y] = FrameCounter; + else if (ANIM_MODE(graphic2) == ANIM_CE_VALUE) + GfxFrame[x][y] = CustomValue[x][y]; + else if (ANIM_MODE(graphic2) == ANIM_CE_SCORE) + GfxFrame[x][y] = element_info[element2].collect_score; + else if (ANIM_MODE(graphic2) == ANIM_CE_DELAY) + GfxFrame[x][y] = ChangeDelay[x][y]; + + if (redraw && GfxFrame[x][y] != last_gfx_frame) + DrawLevelGraphicAnimation(x, y, graphic2); + } +#else + ResetGfxFrame(x, y, TRUE); +#endif + +#if 1 + if (ANIM_MODE(graphic) == ANIM_RANDOM && + IS_NEXT_FRAME(GfxFrame[x][y], graphic)) + ResetRandomAnimationValue(x, y); +#endif + +#if 1 + SetRandomAnimationValue(x, y); +#endif + +#if 1 + PlayLevelSoundActionIfLoop(x, y, GfxAction[x][y]); +#endif + } +#endif // -------------------- !!! TEST ONLY !!! -------------------- + +#if 0 + debug_print_timestamp(0, "- time for TEST loop: -->"); +#endif + SCAN_PLAYFIELD(x, y) { element = Feld[x][y]; @@ -9617,6 +11982,143 @@ void GameActions_RND() graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]); } +#if 0 // --------------------------------------------------------------------- + + if (!IS_MOVING(x, y) && (CAN_FALL(element) || CAN_MOVE(element))) + { + StartMoving(x, y); + + element = Feld[x][y]; + graphic = el_act_dir2img(element, GfxAction[x][y], GfxDir[x][y]); + + if (IS_ANIMATED(graphic) && + !IS_MOVING(x, y) && + !Stop[x][y]) + DrawLevelGraphicAnimationIfNeeded(x, y, graphic); + + if (IS_GEM(element) || element == EL_SP_INFOTRON) + DrawTwinkleOnField(x, y); + } + else if (IS_MOVING(x, y)) + ContinueMoving(x, y); + else + { + switch (element) + { + case EL_ACID: + case EL_EXIT_OPEN: + case EL_EM_EXIT_OPEN: + case EL_SP_EXIT_OPEN: + case EL_STEEL_EXIT_OPEN: + case EL_EM_STEEL_EXIT_OPEN: + case EL_SP_TERMINAL: + case EL_SP_TERMINAL_ACTIVE: + case EL_EXTRA_TIME: + case EL_SHIELD_NORMAL: + case EL_SHIELD_DEADLY: + if (IS_ANIMATED(graphic)) + DrawLevelGraphicAnimationIfNeeded(x, y, graphic); + break; + + case EL_DYNAMITE_ACTIVE: + case EL_EM_DYNAMITE_ACTIVE: + case EL_DYNABOMB_PLAYER_1_ACTIVE: + case EL_DYNABOMB_PLAYER_2_ACTIVE: + case EL_DYNABOMB_PLAYER_3_ACTIVE: + case EL_DYNABOMB_PLAYER_4_ACTIVE: + case EL_SP_DISK_RED_ACTIVE: + CheckDynamite(x, y); + break; + + case EL_AMOEBA_GROWING: + AmoebeWaechst(x, y); + break; + + case EL_AMOEBA_SHRINKING: + AmoebaDisappearing(x, y); + break; + +#if !USE_NEW_AMOEBA_CODE + case EL_AMOEBA_WET: + case EL_AMOEBA_DRY: + case EL_AMOEBA_FULL: + case EL_BD_AMOEBA: + case EL_EMC_DRIPPER: + AmoebeAbleger(x, y); + break; +#endif + + case EL_GAME_OF_LIFE: + case EL_BIOMAZE: + Life(x, y); + break; + + case EL_EXIT_CLOSED: + CheckExit(x, y); + break; + + case EL_EM_EXIT_CLOSED: + CheckExitEM(x, y); + break; + + case EL_STEEL_EXIT_CLOSED: + CheckExitSteel(x, y); + break; + + case EL_EM_STEEL_EXIT_CLOSED: + CheckExitSteelEM(x, y); + break; + + case EL_SP_EXIT_CLOSED: + CheckExitSP(x, y); + break; + + case EL_EXPANDABLE_WALL_GROWING: + case EL_EXPANDABLE_STEELWALL_GROWING: + MauerWaechst(x, y); + break; + + case EL_EXPANDABLE_WALL: + case EL_EXPANDABLE_WALL_HORIZONTAL: + case EL_EXPANDABLE_WALL_VERTICAL: + case EL_EXPANDABLE_WALL_ANY: + case EL_BD_EXPANDABLE_WALL: + MauerAbleger(x, y); + break; + + case EL_EXPANDABLE_STEELWALL_HORIZONTAL: + case EL_EXPANDABLE_STEELWALL_VERTICAL: + case EL_EXPANDABLE_STEELWALL_ANY: + MauerAblegerStahl(x, y); + break; + + case EL_FLAMES: + CheckForDragon(x, y); + break; + + case EL_EXPLOSION: + break; + + case EL_ELEMENT_SNAPPING: + case EL_DIAGONAL_SHRINKING: + case EL_DIAGONAL_GROWING: + { + graphic = + el_act_dir2img(GfxElement[x][y], GfxAction[x][y],GfxDir[x][y]); + + DrawLevelGraphicAnimationIfNeeded(x, y, graphic); + break; + } + + default: + if (IS_ANIMATED(graphic) && !IS_CHANGING(x, y)) + DrawLevelGraphicAnimationIfNeeded(x, y, graphic); + break; + } + } + +#else // --------------------------------------------------------------------- + if (!IS_MOVING(x, y) && (CAN_FALL(element) || CAN_MOVE(element))) { StartMoving(x, y); @@ -9634,7 +12136,10 @@ void GameActions_RND() } else if ((element == EL_ACID || element == EL_EXIT_OPEN || + element == EL_EM_EXIT_OPEN || element == EL_SP_EXIT_OPEN || + element == EL_STEEL_EXIT_OPEN || + element == EL_EM_STEEL_EXIT_OPEN || element == EL_SP_TERMINAL || element == EL_SP_TERMINAL_ACTIVE || element == EL_EXTRA_TIME || @@ -9660,9 +12165,16 @@ void GameActions_RND() Life(x, y); else if (element == EL_EXIT_CLOSED) CheckExit(x, y); + else if (element == EL_EM_EXIT_CLOSED) + CheckExitEM(x, y); + else if (element == EL_STEEL_EXIT_CLOSED) + CheckExitSteel(x, y); + else if (element == EL_EM_STEEL_EXIT_CLOSED) + CheckExitSteelEM(x, y); else if (element == EL_SP_EXIT_CLOSED) CheckExitSP(x, y); - else if (element == EL_EXPANDABLE_WALL_GROWING) + else if (element == EL_EXPANDABLE_WALL_GROWING || + element == EL_EXPANDABLE_STEELWALL_GROWING) MauerWaechst(x, y); else if (element == EL_EXPANDABLE_WALL || element == EL_EXPANDABLE_WALL_HORIZONTAL || @@ -9670,6 +12182,10 @@ void GameActions_RND() element == EL_EXPANDABLE_WALL_ANY || element == EL_BD_EXPANDABLE_WALL) MauerAbleger(x, y); + else if (element == EL_EXPANDABLE_STEELWALL_HORIZONTAL || + element == EL_EXPANDABLE_STEELWALL_VERTICAL || + element == EL_EXPANDABLE_STEELWALL_ANY) + MauerAblegerStahl(x, y); else if (element == EL_FLAMES) CheckForDragon(x, y); else if (element == EL_EXPLOSION) @@ -9685,6 +12201,8 @@ void GameActions_RND() else if (IS_ANIMATED(graphic) && !IS_CHANGING(x, y)) DrawLevelGraphicAnimationIfNeeded(x, y, graphic); +#endif // --------------------------------------------------------------------- + if (IS_BELT_ACTIVE(element)) PlayLevelSoundAction(x, y, ACTION_ACTIVE); @@ -9698,7 +12216,10 @@ void GameActions_RND() element == EL_MAGIC_WALL_EMPTYING || element == EL_BD_MAGIC_WALL_FULL || element == EL_BD_MAGIC_WALL_ACTIVE || - element == EL_BD_MAGIC_WALL_EMPTYING) && + element == EL_BD_MAGIC_WALL_EMPTYING || + element == EL_DC_MAGIC_WALL_FULL || + element == EL_DC_MAGIC_WALL_ACTIVE || + element == EL_DC_MAGIC_WALL_EMPTYING) && ABS(x-jx) + ABS(y-jy) < ABS(magic_wall_x-jx) + ABS(magic_wall_y-jy)) { magic_wall_x = x; @@ -9707,6 +12228,10 @@ void GameActions_RND() } } +#if 0 + debug_print_timestamp(0, "- time for MAIN loop: -->"); +#endif + #if USE_NEW_AMOEBA_CODE /* new experimental amoeba growth stuff */ if (!(FrameCounter % 8)) @@ -9723,6 +12248,7 @@ void GameActions_RND() (element == EL_EMPTY || CAN_GROW_INTO(element) || element == EL_QUICKSAND_EMPTY || + element == EL_QUICKSAND_FAST_EMPTY || element == EL_ACID_SPLASH_LEFT || element == EL_ACID_SPLASH_RIGHT)) { @@ -9769,6 +12295,10 @@ void GameActions_RND() element == EL_BD_MAGIC_WALL_ACTIVE || element == EL_BD_MAGIC_WALL_EMPTYING) PlayLevelSound(magic_wall_x, magic_wall_y, SND_BD_MAGIC_WALL_ACTIVE); + else if (element == EL_DC_MAGIC_WALL_FULL || + element == EL_DC_MAGIC_WALL_ACTIVE || + element == EL_DC_MAGIC_WALL_EMPTYING) + PlayLevelSound(magic_wall_x, magic_wall_y, SND_DC_MAGIC_WALL_ACTIVE); else PlayLevelSound(magic_wall_x, magic_wall_y, SND_MAGIC_WALL_ACTIVE); } @@ -9776,6 +12306,7 @@ void GameActions_RND() if (game.magic_wall_time_left > 0) { game.magic_wall_time_left--; + if (!game.magic_wall_time_left) { SCAN_PLAYFIELD(x, y) @@ -9794,6 +12325,12 @@ void GameActions_RND() Feld[x][y] = EL_BD_MAGIC_WALL_DEAD; DrawLevelField(x, y); } + else if (element == EL_DC_MAGIC_WALL_ACTIVE || + element == EL_DC_MAGIC_WALL_FULL) + { + Feld[x][y] = EL_DC_MAGIC_WALL_DEAD; + DrawLevelField(x, y); + } } game.magic_wall_active = FALSE; @@ -9879,6 +12416,11 @@ void GameActions_RND() local_player->show_envelope = 0; } +#if 0 + debug_print_timestamp(0, "stop main loop profiling "); + printf("----------------------------------------------------------\n"); +#endif + /* use random number generator in every frame to make it less predictable */ if (game.engine_version >= VERSION_IDENT(3,1,1,0)) RND(1); @@ -9925,25 +12467,85 @@ static boolean AllPlayersInVisibleScreen() void ScrollLevel(int dx, int dy) { +#if 1 + static Bitmap *bitmap_db_field2 = NULL; int softscroll_offset = (setup.soft_scrolling ? TILEX : 0); int x, y; +#else + int i, x, y; +#endif + +#if 0 + /* !!! THIS IS APPARENTLY WRONG FOR PLAYER RELOCATION !!! */ + /* only horizontal XOR vertical scroll direction allowed */ + if ((dx == 0 && dy == 0) || (dx != 0 && dy != 0)) + return; +#endif + +#if 1 + if (bitmap_db_field2 == NULL) + bitmap_db_field2 = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH); + + /* needed when blitting directly to same bitmap -- should not be needed with + recent SDL libraries, but apparently does not work in 1.2.11 directly */ + BlitBitmap(drawto_field, bitmap_db_field2, + FX + TILEX * (dx == -1) - softscroll_offset, + FY + TILEY * (dy == -1) - softscroll_offset, + SXSIZE - TILEX * (dx != 0) + 2 * softscroll_offset, + SYSIZE - TILEY * (dy != 0) + 2 * softscroll_offset, + FX + TILEX * (dx == 1) - softscroll_offset, + FY + TILEY * (dy == 1) - softscroll_offset); + BlitBitmap(bitmap_db_field2, drawto_field, + FX + TILEX * (dx == 1) - softscroll_offset, + FY + TILEY * (dy == 1) - softscroll_offset, + SXSIZE - TILEX * (dx != 0) + 2 * softscroll_offset, + SYSIZE - TILEY * (dy != 0) + 2 * softscroll_offset, + FX + TILEX * (dx == 1) - softscroll_offset, + FY + TILEY * (dy == 1) - softscroll_offset); + +#else + +#if 0 + /* !!! DOES NOT WORK FOR DIAGONAL PLAYER RELOCATION !!! */ + int xsize = (BX2 - BX1 + 1); + int ysize = (BY2 - BY1 + 1); + int start = (dx != 0 ? (dx == -1 ? BX1 : BX2) : (dy == -1 ? BY1 : BY2)); + int end = (dx != 0 ? (dx == -1 ? BX2 : BX1) : (dy == -1 ? BY2 : BY1)); + int step = (start < end ? +1 : -1); + + for (i = start; i != end; i += step) + { + BlitBitmap(drawto_field, drawto_field, + FX + TILEX * (dx != 0 ? i + step : 0), + FY + TILEY * (dy != 0 ? i + step : 0), + TILEX * (dx != 0 ? 1 : xsize), + TILEY * (dy != 0 ? 1 : ysize), + FX + TILEX * (dx != 0 ? i : 0), + FY + TILEY * (dy != 0 ? i : 0)); + } + +#else + + int softscroll_offset = (setup.soft_scrolling ? TILEX : 0); BlitBitmap(drawto_field, drawto_field, FX + TILEX * (dx == -1) - softscroll_offset, FY + TILEY * (dy == -1) - softscroll_offset, - SXSIZE - TILEX * (dx!=0) + 2 * softscroll_offset, - SYSIZE - TILEY * (dy!=0) + 2 * softscroll_offset, + SXSIZE - TILEX * (dx != 0) + 2 * softscroll_offset, + SYSIZE - TILEY * (dy != 0) + 2 * softscroll_offset, FX + TILEX * (dx == 1) - softscroll_offset, FY + TILEY * (dy == 1) - softscroll_offset); +#endif +#endif - if (dx) + if (dx != 0) { x = (dx == 1 ? BX1 : BX2); for (y = BY1; y <= BY2; y++) DrawScreenField(x, y); } - if (dy) + if (dy != 0) { y = (dy == 1 ? BY1 : BY2); for (x = BX1; x <= BX2; x++) @@ -10254,7 +12856,7 @@ boolean MovePlayer(struct PlayerInfo *player, int dx, int dy) #endif { int old_scroll_x = scroll_x, old_scroll_y = scroll_y; - int offset = (setup.scroll_delay ? 3 : 0); + int offset = game.scroll_delay_value; if (!IN_VIS_FIELD(SCREENX(jx), SCREENY(jy))) { @@ -10482,6 +13084,9 @@ void ScrollPlayer(struct PlayerInfo *player, int mode) player->last_jy = jy; if (Feld[jx][jy] == EL_EXIT_OPEN || + Feld[jx][jy] == EL_EM_EXIT_OPEN || + Feld[jx][jy] == EL_STEEL_EXIT_OPEN || + Feld[jx][jy] == EL_EM_STEEL_EXIT_OPEN || Feld[jx][jy] == EL_SP_EXIT_OPEN || Feld[jx][jy] == EL_SP_EXIT_OPENING) /* <-- special case */ { @@ -10551,14 +13156,29 @@ void ScrollPlayer(struct PlayerInfo *player, int mode) if (TimeLeft <= 10 && setup.time_limit) PlaySound(SND_GAME_RUNNING_OUT_OF_TIME); +#if 1 + game_panel_controls[GAME_PANEL_TIME].value = TimeLeft; + + DisplayGameControlValues(); +#else DrawGameValue_Time(TimeLeft); +#endif if (!TimeLeft && setup.time_limit) for (i = 0; i < MAX_PLAYERS; i++) KillPlayer(&stored_player[i]); } +#if 1 + else if (level.time == 0 && !AllPlayersGone) /* level w/o time limit */ + { + game_panel_controls[GAME_PANEL_TIME].value = TimePlayed; + + DisplayGameControlValues(); + } +#else else if (level.time == 0 && !AllPlayersGone) /* level w/o time limit */ DrawGameValue_Time(TimePlayed); +#endif } if (tape.single_step && tape.recording && !tape.pausing && @@ -11407,6 +14027,9 @@ int DigField(struct PlayerInfo *player, CheckTriggeredElementChangeByPlayer(x, y, element, CE_PLAYER_SNAPS_X, player->index_bit, dig_side); + if (element == EL_DC_LANDMINE) + Bang(x, y); + if (Feld[x][y] != element) /* field changed by snapping */ return MP_ACTION; @@ -11447,6 +14070,9 @@ int DigField(struct PlayerInfo *player, return MP_NO_ACTION; } else if (element == EL_EXIT_OPEN || + element == EL_EM_EXIT_OPEN || + element == EL_STEEL_EXIT_OPEN || + element == EL_EM_STEEL_EXIT_OPEN || element == EL_SP_EXIT_OPEN || element == EL_SP_EXIT_OPENING) { @@ -11502,6 +14128,15 @@ int DigField(struct PlayerInfo *player, if (!player->key[EMC_GATE_GRAY_ACTIVE_NR(element)]) return MP_NO_ACTION; } + else if (element == EL_DC_GATE_WHITE || + element == EL_DC_GATE_WHITE_GRAY || + element == EL_DC_GATE_WHITE_GRAY_ACTIVE) + { + if (player->num_white_keys == 0) + return MP_NO_ACTION; + + player->num_white_keys--; + } else if (IS_SP_PORT(element)) { if (element == EL_SP_GRAVITY_PORT_LEFT || @@ -11592,7 +14227,14 @@ int DigField(struct PlayerInfo *player, else if (element == EL_EXTRA_TIME && level.time > 0) { TimeLeft += level.extra_time; + +#if 1 + game_panel_controls[GAME_PANEL_TIME].value = TimeLeft; + + DisplayGameControlValues(); +#else DrawGameValue_Time(TimeLeft); +#endif } else if (element == EL_SHIELD_NORMAL || element == EL_SHIELD_DEADLY) { @@ -11628,6 +14270,13 @@ int DigField(struct PlayerInfo *player, DrawGameDoorValues(); } + else if (element == EL_DC_KEY_WHITE) + { + player->num_white_keys++; + + /* display white keys? */ + /* DrawGameDoorValues(); */ + } else if (IS_ENVELOPE(element)) { player->show_envelope = element; @@ -11664,7 +14313,13 @@ int DigField(struct PlayerInfo *player, if (local_player->gems_still_needed < 0) local_player->gems_still_needed = 0; +#if 1 + game_panel_controls[GAME_PANEL_GEMS].value = local_player->gems_still_needed; + + DisplayGameControlValues(); +#else DrawGameValue_Emeralds(local_player->gems_still_needed); +#endif } RaiseScoreElement(element); @@ -11844,6 +14499,8 @@ int DigField(struct PlayerInfo *player, ZX = x; ZY = y; + game.robot_wheel_active = TRUE; + DrawLevelField(x, y); } else if (element == EL_SP_TERMINAL) @@ -11863,7 +14520,9 @@ int DigField(struct PlayerInfo *player, ToggleBeltSwitch(x, y); } else if (element == EL_SWITCHGATE_SWITCH_UP || - element == EL_SWITCHGATE_SWITCH_DOWN) + element == EL_SWITCHGATE_SWITCH_DOWN || + element == EL_DC_SWITCHGATE_SWITCH_UP || + element == EL_DC_SWITCHGATE_SWITCH_DOWN) { ToggleSwitchgateSwitch(x, y); } @@ -11872,7 +14531,8 @@ int DigField(struct PlayerInfo *player, { ToggleLightSwitch(x, y); } - else if (element == EL_TIMEGATE_SWITCH) + else if (element == EL_TIMEGATE_SWITCH || + element == EL_DC_TIMEGATE_SWITCH) { ActivateTimegateSwitch(x, y); } @@ -11905,7 +14565,14 @@ int DigField(struct PlayerInfo *player, if (level.time > 0 || level.use_time_orb_bug) { TimeLeft += level.time_orb_time; + +#if 1 + game_panel_controls[GAME_PANEL_TIME].value = TimeLeft; + + DisplayGameControlValues(); +#else DrawGameValue_Time(TimeLeft); +#endif } ResetGfxAnimation(x, y); @@ -12077,6 +14744,9 @@ boolean DropElement(struct PlayerInfo *player) int dropx = player->jx, dropy = player->jy; int drop_direction = player->MovDir; int drop_side = drop_direction; +#if 1 + int drop_element = get_next_dropped_element(player); +#else int drop_element = (player->inventory_size > 0 ? player->inventory_element[player->inventory_size - 1] : player->inventory_infinite_element != EL_UNDEFINED ? @@ -12084,6 +14754,7 @@ boolean DropElement(struct PlayerInfo *player) player->dynabombs_left > 0 ? EL_DYNABOMB_PLAYER_1_ACTIVE + player->index_nr : EL_UNDEFINED); +#endif player->is_dropping_pressed = TRUE; @@ -12527,7 +15198,13 @@ void RaiseScore(int value) { local_player->score += value; +#if 1 + game_panel_controls[GAME_PANEL_SCORE].value = local_player->score; + + DisplayGameControlValues(); +#else DrawGameValue_Score(local_player->score); +#endif } void RaiseScoreElement(int element) @@ -12601,6 +15278,7 @@ void RaiseScoreElement(int element) case EL_EMC_KEY_6: case EL_EMC_KEY_7: case EL_EMC_KEY_8: + case EL_DC_KEY_WHITE: RaiseScore(level.score[SC_KEY]); break; default: @@ -12621,13 +15299,31 @@ void RequestQuitGameExt(boolean skip_request, boolean quick_quit, char *message) { if (quick_quit) { +#if 1 + +#if 1 + FadeSkipNextFadeIn(); +#else + fading = fading_none; +#endif + +#else + OpenDoor(DOOR_CLOSE_1); +#endif + game_status = GAME_MODE_MAIN; +#if 1 + DrawAndFadeInMainMenu(REDRAW_FIELD); +#else DrawMainMenu(); +#endif } else { +#if 0 FadeOut(REDRAW_FIELD); +#endif game_status = GAME_MODE_MAIN; @@ -12811,9 +15507,9 @@ static void LoadEngineSnapshotValues_RND() if (game.num_random_calls != num_random_calls) { - Error(ERR_RETURN, "number of random calls out of sync"); - Error(ERR_RETURN, "number of random calls should be %d", num_random_calls); - Error(ERR_RETURN, "number of random calls is %d", game.num_random_calls); + Error(ERR_INFO, "number of random calls out of sync"); + Error(ERR_INFO, "number of random calls should be %d", num_random_calls); + Error(ERR_INFO, "number of random calls is %d", game.num_random_calls); Error(ERR_EXIT, "this should not happen -- please debug"); } } @@ -12986,11 +15682,50 @@ boolean CheckEngineSnapshot() static struct { - int x, y; + int *x, *y; + int gd_x, gd_y; int gadget_id; char *infotext; } gamebutton_info[NUM_GAME_BUTTONS] = { +#if 1 + { + &game.button.stop.x, &game.button.stop.y, + GAME_BUTTON_STOP_XPOS, GAME_BUTTON_YPOS, + GAME_CTRL_ID_STOP, + "stop game" + }, + { + &game.button.pause.x, &game.button.pause.y, + GAME_BUTTON_PAUSE_XPOS, GAME_BUTTON_YPOS, + GAME_CTRL_ID_PAUSE, + "pause game" + }, + { + &game.button.play.x, &game.button.play.y, + GAME_BUTTON_PLAY_XPOS, GAME_BUTTON_YPOS, + GAME_CTRL_ID_PLAY, + "play game" + }, + { + &game.button.sound_music.x, &game.button.sound_music.y, + SOUND_BUTTON_MUSIC_XPOS, SOUND_BUTTON_YPOS, + SOUND_CTRL_ID_MUSIC, + "background music on/off" + }, + { + &game.button.sound_loops.x, &game.button.sound_loops.y, + SOUND_BUTTON_LOOPS_XPOS, SOUND_BUTTON_YPOS, + SOUND_CTRL_ID_LOOPS, + "sound loops on/off" + }, + { + &game.button.sound_simple.x,&game.button.sound_simple.y, + SOUND_BUTTON_SIMPLE_XPOS, SOUND_BUTTON_YPOS, + SOUND_CTRL_ID_SIMPLE, + "normal sounds on/off" + } +#else { GAME_BUTTON_STOP_XPOS, GAME_BUTTON_YPOS, GAME_CTRL_ID_STOP, @@ -13021,6 +15756,7 @@ static struct SOUND_CTRL_ID_SIMPLE, "normal sounds on/off" } +#endif }; void CreateGameButtons() @@ -13034,12 +15770,15 @@ void CreateGameButtons() int button_type; boolean checked; unsigned long event_mask; + int x, y; int gd_xoffset, gd_yoffset; int gd_x1, gd_x2, gd_y1, gd_y2; int id = i; - gd_xoffset = gamebutton_info[i].x; - gd_yoffset = gamebutton_info[i].y; + x = DX + *gamebutton_info[i].x; + y = DY + *gamebutton_info[i].y; + gd_xoffset = gamebutton_info[i].gd_x; + gd_yoffset = gamebutton_info[i].gd_y; gd_x1 = DOOR_GFX_PAGEX4 + gd_xoffset; gd_x2 = DOOR_GFX_PAGEX3 + gd_xoffset; @@ -13067,8 +15806,13 @@ void CreateGameButtons() gi = CreateGadget(GDI_CUSTOM_ID, id, GDI_INFO_TEXT, gamebutton_info[i].infotext, +#if 1 + GDI_X, x, + GDI_Y, y, +#else GDI_X, DX + gd_xoffset, GDI_Y, DY + gd_yoffset, +#endif GDI_WIDTH, GAME_BUTTON_XSIZE, GDI_HEIGHT, GAME_BUTTON_YSIZE, GDI_TYPE, button_type, @@ -13078,6 +15822,7 @@ void CreateGameButtons() GDI_DESIGN_PRESSED, gd_bitmap, gd_x2, gd_y1, GDI_ALT_DESIGN_UNPRESSED, gd_bitmap, gd_x1, gd_y2, GDI_ALT_DESIGN_PRESSED, gd_bitmap, gd_x2, gd_y2, + GDI_DIRECT_DRAW, FALSE, GDI_EVENT_MASK, event_mask, GDI_CALLBACK_ACTION, HandleGameButtons, GDI_END); @@ -13113,6 +15858,14 @@ void UnmapGameButtons() UnmapGadget(game_gadget[i]); } +void RedrawGameButtons() +{ + int i; + + for (i = 0; i < NUM_GAME_BUTTONS; i++) + RedrawGadget(game_gadget[i]); +} + static void HandleGameButtons(struct GadgetInfo *gi) { int id = gi->custom_id; diff --git a/src/game.h b/src/game.h index cf5d2c28..c1fb5b12 100644 --- a/src/game.h +++ b/src/game.h @@ -14,11 +14,88 @@ #ifndef GAME_H #define GAME_H +/* (not included here due to collisions with Emerald Mine engine definitions) */ +/* #include "main.h" */ #define MAX_INVENTORY_SIZE 1000 + #define STD_NUM_KEYS 4 #define MAX_NUM_KEYS 8 +#define NUM_BELTS 4 +#define NUM_BELT_PARTS 3 + +#define NUM_PANEL_INVENTORY 8 +#define NUM_PANEL_GRAPHICS 8 +#define NUM_PANEL_ELEMENTS 8 +#define NUM_PANEL_CE_SCORE 8 + +#if 1 +struct GamePanelInfo +{ + struct TextPosInfo level_number; + struct TextPosInfo gems; + struct TextPosInfo inventory_count; + struct TextPosInfo inventory_first[NUM_PANEL_INVENTORY]; + struct TextPosInfo inventory_last[NUM_PANEL_INVENTORY]; + struct TextPosInfo key[MAX_NUM_KEYS]; + struct TextPosInfo key_white; + struct TextPosInfo key_white_count; + struct TextPosInfo score; + struct TextPosInfo time; + struct TextPosInfo time_hh; + struct TextPosInfo time_mm; + struct TextPosInfo time_ss; + struct TextPosInfo shield_normal; + struct TextPosInfo shield_normal_time; + struct TextPosInfo shield_deadly; + struct TextPosInfo shield_deadly_time; + struct TextPosInfo exit; + struct TextPosInfo emc_magic_ball; + struct TextPosInfo emc_magic_ball_switch; + struct TextPosInfo light_switch; + struct TextPosInfo light_switch_time; + struct TextPosInfo timegate_switch; + struct TextPosInfo timegate_switch_time; + struct TextPosInfo switchgate_switch; + struct TextPosInfo emc_lenses; + struct TextPosInfo emc_lenses_time; + struct TextPosInfo emc_magnifier; + struct TextPosInfo emc_magnifier_time; + struct TextPosInfo balloon_switch; + struct TextPosInfo dynabomb_number; + struct TextPosInfo dynabomb_size; + struct TextPosInfo dynabomb_power; + struct TextPosInfo penguins; + struct TextPosInfo sokoban_objects; + struct TextPosInfo sokoban_fields; + struct TextPosInfo robot_wheel; + struct TextPosInfo conveyor_belt[NUM_BELTS]; + struct TextPosInfo conveyor_belt_switch[NUM_BELTS]; + struct TextPosInfo magic_wall; + struct TextPosInfo magic_wall_time; + struct TextPosInfo gravity_state; + struct TextPosInfo graphic[NUM_PANEL_GRAPHICS]; + struct TextPosInfo element[NUM_PANEL_ELEMENTS]; + struct TextPosInfo element_count[NUM_PANEL_ELEMENTS]; + struct TextPosInfo ce_score[NUM_PANEL_CE_SCORE]; + struct TextPosInfo ce_score_element[NUM_PANEL_CE_SCORE]; + struct TextPosInfo player_name; + struct TextPosInfo level_name; + struct TextPosInfo level_author; +}; + +struct GameButtonInfo +{ + struct MenuPosInfo stop; + struct MenuPosInfo pause; + struct MenuPosInfo play; + struct MenuPosInfo sound_music; + struct MenuPosInfo sound_loops; + struct MenuPosInfo sound_simple; +}; + +#else struct GamePanelInfo { @@ -29,11 +106,18 @@ struct GamePanelInfo struct XY score; struct XY time; }; +#endif struct GameInfo { /* values for control panel */ struct GamePanelInfo panel; + struct GameButtonInfo button; + + /* values for graphics engine customization */ + boolean use_native_emc_graphics_engine; + int forced_scroll_delay_value; + int scroll_delay_value; /* values for engine initialization */ int default_push_delay_fixed; @@ -55,6 +139,7 @@ struct GameInfo /* variable within running game */ int yamyam_content_nr; + boolean robot_wheel_active; boolean magic_wall_active; int magic_wall_time_left; int light_time_left; @@ -128,9 +213,13 @@ struct PlayerInfo boolean LevelSolved, GameOver; + boolean LevelSolved_GameWon; boolean LevelSolved_GameEnd; + boolean LevelSolved_PanelOff; boolean LevelSolved_SaveTape; boolean LevelSolved_SaveScore; + int LevelSolved_CountingTime; + int LevelSolved_CountingScore; int last_move_dir; @@ -194,6 +283,7 @@ struct PlayerInfo int lights_still_needed; int friends_still_needed; int key[MAX_NUM_KEYS]; + int num_white_keys; int dynabomb_count, dynabomb_size, dynabombs_left, dynabomb_xl; int shield_normal_time_left; int shield_deadly_time_left; @@ -212,10 +302,13 @@ void DEBUG_SetMaximumDynamite(); #endif void GetPlayerConfig(void); +int GetElementFromGroupElement(int); void DrawGameValue_Time(int); void DrawGameDoorValues(void); +void UpdateAndDisplayGameControlValues(); + void InitGameSound(); void InitGame(); @@ -256,5 +349,6 @@ boolean CheckEngineSnapshot(); void CreateGameButtons(); void FreeGameButtons(); void UnmapGameButtons(); +void RedrawGameButtons(); #endif diff --git a/src/game_em/graphics.c b/src/game_em/graphics.c index 21ca0964..29d9e15d 100644 --- a/src/game_em/graphics.c +++ b/src/game_em/graphics.c @@ -27,6 +27,7 @@ (8 - frame) * ply[p].y) * TILEY / 8 \ - ((SCR_FIELDY - 1) * TILEY) / 2) +#define USE_EXTENDED_GRAPHICS_ENGINE 1 int frame; /* current screen frame */ int screen_x; /* current scroll position */ @@ -143,11 +144,31 @@ void blitscreen(void) BackToFront_EM(); } -static void DrawLevelField_EM(int x, int y, int sx, int sy, - boolean draw_masked) +static struct GraphicInfo_EM *getObjectGraphic(int x, int y) { int tile = Draw[y][x]; struct GraphicInfo_EM *g = &graphic_info_em_object[tile][frame]; + + if (!game.use_native_emc_graphics_engine) + getGraphicSourceObjectExt_EM(g, tile, 7 - frame, x - 2, y - 2); + + return g; +} + +static struct GraphicInfo_EM *getPlayerGraphic(int player_nr, int anim) +{ + struct GraphicInfo_EM *g = &graphic_info_em_player[player_nr][anim][frame]; + + if (!game.use_native_emc_graphics_engine) + getGraphicSourcePlayerExt_EM(g, player_nr, anim, 7 - frame); + + return g; +} + +static void DrawLevelField_EM(int x, int y, int sx, int sy, + boolean draw_masked) +{ + struct GraphicInfo_EM *g = getObjectGraphic(x, y); int src_x = g->src_x + g->src_offset_x; int src_y = g->src_y + g->src_offset_y; int dst_x = sx * TILEX + g->dst_offset_x; @@ -186,8 +207,7 @@ static void DrawLevelField_EM(int x, int y, int sx, int sy, static void DrawLevelFieldCrumbled_EM(int x, int y, int sx, int sy, int crm, boolean draw_masked) { - int tile = Draw[y][x]; - struct GraphicInfo_EM *g = &graphic_info_em_object[tile][frame]; + struct GraphicInfo_EM *g = getObjectGraphic(x, y); int left = screen_x / TILEX; int top = screen_y / TILEY; int i; @@ -200,6 +220,13 @@ static void DrawLevelFieldCrumbled_EM(int x, int y, int sx, int sy, if (crm == 0) /* no crumbled edges for this tile */ return; +#if 0 + if (x == 3 && y == 3 && frame == 0) + printf("::: %d, %d\n", + graphic_info_em_object[207][0].crumbled_src_x, + graphic_info_em_object[207][0].crumbled_src_y); +#endif + for (i = 0; i < 4; i++) { if (crm & (1 << i)) @@ -246,8 +273,7 @@ static void DrawLevelFieldCrumbled_EM(int x, int y, int sx, int sy, static void DrawLevelPlayer_EM(int x1, int y1, int player_nr, int anim, boolean draw_masked) { - struct GraphicInfo_EM *g = &graphic_info_em_player[player_nr][anim][frame]; - + struct GraphicInfo_EM *g = getPlayerGraphic(player_nr, anim); int src_x = g->src_x, src_y = g->src_y; int dst_x, dst_y; @@ -325,6 +351,12 @@ static void animscreen(void) { 0, +1 } }; + if (!game.use_native_emc_graphics_engine) + for (y = 2; y < EM_MAX_CAVE_HEIGHT - 2; y++) + for (x = 2; x < EM_MAX_CAVE_WIDTH - 2; x++) + SetGfxAnimation_EM(&graphic_info_em_object[Draw[y][x]][frame], + Draw[y][x], 7 - frame, x - 2, y - 2); + for (y = top; y < top + MAX_BUF_YSIZE; y++) { for (x = left; x < left + MAX_BUF_XSIZE; x++) @@ -335,6 +367,7 @@ static void animscreen(void) struct GraphicInfo_EM *g = &graphic_info_em_object[tile][frame]; int obj = g->unique_identifier; int crm = 0; + boolean redraw_screen_tile = FALSE; /* re-calculate crumbled state of this tile */ if (g->has_crumbled_graphics) @@ -356,8 +389,17 @@ static void animscreen(void) } } + redraw_screen_tile = (screentiles[sy][sx] != obj || + crumbled_state[sy][sx] != crm); + +#if 0 + /* !!! TEST ONLY -- CHANGE THIS !!! */ + if (!game.use_native_emc_graphics_engine) + redraw_screen_tile = TRUE; +#endif + /* only redraw screen tiles if they (or their crumbled state) changed */ - if (screentiles[sy][sx] != obj || crumbled_state[sy][sx] != crm) + if (redraw_screen_tile) { DrawLevelField_EM(x, y, sx, sy, FALSE); DrawLevelFieldCrumbled_EM(x, y, sx, sy, crm, FALSE); @@ -452,9 +494,14 @@ static void blitplayer(struct PLAYER *ply) DrawLevelField_EM(new_x, new_y, new_sx, new_sy, TRUE); } - /* mark screen tiles as dirty */ + /* redraw screen tiles in the next frame (player may have left the tiles) */ screentiles[old_sy][old_sx] = -1; screentiles[new_sy][new_sx] = -1; + + /* mark screen tiles as dirty (force screen refresh with changed content) */ + redraw[old_sx][old_sy] = TRUE; + redraw[new_sx][new_sy] = TRUE; + redraw_tiles += 2; } } @@ -501,7 +548,7 @@ void DrawRelocatePlayer(struct PlayerInfo *player, boolean quick_relocation) if (quick_relocation) { - int offset = (setup.scroll_delay ? 3 : 0); + int offset = game.scroll_delay_value; if (!IN_VIS_FIELD(SCREENX(jx), SCREENY(jy))) { @@ -705,7 +752,7 @@ void RedrawPlayfield_EM(boolean force_redraw) int player_nr = game_em.last_moving_player; #endif int stepsize = TILEX / 8; - int offset = (setup.scroll_delay ? 3 : 0) * TILEX; + int offset = game.scroll_delay_value * TILEX; int offset_x = offset; int offset_y = offset; int screen_x_old = screen_x; diff --git a/src/game_em/init.c b/src/game_em/init.c index b5a0e033..6e7fe948 100644 --- a/src/game_em/init.c +++ b/src/game_em/init.c @@ -366,7 +366,7 @@ void sound_play(void) #endif - memset(play, 0, sizeof(play)); + clear_mem(play, sizeof(play)); } unsigned int InitEngineRandom_EM(long seed) diff --git a/src/game_em/sound.c b/src/game_em/sound.c index 5aedabb3..c1334cc7 100644 --- a/src/game_em/sound.c +++ b/src/game_em/sound.c @@ -86,7 +86,7 @@ int sound_thread(void) mix_buffer = 0; mix_count = 0; - memset(sound_play, 0, sizeof(sound_play)); /* not playing any sounds */ + clear_mem(sound_play, sizeof(sound_play)); /* not playing any sounds */ for (;;) { @@ -294,7 +294,7 @@ int sound_thread(void) if (mix_count && audio_fd != -1) { /* prepare mix buffer */ - memset(mix_buffer, 0, fragment_size * sizeof(*mix_buffer)); + clear_mem(mix_buffer, fragment_size * sizeof(*mix_buffer)); for (i = 0; i < mix_count; i++) { diff --git a/src/init.c b/src/init.c index ba94035e..512c2756 100644 --- a/src/init.c +++ b/src/init.c @@ -32,12 +32,18 @@ #include "conf_fnt.c" /* include auto-generated data structure definitions */ #include "conf_g2s.c" /* include auto-generated data structure definitions */ #include "conf_g2m.c" /* include auto-generated data structure definitions */ +#include "conf_act.c" /* include auto-generated data structure definitions */ #define CONFIG_TOKEN_FONT_INITIAL "font.initial" +#define CONFIG_TOKEN_GLOBAL_BUSY "global.busy" + +#define DEBUG_PRINT_INIT_TIMESTAMPS TRUE +#define DEBUG_PRINT_INIT_TIMESTAMPS_DEPTH 1 static struct FontBitmapInfo font_initial[NUM_INITIAL_FONTS]; +static struct GraphicInfo anim_initial; static int copy_properties[][5] = { @@ -82,6 +88,143 @@ static int copy_properties[][5] = } }; + +static void print_timestamp_ext(char *message, char *mode) +{ +#if DEBUG +#if DEBUG_PRINT_INIT_TIMESTAMPS + static char *debug_message = NULL; + static char *last_message = NULL; + static int counter_nr = 0; + int max_depth = DEBUG_PRINT_INIT_TIMESTAMPS_DEPTH; + + checked_free(debug_message); + debug_message = getStringCat3(mode, " ", message); + + if (strEqual(mode, "INIT")) + { + debug_print_timestamp(counter_nr, NULL); + + if (counter_nr + 1 < max_depth) + debug_print_timestamp(counter_nr, debug_message); + + counter_nr++; + + debug_print_timestamp(counter_nr, NULL); + } + else if (strEqual(mode, "DONE")) + { + counter_nr--; + + if (counter_nr + 1 < max_depth || + (counter_nr == 0 && max_depth == 1)) + { + last_message = message; + + if (counter_nr == 0 && max_depth == 1) + { + checked_free(debug_message); + debug_message = getStringCat3("TIME", " ", message); + } + + debug_print_timestamp(counter_nr, debug_message); + } + } + else if (!strEqual(mode, "TIME") || + !strEqual(message, last_message)) + { + if (counter_nr < max_depth) + debug_print_timestamp(counter_nr, debug_message); + } +#endif +#endif +} + +static void print_timestamp_init(char *message) +{ + print_timestamp_ext(message, "INIT"); +} + +static void print_timestamp_time(char *message) +{ + print_timestamp_ext(message, "TIME"); +} + +static void print_timestamp_done(char *message) +{ + print_timestamp_ext(message, "DONE"); +} + +void DrawInitAnim() +{ + struct GraphicInfo *graphic_info_last = graphic_info; + int graphic = 0; + static unsigned long action_delay = 0; + unsigned long action_delay_value = GameFrameDelay; + int sync_frame = FrameCounter; + int x, y; + + if (game_status != GAME_MODE_LOADING) + return; + + if (anim_initial.bitmap == NULL || window == NULL) + return; + + if (!DelayReached(&action_delay, action_delay_value)) + return; + +#if 0 + { + static unsigned long last_counter = -1; + unsigned long current_counter = Counter(); + unsigned long delay = current_counter - last_counter; + + if (last_counter != -1 && delay > action_delay_value + 5) + printf("::: DrawInitAnim: DELAY TOO LONG: %ld\n", delay); + + last_counter = current_counter; + } +#endif + +#if 0 + anim_initial.anim_mode = ANIM_LOOP; + anim_initial.anim_start_frame = 0; + anim_initial.offset_x = anim_initial.width; + anim_initial.offset_y = 0; +#endif + +#if 1 + x = ALIGNED_TEXT_XPOS(&init.busy); + y = ALIGNED_TEXT_YPOS(&init.busy); +#else + x = WIN_XSIZE / 2 - TILESIZE / 2; + y = WIN_YSIZE / 2 - TILESIZE / 2; +#endif + +#if 0 + { + static boolean done = FALSE; + + if (!done) + printf("::: %d, %d, %d, %d => %d, %d\n", + init.busy.x, init.busy.y, + init.busy.align, init.busy.valign, + x, y); + + done = TRUE; + } +#endif + + graphic_info = &anim_initial; /* graphic == 0 => anim_initial */ + + if (sync_frame % anim_initial.anim_delay == 0) + DrawGraphicAnimationExt(window, x, y, graphic, sync_frame, NO_MASKING); + + graphic_info = graphic_info_last; + + FrameCounter++; +} + void FreeGadgets() { FreeLevelEditorGadgets(); @@ -111,6 +254,12 @@ void InitGadgets() inline void InitElementSmallImagesScaledUp(int graphic) { +#if 0 + struct FileInfo *fi = getImageListEntryFromImageID(graphic); + + printf("::: '%s' -> '%s'\n", fi->token, fi->filename); +#endif + CreateImageWithSmallImages(graphic, graphic_info[graphic].scale_up_factor); } @@ -167,12 +316,16 @@ static int getFontBitmapID(int font_nr) { int special = -1; - if (game_status >= GAME_MODE_TITLE && game_status <= GAME_MODE_PSEUDO_PREVIEW) + /* (special case: do not use special font for GAME_MODE_LOADING) */ + if (game_status >= GAME_MODE_TITLE_INITIAL && + game_status <= GAME_MODE_PSEUDO_PREVIEW) special = game_status; else if (game_status == GAME_MODE_PSEUDO_TYPENAME) special = GFX_SPECIAL_ARG_MAIN; +#if 0 else if (game_status == GAME_MODE_PLAYING) special = GFX_SPECIAL_ARG_DOOR; +#endif if (special != -1) return font_info[font_nr].special_bitmap_id[special]; @@ -180,6 +333,26 @@ static int getFontBitmapID(int font_nr) return font_nr; } +static int getFontFromToken(char *token) +{ +#if 1 + char *value = getHashEntry(font_token_hash, token); + + if (value != NULL) + return atoi(value); +#else + int i; + + /* !!! OPTIMIZE THIS BY USING HASH !!! */ + for (i = 0; i < NUM_FONTS; i++) + if (strEqual(token, font_info[i].token_name)) + return i; +#endif + + /* if font not found, use reliable default value */ + return FONT_INITIAL_1; +} + void InitFontGraphicInfo() { static struct FontBitmapInfo *font_bitmap_info = NULL; @@ -190,7 +363,8 @@ void InitFontGraphicInfo() if (graphic_info == NULL) /* still at startup phase */ { - InitFontInfo(font_initial, NUM_INITIAL_FONTS, getFontBitmapID); + InitFontInfo(font_initial, NUM_INITIAL_FONTS, + getFontBitmapID, getFontFromToken); return; } @@ -232,18 +406,21 @@ void InitFontGraphicInfo() int graphic = font_to_graphic[i].graphic; int base_graphic = font2baseimg(font_nr); - if (special >= 0 && special < NUM_SPECIAL_GFX_ARGS) + if (IS_SPECIAL_GFX_ARG(special)) { boolean base_redefined = getImageListEntryFromImageID(base_graphic)->redefined; boolean special_redefined = getImageListEntryFromImageID(graphic)->redefined; + boolean special_cloned = (graphic_info[graphic].clone_from != -1); /* if the base font ("font.title_1", for example) has been redefined, but not the special font ("font.title_1.LEVELS", for example), do not use an existing (in this case considered obsolete) special font anymore, but use the automatically determined default font */ - if (base_redefined && !special_redefined) + /* special case: cloned special fonts must be explicitly redefined, + but are not automatically redefined by redefining base font */ + if (base_redefined && !special_redefined && !special_cloned) continue; font_info[font_nr].special_graphic[special] = graphic; @@ -262,7 +439,7 @@ void InitFontGraphicInfo() if (font_nr < 0) continue; - if (special >= 0 && special < NUM_SPECIAL_GFX_ARGS) + if (IS_SPECIAL_GFX_ARG(special)) { font_info[font_nr].special_graphic[special] = graphic; font_info[font_nr].special_bitmap_id[special] = num_font_bitmaps; @@ -270,6 +447,45 @@ void InitFontGraphicInfo() } } + /* correct special font/graphic mapping for cloned fonts for downwards + compatibility of PREVIEW fonts -- this is only needed for implicit + redefinition of special font by redefined base font, and only if other + fonts are cloned from this special font (like in the "Zelda" level set) */ + for (i = 0; font_to_graphic[i].font_nr > -1; i++) + { + int font_nr = font_to_graphic[i].font_nr; + int special = font_to_graphic[i].special; + int graphic = font_to_graphic[i].graphic; + + if (IS_SPECIAL_GFX_ARG(special)) + { + boolean special_redefined = + getImageListEntryFromImageID(graphic)->redefined; + boolean special_cloned = (graphic_info[graphic].clone_from != -1); + + if (special_cloned && !special_redefined) + { + int j; + + for (j = 0; font_to_graphic[j].font_nr > -1; j++) + { + int font_nr2 = font_to_graphic[j].font_nr; + int special2 = font_to_graphic[j].special; + int graphic2 = font_to_graphic[j].graphic; + + if (IS_SPECIAL_GFX_ARG(special2) && + graphic2 == graphic_info[graphic].clone_from) + { + font_info[font_nr].special_graphic[special] = + font_info[font_nr2].special_graphic[special2]; + font_info[font_nr].special_bitmap_id[special] = + font_info[font_nr2].special_bitmap_id[special2]; + } + } + } + } + } + /* reset non-redefined ".active" font graphics if normal font is redefined */ /* (this different treatment is needed because normal and active fonts are independently defined ("active" is not a property of font definitions!) */ @@ -367,7 +583,8 @@ void InitFontGraphicInfo() } } - InitFontInfo(font_bitmap_info, num_font_bitmaps, getFontBitmapID); + InitFontInfo(font_bitmap_info, num_font_bitmaps, + getFontBitmapID, getFontFromToken); } void InitElementGraphicInfo() @@ -395,6 +612,8 @@ void InitElementGraphicInfo() } } + UPDATE_BUSY_STATE(); + /* initialize normal element/graphic mapping from static configuration */ for (i = 0; element_to_graphic[i].element > -1; i++) { @@ -453,6 +672,16 @@ void InitElementGraphicInfo() int graphic = property_mapping[i].artwork_index; boolean crumbled = FALSE; +#if 0 + if ((element == EL_EM_DYNAMITE || + element == EL_EM_DYNAMITE_ACTIVE) && + action == ACTION_ACTIVE && + (special == GFX_SPECIAL_ARG_EDITOR || + special == GFX_SPECIAL_ARG_PANEL)) + printf("::: DYNAMIC: %d, %d, %d -> %d\n", + element, action, special, graphic); +#endif + if (special == GFX_SPECIAL_ARG_CRUMBLED) { special = -1; @@ -569,6 +798,8 @@ void InitElementGraphicInfo() } } + UPDATE_BUSY_STATE(); + /* adjust graphics with 2nd tile for movement according to direction (do this before correcting '-1' values to minimize calculations) */ for (i = 0; i < MAX_NUM_ELEMENTS; i++) @@ -628,6 +859,8 @@ void InitElementGraphicInfo() } } + UPDATE_BUSY_STATE(); + /* now set all '-1' values to element specific default values */ for (i = 0; i < MAX_NUM_ELEMENTS; i++) { @@ -779,6 +1012,8 @@ void InitElementGraphicInfo() } } + UPDATE_BUSY_STATE(); + #if 0 /* !!! THIS ALSO CLEARS SPECIAL FLAGS (AND IS NOT NEEDED ANYWAY) !!! */ /* set animation mode to "none" for each graphic with only 1 frame */ @@ -815,7 +1050,7 @@ void InitElementGraphicInfo() for (i = 0; i < MAX_NUM_ELEMENTS; i++) if (element_info[i].graphic[ACTION_DEFAULT] == IMG_UNKNOWN && i != EL_UNKNOWN) - Error(ERR_RETURN, "warning: no graphic for element '%s' (%d)", + Error(ERR_INFO, "warning: no graphic for element '%s' (%d)", element_info[i].token_name, i); } #endif @@ -846,6 +1081,15 @@ void InitElementSpecialGraphicInfo() boolean special_redefined = getImageListEntryFromImageID(graphic)->redefined; +#if 0 + if ((element == EL_EM_DYNAMITE || + element == EL_EM_DYNAMITE_ACTIVE) && + (special == GFX_SPECIAL_ARG_EDITOR || + special == GFX_SPECIAL_ARG_PANEL)) + printf("::: SPECIAL STATIC: %d, %d -> %d\n", + element, special, graphic); +#endif + /* if the base graphic ("emerald", for example) has been redefined, but not the special graphic ("emerald.EDITOR", for example), do not use an existing (in this case considered obsolete) special graphic @@ -859,14 +1103,58 @@ void InitElementSpecialGraphicInfo() /* initialize special element/graphic mapping from dynamic configuration */ for (i = 0; i < num_property_mappings; i++) { - int element = property_mapping[i].base_index; - int special = property_mapping[i].ext3_index; - int graphic = property_mapping[i].artwork_index; + int element = property_mapping[i].base_index; + int action = property_mapping[i].ext1_index; + int direction = property_mapping[i].ext2_index; + int special = property_mapping[i].ext3_index; + int graphic = property_mapping[i].artwork_index; + +#if 0 + if ((element == EL_EM_DYNAMITE || + element == EL_EM_DYNAMITE_ACTIVE || + element == EL_CONVEYOR_BELT_1_MIDDLE || + element == EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE) && + (special == GFX_SPECIAL_ARG_EDITOR || + special == GFX_SPECIAL_ARG_PANEL)) + printf("::: SPECIAL DYNAMIC: %d, %d -> %d [%d]\n", + element, special, graphic, property_mapping[i].ext1_index); +#endif + +#if 0 + if (element == EL_CONVEYOR_BELT_1_MIDDLE && + action == ACTION_ACTIVE) + { + element = EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE; + action = -1; + } +#endif + +#if 0 + if (element == EL_MAGIC_WALL && + action == ACTION_ACTIVE) + { + element = EL_MAGIC_WALL_ACTIVE; + action = -1; + } +#endif + +#if 1 + /* for action ".active", replace element with active element, if exists */ + if (action == ACTION_ACTIVE && element != ELEMENT_ACTIVE(element)) + { + element = ELEMENT_ACTIVE(element); + action = -1; + } +#endif if (element >= MAX_NUM_ELEMENTS) continue; - if (special >= 0 && special < NUM_SPECIAL_GFX_ARGS) + /* do not change special graphic if action or direction was specified */ + if (action != -1 || direction != -1) + continue; + + if (IS_SPECIAL_GFX_ARG(special)) element_info[element].special_graphic[special] = graphic; } @@ -880,15 +1168,34 @@ void InitElementSpecialGraphicInfo() static int get_graphic_parameter_value(char *value_raw, char *suffix, int type) { - int i; - int x = 0; - - if (type != TYPE_TOKEN) + if (type != TYPE_ELEMENT && type != TYPE_GRAPHIC) return get_parameter_value(value_raw, suffix, type); if (strEqual(value_raw, ARG_UNDEFINED)) return ARG_UNDEFINED_VALUE; +#if 1 + if (type == TYPE_ELEMENT) + { + char *value = getHashEntry(element_token_hash, value_raw); + + return (value != NULL ? atoi(value) : EL_UNDEFINED); + } + else if (type == TYPE_GRAPHIC) + { + char *value = getHashEntry(graphic_token_hash, value_raw); + + return (value != NULL ? atoi(value) : IMG_UNDEFINED); + } + +#else + + int i; + int x = 0; + + /* !!! THIS IS BUGGY !!! NOT SURE IF YOU GET ELEMENT ID OR GRAPHIC ID !!! */ + /* !!! (possible reason why ".clone_from" with elements doesn't work) !!! */ + /* !!! OPTIMIZE THIS BY USING HASH !!! */ for (i = 0; i < MAX_NUM_ELEMENTS; i++) if (strEqual(element_info[i].token_name, value_raw)) @@ -909,6 +1216,7 @@ static int get_graphic_parameter_value(char *value_raw, char *suffix, int type) x++; } +#endif return -1; } @@ -929,8 +1237,259 @@ static int get_scaled_graphic_height(int graphic) return original_height * scale_up_factor; } +static void set_graphic_parameters_ext(int graphic, struct GraphicInfo *g, + int *parameter, Bitmap *src_bitmap) +{ + int anim_frames_per_row = 1, anim_frames_per_col = 1; + int anim_frames_per_line = 1; + + /* always start with reliable default values */ + g->src_image_width = 0; + g->src_image_height = 0; + g->src_x = 0; + g->src_y = 0; + g->width = TILEX; /* default for element graphics */ + g->height = TILEY; /* default for element graphics */ + g->offset_x = 0; /* one or both of these values ... */ + g->offset_y = 0; /* ... will be corrected later */ + g->offset2_x = 0; /* one or both of these values ... */ + g->offset2_y = 0; /* ... will be corrected later */ + g->swap_double_tiles = -1; /* auto-detect tile swapping */ + g->crumbled_like = -1; /* do not use clone element */ + g->diggable_like = -1; /* do not use clone element */ + g->border_size = TILEX / 8; /* "CRUMBLED" border size */ + g->scale_up_factor = 1; /* default: no scaling up */ + g->clone_from = -1; /* do not use clone graphic */ + g->anim_delay_fixed = 0; + g->anim_delay_random = 0; + g->post_delay_fixed = 0; + g->post_delay_random = 0; + g->fade_mode = FADE_MODE_DEFAULT; + g->fade_delay = -1; + g->post_delay = -1; + g->auto_delay = -1; + g->align = ALIGN_CENTER; /* default for title screens */ + g->valign = VALIGN_MIDDLE; /* default for title screens */ + g->sort_priority = 0; /* default for title screens */ + + g->bitmap = src_bitmap; + +#if 1 + /* optional zoom factor for scaling up the image to a larger size */ + if (parameter[GFX_ARG_SCALE_UP_FACTOR] != ARG_UNDEFINED_VALUE) + g->scale_up_factor = parameter[GFX_ARG_SCALE_UP_FACTOR]; + if (g->scale_up_factor < 1) + g->scale_up_factor = 1; /* no scaling */ +#endif + +#if 1 + if (g->use_image_size) + { + /* set new default bitmap size (with scaling, but without small images) */ + g->width = get_scaled_graphic_width(graphic); + g->height = get_scaled_graphic_height(graphic); + } +#endif + + /* optional x and y tile position of animation frame sequence */ + if (parameter[GFX_ARG_XPOS] != ARG_UNDEFINED_VALUE) + g->src_x = parameter[GFX_ARG_XPOS] * TILEX; + if (parameter[GFX_ARG_YPOS] != ARG_UNDEFINED_VALUE) + g->src_y = parameter[GFX_ARG_YPOS] * TILEY; + + /* optional x and y pixel position of animation frame sequence */ + if (parameter[GFX_ARG_X] != ARG_UNDEFINED_VALUE) + g->src_x = parameter[GFX_ARG_X]; + if (parameter[GFX_ARG_Y] != ARG_UNDEFINED_VALUE) + g->src_y = parameter[GFX_ARG_Y]; + + /* optional width and height of each animation frame */ + if (parameter[GFX_ARG_WIDTH] != ARG_UNDEFINED_VALUE) + g->width = parameter[GFX_ARG_WIDTH]; + if (parameter[GFX_ARG_HEIGHT] != ARG_UNDEFINED_VALUE) + g->height = parameter[GFX_ARG_HEIGHT]; + +#if 0 + /* optional zoom factor for scaling up the image to a larger size */ + if (parameter[GFX_ARG_SCALE_UP_FACTOR] != ARG_UNDEFINED_VALUE) + g->scale_up_factor = parameter[GFX_ARG_SCALE_UP_FACTOR]; + if (g->scale_up_factor < 1) + g->scale_up_factor = 1; /* no scaling */ +#endif + + if (src_bitmap) + { + /* get final bitmap size (with scaling, but without small images) */ + int src_image_width = get_scaled_graphic_width(graphic); + int src_image_height = get_scaled_graphic_height(graphic); + + anim_frames_per_row = src_image_width / g->width; + anim_frames_per_col = src_image_height / g->height; + + g->src_image_width = src_image_width; + g->src_image_height = src_image_height; + } + + /* correct x or y offset dependent of vertical or horizontal frame order */ + if (parameter[GFX_ARG_VERTICAL]) /* frames are ordered vertically */ + { + g->offset_y = (parameter[GFX_ARG_OFFSET] != ARG_UNDEFINED_VALUE ? + parameter[GFX_ARG_OFFSET] : g->height); + anim_frames_per_line = anim_frames_per_col; + } + else /* frames are ordered horizontally */ + { + g->offset_x = (parameter[GFX_ARG_OFFSET] != ARG_UNDEFINED_VALUE ? + parameter[GFX_ARG_OFFSET] : g->width); + anim_frames_per_line = anim_frames_per_row; + } + + /* optionally, the x and y offset of frames can be specified directly */ + if (parameter[GFX_ARG_XOFFSET] != ARG_UNDEFINED_VALUE) + g->offset_x = parameter[GFX_ARG_XOFFSET]; + if (parameter[GFX_ARG_YOFFSET] != ARG_UNDEFINED_VALUE) + g->offset_y = parameter[GFX_ARG_YOFFSET]; + + /* optionally, moving animations may have separate start and end graphics */ + g->double_movement = parameter[GFX_ARG_2ND_MOVEMENT_TILE]; + + if (parameter[GFX_ARG_2ND_VERTICAL] == ARG_UNDEFINED_VALUE) + parameter[GFX_ARG_2ND_VERTICAL] = !parameter[GFX_ARG_VERTICAL]; + + /* correct x or y offset2 dependent of vertical or horizontal frame order */ + if (parameter[GFX_ARG_2ND_VERTICAL]) /* frames are ordered vertically */ + g->offset2_y = (parameter[GFX_ARG_2ND_OFFSET] != ARG_UNDEFINED_VALUE ? + parameter[GFX_ARG_2ND_OFFSET] : g->height); + else /* frames are ordered horizontally */ + g->offset2_x = (parameter[GFX_ARG_2ND_OFFSET] != ARG_UNDEFINED_VALUE ? + parameter[GFX_ARG_2ND_OFFSET] : g->width); + + /* optionally, the x and y offset of 2nd graphic can be specified directly */ + if (parameter[GFX_ARG_2ND_XOFFSET] != ARG_UNDEFINED_VALUE) + g->offset2_x = parameter[GFX_ARG_2ND_XOFFSET]; + if (parameter[GFX_ARG_2ND_YOFFSET] != ARG_UNDEFINED_VALUE) + g->offset2_y = parameter[GFX_ARG_2ND_YOFFSET]; + + /* optionally, the second movement tile can be specified as start tile */ + if (parameter[GFX_ARG_2ND_SWAP_TILES] != ARG_UNDEFINED_VALUE) + g->swap_double_tiles= parameter[GFX_ARG_2ND_SWAP_TILES]; + + /* automatically determine correct number of frames, if not defined */ + if (parameter[GFX_ARG_FRAMES] != ARG_UNDEFINED_VALUE) + g->anim_frames = parameter[GFX_ARG_FRAMES]; + else if (parameter[GFX_ARG_XPOS] == 0 && !parameter[GFX_ARG_VERTICAL]) + g->anim_frames = anim_frames_per_row; + else if (parameter[GFX_ARG_YPOS] == 0 && parameter[GFX_ARG_VERTICAL]) + g->anim_frames = anim_frames_per_col; + else + g->anim_frames = 1; + + if (g->anim_frames == 0) /* frames must be at least 1 */ + g->anim_frames = 1; + + g->anim_frames_per_line = + (parameter[GFX_ARG_FRAMES_PER_LINE] != ARG_UNDEFINED_VALUE ? + parameter[GFX_ARG_FRAMES_PER_LINE] : anim_frames_per_line); + + g->anim_delay = parameter[GFX_ARG_DELAY]; + if (g->anim_delay == 0) /* delay must be at least 1 */ + g->anim_delay = 1; + + g->anim_mode = parameter[GFX_ARG_ANIM_MODE]; +#if 0 + if (g->anim_frames == 1) + g->anim_mode = ANIM_NONE; +#endif + + /* automatically determine correct start frame, if not defined */ + if (parameter[GFX_ARG_START_FRAME] == ARG_UNDEFINED_VALUE) + g->anim_start_frame = 0; + else if (g->anim_mode & ANIM_REVERSE) + g->anim_start_frame = g->anim_frames - parameter[GFX_ARG_START_FRAME] - 1; + else + g->anim_start_frame = parameter[GFX_ARG_START_FRAME]; + + /* animation synchronized with global frame counter, not move position */ + g->anim_global_sync = parameter[GFX_ARG_GLOBAL_SYNC]; + + /* optional element for cloning crumble graphics */ + if (parameter[GFX_ARG_CRUMBLED_LIKE] != ARG_UNDEFINED_VALUE) + g->crumbled_like = parameter[GFX_ARG_CRUMBLED_LIKE]; + + /* optional element for cloning digging graphics */ + if (parameter[GFX_ARG_DIGGABLE_LIKE] != ARG_UNDEFINED_VALUE) + g->diggable_like = parameter[GFX_ARG_DIGGABLE_LIKE]; + + /* optional border size for "crumbling" diggable graphics */ + if (parameter[GFX_ARG_BORDER_SIZE] != ARG_UNDEFINED_VALUE) + g->border_size = parameter[GFX_ARG_BORDER_SIZE]; + + /* this is only used for player "boring" and "sleeping" actions */ + if (parameter[GFX_ARG_ANIM_DELAY_FIXED] != ARG_UNDEFINED_VALUE) + g->anim_delay_fixed = parameter[GFX_ARG_ANIM_DELAY_FIXED]; + if (parameter[GFX_ARG_ANIM_DELAY_RANDOM] != ARG_UNDEFINED_VALUE) + g->anim_delay_random = parameter[GFX_ARG_ANIM_DELAY_RANDOM]; + if (parameter[GFX_ARG_POST_DELAY_FIXED] != ARG_UNDEFINED_VALUE) + g->post_delay_fixed = parameter[GFX_ARG_POST_DELAY_FIXED]; + if (parameter[GFX_ARG_POST_DELAY_RANDOM] != ARG_UNDEFINED_VALUE) + g->post_delay_random = parameter[GFX_ARG_POST_DELAY_RANDOM]; + + /* this is only used for toon animations */ + g->step_offset = parameter[GFX_ARG_STEP_OFFSET]; + g->step_delay = parameter[GFX_ARG_STEP_DELAY]; + + /* this is only used for drawing font characters */ + g->draw_xoffset = parameter[GFX_ARG_DRAW_XOFFSET]; + g->draw_yoffset = parameter[GFX_ARG_DRAW_YOFFSET]; + + /* this is only used for drawing envelope graphics */ + g->draw_masked = parameter[GFX_ARG_DRAW_MASKED]; + + /* optional graphic for cloning all graphics settings */ + if (parameter[GFX_ARG_CLONE_FROM] != ARG_UNDEFINED_VALUE) + g->clone_from = parameter[GFX_ARG_CLONE_FROM]; + + /* optional settings for drawing title screens and title messages */ + if (parameter[GFX_ARG_FADE_MODE] != ARG_UNDEFINED_VALUE) + g->fade_mode = parameter[GFX_ARG_FADE_MODE]; + if (parameter[GFX_ARG_FADE_DELAY] != ARG_UNDEFINED_VALUE) + g->fade_delay = parameter[GFX_ARG_FADE_DELAY]; + if (parameter[GFX_ARG_POST_DELAY] != ARG_UNDEFINED_VALUE) + g->post_delay = parameter[GFX_ARG_POST_DELAY]; + if (parameter[GFX_ARG_AUTO_DELAY] != ARG_UNDEFINED_VALUE) + g->auto_delay = parameter[GFX_ARG_AUTO_DELAY]; + if (parameter[GFX_ARG_ALIGN] != ARG_UNDEFINED_VALUE) + g->align = parameter[GFX_ARG_ALIGN]; + if (parameter[GFX_ARG_VALIGN] != ARG_UNDEFINED_VALUE) + g->valign = parameter[GFX_ARG_VALIGN]; + if (parameter[GFX_ARG_SORT_PRIORITY] != ARG_UNDEFINED_VALUE) + g->sort_priority = parameter[GFX_ARG_SORT_PRIORITY]; +} + static void set_graphic_parameters(int graphic) { +#if 1 + struct FileInfo *image = getImageListEntryFromImageID(graphic); + char **parameter_raw = image->parameter; + Bitmap *src_bitmap = getBitmapFromImageID(graphic); + int parameter[NUM_GFX_ARGS]; + int i; + + /* if fallback to default artwork is done, also use the default parameters */ + if (image->fallback_to_default) + parameter_raw = image->default_parameter; + + /* get integer values from string parameters */ + for (i = 0; i < NUM_GFX_ARGS; i++) + parameter[i] = get_graphic_parameter_value(parameter_raw[i], + image_config_suffix[i].token, + image_config_suffix[i].type); + + set_graphic_parameters_ext(graphic, &graphic_info[graphic], + parameter, src_bitmap); + +#else + struct FileInfo *image = getImageListEntryFromImageID(graphic); char **parameter_raw = image->parameter; Bitmap *src_bitmap = getBitmapFromImageID(graphic); @@ -972,9 +1531,13 @@ static void set_graphic_parameters(int graphic) graphic_info[graphic].anim_delay_random = 0; graphic_info[graphic].post_delay_fixed = 0; graphic_info[graphic].post_delay_random = 0; + graphic_info[graphic].fade_mode = FADE_MODE_DEFAULT; graphic_info[graphic].fade_delay = -1; graphic_info[graphic].post_delay = -1; graphic_info[graphic].auto_delay = -1; + graphic_info[graphic].align = ALIGN_CENTER; /* default for title screens */ + graphic_info[graphic].valign = VALIGN_MIDDLE; /* default for title screens */ + graphic_info[graphic].sort_priority = 0; /* default for title screens */ #if 1 /* optional zoom factor for scaling up the image to a larger size */ @@ -1160,13 +1723,24 @@ static void set_graphic_parameters(int graphic) if (parameter[GFX_ARG_CLONE_FROM] != ARG_UNDEFINED_VALUE) graphic_info[graphic].clone_from = parameter[GFX_ARG_CLONE_FROM]; - /* optional settings for drawing title screens */ + /* optional settings for drawing title screens and title messages */ + if (parameter[GFX_ARG_FADE_MODE] != ARG_UNDEFINED_VALUE) + graphic_info[graphic].fade_mode = parameter[GFX_ARG_FADE_MODE]; if (parameter[GFX_ARG_FADE_DELAY] != ARG_UNDEFINED_VALUE) graphic_info[graphic].fade_delay = parameter[GFX_ARG_FADE_DELAY]; if (parameter[GFX_ARG_POST_DELAY] != ARG_UNDEFINED_VALUE) graphic_info[graphic].post_delay = parameter[GFX_ARG_POST_DELAY]; if (parameter[GFX_ARG_AUTO_DELAY] != ARG_UNDEFINED_VALUE) graphic_info[graphic].auto_delay = parameter[GFX_ARG_AUTO_DELAY]; + if (parameter[GFX_ARG_ALIGN] != ARG_UNDEFINED_VALUE) + graphic_info[graphic].align = parameter[GFX_ARG_ALIGN]; + if (parameter[GFX_ARG_VALIGN] != ARG_UNDEFINED_VALUE) + graphic_info[graphic].valign = parameter[GFX_ARG_VALIGN]; + if (parameter[GFX_ARG_SORT_PRIORITY] != ARG_UNDEFINED_VALUE) + graphic_info[graphic].sort_priority = parameter[GFX_ARG_SORT_PRIORITY]; +#endif + + UPDATE_BUSY_STATE(); } static void set_cloned_graphic_parameters(int graphic) @@ -1186,18 +1760,18 @@ static void set_cloned_graphic_parameters(int graphic) if (num_references_followed >= max_num_images) { - Error(ERR_RETURN_LINE, "-"); - Error(ERR_RETURN, "warning: error found in config file:"); - Error(ERR_RETURN, "- config file: '%s'", getImageConfigFilename()); - Error(ERR_RETURN, "- config token: '%s'", getTokenFromImageID(graphic)); - Error(ERR_RETURN, "error: loop discovered when resolving cloned graphics"); - Error(ERR_RETURN, "custom graphic rejected for this element/action"); + Error(ERR_INFO_LINE, "-"); + Error(ERR_INFO, "warning: error found in config file:"); + Error(ERR_INFO, "- config file: '%s'", getImageConfigFilename()); + Error(ERR_INFO, "- config token: '%s'", getTokenFromImageID(graphic)); + Error(ERR_INFO, "error: loop discovered when resolving cloned graphics"); + Error(ERR_INFO, "custom graphic rejected for this element/action"); if (graphic == fallback_graphic) Error(ERR_EXIT, "fatal error: no fallback graphic available"); - Error(ERR_RETURN, "fallback done to 'char_exclam' for this graphic"); - Error(ERR_RETURN_LINE, "-"); + Error(ERR_INFO, "fallback done to 'char_exclam' for this graphic"); + Error(ERR_INFO_LINE, "-"); graphic_info[graphic] = graphic_info[fallback_graphic]; } @@ -1234,8 +1808,8 @@ static void InitGraphicInfo() IMG_BACKGROUND_ENVELOPE_4, IMG_BACKGROUND, + IMG_BACKGROUND_TITLE_INITIAL, IMG_BACKGROUND_TITLE, - IMG_BACKGROUND_MESSAGE, IMG_BACKGROUND_MAIN, IMG_BACKGROUND_LEVELS, IMG_BACKGROUND_SCORES, @@ -1338,21 +1912,21 @@ static void InitGraphicInfo() src_x + width > src_bitmap_width || src_y + height > src_bitmap_height) { - Error(ERR_RETURN_LINE, "-"); - Error(ERR_RETURN, "warning: error found in config file:"); - Error(ERR_RETURN, "- config file: '%s'", getImageConfigFilename()); - Error(ERR_RETURN, "- config token: '%s'", getTokenFromImageID(i)); - Error(ERR_RETURN, "- image file: '%s'", src_bitmap->source_filename); - Error(ERR_RETURN, + Error(ERR_INFO_LINE, "-"); + Error(ERR_INFO, "warning: error found in config file:"); + Error(ERR_INFO, "- config file: '%s'", getImageConfigFilename()); + Error(ERR_INFO, "- config token: '%s'", getTokenFromImageID(i)); + Error(ERR_INFO, "- image file: '%s'", src_bitmap->source_filename); + Error(ERR_INFO, "error: first animation frame out of bounds (%d, %d) [%d, %d]", src_x, src_y, src_bitmap_width, src_bitmap_height); - Error(ERR_RETURN, "custom graphic rejected for this element/action"); + Error(ERR_INFO, "custom graphic rejected for this element/action"); if (i == fallback_graphic) Error(ERR_EXIT, "fatal error: no fallback graphic available"); - Error(ERR_RETURN, "fallback done to 'char_exclam' for this graphic"); - Error(ERR_RETURN_LINE, "-"); + Error(ERR_INFO, "fallback done to 'char_exclam' for this graphic"); + Error(ERR_INFO_LINE, "-"); graphic_info[i] = graphic_info[fallback_graphic]; } @@ -1366,21 +1940,21 @@ static void InitGraphicInfo() src_x + width > src_bitmap_width || src_y + height > src_bitmap_height) { - Error(ERR_RETURN_LINE, "-"); - Error(ERR_RETURN, "warning: error found in config file:"); - Error(ERR_RETURN, "- config file: '%s'", getImageConfigFilename()); - Error(ERR_RETURN, "- config token: '%s'", getTokenFromImageID(i)); - Error(ERR_RETURN, "- image file: '%s'", src_bitmap->source_filename); - Error(ERR_RETURN, + Error(ERR_INFO_LINE, "-"); + Error(ERR_INFO, "warning: error found in config file:"); + Error(ERR_INFO, "- config file: '%s'", getImageConfigFilename()); + Error(ERR_INFO, "- config token: '%s'", getTokenFromImageID(i)); + Error(ERR_INFO, "- image file: '%s'", src_bitmap->source_filename); + Error(ERR_INFO, "error: last animation frame (%d) out of bounds (%d, %d) [%d, %d]", last_frame, src_x, src_y, src_bitmap_width, src_bitmap_height); - Error(ERR_RETURN, "custom graphic rejected for this element/action"); + Error(ERR_INFO, "custom graphic rejected for this element/action"); if (i == fallback_graphic) Error(ERR_EXIT, "fatal error: no fallback graphic available"); - Error(ERR_RETURN, "fallback done to 'char_exclam' for this graphic"); - Error(ERR_RETURN_LINE, "-"); + Error(ERR_INFO, "fallback done to 'char_exclam' for this graphic"); + Error(ERR_INFO_LINE, "-"); graphic_info[i] = graphic_info[fallback_graphic]; } @@ -1584,7 +2158,7 @@ static void set_sound_parameters(int sound, char **parameter_raw) sound_info[sound].volume = parameter[SND_ARG_VOLUME]; /* sound priority to give certain sounds a higher or lower priority */ - sound_info[sound].volume = parameter[SND_ARG_VOLUME]; + sound_info[sound].priority = parameter[SND_ARG_PRIORITY]; } static void InitSoundInfo() @@ -1797,21 +2371,36 @@ static void InitMusicInfo() static void ReinitializeGraphics() { + print_timestamp_init("ReinitializeGraphics"); + InitGraphicInfo(); /* graphic properties mapping */ + print_timestamp_time("InitGraphicInfo"); InitElementGraphicInfo(); /* element game graphic mapping */ + print_timestamp_time("InitElementGraphicInfo"); InitElementSpecialGraphicInfo(); /* element special graphic mapping */ + print_timestamp_time("InitElementSpecialGraphicInfo"); InitElementSmallImages(); /* scale elements to all needed sizes */ + print_timestamp_time("InitElementSmallImages"); InitScaledImages(); /* scale all other images, if needed */ + print_timestamp_time("InitScaledImages"); InitFontGraphicInfo(); /* initialize text drawing functions */ + print_timestamp_time("InitFontGraphicInfo"); InitGraphicInfo_EM(); /* graphic mapping for EM engine */ + print_timestamp_time("InitGraphicInfo_EM"); SetMainBackgroundImage(IMG_BACKGROUND); + print_timestamp_time("SetMainBackgroundImage"); SetDoorBackgroundImage(IMG_BACKGROUND_DOOR); + print_timestamp_time("SetDoorBackgroundImage"); InitGadgets(); + print_timestamp_time("InitGadgets"); InitToons(); + print_timestamp_time("InitToons"); + + print_timestamp_done("ReinitializeGraphics"); } static void ReinitializeSounds() @@ -1959,7 +2548,7 @@ boolean getBitfieldProperty(int *bitfield, int property_bit_nr, int element) return FALSE; } -static void resolve_group_element(int group_element, int recursion_depth) +static void ResolveGroupElementExt(int group_element, int recursion_depth) { static int group_nr; static struct ElementGroupInfo *group; @@ -1983,10 +2572,13 @@ static void resolve_group_element(int group_element, int recursion_depth) if (recursion_depth == 0) /* initialization */ { group = actual_group; - group_nr = group_element - EL_GROUP_START; + group_nr = GROUP_NR(group_element); group->num_elements_resolved = 0; group->choice_pos = 0; + + for (i = 0; i < MAX_NUM_ELEMENTS; i++) + element_info[i].in_group[group_nr] = FALSE; } for (i = 0; i < actual_group->num_elements; i++) @@ -1997,7 +2589,7 @@ static void resolve_group_element(int group_element, int recursion_depth) break; if (IS_GROUP_ELEMENT(element)) - resolve_group_element(element, recursion_depth + 1); + ResolveGroupElementExt(element, recursion_depth + 1); else { group->element_resolved[group->num_elements_resolved++] = element; @@ -2006,8 +2598,15 @@ static void resolve_group_element(int group_element, int recursion_depth) } } +void ResolveGroupElement(int group_element) +{ + ResolveGroupElementExt(group_element, 0); +} + void InitElementPropertiesStatic() { + static boolean clipboard_elements_initialized = FALSE; + static int ep_diggable[] = { EL_SAND, @@ -2023,6 +2622,7 @@ void InitElementPropertiesStatic() /* (if amoeba can grow into anything diggable, maybe keep these out) */ #if 0 EL_LANDMINE, + EL_DC_LANDMINE, EL_TRAP_ACTIVE, EL_SP_BUGGY_BASE_ACTIVE, EL_EMC_PLANT, @@ -2060,7 +2660,7 @@ void InitElementPropertiesStatic() EL_SP_DISK_RED, EL_PEARL, EL_CRYSTAL, - EL_KEY_WHITE, + EL_DC_KEY_WHITE, EL_SHIELD_NORMAL, EL_SHIELD_DEADLY, EL_EXTRA_TIME, @@ -2072,6 +2672,11 @@ void InitElementPropertiesStatic() EL_EMC_LENSES, EL_EMC_MAGNIFIER, +#if 0 + /* !!! handle separately !!! */ + EL_DC_LANDMINE, /* deadly when running into, but can be snapped */ +#endif + -1 }; @@ -2098,6 +2703,7 @@ void InitElementPropertiesStatic() /* !!! maybe this should better be handled by 'ep_diggable' !!! */ #if 1 EL_LANDMINE, + EL_DC_LANDMINE, EL_TRAP_ACTIVE, EL_SP_BUGGY_BASE_ACTIVE, EL_EMC_PLANT, @@ -2176,13 +2782,44 @@ void InitElementPropertiesStatic() EL_SIGN_STOP, EL_SIGN_WHEELCHAIR, EL_SIGN_PARKING, - EL_SIGN_ONEWAY, + EL_SIGN_NO_ENTRY, + EL_SIGN_UNUSED_1, + EL_SIGN_GIVE_WAY, + EL_SIGN_ENTRY_FORBIDDEN, + EL_SIGN_EMERGENCY_EXIT, + EL_SIGN_YIN_YANG, + EL_SIGN_UNUSED_2, + EL_SIGN_SPERMS, + EL_SIGN_BULLET, EL_SIGN_HEART, - EL_SIGN_TRIANGLE, - EL_SIGN_ROUND, - EL_SIGN_EXIT, - EL_SIGN_YINYANG, - EL_SIGN_OTHER, + EL_SIGN_CROSS, + EL_SIGN_FRANKIE, + EL_STEEL_EXIT_CLOSED, + EL_STEEL_EXIT_OPEN, + EL_EM_STEEL_EXIT_CLOSED, + EL_EM_STEEL_EXIT_OPEN, + EL_DC_STEELWALL_1_LEFT, + EL_DC_STEELWALL_1_RIGHT, + EL_DC_STEELWALL_1_TOP, + EL_DC_STEELWALL_1_BOTTOM, + EL_DC_STEELWALL_1_HORIZONTAL, + EL_DC_STEELWALL_1_VERTICAL, + EL_DC_STEELWALL_1_TOPLEFT, + EL_DC_STEELWALL_1_TOPRIGHT, + EL_DC_STEELWALL_1_BOTTOMLEFT, + EL_DC_STEELWALL_1_BOTTOMRIGHT, + EL_DC_STEELWALL_1_TOPLEFT_2, + EL_DC_STEELWALL_1_TOPRIGHT_2, + EL_DC_STEELWALL_1_BOTTOMLEFT_2, + EL_DC_STEELWALL_1_BOTTOMRIGHT_2, + EL_DC_STEELWALL_2_LEFT, + EL_DC_STEELWALL_2_RIGHT, + EL_DC_STEELWALL_2_TOP, + EL_DC_STEELWALL_2_BOTTOM, + EL_DC_STEELWALL_2_HORIZONTAL, + EL_DC_STEELWALL_2_VERTICAL, + EL_DC_STEELWALL_2_MIDDLE, + EL_DC_STEELWALL_2_SINGLE, EL_STEELWALL_SLIPPERY, EL_EMC_STEELWALL_1, EL_EMC_STEELWALL_2, @@ -2225,21 +2862,25 @@ void InitElementPropertiesStatic() EL_EMC_GATE_6_GRAY_ACTIVE, EL_EMC_GATE_7_GRAY_ACTIVE, EL_EMC_GATE_8_GRAY_ACTIVE, + EL_DC_GATE_WHITE, + EL_DC_GATE_WHITE_GRAY, + EL_DC_GATE_WHITE_GRAY_ACTIVE, + EL_DC_GATE_FAKE_GRAY, EL_SWITCHGATE_OPEN, EL_SWITCHGATE_OPENING, EL_SWITCHGATE_CLOSED, EL_SWITCHGATE_CLOSING, -#if 0 - EL_SWITCHGATE_SWITCH_UP, - EL_SWITCHGATE_SWITCH_DOWN, +#if 1 + EL_DC_SWITCHGATE_SWITCH_UP, + EL_DC_SWITCHGATE_SWITCH_DOWN, #endif EL_TIMEGATE_OPEN, EL_TIMEGATE_OPENING, EL_TIMEGATE_CLOSED, EL_TIMEGATE_CLOSING, -#if 0 - EL_TIMEGATE_SWITCH, - EL_TIMEGATE_SWITCH_ACTIVE, +#if 1 + EL_DC_TIMEGATE_SWITCH, + EL_DC_TIMEGATE_SWITCH_ACTIVE, #endif EL_TUBE_ANY, EL_TUBE_VERTICAL, @@ -2252,6 +2893,9 @@ void InitElementPropertiesStatic() EL_TUBE_LEFT_DOWN, EL_TUBE_RIGHT_UP, EL_TUBE_RIGHT_DOWN, + EL_EXPANDABLE_STEELWALL_HORIZONTAL, + EL_EXPANDABLE_STEELWALL_VERTICAL, + EL_EXPANDABLE_STEELWALL_ANY, -1 }; @@ -2344,8 +2988,10 @@ void InitElementPropertiesStatic() EL_NUT, EL_AMOEBA_DROP, EL_QUICKSAND_FULL, + EL_QUICKSAND_FAST_FULL, EL_MAGIC_WALL_FULL, EL_BD_MAGIC_WALL_FULL, + EL_DC_MAGIC_WALL_FULL, EL_TIME_ORB_FULL, EL_TIME_ORB_EMPTY, EL_SP_ZONK, @@ -2473,8 +3119,11 @@ void InitElementPropertiesStatic() EL_SP_EMPTY_SPACE, EL_SOKOBAN_FIELD_EMPTY, EL_EXIT_OPEN, + EL_EM_EXIT_OPEN, EL_SP_EXIT_OPEN, EL_SP_EXIT_OPENING, + EL_STEEL_EXIT_OPEN, + EL_EM_STEEL_EXIT_OPEN, EL_GATE_1, EL_GATE_2, EL_GATE_3, @@ -2542,6 +3191,9 @@ void InitElementPropertiesStatic() EL_EMC_GATE_6_GRAY_ACTIVE, EL_EMC_GATE_7_GRAY_ACTIVE, EL_EMC_GATE_8_GRAY_ACTIVE, + EL_DC_GATE_WHITE, + EL_DC_GATE_WHITE_GRAY, + EL_DC_GATE_WHITE_GRAY_ACTIVE, EL_SWITCHGATE_OPEN, EL_TIMEGATE_OPEN, @@ -2654,6 +3306,9 @@ void InitElementPropertiesStatic() EL_EMC_GATE_6_GRAY_ACTIVE, EL_EMC_GATE_7_GRAY_ACTIVE, EL_EMC_GATE_8_GRAY_ACTIVE, + EL_DC_GATE_WHITE, + EL_DC_GATE_WHITE_GRAY, + EL_DC_GATE_WHITE_GRAY_ACTIVE, EL_SWITCHGATE_OPEN, EL_TIMEGATE_OPEN, @@ -2783,6 +3438,22 @@ void InitElementPropertiesStatic() -1 }; + static int ep_can_pass_dc_magic_wall[] = + { + EL_ROCK, + EL_BD_ROCK, + EL_EMERALD, + EL_BD_DIAMOND, + EL_EMERALD_YELLOW, + EL_EMERALD_RED, + EL_EMERALD_PURPLE, + EL_DIAMOND, + EL_PEARL, + EL_CRYSTAL, + + -1 + }; + static int ep_switchable[] = { EL_ROBOT_WHEEL, @@ -2801,9 +3472,12 @@ void InitElementPropertiesStatic() EL_CONVEYOR_BELT_4_SWITCH_RIGHT, EL_SWITCHGATE_SWITCH_UP, EL_SWITCHGATE_SWITCH_DOWN, + EL_DC_SWITCHGATE_SWITCH_UP, + EL_DC_SWITCHGATE_SWITCH_DOWN, EL_LIGHT_SWITCH, EL_LIGHT_SWITCH_ACTIVE, EL_TIMEGATE_SWITCH, + EL_DC_TIMEGATE_SWITCH, EL_BALLOON_SWITCH_LEFT, EL_BALLOON_SWITCH_RIGHT, EL_BALLOON_SWITCH_UP, @@ -3139,8 +3813,12 @@ void InitElementPropertiesStatic() EL_INVISIBLE_WALL_ACTIVE, EL_SWITCHGATE_SWITCH_UP, EL_SWITCHGATE_SWITCH_DOWN, + EL_DC_SWITCHGATE_SWITCH_UP, + EL_DC_SWITCHGATE_SWITCH_DOWN, EL_TIMEGATE_SWITCH, EL_TIMEGATE_SWITCH_ACTIVE, + EL_DC_TIMEGATE_SWITCH, + EL_DC_TIMEGATE_SWITCH_ACTIVE, EL_EMC_WALL_1, EL_EMC_WALL_2, EL_EMC_WALL_3, @@ -3195,13 +3873,42 @@ void InitElementPropertiesStatic() EL_SIGN_STOP, EL_SIGN_WHEELCHAIR, EL_SIGN_PARKING, - EL_SIGN_ONEWAY, + EL_SIGN_NO_ENTRY, + EL_SIGN_UNUSED_1, + EL_SIGN_GIVE_WAY, + EL_SIGN_ENTRY_FORBIDDEN, + EL_SIGN_EMERGENCY_EXIT, + EL_SIGN_YIN_YANG, + EL_SIGN_UNUSED_2, + EL_SIGN_SPERMS, + EL_SIGN_BULLET, EL_SIGN_HEART, - EL_SIGN_TRIANGLE, - EL_SIGN_ROUND, - EL_SIGN_EXIT, - EL_SIGN_YINYANG, - EL_SIGN_OTHER, + EL_SIGN_CROSS, + EL_SIGN_FRANKIE, + EL_STEEL_EXIT_CLOSED, + EL_STEEL_EXIT_OPEN, + EL_DC_STEELWALL_1_LEFT, + EL_DC_STEELWALL_1_RIGHT, + EL_DC_STEELWALL_1_TOP, + EL_DC_STEELWALL_1_BOTTOM, + EL_DC_STEELWALL_1_HORIZONTAL, + EL_DC_STEELWALL_1_VERTICAL, + EL_DC_STEELWALL_1_TOPLEFT, + EL_DC_STEELWALL_1_TOPRIGHT, + EL_DC_STEELWALL_1_BOTTOMLEFT, + EL_DC_STEELWALL_1_BOTTOMRIGHT, + EL_DC_STEELWALL_1_TOPLEFT_2, + EL_DC_STEELWALL_1_TOPRIGHT_2, + EL_DC_STEELWALL_1_BOTTOMLEFT_2, + EL_DC_STEELWALL_1_BOTTOMRIGHT_2, + EL_DC_STEELWALL_2_LEFT, + EL_DC_STEELWALL_2_RIGHT, + EL_DC_STEELWALL_2_TOP, + EL_DC_STEELWALL_2_BOTTOM, + EL_DC_STEELWALL_2_HORIZONTAL, + EL_DC_STEELWALL_2_VERTICAL, + EL_DC_STEELWALL_2_MIDDLE, + EL_DC_STEELWALL_2_SINGLE, EL_STEELWALL_SLIPPERY, EL_EMC_STEELWALL_1, EL_EMC_STEELWALL_2, @@ -3343,6 +4050,17 @@ void InitElementPropertiesStatic() -1 }; + static int ep_acid_pool[] = + { + EL_ACID_POOL_TOPLEFT, + EL_ACID_POOL_TOPRIGHT, + EL_ACID_POOL_BOTTOMLEFT, + EL_ACID_POOL_BOTTOM, + EL_ACID_POOL_BOTTOMRIGHT, + + -1 + }; + static int ep_keygate[] = { EL_GATE_1, @@ -3381,6 +4099,9 @@ void InitElementPropertiesStatic() EL_EMC_GATE_6_GRAY_ACTIVE, EL_EMC_GATE_7_GRAY_ACTIVE, EL_EMC_GATE_8_GRAY_ACTIVE, + EL_DC_GATE_WHITE, + EL_DC_GATE_WHITE_GRAY, + EL_DC_GATE_WHITE_GRAY_ACTIVE, -1 }; @@ -3473,6 +4194,7 @@ void InitElementPropertiesStatic() EL_STEELWALL, EL_AMOEBA_DEAD, EL_QUICKSAND_EMPTY, + EL_QUICKSAND_FAST_EMPTY, EL_STONEBLOCK, EL_ROBOT_WHEEL, EL_KEY_1, @@ -3523,6 +4245,10 @@ void InitElementPropertiesStatic() EL_EMC_GATE_6_GRAY_ACTIVE, EL_EMC_GATE_7_GRAY_ACTIVE, EL_EMC_GATE_8_GRAY_ACTIVE, + EL_DC_GATE_WHITE, + EL_DC_GATE_WHITE_GRAY, + EL_DC_GATE_WHITE_GRAY_ACTIVE, + EL_DC_GATE_FAKE_GRAY, EL_DYNAMITE, EL_EM_DYNAMITE, EL_INVISIBLE_STEELWALL, @@ -3553,6 +4279,8 @@ void InitElementPropertiesStatic() EL_MAGIC_WALL_DEAD, EL_BD_MAGIC_WALL, EL_BD_MAGIC_WALL_DEAD, + EL_DC_MAGIC_WALL, + EL_DC_MAGIC_WALL_DEAD, EL_AMOEBA_TO_DIAMOND, EL_BLOCKED, EL_SP_EMPTY, @@ -3613,13 +4341,40 @@ void InitElementPropertiesStatic() EL_SIGN_STOP, EL_SIGN_WHEELCHAIR, EL_SIGN_PARKING, - EL_SIGN_ONEWAY, + EL_SIGN_NO_ENTRY, + EL_SIGN_UNUSED_1, + EL_SIGN_GIVE_WAY, + EL_SIGN_ENTRY_FORBIDDEN, + EL_SIGN_EMERGENCY_EXIT, + EL_SIGN_YIN_YANG, + EL_SIGN_UNUSED_2, + EL_SIGN_SPERMS, + EL_SIGN_BULLET, EL_SIGN_HEART, - EL_SIGN_TRIANGLE, - EL_SIGN_ROUND, - EL_SIGN_EXIT, - EL_SIGN_YINYANG, - EL_SIGN_OTHER, + EL_SIGN_CROSS, + EL_SIGN_FRANKIE, + EL_DC_STEELWALL_1_LEFT, + EL_DC_STEELWALL_1_RIGHT, + EL_DC_STEELWALL_1_TOP, + EL_DC_STEELWALL_1_BOTTOM, + EL_DC_STEELWALL_1_HORIZONTAL, + EL_DC_STEELWALL_1_VERTICAL, + EL_DC_STEELWALL_1_TOPLEFT, + EL_DC_STEELWALL_1_TOPRIGHT, + EL_DC_STEELWALL_1_BOTTOMLEFT, + EL_DC_STEELWALL_1_BOTTOMRIGHT, + EL_DC_STEELWALL_1_TOPLEFT_2, + EL_DC_STEELWALL_1_TOPRIGHT_2, + EL_DC_STEELWALL_1_BOTTOMLEFT_2, + EL_DC_STEELWALL_1_BOTTOMRIGHT_2, + EL_DC_STEELWALL_2_LEFT, + EL_DC_STEELWALL_2_RIGHT, + EL_DC_STEELWALL_2_TOP, + EL_DC_STEELWALL_2_BOTTOM, + EL_DC_STEELWALL_2_HORIZONTAL, + EL_DC_STEELWALL_2_VERTICAL, + EL_DC_STEELWALL_2_MIDDLE, + EL_DC_STEELWALL_2_SINGLE, EL_STEELWALL_SLIPPERY, EL_EMC_STEELWALL_1, EL_EMC_STEELWALL_2, @@ -3658,6 +4413,7 @@ void InitElementPropertiesStatic() { EL_SAND, EL_LANDMINE, + EL_DC_LANDMINE, EL_TRAP, EL_TRAP_ACTIVE, @@ -3675,6 +4431,7 @@ void InitElementPropertiesStatic() EL_INTERNAL_CASCADE_DC_ACTIVE, EL_INTERNAL_CASCADE_DX_ACTIVE, EL_INTERNAL_CASCADE_CHARS_ACTIVE, + EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE, EL_INTERNAL_CASCADE_CE_ACTIVE, EL_INTERNAL_CASCADE_GE_ACTIVE, EL_INTERNAL_CASCADE_REF_ACTIVE, @@ -3695,6 +4452,7 @@ void InitElementPropertiesStatic() EL_INTERNAL_CASCADE_DC, EL_INTERNAL_CASCADE_DX, EL_INTERNAL_CASCADE_CHARS, + EL_INTERNAL_CASCADE_STEEL_CHARS, EL_INTERNAL_CASCADE_CE, EL_INTERNAL_CASCADE_GE, EL_INTERNAL_CASCADE_REF, @@ -3756,6 +4514,7 @@ void InitElementPropertiesStatic() { ep_player, EP_PLAYER }, { ep_can_pass_magic_wall, EP_CAN_PASS_MAGIC_WALL }, + { ep_can_pass_dc_magic_wall, EP_CAN_PASS_DC_MAGIC_WALL }, { ep_switchable, EP_SWITCHABLE }, { ep_bd_element, EP_BD_ELEMENT }, { ep_sp_element, EP_SP_ELEMENT }, @@ -3771,6 +4530,7 @@ void InitElementPropertiesStatic() { ep_belt_active, EP_BELT_ACTIVE }, { ep_belt_switch, EP_BELT_SWITCH }, { ep_tube, EP_TUBE }, + { ep_acid_pool, EP_ACID_POOL }, { ep_keygate, EP_KEYGATE }, { ep_amoeboid, EP_AMOEBOID }, { ep_amoebalive, EP_AMOEBALIVE }, @@ -3795,9 +4555,12 @@ void InitElementPropertiesStatic() int i, j, k; /* always start with reliable default values (element has no properties) */ + /* (but never initialize clipboard elements after the very first time) */ + /* (to be able to use clipboard elements between several levels) */ for (i = 0; i < MAX_NUM_ELEMENTS; i++) - for (j = 0; j < NUM_ELEMENT_PROPERTIES; j++) - SET_PROPERTY(i, j, FALSE); + if (!IS_CLIPBOARD_ELEMENT(i) || !clipboard_elements_initialized) + for (j = 0; j < NUM_ELEMENT_PROPERTIES; j++) + SET_PROPERTY(i, j, FALSE); /* set all base element properties from above array definitions */ for (i = 0; element_properties[i].elements != NULL; i++) @@ -3811,6 +4574,12 @@ void InitElementPropertiesStatic() if (HAS_PROPERTY(copy_properties[j][0], i)) for (k = 1; k <= 4; k++) SET_PROPERTY(copy_properties[j][k], i, TRUE); + + /* set static element properties that are not listed in array definitions */ + for (i = EL_STEEL_CHAR_START; i <= EL_STEEL_CHAR_END; i++) + SET_PROPERTY(i, EP_INDESTRUCTIBLE, TRUE); + + clipboard_elements_initialized = TRUE; } void InitElementPropertiesEngine(int engine_version) @@ -3852,20 +4621,22 @@ void InitElementPropertiesEngine(int engine_version) property (which means that conditional property changes must be set to a reliable default value before) */ - /* ---------- recursively resolve group elements ------------------------- */ - - for (i = 0; i < MAX_NUM_ELEMENTS; i++) - for (j = 0; j < NUM_GROUP_ELEMENTS; j++) - element_info[i].in_group[j] = FALSE; - + /* resolve group elements */ for (i = 0; i < NUM_GROUP_ELEMENTS; i++) - resolve_group_element(EL_GROUP_START + i, 0); + ResolveGroupElement(EL_GROUP_START + i); /* set all special, combined or engine dependent element properties */ for (i = 0; i < MAX_NUM_ELEMENTS; i++) { + /* do not change (already initialized) clipboard elements here */ + if (IS_CLIPBOARD_ELEMENT(i)) + continue; + /* ---------- INACTIVE ------------------------------------------------- */ - SET_PROPERTY(i, EP_INACTIVE, (i >= EL_CHAR_START && i <= EL_CHAR_END)); + SET_PROPERTY(i, EP_INACTIVE, ((i >= EL_CHAR_START && + i <= EL_CHAR_END) || + (i >= EL_STEEL_CHAR_START && + i <= EL_STEEL_CHAR_END))); /* ---------- WALKABLE, PASSABLE, ACCESSIBLE --------------------------- */ SET_PROPERTY(i, EP_WALKABLE, (IS_WALKABLE_OVER(i) || @@ -3919,7 +4690,6 @@ void InitElementPropertiesEngine(int engine_version) !IS_COLLECTIBLE(i))); /* ---------- DRAGONFIRE_PROOF ----------------------------------------- */ - if (IS_HISTORIC_SOLID(i) || i == EL_EXPLOSION) SET_PROPERTY(i, EP_DRAGONFIRE_PROOF, TRUE); else @@ -4042,12 +4812,16 @@ void InitElementPropertiesEngine(int engine_version) { static int ep_em_slippery_wall[] = { - EL_STEELWALL, EL_WALL, + EL_STEELWALL, EL_EXPANDABLE_WALL, EL_EXPANDABLE_WALL_HORIZONTAL, EL_EXPANDABLE_WALL_VERTICAL, EL_EXPANDABLE_WALL_ANY, + EL_EXPANDABLE_STEELWALL_HORIZONTAL, + EL_EXPANDABLE_STEELWALL_VERTICAL, + EL_EXPANDABLE_STEELWALL_ANY, + EL_EXPANDABLE_STEELWALL_GROWING, -1 }; @@ -4088,6 +4862,7 @@ void InitElementPropertiesAfterLoading(int engine_version) static void InitGlobal() { + int graphic; int i; for (i = 0; i < MAX_NUM_ELEMENTS + 1; i++) @@ -4098,7 +4873,81 @@ static void InitGlobal() element_info[i].token_name = element_name_info[i].token_name; element_info[i].class_name = element_name_info[i].class_name; - element_info[i].editor_description=element_name_info[i].editor_description; + element_info[i].editor_description= element_name_info[i].editor_description; + +#if 0 + printf("%04d: %s\n", i, element_name_info[i].token_name); +#endif + } + + /* create hash from image config list */ + image_config_hash = newSetupFileHash(); + for (i = 0; image_config[i].token != NULL; i++) + setHashEntry(image_config_hash, + image_config[i].token, + image_config[i].value); + + /* create hash from element token list */ + element_token_hash = newSetupFileHash(); + for (i = 0; element_name_info[i].token_name != NULL; i++) + setHashEntry(element_token_hash, + element_name_info[i].token_name, + int2str(i, 0)); + + /* create hash from graphic token list */ + graphic_token_hash = newSetupFileHash(); + for (graphic = 0, i = 0; image_config[i].token != NULL; i++) + if (strSuffix(image_config[i].value, ".pcx") || + strSuffix(image_config[i].value, ".wav") || + strEqual(image_config[i].value, UNDEFINED_FILENAME)) + setHashEntry(graphic_token_hash, + image_config[i].token, + int2str(graphic++, 0)); + + /* create hash from font token list */ + font_token_hash = newSetupFileHash(); + for (i = 0; font_info[i].token_name != NULL; i++) + setHashEntry(font_token_hash, + font_info[i].token_name, + int2str(i, 0)); + + /* always start with reliable default values (all elements) */ + for (i = 0; i < MAX_NUM_ELEMENTS; i++) + ActiveElement[i] = i; + + /* now add all entries that have an active state (active elements) */ + for (i = 0; element_with_active_state[i].element != -1; i++) + { + int element = element_with_active_state[i].element; + int element_active = element_with_active_state[i].element_active; + + ActiveElement[element] = element_active; + } + + /* always start with reliable default values (all buttons) */ + for (i = 0; i < NUM_IMAGE_FILES; i++) + ActiveButton[i] = i; + + /* now add all entries that have an active state (active buttons) */ + for (i = 0; button_with_active_state[i].button != -1; i++) + { + int button = button_with_active_state[i].button; + int button_active = button_with_active_state[i].button_active; + + ActiveButton[button] = button_active; + } + + /* always start with reliable default values (all fonts) */ + for (i = 0; i < NUM_FONTS; i++) + ActiveFont[i] = i; + + /* now add all entries that have an active state (active fonts) */ + for (i = 0; font_with_active_state[i].font_nr != -1; i++) + { + int font = font_with_active_state[i].font_nr; + int font_active = font_with_active_state[i].font_nr_active; + + ActiveFont[font] = font_active; } global.autoplay_leveldir = NULL; @@ -4107,6 +4956,12 @@ static void InitGlobal() global.frames_per_second = 0; global.fps_slowdown = FALSE; global.fps_slowdown_factor = 1; + + global.border_status = GAME_MODE_MAIN; +#if 0 + global.fading_status = GAME_MODE_MAIN; + global.fading_type = TYPE_ENTER_MENU; +#endif } void Execute_Command(char *command) @@ -4511,6 +5366,7 @@ static void InitMixer() void InitGfx() { char *filename_font_initial = NULL; + char *filename_anim_initial = NULL; Bitmap *bitmap_font_initial = NULL; int font_height; int i, j; @@ -4537,7 +5393,7 @@ void InitGfx() font_initial[j].src_y = atoi(image_config[i].value); else if (strEqual(&image_config[i].token[len_font_token], ".width")) font_initial[j].width = atoi(image_config[i].value); - else if (strEqual(&image_config[i].token[len_font_token],".height")) + else if (strEqual(&image_config[i].token[len_font_token], ".height")) font_initial[j].height = atoi(image_config[i].value); } } @@ -4557,6 +5413,7 @@ void InitGfx() bitmap_db_field = CreateBitmap(FXSIZE, FYSIZE, DEFAULT_DEPTH); bitmap_db_panel = CreateBitmap(DXSIZE, DYSIZE, DEFAULT_DEPTH); bitmap_db_door = CreateBitmap(3 * DXSIZE, DYSIZE + VYSIZE, DEFAULT_DEPTH); + bitmap_db_toons = CreateBitmap(FULL_SXSIZE, FULL_SYSIZE, DEFAULT_DEPTH); /* initialize screen properties */ InitGfxFieldInfo(SX, SY, SXSIZE, SYSIZE, @@ -4584,6 +5441,75 @@ void InitGfx() DrawInitText(PROGRAM_WEBSITE_STRING, WIN_YSIZE - 20 - font_height, FC_RED); DrawInitText("Loading graphics", 120, FC_GREEN); + +#if 1 +#if 1 + /* initialize busy animation with default values */ + int parameter[NUM_GFX_ARGS]; + for (i = 0; i < NUM_GFX_ARGS; i++) + parameter[i] = get_graphic_parameter_value(image_config_suffix[i].value, + image_config_suffix[i].token, + image_config_suffix[i].type); +#if 0 + for (i = 0; i < NUM_GFX_ARGS; i++) + printf("::: '%s' => %d\n", image_config_suffix[i].token, parameter[i]); +#endif +#endif + + /* determine settings for busy animation (when displaying startup messages) */ + for (i = 0; image_config[i].token != NULL; i++) + { + char *anim_token = CONFIG_TOKEN_GLOBAL_BUSY; + int len_anim_token = strlen(anim_token); + + if (strEqual(image_config[i].token, anim_token)) + filename_anim_initial = image_config[i].value; + else if (strlen(image_config[i].token) > len_anim_token && + strncmp(image_config[i].token, anim_token, len_anim_token) == 0) + { +#if 1 + for (j = 0; image_config_suffix[j].token != NULL; j++) + { + if (strEqual(&image_config[i].token[len_anim_token], + image_config_suffix[j].token)) + parameter[j] = + get_graphic_parameter_value(image_config[i].value, + image_config_suffix[j].token, + image_config_suffix[j].type); + } +#else + if (strEqual(&image_config[i].token[len_anim_token], ".x")) + anim_initial.src_x = atoi(image_config[i].value); + else if (strEqual(&image_config[i].token[len_anim_token], ".y")) + anim_initial.src_y = atoi(image_config[i].value); + else if (strEqual(&image_config[i].token[len_anim_token], ".width")) + anim_initial.width = atoi(image_config[i].value); + else if (strEqual(&image_config[i].token[len_anim_token], ".height")) + anim_initial.height = atoi(image_config[i].value); + else if (strEqual(&image_config[i].token[len_anim_token], ".frames")) + anim_initial.anim_frames = atoi(image_config[i].value); + else if (strEqual(&image_config[i].token[len_anim_token], + ".frames_per_line")) + anim_initial.anim_frames_per_line = atoi(image_config[i].value); + else if (strEqual(&image_config[i].token[len_anim_token], ".delay")) + anim_initial.anim_delay = atoi(image_config[i].value); +#endif + } + } + + set_graphic_parameters_ext(0, &anim_initial, parameter, NULL); + + if (filename_anim_initial == NULL) /* should not happen */ + Error(ERR_EXIT, "cannot get filename for '%s'", CONFIG_TOKEN_GLOBAL_BUSY); + + anim_initial.bitmap = LoadCustomImage(filename_anim_initial); + + init.busy.width = anim_initial.width; + init.busy.height = anim_initial.height; + + InitMenuDesignSettings_Static(); + InitGfxDrawBusyAnimFunction(DrawInitAnim); +#endif } void RedrawBackground() @@ -4601,10 +5527,14 @@ void InitGfxBackground() fieldbuffer = bitmap_db_field; SetDrawtoField(DRAW_BACKBUFFER); +#if 1 + ClearRectangle(backbuffer, 0, 0, WIN_XSIZE, WIN_YSIZE); +#else RedrawBackground(); ClearRectangle(backbuffer, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE); ClearRectangle(bitmap_db_door, 0, 0, 3 * DXSIZE, DYSIZE + VYSIZE); +#endif for (x = 0; x < MAX_BUF_XSIZE; x++) for (y = 0; y < MAX_BUF_YSIZE; y++) @@ -4627,6 +5557,8 @@ void InitLevelArtworkInfo() static void InitImages() { + print_timestamp_init("InitImages"); + setLevelArtworkDir(artwork.gfx_first); #if 0 @@ -4638,16 +5570,35 @@ static void InitImages() leveldir_current->graphics_path); #endif + UPDATE_BUSY_STATE(); + ReloadCustomImages(); + print_timestamp_time("ReloadCustomImages"); + + UPDATE_BUSY_STATE(); LoadCustomElementDescriptions(); - LoadSpecialMenuDesignSettings(); + print_timestamp_time("LoadCustomElementDescriptions"); + + UPDATE_BUSY_STATE(); + + LoadMenuDesignSettings(); + print_timestamp_time("LoadMenuDesignSettings"); + + UPDATE_BUSY_STATE(); ReinitializeGraphics(); + print_timestamp_time("ReinitializeGraphics"); + + UPDATE_BUSY_STATE(); + + print_timestamp_done("InitImages"); } static void InitSound(char *identifier) { + print_timestamp_init("InitSound"); + if (identifier == NULL) identifier = artwork.snd_current->identifier; @@ -4655,11 +5606,18 @@ static void InitSound(char *identifier) setLevelArtworkDir(artwork.snd_first); InitReloadCustomSounds(identifier); + print_timestamp_time("InitReloadCustomSounds"); + ReinitializeSounds(); + print_timestamp_time("ReinitializeSounds"); + + print_timestamp_done("InitSound"); } static void InitMusic(char *identifier) { + print_timestamp_init("InitMusic"); + if (identifier == NULL) identifier = artwork.mus_current->identifier; @@ -4667,7 +5625,12 @@ static void InitMusic(char *identifier) setLevelArtworkDir(artwork.mus_first); InitReloadCustomMusic(identifier); + print_timestamp_time("InitReloadCustomMusic"); + ReinitializeMusic(); + print_timestamp_time("ReinitializeMusic"); + + print_timestamp_done("InitMusic"); } void InitNetworkServer() @@ -4808,13 +5771,14 @@ static char *getNewArtworkIdentifier(int type) void ReloadCustomArtwork(int force_reload) { + int last_game_status = game_status; /* save current game status */ char *gfx_new_identifier; char *snd_new_identifier; char *mus_new_identifier; boolean force_reload_gfx = (force_reload & (1 << ARTWORK_TYPE_GRAPHICS)); boolean force_reload_snd = (force_reload & (1 << ARTWORK_TYPE_SOUNDS)); boolean force_reload_mus = (force_reload & (1 << ARTWORK_TYPE_MUSIC)); - boolean redraw_screen = FALSE; + boolean reload_needed; force_reload_gfx |= AdjustGraphicsForEMC(); @@ -4822,6 +5786,34 @@ void ReloadCustomArtwork(int force_reload) snd_new_identifier = getNewArtworkIdentifier(ARTWORK_TYPE_SOUNDS); mus_new_identifier = getNewArtworkIdentifier(ARTWORK_TYPE_MUSIC); + reload_needed = (gfx_new_identifier != NULL || force_reload_gfx || + snd_new_identifier != NULL || force_reload_snd || + mus_new_identifier != NULL || force_reload_mus); + + if (!reload_needed) + return; + + print_timestamp_init("ReloadCustomArtwork"); + + game_status = GAME_MODE_LOADING; + + FadeOut(REDRAW_ALL); + +#if 1 + ClearRectangle(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE); +#else + ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE); +#endif + print_timestamp_time("ClearRectangle"); + +#if 0 + printf("::: fading in ... %d\n", fading.fade_mode); +#endif + FadeIn(REDRAW_ALL); +#if 0 + printf("::: done\n"); +#endif + if (gfx_new_identifier != NULL || force_reload_gfx) { #if 0 @@ -4832,39 +5824,62 @@ void ReloadCustomArtwork(int force_reload) leveldir_current->graphics_set); #endif - ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE); - InitImages(); - - redraw_screen = TRUE; + print_timestamp_time("InitImages"); } if (snd_new_identifier != NULL || force_reload_snd) { - ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE); - InitSound(snd_new_identifier); - - redraw_screen = TRUE; + print_timestamp_time("InitSound"); } if (mus_new_identifier != NULL || force_reload_mus) { - ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE); - InitMusic(mus_new_identifier); - - redraw_screen = TRUE; + print_timestamp_time("InitMusic"); } - if (redraw_screen) - { - RedrawBackground(); + game_status = last_game_status; /* restore current game status */ - /* force redraw of (open or closed) door graphics */ - SetDoorState(DOOR_OPEN_ALL); - CloseDoor(DOOR_CLOSE_ALL | DOOR_NO_DELAY); - } +#if 0 + printf("::: ----------------DELAY 1 ...\n"); + Delay(3000); +#endif + +#if 0 + printf("::: FadeOut @ ReloadCustomArtwork ...\n"); +#endif + FadeOut(REDRAW_ALL); +#if 0 + printf("::: FadeOut @ ReloadCustomArtwork done\n"); +#endif + + RedrawBackground(); + + /* force redraw of (open or closed) door graphics */ + SetDoorState(DOOR_OPEN_ALL); + CloseDoor(DOOR_CLOSE_ALL | DOOR_NO_DELAY); + +#if 1 +#if 1 +#if 1 + FadeSetEnterScreen(); + FadeSkipNextFadeOut(); + // FadeSetDisabled(); +#else + FadeSkipNext(); +#endif +#else + fading = fading_none; +#endif +#endif + +#if 0 + redraw_mask = REDRAW_ALL; +#endif + + print_timestamp_done("ReloadCustomArtwork"); } void KeyboardAutoRepeatOffUnlessAutoplay() @@ -4880,6 +5895,10 @@ void KeyboardAutoRepeatOffUnlessAutoplay() void OpenAll() { + print_timestamp_init("OpenAll"); + + game_status = GAME_MODE_LOADING; + InitGlobal(); /* initialize some global variables */ if (options.execute_command) @@ -4911,6 +5930,8 @@ void OpenAll() InitJoysticks(); + print_timestamp_time("[pre-video]"); + InitVideoDisplay(); InitVideoBuffer(WIN_XSIZE, WIN_YSIZE, DEFAULT_DEPTH, setup.fullscreen); @@ -4919,17 +5940,26 @@ void OpenAll() InitElementPropertiesStatic(); InitElementPropertiesEngine(GAME_VERSION_ACTUAL); + print_timestamp_time("[post-video]"); + InitGfx(); - // debug_print_timestamp(0, "INIT"); + print_timestamp_time("InitGfx"); + InitLevelInfo(); - // debug_print_timestamp(0, "TIME InitLevelInfo: "); + print_timestamp_time("InitLevelInfo"); + InitLevelArtworkInfo(); - // debug_print_timestamp(0, "TIME InitLevelArtworkInfo: "); + print_timestamp_time("InitLevelArtworkInfo"); InitImages(); /* needs to know current level directory */ + print_timestamp_time("InitImages"); + InitSound(NULL); /* needs to know current level directory */ + print_timestamp_time("InitSound"); + InitMusic(NULL); /* needs to know current level directory */ + print_timestamp_time("InitMusic"); InitGfxBackground(); @@ -4950,6 +5980,19 @@ void OpenAll() game_status = GAME_MODE_MAIN; +#if 1 + FadeSetEnterScreen(); + if (!(fading.fade_mode & FADE_TYPE_TRANSFORM)) + FadeSkipNextFadeOut(); + // FadeSetDisabled(); +#else + fading = fading_none; +#endif + + print_timestamp_time("[post-artwork]"); + + print_timestamp_done("OpenAll"); + DrawMainMenu(); InitNetworkServer(); diff --git a/src/init.h b/src/init.h index 165c2a78..3df39d26 100644 --- a/src/init.h +++ b/src/init.h @@ -32,6 +32,7 @@ void setBitfieldProperty(int *, int, int, boolean); boolean getBitfieldProperty(int *, int, int); +void ResolveGroupElement(int); void InitElementPropertiesStatic(void); void InitElementPropertiesEngine(int); void InitElementPropertiesAfterLoading(int); diff --git a/src/libgame/gadgets.c b/src/libgame/gadgets.c index 23c51d36..3d593a9b 100644 --- a/src/libgame/gadgets.c +++ b/src/libgame/gadgets.c @@ -381,10 +381,16 @@ static void DrawGadget(struct GadgetInfo *gi, boolean pressed, boolean direct) gi->height - 2 * border_y); /* gadget text value */ +#if 1 + DrawTextBuffer(gi->x + border_x, gi->y + border_y, gi->textarea.value, + font_nr, gi->textarea.xsize, -1, gi->textarea.ysize, + BLIT_ON_BACKGROUND, FALSE, FALSE, FALSE); +#else DrawTextToTextArea(gi->x + border_x, gi->y + border_y, gi->textarea.value, font_nr, gi->textarea.xsize, gi->textarea.xsize, gi->textarea.ysize, BLIT_ON_BACKGROUND); +#endif cursor_letter = gi->textarea.value[gi->textarea.cursor_position]; cursor_string[0] = (cursor_letter != '\0' ? cursor_letter : ' '); diff --git a/src/libgame/hash.c b/src/libgame/hash.c index e44313a8..65f4270c 100644 --- a/src/libgame/hash.c +++ b/src/libgame/hash.c @@ -47,210 +47,271 @@ create_hashtable(unsigned int minsize, float maxloadfactor, unsigned int (*hashf) (void*), int (*eqf) (void*,void*)) { - struct hashtable *h; - unsigned int i, size = 1u; - /* Check requested hashtable isn't too large */ - if (minsize > (1u << 31)) return NULL; - /* Enforce size as power of 2 */ - while (size < minsize) size <<= 1; - h = (struct hashtable *)malloc(sizeof(struct hashtable)); - if (NULL == h) return NULL; /*oom*/ - h->table = (struct entry **)malloc(sizeof(struct entry*) * size); - if (NULL == h->table) { free(h); return NULL; } /*oom*/ - - for (i=0; i < size; i++) { h->table[i] = NULL; } - h->tablelength = size; - h->entrycount = 0; - h->hashfn = hashf; - h->eqfn = eqf; - h->loadlimit = (unsigned int) ((float)size * maxloadfactor); - return h; + struct hashtable *h; + unsigned int i, size = 1u; + + /* Check requested hashtable isn't too large */ + if (minsize > (1u << 31)) + return NULL; + + /* Enforce size as power of 2 */ + while (size < minsize) + size <<= 1; + + h = (struct hashtable *)malloc(sizeof(struct hashtable)); + + if (h == NULL) + return NULL; + + h->table = (struct entry **)malloc(sizeof(struct entry*) * size); + + if (h->table == NULL) + { + free(h); + + return NULL; + } + + for (i=0; i < size; i++) + h->table[i] = NULL; + + h->tablelength = size; + h->entrycount = 0; + h->hashfn = hashf; + h->eqfn = eqf; + h->loadlimit = (unsigned int) ((float)size * maxloadfactor); + + return h; } /*****************************************************************************/ static unsigned int hash(struct hashtable *h, void *k) { - /* Aim to protect against poor hash functions by adding logic here - * - logic taken from java 1.4 hashtable source */ - unsigned int i = h->hashfn(k); - i += ~(i << 9); - i ^= ((i >> 14) | (i << 18)); /* >>> */ - i += (i << 4); - i ^= ((i >> 10) | (i << 22)); /* >>> */ - return i; + /* Aim to protect against poor hash functions by adding logic here + * - logic taken from java 1.4 hashtable source */ + + unsigned int i = h->hashfn(k); + + i += ~(i << 9); + i ^= ((i >> 14) | (i << 18)); /* >>> */ + i += (i << 4); + i ^= ((i >> 10) | (i << 22)); /* >>> */ + + return i; } + /*****************************************************************************/ static unsigned int indexFor(unsigned int tablelength, unsigned int hashvalue) { - /* Only works if tablelength == 2^N */ - return (hashvalue & (tablelength - 1u)); + /* Only works if tablelength == 2^N */ + return (hashvalue & (tablelength - 1u)); } /*****************************************************************************/ static int hashtable_expand(struct hashtable *h) { - /* Double the size of the table to accomodate more entries */ - struct entry **newtable; - struct entry *e; - struct entry **pE; - unsigned int newsize, i, index; - /* Check we're not hitting max capacity */ - if (0 == (newsize = (h->tablelength << 1))) return 0; - - newtable = (struct entry **)malloc(sizeof(struct entry*) * newsize); - if (NULL != newtable) + /* Double the size of the table to accomodate more entries */ + struct entry **newtable; + struct entry *e; + struct entry **pE; + unsigned int newsize, i, index; + + /* Check we're not hitting max capacity */ + if (0 == (newsize = (h->tablelength << 1))) + return 0; + + newtable = (struct entry **)malloc(sizeof(struct entry*) * newsize); + + if (newtable != NULL) + { + memset(newtable, 0, newsize * sizeof(struct entry *)); + + /* This algorithm is not 'stable'. ie. it reverses the list + * when it transfers entries between the tables */ + for (i = 0; i < h->tablelength; i++) { - memset(newtable, 0, newsize * sizeof(struct entry *)); - /* This algorithm is not 'stable'. ie. it reverses the list - * when it transfers entries between the tables */ - for (i = 0; i < h->tablelength; i++) { - while (NULL != (e = h->table[i])) { - h->table[i] = e->next; - index = indexFor(newsize,e->h); - e->next = newtable[index]; - newtable[index] = e; - } - } - free(h->table); - h->table = newtable; + while ((e = h->table[i]) != NULL) + { + h->table[i] = e->next; + index = indexFor(newsize,e->h); + e->next = newtable[index]; + newtable[index] = e; + } } - /* Plan B: realloc instead */ - else + + free(h->table); + h->table = newtable; + } + else /* Plan B: realloc instead */ + { + newtable = (struct entry **) + realloc(h->table, newsize * sizeof(struct entry *)); + + if (newtable == NULL) + return 0; + + h->table = newtable; + + for (i = h->tablelength; i < newsize; i++) + newtable[i] = NULL; + + for (i = 0; i < h->tablelength; i++) { - newtable = (struct entry **) - realloc(h->table, newsize * sizeof(struct entry *)); - if (NULL == newtable) return 0; - h->table = newtable; - for (i = h->tablelength; i < newsize; i++) { - newtable[i] = NULL; - } - for (i = 0; i < h->tablelength; i++) { - for (pE = &(newtable[i]), e = *pE; e != NULL; e = *pE) { - index = indexFor(newsize,e->h); - if (index == i) - { - pE = &(e->next); - } - else - { - *pE = e->next; - e->next = newtable[index]; - newtable[index] = e; - } - } - } + for (pE = &(newtable[i]), e = *pE; e != NULL; e = *pE) + { + index = indexFor(newsize,e->h); + + if (index == i) + { + pE = &(e->next); + } + else + { + *pE = e->next; + e->next = newtable[index]; + newtable[index] = e; + } + } } - h->tablelength = newsize; - h->loadlimit <<= 1; - return -1; + } + + h->tablelength = newsize; + h->loadlimit <<= 1; + + return -1; } /*****************************************************************************/ unsigned int hashtable_count(struct hashtable *h) { - return h->entrycount; + return h->entrycount; } /*****************************************************************************/ int hashtable_insert(struct hashtable *h, void *k, void *v) { - /* This method allows duplicate keys - but they shouldn't be used */ - unsigned int index; - struct entry *e; - if (++(h->entrycount) > h->loadlimit) - { - /* Ignore the return value. If expand fails, we should - * still try cramming just this value into the existing table - * -- we may not have memory for a larger table, but one more - * element may be ok. Next time we insert, we'll try expanding again.*/ - hashtable_expand(h); - } - e = (struct entry *)malloc(sizeof(struct entry)); - if (NULL == e) { --(h->entrycount); return 0; } /*oom*/ - e->h = hash(h,k); - index = indexFor(h->tablelength,e->h); - e->k = k; - e->v = v; - e->next = h->table[index]; - h->table[index] = e; - return -1; + /* This method allows duplicate keys - but they shouldn't be used */ + unsigned int index; + struct entry *e; + + if (++(h->entrycount) > h->loadlimit) + { + /* Ignore the return value. If expand fails, we should + * still try cramming just this value into the existing table + * -- we may not have memory for a larger table, but one more + * element may be ok. Next time we insert, we'll try expanding again.*/ + + hashtable_expand(h); + } + + e = (struct entry *)malloc(sizeof(struct entry)); + + if (e == NULL) + { + --(h->entrycount); + + return 0; + } + + e->h = hash(h,k); + index = indexFor(h->tablelength,e->h); + e->k = k; + e->v = v; + e->next = h->table[index]; + h->table[index] = e; + + return -1; } /*****************************************************************************/ int hashtable_change(struct hashtable *h, void *k, void *v) { - struct entry *e; - unsigned int hashvalue, index; - hashvalue = hash(h,k); - index = indexFor(h->tablelength,hashvalue); - e = h->table[index]; - while (NULL != e) + struct entry *e; + unsigned int hashvalue, index; + + hashvalue = hash(h,k); + index = indexFor(h->tablelength,hashvalue); + e = h->table[index]; + + while (e != NULL) + { + /* Check hash value to short circuit heavier comparison */ + if ((hashvalue == e->h) && (h->eqfn(k, e->k))) { - /* Check hash value to short circuit heavier comparison */ - if ((hashvalue == e->h) && (h->eqfn(k, e->k))) - { - free(e->v); - e->v = v; - return -1; - } - e = e->next; + free(e->v); + e->v = v; + + return -1; } - return 0; + + e = e->next; + } + + return 0; } /*****************************************************************************/ void * /* returns value associated with key */ hashtable_search(struct hashtable *h, void *k) { - struct entry *e; - unsigned int hashvalue, index; - hashvalue = hash(h,k); - index = indexFor(h->tablelength,hashvalue); - e = h->table[index]; - while (NULL != e) - { - /* Check hash value to short circuit heavier comparison */ - if ((hashvalue == e->h) && (h->eqfn(k, e->k))) return e->v; - e = e->next; - } - return NULL; + struct entry *e; + unsigned int hashvalue, index; + + hashvalue = hash(h,k); + index = indexFor(h->tablelength,hashvalue); + e = h->table[index]; + + while (e != NULL) + { + /* Check hash value to short circuit heavier comparison */ + if ((hashvalue == e->h) && (h->eqfn(k, e->k))) + return e->v; + + e = e->next; + } + + return NULL; } /*****************************************************************************/ void * /* returns value associated with key */ hashtable_remove(struct hashtable *h, void *k) { - /* TODO: consider compacting the table when the load factor drops enough, - * or provide a 'compact' method. */ + /* TODO: consider compacting the table when the load factor drops enough, + * or provide a 'compact' method. */ + + struct entry *e; + struct entry **pE; + void *v; + unsigned int index = indexFor(h->tablelength,hash(h,k)); - struct entry *e; - struct entry **pE; - void *v; + pE = &(h->table[index]); + e = *pE; - unsigned int index = indexFor(h->tablelength,hash(h,k)); - pE = &(h->table[index]); - e = *pE; - while (NULL != e) + while (e != NULL) + { + if (h->eqfn(k, e->k)) { - if (h->eqfn(k, e->k)) - { - *pE = e->next; - h->entrycount--; - v = e->v; - free(e->k); - free(e); - return v; - } - pE = &(e->next); - e = e->next; + *pE = e->next; + h->entrycount--; + v = e->v; + free(e->k); + free(e); + + return v; } - return NULL; + + pE = &(e->next); + e = e->next; + } + + return NULL; } /*****************************************************************************/ @@ -258,26 +319,29 @@ hashtable_remove(struct hashtable *h, void *k) void hashtable_destroy(struct hashtable *h, int free_values) { - unsigned int i; - struct entry *e, *f; - struct entry **table = h->table; + unsigned int i; + struct entry *e, *f; + struct entry **table = h->table; - for (i = 0; i < h->tablelength; i++) + for (i = 0; i < h->tablelength; i++) + { + e = table[i]; + + while (e != NULL) { - e = table[i]; - while (NULL != e) - { - f = e; - e = e->next; - free(f->k); - if (free_values) - free(f->v); - free(f); - } + f = e; + e = e->next; + free(f->k); + + if (free_values) + free(f->v); + + free(f); } + } - free(h->table); - free(h); + free(h->table); + free(h); } @@ -287,26 +351,33 @@ hashtable_destroy(struct hashtable *h, int free_values) struct hashtable_itr * hashtable_iterator(struct hashtable *h) { - unsigned int i, tablelength; - struct hashtable_itr *itr = (struct hashtable_itr *) - malloc(sizeof(struct hashtable_itr)); - if (NULL == itr) return NULL; - itr->h = h; - itr->e = NULL; - tablelength = h->tablelength; - itr->index = tablelength; - if (0 == h->entrycount) return itr; + unsigned int i, tablelength; + struct hashtable_itr *itr = (struct hashtable_itr *) + malloc(sizeof(struct hashtable_itr)); - for (i = 0; i < tablelength; i++) + if (itr == NULL) + return NULL; + + itr->h = h; + itr->e = NULL; + tablelength = h->tablelength; + itr->index = tablelength; + + if (0 == h->entrycount) + return itr; + + for (i = 0; i < tablelength; i++) + { + if (h->table[i] != NULL) { - if (NULL != h->table[i]) - { - itr->e = h->table[i]; - itr->index = i; - break; - } + itr->e = h->table[i]; + itr->index = i; + + break; } - return itr; + } + + return itr; } /*****************************************************************************/ @@ -315,7 +386,7 @@ hashtable_iterator(struct hashtable *h) void * hashtable_iterator_key(struct hashtable_itr *i) { - return i->e->k; + return i->e->k; } /*****************************************************************************/ @@ -324,7 +395,7 @@ hashtable_iterator_key(struct hashtable_itr *i) void * hashtable_iterator_value(struct hashtable_itr *i) { - return i->e->v; + return i->e->v; } /*****************************************************************************/ @@ -334,33 +405,42 @@ hashtable_iterator_value(struct hashtable_itr *i) int hashtable_iterator_advance(struct hashtable_itr *itr) { - unsigned int j,tablelength; - struct entry **table; - struct entry *next; - if (NULL == itr->e) return 0; /* stupidity check */ + unsigned int j,tablelength; + struct entry **table; + struct entry *next; - next = itr->e->next; - if (NULL != next) - { - itr->e = next; - return -1; - } - tablelength = itr->h->tablelength; - if (tablelength <= (j = ++(itr->index))) - { - itr->e = NULL; - return 0; - } - table = itr->h->table; - while (NULL == (next = table[j])) - { - if (++j >= tablelength) - { - itr->index = tablelength; - return 0; - } - } - itr->index = j; + if (itr->e == NULL) + return 0; /* stupidity check */ + + next = itr->e->next; + if (next != NULL) + { itr->e = next; + return -1; + } + + tablelength = itr->h->tablelength; + if (tablelength <= (j = ++(itr->index))) + { + itr->e = NULL; + + return 0; + } + + table = itr->h->table; + while ((next = table[j]) == NULL) + { + if (++j >= tablelength) + { + itr->index = tablelength; + + return 0; + } + } + + itr->index = j; + itr->e = next; + + return -1; } diff --git a/src/libgame/hash.h b/src/libgame/hash.h index c8836fda..0d20f2c4 100644 --- a/src/libgame/hash.h +++ b/src/libgame/hash.h @@ -98,26 +98,27 @@ /*****************************************************************************/ struct entry { - void *k, *v; - unsigned int h; - struct entry *next; + void *k, *v; + unsigned int h; + struct entry *next; }; -struct hashtable { - unsigned int tablelength; - struct entry **table; - unsigned int entrycount; - unsigned int loadlimit; - unsigned int (*hashfn) (void *k); - int (*eqfn) (void *k1, void *k2); +struct hashtable +{ + unsigned int tablelength; + struct entry **table; + unsigned int entrycount; + unsigned int loadlimit; + unsigned int (*hashfn) (void *k); + int (*eqfn) (void *k1, void *k2); }; /*****************************************************************************/ struct hashtable_itr { - struct hashtable *h; - struct entry *e; - unsigned int index; + struct hashtable *h; + struct entry *e; + unsigned int index; }; @@ -162,7 +163,7 @@ hashtable_insert(struct hashtable *h, void *k, void *v); #define DEFINE_HASHTABLE_INSERT(fnname, keytype, valuetype) \ int fnname (struct hashtable *h, keytype *k, valuetype *v) \ { \ - return hashtable_insert(h,k,v); \ + return hashtable_insert(h,k,v); \ } /***************************************************************************** @@ -181,7 +182,7 @@ hashtable_change(struct hashtable *h, void *k, void *v); #define DEFINE_HASHTABLE_CHANGE(fnname, keytype, valuetype) \ int fnname (struct hashtable *h, keytype *k, valuetype *v) \ { \ - return hashtable_change(h,k,v); \ + return hashtable_change(h,k,v); \ } /***************************************************************************** @@ -199,7 +200,7 @@ hashtable_search(struct hashtable *h, void *k); #define DEFINE_HASHTABLE_SEARCH(fnname, keytype, valuetype) \ valuetype * fnname (struct hashtable *h, keytype *k) \ { \ - return (valuetype *) (hashtable_search(h,k)); \ + return (valuetype *) (hashtable_search(h,k)); \ } /***************************************************************************** @@ -217,7 +218,7 @@ hashtable_remove(struct hashtable *h, void *k); #define DEFINE_HASHTABLE_REMOVE(fnname, keytype, valuetype) \ valuetype * fnname (struct hashtable *h, keytype *k) \ { \ - return (valuetype *) (hashtable_remove(h,k)); \ + return (valuetype *) (hashtable_remove(h,k)); \ } @@ -256,7 +257,7 @@ hashtable_iterator(struct hashtable *h); extern inline void * hashtable_iterator_key(struct hashtable_itr *i) { - return i->e->k; + return i->e->k; } /*****************************************************************************/ @@ -265,7 +266,7 @@ hashtable_iterator_key(struct hashtable_itr *i) extern inline void * hashtable_iterator_value(struct hashtable_itr *i) { - return i->e->v; + return i->e->v; } /*****************************************************************************/ diff --git a/src/libgame/image.c b/src/libgame/image.c index 6cfa44f4..85a73a54 100644 --- a/src/libgame/image.c +++ b/src/libgame/image.c @@ -385,7 +385,7 @@ XImageInfo *Image_to_Pixmap(Display *display, int screen, Visual *visual, if (!private_cmap) { if (options.verbose) - Error(ERR_RETURN, "switching to private colormap"); + Error(ERR_INFO, "switching to private colormap"); /* we just filled up the default colormap -- get a private one which contains all already allocated colors */ @@ -486,7 +486,7 @@ XImageInfo *Image_to_Pixmap(Display *display, int screen, Visual *visual, break; default: - Error(ERR_RETURN,"DirectColor, TrueColor or PseudoColor display needed"); + Error(ERR_INFO,"DirectColor, TrueColor or PseudoColor display needed"); SetError(error, "display class not supported"); return NULL; @@ -560,7 +560,7 @@ XImageInfo *Image_to_Pixmap(Display *display, int screen, Visual *visual, } default: - Error(ERR_RETURN, "RGB or TrueColor image needed"); + Error(ERR_INFO, "RGB or TrueColor image needed"); SetError(error, "image type not supported"); return NULL; @@ -594,7 +594,7 @@ XImageInfo *Image_to_Pixmap(Display *display, int screen, Visual *visual, } default: - Error(ERR_RETURN,"DirectColor, TrueColor or PseudoColor display needed"); + Error(ERR_INFO,"DirectColor, TrueColor or PseudoColor display needed"); SetError(error, "display class not supported"); return NULL; diff --git a/src/libgame/misc.c b/src/libgame/misc.c index f9b8b257..3d63cc5c 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -106,7 +106,7 @@ char *int2str(int number, int size) if (size > 20) size = 20; - if (size) + if (size > 0) { sprintf(s, " %09d", number); return &s[strlen(s) - size]; @@ -156,6 +156,11 @@ int log_2(unsigned int x) return e; } +boolean getTokenValueFromString(char *string, char **token, char **value) +{ + return getTokenValueFromSetupLine(string, token, value); +} + /* ------------------------------------------------------------------------- */ /* counter functions */ @@ -552,6 +557,21 @@ char *getStringCopy(char *s) return s_copy; } +char *getStringCopyN(char *s, int n) +{ + char *s_copy; + int s_len = MAX(0, n); + + if (s == NULL) + return NULL; + + s_copy = checked_malloc(s_len + 1); + strncpy(s_copy, s, s_len); + s_copy[s_len] = '\0'; + + return s_copy; +} + char *getStringToLower(char *s) { char *s_copy = checked_malloc(strlen(s) + 1); @@ -579,6 +599,31 @@ boolean strEqual(char *s1, char *s2) strcmp(s1, s2) == 0); } +boolean strEqualN(char *s1, char *s2, int n) +{ + return (s1 == NULL && s2 == NULL ? TRUE : + s1 == NULL && s2 != NULL ? FALSE : + s1 != NULL && s2 == NULL ? FALSE : + strncmp(s1, s2, n) == 0); +} + +boolean strPrefix(char *s, char *prefix) +{ + return (s == NULL && prefix == NULL ? TRUE : + s == NULL && prefix != NULL ? FALSE : + s != NULL && prefix == NULL ? FALSE : + strncmp(s, prefix, strlen(prefix)) == 0); +} + +boolean strSuffix(char *s, char *suffix) +{ + return (s == NULL && suffix == NULL ? TRUE : + s == NULL && suffix != NULL ? FALSE : + s != NULL && suffix == NULL ? FALSE : + strlen(s) < strlen(suffix) ? FALSE : + strncmp(&s[strlen(s) - strlen(suffix)], suffix, strlen(suffix)) == 0); +} + /* ------------------------------------------------------------------------- */ /* command line option handling functions */ @@ -808,7 +853,7 @@ void Error(int mode, char *format, ...) if (mode & ERR_WARN && !options.verbose) return; - if (mode == ERR_RETURN_LINE) + if (mode == ERR_INFO_LINE) { if (!last_line_was_separator) fprintf_line(program.error_file, format, 79); @@ -905,6 +950,19 @@ void checked_free(void *ptr) free(ptr); } +void clear_mem(void *ptr, unsigned long size) +{ +#if defined(PLATFORM_WIN32) + /* for unknown reason, memset() sometimes crashes when compiled with MinGW */ + char *cptr = (char *)ptr; + + while (size--) + *cptr++ = 0; +#else + memset(ptr, 0, size); +#endif +} + /* ------------------------------------------------------------------------- */ /* various helper functions */ @@ -1219,6 +1277,7 @@ void translate_keyname(Key *keysym, char **x11name, char **name, int mode) { KSYM_asciitilde, "XK_asciitilde", "~" }, /* special (non-ASCII) keys */ + { KSYM_degree, "XK_degree", "°" }, { KSYM_Adiaeresis, "XK_Adiaeresis", "Ä" }, { KSYM_Odiaeresis, "XK_Odiaeresis", "Ö" }, { KSYM_Udiaeresis, "XK_Udiaeresis", "Ãœ" }, @@ -1447,16 +1506,23 @@ Key getKeyFromX11KeyName(char *x11name) char getCharFromKey(Key key) { char *keyname = getKeyNameFromKey(key); - char letter = 0; + char c = 0; if (strlen(keyname) == 1) - letter = keyname[0]; + c = keyname[0]; else if (strEqual(keyname, "space")) - letter = ' '; - else if (strEqual(keyname, "circumflex")) - letter = '^'; + c = ' '; + + return c; +} + +char getValidConfigValueChar(char c) +{ + if (c == '#' || /* used to mark comments */ + c == '\\') /* used to mark continued lines */ + c = 0; - return letter; + return c; } @@ -1496,9 +1562,13 @@ int get_integer_from_string(char *s) if (result == -1) { - if (strEqual(s_lower, "false")) + if (strEqual(s_lower, "false") || + strEqual(s_lower, "no") || + strEqual(s_lower, "off")) result = 0; - else if (strEqual(s_lower, "true")) + else if (strEqual(s_lower, "true") || + strEqual(s_lower, "yes") || + strEqual(s_lower, "on")) result = 1; else result = atoi(s); @@ -1774,7 +1844,15 @@ int get_parameter_value(char *value_raw, char *suffix, int type) { result = (strEqual(value, "left") ? ALIGN_LEFT : strEqual(value, "right") ? ALIGN_RIGHT : - strEqual(value, "center") ? ALIGN_CENTER : ALIGN_DEFAULT); + strEqual(value, "center") ? ALIGN_CENTER : + strEqual(value, "middle") ? ALIGN_CENTER : ALIGN_DEFAULT); + } + else if (strEqual(suffix, ".valign")) + { + result = (strEqual(value, "top") ? VALIGN_TOP : + strEqual(value, "bottom") ? VALIGN_BOTTOM : + strEqual(value, "middle") ? VALIGN_MIDDLE : + strEqual(value, "center") ? VALIGN_MIDDLE : VALIGN_DEFAULT); } else if (strEqual(suffix, ".anim_mode")) { @@ -1790,8 +1868,6 @@ int get_parameter_value(char *value_raw, char *suffix, int type) string_has_parameter(value, "horizontal") ? ANIM_HORIZONTAL : string_has_parameter(value, "vertical") ? ANIM_VERTICAL : string_has_parameter(value, "centered") ? ANIM_CENTERED : - string_has_parameter(value, "fade") ? ANIM_FADE : - string_has_parameter(value, "crossfade") ? ANIM_CROSSFADE : ANIM_DEFAULT); if (string_has_parameter(value, "reverse")) @@ -1803,6 +1879,22 @@ int get_parameter_value(char *value_raw, char *suffix, int type) if (string_has_parameter(value, "static_panel")) result |= ANIM_STATIC_PANEL; } + else if (strEqual(suffix, ".fade_mode")) + { + result = (string_has_parameter(value, "none") ? FADE_MODE_NONE : + string_has_parameter(value, "fade") ? FADE_MODE_FADE : + string_has_parameter(value, "crossfade") ? FADE_MODE_CROSSFADE : + string_has_parameter(value, "melt") ? FADE_MODE_MELT : + FADE_MODE_DEFAULT); + } +#if 1 + else if (strPrefix(suffix, ".font")) /* (may also be ".font_xyz") */ +#else + else if (strEqualN(suffix, ".font", 5)) /* (may also be ".font_xyz") */ +#endif + { + result = gfx.get_font_from_token_function(value); + } else /* generic parameter of type integer or boolean */ { result = (strEqual(value, ARG_UNDEFINED) ? ARG_UNDEFINED_VALUE : @@ -1816,20 +1908,6 @@ int get_parameter_value(char *value_raw, char *suffix, int type) return result; } -int get_auto_parameter_value(char *token, char *value_raw) -{ - char *suffix; - - if (token == NULL || value_raw == NULL) - return ARG_UNDEFINED_VALUE; - - suffix = strrchr(token, '.'); - if (suffix == NULL) - suffix = token; - - return get_parameter_value(value_raw, suffix, TYPE_INTEGER); -} - struct ScreenModeInfo *get_screen_mode_from_string(char *screen_mode_string) { static struct ScreenModeInfo screen_mode; @@ -1914,6 +1992,7 @@ struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list, file_list[i].redefined = FALSE; file_list[i].fallback_to_default = FALSE; + file_list[i].default_is_cloned = FALSE; } } @@ -1958,28 +2037,39 @@ struct FileInfo *getFileListFromConfigList(struct ConfigInfo *config_list, !strEqual(&config_list[i].value[len_config_value - 4], ".wav") && !strEqual(config_list[i].value, UNDEFINED_FILENAME)) { - Error(ERR_RETURN, "Configuration directive '%s' -> '%s':", + Error(ERR_INFO, "Configuration directive '%s' -> '%s':", config_list[i].token, config_list[i].value); Error(ERR_EXIT, "This seems to be no valid definition -- please fix"); } file_list[list_pos].token = config_list[i].token; file_list[list_pos].default_filename = config_list[i].value; + +#if 0 + printf("::: '%s' => '%s'\n", config_list[i].token, config_list[i].value); +#endif } + + if (strSuffix(config_list[i].token, ".clone_from")) + file_list[list_pos].default_is_cloned = TRUE; } num_file_list_entries_found = list_pos + 1; if (num_file_list_entries_found != num_file_list_entries) { - Error(ERR_RETURN_LINE, "-"); - Error(ERR_RETURN, "inconsistant config list information:"); - Error(ERR_RETURN, "- should be: %d (according to 'src/conf_gfx.h')", + Error(ERR_INFO_LINE, "-"); + Error(ERR_INFO, "inconsistant config list information:"); + Error(ERR_INFO, "- should be: %d (according to 'src/conf_xxx.h')", num_file_list_entries); - Error(ERR_RETURN, "- found to be: %d (according to 'src/conf_gfx.c')", + Error(ERR_INFO, "- found to be: %d (according to 'src/conf_xxx.c')", num_file_list_entries_found); Error(ERR_EXIT, "please fix"); } +#if 0 + printf("::: ---------- DONE ----------\n"); +#endif + return file_list; } @@ -2070,6 +2160,7 @@ static void add_dynamic_file_list_entry(struct FileInfo **list, new_list_entry->redefined = FALSE; new_list_entry->fallback_to_default = FALSE; + new_list_entry->default_is_cloned = FALSE; read_token_parameters(extra_file_hash, suffix_list, new_list_entry); } @@ -2245,10 +2336,20 @@ static void LoadArtworkConfigFromFilename(struct ArtworkListInfo *artwork_info, base_index = i; +#if 0 + if (IS_PARENT_PROCESS()) + printf("===> MATCH: '%s', '%s'\n", token, base_prefix); +#endif + if (start_pos + len_base_prefix == len_token) /* exact match */ { exact_match = TRUE; +#if 0 + if (IS_PARENT_PROCESS()) + printf("===> EXACT MATCH: '%s', '%s'\n", token, base_prefix); +#endif + add_dynamic_file_list_entry(dynamic_file_list, num_dynamic_file_list_entries, extra_file_hash, @@ -2282,10 +2383,20 @@ static void LoadArtworkConfigFromFilename(struct ArtworkListInfo *artwork_info, ext1_index = j; +#if 0 + if (IS_PARENT_PROCESS()) + printf("===> MATCH: '%s', '%s'\n", token, ext1_suffix); +#endif + if (start_pos + len_ext1_suffix == len_token) /* exact match */ { exact_match = TRUE; +#if 0 + if (IS_PARENT_PROCESS()) + printf("===> EXACT MATCH: '%s', '%s'\n", token, ext1_suffix); +#endif + add_dynamic_file_list_entry(dynamic_file_list, num_dynamic_file_list_entries, extra_file_hash, @@ -2324,10 +2435,20 @@ static void LoadArtworkConfigFromFilename(struct ArtworkListInfo *artwork_info, ext2_index = k; +#if 0 + if (IS_PARENT_PROCESS()) + printf("===> MATCH: '%s', '%s'\n", token, ext2_suffix); +#endif + if (start_pos + len_ext2_suffix == len_token) /* exact match */ { exact_match = TRUE; +#if 0 + if (IS_PARENT_PROCESS()) + printf("===> EXACT MATCH: '%s', '%s'\n", token, ext2_suffix); +#endif + add_dynamic_file_list_entry(dynamic_file_list, num_dynamic_file_list_entries, extra_file_hash, @@ -2366,10 +2487,20 @@ static void LoadArtworkConfigFromFilename(struct ArtworkListInfo *artwork_info, ext3_index = l; +#if 0 + if (IS_PARENT_PROCESS()) + printf("===> MATCH: '%s', '%s'\n", token, ext3_suffix); +#endif + if (start_pos + len_ext3_suffix == len_token) /* exact match */ { exact_match = TRUE; +#if 0 + if (IS_PARENT_PROCESS()) + printf("===> EXACT MATCH: '%s', '%s'\n", token, ext3_suffix); +#endif + add_dynamic_file_list_entry(dynamic_file_list, num_dynamic_file_list_entries, extra_file_hash, @@ -2415,53 +2546,53 @@ static void LoadArtworkConfigFromFilename(struct ArtworkListInfo *artwork_info, if (options.debug && dynamic_tokens_found) { - Error(ERR_RETURN_LINE, "-"); - Error(ERR_RETURN, "dynamic token(s) found in config file:"); - Error(ERR_RETURN, "- config file: '%s'", filename); + Error(ERR_INFO_LINE, "-"); + Error(ERR_INFO, "dynamic token(s) found in config file:"); + Error(ERR_INFO, "- config file: '%s'", filename); for (list = setup_file_list; list != NULL; list = list->next) { char *value = getHashEntry(extra_file_hash, list->token); if (value != NULL && strEqual(value, known_token_value)) - Error(ERR_RETURN, "- dynamic token: '%s'", list->token); + Error(ERR_INFO, "- dynamic token: '%s'", list->token); } - Error(ERR_RETURN_LINE, "-"); + Error(ERR_INFO_LINE, "-"); } if (unknown_tokens_found) { - Error(ERR_RETURN_LINE, "-"); - Error(ERR_RETURN, "warning: unknown token(s) found in config file:"); - Error(ERR_RETURN, "- config file: '%s'", filename); + Error(ERR_INFO_LINE, "-"); + Error(ERR_INFO, "warning: unknown token(s) found in config file:"); + Error(ERR_INFO, "- config file: '%s'", filename); for (list = setup_file_list; list != NULL; list = list->next) { char *value = getHashEntry(extra_file_hash, list->token); if (value != NULL && !strEqual(value, known_token_value)) - Error(ERR_RETURN, "- dynamic token: '%s'", list->token); + Error(ERR_INFO, "- dynamic token: '%s'", list->token); } - Error(ERR_RETURN_LINE, "-"); + Error(ERR_INFO_LINE, "-"); } if (undefined_values_found) { - Error(ERR_RETURN_LINE, "-"); - Error(ERR_RETURN, "warning: undefined values found in config file:"); - Error(ERR_RETURN, "- config file: '%s'", filename); + Error(ERR_INFO_LINE, "-"); + Error(ERR_INFO, "warning: undefined values found in config file:"); + Error(ERR_INFO, "- config file: '%s'", filename); for (list = setup_file_list; list != NULL; list = list->next) { char *value = getHashEntry(empty_file_hash, list->token); if (value != NULL) - Error(ERR_RETURN, "- undefined value for token: '%s'", list->token); + Error(ERR_INFO, "- undefined value for token: '%s'", list->token); } - Error(ERR_RETURN_LINE, "-"); + Error(ERR_INFO_LINE, "-"); } freeSetupFileList(setup_file_list); @@ -2582,6 +2713,22 @@ static void replaceArtworkListEntry(struct ArtworkListInfo *artwork_info, basename = file_list_entry->default_filename; + /* fail for cloned default artwork that has no default filename defined */ + if (file_list_entry->default_is_cloned && + strEqual(basename, UNDEFINED_FILENAME)) + { + int error_mode = ERR_WARN; + + /* we can get away without sounds and music, but not without graphics */ + if (*listnode == NULL && artwork_info->type == ARTWORK_TYPE_GRAPHICS) + error_mode = ERR_EXIT; + + Error(error_mode, "token '%s' was cloned and has no default filename", + file_list_entry->token); + + return; + } + /* dynamic artwork has no default filename / skip empty default artwork */ if (basename == NULL || strEqual(basename, UNDEFINED_FILENAME)) return; @@ -2658,6 +2805,7 @@ static void replaceArtworkListEntry(struct ArtworkListInfo *artwork_info, error_mode = ERR_EXIT; Error(error_mode, "cannot load artwork file '%s'", basename); + return; } } @@ -2667,7 +2815,7 @@ static void LoadCustomArtwork(struct ArtworkListInfo *artwork_info, struct FileInfo *file_list_entry) { #if 0 - printf("GOT CUSTOM ARTWORK FILE '%s'\n", filename); + printf("GOT CUSTOM ARTWORK FILE '%s'\n", file_list_entry->filename); #endif if (strEqual(file_list_entry->filename, UNDEFINED_FILENAME)) @@ -2789,22 +2937,77 @@ void NotifyUserAboutErrorFile() #if DEBUG -#define DEBUG_NUM_TIMESTAMPS 3 +#define DEBUG_NUM_TIMESTAMPS 5 +#define DEBUG_TIME_IN_MICROSECONDS 0 + +#if DEBUG_TIME_IN_MICROSECONDS +static double Counter_Microseconds() +{ + static struct timeval base_time = { 0, 0 }; + struct timeval current_time; + double counter; + + gettimeofday(¤t_time, NULL); + + /* reset base time in case of wrap-around */ + if (current_time.tv_sec < base_time.tv_sec) + base_time = current_time; + + counter = + ((double)(current_time.tv_sec - base_time.tv_sec)) * 1000000 + + ((double)(current_time.tv_usec - base_time.tv_usec)); + + return counter; /* return microseconds since last init */ +} +#endif + +char *debug_print_timestamp_get_padding(int padding_size) +{ + static char *padding = NULL; + int max_padding_size = 100; + + if (padding == NULL) + { + padding = checked_calloc(max_padding_size + 1); + memset(padding, ' ', max_padding_size); + } + + return &padding[MAX(0, max_padding_size - padding_size)]; +} void debug_print_timestamp(int counter_nr, char *message) { - static long counter[DEBUG_NUM_TIMESTAMPS][2]; + int indent_size = 8; + int padding_size = 40; + float timestamp_interval; - if (counter_nr >= DEBUG_NUM_TIMESTAMPS) + if (counter_nr < 0) + Error(ERR_EXIT, "debugging: invalid negative counter"); + else if (counter_nr >= DEBUG_NUM_TIMESTAMPS) Error(ERR_EXIT, "debugging: increase DEBUG_NUM_TIMESTAMPS in misc.c"); - counter[counter_nr][0] = Counter(); +#if DEBUG_TIME_IN_MICROSECONDS + static double counter[DEBUG_NUM_TIMESTAMPS][2]; + char *unit = "ms"; - if (message) - printf("%s %.3f seconds\n", message, - (float)(counter[counter_nr][0] - counter[counter_nr][1]) / 1000); + counter[counter_nr][0] = Counter_Microseconds(); +#else + static long counter[DEBUG_NUM_TIMESTAMPS][2]; + char *unit = "s"; + counter[counter_nr][0] = Counter(); +#endif + + timestamp_interval = counter[counter_nr][0] - counter[counter_nr][1]; counter[counter_nr][1] = counter[counter_nr][0]; + + if (message) + printf("%s%s%s %.3f %s\n", + debug_print_timestamp_get_padding(counter_nr * indent_size), + message, + debug_print_timestamp_get_padding(padding_size - strlen(message)), + timestamp_interval / 1000, + unit); } void debug_print_parent_only(char *format, ...) diff --git a/src/libgame/misc.h b/src/libgame/misc.h index a42a7584..29aaee70 100644 --- a/src/libgame/misc.h +++ b/src/libgame/misc.h @@ -36,8 +36,8 @@ #define GetSimpleRandom(max) get_random_number(RANDOM_SIMPLE, max) /* values for Error() */ -#define ERR_RETURN 0 -#define ERR_RETURN_LINE (1 << 0) +#define ERR_INFO 0 +#define ERR_INFO_LINE (1 << 0) #define ERR_WARN (1 << 1) #define ERR_EXIT (1 << 2) #define ERR_HELP (1 << 3) @@ -77,6 +77,8 @@ char *int2str(int, int); char *i_to_a(unsigned int); int log_2(unsigned int); +boolean getTokenValueFromString(char *, char **, char **); + void InitCounter(void); unsigned long Counter(void); void Delay(unsigned long); @@ -101,9 +103,13 @@ char *getStringCat3(char *, char *, char *); char *getPath2(char *, char *); char *getPath3(char *, char *, char*); char *getStringCopy(char *); +char *getStringCopyN(char *, int); char *getStringToLower(char *); void setString(char **, char *); boolean strEqual(char *, char *); +boolean strEqualN(char *, char *, int); +boolean strPrefix(char *, char *); +boolean strSuffix(char *, char *); void GetOptions(char **, void (*print_usage_function)(void)); @@ -115,6 +121,7 @@ void *checked_malloc(unsigned long); void *checked_calloc(unsigned long); void *checked_realloc(void *, unsigned long); void checked_free(void *); +void clear_mem(void *, unsigned long); void swap_numbers(int *, int *); void swap_number_pairs(int *, int *, int *, int *); @@ -158,6 +165,7 @@ char *getX11KeyNameFromKey(Key); Key getKeyFromKeyName(char *); Key getKeyFromX11KeyName(char *); char getCharFromKey(Key); +char getValidConfigValueChar(char); int get_integer_from_string(char *); boolean get_boolean_from_string(char *); @@ -177,7 +185,6 @@ boolean FileIsArtworkType(char *, int); char *get_mapped_token(char *); int get_parameter_value(char *, char *, int); -int get_auto_parameter_value(char *, char *); struct ScreenModeInfo *get_screen_mode_from_string(char *); void get_aspect_ratio_from_screen_mode(struct ScreenModeInfo *, int *x, int *y); diff --git a/src/libgame/platform.h b/src/libgame/platform.h index d8773420..1e6d1c0f 100644 --- a/src/libgame/platform.h +++ b/src/libgame/platform.h @@ -15,82 +15,159 @@ #define PLATFORM_H /* ========================================================================= */ -/* define keywords for supported main platforms (Unix, DOS and Windows) */ +/* define main platform keywords */ /* ========================================================================= */ #if defined(MSDOS) #define PLATFORM_MSDOS -#elif defined(WIN32) +#define PLATFORM_STRING "DOS" +#elif defined(WIN32) || defined(_WIN32) #define PLATFORM_WIN32 +#define PLATFORM_STRING "Windows" #else #define PLATFORM_UNIX +#define PLATFORM_STRING "Unix" #endif /* ========================================================================= */ -/* define additional keywords for MS-DOS platform */ +/* define additional platform keywords */ /* ========================================================================= */ -#if defined(PLATFORM_MSDOS) +#if defined(_AIX) +#define PLATFORM_AIX +#undef PLATFORM_STRING +#define PLATFORM_STRING "AIX" +#endif -#ifndef TARGET_ALLEGRO -#define TARGET_ALLEGRO +#if defined(AMIGA) || defined(__AMIGA) || defined(__amigados__) +#define PLATFORM_AMIGA +#undef PLATFORM_STRING +#define PLATFORM_STRING "AmigaOS" #endif -#ifndef TARGET_X11 -#define TARGET_X11 +#if defined(__BEOS__) +#define PLATFORM_BEOS +#undef PLATFORM_STRING +#define PLATFORM_STRING "BeOS" #endif +#if defined(bsdi) || defined(__bsdi) || defined(__bsdi__) +#define PLATFORM_BSDI +#define PLATFORM_BSD +#undef PLATFORM_STRING +#define PLATFORM_STRING "BSDI" #endif +#if defined(_arch_dreamcast) +#define PLATFORM_DREAMCAST +#undef PLATFORM_STRING +#define PLATFORM_STRING "Dreamcast" +#endif -/* ========================================================================= */ -/* define additional keywords for several Unix platforms */ -/* ========================================================================= */ +#if defined(__FreeBSD__) || defined(__DragonFly__) +#define PLATFORM_FREEBSD +#define PLATFORM_BSD +#undef PLATFORM_STRING +#define PLATFORM_STRING "FreeBSD" +#endif -#if defined(PLATFORM_UNIX) && defined(TARGET_X11) -#define TARGET_X11_NATIVE +#if defined(hpux) || defined(__hpux) || defined(__hpux__) +#define PLATFORM_HPUX +#undef PLATFORM_STRING +#define PLATFORM_STRING "HP-UX" #endif -#if defined(linux) +#if defined(sgi) || defined(__sgi) || defined(__sgi__) || defined(_SGI_SOURCE) +#define PLATFORM_IRIX +#undef PLATFORM_STRING +#define PLATFORM_STRING "IRIX" +#endif + +#if defined(linux) || defined(__linux) || defined(__linux__) #define PLATFORM_LINUX +#undef PLATFORM_STRING +#define PLATFORM_STRING "Linux" #endif -#if defined(__FreeBSD__) -#define PLATFORM_FREEBSD -#define PLATFORM_BSD +#if defined(__APPLE__) && defined(__MACH__) +#define PLATFORM_MACOSX +#undef PLATFORM_STRING +#define PLATFORM_STRING "Mac OS X" #endif #if defined(__NetBSD__) #define PLATFORM_NETBSD #define PLATFORM_BSD +#undef PLATFORM_STRING +#define PLATFORM_STRING "NetBSD" #endif -#if defined(__bsdi__) -#define PLATFORM_BSDI +#if defined(NeXT) +#define PLATFORM_NEXT +#undef PLATFORM_STRING +#define PLATFORM_STRING "NeXT" +#endif + +#if defined(__OpenBSD__) +#define PLATFORM_OPENBSD #define PLATFORM_BSD +#undef PLATFORM_STRING +#define PLATFORM_STRING "OpenBSD" #endif -#if defined(sparc) && defined(sun) -#define PLATFORM_SUNOS +#if defined(__OS2__) +#define PLATFORM_OS2 +#undef PLATFORM_STRING +#define PLATFORM_STRING "OS/2" #endif -#if defined(__APPLE__) && defined(__MACH__) -#define PLATFORM_MACOSX +#if defined(osf) || defined(__osf) || defined(__osf__) || defined(_OSF_SOURCE) +#define PLATFORM_OSF +#undef PLATFORM_STRING +#define PLATFORM_STRING "OSF/1" #endif -#if defined(NeXT) -#define PLATFORM_NEXT +#if defined(__QNXNTO__) +#define PLATFORM_QNX +#undef PLATFORM_STRING +#define PLATFORM_STRING "QNX" #endif -/* detecting HP-UX by the following compiler keyword definitions: - - in K&R mode (the default), the HP C compiler defines "hpux" - - in ANSI mode (-Aa or -Ae), the HP C compiler defines "__hpux" - - the gcc (Gnu) C compiler defines "__hpux__" - Thanks to Jarkko Hietaniemi for this note. */ +#if defined(riscos) || defined(__riscos) || defined(__riscos__) +#define PLATFORM_RISCOS +#undef PLATFORM_STRING +#define PLATFORM_STRING "RISC OS" +#endif -#if defined(__hpux__) || defined(__hpux) || defined(hpux) -#define PLATFORM_HPUX +#if defined(sparc) || defined(sun) || defined(__SVR4) +#define PLATFORM_SOLARIS +#undef PLATFORM_STRING +#define PLATFORM_STRING "Solaris" +#endif + +#if defined(_WIN32_WCE) +#define PLATFORM_WINDOWS_CE +#undef PLATFORM_STRING +#define PLATFORM_STRING "Windows CE" +#endif + + +/* ========================================================================= */ +/* define additional target keywords */ +/* ========================================================================= */ + +#if defined(PLATFORM_MSDOS) +#ifndef TARGET_ALLEGRO +#define TARGET_ALLEGRO +#endif +#ifndef TARGET_X11 +#define TARGET_X11 +#endif +#endif + +#if defined(PLATFORM_UNIX) && defined(TARGET_X11) +#define TARGET_X11_NATIVE #endif @@ -102,5 +179,4 @@ #define NETWORK_AVALIABLE #endif - #endif /* PLATFORM_H */ diff --git a/src/libgame/sdl.c b/src/libgame/sdl.c index 6ac1229f..66320a5b 100644 --- a/src/libgame/sdl.c +++ b/src/libgame/sdl.c @@ -94,7 +94,10 @@ static void SDLSetWindowIcon(char *basename) void SDLInitVideoDisplay(void) { - putenv("SDL_VIDEO_CENTERED=1"); + if (!strEqual(setup.system.sdl_videodriver, ARG_DEFAULT)) + SDL_putenv(getStringCat2("SDL_VIDEODRIVER=", setup.system.sdl_videodriver)); + + SDL_putenv("SDL_VIDEO_CENTERED=1"); /* initialize SDL video */ if (SDL_InitSubSystem(SDL_INIT_VIDEO) < 0) @@ -412,8 +415,8 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height, dst_rect.x = dst_x; dst_rect.y = dst_y; - dst_rect.w = width; - dst_rect.h = height; + dst_rect.w = width; /* (ignored) */ + dst_rect.h = height; /* (ignored) */ if (initialization_needed) { @@ -469,17 +472,17 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height, } /* copy source and target surfaces to temporary surfaces for fading */ - if (fade_mode == FADE_MODE_CROSSFADE) + if (fade_mode & FADE_TYPE_TRANSFORM) { SDL_BlitSurface(surface_cross, &src_rect, surface_source, &src_rect); SDL_BlitSurface(surface_screen, &dst_rect, surface_target, &src_rect); } - else if (fade_mode == FADE_MODE_FADE_IN) + else if (fade_mode & FADE_TYPE_FADE_IN) { SDL_BlitSurface(surface_black, &src_rect, surface_source, &src_rect); SDL_BlitSurface(surface_screen, &dst_rect, surface_target, &src_rect); } - else /* FADE_MODE_FADE_OUT */ + else /* FADE_TYPE_FADE_OUT */ { SDL_BlitSurface(surface_screen, &dst_rect, surface_source, &src_rect); SDL_BlitSurface(surface_black, &src_rect, surface_target, &src_rect); @@ -487,29 +490,150 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height, time_current = SDL_GetTicks(); - for (alpha = 0.0; alpha < 255.0;) + if (fade_mode == FADE_MODE_MELT) { - time_last = time_current; - time_current = SDL_GetTicks(); - alpha += 255 * ((float)(time_current - time_last) / fade_delay); - alpha_final = MIN(MAX(0, alpha), 255); + boolean done = FALSE; + int melt_pixels = 2; + int melt_columns = width / melt_pixels; + int ypos[melt_columns]; + int max_steps = height / 8 + 32; + int steps_done = 0; + int i; - /* draw existing (source) image to screen buffer */ SDL_BlitSurface(surface_source, &src_rect, surface_screen, &dst_rect); + SDL_SetAlpha(surface_target, 0, 0); /* disable alpha blending */ + + ypos[0] = -GetSimpleRandom(16); + + for (i = 1 ; i < melt_columns; i++) + { + int r = GetSimpleRandom(3) - 1; /* randomly choose from { -1, 0, -1 } */ + + ypos[i] = ypos[i - 1] + r; + + if (ypos[i] > 0) + ypos[i] = 0; + else + if (ypos[i] == -16) + ypos[i] = -15; + } + + while (!done) + { + float steps; + int steps_final; + + time_last = time_current; + time_current = SDL_GetTicks(); + steps += max_steps * ((float)(time_current - time_last) / fade_delay); + steps_final = MIN(MAX(0, steps), max_steps); - /* draw new (target) image to screen buffer using alpha blending */ - SDL_SetAlpha(surface_target, SDL_SRCALPHA, alpha_final); - SDL_BlitSurface(surface_target, &src_rect, surface_screen, &dst_rect); + steps_done++; - if (draw_border_function != NULL) - draw_border_function(); + done = (steps_done >= steps_final); + + for (i = 0 ; i < melt_columns; i++) + { + if (ypos[i] < 0) + { + ypos[i]++; + + done = FALSE; + } + else if (ypos[i] < height) + { + int y1 = 16; + int y2 = 8; + int y3 = 8; + int dy = (ypos[i] < y1) ? ypos[i] + 1 : y2 + GetSimpleRandom(y3); + + if (ypos[i] + dy >= height) + dy = height - ypos[i]; + + /* copy part of (appearing) target surface to upper area */ + src_rect.x = src_x + i * melt_pixels; + // src_rect.y = src_y + ypos[i]; + src_rect.y = src_y; + src_rect.w = melt_pixels; + // src_rect.h = dy; + src_rect.h = ypos[i] + dy; + + dst_rect.x = dst_x + i * melt_pixels; + // dst_rect.y = dst_y + ypos[i]; + dst_rect.y = dst_y; + + if (steps_done >= steps_final) + SDL_BlitSurface(surface_target, &src_rect, + surface_screen, &dst_rect); + + ypos[i] += dy; + + /* copy part of (disappearing) source surface to lower area */ + src_rect.x = src_x + i * melt_pixels; + src_rect.y = src_y; + src_rect.w = melt_pixels; + src_rect.h = height - ypos[i]; + + dst_rect.x = dst_x + i * melt_pixels; + dst_rect.y = dst_y + ypos[i]; + + if (steps_done >= steps_final) + SDL_BlitSurface(surface_source, &src_rect, + surface_screen, &dst_rect); + + done = FALSE; + } + else + { + src_rect.x = src_x + i * melt_pixels; + src_rect.y = src_y; + src_rect.w = melt_pixels; + src_rect.h = height; + + dst_rect.x = dst_x + i * melt_pixels; + dst_rect.y = dst_y; + + if (steps_done >= steps_final) + SDL_BlitSurface(surface_target, &src_rect, + surface_screen, &dst_rect); + } + } + + if (steps_done >= steps_final) + { + if (draw_border_function != NULL) + draw_border_function(); + + SDL_UpdateRect(surface_screen, dst_x, dst_y, width, height); + } + } + } + else + { + for (alpha = 0.0; alpha < 255.0;) + { + time_last = time_current; + time_current = SDL_GetTicks(); + alpha += 255 * ((float)(time_current - time_last) / fade_delay); + alpha_final = MIN(MAX(0, alpha), 255); + + /* draw existing (source) image to screen buffer */ + SDL_BlitSurface(surface_source, &src_rect, surface_screen, &dst_rect); + + /* draw new (target) image to screen buffer using alpha blending */ + SDL_SetAlpha(surface_target, SDL_SRCALPHA, alpha_final); + SDL_BlitSurface(surface_target, &src_rect, surface_screen, &dst_rect); + + if (draw_border_function != NULL) + draw_border_function(); #if 1 - /* only update the region of the screen that is affected from fading */ - SDL_UpdateRect(surface_screen, dst_x, dst_y, width, height); + /* only update the region of the screen that is affected from fading */ + SDL_UpdateRect(surface_screen, dst_x, dst_y, width, height); #else - SDL_Flip(surface_screen); + SDL_Flip(surface_screen); #endif + } } Delay(post_delay); @@ -1512,6 +1636,8 @@ Bitmap *SDLLoadImage(char *filename) return NULL; } + UPDATE_BUSY_STATE(); + /* create native non-transparent surface for current image */ if ((new_bitmap->surface = SDL_DisplayFormat(sdl_image_tmp)) == NULL) { @@ -1520,6 +1646,8 @@ Bitmap *SDLLoadImage(char *filename) return NULL; } + UPDATE_BUSY_STATE(); + /* create native transparent surface for current image */ SDL_SetColorKey(sdl_image_tmp, SDL_SRCCOLORKEY, SDL_MapRGB(sdl_image_tmp->format, 0x00, 0x00, 0x00)); @@ -1530,6 +1658,8 @@ Bitmap *SDLLoadImage(char *filename) return NULL; } + UPDATE_BUSY_STATE(); + /* free temporary surface */ SDL_FreeSurface(sdl_image_tmp); @@ -1584,7 +1714,7 @@ void SDLSetMouseCursor(struct MouseCursorInfo *cursor_info) void SDLOpenAudio(void) { if (!strEqual(setup.system.sdl_audiodriver, ARG_DEFAULT)) - putenv(getStringCat2("SDL_AUDIODRIVER=", setup.system.sdl_audiodriver)); + SDL_putenv(getStringCat2("SDL_AUDIODRIVER=", setup.system.sdl_audiodriver)); if (SDL_InitSubSystem(SDL_INIT_AUDIO) < 0) { diff --git a/src/libgame/sdl.h b/src/libgame/sdl.h index 5ab0461d..19ead5e5 100644 --- a/src/libgame/sdl.h +++ b/src/libgame/sdl.h @@ -78,8 +78,8 @@ struct MouseCursorInfo int width, height; int hot_x, hot_y; - char data[CURSOR_MAX_WIDTH * CURSOR_MAX_HEIGHT / 8]; - char mask[CURSOR_MAX_WIDTH * CURSOR_MAX_HEIGHT / 8]; + byte data[CURSOR_MAX_WIDTH * CURSOR_MAX_HEIGHT / 8]; + byte mask[CURSOR_MAX_WIDTH * CURSOR_MAX_HEIGHT / 8]; }; @@ -187,6 +187,7 @@ struct MouseCursorInfo #define KSYM_braceright KSYM_UNDEFINED /* undefined */ #define KSYM_asciitilde KSYM_UNDEFINED /* undefined */ +#define KSYM_degree SDLK_WORLD_16 #define KSYM_Adiaeresis SDLK_WORLD_36 #define KSYM_Odiaeresis SDLK_WORLD_54 #define KSYM_Udiaeresis SDLK_WORLD_60 diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 3cd7bf0f..df6e2f8a 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -498,33 +498,80 @@ char *getLevelSetInfoFilename() return NULL; } -char *getLevelSetMessageFilename() +char *getLevelSetTitleMessageBasename(int nr, boolean initial) +{ + static char basename[32]; + + sprintf(basename, "%s_%d.txt", + (initial ? "titlemessage_initial" : "titlemessage"), nr + 1); + + return basename; +} + +char *getLevelSetTitleMessageFilename(int nr, boolean initial) { static char *filename = NULL; - char *basenames[] = - { - "MESSAGE", - "MESSAGE.TXT", - "MESSAGE.txt", - "Message", - "Message.txt", - "message", - "message.txt", + char *basename; + boolean skip_setup_artwork = FALSE; - NULL - }; - int i; + checked_free(filename); - for (i = 0; basenames[i] != NULL; i++) + basename = getLevelSetTitleMessageBasename(nr, initial); + + if (!setup.override_level_graphics) { - checked_free(filename); - filename = getPath2(getCurrentLevelDir(), basenames[i]); + /* 1st try: look for special artwork in current level series directory */ + filename = getPath3(getCurrentLevelDir(), GRAPHICS_DIRECTORY, basename); + if (fileExists(filename)) + return filename; + free(filename); + + /* 2nd try: look for message file in current level set directory */ + filename = getPath2(getCurrentLevelDir(), basename); if (fileExists(filename)) return filename; + + free(filename); + + /* check if there is special artwork configured in level series config */ + if (getLevelArtworkSet(ARTWORK_TYPE_GRAPHICS) != NULL) + { + /* 3rd try: look for special artwork configured in level series config */ + filename = getPath2(getLevelArtworkDir(ARTWORK_TYPE_GRAPHICS), basename); + if (fileExists(filename)) + return filename; + + free(filename); + + /* take missing artwork configured in level set config from default */ + skip_setup_artwork = TRUE; + } } - return NULL; + if (!skip_setup_artwork) + { + /* 4th try: look for special artwork in configured artwork directory */ + filename = getPath2(getSetupArtworkDir(artwork.gfx_current), basename); + if (fileExists(filename)) + return filename; + + free(filename); + } + + /* 5th try: look for default artwork in new default artwork directory */ + filename = getPath2(getDefaultGraphicsDir(GFX_CLASSIC_SUBDIR), basename); + if (fileExists(filename)) + return filename; + + free(filename); + + /* 6th try: look for default artwork in old default artwork directory */ + filename = getPath2(options.graphics_directory, basename); + if (fileExists(filename)) + return filename; + + return NULL; /* cannot find specified artwork file anywhere */ } static char *getCorrectedArtworkBasename(char *basename) @@ -614,6 +661,21 @@ char *getCustomImageFilename(char *basename) if (fileExists(filename)) return filename; +#if CREATE_SPECIAL_EDITION + free(filename); + + /* !!! INSERT WARNING HERE TO REPORT MISSING ARTWORK FILES !!! */ +#if 0 + printf("::: MISSING ARTWORK FILE '%s'\n", basename); +#endif + + /* 6th try: look for fallback artwork in old default artwork directory */ + /* (needed to prevent errors when trying to access unused artwork files) */ + filename = getPath2(options.graphics_directory, GFX_FALLBACK_FILENAME); + if (fileExists(filename)) + return filename; +#endif + return NULL; /* cannot find specified artwork file anywhere */ } @@ -672,6 +734,16 @@ char *getCustomSoundFilename(char *basename) if (fileExists(filename)) return filename; +#if CREATE_SPECIAL_EDITION + free(filename); + + /* 6th try: look for fallback artwork in old default artwork directory */ + /* (needed to prevent errors when trying to access unused artwork files) */ + filename = getPath2(options.sounds_directory, SND_FALLBACK_FILENAME); + if (fileExists(filename)) + return filename; +#endif + return NULL; /* cannot find specified artwork file anywhere */ } @@ -730,6 +802,16 @@ char *getCustomMusicFilename(char *basename) if (fileExists(filename)) return filename; +#if CREATE_SPECIAL_EDITION + free(filename); + + /* 6th try: look for fallback artwork in old default artwork directory */ + /* (needed to prevent errors when trying to access unused artwork files) */ + filename = getPath2(options.music_directory, MUS_FALLBACK_FILENAME); + if (fileExists(filename)) + return filename; +#endif + return NULL; /* cannot find specified artwork file anywhere */ } @@ -1619,25 +1701,372 @@ static void printSetupFileHash(SetupFileHash *hash) } #endif -static void *loadSetupFileData(char *filename, boolean use_hash) +#define ALLOW_TOKEN_VALUE_SEPARATOR_BEING_WHITESPACE 1 +#define CHECK_TOKEN_VALUE_SEPARATOR__WARN_IF_MISSING 0 +#define CHECK_TOKEN__WARN_IF_ALREADY_EXISTS_IN_HASH 0 + +static boolean token_value_separator_found = FALSE; +#if CHECK_TOKEN_VALUE_SEPARATOR__WARN_IF_MISSING +static boolean token_value_separator_warning = FALSE; +#endif +#if CHECK_TOKEN__WARN_IF_ALREADY_EXISTS_IN_HASH +static boolean token_already_exists_warning = FALSE; +#endif + +static boolean getTokenValueFromSetupLineExt(char *line, + char **token_ptr, char **value_ptr, + char *filename, char *line_raw, + int line_nr, + boolean separator_required) +{ + static char line_copy[MAX_LINE_LEN + 1], line_raw_copy[MAX_LINE_LEN + 1]; + char *token, *value, *line_ptr; + + /* when externally invoked via ReadTokenValueFromLine(), copy line buffers */ + if (line_raw == NULL) + { + strncpy(line_copy, line, MAX_LINE_LEN); + line_copy[MAX_LINE_LEN] = '\0'; + line = line_copy; + + strcpy(line_raw_copy, line_copy); + line_raw = line_raw_copy; + } + + /* cut trailing comment from input line */ + for (line_ptr = line; *line_ptr; line_ptr++) + { + if (*line_ptr == '#') + { + *line_ptr = '\0'; + break; + } + } + + /* cut trailing whitespaces from input line */ + for (line_ptr = &line[strlen(line)]; line_ptr >= line; line_ptr--) + if ((*line_ptr == ' ' || *line_ptr == '\t') && *(line_ptr + 1) == '\0') + *line_ptr = '\0'; + + /* ignore empty lines */ + if (*line == '\0') + return FALSE; + + /* cut leading whitespaces from token */ + for (token = line; *token; token++) + if (*token != ' ' && *token != '\t') + break; + + /* start with empty value as reliable default */ + value = ""; + + token_value_separator_found = FALSE; + + /* find end of token to determine start of value */ + for (line_ptr = token; *line_ptr; line_ptr++) + { +#if 1 + /* first look for an explicit token/value separator, like ':' or '=' */ + if (*line_ptr == ':' || *line_ptr == '=') +#else + if (*line_ptr == ' ' || *line_ptr == '\t' || *line_ptr == ':') +#endif + { + *line_ptr = '\0'; /* terminate token string */ + value = line_ptr + 1; /* set beginning of value */ + + token_value_separator_found = TRUE; + + break; + } + } + +#if ALLOW_TOKEN_VALUE_SEPARATOR_BEING_WHITESPACE + /* fallback: if no token/value separator found, also allow whitespaces */ + if (!token_value_separator_found && !separator_required) + { + for (line_ptr = token; *line_ptr; line_ptr++) + { + if (*line_ptr == ' ' || *line_ptr == '\t') + { + *line_ptr = '\0'; /* terminate token string */ + value = line_ptr + 1; /* set beginning of value */ + + token_value_separator_found = TRUE; + + break; + } + } + +#if CHECK_TOKEN_VALUE_SEPARATOR__WARN_IF_MISSING + if (token_value_separator_found) + { + if (!token_value_separator_warning) + { + Error(ERR_INFO_LINE, "-"); + + if (filename != NULL) + { + Error(ERR_WARN, "missing token/value separator(s) in config file:"); + Error(ERR_INFO, "- config file: '%s'", filename); + } + else + { + Error(ERR_WARN, "missing token/value separator(s):"); + } + + token_value_separator_warning = TRUE; + } + + if (filename != NULL) + Error(ERR_INFO, "- line %d: '%s'", line_nr, line_raw); + else + Error(ERR_INFO, "- line: '%s'", line_raw); + } +#endif + } +#endif + + /* cut trailing whitespaces from token */ + for (line_ptr = &token[strlen(token)]; line_ptr >= token; line_ptr--) + if ((*line_ptr == ' ' || *line_ptr == '\t') && *(line_ptr + 1) == '\0') + *line_ptr = '\0'; + + /* cut leading whitespaces from value */ + for (; *value; value++) + if (*value != ' ' && *value != '\t') + break; + +#if 0 + if (*value == '\0') + value = "true"; /* treat tokens without value as "true" */ +#endif + + *token_ptr = token; + *value_ptr = value; + + return TRUE; +} + +boolean getTokenValueFromSetupLine(char *line, char **token, char **value) { - char line[MAX_LINE_LEN], previous_line[MAX_LINE_LEN]; + /* while the internal (old) interface does not require a token/value + separator (for downwards compatibility with existing files which + don't use them), it is mandatory for the external (new) interface */ + + return getTokenValueFromSetupLineExt(line, token, value, NULL, NULL, 0, TRUE); +} + +#if 1 +static boolean loadSetupFileData(void *setup_file_data, char *filename, + boolean top_recursion_level, boolean is_hash) +{ + static SetupFileHash *include_filename_hash = NULL; + char line[MAX_LINE_LEN], line_raw[MAX_LINE_LEN], previous_line[MAX_LINE_LEN]; char *token, *value, *line_ptr; - void *setup_file_data, *insert_ptr = NULL; + void *insert_ptr = NULL; boolean read_continued_line = FALSE; FILE *file; + int line_nr = 0, token_count = 0, include_count = 0; + +#if CHECK_TOKEN_VALUE_SEPARATOR__WARN_IF_MISSING + token_value_separator_warning = FALSE; +#endif + +#if CHECK_TOKEN__WARN_IF_ALREADY_EXISTS_IN_HASH + token_already_exists_warning = FALSE; +#endif if (!(file = fopen(filename, MODE_READ))) { Error(ERR_WARN, "cannot open configuration file '%s'", filename); - return NULL; + return FALSE; } - if (use_hash) - setup_file_data = newSetupFileHash(); - else - insert_ptr = setup_file_data = newSetupFileList("", ""); + /* use "insert pointer" to store list end for constant insertion complexity */ + if (!is_hash) + insert_ptr = setup_file_data; + + /* on top invocation, create hash to mark included files (to prevent loops) */ + if (top_recursion_level) + include_filename_hash = newSetupFileHash(); + + /* mark this file as already included (to prevent including it again) */ + setHashEntry(include_filename_hash, getBaseNamePtr(filename), "true"); + + while (!feof(file)) + { + /* read next line of input file */ + if (!fgets(line, MAX_LINE_LEN, file)) + break; + + /* check if line was completely read and is terminated by line break */ + if (strlen(line) > 0 && line[strlen(line) - 1] == '\n') + line_nr++; + + /* cut trailing line break (this can be newline and/or carriage return) */ + for (line_ptr = &line[strlen(line)]; line_ptr >= line; line_ptr--) + if ((*line_ptr == '\n' || *line_ptr == '\r') && *(line_ptr + 1) == '\0') + *line_ptr = '\0'; + + /* copy raw input line for later use (mainly debugging output) */ + strcpy(line_raw, line); + + if (read_continued_line) + { +#if 0 + /* !!! ??? WHY ??? !!! */ + /* cut leading whitespaces from input line */ + for (line_ptr = line; *line_ptr; line_ptr++) + if (*line_ptr != ' ' && *line_ptr != '\t') + break; +#endif + + /* append new line to existing line, if there is enough space */ + if (strlen(previous_line) + strlen(line_ptr) < MAX_LINE_LEN) + strcat(previous_line, line_ptr); + + strcpy(line, previous_line); /* copy storage buffer to line */ + + read_continued_line = FALSE; + } + + /* if the last character is '\', continue at next line */ + if (strlen(line) > 0 && line[strlen(line) - 1] == '\\') + { + line[strlen(line) - 1] = '\0'; /* cut off trailing backslash */ + strcpy(previous_line, line); /* copy line to storage buffer */ + + read_continued_line = TRUE; + + continue; + } + + if (!getTokenValueFromSetupLineExt(line, &token, &value, filename, + line_raw, line_nr, FALSE)) + continue; + + if (*token) + { + if (strEqual(token, "include")) + { + if (getHashEntry(include_filename_hash, value) == NULL) + { + char *basepath = getBasePath(filename); + char *basename = getBaseName(value); + char *filename_include = getPath2(basepath, basename); + +#if 0 + Error(ERR_INFO, "[including file '%s']", filename_include); +#endif + + loadSetupFileData(setup_file_data, filename_include, FALSE, is_hash); + + free(basepath); + free(basename); + free(filename_include); + + include_count++; + } + else + { + Error(ERR_WARN, "ignoring already processed file '%s'", value); + } + } + else + { + if (is_hash) + { +#if CHECK_TOKEN__WARN_IF_ALREADY_EXISTS_IN_HASH + char *old_value = + getHashEntry((SetupFileHash *)setup_file_data, token); + + if (old_value != NULL) + { + if (!token_already_exists_warning) + { + Error(ERR_INFO_LINE, "-"); + Error(ERR_WARN, "duplicate token(s) found in config file:"); + Error(ERR_INFO, "- config file: '%s'", filename); + + token_already_exists_warning = TRUE; + } + + Error(ERR_INFO, "- token: '%s' (in line %d)", token, line_nr); + Error(ERR_INFO, " old value: '%s'", old_value); + Error(ERR_INFO, " new value: '%s'", value); + } +#endif + + setHashEntry((SetupFileHash *)setup_file_data, token, value); + } + else + { + insert_ptr = addListEntry((SetupFileList *)insert_ptr, token, value); + } + + token_count++; + } + } + } + + fclose(file); + +#if CHECK_TOKEN_VALUE_SEPARATOR__WARN_IF_MISSING + if (token_value_separator_warning) + Error(ERR_INFO_LINE, "-"); +#endif + +#if CHECK_TOKEN__WARN_IF_ALREADY_EXISTS_IN_HASH + if (token_already_exists_warning) + Error(ERR_INFO_LINE, "-"); +#endif + + if (token_count == 0 && include_count == 0) + Error(ERR_WARN, "configuration file '%s' is empty", filename); + + if (top_recursion_level) + freeSetupFileHash(include_filename_hash); + + return TRUE; +} + +#else + +static boolean loadSetupFileData(void *setup_file_data, char *filename, + boolean top_recursion_level, boolean is_hash) +{ + static SetupFileHash *include_filename_hash = NULL; + char line[MAX_LINE_LEN], line_raw[MAX_LINE_LEN], previous_line[MAX_LINE_LEN]; + char *token, *value, *line_ptr; + void *insert_ptr = NULL; + boolean read_continued_line = FALSE; + FILE *file; + int line_nr = 0; + int token_count = 0; + +#if CHECK_TOKEN_VALUE_SEPARATOR__WARN_IF_MISSING + token_value_separator_warning = FALSE; +#endif + + if (!(file = fopen(filename, MODE_READ))) + { + Error(ERR_WARN, "cannot open configuration file '%s'", filename); + + return FALSE; + } + + /* use "insert pointer" to store list end for constant insertion complexity */ + if (!is_hash) + insert_ptr = setup_file_data; + + /* on top invocation, create hash to mark included files (to prevent loops) */ + if (top_recursion_level) + include_filename_hash = newSetupFileHash(); + + /* mark this file as already included (to prevent including it again) */ + setHashEntry(include_filename_hash, getBaseNamePtr(filename), "true"); while (!feof(file)) { @@ -1645,11 +2074,18 @@ static void *loadSetupFileData(char *filename, boolean use_hash) if (!fgets(line, MAX_LINE_LEN, file)) break; - /* cut trailing newline or carriage return */ + /* check if line was completely read and is terminated by line break */ + if (strlen(line) > 0 && line[strlen(line) - 1] == '\n') + line_nr++; + + /* cut trailing line break (this can be newline and/or carriage return) */ for (line_ptr = &line[strlen(line)]; line_ptr >= line; line_ptr--) if ((*line_ptr == '\n' || *line_ptr == '\r') && *(line_ptr + 1) == '\0') *line_ptr = '\0'; + /* copy raw input line for later use (mainly debugging output) */ + strcpy(line_raw, line); + if (read_continued_line) { /* cut leading whitespaces from input line */ @@ -1704,10 +2140,13 @@ static void *loadSetupFileData(char *filename, boolean use_hash) /* start with empty value as reliable default */ value = ""; + token_value_separator_found = FALSE; + /* find end of token to determine start of value */ for (line_ptr = token; *line_ptr; line_ptr++) { #if 1 + /* first look for an explicit token/value separator, like ':' or '=' */ if (*line_ptr == ':' || *line_ptr == '=') #else if (*line_ptr == ' ' || *line_ptr == '\t' || *line_ptr == ':') @@ -1716,10 +2155,47 @@ static void *loadSetupFileData(char *filename, boolean use_hash) *line_ptr = '\0'; /* terminate token string */ value = line_ptr + 1; /* set beginning of value */ + token_value_separator_found = TRUE; + break; } } +#if ALLOW_TOKEN_VALUE_SEPARATOR_BEING_WHITESPACE + /* fallback: if no token/value separator found, also allow whitespaces */ + if (!token_value_separator_found) + { + for (line_ptr = token; *line_ptr; line_ptr++) + { + if (*line_ptr == ' ' || *line_ptr == '\t') + { + *line_ptr = '\0'; /* terminate token string */ + value = line_ptr + 1; /* set beginning of value */ + + token_value_separator_found = TRUE; + + break; + } + } + +#if CHECK_TOKEN_VALUE_SEPARATOR__WARN_IF_MISSING + if (token_value_separator_found) + { + if (!token_value_separator_warning) + { + Error(ERR_INFO_LINE, "-"); + Error(ERR_WARN, "missing token/value separator(s) in config file:"); + Error(ERR_INFO, "- config file: '%s'", filename); + + token_value_separator_warning = TRUE; + } + + Error(ERR_INFO, "- line %d: '%s'", line_nr, line_raw); + } +#endif + } +#endif + /* cut trailing whitespaces from token */ for (line_ptr = &token[strlen(token)]; line_ptr >= token; line_ptr--) if ((*line_ptr == ' ' || *line_ptr == '\t') && *(line_ptr + 1) == '\0') @@ -1737,36 +2213,57 @@ static void *loadSetupFileData(char *filename, boolean use_hash) if (*token) { - if (use_hash) - setHashEntry((SetupFileHash *)setup_file_data, token, value); + if (strEqual(token, "include")) + { + if (getHashEntry(include_filename_hash, value) == NULL) + { + char *basepath = getBasePath(filename); + char *basename = getBaseName(value); + char *filename_include = getPath2(basepath, basename); + +#if 0 + Error(ERR_INFO, "[including file '%s']", filename_include); +#endif + + loadSetupFileData(setup_file_data, filename_include, FALSE, is_hash); + + free(basepath); + free(basename); + free(filename_include); + } + else + { + Error(ERR_WARN, "ignoring already processed file '%s'", value); + } + } else - insert_ptr = addListEntry((SetupFileList *)insert_ptr, token, value); + { + if (is_hash) + setHashEntry((SetupFileHash *)setup_file_data, token, value); + else + insert_ptr = addListEntry((SetupFileList *)insert_ptr, token, value); + + token_count++; + } } } fclose(file); - if (use_hash) - { - if (hashtable_count((SetupFileHash *)setup_file_data) == 0) - Error(ERR_WARN, "configuration file '%s' is empty", filename); - } - else - { - SetupFileList *setup_file_list = (SetupFileList *)setup_file_data; - SetupFileList *first_valid_list_entry = setup_file_list->next; +#if CHECK_TOKEN_VALUE_SEPARATOR__WARN_IF_MISSING + if (token_value_separator_warning) + Error(ERR_INFO_LINE, "-"); +#endif - /* free empty list header */ - setup_file_list->next = NULL; - freeSetupFileList(setup_file_list); - setup_file_data = first_valid_list_entry; + if (token_count == 0) + Error(ERR_WARN, "configuration file '%s' is empty", filename); - if (first_valid_list_entry == NULL) - Error(ERR_WARN, "configuration file '%s' is empty", filename); - } + if (top_recursion_level) + freeSetupFileHash(include_filename_hash); - return setup_file_data; + return TRUE; } +#endif void saveSetupFileHash(SetupFileHash *hash, char *filename) { @@ -1791,12 +2288,37 @@ void saveSetupFileHash(SetupFileHash *hash, char *filename) SetupFileList *loadSetupFileList(char *filename) { - return (SetupFileList *)loadSetupFileData(filename, FALSE); + SetupFileList *setup_file_list = newSetupFileList("", ""); + SetupFileList *first_valid_list_entry; + + if (!loadSetupFileData(setup_file_list, filename, TRUE, FALSE)) + { + freeSetupFileList(setup_file_list); + + return NULL; + } + + first_valid_list_entry = setup_file_list->next; + + /* free empty list header */ + setup_file_list->next = NULL; + freeSetupFileList(setup_file_list); + + return first_valid_list_entry; } SetupFileHash *loadSetupFileHash(char *filename) { - return (SetupFileHash *)loadSetupFileData(filename, TRUE); + SetupFileHash *setup_file_hash = newSetupFileHash(); + + if (!loadSetupFileData(setup_file_hash, filename, TRUE, TRUE)) + { + freeSetupFileHash(setup_file_hash); + + return NULL; + } + + return setup_file_hash; } void checkSetupFileHashIdentifier(SetupFileHash *setup_file_hash, @@ -1824,25 +2346,27 @@ void checkSetupFileHashIdentifier(SetupFileHash *setup_file_hash, #define LEVELINFO_TOKEN_NAME 1 #define LEVELINFO_TOKEN_NAME_SORTING 2 #define LEVELINFO_TOKEN_AUTHOR 3 -#define LEVELINFO_TOKEN_IMPORTED_FROM 4 -#define LEVELINFO_TOKEN_IMPORTED_BY 5 -#define LEVELINFO_TOKEN_LEVELS 6 -#define LEVELINFO_TOKEN_FIRST_LEVEL 7 -#define LEVELINFO_TOKEN_SORT_PRIORITY 8 -#define LEVELINFO_TOKEN_LATEST_ENGINE 9 -#define LEVELINFO_TOKEN_LEVEL_GROUP 10 -#define LEVELINFO_TOKEN_READONLY 11 -#define LEVELINFO_TOKEN_GRAPHICS_SET_ECS 12 -#define LEVELINFO_TOKEN_GRAPHICS_SET_AGA 13 -#define LEVELINFO_TOKEN_GRAPHICS_SET 14 -#define LEVELINFO_TOKEN_SOUNDS_SET 15 -#define LEVELINFO_TOKEN_MUSIC_SET 16 -#define LEVELINFO_TOKEN_FILENAME 17 -#define LEVELINFO_TOKEN_FILETYPE 18 -#define LEVELINFO_TOKEN_HANDICAP 19 -#define LEVELINFO_TOKEN_SKIP_LEVELS 20 - -#define NUM_LEVELINFO_TOKENS 21 +#define LEVELINFO_TOKEN_YEAR 4 +#define LEVELINFO_TOKEN_IMPORTED_FROM 5 +#define LEVELINFO_TOKEN_IMPORTED_BY 6 +#define LEVELINFO_TOKEN_TESTED_BY 7 +#define LEVELINFO_TOKEN_LEVELS 8 +#define LEVELINFO_TOKEN_FIRST_LEVEL 9 +#define LEVELINFO_TOKEN_SORT_PRIORITY 10 +#define LEVELINFO_TOKEN_LATEST_ENGINE 11 +#define LEVELINFO_TOKEN_LEVEL_GROUP 12 +#define LEVELINFO_TOKEN_READONLY 13 +#define LEVELINFO_TOKEN_GRAPHICS_SET_ECS 14 +#define LEVELINFO_TOKEN_GRAPHICS_SET_AGA 15 +#define LEVELINFO_TOKEN_GRAPHICS_SET 16 +#define LEVELINFO_TOKEN_SOUNDS_SET 17 +#define LEVELINFO_TOKEN_MUSIC_SET 18 +#define LEVELINFO_TOKEN_FILENAME 19 +#define LEVELINFO_TOKEN_FILETYPE 20 +#define LEVELINFO_TOKEN_HANDICAP 21 +#define LEVELINFO_TOKEN_SKIP_LEVELS 22 + +#define NUM_LEVELINFO_TOKENS 23 static LevelDirTree ldi; @@ -1853,8 +2377,10 @@ static struct TokenInfo levelinfo_tokens[] = { TYPE_STRING, &ldi.name, "name" }, { TYPE_STRING, &ldi.name_sorting, "name_sorting" }, { TYPE_STRING, &ldi.author, "author" }, + { TYPE_STRING, &ldi.year, "year" }, { TYPE_STRING, &ldi.imported_from, "imported_from" }, { TYPE_STRING, &ldi.imported_by, "imported_by" }, + { TYPE_STRING, &ldi.tested_by, "tested_by" }, { TYPE_INTEGER, &ldi.levels, "levels" }, { TYPE_INTEGER, &ldi.first_level, "first_level" }, { TYPE_INTEGER, &ldi.sort_priority, "sort_priority" }, @@ -1914,6 +2440,7 @@ static void setTreeInfoToDefaults(TreeInfo *ti, int type) ti->name = getStringCopy(ANONYMOUS_NAME); ti->name_sorting = NULL; ti->author = getStringCopy(ANONYMOUS_NAME); + ti->year = NULL; ti->sort_priority = LEVELCLASS_UNDEFINED; /* default: least priority */ ti->latest_engine = FALSE; /* default: get from level */ @@ -1929,6 +2456,7 @@ static void setTreeInfoToDefaults(TreeInfo *ti, int type) { ti->imported_from = NULL; ti->imported_by = NULL; + ti->tested_by = NULL; ti->graphics_set_ecs = NULL; ti->graphics_set_aga = NULL; @@ -1983,6 +2511,7 @@ static void setTreeInfoToDefaultsFromParent(TreeInfo *ti, TreeInfo *parent) ti->name = getStringCopy(ANONYMOUS_NAME); ti->name_sorting = NULL; ti->author = getStringCopy(parent->author); + ti->year = getStringCopy(parent->year); ti->sort_priority = parent->sort_priority; ti->latest_engine = parent->latest_engine; @@ -1998,6 +2527,7 @@ static void setTreeInfoToDefaultsFromParent(TreeInfo *ti, TreeInfo *parent) { ti->imported_from = getStringCopy(parent->imported_from); ti->imported_by = getStringCopy(parent->imported_by); + ti->tested_by = getStringCopy(parent->tested_by); ti->graphics_set_ecs = NULL; ti->graphics_set_aga = NULL; @@ -2045,8 +2575,10 @@ static TreeInfo *getTreeInfoCopy(TreeInfo *ti) ti_copy->name = getStringCopy(ti->name); ti_copy->name_sorting = getStringCopy(ti->name_sorting); ti_copy->author = getStringCopy(ti->author); + ti_copy->year = getStringCopy(ti->year); ti_copy->imported_from = getStringCopy(ti->imported_from); ti_copy->imported_by = getStringCopy(ti->imported_by); + ti_copy->tested_by = getStringCopy(ti->tested_by); ti_copy->graphics_set_ecs = getStringCopy(ti->graphics_set_ecs); ti_copy->graphics_set_aga = getStringCopy(ti->graphics_set_aga); @@ -2097,6 +2629,7 @@ static void freeTreeInfo(TreeInfo *ti) checked_free(ti->name); checked_free(ti->name_sorting); checked_free(ti->author); + checked_free(ti->year); checked_free(ti->class_desc); @@ -2106,6 +2639,7 @@ static void freeTreeInfo(TreeInfo *ti) { checked_free(ti->imported_from); checked_free(ti->imported_by); + checked_free(ti->tested_by); checked_free(ti->graphics_set_ecs); checked_free(ti->graphics_set_aga); @@ -2346,12 +2880,13 @@ static TreeInfo *getArtworkInfoCacheEntry(LevelDirTree *level_node, int type) if (value == NULL) { #if 1 - printf("::: - WARNING: cache entry '%s' invalid\n", token); + Error(ERR_WARN, "cache entry '%s' invalid", token); #endif cached = FALSE; } } + *artwork_info = ldi; } @@ -2452,6 +2987,10 @@ static boolean LoadLevelInfoFromLevelConf(TreeInfo **node_first, char *level_directory, char *directory_name) { +#if 0 + static unsigned long progress_delay = 0; + unsigned long progress_delay_value = 100; /* (in milliseconds) */ +#endif char *directory_path = getPath2(level_directory, directory_name); char *filename = getPath2(directory_path, LEVELINFO_FILENAME); SetupFileHash *setup_file_hash; @@ -2552,8 +3091,14 @@ static boolean LoadLevelInfoFromLevelConf(TreeInfo **node_first, leveldir_new->last_level : leveldir_new->first_level); #if 1 - if (leveldir_new->level_group) +#if 1 + DrawInitTextExt(leveldir_new->name, 150, FC_YELLOW, + leveldir_new->level_group); +#else + if (leveldir_new->level_group || + DelayReached(&progress_delay, progress_delay_value)) DrawInitText(leveldir_new->name, 150, FC_YELLOW); +#endif #else DrawInitText(leveldir_new->name, 150, FC_YELLOW); #endif @@ -3000,6 +3545,10 @@ void LoadArtworkInfo() void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node, LevelDirTree *level_node) { +#if 0 + static unsigned long progress_delay = 0; + unsigned long progress_delay_value = 100; /* (in milliseconds) */ +#endif int type = (*artwork_node)->type; /* recursively check all level directories for artwork sub-directories */ @@ -3045,7 +3594,11 @@ void LoadArtworkInfoFromLevelInfo(ArtworkDirTree **artwork_node, } #if 1 - if (level_node->level_group) + DrawInitTextExt(level_node->name, 150, FC_YELLOW, + level_node->level_group); +#else + if (level_node->level_group || + DelayReached(&progress_delay, progress_delay_value)) DrawInitText(level_node->name, 150, FC_YELLOW); #endif diff --git a/src/libgame/setup.h b/src/libgame/setup.h index 6dc15e9c..02a815ab 100644 --- a/src/libgame/setup.h +++ b/src/libgame/setup.h @@ -27,24 +27,24 @@ #define TYPE_KEY_X11 (1 << 5) #define TYPE_INTEGER (1 << 6) #define TYPE_STRING (1 << 7) -#define TYPE_TOKEN (1 << 8) +#define TYPE_ELEMENT (1 << 8) +#define TYPE_GRAPHIC (1 << 9) /* additional values for setup screen */ -#define TYPE_ENTER_SCREEN (1 << 9) -#define TYPE_LEAVE_SCREEN (1 << 10) -#define TYPE_ENTER_MENU (1 << 11) -#define TYPE_LEAVE_MENU (1 << 12) -#define TYPE_ENTER_LIST (1 << 13) -#define TYPE_LEAVE_LIST (1 << 14) -#define TYPE_EMPTY (1 << 15) -#define TYPE_KEYTEXT (1 << 16) - -#define TYPE_GHOSTED (1 << 17) -#define TYPE_QUERY (1 << 18) +#define TYPE_ENTER_SCREEN (1 << 10) +#define TYPE_LEAVE_SCREEN (1 << 11) +#define TYPE_ENTER_MENU (1 << 12) +#define TYPE_LEAVE_MENU (1 << 13) +#define TYPE_ENTER_LIST (1 << 14) +#define TYPE_LEAVE_LIST (1 << 15) +#define TYPE_EMPTY (1 << 16) +#define TYPE_KEYTEXT (1 << 17) + +#define TYPE_GHOSTED (1 << 18) +#define TYPE_QUERY (1 << 19) /* additional values for internal purposes */ -#define TYPE_BITFIELD (1 << 19) -#define TYPE_ELEMENT (1 << 20) +#define TYPE_BITFIELD (1 << 20) #define TYPE_CONTENT (1 << 21) #define TYPE_ELEMENT_LIST (1 << 22) #define TYPE_CONTENT_LIST (1 << 23) @@ -61,7 +61,8 @@ TYPE_KEY_X11 | \ TYPE_INTEGER | \ TYPE_STRING | \ - TYPE_TOKEN) + TYPE_ELEMENT | \ + TYPE_GRAPHIC) #define TYPE_SKIP_ENTRY (TYPE_EMPTY | \ TYPE_KEY | \ @@ -230,7 +231,7 @@ char *getEditorSetupFilename(void); char *getHelpAnimFilename(void); char *getHelpTextFilename(void); char *getLevelSetInfoFilename(void); -char *getLevelSetMessageFilename(void); +char *getLevelSetTitleMessageFilename(int, boolean); char *getImageFilename(char *); char *getCustomImageFilename(char *); char *getCustomSoundFilename(char *); @@ -281,6 +282,8 @@ boolean checkCookieString(const char *, const char *); char *getFormattedSetupEntry(char *, char *); +boolean getTokenValueFromSetupLine(char *, char **, char **); + SetupFileList *newSetupFileList(char *, char *); void freeSetupFileList(SetupFileList *); char *getListEntry(SetupFileList *, char *); diff --git a/src/libgame/sound.c b/src/libgame/sound.c index a01ce29d..b80cccab 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -483,7 +483,7 @@ static void WriteReloadInfoToPipe(char *set_identifier, int type) if (leveldir_current == NULL) /* should never happen */ Error(ERR_EXIT, "leveldir_current == NULL"); - memset(&snd_ctrl, 0, sizeof(SoundControl)); /* to make valgrind happy */ + clear_mem(&snd_ctrl, sizeof(SoundControl)); /* to make valgrind happy */ snd_ctrl.active = FALSE; snd_ctrl.state = type; @@ -913,8 +913,8 @@ static void Mixer_InsertSound(SoundControl snd_ctrl) { if (!mixer[i].active) { - Error(ERR_RETURN, "Mixer_InsertSound: Channel %d inactive", i); - Error(ERR_RETURN, "Mixer_InsertSound: This should never happen!"); + Error(ERR_INFO, "Mixer_InsertSound: Channel %d inactive", i); + Error(ERR_INFO, "Mixer_InsertSound: This should never happen!"); mixer_active_channels--; } @@ -933,7 +933,7 @@ static void Mixer_InsertSound(SoundControl snd_ctrl) /* print some debugging information about audio channel usage */ for (i = audio.first_sound_channel; i < audio.num_channels; i++) { - Error(ERR_RETURN, "Mixer_InsertSound: %d [%d]: %ld (%ld)", + Error(ERR_INFO, "Mixer_InsertSound: %d [%d]: %ld (%ld)", i, mixer[i].active, mixer[i].data_len, (long)mixer[i].data_ptr); } #endif @@ -1147,8 +1147,8 @@ static void Mixer_Main_DSP() max_sample_size = fragment_size / (num_output_channels * sample_bytes); /* first clear the last premixing buffer */ - memset(premix_last_buffer, 0, - max_sample_size * num_output_channels * sizeof(long)); + clear_mem(premix_last_buffer, + max_sample_size * num_output_channels * sizeof(long)); for (i = 0; i < audio.num_channels; i++) { @@ -1559,6 +1559,8 @@ static void *Load_WAV(char *filename) #else /* AUDIO_UNIX_NATIVE */ + clear_mem(&header, sizeof(struct SoundHeader_WAV)); /* to make gcc happy */ + if ((file = fopen(filename, MODE_READ)) == NULL) { Error(ERR_WARN, "cannot open sound file '%s'", filename); @@ -2110,7 +2112,7 @@ void PlaySoundExt(int nr, int volume, int stereo_position, int state) else if (stereo_position > SOUND_MAX_RIGHT) stereo_position = SOUND_MAX_RIGHT; - memset(&snd_ctrl, 0, sizeof(SoundControl)); /* to make valgrind happy */ + clear_mem(&snd_ctrl, sizeof(SoundControl)); /* to make valgrind happy */ snd_ctrl.active = TRUE; snd_ctrl.nr = nr; @@ -2171,7 +2173,7 @@ void StopSoundExt(int nr, int state) if (!audio.sound_available) return; - memset(&snd_ctrl, 0, sizeof(SoundControl)); /* to make valgrind happy */ + clear_mem(&snd_ctrl, sizeof(SoundControl)); /* to make valgrind happy */ snd_ctrl.active = FALSE; snd_ctrl.nr = nr; diff --git a/src/libgame/system.c b/src/libgame/system.c index 7d0099f4..9ed186f1 100644 --- a/src/libgame/system.c +++ b/src/libgame/system.c @@ -196,6 +196,11 @@ void InitGfxScrollbufferInfo(int scrollbuffer_width, int scrollbuffer_height) gfx.scrollbuffer_height = scrollbuffer_height; } +void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void)) +{ + gfx.draw_busy_anim_function = draw_busy_anim_function; +} + void SetDrawDeactivationMask(int draw_deactivation_mask) { gfx.draw_deactivation_mask = draw_deactivation_mask; @@ -262,17 +267,24 @@ void SetBackgroundBitmap(Bitmap *background_bitmap_tile, int mask) void SetWindowBackgroundBitmap(Bitmap *background_bitmap_tile) { + /* remove every mask before setting mask for window */ + /* (!!! TO BE FIXED: The whole REDRAW_* system really sucks! !!!) */ + SetBackgroundBitmap(NULL, 0xffff); /* !!! FIX THIS !!! */ SetBackgroundBitmap(background_bitmap_tile, REDRAW_ALL); } void SetMainBackgroundBitmap(Bitmap *background_bitmap_tile) { + /* remove window area mask before setting mask for main area */ + /* (!!! TO BE FIXED: The whole REDRAW_* system really sucks! !!!) */ SetBackgroundBitmap(NULL, REDRAW_ALL); /* !!! FIX THIS !!! */ SetBackgroundBitmap(background_bitmap_tile, REDRAW_FIELD); } void SetDoorBackgroundBitmap(Bitmap *background_bitmap_tile) { + /* remove window area mask before setting mask for door area */ + /* (!!! TO BE FIXED: The whole REDRAW_* system really sucks! !!!) */ SetBackgroundBitmap(NULL, REDRAW_ALL); /* !!! FIX THIS !!! */ SetBackgroundBitmap(background_bitmap_tile, REDRAW_DOOR_1); } @@ -843,8 +855,19 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, boolean create_small_bitmaps) { Bitmap swap_bitmap; - Bitmap *new_bitmap, *tmp_bitmap_1, *tmp_bitmap_2, *tmp_bitmap_4,*tmp_bitmap_8; - int width_1, height_1, width_2, height_2, width_4, height_4, width_8,height_8; + Bitmap *new_bitmap; + Bitmap *tmp_bitmap_1; + Bitmap *tmp_bitmap_2; + Bitmap *tmp_bitmap_4; + Bitmap *tmp_bitmap_8; + Bitmap *tmp_bitmap_16; + Bitmap *tmp_bitmap_32; + int width_1, height_1; + int width_2, height_2; + int width_4, height_4; + int width_8, height_8; + int width_16, height_16; + int width_32, height_32; int new_width, new_height; /* calculate new image dimensions for normal sized image */ @@ -858,7 +881,11 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, tmp_bitmap_1 = old_bitmap; /* this is only needed to make compilers happy */ - tmp_bitmap_2 = tmp_bitmap_4 = tmp_bitmap_8 = NULL; + tmp_bitmap_2 = NULL; + tmp_bitmap_4 = NULL; + tmp_bitmap_8 = NULL; + tmp_bitmap_16 = NULL; + tmp_bitmap_32 = NULL; if (create_small_bitmaps) { @@ -869,6 +896,12 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, height_4 = height_1 / 4; width_8 = width_1 / 8; height_8 = height_1 / 8; + width_16 = width_1 / 16; + height_16 = height_1 / 16; + width_32 = width_1 / 32; + height_32 = height_1 / 32; + + UPDATE_BUSY_STATE(); /* get image with 1/2 of normal size (for use in the level editor) */ if (zoom_factor != 2) @@ -876,19 +909,42 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, else tmp_bitmap_2 = old_bitmap; + UPDATE_BUSY_STATE(); + /* get image with 1/4 of normal size (for use in the level editor) */ if (zoom_factor != 4) tmp_bitmap_4 = ZoomBitmap(tmp_bitmap_2, width_2 / 2, height_2 / 2); else tmp_bitmap_4 = old_bitmap; + UPDATE_BUSY_STATE(); + /* get image with 1/8 of normal size (for use on the preview screen) */ if (zoom_factor != 8) tmp_bitmap_8 = ZoomBitmap(tmp_bitmap_4, width_4 / 2, height_4 / 2); else tmp_bitmap_8 = old_bitmap; + + UPDATE_BUSY_STATE(); + + /* get image with 1/16 of normal size (for use on the preview screen) */ + if (zoom_factor != 16) + tmp_bitmap_16 = ZoomBitmap(tmp_bitmap_8, width_8 / 2, height_8 / 2); + else + tmp_bitmap_16 = old_bitmap; + + UPDATE_BUSY_STATE(); + + /* get image with 1/32 of normal size (for use on the preview screen) */ + if (zoom_factor != 32) + tmp_bitmap_32 = ZoomBitmap(tmp_bitmap_16, width_16 / 2, height_16 / 2); + else + tmp_bitmap_32 = old_bitmap; + + UPDATE_BUSY_STATE(); } +#if 0 /* if image was scaled up, create new clipmask for normal size image */ if (zoom_factor != 1) { @@ -913,6 +969,7 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, SDL_SetColorKey(tmp_surface_1, 0, 0); /* reset transparent pixel */ #endif } +#endif if (create_small_bitmaps) { @@ -928,6 +985,12 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, width_1 / 2, height_1); BlitBitmap(tmp_bitmap_8, new_bitmap, 0, 0, width_1 / 8, height_1 / 8, 3 * width_1 / 4, height_1); + BlitBitmap(tmp_bitmap_16, new_bitmap, 0, 0, width_1 / 16, height_1 / 16, + 7 * width_1 / 8, height_1); + BlitBitmap(tmp_bitmap_32, new_bitmap, 0, 0, width_1 / 32, height_1 / 32, + 15 * width_1 / 16, height_1); + + UPDATE_BUSY_STATE(); } else { @@ -951,6 +1014,12 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, if (zoom_factor != 8) FreeBitmap(tmp_bitmap_8); + + if (zoom_factor != 16) + FreeBitmap(tmp_bitmap_16); + + if (zoom_factor != 32) + FreeBitmap(tmp_bitmap_32); } /* replace image with extended image (containing 1/1, 1/2, 1/4, 1/8 size) */ @@ -967,6 +1036,34 @@ static void CreateScaledBitmaps(Bitmap *old_bitmap, int zoom_factor, old_bitmap->width = new_bitmap->width; old_bitmap->height = new_bitmap->height; +#if 1 + /* this replaces all blit masks created when loading -- maybe optimize this */ + { +#if defined(TARGET_X11) + if (old_bitmap->clip_mask) + XFreePixmap(display, old_bitmap->clip_mask); + + old_bitmap->clip_mask = + Pixmap_to_Mask(old_bitmap->drawable, new_width, new_height); + + XSetClipMask(display, old_bitmap->stored_clip_gc, old_bitmap->clip_mask); +#else + SDL_Surface *old_surface = old_bitmap->surface; + + if (old_bitmap->surface_masked) + SDL_FreeSurface(old_bitmap->surface_masked); + + SDL_SetColorKey(old_surface, SDL_SRCCOLORKEY, + SDL_MapRGB(old_surface->format, 0x00, 0x00, 0x00)); + if ((old_bitmap->surface_masked = SDL_DisplayFormat(old_surface)) ==NULL) + Error(ERR_EXIT, "SDL_DisplayFormat() failed"); + SDL_SetColorKey(old_surface, 0, 0); /* reset transparent pixel */ +#endif + } +#endif + + UPDATE_BUSY_STATE(); + FreeBitmap(new_bitmap); /* this actually frees the _old_ bitmap now */ } @@ -986,8 +1083,9 @@ void ScaleBitmap(Bitmap *old_bitmap, int zoom_factor) /* ------------------------------------------------------------------------- */ #if !defined(PLATFORM_MSDOS) -/* XPM */ -static const char *cursor_image_playfield[] = +#define USE_ONE_PIXEL_PLAYFIELD_MOUSEPOINTER 0 +/* XPM image definitions */ +static const char *cursor_image_none[] = { /* width height num_colors chars_per_pixel */ " 16 16 3 1", @@ -997,10 +1095,6 @@ static const char *cursor_image_playfield[] = ". c #ffffff", " c None", -#if 1 - /* some people complained about a "white dot" on the screen and thought it - was a graphical error... OK, let's just remove the whole pointer :-) */ - /* pixels */ " ", " ", @@ -1021,8 +1115,17 @@ static const char *cursor_image_playfield[] = /* hot spot */ "0,0" +}; +#if USE_ONE_PIXEL_PLAYFIELD_MOUSEPOINTER +static const char *cursor_image_dot[] = +{ + /* width height num_colors chars_per_pixel */ + " 16 16 3 1", -#else + /* colors */ + "X c #000000", + ". c #ffffff", + " c None", /* pixels */ " X ", @@ -1044,8 +1147,13 @@ static const char *cursor_image_playfield[] = /* hot spot */ "1,1" -#endif }; +static const char **cursor_image_playfield = cursor_image_dot; +#else +/* some people complained about a "white dot" on the screen and thought it + was a graphical error... OK, let's just remove the whole pointer :-) */ +static const char **cursor_image_playfield = cursor_image_none; +#endif #if defined(TARGET_SDL) static const int cursor_bit_order = BIT_ORDER_MSB; @@ -1104,15 +1212,24 @@ static struct MouseCursorInfo *get_cursor_from_image(const char **image) void SetMouseCursor(int mode) { #if !defined(PLATFORM_MSDOS) + static struct MouseCursorInfo *cursor_none = NULL; static struct MouseCursorInfo *cursor_playfield = NULL; + struct MouseCursorInfo *cursor_new; + + if (cursor_none == NULL) + cursor_none = get_cursor_from_image(cursor_image_none); if (cursor_playfield == NULL) cursor_playfield = get_cursor_from_image(cursor_image_playfield); + cursor_new = (mode == CURSOR_DEFAULT ? NULL : + mode == CURSOR_NONE ? cursor_none : + mode == CURSOR_PLAYFIELD ? cursor_playfield : NULL); + #if defined(TARGET_SDL) - SDLSetMouseCursor(mode == CURSOR_PLAYFIELD ? cursor_playfield : NULL); + SDLSetMouseCursor(cursor_new); #elif defined(TARGET_X11_NATIVE) - X11SetMouseCursor(mode == CURSOR_PLAYFIELD ? cursor_playfield : NULL); + X11SetMouseCursor(cursor_new); #endif #endif } diff --git a/src/libgame/system.h b/src/libgame/system.h index 2d10c7b1..db3c5118 100644 --- a/src/libgame/system.h +++ b/src/libgame/system.h @@ -48,6 +48,9 @@ #define FULLSCREEN_NOT_AVAILABLE FALSE #define FULLSCREEN_AVAILABLE TRUE +#define CREATE_SPECIAL_EDITION FALSE +#define CREATE_SPECIAL_EDITION_RND_JUE FALSE + /* default input keys */ #define DEFAULT_KEY_LEFT KSYM_Left #define DEFAULT_KEY_RIGHT KSYM_Right @@ -196,20 +199,47 @@ #define ANIM_VERTICAL (1 << 11) #define ANIM_CENTERED (1 << 12) #define ANIM_STATIC_PANEL (1 << 13) -#define ANIM_FADE (1 << 14) -#define ANIM_CROSSFADE (1 << 15) #define ANIM_DEFAULT ANIM_LOOP +/* values for fade mode */ +#define FADE_TYPE_NONE 0 +#define FADE_TYPE_FADE_IN (1 << 0) +#define FADE_TYPE_FADE_OUT (1 << 1) +#define FADE_TYPE_TRANSFORM (1 << 2) +#define FADE_TYPE_CROSSFADE (1 << 3) +#define FADE_TYPE_MELT (1 << 4) +#define FADE_TYPE_SKIP (1 << 5) + +#define FADE_MODE_NONE (FADE_TYPE_NONE) +#define FADE_MODE_FADE_IN (FADE_TYPE_FADE_IN) +#define FADE_MODE_FADE_OUT (FADE_TYPE_FADE_OUT) +#define FADE_MODE_FADE (FADE_TYPE_FADE_IN | FADE_TYPE_FADE_OUT) +#define FADE_MODE_TRANSFORM (FADE_TYPE_TRANSFORM | FADE_TYPE_FADE_IN) +#define FADE_MODE_CROSSFADE (FADE_MODE_TRANSFORM | FADE_TYPE_CROSSFADE) +#define FADE_MODE_MELT (FADE_MODE_TRANSFORM | FADE_TYPE_MELT) +#define FADE_MODE_SKIP_FADE_IN (FADE_TYPE_SKIP | FADE_TYPE_FADE_IN) +#define FADE_MODE_SKIP_FADE_OUT (FADE_TYPE_SKIP | FADE_TYPE_FADE_OUT) + +#define FADE_MODE_DEFAULT FADE_MODE_FADE + /* values for text alignment */ #define ALIGN_LEFT (1 << 0) #define ALIGN_RIGHT (1 << 1) #define ALIGN_CENTER (1 << 2) - #define ALIGN_DEFAULT ALIGN_LEFT -#define ALIGNED_XPOS(x,w,a) ((a) == ALIGN_CENTER ? (x) - (w) / 2 : \ - (a) == ALIGN_RIGHT ? (x) - (w) : (x)) +#define VALIGN_TOP (1 << 0) +#define VALIGN_BOTTOM (1 << 1) +#define VALIGN_MIDDLE (1 << 2) +#define VALIGN_DEFAULT VALIGN_TOP + +#define ALIGNED_XPOS(x,w,a) ((a) == ALIGN_CENTER ? (x) - (w) / 2 : \ + (a) == ALIGN_RIGHT ? (x) - (w) : (x)) +#define ALIGNED_YPOS(y,h,v) ((v) == VALIGN_MIDDLE ? (y) - (h) / 2 : \ + (v) == VALIGN_BOTTOM ? (y) - (h) : (y)) +#define ALIGNED_TEXT_XPOS(p) ALIGNED_XPOS((p)->x, (p)->width, (p)->align) +#define ALIGNED_TEXT_YPOS(p) ALIGNED_YPOS((p)->y, (p)->height, (p)->valign) /* values for redraw_mask */ #define REDRAW_NONE (0) @@ -236,10 +266,6 @@ #define REDRAW_FPS (1 << 11) #define REDRAWTILES_THRESHOLD (SCR_FIELDX * SCR_FIELDY / 2) -#define FADE_MODE_FADE_IN 0 -#define FADE_MODE_FADE_OUT 1 -#define FADE_MODE_CROSSFADE 2 - #define IN_GFX_SCREEN(x, y) (x >= gfx.sx && x < gfx.sx + gfx.sxsize && \ y >= gfx.sy && y < gfx.sy + gfx.sysize) #define IN_GFX_DOOR(x, y) (x >= gfx.dx && x < gfx.dx + gfx.dxsize && \ @@ -249,7 +275,8 @@ /* values for mouse cursor */ #define CURSOR_DEFAULT 0 -#define CURSOR_PLAYFIELD 1 +#define CURSOR_NONE 1 +#define CURSOR_PLAYFIELD 2 /* fundamental game speed values */ #define ONE_SECOND_DELAY 1000 /* delay value for one second */ @@ -315,15 +342,27 @@ #define CACHE_DIRECTORY "cache" #if !defined(PLATFORM_MSDOS) +#if CREATE_SPECIAL_EDITION_RND_JUE +#define GFX_CLASSIC_SUBDIR "jue0" +#define SND_CLASSIC_SUBDIR "jue0" +#define MUS_CLASSIC_SUBDIR "jue0" +#else #define GFX_CLASSIC_SUBDIR "gfx_classic" #define SND_CLASSIC_SUBDIR "snd_classic" #define MUS_CLASSIC_SUBDIR "mus_classic" +#endif #else #define GFX_CLASSIC_SUBDIR "gfx_orig" #define SND_CLASSIC_SUBDIR "snd_orig" #define MUS_CLASSIC_SUBDIR "mus_orig" #endif +#if CREATE_SPECIAL_EDITION +#define GFX_FALLBACK_FILENAME "fallback.pcx" +#define SND_FALLBACK_FILENAME "fallback.wav" +#define MUS_FALLBACK_FILENAME "fallback.wav" +#endif + /* file names and filename extensions */ #if !defined(PLATFORM_MSDOS) #define LEVELSETUP_DIRECTORY "levelsetup" @@ -546,6 +585,12 @@ (type) == ARTWORK_TYPE_MUSIC ? \ options.music_directory : "") +#define UPDATE_BUSY_STATE() \ +{ \ + if (gfx.draw_busy_anim_function != NULL) \ + gfx.draw_busy_anim_function(); \ +} + /* type definitions */ typedef int (*EventFilter)(const Event *); @@ -683,8 +728,11 @@ struct GfxInfo int num_fonts; struct FontBitmapInfo *font_bitmap_info; int (*select_font_function)(int); + int (*get_font_from_token_function)(char *); int anim_random_frame; + + void (*draw_busy_anim_function)(void); }; struct JoystickInfo @@ -726,6 +774,7 @@ struct SetupEditorInfo boolean el_diamond_caves; boolean el_dx_boulderdash; boolean el_chars; + boolean el_steel_chars; boolean el_custom; boolean el_user_defined; boolean el_dynamic; @@ -749,6 +798,7 @@ struct SetupEditorCascadeInfo boolean el_dc; boolean el_dx; boolean el_chars; + boolean el_steel_chars; boolean el_ce; boolean el_ge; boolean el_ref; @@ -768,6 +818,7 @@ struct SetupShortcutInfo struct SetupSystemInfo { + char *sdl_videodriver; char *sdl_audiodriver; int audio_fragment_size; }; @@ -781,9 +832,8 @@ struct SetupInfo boolean sound_music; boolean sound_simple; boolean toons; - boolean double_buffering; - boolean direct_draw; /* !double_buffering (redundant!) */ boolean scroll_delay; + boolean scroll_delay_value; boolean soft_scrolling; boolean fade_screens; boolean autorecord; @@ -800,6 +850,7 @@ struct SetupInfo boolean quick_switch; boolean input_on_focus; boolean prefer_aga_graphics; + int game_frame_delay; char *graphics_set; char *sounds_set; @@ -837,8 +888,10 @@ struct TreeInfo char *name; /* tree info name, as displayed in selection menues */ char *name_sorting; /* optional sorting name for correct name sorting */ char *author; /* level or artwork author name */ + char *year; /* optional year of creation for levels or artwork */ char *imported_from; /* optional comment for imported levels or artwork */ char *imported_by; /* optional comment for imported levels or artwork */ + char *tested_by; /* optional comment to name people who tested a set */ char *graphics_set_ecs; /* special EMC custom graphics set (ECS graphics) */ char *graphics_set_aga; /* special EMC custom graphics set (AGA graphics) */ @@ -932,6 +985,7 @@ struct FileInfo boolean redefined; boolean fallback_to_default; + boolean default_is_cloned; }; struct SetupFileList @@ -1006,6 +1060,25 @@ struct Rect int width, height; }; +struct MenuPosInfo +{ + int x, y; + int width, height; + int align, valign; +}; + +struct TextPosInfo +{ + int x, y; + int width, height; + int align, valign; + int size; + int font, font_alt; + boolean draw_masked; + int sort_priority; + int id; +}; + /* ========================================================================= */ /* exported variables */ @@ -1057,6 +1130,7 @@ void InitGfxFieldInfo(int, int, int, int, int, int, int, int, Bitmap *); void InitGfxDoor1Info(int, int, int, int); void InitGfxDoor2Info(int, int, int, int); void InitGfxScrollbufferInfo(int, int); +void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void)); void SetDrawDeactivationMask(int); void SetDrawBackgroundMask(int); void SetWindowBackgroundBitmap(Bitmap *); diff --git a/src/libgame/text.c b/src/libgame/text.c index 83be1dfc..f5e9c066 100644 --- a/src/libgame/text.c +++ b/src/libgame/text.c @@ -107,11 +107,13 @@ static void FreeFontClipmasks() #endif /* TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND */ void InitFontInfo(struct FontBitmapInfo *font_bitmap_info, int num_fonts, - int (*select_font_function)(int)) + int (*select_font_function)(int), + int (*get_font_from_token_function)(char *)) { gfx.num_fonts = num_fonts; gfx.font_bitmap_info = font_bitmap_info; gfx.select_font_function = select_font_function; + gfx.get_font_from_token_function = get_font_from_token_function; #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) InitFontClipmasks(); @@ -185,8 +187,21 @@ void getFontCharSource(int font_nr, char c, Bitmap **bitmap, int *x, int *y) *y = font->src_y + (font_pos / font->num_chars_per_line) * font->height; } -void DrawInitText(char *text, int ypos, int font_nr) + +/* ========================================================================= */ +/* simple text drawing functions */ +/* ========================================================================= */ + +void DrawInitTextExt(char *text, int ypos, int font_nr, boolean force) { + static unsigned long progress_delay = 0; + unsigned long progress_delay_value = 100; /* (in milliseconds) */ + + UPDATE_BUSY_STATE(); + + if (!force && !DelayReached(&progress_delay, progress_delay_value)) + return; + if (window != NULL && gfx.num_fonts > 0 && gfx.font_bitmap_info[font_nr].bitmap != NULL) @@ -204,6 +219,16 @@ void DrawInitText(char *text, int ypos, int font_nr) } } +void DrawInitText(char *text, int ypos, int font_nr) +{ + DrawInitTextExt(text, ypos, font_nr, TRUE); +} + +void DrawInitTextIfNeeded(char *text, int ypos, int font_nr) +{ + DrawInitTextExt(text, ypos, font_nr, FALSE); +} + void DrawTextF(int x, int y, int font_nr, char *format, ...) { char buffer[MAX_OUTPUT_LINESIZE + 1]; @@ -246,6 +271,11 @@ void DrawTextSCentered(int y, int font_nr, char *text) gfx.sy + y, text, font_nr); } +void DrawTextCentered(int y, int font_nr, char *text) +{ + DrawText((gfx.sxsize - getTextWidth(text, font_nr)) / 2, y, text, font_nr); +} + void DrawTextSAligned(int x, int y, char *text, int font_nr, int align) { DrawText(gfx.sx + ALIGNED_XPOS(x, getTextWidth(text, font_nr), align), @@ -394,8 +424,49 @@ void DrawTextExt(DrawBuffer *dst_bitmap, int dst_x, int dst_y, char *text, } } -void DrawTextToTextArea(int x, int y, char *text, int font_nr, int line_length, - int area_xsize, int area_ysize, int mask_mode) + +/* ========================================================================= */ +/* text buffer drawing functions */ +/* ========================================================================= */ + +#define MAX_LINES_FROM_FILE 1024 + +char *GetTextBufferFromFile(char *filename, int max_lines) +{ + FILE *file; + char *buffer; + int num_lines = 0; + + if (filename == NULL) + return NULL; + + if (!(file = fopen(filename, MODE_READ))) + return NULL; + + buffer = checked_calloc(1); /* start with valid, but empty text buffer */ + + while (!feof(file) && num_lines < max_lines) + { + char line[MAX_LINE_LEN]; + + /* read next line of input file */ + if (!fgets(line, MAX_LINE_LEN, file)) + break; + + buffer = checked_realloc(buffer, strlen(buffer) + strlen(line) + 1); + + strcat(buffer, line); + + num_lines++; + } + + fclose(file); + + return buffer; +} + +void DrawTextToTextArea_OLD(int x, int y, char *text, int font_nr, int line_length, + int area_xsize, int area_ysize, int mask_mode) { int area_line = 0; int font_height = getFontHeight(font_nr); @@ -422,9 +493,9 @@ void DrawTextToTextArea(int x, int y, char *text, int font_nr, int line_length, redraw_mask |= REDRAW_FIELD; } -boolean RenderLineToBuffer(char **src_buffer_ptr, char *dst_buffer, - int *dst_buffer_len, boolean last_line_was_empty, - int line_length) +static boolean RenderLineToBuffer(char **src_buffer_ptr, char *dst_buffer, + int *dst_buffer_len, int line_length, + boolean last_line_was_empty) { char *text_ptr = *src_buffer_ptr; char *buffer = dst_buffer; @@ -501,29 +572,32 @@ boolean RenderLineToBuffer(char **src_buffer_ptr, char *dst_buffer, return buffer_filled; } -void DrawTextWrapped(int x, int y, char *text, int font_nr, int line_length, - int max_lines) +#if 0 +void DrawTextWrapped_OLD(int x, int y, char *text, int font_nr, int line_length, + int max_lines) { char *text_ptr = text; - char buffer[line_length + 1]; - int buffer_len; int current_line = 0; int font_height = getFontHeight(font_nr); while (*text_ptr && current_line < max_lines) { + char buffer[line_length + 1]; + int buffer_len = 0; + buffer[0] = '\0'; - buffer_len = 0; - RenderLineToBuffer(&text_ptr, buffer, &buffer_len, TRUE, line_length); + RenderLineToBuffer(&text_ptr, buffer, &buffer_len, line_length, TRUE); DrawText(x, y + current_line * font_height, buffer, font_nr); current_line++; } } +#endif -int DrawTextFromFile(int x, int y, char *filename, int font_nr, - int line_length, int max_lines, boolean rewrap) +#if 0 +int DrawTextFromFile_OLD(int x, int y, char *filename, int font_nr, + int line_length, int max_lines, boolean wrap_text) { int font_height = getFontHeight(font_nr); char line[MAX_LINE_LEN]; @@ -577,12 +651,10 @@ int DrawTextFromFile(int x, int y, char *filename, int font_nr, #if 1 boolean buffer_filled; - if (rewrap) + if (wrap_text) { - buffer_filled = RenderLineToBuffer(&line_ptr, - buffer, &buffer_len, - last_line_was_empty, - line_length); + buffer_filled = RenderLineToBuffer(&line_ptr, buffer, &buffer_len, + line_length, last_line_was_empty); } else { @@ -603,10 +675,8 @@ int DrawTextFromFile(int x, int y, char *filename, int font_nr, buffer_filled = TRUE; } #else - boolean buffer_filled = RenderLineToBuffer(&line_ptr, - buffer, &buffer_len, - last_line_was_empty, - line_length); + boolean buffer_filled = RenderLineToBuffer(&line_ptr, buffer, &buffer_len, + line_length, last_line_was_empty); #endif if (buffer_filled) @@ -632,3 +702,260 @@ int DrawTextFromFile(int x, int y, char *filename, int font_nr, return current_line; } +#endif + +static boolean getCheckedTokenValueFromString(char *string, char **token, + char **value) +{ + char *ptr; + + if (!getTokenValueFromString(string, token, value)) + return FALSE; + + if (**token != '.') /* token should begin with dot */ + return FALSE; + + for (ptr = *token; *ptr; ptr++) /* token should contain no whitespace */ + if (*ptr == ' ' || *ptr == '\t') + return FALSE; + + for (ptr = *value; *ptr; ptr++) /* value should contain no whitespace */ + if (*ptr == ' ' || *ptr == '\t') + return FALSE; + + return TRUE; +} + +static void DrawTextBuffer_Flush(int x, int y, char *buffer, int font_nr, + int line_length, int cut_length, int mask_mode, + boolean centered, int current_line) +{ + int buffer_len = strlen(buffer); + int font_width = getFontWidth(font_nr); + int font_height = getFontHeight(font_nr); + int offset_chars = (centered ? (line_length - buffer_len) / 2 : 0); + int offset_xsize = + (centered ? font_width * (line_length - buffer_len) / 2 : 0); + int final_cut_length = MAX(0, cut_length - offset_chars); + int xx = x + offset_xsize; + int yy = y + current_line * font_height; + + buffer[final_cut_length] = '\0'; + + if (mask_mode != -1) + DrawTextExt(drawto, xx, yy, buffer, font_nr, mask_mode); + else + DrawText(xx, yy, buffer, font_nr); +} + +int DrawTextBuffer(int x, int y, char *text_buffer, int font_nr, + int line_length, int cut_length, int max_lines, + int mask_mode, boolean autowrap, boolean centered, + boolean parse_comments) +{ +#if 0 + int font_width = getFontWidth(font_nr); + int font_height = getFontHeight(font_nr); +#endif + char buffer[line_length + 1]; + int buffer_len; + int current_line = 0; + + if (text_buffer == NULL || *text_buffer == '\0') + return 0; + + if (current_line >= max_lines) + return 0; + + if (cut_length == -1) + cut_length = line_length; + + buffer[0] = '\0'; + buffer_len = 0; + + while (*text_buffer && current_line < max_lines) + { + char line[MAX_LINE_LEN + 1]; + char *line_ptr; + boolean last_line_was_empty = TRUE; +#if 1 + int num_line_chars = MAX_LINE_LEN; +#else + int num_line_chars = (autowrap ? MAX_LINE_LEN : line_length); +#endif + int i; + + /* copy next line from text buffer to line buffer (nearly fgets() style) */ + for (i = 0; i < num_line_chars && *text_buffer; i++) + if ((line[i] = *text_buffer++) == '\n') + break; + line[i] = '\0'; + + /* prevent 'num_line_chars' sized lines to cause additional empty line */ + if (i == num_line_chars && *text_buffer == '\n') + text_buffer++; + + /* skip comments (lines directly beginning with '#') */ + if (line[0] == '#' && parse_comments) + { + char *token, *value; + + /* try to read generic token/value pair definition after comment sign */ + if (getCheckedTokenValueFromString(line + 1, &token, &value)) + { + /* if found, flush the current buffer, if non-empty */ + if (buffer_len > 0 && current_line < max_lines) + { + DrawTextBuffer_Flush(x, y, buffer, font_nr, line_length, cut_length, + mask_mode, centered, current_line); + + current_line++; + + buffer[0] = '\0'; + buffer_len = 0; + } + + if (strEqual(token, ".font")) + font_nr = gfx.get_font_from_token_function(value); + else if (strEqual(token, ".autowrap")) + autowrap = get_boolean_from_string(value); + else if (strEqual(token, ".centered")) + centered = get_boolean_from_string(value); + else if (strEqual(token, ".parse_comments")) + parse_comments = get_boolean_from_string(value); + } + + continue; + } + + /* cut trailing newline and carriage return from input line */ + for (line_ptr = line; *line_ptr; line_ptr++) + { + if (*line_ptr == '\n' || *line_ptr == '\r') + { + *line_ptr = '\0'; + break; + } + } + + if (strlen(line) == 0) /* special case: force empty line */ + strcpy(line, "\n"); + + line_ptr = line; + + while (*line_ptr && current_line < max_lines) + { + boolean buffer_filled; + + if (autowrap) + { + buffer_filled = RenderLineToBuffer(&line_ptr, buffer, &buffer_len, + line_length, last_line_was_empty); + } + else + { + if (strlen(line_ptr) <= line_length) + { + buffer_len = strlen(line_ptr); + strcpy(buffer, line_ptr); + } + else + { + buffer_len = line_length; + strncpy(buffer, line_ptr, line_length); + } + + buffer[buffer_len] = '\0'; + line_ptr += buffer_len; + + buffer_filled = TRUE; + } + + if (buffer_filled) + { +#if 1 + DrawTextBuffer_Flush(x, y, buffer, font_nr, line_length, cut_length, + mask_mode, centered, current_line); +#else + int offset_chars = (centered ? (line_length - buffer_len) / 2 : 0); + int offset_xsize = + (centered ? font_width * (line_length - buffer_len) / 2 : 0); + int final_cut_length = MAX(0, cut_length - offset_chars); + int xx = x + offset_xsize; + + buffer[final_cut_length] = '\0'; + + if (mask_mode != -1) + DrawTextExt(drawto, xx, y + current_line * font_height, buffer, + font_nr, mask_mode); + else + DrawText(xx, y + current_line * font_height, buffer, font_nr); +#endif + + current_line++; + + last_line_was_empty = (buffer_len == 0); + + buffer[0] = '\0'; + buffer_len = 0; + } + } + } + + if (buffer_len > 0 && current_line < max_lines) + { +#if 1 + DrawTextBuffer_Flush(x, y, buffer, font_nr, line_length, cut_length, + mask_mode, centered, current_line); +#else + int offset_chars = (centered ? (line_length - buffer_len) / 2 : 0); + int offset_xsize = + (centered ? font_width * (line_length - buffer_len) / 2 : 0); + int final_cut_length = MAX(0, cut_length - offset_chars); + int xx = x + offset_xsize; + + buffer[final_cut_length] = '\0'; + + if (mask_mode != -1) + DrawTextExt(drawto, xx, y + current_line * font_height, buffer, + font_nr, mask_mode); + else + DrawText(xx, y + current_line * font_height, buffer, font_nr); +#endif + + current_line++; + } + + return current_line; +} + +int DrawTextFile(int x, int y, char *filename, int font_nr, + int line_length, int cut_length, int max_lines, + int mask_mode, boolean autowrap, boolean centered, + boolean parse_comments) +{ + char *text_buffer = GetTextBufferFromFile(filename, MAX_LINES_FROM_FILE); + int num_lines_printed = DrawTextBuffer(x, y, text_buffer, font_nr, + line_length, cut_length, max_lines, + mask_mode, autowrap, centered, + parse_comments); + checked_free(text_buffer); + + return num_lines_printed; +} + +#if 0 +void DrawTextWrapped(int x, int y, char *text, int font_nr, int line_length, + int max_lines) +{ + DrawTextBuffer(x, y, text, font_nr, line_length, -1, max_lines, -1, TRUE, + FALSE, FALSE); +} + +void DrawTextToTextArea(int x, int y, char *text, int font_nr, int line_length, + int cut_length, int max_lines, int mask_mode) +{ + DrawTextBuffer(x, y, text, font_nr, line_length, cut_length, max_lines, + mask_mode, FALSE, FALSE, FALSE); +} +#endif diff --git a/src/libgame/text.h b/src/libgame/text.h index f21ffdbf..146648a3 100644 --- a/src/libgame/text.h +++ b/src/libgame/text.h @@ -34,6 +34,12 @@ /* special character mapping for default fonts */ #define FONT_ASCII_CURSOR ((char)160) +#define FONT_ASCII_BUTTON ((char)128) +#define FONT_ASCII_UP ((char)129) +#define FONT_ASCII_DOWN ((char)130) +#define FONT_ASCII_LEFT ((char)'<') +#define FONT_ASCII_RIGHT ((char)'>') + #define MAP_FONT_ASCII(c) ((c) >= 'a' && (c) <= 'z' ? 'A' + (c) - 'a' : \ (c) == '©' ? 96 : \ (c) == 'ä' || (c) == 'Ä' ? 97 : \ @@ -42,6 +48,9 @@ (c) == '°' ? 100 : \ (c) == '®' ? 101 : \ (c) == FONT_ASCII_CURSOR ? 102 : \ + (c) == FONT_ASCII_BUTTON ? 109 : \ + (c) == FONT_ASCII_UP ? 110 : \ + (c) == FONT_ASCII_DOWN ? 111 : \ (c)) /* 64 regular ordered ASCII characters, 6 special characters, 1 cursor char. */ @@ -52,7 +61,8 @@ /* font structure definitions */ -void InitFontInfo(struct FontBitmapInfo *, int, int (*function)(int)); +void InitFontInfo(struct FontBitmapInfo *, int, + int (*function1)(int), int (*function2)(char *)); void FreeFontInfo(struct FontBitmapInfo *); struct FontBitmapInfo *getFontBitmapInfo(int); @@ -64,17 +74,22 @@ int getTextWidth(char *, int); void getFontCharSource(int, char, Bitmap **, int *, int *); void DrawInitText(char *, int, int); +void DrawInitTextIfNeeded(char *, int, int); +void DrawInitTextExt(char *, int, int, boolean); void DrawTextF(int, int, int, char *, ...); void DrawTextFCentered(int, int, char *, ...); void DrawTextS(int, int, int, char *); void DrawTextSCentered(int, int, char *); +void DrawTextCentered(int, int, char *); void DrawTextSAligned(int, int, char *, int, int); void DrawTextAligned(int, int, char *, int, int); void DrawText(int, int, char *, int); void DrawTextExt(DrawBuffer *, int, int, char *, int, int); -void DrawTextToTextArea(int, int, char *, int, int, int, int, int); -boolean RenderLineToBuffer(char **, char *, int *, boolean, int); -void DrawTextWrapped(int, int, char *, int, int, int); -int DrawTextFromFile(int, int, char *, int, int, int, boolean); + +char *GetTextBufferFromFile(char *, int); +int DrawTextBuffer(int, int, char *, int, int, int, int, int, boolean, boolean, + boolean); +int DrawTextFile(int, int, char *, int, int, int, int, int, boolean, boolean, + boolean); #endif /* TEXT_H */ diff --git a/src/libgame/toons.c b/src/libgame/toons.c index bbbd8833..2a233e4c 100644 --- a/src/libgame/toons.c +++ b/src/libgame/toons.c @@ -125,21 +125,64 @@ void DrawAnim(Bitmap *toon_bitmap, GC toon_clip_gc, int src_x, int src_y, int width, int height, int dest_x, int dest_y, int pad_x, int pad_y) { - int buf_x = DOOR_GFX_PAGEX3, buf_y = DOOR_GFX_PAGEY1; + int pad_dest_x = dest_x - pad_x; + int pad_dest_y = dest_y - pad_y; + int pad_width = width + 2 * pad_x; + int pad_height = height + 2 * pad_y; +#if 1 + int buffer_x = 0; + int buffer_y = 0; +#else + int buffer_x = DOOR_GFX_PAGEX3; + int buffer_y = DOOR_GFX_PAGEY1; +#endif + +#if 0 + printf("::: (%d, %d), (%d, %d), (%d, %d), (%d, %d) -> (%d, %d), (%d, %d), (%d, %d)\n", + src_x, src_y, + width, height, + dest_x, dest_y, + pad_x, pad_y, + + pad_dest_x, pad_dest_y, + pad_width, pad_height, + buffer_x, buffer_y); +#endif + + if (width == 0 || height == 0) + return; + + /* correct values to avoid off-screen blitting (start position) */ + if (pad_dest_x < screen_info.startx) + { + pad_width -= (screen_info.startx - pad_dest_x); + pad_dest_x = screen_info.startx; + } + if (pad_dest_y < screen_info.starty) + { + pad_height -= (screen_info.starty - pad_dest_y); + pad_dest_y = screen_info.starty; + } + + /* correct values to avoid off-screen blitting (blit size) */ + if (pad_width > screen_info.width) + pad_width = screen_info.width; + if (pad_height > screen_info.height) + pad_height = screen_info.height; /* special method to avoid flickering interference with BackToFront() */ - BlitBitmap(backbuffer, screen_info.save_buffer, dest_x-pad_x, dest_y-pad_y, - width+2*pad_x, height+2*pad_y, buf_x, buf_y); - SetClipOrigin(toon_bitmap, toon_clip_gc, dest_x-src_x, dest_y-src_y); - BlitBitmapMasked(toon_bitmap, backbuffer, - src_x, src_y, width, height, dest_x, dest_y); - BlitBitmap(backbuffer, window, dest_x-pad_x, dest_y-pad_y, - width+2*pad_x, height+2*pad_y, dest_x-pad_x, dest_y-pad_y); + BlitBitmap(backbuffer, screen_info.save_buffer, pad_dest_x, pad_dest_y, + pad_width, pad_height, buffer_x, buffer_y); + SetClipOrigin(toon_bitmap, toon_clip_gc, dest_x - src_x, dest_y - src_y); + BlitBitmapMasked(toon_bitmap, backbuffer, src_x, src_y, width, height, + dest_x, dest_y); + BlitBitmap(backbuffer, window, pad_dest_x, pad_dest_y, pad_width, pad_height, + pad_dest_x, pad_dest_y); screen_info.update_function(); - BlitBitmap(screen_info.save_buffer, backbuffer, buf_x, buf_y, - width+2*pad_x, height+2*pad_y, dest_x-pad_x, dest_y-pad_y); + BlitBitmap(screen_info.save_buffer, backbuffer, buffer_x, buffer_y, + pad_width, pad_height, pad_dest_x, pad_dest_y); FlushDisplay(); } @@ -220,7 +263,7 @@ boolean AnimateToon(int toon_nr, boolean restart) else { delta_y = -anim->step_offset; - pos_y = screen_info.width + delta_y; + pos_y = screen_info.height + delta_y; } delta_x = 0; @@ -337,15 +380,9 @@ void HandleAnimation(int mode) if (anim_running) { #if 1 - int draw_mode; - redraw_mask |= (REDRAW_FIELD | REDRAW_FROM_BACKBUFFER); - /* Redraw background even when in direct drawing mode */ - draw_mode = setup.direct_draw; - setup.direct_draw = FALSE; screen_info.update_function(); - setup.direct_draw = draw_mode; #endif anim_running = FALSE; diff --git a/src/libgame/x11.c b/src/libgame/x11.c index 2bbf76d5..12f4e1e4 100644 --- a/src/libgame/x11.c +++ b/src/libgame/x11.c @@ -374,7 +374,7 @@ void X11FadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height, if (draw_border_function != NULL) draw_border_function(); - X11CopyArea(backbuffer, window, x, y, width, height, 0, 0, BLIT_OPAQUE); + X11CopyArea(backbuffer, window, x, y, width, height, x, y, BLIT_OPAQUE); /* as we currently cannot use the fade delay, also do not use post delay */ } diff --git a/src/libgame/x11.h b/src/libgame/x11.h index 28e8f5e8..2ebaf86c 100644 --- a/src/libgame/x11.h +++ b/src/libgame/x11.h @@ -75,7 +75,7 @@ struct X11DrawableInfo { char *source_filename; - int width, height; + unsigned int width, height; Drawable drawable; Drawable clip_mask; GC gc; /* GC for normal drawing (inheritated from 'window') */ @@ -198,6 +198,7 @@ struct MouseCursorInfo #define KSYM_braceright XK_braceright #define KSYM_asciitilde XK_asciitilde +#define KSYM_degree XK_degree #define KSYM_Adiaeresis XK_Adiaeresis #define KSYM_Odiaeresis XK_Odiaeresis #define KSYM_Udiaeresis XK_Udiaeresis diff --git a/src/main.c b/src/main.c index 3b1eb05e..a86ed447 100644 --- a/src/main.c +++ b/src/main.c @@ -24,6 +24,7 @@ Bitmap *bitmap_db_cross; Bitmap *bitmap_db_field; Bitmap *bitmap_db_panel; Bitmap *bitmap_db_door; +Bitmap *bitmap_db_toons; DrawBuffer *fieldbuffer; DrawBuffer *drawto_field; @@ -75,6 +76,10 @@ int GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; int GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +int ActiveElement[MAX_NUM_ELEMENTS]; +int ActiveButton[NUM_IMAGE_FILES]; +int ActiveFont[NUM_FONTS]; + int lev_fieldx, lev_fieldy; int scroll_x, scroll_y; @@ -106,7 +111,15 @@ struct SetupInfo setup; struct GameInfo game; struct GlobalInfo global; struct BorderInfo border; -struct TitleInfo title; +struct TitleFadingInfo fading; +struct TitleFadingInfo title_initial_default; +struct TitleFadingInfo title_default; +struct TitleMessageInfo titlemessage_initial_default; +struct TitleMessageInfo titlemessage_initial[MAX_NUM_TITLE_MESSAGES]; +struct TitleMessageInfo titlemessage_default; +struct TitleMessageInfo titlemessage[MAX_NUM_TITLE_MESSAGES]; +struct TitleMessageInfo readme; +struct InitInfo init; struct MenuInfo menu; struct DoorInfo door_1, door_2; struct PreviewInfo preview; @@ -116,6 +129,10 @@ struct MusicInfo *music_info = NULL; struct MusicFileInfo *music_file_info = NULL; struct HelpAnimInfo *helpanim_info = NULL; SetupFileHash *helptext_info = NULL; +SetupFileHash *image_config_hash = NULL; +SetupFileHash *element_token_hash = NULL; +SetupFileHash *graphic_token_hash = NULL; +SetupFileHash *font_token_hash = NULL; /* ------------------------------------------------------------------------- */ @@ -216,12 +233,12 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "quicksand_empty", "quicksand", - "empty quicksand" + "quicksand (empty)" }, { "quicksand_full", "quicksand", - "quicksand with rock" + "quicksand (with rock)" }, { "amoeba_drop", @@ -1115,17 +1132,17 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = { "char_unused", "char", - "letter ''" + "letter 'button'" }, { "char_unused", "char", - "letter ''" + "letter 'up'" }, { "char_unused", "char", - "letter ''" + "letter 'down'" }, { "expandable_wall_horizontal", @@ -1428,17 +1445,17 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "wall with crystal" }, { - "door_white", + "dc_gate_white", "gate", "white door" }, { - "door_white_gray", + "dc_gate_white_gray", "gate", "gray door (opened by white key)" }, { - "key_white", + "dc_key_white", "key", "white key" }, @@ -1604,8 +1621,8 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = }, { "landmine", - "sand", - "land mine" + "landmine", + "land mine (not removable)" }, { "envelope_obsolete", @@ -1624,63 +1641,63 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = }, { "sign_exclamation", - "wall", + "sign", "sign (exclamation)" }, { "sign_radioactivity", - "wall", + "sign", "sign (radio activity)" }, { "sign_stop", - "wall", + "sign", "sign (stop)" }, { "sign_wheelchair", - "wall", + "sign", "sign (wheel chair)" }, { "sign_parking", - "wall", + "sign", "sign (parking)" }, { - "sign_oneway", - "wall", - "sign (one way)" + "sign_no_entry", + "sign", + "sign (no entry)" }, { - "sign_heart", - "wall", - "sign (heart)" + "sign_unused_1", + "sign", + "sign (unused)" }, { - "sign_triangle", - "wall", - "sign (triangle)" + "sign_give_way", + "sign", + "sign (give way)" }, { - "sign_round", - "wall", - "sign (round)" + "sign_entry_forbidden", + "sign", + "sign (entry forbidden)" }, { - "sign_exit", - "wall", - "sign (exit)" + "sign_emergency_exit", + "sign", + "sign (emergency exit)" }, { - "sign_yinyang", - "wall", + "sign_yin_yang", + "sign", "sign (yin yang)" }, { - "sign_other", - "wall", - "sign (other)" + "sign_unused_2", + "sign", + "sign (unused)" }, { "mole.left", @@ -3787,6 +3804,661 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "any_element", "this element matches any element" }, + { + "steel_char_space", + "steel_char", + "steel letter ' '" + }, + { + "steel_char_exclam", + "steel_char", + "steel letter '!'" + }, + { + "steel_char_quotedbl", + "steel_char", + "steel letter '\"'" + }, + { + "steel_char_numbersign", + "steel_char", + "steel letter '#'" + }, + { + "steel_char_dollar", + "steel_char", + "steel letter '$'" + }, + { + "steel_char_percent", + "steel_char", + "steel letter '%'" + }, + { + "steel_char_ampersand", + "steel_char", + "steel letter '&'" + }, + { + "steel_char_apostrophe", + "steel_char", + "steel letter '''" + }, + { + "steel_char_parenleft", + "steel_char", + "steel letter '('" + }, + { + "steel_char_parenright", + "steel_char", + "steel letter ')'" + }, + { + "steel_char_asterisk", + "steel_char", + "steel letter '*'" + }, + { + "steel_char_plus", + "steel_char", + "steel letter '+'" + }, + { + "steel_char_comma", + "steel_char", + "steel letter ','" + }, + { + "steel_char_minus", + "steel_char", + "steel letter '-'" + }, + { + "steel_char_period", + "steel_char", + "steel letter '.'" + }, + { + "steel_char_slash", + "steel_char", + "steel letter '/'" + }, + { + "steel_char_0", + "steel_char", + "steel letter '0'" + }, + { + "steel_char_1", + "steel_char", + "steel letter '1'" + }, + { + "steel_char_2", + "steel_char", + "steel letter '2'" + }, + { + "steel_char_3", + "steel_char", + "steel letter '3'" + }, + { + "steel_char_4", + "steel_char", + "steel letter '4'" + }, + { + "steel_char_5", + "steel_char", + "steel letter '5'" + }, + { + "steel_char_6", + "steel_char", + "steel letter '6'" + }, + { + "steel_char_7", + "steel_char", + "steel letter '7'" + }, + { + "steel_char_8", + "steel_char", + "steel letter '8'" + }, + { + "steel_char_9", + "steel_char", + "steel letter '9'" + }, + { + "steel_char_colon", + "steel_char", + "steel letter ':'" + }, + { + "steel_char_semicolon", + "steel_char", + "steel letter ';'" + }, + { + "steel_char_less", + "steel_char", + "steel letter '<'" + }, + { + "steel_char_equal", + "steel_char", + "steel letter '='" + }, + { + "steel_char_greater", + "steel_char", + "steel letter '>'" + }, + { + "steel_char_question", + "steel_char", + "steel letter '?'" + }, + { + "steel_char_at", + "steel_char", + "steel letter '@'" + }, + { + "steel_char_a", + "steel_char", + "steel letter 'A'" + }, + { + "steel_char_b", + "steel_char", + "steel letter 'B'" + }, + { + "steel_char_c", + "steel_char", + "steel letter 'C'" + }, + { + "steel_char_d", + "steel_char", + "steel letter 'D'" + }, + { + "steel_char_e", + "steel_char", + "steel letter 'E'" + }, + { + "steel_char_f", + "steel_char", + "steel letter 'F'" + }, + { + "steel_char_g", + "steel_char", + "steel letter 'G'" + }, + { + "steel_char_h", + "steel_char", + "steel letter 'H'" + }, + { + "steel_char_i", + "steel_char", + "steel letter 'I'" + }, + { + "steel_char_j", + "steel_char", + "steel letter 'J'" + }, + { + "steel_char_k", + "steel_char", + "steel letter 'K'" + }, + { + "steel_char_l", + "steel_char", + "steel letter 'L'" + }, + { + "steel_char_m", + "steel_char", + "steel letter 'M'" + }, + { + "steel_char_n", + "steel_char", + "steel letter 'N'" + }, + { + "steel_char_o", + "steel_char", + "steel letter 'O'" + }, + { + "steel_char_p", + "steel_char", + "steel letter 'P'" + }, + { + "steel_char_q", + "steel_char", + "steel letter 'Q'" + }, + { + "steel_char_r", + "steel_char", + "steel letter 'R'" + }, + { + "steel_char_s", + "steel_char", + "steel letter 'S'" + }, + { + "steel_char_t", + "steel_char", + "steel letter 'T'" + }, + { + "steel_char_u", + "steel_char", + "steel letter 'U'" + }, + { + "steel_char_v", + "steel_char", + "steel letter 'V'" + }, + { + "steel_char_w", + "steel_char", + "steel letter 'W'" + }, + { + "steel_char_x", + "steel_char", + "steel letter 'X'" + }, + { + "steel_char_y", + "steel_char", + "steel letter 'Y'" + }, + { + "steel_char_z", + "steel_char", + "steel letter 'Z'" + }, + { + "steel_char_bracketleft", + "steel_char", + "steel letter '['" + }, + { + "steel_char_backslash", + "steel_char", + "steel letter '\\'" + }, + { + "steel_char_bracketright", + "steel_char", + "steel letter ']'" + }, + { + "steel_char_asciicircum", + "steel_char", + "steel letter '^'" + }, + { + "steel_char_underscore", + "steel_char", + "steel letter '_'" + }, + { + "steel_char_copyright", + "steel_char", + "steel letter '©'" + }, + { + "steel_char_aumlaut", + "steel_char", + "steel letter 'Ä'" + }, + { + "steel_char_oumlaut", + "steel_char", + "steel letter 'Ö'" + }, + { + "steel_char_uumlaut", + "steel_char", + "steel letter 'Ãœ'" + }, + { + "steel_char_degree", + "steel_char", + "steel letter '°'" + }, + { + "steel_char_trademark", + "steel_char", + "steel letter '®'" + }, + { + "steel_char_cursor", + "steel_char", + "steel letter ' '" + }, + { + "steel_char_unused", + "steel_char", + "steel letter ''" + }, + { + "steel_char_unused", + "steel_char", + "steel letter ''" + }, + { + "steel_char_unused", + "steel_char", + "steel letter ''" + }, + { + "steel_char_unused", + "steel_char", + "steel letter ''" + }, + { + "steel_char_unused", + "steel_char", + "steel letter ''" + }, + { + "steel_char_unused", + "steel_char", + "steel letter ''" + }, + { + "steel_char_unused", + "steel_char", + "steel letter 'button'" + }, + { + "steel_char_unused", + "steel_char", + "steel letter 'up'" + }, + { + "steel_char_unused", + "steel_char", + "steel letter 'down'" + }, + { + "sperms", + "frankie", + "sperms" + }, + { + "bullet", + "frankie", + "bullet" + }, + { + "heart", + "frankie", + "heart" + }, + { + "cross", + "frankie", + "cross" + }, + { + "frankie", + "frankie", + "frankie" + }, + { + "sign_sperms", + "sign", + "sign (sperms)" + }, + { + "sign_bullet", + "sign", + "sign (bullet)" + }, + { + "sign_heart", + "sign", + "sign (heart)" + }, + { + "sign_cross", + "sign", + "sign (cross)" + }, + { + "sign_frankie", + "sign", + "sign (frankie)" + }, + { + "steel_exit_closed", + "steel_exit", + "closed steel exit" + }, + { + "steel_exit_open", + "steel_exit", + "open steel exit" + }, + { + "dc_steelwall_1_left", + "steelwall", + "steel wall (left)" + }, + { + "dc_steelwall_1_right", + "steelwall", + "steel wall (right)" + }, + { + "dc_steelwall_1_top", + "steelwall", + "steel wall (top)" + }, + { + "dc_steelwall_1_bottom", + "steelwall", + "steel wall (bottom)" + }, + { + "dc_steelwall_1_horizontal", + "steelwall", + "steel wall (top/bottom)" + }, + { + "dc_steelwall_1_vertical", + "steelwall", + "steel wall (left/right)" + }, + { + "dc_steelwall_1_topleft", + "steelwall", + "steel wall (top/left)" + }, + { + "dc_steelwall_1_topright", + "steelwall", + "steel wall (top/right)" + }, + { + "dc_steelwall_1_bottomleft", + "steelwall", + "steel wall (bottom/left)" + }, + { + "dc_steelwall_1_bottomright", + "steelwall", + "steel wall (bottom/right)" + }, + { + "dc_steelwall_1_topleft_2", + "steelwall", + "steel wall (top/left corner)" + }, + { + "dc_steelwall_1_topright_2", + "steelwall", + "steel wall (top/right corner)" + }, + { + "dc_steelwall_1_bottomleft_2", + "steelwall", + "steel wall (bottom/left corner)" + }, + { + "dc_steelwall_1_bottomright_2", + "steelwall", + "steel wall (bottom/right corner)" + }, + { + "dc_steelwall_2_left", + "steelwall", + "steel wall (left)" + }, + { + "dc_steelwall_2_right", + "steelwall", + "steel wall (right)" + }, + { + "dc_steelwall_2_top", + "steelwall", + "steel wall (top)" + }, + { + "dc_steelwall_2_bottom", + "steelwall", + "steel wall (bottom)" + }, + { + "dc_steelwall_2_horizontal", + "steelwall", + "steel wall (horizontal)" + }, + { + "dc_steelwall_2_vertical", + "steelwall", + "steel wall (vertical)" + }, + { + "dc_steelwall_2_middle", + "steelwall", + "steel wall (middle)" + }, + { + "dc_steelwall_2_single", + "steelwall", + "steel wall (single)" + }, + { + "dc_switchgate_switch_up", + "switchgate_switch", + "switch for switch gate (steel)" + }, + { + "dc_switchgate_switch_down", + "switchgate_switch", + "switch for switch gate (steel)" + }, + { + "dc_timegate_switch", + "timegate_switch", + "switch for time gate (steel)" + }, + { + "dc_timegate_switch.active", + "timegate_switch", + "switch for time gate (steel)" + }, + { + "dc_landmine", + "dc_landmine", + "land mine (DC style, removable)" + }, + { + "expandable_steelwall", + "steelwall", + "growing steel wall" + }, + { + "expandable_steelwall_horizontal", + "steelwall", + "growing steel wall (horizontal)" + }, + { + "expandable_steelwall_vertical", + "steelwall", + "growing steel wall (vertical)" + }, + { + "expandable_steelwall_any", + "steelwall", + "growing steel wall (any direction)" + }, + { + "em_exit_closed", + "em_exit", + "closed exit (EM style)" + }, + { + "em_exit_open", + "em_exit", + "open exit (EM style)" + }, + { + "em_steel_exit_closed", + "em_steel_exit", + "closed steel exit (EM style)" + }, + { + "em_steel_exit_open", + "em_steel_exit", + "open steel exit (EM style)" + }, + { + "dc_gate_fake_gray", + "gate", + "gray door (opened by no key)" + }, + { + "dc_magic_wall", + "dc_magic_wall", + "magic wall (DC style)" + }, + { + "quicksand_fast_empty", + "quicksand", + "fast quicksand (empty)" + }, + { + "quicksand_fast_full", + "quicksand", + "fast quicksand (with rock)" + }, /* ----------------------------------------------------------------------- */ /* "real" (and therefore drawable) runtime elements */ @@ -3932,6 +4604,36 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "exit", "-" }, + { + "steel_exit.opening", + "steel_exit", + "-" + }, + { + "steel_exit.closing", + "steel_exit", + "-" + }, + { + "em_exit.opening", + "em_exit", + "-" + }, + { + "em_exit.closing", + "em_exit", + "-" + }, + { + "em_steel_exit.opening", + "em_steel_exit", + "-" + }, + { + "em_steel_exit.closing", + "em_steel_exit", + "-" + }, { "sp_exit.opening", "sp_exit", @@ -3977,6 +4679,11 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "quicksand", "-" }, + { + "quicksand_fast.emptying", + "quicksand", + "-" + }, { "magic_wall.active", "magic_wall", @@ -3987,6 +4694,11 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "magic_wall", "-" }, + { + "dc_magic_wall.active", + "magic_wall", + "-" + }, { "magic_wall_full", "magic_wall", @@ -3997,6 +4709,11 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "magic_wall", "-" }, + { + "dc_magic_wall_full", + "magic_wall", + "-" + }, { "magic_wall.emptying", "magic_wall", @@ -4007,6 +4724,11 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "magic_wall", "-" }, + { + "dc_magic_wall.emptying", + "magic_wall", + "-" + }, { "magic_wall_dead", "magic_wall", @@ -4017,6 +4739,11 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "magic_wall", "-" }, + { + "dc_magic_wall_dead", + "magic_wall", + "-" + }, { "emc_fake_grass.active", @@ -4083,6 +4810,11 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "gate", "", }, + { + "dc_gate_white_gray.active", + "gate", + "", + }, { "emc_dripper.active", "dripper", @@ -4143,6 +4875,11 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "-", "-" }, + { + "expandable_steelwall.growing", + "-", + "-" + }, { "flames", "-", @@ -4178,6 +4915,11 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "quicksand", "-" }, + { + "quicksand_fast.filling", + "quicksand", + "-" + }, { "magic_wall.filling", "-", @@ -4188,6 +4930,11 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "-", "-" }, + { + "dc_magic_wall.filling", + "-", + "-" + }, { "element.snapping", "-", @@ -4333,6 +5080,46 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "sb_default", "-" }, + { + "graphic_1", + "graphic", + "-" + }, + { + "graphic_2", + "graphic", + "-" + }, + { + "graphic_3", + "graphic", + "-" + }, + { + "graphic_4", + "graphic", + "-" + }, + { + "graphic_5", + "graphic", + "-" + }, + { + "graphic_6", + "graphic", + "-" + }, + { + "graphic_7", + "graphic", + "-" + }, + { + "graphic_8", + "graphic", + "-" + }, { "internal_clipboard_custom", "internal", @@ -4443,6 +5230,16 @@ struct ElementNameInfo element_name_info[MAX_NUM_ELEMENTS + 1] = "internal", "hide text elements" }, + { + "internal_cascade_steel_chars", + "internal", + "show steel text elements" + }, + { + "internal_cascade_steel_chars.active", + "internal", + "hide steel text elements" + }, { "internal_cascade_ce", "internal", @@ -4604,239 +5401,43 @@ struct ElementActionInfo element_action_info[NUM_ACTIONS + 1 + 1] = struct ElementDirectionInfo element_direction_info[NUM_DIRECTIONS_FULL + 1] = { - { ".left", MV_BIT_LEFT }, - { ".right", MV_BIT_RIGHT }, - { ".up", MV_BIT_UP }, - { ".down", MV_BIT_DOWN }, - { ".upleft", MV_BIT_UP }, - { ".upright", MV_BIT_RIGHT }, - { ".downleft", MV_BIT_LEFT }, - { ".downright", MV_BIT_DOWN }, + { ".left", MV_BIT_LEFT }, + { ".right", MV_BIT_RIGHT }, + { ".up", MV_BIT_UP }, + { ".down", MV_BIT_DOWN }, + { ".upleft", MV_BIT_UP }, + { ".upright", MV_BIT_RIGHT }, + { ".downleft", MV_BIT_LEFT }, + { ".downright", MV_BIT_DOWN }, - { NULL, 0 } + { NULL, 0 } }; struct SpecialSuffixInfo special_suffix_info[NUM_SPECIAL_GFX_ARGS + 1 + 1] = { - { ".[DEFAULT]", GFX_SPECIAL_ARG_DEFAULT, }, - { ".TITLE", GFX_SPECIAL_ARG_TITLE, }, - { ".MESSAGE", GFX_SPECIAL_ARG_MESSAGE, }, - { ".MAIN", GFX_SPECIAL_ARG_MAIN, }, - { ".LEVELS", GFX_SPECIAL_ARG_LEVELS }, - { ".SCORES", GFX_SPECIAL_ARG_SCORES, }, - { ".EDITOR", GFX_SPECIAL_ARG_EDITOR, }, - { ".INFO", GFX_SPECIAL_ARG_INFO, }, - { ".SETUP", GFX_SPECIAL_ARG_SETUP, }, - { ".PLAYING", GFX_SPECIAL_ARG_PLAYING, }, - { ".DOOR", GFX_SPECIAL_ARG_DOOR, }, - { ".PREVIEW", GFX_SPECIAL_ARG_PREVIEW, }, - { ".CRUMBLED", GFX_SPECIAL_ARG_CRUMBLED, }, + { ".[DEFAULT]", GFX_SPECIAL_ARG_DEFAULT, }, + { ".LOADING", GFX_SPECIAL_ARG_LOADING, }, + { ".TITLE_INITIAL", GFX_SPECIAL_ARG_TITLE_INITIAL, }, + { ".TITLE", GFX_SPECIAL_ARG_TITLE, }, + { ".MAIN", GFX_SPECIAL_ARG_MAIN, }, + { ".LEVELS", GFX_SPECIAL_ARG_LEVELS }, + { ".SCORES", GFX_SPECIAL_ARG_SCORES, }, + { ".EDITOR", GFX_SPECIAL_ARG_EDITOR, }, + { ".INFO", GFX_SPECIAL_ARG_INFO, }, + { ".SETUP", GFX_SPECIAL_ARG_SETUP, }, + { ".PLAYING", GFX_SPECIAL_ARG_PLAYING, }, + { ".DOOR", GFX_SPECIAL_ARG_DOOR, }, + { ".PANEL", GFX_SPECIAL_ARG_PANEL, }, + { ".PREVIEW", GFX_SPECIAL_ARG_PREVIEW, }, + { ".CRUMBLED", GFX_SPECIAL_ARG_CRUMBLED, }, /* empty suffix always matches -- check as last entry in InitMusicInfo() */ - { "", GFX_SPECIAL_ARG_DEFAULT, }, + { "", GFX_SPECIAL_ARG_DEFAULT, }, - { NULL, 0, } + { NULL, 0, } }; -struct TokenIntPtrInfo image_config_vars[] = -{ - { "global.num_toons", &global.num_toons }, - - { "border.draw_masked.TITLE", &border.draw_masked[GFX_SPECIAL_ARG_TITLE] }, - { "border.draw_masked.MAIN", &border.draw_masked[GFX_SPECIAL_ARG_MAIN] }, - { "border.draw_masked.LEVELS", &border.draw_masked[GFX_SPECIAL_ARG_LEVELS] }, - { "border.draw_masked.SCORES", &border.draw_masked[GFX_SPECIAL_ARG_SCORES] }, - { "border.draw_masked.EDITOR", &border.draw_masked[GFX_SPECIAL_ARG_EDITOR] }, - { "border.draw_masked.INFO", &border.draw_masked[GFX_SPECIAL_ARG_INFO] }, - { "border.draw_masked.SETUP", &border.draw_masked[GFX_SPECIAL_ARG_SETUP] }, - { "border.draw_masked.PLAYING",&border.draw_masked[GFX_SPECIAL_ARG_PLAYING] }, - { "border.draw_masked.DOOR", &border.draw_masked[GFX_SPECIAL_ARG_DOOR] }, - - { "title.fade_delay", &title.fade_delay }, - { "title.post_delay", &title.post_delay }, - { "title.auto_delay", &title.auto_delay }, - - { "menu.fade_delay", &menu.fade_delay }, - { "menu.post_delay", &menu.post_delay }, - { "menu.auto_delay", &menu.auto_delay }, - - { "menu.draw_xoffset", &menu.draw_xoffset[GFX_SPECIAL_ARG_DEFAULT] }, - { "menu.draw_yoffset", &menu.draw_yoffset[GFX_SPECIAL_ARG_DEFAULT] }, - { "menu.draw_xoffset.MAIN", &menu.draw_xoffset[GFX_SPECIAL_ARG_MAIN] }, - { "menu.draw_yoffset.MAIN", &menu.draw_yoffset[GFX_SPECIAL_ARG_MAIN] }, - { "menu.draw_xoffset.LEVELS", &menu.draw_xoffset[GFX_SPECIAL_ARG_LEVELS] }, - { "menu.draw_yoffset.LEVELS", &menu.draw_yoffset[GFX_SPECIAL_ARG_LEVELS] }, - { "menu.draw_xoffset.SCORES", &menu.draw_xoffset[GFX_SPECIAL_ARG_SCORES] }, - { "menu.draw_yoffset.SCORES", &menu.draw_yoffset[GFX_SPECIAL_ARG_SCORES] }, - { "menu.draw_xoffset.EDITOR", &menu.draw_xoffset[GFX_SPECIAL_ARG_EDITOR] }, - { "menu.draw_yoffset.EDITOR", &menu.draw_yoffset[GFX_SPECIAL_ARG_EDITOR] }, - { "menu.draw_xoffset.INFO", &menu.draw_xoffset[GFX_SPECIAL_ARG_INFO] }, - { "menu.draw_yoffset.INFO", &menu.draw_yoffset[GFX_SPECIAL_ARG_INFO] }, - { "menu.draw_xoffset.INFO[ELEMENTS]", - &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_ELEMENTS] }, - { "menu.draw_yoffset.INFO[ELEMENTS]", - &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_ELEMENTS] }, - { "menu.draw_xoffset.INFO[MUSIC]", - &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_MUSIC] }, - { "menu.draw_yoffset.INFO[MUSIC]", - &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_MUSIC] }, - { "menu.draw_xoffset.INFO[CREDITS]", - &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_CREDITS] }, - { "menu.draw_yoffset.INFO[CREDITS]", - &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_CREDITS] }, - { "menu.draw_xoffset.INFO[PROGRAM]", - &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_PROGRAM] }, - { "menu.draw_yoffset.INFO[PROGRAM]", - &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_PROGRAM] }, - { "menu.draw_xoffset.INFO[LEVELSET]", - &menu.draw_xoffset_info[GFX_SPECIAL_ARG_INFO_LEVELSET] }, - { "menu.draw_yoffset.INFO[LEVELSET]", - &menu.draw_yoffset_info[GFX_SPECIAL_ARG_INFO_LEVELSET] }, - { "menu.draw_xoffset.SETUP", &menu.draw_xoffset[GFX_SPECIAL_ARG_SETUP] }, - { "menu.draw_yoffset.SETUP", &menu.draw_yoffset[GFX_SPECIAL_ARG_SETUP] }, - - { "menu.scrollbar_xoffset", &menu.scrollbar_xoffset }, - - { "menu.list_size", &menu.list_size[GFX_SPECIAL_ARG_DEFAULT] }, - { "menu.list_size.LEVELS", &menu.list_size[GFX_SPECIAL_ARG_LEVELS] }, - { "menu.list_size.SCORES", &menu.list_size[GFX_SPECIAL_ARG_SCORES] }, - { "menu.list_size.INFO", &menu.list_size[GFX_SPECIAL_ARG_INFO] }, - - { "main.button.name.x", &menu.main.button.name.x }, - { "main.button.name.y", &menu.main.button.name.y }, - { "main.button.levels.x", &menu.main.button.levels.x }, - { "main.button.levels.y", &menu.main.button.levels.y }, - { "main.button.scores.x", &menu.main.button.scores.x }, - { "main.button.scores.y", &menu.main.button.scores.y }, - { "main.button.editor.x", &menu.main.button.editor.x }, - { "main.button.editor.y", &menu.main.button.editor.y }, - { "main.button.info.x", &menu.main.button.info.x }, - { "main.button.info.y", &menu.main.button.info.y }, - { "main.button.game.x", &menu.main.button.game.x }, - { "main.button.game.y", &menu.main.button.game.y }, - { "main.button.setup.x", &menu.main.button.setup.x }, - { "main.button.setup.y", &menu.main.button.setup.y }, - { "main.button.quit.x", &menu.main.button.quit.x }, - { "main.button.quit.y", &menu.main.button.quit.y }, - - { "main.button.prev_level.x", &menu.main.button.prev_level.x }, - { "main.button.prev_level.y", &menu.main.button.prev_level.y }, - { "main.button.next_level.x", &menu.main.button.next_level.x }, - { "main.button.next_level.y", &menu.main.button.next_level.y }, - - { "main.text.name.x", &menu.main.text.name.x }, - { "main.text.name.y", &menu.main.text.name.y }, - { "main.text.name.width", &menu.main.text.name.width }, - { "main.text.name.height", &menu.main.text.name.height }, - { "main.text.name.align", &menu.main.text.name.align }, - { "main.text.levels.x", &menu.main.text.levels.x }, - { "main.text.levels.y", &menu.main.text.levels.y }, - { "main.text.levels.width", &menu.main.text.levels.width }, - { "main.text.levels.height", &menu.main.text.levels.height }, - { "main.text.levels.align", &menu.main.text.levels.align }, - { "main.text.scores.x", &menu.main.text.scores.x }, - { "main.text.scores.y", &menu.main.text.scores.y }, - { "main.text.scores.width", &menu.main.text.scores.width }, - { "main.text.scores.height", &menu.main.text.scores.height }, - { "main.text.scores.align", &menu.main.text.scores.align }, - { "main.text.editor.x", &menu.main.text.editor.x }, - { "main.text.editor.y", &menu.main.text.editor.y }, - { "main.text.editor.width", &menu.main.text.editor.width }, - { "main.text.editor.height", &menu.main.text.editor.height }, - { "main.text.editor.align", &menu.main.text.editor.align }, - { "main.text.info.x", &menu.main.text.info.x }, - { "main.text.info.y", &menu.main.text.info.y }, - { "main.text.info.width", &menu.main.text.info.width }, - { "main.text.info.height", &menu.main.text.info.height }, - { "main.text.info.align", &menu.main.text.info.align }, - { "main.text.game.x", &menu.main.text.game.x }, - { "main.text.game.y", &menu.main.text.game.y }, - { "main.text.game.width", &menu.main.text.game.width }, - { "main.text.game.height", &menu.main.text.game.height }, - { "main.text.game.align", &menu.main.text.game.align }, - { "main.text.setup.x", &menu.main.text.setup.x }, - { "main.text.setup.y", &menu.main.text.setup.y }, - { "main.text.setup.width", &menu.main.text.setup.width }, - { "main.text.setup.height", &menu.main.text.setup.height }, - { "main.text.setup.align", &menu.main.text.setup.align }, - { "main.text.quit.x", &menu.main.text.quit.x }, - { "main.text.quit.y", &menu.main.text.quit.y }, - { "main.text.quit.width", &menu.main.text.quit.width }, - { "main.text.quit.height", &menu.main.text.quit.height }, - { "main.text.quit.align", &menu.main.text.quit.align }, - - { "main.text.current_level.x", &menu.main.text.current_level.x }, - { "main.text.current_level.y", &menu.main.text.current_level.y }, - { "main.text.current_level.align", &menu.main.text.current_level.align }, - { "main.text.first_level.x", &menu.main.text.first_level.x }, - { "main.text.first_level.y", &menu.main.text.first_level.y }, - { "main.text.first_level.align", &menu.main.text.first_level.align }, - { "main.text.last_level.x", &menu.main.text.last_level.x }, - { "main.text.last_level.y", &menu.main.text.last_level.y }, - { "main.text.last_level.align", &menu.main.text.last_level.align }, - { "main.text.level_info_1.x", &menu.main.text.level_info_1.x }, - { "main.text.level_info_1.y", &menu.main.text.level_info_1.y }, - { "main.text.level_info_1.align", &menu.main.text.level_info_1.align }, - { "main.text.level_info_2.x", &menu.main.text.level_info_2.x }, - { "main.text.level_info_2.y", &menu.main.text.level_info_2.y }, - { "main.text.level_info_2.align", &menu.main.text.level_info_2.align }, - { "main.text.title_1.x", &menu.main.text.title_1.x }, - { "main.text.title_1.y", &menu.main.text.title_1.y }, - { "main.text.title_1.align", &menu.main.text.title_1.align }, - { "main.text.title_2.x", &menu.main.text.title_2.x }, - { "main.text.title_2.y", &menu.main.text.title_2.y }, - { "main.text.title_2.align", &menu.main.text.title_2.align }, - { "main.text.title_3.x", &menu.main.text.title_3.x }, - { "main.text.title_3.y", &menu.main.text.title_3.y }, - { "main.text.title_3.align", &menu.main.text.title_3.align }, - - { "main.input.name.x", &menu.main.input.name.x }, - { "main.input.name.y", &menu.main.input.name.y }, - { "main.input.name.align", &menu.main.input.name.align }, - - { "preview.x", &preview.x }, - { "preview.y", &preview.y }, - { "preview.align", &preview.align }, - { "preview.xsize", &preview.xsize }, - { "preview.ysize", &preview.ysize }, - { "preview.xoffset", &preview.xoffset }, - { "preview.yoffset", &preview.yoffset }, - { "preview.tile_size", &preview.tile_size }, - { "preview.step_offset", &preview.step_offset }, - { "preview.step_delay", &preview.step_delay }, - { "preview.anim_mode", &preview.anim_mode }, - - { "door_1.width", &door_1.width }, - { "door_1.height", &door_1.height }, - { "door_1.step_offset", &door_1.step_offset }, - { "door_1.step_delay", &door_1.step_delay }, - { "door_1.anim_mode", &door_1.anim_mode }, - { "door_2.width", &door_2.width }, - { "door_2.height", &door_2.height }, - { "door_2.step_offset", &door_2.step_offset }, - { "door_2.step_delay", &door_2.step_delay }, - { "door_2.anim_mode", &door_2.anim_mode }, - - { "game.panel.level.x", &game.panel.level.x }, - { "game.panel.level.y", &game.panel.level.y }, - { "game.panel.gems.x", &game.panel.gems.x }, - { "game.panel.gems.y", &game.panel.gems.y }, - { "game.panel.inventory.x", &game.panel.inventory.x }, - { "game.panel.inventory.y", &game.panel.inventory.y }, - { "game.panel.keys.x", &game.panel.keys.x }, - { "game.panel.keys.y", &game.panel.keys.y }, - { "game.panel.score.x", &game.panel.score.x }, - { "game.panel.score.y", &game.panel.score.y }, - { "game.panel.time.x", &game.panel.time.x }, - { "game.panel.time.y", &game.panel.time.y }, - - { "[player].boring_delay_fixed", &game.player_boring_delay_fixed }, - { "[player].boring_delay_random", &game.player_boring_delay_random }, - { "[player].sleeping_delay_fixed", &game.player_sleeping_delay_fixed }, - { "[player].sleeping_delay_random", &game.player_sleeping_delay_random }, - - { NULL, NULL, } -}; +#include "conf_var.c" /* include auto-generated data structure definitions */ /* ------------------------------------------------------------------------- */ @@ -4884,6 +5485,10 @@ struct FontInfo font_info[NUM_FONTS + 1] = { "font.level_number" }, { "font.tape_recorder" }, { "font.game_info" }, + { "font.info.elements" }, + { "font.info.levelset" }, + + { NULL } }; diff --git a/src/main.h b/src/main.h index b8430daa..69b9b501 100644 --- a/src/main.h +++ b/src/main.h @@ -34,6 +34,7 @@ #define IMG_SP_EMPTY IMG_SP_EMPTY_SPACE #define IMG_EXPLOSION IMG_DEFAULT_EXPLODING #define IMG_CHAR_START IMG_CHAR_SPACE +#define IMG_STEEL_CHAR_START IMG_STEEL_CHAR_SPACE #define IMG_CUSTOM_START IMG_CUSTOM_1 #define SND_UNDEFINED (-1) @@ -55,15 +56,27 @@ #define MAX_LEV_FIELDX MAX_PLAYFIELD_WIDTH #define MAX_LEV_FIELDY MAX_PLAYFIELD_HEIGHT +#define MIN_SCROLL_DELAY 0 +#define STD_SCROLL_DELAY 3 +#define MAX_SCROLL_DELAY 8 + #define SCREENX(a) ((a) - scroll_x) #define SCREENY(a) ((a) - scroll_y) #define LEVELX(a) ((a) + scroll_x) #define LEVELY(a) ((a) + scroll_y) -#define IN_VIS_FIELD(x,y) ((x)>=0 && (x)=0 &&(y)=BX1 && (x)<=BX2 && (y)>=BY1 &&(y)<=BY2) -#define IN_LEV_FIELD(x,y) ((x)>=0 && (x)=0 &&(y)= 0 && (x) < (xsize) && \ + (y) >= 0 && (y) < (ysize)) +#define IN_FIELD_MINMAX(x, y, xmin, ymin, xmax, ymax) \ + ((x) >= (xmin) && (x) <= (xmax) && \ + (y) >= (ymin) && (y) <= (ymax)) + +#define IN_VIS_FIELD(x, y) IN_FIELD(x, y, SCR_FIELDX, SCR_FIELDY) +#define IN_LEV_FIELD(x, y) IN_FIELD(x, y, lev_fieldx, lev_fieldy) +#define IN_SCR_FIELD(x, y) IN_FIELD_MINMAX(x,y, BX1,BY1, BX2,BY2) /* values for configurable properties (custom elem's only, else pre-defined) */ +/* (never change these values, as they are stored in level files!) */ #define EP_DIGGABLE 0 #define EP_COLLECTIBLE_ONLY 1 #define EP_DONT_RUN_INTO 2 @@ -97,78 +110,81 @@ #define EP_GRAVITY_REACHABLE 30 /* values for pre-defined properties */ +/* (from here on, values can be changed by inserting new values) */ #define EP_PLAYER 32 #define EP_CAN_PASS_MAGIC_WALL 33 -#define EP_SWITCHABLE 34 -#define EP_BD_ELEMENT 35 -#define EP_SP_ELEMENT 36 -#define EP_SB_ELEMENT 37 -#define EP_GEM 38 -#define EP_FOOD_DARK_YAMYAM 39 -#define EP_FOOD_PENGUIN 40 -#define EP_FOOD_PIG 41 -#define EP_HISTORIC_WALL 42 -#define EP_HISTORIC_SOLID 43 -#define EP_CLASSIC_ENEMY 44 -#define EP_BELT 45 -#define EP_BELT_ACTIVE 46 -#define EP_BELT_SWITCH 47 -#define EP_TUBE 48 -#define EP_KEYGATE 49 -#define EP_AMOEBOID 50 -#define EP_AMOEBALIVE 51 -#define EP_HAS_EDITOR_CONTENT 52 -#define EP_CAN_TURN_EACH_MOVE 53 -#define EP_CAN_GROW 54 -#define EP_ACTIVE_BOMB 55 -#define EP_INACTIVE 56 +#define EP_CAN_PASS_DC_MAGIC_WALL 34 +#define EP_SWITCHABLE 35 +#define EP_BD_ELEMENT 36 +#define EP_SP_ELEMENT 37 +#define EP_SB_ELEMENT 38 +#define EP_GEM 39 +#define EP_FOOD_DARK_YAMYAM 40 +#define EP_FOOD_PENGUIN 41 +#define EP_FOOD_PIG 42 +#define EP_HISTORIC_WALL 43 +#define EP_HISTORIC_SOLID 44 +#define EP_CLASSIC_ENEMY 45 +#define EP_BELT 46 +#define EP_BELT_ACTIVE 47 +#define EP_BELT_SWITCH 48 +#define EP_TUBE 49 +#define EP_ACID_POOL 50 +#define EP_KEYGATE 51 +#define EP_AMOEBOID 52 +#define EP_AMOEBALIVE 53 +#define EP_HAS_EDITOR_CONTENT 54 +#define EP_CAN_TURN_EACH_MOVE 55 +#define EP_CAN_GROW 56 +#define EP_ACTIVE_BOMB 57 +#define EP_INACTIVE 58 /* values for special configurable properties (depending on level settings) */ -#define EP_EM_SLIPPERY_WALL 57 +#define EP_EM_SLIPPERY_WALL 59 /* values for special graphics properties (no effect on game engine) */ -#define EP_GFX_CRUMBLED 58 +#define EP_GFX_CRUMBLED 60 /* values for derived properties (determined from properties above) */ -#define EP_ACCESSIBLE_OVER 59 -#define EP_ACCESSIBLE_INSIDE 60 -#define EP_ACCESSIBLE_UNDER 61 -#define EP_WALKABLE 62 -#define EP_PASSABLE 63 -#define EP_ACCESSIBLE 64 -#define EP_COLLECTIBLE 65 -#define EP_SNAPPABLE 66 -#define EP_WALL 67 -#define EP_SOLID_FOR_PUSHING 68 -#define EP_DRAGONFIRE_PROOF 69 -#define EP_EXPLOSION_PROOF 70 -#define EP_CAN_SMASH 71 -#define EP_EXPLODES_3X3_OLD 72 -#define EP_CAN_EXPLODE_BY_FIRE 73 -#define EP_CAN_EXPLODE_SMASHED 74 -#define EP_CAN_EXPLODE_IMPACT 75 -#define EP_SP_PORT 76 -#define EP_CAN_EXPLODE_BY_DRAGONFIRE 77 -#define EP_CAN_EXPLODE_BY_EXPLOSION 78 -#define EP_COULD_MOVE_INTO_ACID 79 -#define EP_MAYBE_DONT_COLLIDE_WITH 80 -#define EP_CAN_BE_CLONED_BY_ANDROID 81 +#define EP_ACCESSIBLE_OVER 61 +#define EP_ACCESSIBLE_INSIDE 62 +#define EP_ACCESSIBLE_UNDER 63 +#define EP_WALKABLE 64 +#define EP_PASSABLE 65 +#define EP_ACCESSIBLE 66 +#define EP_COLLECTIBLE 67 +#define EP_SNAPPABLE 68 +#define EP_WALL 69 +#define EP_SOLID_FOR_PUSHING 70 +#define EP_DRAGONFIRE_PROOF 71 +#define EP_EXPLOSION_PROOF 72 +#define EP_CAN_SMASH 73 +#define EP_EXPLODES_3X3_OLD 74 +#define EP_CAN_EXPLODE_BY_FIRE 75 +#define EP_CAN_EXPLODE_SMASHED 76 +#define EP_CAN_EXPLODE_IMPACT 77 +#define EP_SP_PORT 78 +#define EP_CAN_EXPLODE_BY_DRAGONFIRE 79 +#define EP_CAN_EXPLODE_BY_EXPLOSION 80 +#define EP_COULD_MOVE_INTO_ACID 81 +#define EP_MAYBE_DONT_COLLIDE_WITH 82 +#define EP_CAN_BE_CLONED_BY_ANDROID 83 /* values for internal purpose only (level editor) */ -#define EP_WALK_TO_OBJECT 82 -#define EP_DEADLY 83 -#define EP_EDITOR_CASCADE 84 -#define EP_EDITOR_CASCADE_ACTIVE 85 -#define EP_EDITOR_CASCADE_INACTIVE 86 +#define EP_WALK_TO_OBJECT 84 +#define EP_DEADLY 85 +#define EP_EDITOR_CASCADE 86 +#define EP_EDITOR_CASCADE_ACTIVE 87 +#define EP_EDITOR_CASCADE_INACTIVE 88 /* values for internal purpose only (game engine) */ -#define EP_HAS_ACTION 87 -#define EP_CAN_CHANGE_OR_HAS_ACTION 88 +#define EP_HAS_ACTION 89 +#define EP_CAN_CHANGE_OR_HAS_ACTION 90 /* values for internal purpose only (other) */ -#define EP_OBSOLETE 89 +#define EP_OBSOLETE 91 -#define NUM_ELEMENT_PROPERTIES 90 +#define NUM_ELEMENT_PROPERTIES 92 #define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32) #define EP_BITFIELD_BASE_NR 0 @@ -542,6 +558,7 @@ /* macros for pre-defined properties */ #define ELEM_IS_PLAYER(e) HAS_PROPERTY(e, EP_PLAYER) #define CAN_PASS_MAGIC_WALL(e) HAS_PROPERTY(e, EP_CAN_PASS_MAGIC_WALL) +#define CAN_PASS_DC_MAGIC_WALL(e) HAS_PROPERTY(e, EP_CAN_PASS_DC_MAGIC_WALL) #define IS_SWITCHABLE(e) HAS_PROPERTY(e, EP_SWITCHABLE) #define IS_BD_ELEMENT(e) HAS_PROPERTY(e, EP_BD_ELEMENT) #define IS_SP_ELEMENT(e) HAS_PROPERTY(e, EP_SP_ELEMENT) @@ -557,6 +574,7 @@ #define IS_BELT_ACTIVE(e) HAS_PROPERTY(e, EP_BELT_ACTIVE) #define IS_BELT_SWITCH(e) HAS_PROPERTY(e, EP_BELT_SWITCH) #define IS_TUBE(e) HAS_PROPERTY(e, EP_TUBE) +#define IS_ACID_POOL(e) HAS_PROPERTY(e, EP_ACID_POOL) #define IS_KEYGATE(e) HAS_PROPERTY(e, EP_KEYGATE) #define IS_AMOEBOID(e) HAS_PROPERTY(e, EP_AMOEBOID) #define IS_AMOEBALIVE(e) HAS_PROPERTY(e, EP_AMOEBALIVE) @@ -607,6 +625,18 @@ #define IS_OBSOLETE(e) HAS_PROPERTY(e, EP_OBSOLETE) /* special macros used in game engine */ +#define IS_FILE_ELEMENT(e) ((e) >= 0 && \ + (e) <= NUM_FILE_ELEMENTS) + +#define IS_DRAWABLE_ELEMENT(e) ((e) >= 0 && \ + (e) <= NUM_DRAWABLE_ELEMENTS) + +#define IS_RUNTIME_ELEMENT(e) ((e) >= 0 && \ + (e) <= NUM_RUNTIME_ELEMENTS) + +#define IS_VALID_ELEMENT(e) ((e) >= 0 && \ + (e) <= MAX_NUM_ELEMENTS) + #define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \ (e) <= EL_CUSTOM_END) @@ -635,7 +665,7 @@ #define EM_KEY_NR(e) ((e) - EL_EM_KEY_1) #define EMC_KEY_NR(e) ((e) - EL_EMC_KEY_5 + 4) #define KEY_NR(e) (IS_RND_KEY(e) ? RND_KEY_NR(e) : \ - IS_EM_KEY(e) ? EM_KEY_NR(e) : \ + IS_EM_KEY(e) ? EM_KEY_NR(e) : \ IS_EMC_KEY(e) ? EMC_KEY_NR(e) : 0) #define IS_RND_GATE(e) ((e) >= EL_GATE_1 && \ @@ -682,6 +712,25 @@ IS_EM_GATE_GRAY(e) ? EM_GATE_GRAY_NR(e) : \ IS_EMC_GATE_GRAY(e) ? EMC_GATE_GRAY_NR(e) : 0) +#define IS_ACID_POOL_OR_ACID(e) (IS_ACID_POOL(e) || (e) == EL_ACID) + +#define IS_EMC_PILLAR(e) ((e) >= EL_EMC_WALL_1 && \ + (e) <= EL_EMC_WALL_3) +#define IS_SP_CHIP(e) ((e) == EL_SP_CHIP_SINGLE || \ + (e) == EL_SP_CHIP_LEFT || \ + (e) == EL_SP_CHIP_RIGHT || \ + (e) == EL_SP_CHIP_TOP || \ + (e) == EL_SP_CHIP_BOTTOM) +#define IS_SP_HARDWARE_BASE(e) ((e) == EL_SP_HARDWARE_BASE_1 || \ + (e) == EL_SP_HARDWARE_BASE_2 || \ + (e) == EL_SP_HARDWARE_BASE_3 || \ + (e) == EL_SP_HARDWARE_BASE_4 || \ + (e) == EL_SP_HARDWARE_BASE_5 || \ + (e) == EL_SP_HARDWARE_BASE_6) + +#define IS_DC_STEELWALL_2(e) ((e) >= EL_DC_STEELWALL_2_LEFT && \ + (e) <= EL_DC_STEELWALL_2_SINGLE) + #define GFX_ELEMENT(e) (element_info[e].use_gfx_element ? \ element_info[e].gfx_element : e) @@ -732,9 +781,18 @@ (e) == EL_EMERALD_RED ? EL_DIAMOND : \ (e) == EL_EMERALD_PURPLE ? EL_DIAMOND : \ EL_ROCK) -#define EL_CHANGED2(e) ((e) == EL_ROCK ? EL_BD_DIAMOND : \ +#define EL_CHANGED_BD(e) ((e) == EL_ROCK ? EL_BD_DIAMOND : \ (e) == EL_BD_ROCK ? EL_BD_DIAMOND : \ EL_BD_ROCK) +#define EL_CHANGED_DC(e) ((e) == EL_ROCK ? EL_EMERALD : \ + (e) == EL_BD_ROCK ? EL_BD_DIAMOND : \ + (e) == EL_EMERALD ? EL_DIAMOND : \ + (e) == EL_EMERALD_YELLOW ? EL_DIAMOND : \ + (e) == EL_EMERALD_RED ? EL_DIAMOND : \ + (e) == EL_EMERALD_PURPLE ? EL_DIAMOND : \ + (e) == EL_PEARL ? EL_BOMB : \ + (e) == EL_CRYSTAL ? EL_CRYSTAL : \ + EL_ROCK) #define IS_DRAWABLE(e) ((e) < EL_BLOCKED) #define IS_NOT_DRAWABLE(e) ((e) >= EL_BLOCKED) #define TAPE_IS_EMPTY(x) ((x).length == 0) @@ -778,6 +836,8 @@ #define IS_LOOP_SOUND(s) (sound_info[s].loop) +#define IS_SPECIAL_GFX_ARG(a) ((a) >= 0 && (a) < NUM_SPECIAL_GFX_ARGS) + #define EL_CASCADE_ACTIVE(e) (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 : (e)) #define EL_CASCADE_INACTIVE(e) (IS_EDITOR_CASCADE_ACTIVE(e) ? (e) - 1 : (e)) #define EL_CASCADE_TOGGLE(e) (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 : \ @@ -790,6 +850,11 @@ (d) == MV_UP ? "MV_UP" : \ (d) == MV_DOWN ? "MV_DOWN" : "(various)") +#define ELEMENT_ACTIVE(e) (ActiveElement[e]) +#define BUTTON_ACTIVE(b) (ActiveButton[b]) +#define FONT_ACTIVE(f) (ActiveFont[f]) + + /* fundamental game speed values */ #define MICROLEVEL_SCROLL_DELAY 50 /* delay for scrolling micro level */ #define MICROLEVEL_LABEL_DELAY 250 /* delay for micro level label */ @@ -800,12 +865,11 @@ #define MAX_ELEMENT_NAME_LEN 32 #define MAX_TAPES_PER_SET 1024 #define MAX_SCORE_ENTRIES 100 -#define MAX_NUM_TITLE_SCREENS 5 +#define MAX_NUM_TITLE_IMAGES 5 +#define MAX_NUM_TITLE_MESSAGES 5 #define MAX_NUM_AMOEBA 100 -#define NUM_BELTS 4 -#define NUM_BELT_PARTS 3 #define NUM_ENVELOPES 4 #define MIN_ENVELOPE_XSIZE 1 #define MIN_ENVELOPE_YSIZE 1 @@ -1101,9 +1165,9 @@ #define EL_CRYSTAL 257 #define EL_WALL_PEARL 258 #define EL_WALL_CRYSTAL 259 -#define EL_DOOR_WHITE 260 -#define EL_DOOR_WHITE_GRAY 261 -#define EL_KEY_WHITE 262 +#define EL_DC_GATE_WHITE 260 +#define EL_DC_GATE_WHITE_GRAY 261 +#define EL_DC_KEY_WHITE 262 #define EL_SHIELD_NORMAL 263 #define EL_EXTRA_TIME 264 #define EL_SWITCHGATE_OPEN 265 @@ -1147,13 +1211,13 @@ #define EL_SIGN_STOP 301 #define EL_SIGN_WHEELCHAIR 302 #define EL_SIGN_PARKING 303 -#define EL_SIGN_ONEWAY 304 -#define EL_SIGN_HEART 305 -#define EL_SIGN_TRIANGLE 306 -#define EL_SIGN_ROUND 307 -#define EL_SIGN_EXIT 308 -#define EL_SIGN_YINYANG 309 -#define EL_SIGN_OTHER 310 +#define EL_SIGN_NO_ENTRY 304 +#define EL_SIGN_UNUSED_1 305 +#define EL_SIGN_GIVE_WAY 306 +#define EL_SIGN_ENTRY_FORBIDDEN 307 +#define EL_SIGN_EMERGENCY_EXIT 308 +#define EL_SIGN_YIN_YANG 309 +#define EL_SIGN_UNUSED_2 310 #define EL_MOLE_LEFT 311 #define EL_MOLE_RIGHT 312 #define EL_MOLE_UP 313 @@ -1322,7 +1386,80 @@ #define EL_NEXT_CE_8 730 #define EL_ANY_ELEMENT 731 -#define NUM_FILE_ELEMENTS 732 +#define EL_STEEL_CHAR_START 732 +#define EL_STEEL_CHAR_ASCII0 (EL_STEEL_CHAR_START - 32) +#define EL_STEEL_CHAR_ASCII0_START (EL_STEEL_CHAR_ASCII0 + 32) + +/* (auto-generated data structure definitions included with normal chars) */ + +#define EL_STEEL_CHAR_ASCII0_END (EL_STEEL_CHAR_ASCII0 + 111) +#define EL_STEEL_CHAR_END (EL_STEEL_CHAR_START + 79) + +#define EL_STEEL_CHAR(c) (EL_STEEL_CHAR_ASCII0+MAP_FONT_ASCII(c)) + +#define EL_SPERMS 812 +#define EL_BULLET 813 +#define EL_HEART 814 +#define EL_CROSS 815 +#define EL_FRANKIE 816 +#define EL_SIGN_SPERMS 817 +#define EL_SIGN_BULLET 818 +#define EL_SIGN_HEART 819 +#define EL_SIGN_CROSS 820 +#define EL_SIGN_FRANKIE 821 + +#define EL_STEEL_EXIT_CLOSED 822 +#define EL_STEEL_EXIT_OPEN 823 + +#define EL_DC_STEELWALL_1_LEFT 824 +#define EL_DC_STEELWALL_1_RIGHT 825 +#define EL_DC_STEELWALL_1_TOP 826 +#define EL_DC_STEELWALL_1_BOTTOM 827 +#define EL_DC_STEELWALL_1_HORIZONTAL 828 +#define EL_DC_STEELWALL_1_VERTICAL 829 +#define EL_DC_STEELWALL_1_TOPLEFT 830 +#define EL_DC_STEELWALL_1_TOPRIGHT 831 +#define EL_DC_STEELWALL_1_BOTTOMLEFT 832 +#define EL_DC_STEELWALL_1_BOTTOMRIGHT 833 +#define EL_DC_STEELWALL_1_TOPLEFT_2 834 +#define EL_DC_STEELWALL_1_TOPRIGHT_2 835 +#define EL_DC_STEELWALL_1_BOTTOMLEFT_2 836 +#define EL_DC_STEELWALL_1_BOTTOMRIGHT_2 837 + +#define EL_DC_STEELWALL_2_LEFT 838 +#define EL_DC_STEELWALL_2_RIGHT 839 +#define EL_DC_STEELWALL_2_TOP 840 +#define EL_DC_STEELWALL_2_BOTTOM 841 +#define EL_DC_STEELWALL_2_HORIZONTAL 842 +#define EL_DC_STEELWALL_2_VERTICAL 843 +#define EL_DC_STEELWALL_2_MIDDLE 844 +#define EL_DC_STEELWALL_2_SINGLE 845 + +#define EL_DC_SWITCHGATE_SWITCH_UP 846 +#define EL_DC_SWITCHGATE_SWITCH_DOWN 847 +#define EL_DC_TIMEGATE_SWITCH 848 +#define EL_DC_TIMEGATE_SWITCH_ACTIVE 849 + +#define EL_DC_LANDMINE 850 + +#define EL_EXPANDABLE_STEELWALL 851 +#define EL_EXPANDABLE_STEELWALL_HORIZONTAL 852 +#define EL_EXPANDABLE_STEELWALL_VERTICAL 853 +#define EL_EXPANDABLE_STEELWALL_ANY 854 + +#define EL_EM_EXIT_CLOSED 855 +#define EL_EM_EXIT_OPEN 856 +#define EL_EM_STEEL_EXIT_CLOSED 857 +#define EL_EM_STEEL_EXIT_OPEN 858 + +#define EL_DC_GATE_FAKE_GRAY 859 + +#define EL_DC_MAGIC_WALL 860 + +#define EL_QUICKSAND_FAST_EMPTY 861 +#define EL_QUICKSAND_FAST_FULL 862 + +#define NUM_FILE_ELEMENTS 863 /* "real" (and therefore drawable) runtime elements */ @@ -1356,41 +1493,55 @@ #define EL_CONVEYOR_BELT_4_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 25) #define EL_EXIT_OPENING (EL_FIRST_RUNTIME_REAL + 26) #define EL_EXIT_CLOSING (EL_FIRST_RUNTIME_REAL + 27) -#define EL_SP_EXIT_OPENING (EL_FIRST_RUNTIME_REAL + 28) -#define EL_SP_EXIT_CLOSING (EL_FIRST_RUNTIME_REAL + 29) -#define EL_SP_EXIT_OPEN (EL_FIRST_RUNTIME_REAL + 30) -#define EL_SP_TERMINAL_ACTIVE (EL_FIRST_RUNTIME_REAL + 31) -#define EL_SP_BUGGY_BASE_ACTIVATING (EL_FIRST_RUNTIME_REAL + 32) -#define EL_SP_BUGGY_BASE_ACTIVE (EL_FIRST_RUNTIME_REAL + 33) -#define EL_SP_MURPHY_CLONE (EL_FIRST_RUNTIME_REAL + 34) -#define EL_AMOEBA_DROPPING (EL_FIRST_RUNTIME_REAL + 35) -#define EL_QUICKSAND_EMPTYING (EL_FIRST_RUNTIME_REAL + 36) -#define EL_MAGIC_WALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 37) -#define EL_BD_MAGIC_WALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 38) -#define EL_MAGIC_WALL_FULL (EL_FIRST_RUNTIME_REAL + 39) -#define EL_BD_MAGIC_WALL_FULL (EL_FIRST_RUNTIME_REAL + 40) -#define EL_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 41) -#define EL_BD_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 42) -#define EL_MAGIC_WALL_DEAD (EL_FIRST_RUNTIME_REAL + 43) -#define EL_BD_MAGIC_WALL_DEAD (EL_FIRST_RUNTIME_REAL + 44) -#define EL_EMC_FAKE_GRASS_ACTIVE (EL_FIRST_RUNTIME_REAL + 45) -#define EL_GATE_1_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 46) -#define EL_GATE_2_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 47) -#define EL_GATE_3_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 48) -#define EL_GATE_4_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 49) -#define EL_EM_GATE_1_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 50) -#define EL_EM_GATE_2_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 51) -#define EL_EM_GATE_3_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 52) -#define EL_EM_GATE_4_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 53) -#define EL_EMC_GATE_5_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 54) -#define EL_EMC_GATE_6_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 55) -#define EL_EMC_GATE_7_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 56) -#define EL_EMC_GATE_8_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 57) -#define EL_EMC_DRIPPER_ACTIVE (EL_FIRST_RUNTIME_REAL + 58) -#define EL_EMC_SPRING_BUMPER_ACTIVE (EL_FIRST_RUNTIME_REAL + 59) +#define EL_STEEL_EXIT_OPENING (EL_FIRST_RUNTIME_REAL + 28) +#define EL_STEEL_EXIT_CLOSING (EL_FIRST_RUNTIME_REAL + 29) +#define EL_EM_EXIT_OPENING (EL_FIRST_RUNTIME_REAL + 30) +#define EL_EM_EXIT_CLOSING (EL_FIRST_RUNTIME_REAL + 31) +#define EL_EM_STEEL_EXIT_OPENING (EL_FIRST_RUNTIME_REAL + 32) +#define EL_EM_STEEL_EXIT_CLOSING (EL_FIRST_RUNTIME_REAL + 33) +#define EL_SP_EXIT_OPENING (EL_FIRST_RUNTIME_REAL + 34) +#define EL_SP_EXIT_CLOSING (EL_FIRST_RUNTIME_REAL + 35) +#define EL_SP_EXIT_OPEN (EL_FIRST_RUNTIME_REAL + 36) +#define EL_SP_TERMINAL_ACTIVE (EL_FIRST_RUNTIME_REAL + 37) +#define EL_SP_BUGGY_BASE_ACTIVATING (EL_FIRST_RUNTIME_REAL + 38) +#define EL_SP_BUGGY_BASE_ACTIVE (EL_FIRST_RUNTIME_REAL + 39) +#define EL_SP_MURPHY_CLONE (EL_FIRST_RUNTIME_REAL + 40) +#define EL_AMOEBA_DROPPING (EL_FIRST_RUNTIME_REAL + 41) +#define EL_QUICKSAND_EMPTYING (EL_FIRST_RUNTIME_REAL + 42) +#define EL_QUICKSAND_FAST_EMPTYING (EL_FIRST_RUNTIME_REAL + 43) +#define EL_MAGIC_WALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 44) +#define EL_BD_MAGIC_WALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 45) +#define EL_DC_MAGIC_WALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 46) +#define EL_MAGIC_WALL_FULL (EL_FIRST_RUNTIME_REAL + 47) +#define EL_BD_MAGIC_WALL_FULL (EL_FIRST_RUNTIME_REAL + 48) +#define EL_DC_MAGIC_WALL_FULL (EL_FIRST_RUNTIME_REAL + 49) +#define EL_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 50) +#define EL_BD_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 51) +#define EL_DC_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 52) +#define EL_MAGIC_WALL_DEAD (EL_FIRST_RUNTIME_REAL + 53) +#define EL_BD_MAGIC_WALL_DEAD (EL_FIRST_RUNTIME_REAL + 54) +#define EL_DC_MAGIC_WALL_DEAD (EL_FIRST_RUNTIME_REAL + 55) +#define EL_EMC_FAKE_GRASS_ACTIVE (EL_FIRST_RUNTIME_REAL + 56) +#define EL_GATE_1_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 57) +#define EL_GATE_2_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 58) +#define EL_GATE_3_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 59) +#define EL_GATE_4_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 60) +#define EL_EM_GATE_1_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 61) +#define EL_EM_GATE_2_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 62) +#define EL_EM_GATE_3_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 63) +#define EL_EM_GATE_4_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 64) +#define EL_EMC_GATE_5_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 65) +#define EL_EMC_GATE_6_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 66) +#define EL_EMC_GATE_7_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 67) +#define EL_EMC_GATE_8_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 68) +#define EL_DC_GATE_WHITE_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 69) +#define EL_EMC_DRIPPER_ACTIVE (EL_FIRST_RUNTIME_REAL + 70) +#define EL_EMC_SPRING_BUMPER_ACTIVE (EL_FIRST_RUNTIME_REAL + 71) + +#define NUM_DRAWABLE_ELEMENTS (EL_FIRST_RUNTIME_REAL + 72) /* "unreal" (and therefore not drawable) runtime elements */ -#define EL_FIRST_RUNTIME_UNREAL (EL_FIRST_RUNTIME_REAL + 60) +#define EL_FIRST_RUNTIME_UNREAL (NUM_DRAWABLE_ELEMENTS) #define EL_BLOCKED (EL_FIRST_RUNTIME_UNREAL + 0) #define EL_EXPLOSION (EL_FIRST_RUNTIME_UNREAL + 1) @@ -1401,20 +1552,23 @@ #define EL_AMOEBA_GROWING (EL_FIRST_RUNTIME_UNREAL + 6) #define EL_AMOEBA_SHRINKING (EL_FIRST_RUNTIME_UNREAL + 7) #define EL_EXPANDABLE_WALL_GROWING (EL_FIRST_RUNTIME_UNREAL + 8) -#define EL_FLAMES (EL_FIRST_RUNTIME_UNREAL + 9) -#define EL_PLAYER_IS_LEAVING (EL_FIRST_RUNTIME_UNREAL + 10) -#define EL_PLAYER_IS_EXPLODING_1 (EL_FIRST_RUNTIME_UNREAL + 11) -#define EL_PLAYER_IS_EXPLODING_2 (EL_FIRST_RUNTIME_UNREAL + 12) -#define EL_PLAYER_IS_EXPLODING_3 (EL_FIRST_RUNTIME_UNREAL + 13) -#define EL_PLAYER_IS_EXPLODING_4 (EL_FIRST_RUNTIME_UNREAL + 14) -#define EL_QUICKSAND_FILLING (EL_FIRST_RUNTIME_UNREAL + 15) -#define EL_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 16) -#define EL_BD_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 17) -#define EL_ELEMENT_SNAPPING (EL_FIRST_RUNTIME_UNREAL + 18) -#define EL_DIAGONAL_SHRINKING (EL_FIRST_RUNTIME_UNREAL + 19) -#define EL_DIAGONAL_GROWING (EL_FIRST_RUNTIME_UNREAL + 20) - -#define NUM_RUNTIME_ELEMENTS (EL_FIRST_RUNTIME_UNREAL + 21) +#define EL_EXPANDABLE_STEELWALL_GROWING (EL_FIRST_RUNTIME_UNREAL + 9) +#define EL_FLAMES (EL_FIRST_RUNTIME_UNREAL + 10) +#define EL_PLAYER_IS_LEAVING (EL_FIRST_RUNTIME_UNREAL + 11) +#define EL_PLAYER_IS_EXPLODING_1 (EL_FIRST_RUNTIME_UNREAL + 12) +#define EL_PLAYER_IS_EXPLODING_2 (EL_FIRST_RUNTIME_UNREAL + 13) +#define EL_PLAYER_IS_EXPLODING_3 (EL_FIRST_RUNTIME_UNREAL + 14) +#define EL_PLAYER_IS_EXPLODING_4 (EL_FIRST_RUNTIME_UNREAL + 15) +#define EL_QUICKSAND_FILLING (EL_FIRST_RUNTIME_UNREAL + 16) +#define EL_QUICKSAND_FAST_FILLING (EL_FIRST_RUNTIME_UNREAL + 17) +#define EL_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 18) +#define EL_BD_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 19) +#define EL_DC_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 20) +#define EL_ELEMENT_SNAPPING (EL_FIRST_RUNTIME_UNREAL + 21) +#define EL_DIAGONAL_SHRINKING (EL_FIRST_RUNTIME_UNREAL + 22) +#define EL_DIAGONAL_GROWING (EL_FIRST_RUNTIME_UNREAL + 23) + +#define NUM_RUNTIME_ELEMENTS (EL_FIRST_RUNTIME_UNREAL + 24) /* dummy elements (never used as game elements, only used as graphics) */ #define EL_FIRST_DUMMY NUM_RUNTIME_ELEMENTS @@ -1444,9 +1598,17 @@ #define EL_BD_DEFAULT (EL_FIRST_DUMMY + 22) #define EL_SP_DEFAULT (EL_FIRST_DUMMY + 23) #define EL_SB_DEFAULT (EL_FIRST_DUMMY + 24) +#define EL_GRAPHIC_1 (EL_FIRST_DUMMY + 25) +#define EL_GRAPHIC_2 (EL_FIRST_DUMMY + 26) +#define EL_GRAPHIC_3 (EL_FIRST_DUMMY + 27) +#define EL_GRAPHIC_4 (EL_FIRST_DUMMY + 28) +#define EL_GRAPHIC_5 (EL_FIRST_DUMMY + 29) +#define EL_GRAPHIC_6 (EL_FIRST_DUMMY + 30) +#define EL_GRAPHIC_7 (EL_FIRST_DUMMY + 31) +#define EL_GRAPHIC_8 (EL_FIRST_DUMMY + 32) /* internal elements (only used for internal purposes like copying) */ -#define EL_FIRST_INTERNAL (EL_FIRST_DUMMY + 25) +#define EL_FIRST_INTERNAL (EL_FIRST_DUMMY + 33) #define EL_INTERNAL_CLIPBOARD_CUSTOM (EL_FIRST_INTERNAL + 0) #define EL_INTERNAL_CLIPBOARD_CHANGE (EL_FIRST_INTERNAL + 1) @@ -1471,23 +1633,25 @@ #define EL_INTERNAL_CASCADE_DX_ACTIVE (EL_FIRST_INTERNAL + 19) #define EL_INTERNAL_CASCADE_CHARS (EL_FIRST_INTERNAL + 20) #define EL_INTERNAL_CASCADE_CHARS_ACTIVE (EL_FIRST_INTERNAL + 21) -#define EL_INTERNAL_CASCADE_CE (EL_FIRST_INTERNAL + 22) -#define EL_INTERNAL_CASCADE_CE_ACTIVE (EL_FIRST_INTERNAL + 23) -#define EL_INTERNAL_CASCADE_GE (EL_FIRST_INTERNAL + 24) -#define EL_INTERNAL_CASCADE_GE_ACTIVE (EL_FIRST_INTERNAL + 25) -#define EL_INTERNAL_CASCADE_REF (EL_FIRST_INTERNAL + 26) -#define EL_INTERNAL_CASCADE_REF_ACTIVE (EL_FIRST_INTERNAL + 27) -#define EL_INTERNAL_CASCADE_USER (EL_FIRST_INTERNAL + 28) -#define EL_INTERNAL_CASCADE_USER_ACTIVE (EL_FIRST_INTERNAL + 29) -#define EL_INTERNAL_CASCADE_DYNAMIC (EL_FIRST_INTERNAL + 30) -#define EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE (EL_FIRST_INTERNAL + 31) +#define EL_INTERNAL_CASCADE_STEEL_CHARS (EL_FIRST_INTERNAL + 22) +#define EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE (EL_FIRST_INTERNAL + 23) +#define EL_INTERNAL_CASCADE_CE (EL_FIRST_INTERNAL + 24) +#define EL_INTERNAL_CASCADE_CE_ACTIVE (EL_FIRST_INTERNAL + 25) +#define EL_INTERNAL_CASCADE_GE (EL_FIRST_INTERNAL + 26) +#define EL_INTERNAL_CASCADE_GE_ACTIVE (EL_FIRST_INTERNAL + 27) +#define EL_INTERNAL_CASCADE_REF (EL_FIRST_INTERNAL + 28) +#define EL_INTERNAL_CASCADE_REF_ACTIVE (EL_FIRST_INTERNAL + 29) +#define EL_INTERNAL_CASCADE_USER (EL_FIRST_INTERNAL + 30) +#define EL_INTERNAL_CASCADE_USER_ACTIVE (EL_FIRST_INTERNAL + 31) +#define EL_INTERNAL_CASCADE_DYNAMIC (EL_FIRST_INTERNAL + 32) +#define EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE (EL_FIRST_INTERNAL + 33) #define EL_INTERNAL_CLIPBOARD_START (EL_FIRST_INTERNAL + 0) #define EL_INTERNAL_CLIPBOARD_END (EL_FIRST_INTERNAL + 2) #define EL_INTERNAL_START (EL_FIRST_INTERNAL + 0) -#define EL_INTERNAL_END (EL_FIRST_INTERNAL + 31) +#define EL_INTERNAL_END (EL_FIRST_INTERNAL + 33) -#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 32) +#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 34) /* values for graphics/sounds action types */ @@ -1585,20 +1749,22 @@ /* values for special image configuration suffixes (must match game mode) */ #define GFX_SPECIAL_ARG_DEFAULT 0 -#define GFX_SPECIAL_ARG_TITLE 1 -#define GFX_SPECIAL_ARG_MESSAGE 2 -#define GFX_SPECIAL_ARG_MAIN 3 -#define GFX_SPECIAL_ARG_LEVELS 4 -#define GFX_SPECIAL_ARG_SCORES 5 -#define GFX_SPECIAL_ARG_EDITOR 6 -#define GFX_SPECIAL_ARG_INFO 7 -#define GFX_SPECIAL_ARG_SETUP 8 -#define GFX_SPECIAL_ARG_PLAYING 9 -#define GFX_SPECIAL_ARG_DOOR 10 -#define GFX_SPECIAL_ARG_PREVIEW 11 -#define GFX_SPECIAL_ARG_CRUMBLED 12 - -#define NUM_SPECIAL_GFX_ARGS 13 +#define GFX_SPECIAL_ARG_LOADING 1 +#define GFX_SPECIAL_ARG_TITLE_INITIAL 2 +#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_PANEL 12 +#define GFX_SPECIAL_ARG_PREVIEW 13 +#define GFX_SPECIAL_ARG_CRUMBLED 14 + +#define NUM_SPECIAL_GFX_ARGS 15 /* these additional definitions are currently only used for draw offsets */ #define GFX_SPECIAL_ARG_INFO_MAIN 0 @@ -1607,9 +1773,25 @@ #define GFX_SPECIAL_ARG_INFO_MUSIC 3 #define GFX_SPECIAL_ARG_INFO_CREDITS 4 #define GFX_SPECIAL_ARG_INFO_PROGRAM 5 -#define GFX_SPECIAL_ARG_INFO_LEVELSET 6 +#define GFX_SPECIAL_ARG_INFO_VERSION 6 +#define GFX_SPECIAL_ARG_INFO_LEVELSET 7 + +#define NUM_SPECIAL_GFX_INFO_ARGS 8 + +/* these additional definitions are currently only used for draw offsets */ +#define GFX_SPECIAL_ARG_SETUP_MAIN 0 +#define GFX_SPECIAL_ARG_SETUP_GAME 1 +#define GFX_SPECIAL_ARG_SETUP_EDITOR 2 +#define GFX_SPECIAL_ARG_SETUP_GRAPHICS 3 +#define GFX_SPECIAL_ARG_SETUP_SOUND 4 +#define GFX_SPECIAL_ARG_SETUP_ARTWORK 5 +#define GFX_SPECIAL_ARG_SETUP_INPUT 6 +#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_1 7 +#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_2 8 +#define GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK 9 +#define GFX_SPECIAL_ARG_SETUP_CHOOSE_OTHER 10 -#define NUM_SPECIAL_GFX_INFO_ARGS 7 +#define NUM_SPECIAL_GFX_SETUP_ARGS 11 /* values for image configuration suffixes */ @@ -1652,11 +1834,15 @@ #define GFX_ARG_NAME 36 #define GFX_ARG_SCALE_UP_FACTOR 37 #define GFX_ARG_CLONE_FROM 38 -#define GFX_ARG_FADE_DELAY 39 -#define GFX_ARG_POST_DELAY 40 -#define GFX_ARG_AUTO_DELAY 41 +#define GFX_ARG_FADE_MODE 39 +#define GFX_ARG_FADE_DELAY 40 +#define GFX_ARG_POST_DELAY 41 +#define GFX_ARG_AUTO_DELAY 42 +#define GFX_ARG_ALIGN 43 +#define GFX_ARG_VALIGN 44 +#define GFX_ARG_SORT_PRIORITY 45 -#define NUM_GFX_ARGS 42 +#define NUM_GFX_ARGS 46 /* values for sound configuration suffixes */ @@ -1709,10 +1895,13 @@ #define FONT_LEVEL_NUMBER 32 #define FONT_TAPE_RECORDER 33 #define FONT_GAME_INFO 34 +#define FONT_INFO_ELEMENTS 35 +#define FONT_INFO_LEVELSET 36 -#define NUM_FONTS 35 +#define NUM_FONTS 37 #define NUM_INITIAL_FONTS 4 +#if 0 #define FONT_ACTIVE(f) \ ((f) == FONT_MENU_1 ? FONT_MENU_1_ACTIVE : \ (f) == FONT_MENU_2 ? FONT_MENU_2_ACTIVE : \ @@ -1724,26 +1913,28 @@ (f) == FONT_INPUT_2 ? FONT_INPUT_2_ACTIVE : \ (f) == FONT_LEVEL_NUMBER ? FONT_LEVEL_NUMBER_ACTIVE : \ (f)) - +#endif /* values for game_status (must match special image configuration suffixes) */ #define GAME_MODE_DEFAULT 0 -#define GAME_MODE_TITLE 1 -#define GAME_MODE_MESSAGE 2 -#define GAME_MODE_MAIN 3 -#define GAME_MODE_LEVELS 4 -#define GAME_MODE_SCORES 5 -#define GAME_MODE_EDITOR 6 -#define GAME_MODE_INFO 7 -#define GAME_MODE_SETUP 8 -#define GAME_MODE_PLAYING 9 -#define GAME_MODE_PSEUDO_DOOR 10 -#define GAME_MODE_PSEUDO_PREVIEW 11 -#define GAME_MODE_PSEUDO_CRUMBLED 12 +#define GAME_MODE_LOADING 1 +#define GAME_MODE_TITLE_INITIAL 2 +#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_PANEL 12 +#define GAME_MODE_PSEUDO_PREVIEW 13 +#define GAME_MODE_PSEUDO_CRUMBLED 14 /* there are no special config file suffixes for these modes */ -#define GAME_MODE_PSEUDO_TYPENAME 13 -#define GAME_MODE_QUIT 14 +#define GAME_MODE_PSEUDO_TYPENAME 15 +#define GAME_MODE_QUIT 16 /* special definitions currently only used for custom artwork configuration */ #define MUSIC_PREFIX_BACKGROUND 0 @@ -1758,15 +1949,23 @@ /* program information and versioning definitions */ #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 2 -#define PROGRAM_VERSION_PATCH 3 -#define PROGRAM_VERSION_BUILD 0 +#define PROGRAM_VERSION_PATCH 4 +#define PROGRAM_VERSION_BUILD 3 #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" -#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2006 by Holger Schemel" +#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2007 by Holger Schemel" #define PROGRAM_EMAIL_STRING "info@artsoft.org" #define PROGRAM_WEBSITE_STRING "http://www.artsoft.org/" #define PROGRAM_GAME_BY_STRING "A Game by Artsoft Entertainment" +#define PROGRAM_UNIX_DATADIR_STRING ".rocksndiamonds" + +#if CREATE_SPECIAL_EDITION_RND_JUE +#undef PROGRAM_TITLE_STRING +#define PROGRAM_TITLE_STRING "R'n'D - jue" +#undef PROGRAM_UNIX_DATADIR_STRING +#define PROGRAM_UNIX_DATADIR_STRING ".rocksndiamonds-jue" +#endif #define ICON_TITLE_STRING PROGRAM_TITLE_STRING #define COOKIE_PREFIX "ROCKSNDIAMONDS" @@ -1774,7 +1973,7 @@ #define USERDATA_DIRECTORY_WIN32 PROGRAM_TITLE_STRING #define USERDATA_DIRECTORY_MACOSX PROGRAM_TITLE_STRING -#define USERDATA_DIRECTORY_UNIX ".rocksndiamonds" +#define USERDATA_DIRECTORY_UNIX PROGRAM_UNIX_DATADIR_STRING #define USERDATA_DIRECTORY_DOS "userdata" #if defined(PLATFORM_WIN32) @@ -1849,14 +2048,8 @@ struct BorderInfo { - int draw_masked[NUM_SPECIAL_GFX_ARGS]; -}; - -struct MenuPosInfo -{ - int x, y; - int width, height; - int align; + boolean draw_masked[NUM_SPECIAL_GFX_ARGS]; + boolean draw_masked_when_fading; }; struct MenuMainButtonInfo @@ -1876,28 +2069,34 @@ struct MenuMainButtonInfo struct MenuMainTextInfo { - struct MenuPosInfo name; - struct MenuPosInfo levels; - struct MenuPosInfo scores; - struct MenuPosInfo editor; - struct MenuPosInfo info; - struct MenuPosInfo game; - struct MenuPosInfo setup; - struct MenuPosInfo quit; - - struct MenuPosInfo current_level; - struct MenuPosInfo first_level; - struct MenuPosInfo last_level; - struct MenuPosInfo level_info_1; - struct MenuPosInfo level_info_2; - struct MenuPosInfo title_1; - struct MenuPosInfo title_2; - struct MenuPosInfo title_3; + struct TextPosInfo name; + struct TextPosInfo levels; + struct TextPosInfo scores; + struct TextPosInfo editor; + struct TextPosInfo info; + struct TextPosInfo game; + struct TextPosInfo setup; + struct TextPosInfo quit; + + struct TextPosInfo first_level; + struct TextPosInfo last_level; + struct TextPosInfo level_number; + struct TextPosInfo level_info_1; + struct TextPosInfo level_info_2; + struct TextPosInfo level_name; + struct TextPosInfo level_author; + struct TextPosInfo level_year; + struct TextPosInfo level_imported_from; + struct TextPosInfo level_imported_by; + struct TextPosInfo level_tested_by; + struct TextPosInfo title_1; + struct TextPosInfo title_2; + struct TextPosInfo title_3; }; struct MenuMainInputInfo { - struct MenuPosInfo name; + struct TextPosInfo name; }; struct MenuMainInfo @@ -1907,15 +2106,35 @@ struct MenuMainInfo struct MenuMainInputInfo input; }; -struct TitleInfo +struct TitleFadingInfo { + int fade_mode; int fade_delay; int post_delay; int auto_delay; +}; - int fade_delay_final; - int post_delay_final; - int auto_delay_final; +struct TitleMessageInfo +{ + int x, y; + int width, height; + int chars, lines; + int align, valign; + int font; + boolean autowrap; + boolean centered; + boolean parse_comments; + int sort_priority; + + int fade_mode; + int fade_delay; + int post_delay; + int auto_delay; +}; + +struct InitInfo +{ + struct MenuPosInfo busy; }; struct MenuInfo @@ -1924,14 +2143,18 @@ struct MenuInfo int draw_yoffset[NUM_SPECIAL_GFX_ARGS]; int draw_xoffset_info[NUM_SPECIAL_GFX_INFO_ARGS]; int draw_yoffset_info[NUM_SPECIAL_GFX_INFO_ARGS]; + int draw_xoffset_setup[NUM_SPECIAL_GFX_SETUP_ARGS]; + int draw_yoffset_setup[NUM_SPECIAL_GFX_SETUP_ARGS]; int scrollbar_xoffset; int list_size[NUM_SPECIAL_GFX_ARGS]; - int fade_delay; - int post_delay; - int auto_delay; + struct TitleFadingInfo enter_menu; + struct TitleFadingInfo leave_menu; + struct TitleFadingInfo enter_screen[NUM_SPECIAL_GFX_ARGS]; + struct TitleFadingInfo leave_screen[NUM_SPECIAL_GFX_ARGS]; + struct TitleFadingInfo next_screen; int sound[NUM_SPECIAL_GFX_ARGS]; int music[NUM_SPECIAL_GFX_ARGS]; @@ -1951,7 +2174,7 @@ struct DoorInfo struct PreviewInfo { int x, y; - int align; + int align, valign; int xsize, ysize; int xoffset, yoffset; int tile_size; @@ -1976,6 +2199,9 @@ struct EnvelopeInfo int xsize; int ysize; + boolean autowrap; + boolean centered; + char text[MAX_ENVELOPE_TEXT_LEN + 1]; }; @@ -2090,6 +2316,7 @@ struct LevelInfo boolean use_spring_bug; /* for compatibility with old levels */ boolean use_time_orb_bug; /* for compatibility with old levels */ boolean instant_relocation; /* no visual delay when relocating player */ + boolean shifted_relocation; /* no level centering when relocating player */ boolean can_pass_to_walkable; /* player can pass to empty or walkable tile */ boolean grow_into_diggable; /* amoeba can grow into anything diggable */ @@ -2124,6 +2351,13 @@ struct GlobalInfo float frames_per_second; boolean fps_slowdown; int fps_slowdown_factor; + + /* global values for fading screens and masking borders */ + int border_status; +#if 0 + int fading_status; + int fading_type; +#endif }; struct ElementChangeInfo @@ -2169,6 +2403,7 @@ struct ElementChangeInfo short actual_trigger_element; /* element that actually triggered change */ int actual_trigger_side; /* element side that triggered the change */ int actual_trigger_player; /* player which actually triggered change */ + int actual_trigger_player_bits; /* player bits of triggering players */ int actual_trigger_ce_value; /* CE value of element that triggered change */ int actual_trigger_ce_score; /* CE score of element that triggered change */ @@ -2289,6 +2524,9 @@ struct ElementInfo int collect_score; /* runtime score value for collecting */ + /* count of this element on playfield, calculated after each frame */ + int element_count; + /* ---------- internal values used in level editor ---------- */ int access_type; /* walkable or passable */ @@ -2361,9 +2599,12 @@ struct GraphicInfo int draw_masked; /* optional setting for drawing envelope gfx */ + int fade_mode; /* optional setting for drawing title screens */ int fade_delay; /* optional setting for drawing title screens */ int post_delay; /* optional setting for drawing title screens */ int auto_delay; /* optional setting for drawing title screens */ + int align, valign; /* optional setting for drawing title screens */ + int sort_priority; /* optional setting for drawing title screens */ boolean use_image_size; /* use image size as default width and height */ @@ -2445,6 +2686,7 @@ extern Bitmap *bitmap_db_cross; extern Bitmap *bitmap_db_field; extern Bitmap *bitmap_db_panel; extern Bitmap *bitmap_db_door; +extern Bitmap *bitmap_db_toons; extern Pixmap tile_clipmask[]; extern DrawBuffer *fieldbuffer; extern DrawBuffer *drawto_field; @@ -2497,6 +2739,10 @@ extern int GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern int GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; extern int GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY]; +extern int ActiveElement[MAX_NUM_ELEMENTS]; +extern int ActiveButton[NUM_IMAGE_FILES]; +extern int ActiveFont[NUM_FONTS]; + extern int lev_fieldx, lev_fieldy; extern int scroll_x, scroll_y; @@ -2526,7 +2772,16 @@ extern struct HiScore highscore[]; extern struct TapeInfo tape; extern struct GlobalInfo global; extern struct BorderInfo border; -extern struct TitleInfo title; +extern struct TitleFadingInfo fading; +extern struct TitleFadingInfo fading_none; +extern struct TitleFadingInfo title_initial_default; +extern struct TitleFadingInfo title_default; +extern struct TitleMessageInfo titlemessage_initial_default; +extern struct TitleMessageInfo titlemessage_initial[]; +extern struct TitleMessageInfo titlemessage_default; +extern struct TitleMessageInfo titlemessage[]; +extern struct TitleMessageInfo readme; +extern struct InitInfo init; extern struct MenuInfo menu; extern struct DoorInfo door_1, door_2; extern struct PreviewInfo preview; @@ -2544,6 +2799,10 @@ extern struct MusicInfo *music_info; extern struct MusicFileInfo *music_file_info; extern struct HelpAnimInfo *helpanim_info; extern SetupFileHash *helptext_info; +extern SetupFileHash *image_config_hash; +extern SetupFileHash *element_token_hash; +extern SetupFileHash *graphic_token_hash; +extern SetupFileHash *font_token_hash; extern struct ConfigTypeInfo image_config_suffix[]; extern struct ConfigTypeInfo sound_config_suffix[]; extern struct ConfigTypeInfo music_config_suffix[]; diff --git a/src/netserv.c b/src/netserv.c index a62cae02..ac1b71c4 100644 --- a/src/netserv.c +++ b/src/netserv.c @@ -662,7 +662,8 @@ void NetworkServer(int port, int serveronly) if (FD_ISSET(lfd, &fds)) { - int newfd, slen; + int newfd; + socklen_t slen; slen = sizeof(saddr); newfd = accept(lfd, (struct sockaddr *)&saddr, &slen); diff --git a/src/network.c b/src/network.c index f2f1ea28..1a0feda6 100644 --- a/src/network.c +++ b/src/network.c @@ -592,10 +592,10 @@ static void Handle_OP_MOVE_PLAYER(unsigned int len) if (server_frame_counter != FrameCounter) { - Error(ERR_RETURN, "client and servers frame counters out of sync"); - Error(ERR_RETURN, "frame counter of client is %d", FrameCounter); - Error(ERR_RETURN, "frame counter of server is %d", server_frame_counter); - Error(ERR_RETURN, "this should not happen -- please debug"); + Error(ERR_INFO, "client and servers frame counters out of sync"); + Error(ERR_INFO, "frame counter of client is %d", FrameCounter); + Error(ERR_INFO, "frame counter of server is %d", server_frame_counter); + Error(ERR_INFO, "this should not happen -- please debug"); stop_network_game = TRUE; diff --git a/src/screens.c b/src/screens.c index c78cfd13..ec482ba1 100644 --- a/src/screens.c +++ b/src/screens.c @@ -23,23 +23,44 @@ #include "cartoons.h" #include "network.h" #include "init.h" +#include "config.h" -/* screens in the setup menu */ +/* screens on the info screen */ +#define INFO_MODE_MAIN 0 +#define INFO_MODE_TITLE 1 +#define INFO_MODE_ELEMENTS 2 +#define INFO_MODE_MUSIC 3 +#define INFO_MODE_CREDITS 4 +#define INFO_MODE_PROGRAM 5 +#define INFO_MODE_VERSION 6 +#define INFO_MODE_LEVELSET 7 + +#define MAX_INFO_MODES 8 + +/* screens on the setup screen */ #define SETUP_MODE_MAIN 0 #define SETUP_MODE_GAME 1 #define SETUP_MODE_EDITOR 2 -#define SETUP_MODE_INPUT 3 -#define SETUP_MODE_SHORTCUT_1 4 -#define SETUP_MODE_SHORTCUT_2 5 -#define SETUP_MODE_GRAPHICS 6 -#define SETUP_MODE_CHOOSE_SCREEN_MODE 7 -#define SETUP_MODE_SOUND 8 -#define SETUP_MODE_ARTWORK 9 -#define SETUP_MODE_CHOOSE_GRAPHICS 10 -#define SETUP_MODE_CHOOSE_SOUNDS 11 -#define SETUP_MODE_CHOOSE_MUSIC 12 - -#define MAX_SETUP_MODES 13 +#define SETUP_MODE_GRAPHICS 3 +#define SETUP_MODE_SOUND 4 +#define SETUP_MODE_ARTWORK 5 +#define SETUP_MODE_INPUT 6 +#define SETUP_MODE_SHORTCUTS_1 7 +#define SETUP_MODE_SHORTCUTS_2 8 + +/* sub-screens on the setup screen (generic) */ +#define SETUP_MODE_CHOOSE_ARTWORK 9 +#define SETUP_MODE_CHOOSE_OTHER 10 + +/* sub-screens on the setup screen (specific) */ +#define SETUP_MODE_CHOOSE_GAME_SPEED 11 +#define SETUP_MODE_CHOOSE_SCREEN_MODE 12 +#define SETUP_MODE_CHOOSE_SCROLL_DELAY 13 +#define SETUP_MODE_CHOOSE_GRAPHICS 14 +#define SETUP_MODE_CHOOSE_SOUNDS 15 +#define SETUP_MODE_CHOOSE_MUSIC 16 + +#define MAX_SETUP_MODES 17 /* for input setup functions */ #define SETUPINPUT_SCREEN_POS_START 0 @@ -47,17 +68,6 @@ #define SETUPINPUT_SCREEN_POS_EMPTY1 (SETUPINPUT_SCREEN_POS_START + 3) #define SETUPINPUT_SCREEN_POS_EMPTY2 (SETUPINPUT_SCREEN_POS_END - 1) -/* screens on the info screen */ -#define INFO_MODE_MAIN 0 -#define INFO_MODE_TITLE 1 -#define INFO_MODE_ELEMENTS 2 -#define INFO_MODE_MUSIC 3 -#define INFO_MODE_CREDITS 4 -#define INFO_MODE_PROGRAM 5 -#define INFO_MODE_LEVELSET 6 - -#define MAX_INFO_MODES 7 - /* for various menu stuff */ #define MENU_SCREEN_START_XPOS 1 #define MENU_SCREEN_START_YPOS 2 @@ -115,18 +125,6 @@ #define SC_BORDER_SIZE 14 -/* other useful macro definitions */ -#define BUTTON_GRAPHIC_ACTIVE(g) \ - (g == IMG_MENU_BUTTON_LEFT ? IMG_MENU_BUTTON_LEFT_ACTIVE : \ - g == IMG_MENU_BUTTON_RIGHT ? IMG_MENU_BUTTON_RIGHT_ACTIVE : \ - g == IMG_MENU_BUTTON_UP ? IMG_MENU_BUTTON_UP_ACTIVE : \ - g == IMG_MENU_BUTTON_DOWN ? IMG_MENU_BUTTON_DOWN_ACTIVE : \ - g == IMG_MENU_BUTTON_LEAVE_MENU ? IMG_MENU_BUTTON_LEAVE_MENU_ACTIVE : \ - g == IMG_MENU_BUTTON_ENTER_MENU ? IMG_MENU_BUTTON_ENTER_MENU_ACTIVE : \ - g == IMG_MENU_BUTTON_PREV_LEVEL ? IMG_MENU_BUTTON_PREV_LEVEL_ACTIVE : \ - g == IMG_MENU_BUTTON_NEXT_LEVEL ? IMG_MENU_BUTTON_NEXT_LEVEL_ACTIVE : \ - IMG_MENU_BUTTON_ACTIVE) - /* forward declarations of internal functions */ static void HandleScreenGadgets(struct GadgetInfo *); @@ -134,6 +132,7 @@ static void HandleSetupScreen_Generic(int, int, int, int, int); static void HandleSetupScreen_Input(int, int, int, int, int); static void CustomizeKeyboard(int); static void CalibrateJoystick(int); +static void execSetupGame(void); static void execSetupGraphics(void); static void execSetupArtwork(void); static void HandleChooseTree(int, int, int, int, int, TreeInfo **); @@ -153,29 +152,92 @@ static void HandleInfoScreen_Elements(int); static void HandleInfoScreen_Music(int); static void HandleInfoScreen_Credits(int); static void HandleInfoScreen_Program(int); +static void HandleInfoScreen_Version(int); static void MapScreenMenuGadgets(int); static void MapScreenTreeGadgets(TreeInfo *); static struct GadgetInfo *screen_gadget[NUM_SCREEN_GADGETS]; -static boolean show_titlescreen_initial = TRUE; - -static int setup_mode = SETUP_MODE_MAIN; static int info_mode = INFO_MODE_MAIN; +static int setup_mode = SETUP_MODE_MAIN; static TreeInfo *screen_modes = NULL; static TreeInfo *screen_mode_current = NULL; +static TreeInfo *scroll_delays = NULL; +static TreeInfo *scroll_delay_current = NULL; + +static TreeInfo *game_speeds = NULL; +static TreeInfo *game_speed_current = NULL; + +static struct +{ + int value; + char *text; +} game_speeds_list[] = +{ +#if 1 + { 30, "Very Slow" }, + { 25, "Slow" }, + { 20, "Normal" }, + { 15, "Fast" }, + { 10, "Very Fast" }, +#else + { 1000, "1/1s (Extremely Slow)" }, + { 500, "1/2s" }, + { 200, "1/5s" }, + { 100, "1/10s" }, + { 50, "1/20s" }, + { 29, "1/35s (Original Supaplex)" }, + { 25, "1/40s" }, + { 20, "1/50s (Normal Speed)" }, + { 14, "1/70s (Maximum Supaplex)" }, + { 10, "1/100s" }, + { 5, "1/200s" }, + { 2, "1/500s" }, + { 1, "1/1000s (Extremely Fast)" }, +#endif + + { -1, NULL }, +}; + +static struct +{ + int value; + char *text; +} scroll_delays_list[] = +{ + { 0, "0 Tiles (No Scroll Delay)" }, + { 1, "1 Tile" }, + { 2, "2 Tiles" }, + { 3, "3 Tiles (Default)" }, + { 4, "4 Tiles" }, + { 5, "5 Tiles" }, + { 6, "6 Tiles" }, + { 7, "7 Tiles" }, + { 8, "8 Tiles (Maximum Scroll Delay)"}, + + { -1, NULL }, +}; + #define DRAW_MODE(s) ((s) >= GAME_MODE_MAIN && \ (s) <= GAME_MODE_SETUP ? (s) : \ (s) == GAME_MODE_PSEUDO_TYPENAME ? \ GAME_MODE_MAIN : GAME_MODE_DEFAULT) +/* (there are no draw offset definitions needed for INFO_MODE_TITLE) */ #define DRAW_MODE_INFO(i) ((i) >= INFO_MODE_ELEMENTS && \ (i) <= INFO_MODE_LEVELSET ? (i) : \ INFO_MODE_MAIN) +#define DRAW_MODE_SETUP(i) ((i) >= SETUP_MODE_MAIN && \ + (i) <= SETUP_MODE_SHORTCUTS_2 ? (i) : \ + (i) >= SETUP_MODE_CHOOSE_GRAPHICS && \ + (i) <= SETUP_MODE_CHOOSE_MUSIC ? \ + SETUP_MODE_CHOOSE_ARTWORK : \ + SETUP_MODE_CHOOSE_OTHER) + #define DRAW_XOFFSET_INFO(i) (DRAW_MODE_INFO(i) == INFO_MODE_MAIN ? \ menu.draw_xoffset[GAME_MODE_INFO] : \ menu.draw_xoffset_info[DRAW_MODE_INFO(i)]) @@ -183,11 +245,22 @@ static TreeInfo *screen_mode_current = NULL; menu.draw_yoffset[GAME_MODE_INFO] : \ menu.draw_yoffset_info[DRAW_MODE_INFO(i)]) +#define DRAW_XOFFSET_SETUP(i) (DRAW_MODE_SETUP(i) == SETUP_MODE_MAIN ? \ + menu.draw_xoffset[GAME_MODE_SETUP] : \ + menu.draw_xoffset_setup[DRAW_MODE_SETUP(i)]) +#define DRAW_YOFFSET_SETUP(i) (DRAW_MODE_SETUP(i) == SETUP_MODE_MAIN ? \ + menu.draw_yoffset[GAME_MODE_SETUP] : \ + menu.draw_yoffset_setup[DRAW_MODE_SETUP(i)]) + #define DRAW_XOFFSET(s) ((s) == GAME_MODE_INFO ? \ DRAW_XOFFSET_INFO(info_mode) : \ + (s) == GAME_MODE_SETUP ? \ + DRAW_XOFFSET_SETUP(setup_mode) : \ menu.draw_xoffset[DRAW_MODE(s)]) #define DRAW_YOFFSET(s) ((s) == GAME_MODE_INFO ? \ DRAW_YOFFSET_INFO(info_mode) : \ + (s) == GAME_MODE_SETUP ? \ + DRAW_YOFFSET_SETUP(setup_mode) : \ menu.draw_yoffset[DRAW_MODE(s)]) #define mSX (SX + DRAW_XOFFSET(game_status)) @@ -203,30 +276,75 @@ static Bitmap *scrollbar_bitmap[NUM_SCROLLBAR_BITMAPS]; #endif -#define MAIN_CONTROL_NAME 0 -#define MAIN_CONTROL_LEVELS 1 -#define MAIN_CONTROL_SCORES 2 -#define MAIN_CONTROL_EDITOR 3 -#define MAIN_CONTROL_INFO 4 -#define MAIN_CONTROL_GAME 5 -#define MAIN_CONTROL_SETUP 6 -#define MAIN_CONTROL_QUIT 7 -#define MAIN_CONTROL_PREV_LEVEL 8 -#define MAIN_CONTROL_NEXT_LEVEL 9 -#define MAIN_CONTROL_CURRENT_LEVEL 10 -#define MAIN_CONTROL_FIRST_LEVEL 11 -#define MAIN_CONTROL_LAST_LEVEL 12 -#define MAIN_CONTROL_LEVEL_INFO_1 13 -#define MAIN_CONTROL_LEVEL_INFO_2 14 -#define MAIN_CONTROL_TITLE_1 15 -#define MAIN_CONTROL_TITLE_2 16 -#define MAIN_CONTROL_TITLE_3 17 - -static char main_text_name[10]; -static char main_text_current_level[10]; -static char main_text_first_level[10]; -static char main_text_last_level[10]; -static char main_input_name[MAX_PLAYER_NAME_LEN + 1]; +/* title display and control definitions */ + +#define MAX_NUM_TITLE_SCREENS (2 * MAX_NUM_TITLE_IMAGES + \ + 2 * MAX_NUM_TITLE_MESSAGES) + +static int num_title_screens = 0; + +struct TitleControlInfo +{ + boolean is_image; + boolean initial; + int local_nr; + int sort_priority; +}; + +struct TitleControlInfo title_controls[MAX_NUM_TITLE_SCREENS]; + +/* main menu display and control definitions */ + +#define MAIN_CONTROL_NAME 0 +#define MAIN_CONTROL_LEVELS 1 +#define MAIN_CONTROL_SCORES 2 +#define MAIN_CONTROL_EDITOR 3 +#define MAIN_CONTROL_INFO 4 +#define MAIN_CONTROL_GAME 5 +#define MAIN_CONTROL_SETUP 6 +#define MAIN_CONTROL_QUIT 7 +#define MAIN_CONTROL_PREV_LEVEL 8 +#define MAIN_CONTROL_NEXT_LEVEL 9 +#define MAIN_CONTROL_FIRST_LEVEL 10 +#define MAIN_CONTROL_LAST_LEVEL 11 +#define MAIN_CONTROL_LEVEL_NUMBER 12 +#define MAIN_CONTROL_LEVEL_INFO_1 13 +#define MAIN_CONTROL_LEVEL_INFO_2 14 +#define MAIN_CONTROL_LEVEL_NAME 15 +#define MAIN_CONTROL_LEVEL_AUTHOR 16 +#define MAIN_CONTROL_LEVEL_YEAR 17 +#define MAIN_CONTROL_LEVEL_IMPORTED_FROM 18 +#define MAIN_CONTROL_LEVEL_IMPORTED_BY 19 +#define MAIN_CONTROL_LEVEL_TESTED_BY 20 +#define MAIN_CONTROL_TITLE_1 21 +#define MAIN_CONTROL_TITLE_2 22 +#define MAIN_CONTROL_TITLE_3 23 + +static char str_main_text_name[10]; +static char str_main_text_first_level[10]; +static char str_main_text_last_level[10]; +static char str_main_text_level_number[10]; + +static char *main_text_name = str_main_text_name; +static char *main_text_first_level = str_main_text_first_level; +static char *main_text_last_level = str_main_text_last_level; +static char *main_text_level_number = str_main_text_level_number; +static char *main_text_levels = "Levelset"; +static char *main_text_scores = "Hall Of Fame"; +static char *main_text_editor = "Level Creator"; +static char *main_text_info = "Info Screen"; +static char *main_text_game = "Start Game"; +static char *main_text_setup = "Setup"; +static char *main_text_quit = "Quit"; +static char *main_text_level_name = level.name; +static char *main_text_level_author = level.author; +static char *main_text_level_year = NULL; +static char *main_text_level_imported_from = NULL; +static char *main_text_level_imported_by = NULL; +static char *main_text_level_tested_by = NULL; +static char *main_text_title_1 = PROGRAM_TITLE_STRING; +static char *main_text_title_2 = PROGRAM_COPYRIGHT_STRING; +static char *main_text_title_3 = PROGRAM_GAME_BY_STRING; struct MainControlInfo { @@ -235,149 +353,450 @@ struct MainControlInfo struct MenuPosInfo *pos_button; int button_graphic; - struct MenuPosInfo *pos_text; - char *text; - int font_text; + struct TextPosInfo *pos_text; + char **text; - struct MenuPosInfo *pos_input; - char *input; - int font_input; + struct TextPosInfo *pos_input; + char **input; }; static struct MainControlInfo main_controls[] = { { MAIN_CONTROL_NAME, - &menu.main.button.name, IMG_MENU_BUTTON, - &menu.main.text.name, main_text_name, FONT_MENU_1, - &menu.main.input.name, main_input_name, FONT_INPUT_1, + &menu.main.button.name, IMG_MENU_BUTTON_NAME, + &menu.main.text.name, &main_text_name, + &menu.main.input.name, &setup.player_name, }, { MAIN_CONTROL_LEVELS, - &menu.main.button.levels, IMG_MENU_BUTTON_ENTER_MENU, - &menu.main.text.levels, "Levelset", FONT_MENU_1, - NULL, NULL, -1, + &menu.main.button.levels, IMG_MENU_BUTTON_LEVELS, + &menu.main.text.levels, &main_text_levels, + NULL, NULL, }, { MAIN_CONTROL_SCORES, - &menu.main.button.scores, IMG_MENU_BUTTON, - &menu.main.text.scores, "Hall Of Fame", FONT_MENU_1, - NULL, NULL, -1, + &menu.main.button.scores, IMG_MENU_BUTTON_SCORES, + &menu.main.text.scores, &main_text_scores, + NULL, NULL, }, { MAIN_CONTROL_EDITOR, - &menu.main.button.editor, IMG_MENU_BUTTON, - &menu.main.text.editor, "Level Creator", FONT_MENU_1, - NULL, NULL, -1, + &menu.main.button.editor, IMG_MENU_BUTTON_EDITOR, + &menu.main.text.editor, &main_text_editor, + NULL, NULL, }, { MAIN_CONTROL_INFO, - &menu.main.button.info, IMG_MENU_BUTTON_ENTER_MENU, - &menu.main.text.info, "Info Screen", FONT_MENU_1, - NULL, NULL, -1, + &menu.main.button.info, IMG_MENU_BUTTON_INFO, + &menu.main.text.info, &main_text_info, + NULL, NULL, }, { MAIN_CONTROL_GAME, - &menu.main.button.game, IMG_MENU_BUTTON, - &menu.main.text.game, "Start Game", FONT_MENU_1, - NULL, NULL, -1, + &menu.main.button.game, IMG_MENU_BUTTON_GAME, + &menu.main.text.game, &main_text_game, + NULL, NULL, }, { MAIN_CONTROL_SETUP, - &menu.main.button.setup, IMG_MENU_BUTTON_ENTER_MENU, - &menu.main.text.setup, "Setup", FONT_MENU_1, - NULL, NULL, -1, + &menu.main.button.setup, IMG_MENU_BUTTON_SETUP, + &menu.main.text.setup, &main_text_setup, + NULL, NULL, }, { MAIN_CONTROL_QUIT, - &menu.main.button.quit, IMG_MENU_BUTTON, - &menu.main.text.quit, "Quit", FONT_MENU_1, - NULL, NULL, -1, + &menu.main.button.quit, IMG_MENU_BUTTON_QUIT, + &menu.main.text.quit, &main_text_quit, + NULL, NULL, }, #if 0 /* (these two buttons are real gadgets) */ { MAIN_CONTROL_PREV_LEVEL, &menu.main.button.prev_level, IMG_MENU_BUTTON_PREV_LEVEL, - NULL, NULL, -1, - NULL, NULL, -1, + NULL, NULL, + NULL, NULL, }, { MAIN_CONTROL_NEXT_LEVEL, &menu.main.button.next_level, IMG_MENU_BUTTON_NEXT_LEVEL, - NULL, NULL, -1, - NULL, NULL, -1, + NULL, NULL, + NULL, NULL, }, #endif { - MAIN_CONTROL_CURRENT_LEVEL, + MAIN_CONTROL_FIRST_LEVEL, NULL, -1, - &menu.main.text.current_level, main_text_current_level,FONT_VALUE_1, - NULL, NULL, -1, + &menu.main.text.first_level, &main_text_first_level, + NULL, NULL, }, { - MAIN_CONTROL_FIRST_LEVEL, + MAIN_CONTROL_LAST_LEVEL, NULL, -1, - &menu.main.text.first_level, main_text_first_level, FONT_TEXT_3, - NULL, NULL, -1, + &menu.main.text.last_level, &main_text_last_level, + NULL, NULL, }, { - MAIN_CONTROL_LAST_LEVEL, + MAIN_CONTROL_LEVEL_NUMBER, NULL, -1, - &menu.main.text.last_level, main_text_last_level, FONT_TEXT_3, - NULL, NULL, -1, + &menu.main.text.level_number, &main_text_level_number, + NULL, NULL, }, { MAIN_CONTROL_LEVEL_INFO_1, NULL, -1, - &menu.main.text.level_info_1, NULL, -1, - NULL, NULL, -1, + &menu.main.text.level_info_1, NULL, + NULL, NULL, }, { MAIN_CONTROL_LEVEL_INFO_2, NULL, -1, - &menu.main.text.level_info_2, NULL, -1, - NULL, NULL, -1, + &menu.main.text.level_info_2, NULL, + NULL, NULL, + }, + { + MAIN_CONTROL_LEVEL_NAME, + NULL, -1, + &menu.main.text.level_name, &main_text_level_name, + NULL, NULL, + }, + { + MAIN_CONTROL_LEVEL_AUTHOR, + NULL, -1, + &menu.main.text.level_author, &main_text_level_author, + NULL, NULL, + }, + { + MAIN_CONTROL_LEVEL_YEAR, + NULL, -1, + &menu.main.text.level_year, &main_text_level_year, + NULL, NULL, + }, + { + MAIN_CONTROL_LEVEL_IMPORTED_FROM, + NULL, -1, + &menu.main.text.level_imported_from, &main_text_level_imported_from, + NULL, NULL, + }, + { + MAIN_CONTROL_LEVEL_IMPORTED_BY, + NULL, -1, + &menu.main.text.level_imported_by, &main_text_level_imported_by, + NULL, NULL, + }, + { + MAIN_CONTROL_LEVEL_TESTED_BY, + NULL, -1, + &menu.main.text.level_tested_by, &main_text_level_tested_by, + NULL, NULL, }, { MAIN_CONTROL_TITLE_1, NULL, -1, - &menu.main.text.title_1, PROGRAM_TITLE_STRING, FONT_TITLE_1, - NULL, NULL, -1, + &menu.main.text.title_1, &main_text_title_1, + NULL, NULL, }, { MAIN_CONTROL_TITLE_2, NULL, -1, - &menu.main.text.title_2, PROGRAM_COPYRIGHT_STRING, FONT_TITLE_2, - NULL, NULL, -1, + &menu.main.text.title_2, &main_text_title_2, + NULL, NULL, }, { MAIN_CONTROL_TITLE_3, NULL, -1, - &menu.main.text.title_3, PROGRAM_GAME_BY_STRING, FONT_TITLE_2, - NULL, NULL, -1, + &menu.main.text.title_3, &main_text_title_3, + NULL, NULL, }, { -1, NULL, -1, - NULL, NULL, -1, - NULL, NULL, -1, + NULL, NULL, + NULL, NULL, } }; +static int getTitleScreenGraphic(int nr, boolean initial) +{ + return (initial ? IMG_TITLESCREEN_INITIAL_1 : IMG_TITLESCREEN_1) + nr; +} + +static struct TitleMessageInfo *getTitleMessageInfo(int nr, boolean initial) +{ + return (initial ? &titlemessage_initial[nr] : &titlemessage[nr]); +} + +#if 0 +static int getTitleScreenGameMode(boolean initial) +{ + return (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE); +} +#endif + +static int getTitleMessageGameMode(boolean initial) +{ + return (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE); +} + +#if 0 +static int getTitleScreenBackground(boolean initial) +{ + return (initial ? IMG_BACKGROUND_TITLE_INITIAL : IMG_BACKGROUND_TITLE); +} +#endif + +#if 0 +static int getTitleMessageBackground(int nr, boolean initial) +{ + return (initial ? IMG_BACKGROUND_TITLE_INITIAL : IMG_BACKGROUND_TITLE); +} +#endif + +static int getTitleBackground(int nr, boolean initial, boolean is_image) +{ + int base = (is_image ? + (initial ? IMG_BACKGROUND_TITLESCREEN_INITIAL_1 : + IMG_BACKGROUND_TITLESCREEN_1) : + (initial ? IMG_BACKGROUND_TITLEMESSAGE_INITIAL_1 : + IMG_BACKGROUND_TITLEMESSAGE_1)); + int graphic_global = (initial ? IMG_BACKGROUND_TITLE_INITIAL : + IMG_BACKGROUND_TITLE); + int graphic_local = base + nr; + + if (graphic_info[graphic_local].bitmap != NULL) + return graphic_local; + + if (graphic_info[graphic_global].bitmap != NULL) + return graphic_global; + + return IMG_UNDEFINED; +} + +static int getTitleSound(struct TitleControlInfo *tci) +{ + boolean is_image = tci->is_image; + int initial = tci->initial; + int nr = tci->local_nr; + int mode = (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE); + int base = (is_image ? + (initial ? SND_BACKGROUND_TITLESCREEN_INITIAL_1 : + SND_BACKGROUND_TITLESCREEN_1) : + (initial ? SND_BACKGROUND_TITLEMESSAGE_INITIAL_1 : + SND_BACKGROUND_TITLEMESSAGE_1)); + int sound_global = menu.sound[mode]; + int sound_local = base + nr; + +#if 0 + printf("::: %d, %d, %d: %d ['%s'], %d ['%s']\n", + nr, initial, is_image, + sound_global, getSoundListEntry(sound_global)->filename, + sound_local, getSoundListEntry(sound_local)->filename); +#endif + + if (!strEqual(getSoundListEntry(sound_local)->filename, UNDEFINED_FILENAME)) + return sound_local; + + if (!strEqual(getSoundListEntry(sound_global)->filename, UNDEFINED_FILENAME)) + return sound_global; + + return SND_UNDEFINED; +} + +static int getTitleMusic(struct TitleControlInfo *tci) +{ + boolean is_image = tci->is_image; + int initial = tci->initial; + int nr = tci->local_nr; + int mode = (initial ? GAME_MODE_TITLE_INITIAL : GAME_MODE_TITLE); + int base = (is_image ? + (initial ? MUS_BACKGROUND_TITLESCREEN_INITIAL_1 : + MUS_BACKGROUND_TITLESCREEN_1) : + (initial ? MUS_BACKGROUND_TITLEMESSAGE_INITIAL_1 : + MUS_BACKGROUND_TITLEMESSAGE_1)); + int music_global = menu.music[mode]; + int music_local = base + nr; + +#if 0 + printf("::: %d, %d, %d: %d ['%s'], %d ['%s']\n", + nr, initial, is_image, + music_global, getMusicListEntry(music_global)->filename, + music_local, getMusicListEntry(music_local)->filename); +#endif + + if (!strEqual(getMusicListEntry(music_local)->filename, UNDEFINED_FILENAME)) + return music_local; + + if (!strEqual(getMusicListEntry(music_global)->filename, UNDEFINED_FILENAME)) + return music_global; + + return MUS_UNDEFINED; +} + +static struct TitleFadingInfo getTitleFading(struct TitleControlInfo *tci) +{ + boolean is_image = tci->is_image; + int initial = tci->initial; + int nr = tci->local_nr; + struct TitleFadingInfo ti; + + if (is_image) + { + int graphic = getTitleScreenGraphic(nr, initial); + + /* initialize fading control values to default title config settings */ + ti = (initial ? title_initial_default : title_default); + + /* override default settings with image config settings, if defined */ + if (graphic_info[graphic].fade_mode != FADE_MODE_DEFAULT) + ti.fade_mode = graphic_info[graphic].fade_mode; + if (graphic_info[graphic].fade_delay > -1) + ti.fade_delay = graphic_info[graphic].fade_delay; + if (graphic_info[graphic].post_delay > -1) + ti.post_delay = graphic_info[graphic].post_delay; + if (graphic_info[graphic].auto_delay > -1) + ti.auto_delay = graphic_info[graphic].auto_delay; + } + else + { + if (initial) + { + ti.fade_mode = titlemessage_initial[nr].fade_mode; + ti.fade_delay = titlemessage_initial[nr].fade_delay; + ti.post_delay = titlemessage_initial[nr].post_delay; + ti.auto_delay = titlemessage_initial[nr].auto_delay; + } + else + { + ti.fade_mode = titlemessage[nr].fade_mode; + ti.fade_delay = titlemessage[nr].fade_delay; + ti.post_delay = titlemessage[nr].post_delay; + ti.auto_delay = titlemessage[nr].auto_delay; + } + } + +#if 0 + if (ti.anim_mode == ANIM_NONE) + ti.fade_delay = ti.post_delay = 0; +#endif + + return ti; +} + +static int compareTitleControlInfo(const void *object1, const void *object2) +{ + const struct TitleControlInfo *tci1 = (struct TitleControlInfo *)object1; + const struct TitleControlInfo *tci2 = (struct TitleControlInfo *)object2; + int compare_result; + + if (tci1->initial != tci2->initial) + compare_result = (tci1->initial ? -1 : +1); + else if (tci1->sort_priority != tci2->sort_priority) + compare_result = tci1->sort_priority - tci2->sort_priority; + else if (tci1->is_image != tci2->is_image) + compare_result = (tci1->is_image ? -1 : +1); + else + compare_result = tci1->local_nr - tci2->local_nr; + + return compare_result; +} + +static void InitializeTitleControlsExt_AddTitleInfo(boolean is_image, + boolean initial, + int nr, int sort_priority) +{ + title_controls[num_title_screens].is_image = is_image; + title_controls[num_title_screens].initial = initial; + title_controls[num_title_screens].local_nr = nr; + title_controls[num_title_screens].sort_priority = sort_priority; + + num_title_screens++; +} + +static void InitializeTitleControls_CheckTitleInfo(boolean initial) +{ + int i; + + for (i = 0; i < MAX_NUM_TITLE_IMAGES; i++) + { + int graphic = getTitleScreenGraphic(i, initial); + Bitmap *bitmap = graphic_info[graphic].bitmap; + int sort_priority = graphic_info[graphic].sort_priority; + +#if 0 + /* skip images and messages (fonts!) when using forced custom graphics */ + if (setup.override_level_graphics && !initial) + continue; +#endif + + if (bitmap != NULL) + InitializeTitleControlsExt_AddTitleInfo(TRUE, initial, i, sort_priority); + } + + for (i = 0; i < MAX_NUM_TITLE_MESSAGES; i++) + { + struct TitleMessageInfo *tmi = getTitleMessageInfo(i, initial); + char *filename = getLevelSetTitleMessageFilename(i, initial); + int sort_priority = tmi->sort_priority; + +#if 0 + /* skip images and messages (fonts!) when using forced custom graphics */ + if (setup.override_level_graphics) + continue; +#endif + + if (filename != NULL) + InitializeTitleControlsExt_AddTitleInfo(FALSE, initial, i, sort_priority); + } +} + +static void InitializeTitleControls(boolean show_title_initial) +{ + num_title_screens = 0; + +#if 1 + if (show_title_initial) + InitializeTitleControls_CheckTitleInfo(TRUE); +#endif + + InitializeTitleControls_CheckTitleInfo(FALSE); + + /* sort title screens according to sort_priority and title number */ + qsort(title_controls, num_title_screens, sizeof(struct TitleControlInfo), + compareTitleControlInfo); +} + +static boolean visibleMenuPos(struct MenuPosInfo *pos) +{ + return (pos != NULL && pos->x != -1 && pos->y != -1); +} + +static boolean visibleTextPos(struct TextPosInfo *pos) +{ + return (pos != NULL && pos->x != -1 && pos->y != -1); +} + static void InitializeMainControls() { boolean local_team_mode = (!options.network && setup.team_mode); int i; /* set main control text values to dynamically determined values */ - sprintf(main_text_name, "%s", local_team_mode ? "Team:" : "Name:"); - sprintf(main_text_current_level, "%s", int2str(level_nr, 3)); - sprintf(main_text_first_level, "%03d", leveldir_current->first_level); - sprintf(main_text_last_level, "%03d", leveldir_current->last_level); - sprintf(main_input_name, "%s", setup.player_name); + sprintf(main_text_name, "%s", local_team_mode ? "Team:" : "Name:"); + + strcpy(main_text_first_level, int2str(leveldir_current->first_level, + menu.main.text.first_level.size)); + strcpy(main_text_last_level, int2str(leveldir_current->last_level, + menu.main.text.last_level.size)); + strcpy(main_text_level_number, int2str(level_nr, + menu.main.text.level_number.size)); + + main_text_level_year = leveldir_current->year; + main_text_level_imported_from = leveldir_current->imported_from; + main_text_level_imported_by = leveldir_current->imported_by; + main_text_level_tested_by = leveldir_current->tested_by; /* set main control screen positions to dynamically determined values */ for (i = 0; main_controls[i].nr != -1; i++) @@ -385,13 +804,18 @@ static void InitializeMainControls() struct MainControlInfo *mci = &main_controls[i]; int nr = mci->nr; struct MenuPosInfo *pos_button = mci->pos_button; - struct MenuPosInfo *pos_text = mci->pos_text; - struct MenuPosInfo *pos_input = mci->pos_input; - char *text = mci->text; - char *input = mci->input; + struct TextPosInfo *pos_text = mci->pos_text; + struct TextPosInfo *pos_input = mci->pos_input; + char *text = (mci->text ? *mci->text : NULL); + char *input = (mci->input ? *mci->input : NULL); int button_graphic = mci->button_graphic; +#if 1 + int font_text = (pos_text ? pos_text->font : -1); + int font_input = (pos_input ? pos_input->font : -1); +#else int font_text = mci->font_text; int font_input = mci->font_input; +#endif int font_text_width = (font_text != -1 ? getFontWidth(font_text) : 0); int font_text_height = (font_text != -1 ? getFontHeight(font_text) : 0); @@ -418,11 +842,16 @@ static void InitializeMainControls() menu.main.input.name.y = menu.main.text.name.y; #endif +#if 1 + menu.main.input.name.width = input_width; + menu.main.input.name.height = input_height; +#else menu.main.input.name.width = font_input_width * MAX_PLAYER_NAME_LEN; menu.main.input.name.height = font_input_height; +#endif } - if (pos_button != NULL) + if (pos_button != NULL) /* (x/y may be -1/-1 here) */ { if (pos_button->width == 0) pos_button->width = button_width; @@ -430,15 +859,18 @@ static void InitializeMainControls() pos_button->height = button_height; } - if (pos_text != NULL) + if (pos_text != NULL) /* (x/y may be -1/-1 here) */ { /* calculate width for non-clickable text -- needed for text alignment */ boolean calculate_text_width = (pos_button == NULL && text != NULL); - if (pos_text->x == -1 && pos_button != NULL) - pos_text->x = pos_button->x + pos_button->width; - if (pos_text->y == -1 && pos_button != NULL) - pos_text->y = pos_button->y; + if (visibleMenuPos(pos_button)) + { + if (pos_text->x == -1) + pos_text->x = pos_button->x + pos_button->width; + if (pos_text->y == -1) + pos_text->y = pos_button->y; + } if (pos_text->width == -1 || calculate_text_width) pos_text->width = text_width; @@ -446,12 +878,15 @@ static void InitializeMainControls() pos_text->height = text_height; } - if (pos_input != NULL) + if (pos_input != NULL) /* (x/y may be -1/-1 here) */ { - if (pos_input->x == -1 && pos_text != NULL) - pos_input->x = pos_text->x + pos_text->width; - if (pos_input->y == -1 && pos_text != NULL) - pos_input->y = pos_text->y; + if (visibleTextPos(pos_text)) + { + if (pos_input->x == -1) + pos_input->x = pos_text->x + pos_text->width; + if (pos_input->y == -1) + pos_input->y = pos_text->y; + } if (pos_input->width == -1) pos_input->width = input_width; @@ -473,17 +908,22 @@ static void DrawCursorAndText_Main_Ext(int nr, boolean active_text, if (mci->nr == nr || nr == -1) { struct MenuPosInfo *pos_button = mci->pos_button; - struct MenuPosInfo *pos_text = mci->pos_text; - struct MenuPosInfo *pos_input = mci->pos_input; - char *text = mci->text; - char *input = mci->input; + struct TextPosInfo *pos_text = mci->pos_text; + struct TextPosInfo *pos_input = mci->pos_input; + char *text = (mci->text ? *mci->text : NULL); + char *input = (mci->input ? *mci->input : NULL); int button_graphic = mci->button_graphic; +#if 1 + int font_text = (pos_text ? pos_text->font : -1); + int font_input = (pos_input ? pos_input->font : -1); +#else int font_text = mci->font_text; int font_input = mci->font_input; +#endif if (active_text) { - button_graphic = BUTTON_GRAPHIC_ACTIVE(button_graphic); + button_graphic = BUTTON_ACTIVE(button_graphic); font_text = FONT_ACTIVE(font_text); } @@ -492,7 +932,7 @@ static void DrawCursorAndText_Main_Ext(int nr, boolean active_text, font_input = FONT_ACTIVE(font_input); } - if (pos_button != NULL) + if (visibleMenuPos(pos_button)) { struct MenuPosInfo *pos = pos_button; int x = mSX + pos->x; @@ -502,23 +942,29 @@ static void DrawCursorAndText_Main_Ext(int nr, boolean active_text, DrawGraphicThruMaskExt(drawto, x, y, button_graphic, 0); } - if (pos_text != NULL && text != NULL) + if (visibleTextPos(pos_text) && text != NULL) { - struct MenuPosInfo *pos = pos_text; - int x = mSX + ALIGNED_XPOS(pos->x, pos->width, pos->align); - int y = mSY + pos->y; + struct TextPosInfo *pos = pos_text; + int x = mSX + ALIGNED_TEXT_XPOS(pos); + int y = mSY + ALIGNED_TEXT_YPOS(pos); +#if 1 + /* (check why/if this is needed) */ DrawBackgroundForFont(x, y, pos->width, pos->height, font_text); +#endif DrawText(x, y, text, font_text); } - if (pos_input != NULL && input != NULL) + if (visibleTextPos(pos_input) && input != NULL) { - struct MenuPosInfo *pos = pos_input; - int x = mSX + ALIGNED_XPOS(pos->x, pos->width, pos->align); - int y = mSY + pos->y; + struct TextPosInfo *pos = pos_input; + int x = mSX + ALIGNED_TEXT_XPOS(pos); + int y = mSY + ALIGNED_TEXT_YPOS(pos); +#if 1 + /* (check why/if this is needed) */ DrawBackgroundForFont(x, y, pos->width, pos->height, font_input); +#endif DrawText(x, y, input, font_input); } } @@ -553,8 +999,20 @@ static boolean insideMenuPosRect(struct MenuPosInfo *rect, int x, int y) if (rect == NULL) return FALSE; - int rect_x = ALIGNED_XPOS(rect->x, rect->width, rect->align); - int rect_y = rect->y; + int rect_x = ALIGNED_TEXT_XPOS(rect); + int rect_y = ALIGNED_TEXT_YPOS(rect); + + return (x >= rect_x && x < rect_x + rect->width && + y >= rect_y && y < rect_y + rect->height); +} + +static boolean insideTextPosRect(struct TextPosInfo *rect, int x, int y) +{ + if (rect == NULL) + return FALSE; + + int rect_x = ALIGNED_TEXT_XPOS(rect); + int rect_y = ALIGNED_TEXT_YPOS(rect); return (x >= rect_x && x < rect_x + rect->width && y >= rect_y && y < rect_y + rect->height); @@ -575,7 +1033,7 @@ static void drawCursorExt(int xpos, int ypos, boolean active, int graphic) } if (active) - graphic = BUTTON_GRAPHIC_ACTIVE(graphic); + graphic = BUTTON_ACTIVE(graphic); DrawBackgroundForGraphic(x, y, TILEX, TILEY, graphic); DrawGraphicThruMaskExt(drawto, x, y, graphic, 0); @@ -600,8 +1058,10 @@ static void drawChooseTreeCursor(int ypos, boolean active) { int last_game_status = game_status; /* save current game status */ +#if 0 /* force LEVELS draw offset on artwork setup screen */ game_status = GAME_MODE_LEVELS; +#endif drawCursorExt(0, ypos, active, -1); @@ -636,12 +1096,6 @@ static int getLevelRangeTextPos() } #endif -static int getTitleScreenGraphic() -{ - return (show_titlescreen_initial ? IMG_TITLESCREEN_INITIAL_1 : - IMG_TITLESCREEN_1); -} - int effectiveGameStatus() { if (game_status == GAME_MODE_INFO && info_mode == INFO_MODE_TITLE) @@ -650,20 +1104,14 @@ int effectiveGameStatus() return game_status; } -void DrawTitleScreenImage(int nr) +void DrawTitleScreenImage(int nr, boolean initial) { - int graphic = getTitleScreenGraphic() + nr; + int graphic = getTitleScreenGraphic(nr, initial); Bitmap *bitmap = graphic_info[graphic].bitmap; -#if 1 int width = graphic_info[graphic].width; int height = graphic_info[graphic].height; int src_x = graphic_info[graphic].src_x; int src_y = graphic_info[graphic].src_y; -#else - int width = graphic_info[graphic].src_image_width; - int height = graphic_info[graphic].src_image_height; - int src_x = 0, src_y = 0; -#endif int dst_x, dst_y; if (bitmap == NULL) @@ -683,9 +1131,13 @@ void DrawTitleScreenImage(int nr) height = WIN_YSIZE; } + /* always display title screens centered */ dst_x = (WIN_XSIZE - width) / 2; dst_y = (WIN_YSIZE - height) / 2; + SetDrawBackgroundMask(REDRAW_ALL); + SetWindowBackgroundImage(getTitleBackground(nr, initial, TRUE)); + ClearRectangleOnBackground(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE); if (DrawingOnBackground(dst_x, dst_y)) @@ -694,52 +1146,40 @@ void DrawTitleScreenImage(int nr) BlitBitmap(bitmap, drawto, src_x, src_y, width, height, dst_x, dst_y); redraw_mask = REDRAW_ALL; +} - /* reset fading control values to default config settings */ - title.fade_delay_final = title.fade_delay; - title.post_delay_final = title.post_delay; - title.auto_delay_final = title.auto_delay; - - /* override default settings with image config settings, if defined */ - if (graphic_info[graphic].fade_delay > -1) - title.fade_delay_final = graphic_info[graphic].fade_delay; - if (graphic_info[graphic].post_delay > -1) - title.post_delay_final = graphic_info[graphic].post_delay; - if (graphic_info[graphic].auto_delay > -1) - title.auto_delay_final = graphic_info[graphic].auto_delay; -} - -void DrawTitleScreenMessage(char *filename) -{ - int font_nr = FONT_TEXT_1; - int font_width; - int font_height; - int pad_x = 16; - int pad_y = 32; - int sx = pad_x; - int sy = pad_y; - int max_chars_per_line; - int max_lines_per_screen; +void DrawTitleScreenMessage(int nr, boolean initial) +{ + char *filename = getLevelSetTitleMessageFilename(nr, initial); + struct TitleMessageInfo *tmi = getTitleMessageInfo(nr, initial); int last_game_status = game_status; /* save current game status */ if (filename == NULL) return; - SetDrawBackgroundMask(REDRAW_ALL); - SetWindowBackgroundImageIfDefined(IMG_BACKGROUND_MESSAGE); + /* force TITLE font on title message screen */ + game_status = getTitleMessageGameMode(initial); - ClearRectangleOnBackground(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE); + /* if chars set to "-1", automatically determine by text and font width */ + if (tmi->chars == -1) + tmi->chars = tmi->width / getFontWidth(tmi->font); + else + tmi->width = tmi->chars * getFontWidth(tmi->font); + + /* if lines set to "-1", automatically determine by text and font height */ + if (tmi->lines == -1) + tmi->lines = tmi->height / getFontHeight(tmi->font); + else + tmi->height = tmi->lines * getFontHeight(tmi->font); - /* force MESSAGE font on title message screen */ - game_status = GAME_MODE_MESSAGE; + SetDrawBackgroundMask(REDRAW_ALL); + SetWindowBackgroundImage(getTitleBackground(nr, initial, FALSE)); - font_width = getFontWidth(font_nr); - font_height = getFontHeight(font_nr); - max_chars_per_line = (WIN_XSIZE - 2 * pad_x) / font_width; - max_lines_per_screen = (WIN_YSIZE - pad_y) / font_height - 1; + ClearRectangleOnBackground(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE); - DrawTextFromFile(sx, sy, filename, font_nr, max_chars_per_line, - max_lines_per_screen, FALSE); + DrawTextFile(ALIGNED_TEXT_XPOS(tmi), ALIGNED_TEXT_YPOS(tmi), + filename, tmi->font, tmi->chars, -1, tmi->lines, -1, + tmi->autowrap, tmi->centered, tmi->parse_comments); game_status = last_game_status; /* restore current game status */ } @@ -748,25 +1188,40 @@ void DrawTitleScreen() { KeyboardAutoRepeatOff(); +#if 0 SetMainBackgroundImage(IMG_BACKGROUND_TITLE); +#endif HandleTitleScreen(0, 0, 0, 0, MB_MENU_INITIALIZE); StopAnimation(); } -void DrawMainMenuExt(int redraw_mask, boolean do_fading) +boolean CheckTitleScreen(boolean levelset_has_changed) +{ + static boolean show_title_initial = TRUE; + boolean show_titlescreen = FALSE; + + /* needed to be able to skip title screen, if no image or message defined */ + InitializeTitleControls(show_title_initial); + + if (setup.show_titlescreen && (show_title_initial || levelset_has_changed)) + show_titlescreen = TRUE; + + /* show initial title images and messages only once at program start */ + show_title_initial = FALSE; + + return (show_titlescreen && num_title_screens > 0); +} + +void DrawMainMenuExt(int fade_mask, boolean do_fading) { static LevelDirTree *leveldir_last_valid = NULL; boolean levelset_has_changed = FALSE; -#if 0 - boolean local_team_mode = (!options.network && setup.team_mode); - char *name_text = (local_team_mode ? "Team:" : "Name:"); - int name_width, level_width; -#endif -#if 0 - int i; -#endif + + FadeSetLeaveScreen(); + + /* do not fade out here -- function may continue and fade on editor screen */ UnmapAllGadgets(); FadeSoundsAndMusic(); @@ -790,9 +1245,6 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading) return; } - /* needed if last screen was the editor screen */ - UndrawSpecialEditorDoor(); - /* needed if last screen was the setup screen and fullscreen state changed */ ToggleFullscreenIfNeeded(); @@ -809,18 +1261,27 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading) /* needed if last screen (level choice) changed graphics, sounds or music */ ReloadCustomArtwork(0); -#ifdef TARGET_SDL - SetDrawtoField(DRAW_BACKBUFFER); -#endif + if (redraw_mask & REDRAW_ALL) + fade_mask = REDRAW_ALL; - if (setup.show_titlescreen && - ((levelset_has_changed && - (graphic_info[IMG_TITLESCREEN_1].bitmap != NULL || - getLevelSetMessageFilename() != NULL)) || - (show_titlescreen_initial && - graphic_info[IMG_TITLESCREEN_INITIAL_1].bitmap != NULL))) - { - game_status = GAME_MODE_TITLE; +#if 1 + FadeOut(fade_mask); + + /* needed if last screen was the editor screen */ + UndrawSpecialEditorDoor(); +#if 0 + if (fade_mask == REDRAW_FIELD) + BackToFront(); +#endif +#endif + +#if defined(TARGET_SDL) + SetDrawtoField(DRAW_BACKBUFFER); +#endif + + if (CheckTitleScreen(levelset_has_changed)) + { + game_status = GAME_MODE_TITLE; DrawTitleScreen(); @@ -834,79 +1295,23 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading) LoadLevel(level_nr); SetMainBackgroundImage(IMG_BACKGROUND_MAIN); - ClearWindow(); #if 1 - InitializeMainControls(); - -#if 1 - DrawCursorAndText_Main(-1, FALSE); -#else - for (i = 0; main_controls[i].nr != -1; i++) + if (fade_mask == REDRAW_ALL) { - struct MenuPosInfo *pos_button = main_controls[i].pos_button; - struct MenuPosInfo *pos_text = main_controls[i].pos_text; - struct MenuPosInfo *pos_input = main_controls[i].pos_input; - char *text = main_controls[i].text; - char *input = main_controls[i].input; - int button_graphic = main_controls[i].button_graphic; - int font_text = main_controls[i].font_text; - int font_input = main_controls[i].font_input; - - if (pos_button != NULL) - DrawGraphicThruMaskExt(drawto, mSX + pos_button->x, mSY + pos_button->y, - button_graphic, 0); + // int door_state = GetDoorState(); - if (pos_text != NULL && text != NULL) - DrawText(mSX + pos_text->x, mSY + pos_text->y, text, font_text); + RedrawBackground(); - if (pos_input != NULL && input != NULL) - DrawText(mSX + pos_input->x, mSY + pos_input->y, input, font_input); + // OpenDoor(door_state | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); } #endif -#else - - DrawHeadline(); - - DrawText(mSX + 32, mSY + 2 * 32, name_text, FONT_MENU_1); - DrawText(mSX + 32, mSY + 3 * 32, "Levelset", FONT_MENU_1); - DrawText(mSX + 32, mSY + 4 * 32, "Hall Of Fame", FONT_MENU_1); - DrawText(mSX + 32, mSY + 5 * 32, "Level Creator", FONT_MENU_1); - DrawText(mSX + 32, mSY + 6 * 32, "Info Screen", FONT_MENU_1); - DrawText(mSX + 32, mSY + 7 * 32, "Start Game", FONT_MENU_1); - DrawText(mSX + 32, mSY + 8 * 32, "Setup", FONT_MENU_1); - DrawText(mSX + 32, mSY + 9 * 32, "Quit", FONT_MENU_1); - - /* calculated after (possible) reload of custom artwork */ - name_width = getTextWidth(name_text, FONT_MENU_1); - level_width = 9 * 32; + ClearField(); - DrawText(mSX + 32 + name_width, mSY + 2 * 32, setup.player_name, - FONT_INPUT_1); - - DrawText(mSX + getCurrentLevelTextPos() * 32, mSY + 3 * 32, - int2str(level_nr, 3), FONT_VALUE_1); - - { - int text_height = getFontHeight(FONT_TEXT_3); - int xpos = getLevelRangeTextPos() * 32 + 8; - int ypos2 = 3 * 32 + 16; - int ypos1 = ypos2 - text_height; - - DrawTextF(mSX - SX + xpos, mSY - SY + ypos1, FONT_TEXT_3, - "%03d", leveldir_current->first_level); - DrawTextF(mSX - SX + xpos, mSY - SY + ypos2, FONT_TEXT_3, - "%03d", leveldir_current->last_level); - } - - for (i = 0; i < 8; i++) - initCursor(i, (i == 1 || i == 4 || i == 6 ? IMG_MENU_BUTTON_ENTER_MENU : - IMG_MENU_BUTTON)); - - DrawTextSCentered(326, FONT_TITLE_2, PROGRAM_GAME_BY_STRING); -#endif + InitializeMainControls(); + DrawCursorAndText_Main(-1, FALSE); DrawPreviewLevel(TRUE); HandleMainMenu(0, 0, 0, 0, MB_MENU_INITIALIZE); @@ -927,21 +1332,38 @@ void DrawMainMenuExt(int redraw_mask, boolean do_fading) MapTapeButtons(); MapScreenMenuGadgets(SCREEN_MASK_MAIN); +#if 1 + if (fade_mask == REDRAW_ALL) + { + int door_state = GetDoorState(); + + // RedrawBackground(); + + OpenDoor(door_state | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); + } +#endif + DrawMaskedBorder(REDRAW_ALL); - if (do_fading) - FadeIn(redraw_mask); - else - BackToFront(); + FadeIn(fade_mask); + FadeSetEnterMenu(); + +#if 1 + /* update screen area with special editor door */ + redraw_mask |= REDRAW_ALL; + BackToFront(); +#endif + + SetMouseCursor(CURSOR_DEFAULT); InitAnimation(); OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2); } -void DrawAndFadeInMainMenu(int redraw_mask) +void DrawAndFadeInMainMenu(int fade_mask) { - DrawMainMenuExt(redraw_mask, TRUE); + DrawMainMenuExt(fade_mask, TRUE); } void DrawMainMenu() @@ -983,77 +1405,99 @@ static void gotoTopLevelDir() void HandleTitleScreen(int mx, int my, int dx, int dy, int button) { static unsigned long title_delay = 0; - static int title_nr = 0; - static boolean showing_message = FALSE; - char *filename = getLevelSetMessageFilename(); + static int title_screen_nr = 0; + static int last_sound = -1, last_music = -1; boolean return_to_main_menu = FALSE; boolean use_fading_main_menu = TRUE; - boolean use_cross_fading = !show_titlescreen_initial; /* default */ - boolean no_title_info = (graphic_info[IMG_TITLESCREEN_1].bitmap == NULL && - filename == NULL); + struct TitleControlInfo *tci; + struct TitleFadingInfo fading_default; + struct TitleFadingInfo fading_last = fading; + struct TitleFadingInfo fading_next; + int sound, music; if (button == MB_MENU_INITIALIZE) { - int last_game_status = game_status; /* save current game status */ - title_delay = 0; - title_nr = 0; - showing_message = FALSE; + title_screen_nr = 0; + tci = &title_controls[title_screen_nr]; - if (show_titlescreen_initial && - graphic_info[IMG_TITLESCREEN_INITIAL_1].bitmap == NULL) - show_titlescreen_initial = FALSE; + last_sound = SND_UNDEFINED; + last_music = MUS_UNDEFINED; if (game_status == GAME_MODE_INFO) { - if (no_title_info) + if (num_title_screens == 0) { DrawInfoScreen_NotAvailable("Title screen information:", "No title screen for this level set."); - title.auto_delay_final = -1; - return; } FadeSoundsAndMusic(); +#if 1 FadeOut(REDRAW_ALL); +#endif } - /* force TITLE music on title info screen */ - game_status = GAME_MODE_TITLE; + if (tci->is_image) + DrawTitleScreenImage(tci->local_nr, tci->initial); + else + DrawTitleScreenMessage(tci->local_nr, tci->initial); - PlayMenuSound(); - PlayMenuMusic(); + fading_default = (tci->initial ? title_initial_default : title_default); - game_status = last_game_status; /* restore current game status */ + fading = fading_next = getTitleFading(tci); - if (graphic_info[getTitleScreenGraphic()].bitmap != NULL) +#if 1 +#if 1 + if (!(fading_last.fade_mode & FADE_TYPE_TRANSFORM) && + fading_next.fade_mode & FADE_TYPE_TRANSFORM) { - DrawTitleScreenImage(title_nr); + fading.fade_mode = FADE_MODE_FADE; + fading.fade_delay = fading_default.fade_delay; } - else - { - DrawTitleScreenMessage(filename); +#else + if (fading_last.fade_mode != FADE_MODE_CROSSFADE && + fading_next.fade_mode == FADE_MODE_CROSSFADE) + fading.fade_mode = FADE_MODE_FADE; +#endif +#endif - showing_message = TRUE; +#if 1 + sound = getTitleSound(tci); + music = getTitleMusic(tci); - title.fade_delay_final = title.fade_delay; - title.post_delay_final = title.post_delay; - title.auto_delay_final = -1; - } + if (sound != last_sound) + PlayMenuSoundExt(sound); + if (music != last_music) + PlayMenuMusicExt(music); + last_sound = sound; + last_music = music; +#endif + + SetMouseCursor(CURSOR_NONE); + +#if 1 FadeIn(REDRAW_ALL); +#endif + + fading = fading_next; DelayReached(&title_delay, 0); /* reset delay counter */ return; } - if (title.auto_delay_final > -1 && - DelayReached(&title_delay, title.auto_delay_final)) +#if 1 + if (fading.auto_delay > 0 && DelayReached(&title_delay, fading.auto_delay)) + button = MB_MENU_CHOICE; +#else + if (fading.auto_delay > -1 && DelayReached(&title_delay, fading.auto_delay)) button = MB_MENU_CHOICE; +#endif if (button == MB_MENU_LEAVE) { @@ -1062,11 +1506,13 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) } else if (button == MB_MENU_CHOICE) { - int anim_mode; - - if (game_status == GAME_MODE_INFO && no_title_info) + if (game_status == GAME_MODE_INFO && num_title_screens == 0) { +#if 0 FadeOut(REDRAW_FIELD); +#endif + + FadeSetEnterScreen(); info_mode = INFO_MODE_MAIN; DrawAndFadeInInfoScreen(REDRAW_FIELD); @@ -1074,83 +1520,93 @@ void HandleTitleScreen(int mx, int my, int dx, int dy, int button) return; } - title_nr++; + title_screen_nr++; + tci = &title_controls[title_screen_nr]; - if (show_titlescreen_initial && - (title_nr >= MAX_NUM_TITLE_SCREENS || - graphic_info[IMG_TITLESCREEN_INITIAL_1 + title_nr].bitmap == NULL)) + if (title_screen_nr < num_title_screens) { - show_titlescreen_initial = FALSE; + sound = getTitleSound(tci); + music = getTitleMusic(tci); - title_nr = 0; /* restart with title screens for current level set */ - } + if (sound == SND_UNDEFINED || sound != last_sound) + FadeSounds(); + if (music == MUS_UNDEFINED || music != last_music) + FadeMusic(); - anim_mode = graphic_info[getTitleScreenGraphic() + title_nr].anim_mode; +#if 1 + FadeOut(REDRAW_ALL); +#endif - use_cross_fading = (anim_mode == ANIM_FADE ? FALSE : - anim_mode == ANIM_CROSSFADE ? TRUE : - use_cross_fading); + if (tci->is_image) + DrawTitleScreenImage(tci->local_nr, tci->initial); + else + DrawTitleScreenMessage(tci->local_nr, tci->initial); - if (!use_cross_fading) - FadeOut(REDRAW_ALL); + fading_next = getTitleFading(tci); - if (title_nr < MAX_NUM_TITLE_SCREENS && - graphic_info[getTitleScreenGraphic() + title_nr].bitmap != NULL) - { - if (use_cross_fading) - FadeCrossSaveBackbuffer(); +#if 1 + sound = getTitleSound(tci); + music = getTitleMusic(tci); - DrawTitleScreenImage(title_nr); + if (sound != last_sound) + PlayMenuSoundExt(sound); + if (music != last_music) + PlayMenuMusicExt(music); - if (use_cross_fading) - FadeCross(REDRAW_ALL); - else - FadeIn(REDRAW_ALL); + last_sound = sound; + last_music = music; +#endif - DelayReached(&title_delay, 0); /* reset delay counter */ - } - else if (!showing_message && filename != NULL) - { - if (use_cross_fading) - FadeCrossSaveBackbuffer(); +#if 1 + /* last screen already faded out, next screen has no animation */ + if (!(fading.fade_mode & FADE_TYPE_TRANSFORM) && + fading_next.fade_mode == FADE_MODE_NONE) + fading = fading_next; +#else + /* last screen already faded out, next screen has no animation */ + if (fading.fade_mode != FADE_MODE_CROSSFADE && + fading_next.fade_mode == FADE_MODE_NONE) + fading = fading_next; +#endif - DrawTitleScreenMessage(filename); +#if 1 + FadeIn(REDRAW_ALL); +#endif - if (use_cross_fading) - FadeCross(REDRAW_ALL); - else - FadeIn(REDRAW_ALL); + fading = fading_next; DelayReached(&title_delay, 0); /* reset delay counter */ - - showing_message = TRUE; } else { FadeSoundsAndMusic(); - FadeOut(REDRAW_ALL); - return_to_main_menu = TRUE; } } if (return_to_main_menu) { - show_titlescreen_initial = FALSE; - +#if 0 RedrawBackground(); +#endif + + SetMouseCursor(CURSOR_DEFAULT); if (game_status == GAME_MODE_INFO) { +#if 0 OpenDoor(DOOR_CLOSE_1 | DOOR_CLOSE_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); +#endif info_mode = INFO_MODE_MAIN; DrawInfoScreenExt(REDRAW_ALL, use_fading_main_menu); } else /* default: return to main menu */ { +#if 0 OpenDoor(DOOR_CLOSE_1 | DOOR_OPEN_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); +#endif game_status = GAME_MODE_MAIN; DrawMainMenuExt(REDRAW_ALL, use_fading_main_menu); @@ -1167,247 +1623,118 @@ void HandleMainMenu_SelectLevel(int step, int direction) if (new_level_nr < leveldir_current->first_level) new_level_nr = leveldir_current->first_level; if (new_level_nr > leveldir_current->last_level) - new_level_nr = leveldir_current->last_level; - - if (setup.handicap && new_level_nr > leveldir_current->handicap_level) - { - /* skipping levels is only allowed when trying to skip single level */ - if (setup.skip_levels && step == 1 && - Request("Level still unsolved ! Skip despite handicap ?", REQ_ASK)) - { - leveldir_current->handicap_level++; - SaveLevelSetup_SeriesInfo(); - } - - new_level_nr = leveldir_current->handicap_level; - } - - if (new_level_nr != old_level_nr) - { - struct MainControlInfo *mci= getMainControlInfo(MAIN_CONTROL_CURRENT_LEVEL); - - PlaySound(SND_MENU_ITEM_SELECTING); - - level_nr = new_level_nr; - -#if 1 - DrawText(mSX + mci->pos_text->x, mSY + mci->pos_text->y, - int2str(level_nr, 3), mci->font_text); -#else - DrawText(mSX + 11 * 32, mSY + 3 * 32, int2str(level_nr, 3), FONT_VALUE_1); -#endif - - LoadLevel(level_nr); - DrawPreviewLevel(TRUE); - - TapeErase(); - LoadTape(level_nr); - DrawCompleteVideoDisplay(); - - /* needed because DrawPreviewLevel() takes some time */ - BackToFront(); - SyncDisplay(); - } -} - -#if 1 - -void HandleMainMenu(int mx, int my, int dx, int dy, int button) -{ - static int choice = MAIN_CONTROL_GAME; - int pos = choice; - int i; - - if (button == MB_MENU_INITIALIZE) - { - DrawCursorAndText_Main(choice, TRUE); - - return; - } - - if (mx || my) /* mouse input */ - { - pos = -1; - - for (i = 0; main_controls[i].nr != -1; i++) - { - if (insideMenuPosRect(main_controls[i].pos_button, mx - mSX, my - mSY) || - insideMenuPosRect(main_controls[i].pos_text, mx - mSX, my - mSY) || - insideMenuPosRect(main_controls[i].pos_input, mx - mSX, my - mSY)) - { - pos = main_controls[i].nr; - - break; - } - } - } - else if (dx || dy) /* keyboard input */ - { - if (dx > 0 && (choice == MAIN_CONTROL_INFO || - choice == MAIN_CONTROL_SETUP)) - button = MB_MENU_CHOICE; - else if (dy) - pos = choice + dy; - } - - if (pos == MAIN_CONTROL_LEVELS && dx != 0 && button) - { - HandleMainMenu_SelectLevel(1, dx < 0 ? -1 : +1); - } - else if (pos >= MAIN_CONTROL_NAME && pos <= MAIN_CONTROL_QUIT) - { - if (button) - { - if (pos != choice) - { - PlaySound(SND_MENU_ITEM_ACTIVATING); - - DrawCursorAndText_Main(choice, FALSE); - DrawCursorAndText_Main(pos, TRUE); - - choice = pos; - } - } - else - { - PlaySound(SND_MENU_ITEM_SELECTING); - - if (pos == MAIN_CONTROL_NAME) - { - game_status = GAME_MODE_PSEUDO_TYPENAME; - - HandleTypeName(strlen(setup.player_name), 0); - } - else if (pos == MAIN_CONTROL_LEVELS) - { - if (leveldir_first) - { - game_status = GAME_MODE_LEVELS; - - SaveLevelSetup_LastSeries(); - SaveLevelSetup_SeriesInfo(); - -#if 0 - gotoTopLevelDir(); -#endif - - DrawChooseLevel(); - } - } - else if (pos == MAIN_CONTROL_SCORES) - { - game_status = GAME_MODE_SCORES; - - DrawHallOfFame(-1); - } - else if (pos == MAIN_CONTROL_EDITOR) - { - if (leveldir_current->readonly && - !strEqual(setup.player_name, "Artsoft")) - Request("This level is read only !", REQ_CONFIRM); - - game_status = GAME_MODE_EDITOR; - - DrawLevelEd(); - } - else if (pos == MAIN_CONTROL_INFO) - { - game_status = GAME_MODE_INFO; - info_mode = INFO_MODE_MAIN; - - DrawInfoScreen(); - } - else if (pos == MAIN_CONTROL_GAME) - { - StartGameActions(options.network, setup.autorecord, NEW_RANDOMIZE); - } - else if (pos == MAIN_CONTROL_SETUP) - { - game_status = GAME_MODE_SETUP; - setup_mode = SETUP_MODE_MAIN; - - DrawSetupScreen(); - } - else if (pos == MAIN_CONTROL_QUIT) - { - SaveLevelSetup_LastSeries(); - SaveLevelSetup_SeriesInfo(); - - if (Request("Do you really want to quit ?", REQ_ASK | REQ_STAY_CLOSED)) - game_status = GAME_MODE_QUIT; - } + new_level_nr = leveldir_current->last_level; + + if (setup.handicap && new_level_nr > leveldir_current->handicap_level) + { + /* skipping levels is only allowed when trying to skip single level */ + if (setup.skip_levels && step == 1 && + Request("Level still unsolved ! Skip despite handicap ?", REQ_ASK)) + { + leveldir_current->handicap_level++; + SaveLevelSetup_SeriesInfo(); } + + new_level_nr = leveldir_current->handicap_level; } - if (game_status == GAME_MODE_MAIN) + if (new_level_nr != old_level_nr) { - DrawPreviewLevel(FALSE); - DoAnimation(); + struct MainControlInfo *mci= getMainControlInfo(MAIN_CONTROL_LEVEL_NUMBER); + + PlaySound(SND_MENU_ITEM_SELECTING); + + level_nr = new_level_nr; + + DrawText(mSX + mci->pos_text->x, mSY + mci->pos_text->y, + int2str(level_nr, menu.main.text.level_number.size), + mci->pos_text->font); + + LoadLevel(level_nr); + DrawPreviewLevel(TRUE); + + TapeErase(); + LoadTape(level_nr); + DrawCompleteVideoDisplay(); + + /* needed because DrawPreviewLevel() takes some time */ + BackToFront(); + SyncDisplay(); } } -#else - void HandleMainMenu(int mx, int my, int dx, int dy, int button) { - static int choice = 5; - int x = 0; - int y = choice; + static int choice = MAIN_CONTROL_GAME; + int pos = choice; + int i; if (button == MB_MENU_INITIALIZE) { - drawCursor(choice, TRUE); + DrawCursorAndText_Main(choice, TRUE); return; } if (mx || my) /* mouse input */ { - x = (mx - mSX) / 32; - y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS; + pos = -1; + + for (i = 0; main_controls[i].nr != -1; i++) + { + 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)) + { + pos = main_controls[i].nr; + + break; + } + } } else if (dx || dy) /* keyboard input */ { - if (dx && choice == 1) - x = (dx < 0 ? 10 : 14); - else if (dx > 0) - { - if (choice == 4 || choice == 6) - button = MB_MENU_CHOICE; - } + if (dx > 0 && (choice == MAIN_CONTROL_INFO || + choice == MAIN_CONTROL_SETUP)) + button = MB_MENU_CHOICE; else if (dy) - y = choice + dy; + pos = choice + dy; } - if (y == 1 && dx != 0 && button) + if (pos == MAIN_CONTROL_LEVELS && dx != 0 && button) { HandleMainMenu_SelectLevel(1, dx < 0 ? -1 : +1); } - else if (IN_VIS_FIELD(x, y) && - y >= 0 && y <= 7 && (y != 1 || x < 10)) + else if (pos >= MAIN_CONTROL_NAME && pos <= MAIN_CONTROL_QUIT) { if (button) { - if (y != choice) + if (pos != choice) { - drawCursor(choice, FALSE); - drawCursor(y, TRUE); + PlaySound(SND_MENU_ITEM_ACTIVATING); - choice = y; + DrawCursorAndText_Main(choice, FALSE); + DrawCursorAndText_Main(pos, TRUE); + + choice = pos; } } else { - if (y == 0) + PlaySound(SND_MENU_ITEM_SELECTING); + + if (pos == MAIN_CONTROL_NAME) { game_status = GAME_MODE_PSEUDO_TYPENAME; + HandleTypeName(strlen(setup.player_name), 0); } - else if (y == 1) + else if (pos == MAIN_CONTROL_LEVELS) { if (leveldir_first) { game_status = GAME_MODE_LEVELS; + SaveLevelSetup_LastSeries(); SaveLevelSetup_SeriesInfo(); @@ -1418,37 +1745,43 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) DrawChooseLevel(); } } - else if (y == 2) + else if (pos == MAIN_CONTROL_SCORES) { game_status = GAME_MODE_SCORES; + DrawHallOfFame(-1); } - else if (y == 3) + else if (pos == MAIN_CONTROL_EDITOR) { if (leveldir_current->readonly && !strEqual(setup.player_name, "Artsoft")) Request("This level is read only !", REQ_CONFIRM); + game_status = GAME_MODE_EDITOR; + + FadeSetEnterScreen(); + DrawLevelEd(); } - else if (y == 4) + else if (pos == MAIN_CONTROL_INFO) { game_status = GAME_MODE_INFO; info_mode = INFO_MODE_MAIN; + DrawInfoScreen(); } - else if (y == 5) + else if (pos == MAIN_CONTROL_GAME) { StartGameActions(options.network, setup.autorecord, NEW_RANDOMIZE); } - else if (y == 6) + else if (pos == MAIN_CONTROL_SETUP) { game_status = GAME_MODE_SETUP; setup_mode = SETUP_MODE_MAIN; DrawSetupScreen(); } - else if (y == 7) + else if (pos == MAIN_CONTROL_QUIT) { SaveLevelSetup_LastSeries(); SaveLevelSetup_SeriesInfo(); @@ -1466,8 +1799,6 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) } } -#endif - /* ========================================================================= */ /* info screen functions */ @@ -1479,43 +1810,57 @@ static int num_info_info; static void execInfoTitleScreen() { info_mode = INFO_MODE_TITLE; + DrawInfoScreen(); } static void execInfoElements() { info_mode = INFO_MODE_ELEMENTS; + DrawInfoScreen(); } static void execInfoMusic() { info_mode = INFO_MODE_MUSIC; + DrawInfoScreen(); } static void execInfoCredits() { info_mode = INFO_MODE_CREDITS; + DrawInfoScreen(); } static void execInfoProgram() { info_mode = INFO_MODE_PROGRAM; + + DrawInfoScreen(); +} + +static void execInfoVersion() +{ + info_mode = INFO_MODE_VERSION; + DrawInfoScreen(); } static void execInfoLevelSet() { info_mode = INFO_MODE_LEVELSET; + DrawInfoScreen(); } static void execExitInfo() { game_status = GAME_MODE_MAIN; - DrawMainMenu(); + + DrawMainMenuExt(REDRAW_FIELD, FALSE); } static struct TokenInfo info_info_main[] = @@ -1525,6 +1870,7 @@ static struct TokenInfo info_info_main[] = { TYPE_ENTER_SCREEN, execInfoMusic, "Music Info" }, { TYPE_ENTER_SCREEN, execInfoCredits, "Credits" }, { TYPE_ENTER_SCREEN, execInfoProgram, "Program Info" }, + { TYPE_ENTER_SCREEN, execInfoVersion, "Version Info" }, { TYPE_ENTER_SCREEN, execInfoLevelSet, "Level Set Info" }, { TYPE_EMPTY, NULL, "" }, { TYPE_LEAVE_MENU, execExitInfo, "Exit" }, @@ -1547,28 +1893,44 @@ static void DrawCursorAndText_Info(int pos, boolean active) drawCursor(pos, active); } -static void DrawInfoScreen_Main(int redraw_mask, boolean do_fading) +static void DrawInfoScreen_Main(int fade_mask, boolean do_fading) { int i; UnmapAllGadgets(); CloseDoor(DOOR_CLOSE_2); - ClearWindow(); + /* (needed after displaying title screens which disable auto repeat) */ + KeyboardAutoRepeatOn(); + + FadeSetLeaveScreen(); + +#if 1 + FadeOut(fade_mask); +#endif + +#if 1 + if (fade_mask == REDRAW_ALL) + { + RedrawBackground(); + + OpenDoor(DOOR_CLOSE_1 | DOOR_CLOSE_2 | DOOR_NO_DELAY | DOOR_FORCE_REDRAW); + } +#endif + + ClearField(); DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Info Screen"); info_info = info_info_main; num_info_info = 0; +#if 1 + for (i = 0; info_info[i].type != 0 && i < MAX_MENU_ENTRIES_ON_SCREEN; i++) +#else for (i = 0; info_info[i].type != 0 && i < NUM_MENU_ENTRIES_ON_SCREEN; i++) - { -#if 0 - int xpos = MENU_SCREEN_START_XPOS; - int ypos = MENU_SCREEN_START_YPOS + i; - int font_nr = FONT_MENU_1; #endif - + { if (info_info[i].type & (TYPE_ENTER_MENU|TYPE_ENTER_LIST)) initCursor(i, IMG_MENU_BUTTON_ENTER_MENU); else if (info_info[i].type & (TYPE_LEAVE_MENU|TYPE_LEAVE_LIST)) @@ -1576,11 +1938,7 @@ static void DrawInfoScreen_Main(int redraw_mask, boolean do_fading) else if (info_info[i].type & ~TYPE_SKIP_ENTRY) initCursor(i, IMG_MENU_BUTTON); -#if 1 DrawCursorAndText_Info(i, FALSE); -#else - DrawText(mSX + xpos * 32, mSY + ypos * 32, info_info[i].text, font_nr); -#endif num_info_info++; } @@ -1590,12 +1948,9 @@ static void DrawInfoScreen_Main(int redraw_mask, boolean do_fading) PlayMenuSound(); PlayMenuMusic(); - DrawMaskedBorder(REDRAW_ALL); + DrawMaskedBorder(fade_mask); - if (do_fading) - FadeIn(redraw_mask); - else - BackToFront(); + FadeIn(fade_mask); InitAnimation(); } @@ -1615,11 +1970,7 @@ void HandleInfoScreen_Main(int mx, int my, int dx, int dy, int button) choice++; choice_store[info_mode] = choice; -#if 1 DrawCursorAndText_Info(choice, TRUE); -#else - drawCursor(choice, TRUE); -#endif return; } @@ -1631,6 +1982,8 @@ void HandleInfoScreen_Main(int mx, int my, int dx, int dy, int button) { void (*menu_callback_function)(void) = info_info[y].value; + FadeSetLeaveMenu(); + menu_callback_function(); break; /* absolutely needed because function changes 'info_info'! */ @@ -1674,13 +2027,8 @@ void HandleInfoScreen_Main(int mx, int my, int dx, int dy, int button) { PlaySound(SND_MENU_ITEM_ACTIVATING); -#if 1 DrawCursorAndText_Info(choice, FALSE); DrawCursorAndText_Info(y, TRUE); -#else - drawCursor(choice, FALSE); - drawCursor(y, TRUE); -#endif choice = choice_store[info_mode] = y; } @@ -1693,6 +2041,8 @@ void HandleInfoScreen_Main(int mx, int my, int dx, int dy, int button) { void (*menu_callback_function)(void) = info_info[choice].value; + FadeSetFromType(info_info[y].type); + menu_callback_function(); } } @@ -1701,15 +2051,15 @@ void HandleInfoScreen_Main(int mx, int my, int dx, int dy, int button) void DrawInfoScreen_NotAvailable(char *text_title, char *text_error) { - int ystart1 = 100; - int ystart2 = 150; - int ybottom = SYSIZE - 20; + int ystart1 = mSY - SY + 100; + int ystart2 = mSY - SY + 150; + int ybottom = mSY - SY + SYSIZE - 20; SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_LEVELSET); FadeOut(REDRAW_FIELD); - ClearWindow(); + ClearField(); DrawHeadline(); DrawTextSCentered(ystart1, FONT_TEXT_1, text_title); @@ -1726,7 +2076,9 @@ void DrawInfoScreen_HelpAnim(int start, int max_anims, boolean init) static int infoscreen_step[MAX_INFO_ELEMENTS_ON_SCREEN]; static int infoscreen_frame[MAX_INFO_ELEMENTS_ON_SCREEN]; int xstart = mSX + 16; - int ystart = mSY + 64 + 2 * 32; + int ystart1 = mSY - SY + 100; + int ystart2 = mSY + 64 + 2 * 32; + int ybottom = mSY - SY + SYSIZE - 20; int ystep = TILEY + 4; int element, action, direction; int graphic; @@ -1739,12 +2091,12 @@ void DrawInfoScreen_HelpAnim(int start, int max_anims, boolean init) for (i = 0; i < MAX_INFO_ELEMENTS_ON_SCREEN; i++) infoscreen_step[i] = infoscreen_frame[i] = 0; - ClearWindow(); + ClearField(); DrawHeadline(); - DrawTextSCentered(100, FONT_TEXT_1, "The Game Elements:"); + DrawTextSCentered(ystart1, FONT_TEXT_1, "The Game Elements:"); - DrawTextSCentered(SYSIZE - 20, FONT_TEXT_4, + DrawTextSCentered(ybottom, FONT_TEXT_4, "Press any key or button for next page"); FrameCounter = 0; @@ -1816,9 +2168,9 @@ void DrawInfoScreen_HelpAnim(int start, int max_anims, boolean init) j++; - ClearRectangleOnBackground(drawto, xstart, ystart + (i - start) * ystep, + ClearRectangleOnBackground(drawto, xstart, ystart2 + (i - start) * ystep, TILEX, TILEY); - DrawGraphicAnimationExt(drawto, xstart, ystart + (i - start) * ystep, + DrawGraphicAnimationExt(drawto, xstart, ystart2 + (i - start) * ystep, graphic, sync_frame, USE_MASKING); if (init) @@ -1849,7 +2201,7 @@ static char *getHelpText(int element, int action, int direction) void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos) { - int font_nr = FONT_LEVEL_NUMBER; + int font_nr = FONT_INFO_ELEMENTS; int font_width = getFontWidth(font_nr); int sx = mSX + MINI_TILEX + TILEX + MINI_TILEX; int sy = mSY + 65 + 2 * 32 + 1; @@ -1877,8 +2229,9 @@ void DrawInfoScreen_HelpText(int element, int action, int direction, int ypos) if (strlen(text) <= max_chars_per_line) /* only one line of text */ sy += getFontHeight(font_nr) / 2; - DrawTextWrapped(sx, sy + ypos * ystep, text, font_nr, - max_chars_per_line, max_lines_per_text); + DrawTextBuffer(sx, sy + ypos * ystep, text, font_nr, + max_chars_per_line, -1, max_lines_per_text, -1, + TRUE, FALSE, FALSE); } void DrawInfoScreen_TitleScreen() @@ -1958,7 +2311,6 @@ void HandleInfoScreen_Elements(int button) if (page >= num_pages) { FadeSoundsAndMusic(); - FadeOut(REDRAW_FIELD); info_mode = INFO_MODE_MAIN; DrawAndFadeInInfoScreen(REDRAW_FIELD); @@ -1966,13 +2318,18 @@ void HandleInfoScreen_Elements(int button) return; } +#if 1 + if (page > 0) + FadeSetNextScreen(); +#endif + if (button != MB_MENU_INITIALIZE) - FadeCrossSaveBackbuffer(); + FadeOut(REDRAW_FIELD); DrawInfoScreen_HelpAnim(page * anims_per_page, num_anims, TRUE); if (button != MB_MENU_INITIALIZE) - FadeCross(REDRAW_FIELD); + FadeIn(REDRAW_FIELD); } else { @@ -1988,23 +2345,29 @@ void DrawInfoScreen_Music() { SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_MUSIC); +#if 1 FadeOut(REDRAW_FIELD); +#endif - ClearWindow(); + ClearField(); DrawHeadline(); LoadMusicInfo(); HandleInfoScreen_Music(MB_MENU_INITIALIZE); +#if 1 FadeIn(REDRAW_FIELD); +#endif } void HandleInfoScreen_Music(int button) { static struct MusicFileInfo *list = NULL; - int ystart = 150, dy = 30; - int ybottom = SYSIZE - 20; + int ystart1 = mSY - SY + 100; + int ystart2 = mSY - SY + 150; + int ybottom = mSY - SY + SYSIZE - 20; + int dy = 30; if (button == MB_MENU_INITIALIZE) { @@ -2014,10 +2377,11 @@ void HandleInfoScreen_Music(int button) { FadeSoundsAndMusic(); - ClearWindow(); + ClearField(); DrawHeadline(); - DrawTextSCentered(100, FONT_TEXT_1, "No music info for this level set."); + DrawTextSCentered(ystart1, FONT_TEXT_1, + "No music info for this level set."); DrawTextSCentered(ybottom, FONT_TEXT_4, "Press any key or button for info menu"); @@ -2052,7 +2416,6 @@ void HandleInfoScreen_Music(int button) if (list == NULL) { FadeSoundsAndMusic(); - FadeOut(REDRAW_FIELD); info_mode = INFO_MODE_MAIN; DrawAndFadeInInfoScreen(REDRAW_FIELD); @@ -2062,10 +2425,15 @@ void HandleInfoScreen_Music(int button) FadeSoundsAndMusic(); +#if 1 + if (list != music_file_info) + FadeSetNextScreen(); +#endif + if (button != MB_MENU_INITIALIZE) - FadeCrossSaveBackbuffer(); + FadeOut(REDRAW_FIELD); - ClearWindow(); + ClearField(); DrawHeadline(); if (list->is_sound) @@ -2077,237 +2445,228 @@ void HandleInfoScreen_Music(int button) else PlaySound(sound); - DrawTextSCentered(100, FONT_TEXT_1, "The Game Background Sounds:"); + DrawTextSCentered(ystart1, FONT_TEXT_1, "The Game Background Sounds:"); } else { PlayMusic(list->music); - DrawTextSCentered(100, FONT_TEXT_1, "The Game Background Music:"); + DrawTextSCentered(ystart1, FONT_TEXT_1, "The Game Background Music:"); } if (!strEqual(list->title, UNKNOWN_NAME)) { if (!strEqual(list->title_header, UNKNOWN_NAME)) - DrawTextSCentered(ystart + y++ * dy, FONT_TEXT_2, list->title_header); + DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, list->title_header); - DrawTextFCentered(ystart + y++ * dy, FONT_TEXT_3, "\"%s\"", list->title); + DrawTextFCentered(ystart2 + y++ * dy, FONT_TEXT_3, "\"%s\"", list->title); } if (!strEqual(list->artist, UNKNOWN_NAME)) { if (!strEqual(list->artist_header, UNKNOWN_NAME)) - DrawTextSCentered(ystart + y++ * dy, FONT_TEXT_2, list->artist_header); + DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, list->artist_header); else - DrawTextSCentered(ystart + y++ * dy, FONT_TEXT_2, "by"); + DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, "by"); - DrawTextFCentered(ystart + y++ * dy, FONT_TEXT_3, "%s", list->artist); + DrawTextFCentered(ystart2 + y++ * dy, FONT_TEXT_3, "%s", list->artist); } if (!strEqual(list->album, UNKNOWN_NAME)) { if (!strEqual(list->album_header, UNKNOWN_NAME)) - DrawTextSCentered(ystart + y++ * dy, FONT_TEXT_2, list->album_header); + DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, list->album_header); else - DrawTextSCentered(ystart + y++ * dy, FONT_TEXT_2, "from the album"); + DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, "from the album"); - DrawTextFCentered(ystart + y++ * dy, FONT_TEXT_3, "\"%s\"", list->album); + DrawTextFCentered(ystart2 + y++ * dy, FONT_TEXT_3, "\"%s\"", list->album); } if (!strEqual(list->year, UNKNOWN_NAME)) { if (!strEqual(list->year_header, UNKNOWN_NAME)) - DrawTextSCentered(ystart + y++ * dy, FONT_TEXT_2, list->year_header); + DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, list->year_header); else - DrawTextSCentered(ystart + y++ * dy, FONT_TEXT_2, "from the year"); + DrawTextSCentered(ystart2 + y++ * dy, FONT_TEXT_2, "from the year"); - DrawTextFCentered(ystart + y++ * dy, FONT_TEXT_3, "%s", list->year); + DrawTextFCentered(ystart2 + y++ * dy, FONT_TEXT_3, "%s", list->year); } DrawTextSCentered(ybottom, FONT_TEXT_4, "Press any key or button for next page"); if (button != MB_MENU_INITIALIZE) - FadeCross(REDRAW_FIELD); + FadeIn(REDRAW_FIELD); } if (list != NULL && list->is_sound && sound_info[list->music].loop) PlaySoundLoop(list->music); } -static boolean DrawInfoScreen_CreditsScreen(int screen_nr) +static void DrawInfoScreen_CreditsScreen(int screen_nr) { - int ystart = 150, ystep = 30; - int ybottom = SYSIZE - 20; - - if (screen_nr > 8) - return FALSE; + int ystart1 = mSY - SY + 100; + int ystart2 = mSY - SY + 150; + int ybottom = mSY - SY + SYSIZE - 20; + int ystep = 30; - ClearWindow(); + ClearField(); DrawHeadline(); - DrawTextSCentered(100, FONT_TEXT_1, "Credits:"); + DrawTextSCentered(ystart1, FONT_TEXT_1, "Credits:"); if (screen_nr == 0) { - DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 0 * ystep, FONT_TEXT_2, "Special thanks to"); - DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 1 * ystep, FONT_TEXT_3, "Peter Liepa"); - DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_2, "for creating"); - DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 3 * ystep, FONT_TEXT_3, "\"Boulder Dash\""); - DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 4 * ystep, FONT_TEXT_2, "in the year"); - DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 5 * ystep, FONT_TEXT_3, "1984"); - DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 6 * ystep, FONT_TEXT_2, "published by"); - DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 7 * ystep, FONT_TEXT_3, "First Star Software"); } else if (screen_nr == 1) { - DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 0 * ystep, FONT_TEXT_2, "Special thanks to"); - DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 1 * ystep, FONT_TEXT_3, "Klaus Heinz & Volker Wertich"); - DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_2, "for creating"); - DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 3 * ystep, FONT_TEXT_3, "\"Emerald Mine\""); - DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 4 * ystep, FONT_TEXT_2, "in the year"); - DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 5 * ystep, FONT_TEXT_3, "1987"); - DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 6 * ystep, FONT_TEXT_2, "published by"); - DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 7 * ystep, FONT_TEXT_3, "Kingsoft"); } else if (screen_nr == 2) { - DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 0 * ystep, FONT_TEXT_2, "Special thanks to"); - DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 1 * ystep, FONT_TEXT_3, "Michael Stopp & Philip Jespersen"); - DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_2, "for creating"); - DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 3 * ystep, FONT_TEXT_3, "\"Supaplex\""); - DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 4 * ystep, FONT_TEXT_2, "in the year"); - DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 5 * ystep, FONT_TEXT_3, "1991"); - DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 6 * ystep, FONT_TEXT_2, "published by"); - DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 7 * ystep, FONT_TEXT_3, "Digital Integration"); } else if (screen_nr == 3) { - DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 0 * ystep, FONT_TEXT_2, "Special thanks to"); - DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 1 * ystep, FONT_TEXT_3, "Hiroyuki Imabayashi"); - DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_2, "for creating"); - DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 3 * ystep, FONT_TEXT_3, "\"Sokoban\""); - DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 4 * ystep, FONT_TEXT_2, "in the year"); - DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 5 * ystep, FONT_TEXT_3, "1982"); - DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 6 * ystep, FONT_TEXT_2, "published by"); - DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 7 * ystep, FONT_TEXT_3, "Thinking Rabbit"); } else if (screen_nr == 4) { - DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 0 * ystep, FONT_TEXT_2, "Special thanks to"); - DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 1 * ystep, FONT_TEXT_3, "Alan Bond"); - DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_2, "and"); - DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 3 * ystep, FONT_TEXT_3, "Jürgen Bonhagen"); - DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 4 * ystep, FONT_TEXT_2, "for the continuous creation"); - DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 5 * ystep, FONT_TEXT_2, "of outstanding level sets"); } else if (screen_nr == 5) { - DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 0 * ystep, FONT_TEXT_2, "Thanks to"); - DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 1 * ystep, FONT_TEXT_3, "Peter Elzner"); - DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_2, "for ideas and inspiration by"); - DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 3 * ystep, FONT_TEXT_3, "Diamond Caves"); - DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 5 * ystep, FONT_TEXT_2, "Thanks to"); - DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 6 * ystep, FONT_TEXT_3, "Steffest"); - DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 7 * ystep, FONT_TEXT_2, "for ideas and inspiration by"); - DrawTextSCentered(ystart + 8 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 8 * ystep, FONT_TEXT_3, "DX-Boulderdash"); } else if (screen_nr == 6) { - DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 0 * ystep, FONT_TEXT_2, "Thanks to"); - DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 1 * ystep, FONT_TEXT_3, "David Tritscher"); - DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_2, "for the new Emerald Mine engine"); } else if (screen_nr == 7) { - DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 0 * ystep, FONT_TEXT_2, "Thanks to"); - DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 1 * ystep, FONT_TEXT_3, "Guido Schulz"); - DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_2, "for the initial DOS port"); - DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 4 * ystep, FONT_TEXT_2, "Thanks to"); - DrawTextSCentered(ystart + 5 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 5 * ystep, FONT_TEXT_3, "Karl Hörnell"); - DrawTextSCentered(ystart + 6 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 6 * ystep, FONT_TEXT_2, "for some additional toons"); } else if (screen_nr == 8) { - DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 0 * ystep, FONT_TEXT_2, "And not to forget:"); - DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 1 * ystep, FONT_TEXT_2, "Many thanks to"); - DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_3, "All those who contributed"); - DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 3 * ystep, FONT_TEXT_3, "levels to this game"); - DrawTextSCentered(ystart + 4 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 4 * ystep, FONT_TEXT_3, "since 1995"); } -#if 0 - else - { - return FALSE; - } -#endif DrawTextSCentered(ybottom, FONT_TEXT_4, "Press any key or button for next page"); - - return TRUE; } void DrawInfoScreen_Credits() @@ -2316,24 +2675,30 @@ void DrawInfoScreen_Credits() FadeSoundsAndMusic(); +#if 1 FadeOut(REDRAW_FIELD); +#endif HandleInfoScreen_Credits(MB_MENU_INITIALIZE); +#if 1 FadeIn(REDRAW_FIELD); +#endif } void HandleInfoScreen_Credits(int button) { static int screen_nr = 0; + int num_screens = 9; if (button == MB_MENU_INITIALIZE) { screen_nr = 0; - DrawInfoScreen_CreditsScreen(screen_nr); + // DrawInfoScreen_CreditsScreen(screen_nr); } - else if (button == MB_MENU_LEAVE) + + if (button == MB_MENU_LEAVE) { PlaySound(SND_MENU_ITEM_SELECTING); @@ -2342,30 +2707,37 @@ void HandleInfoScreen_Credits(int button) return; } - else if (button == MB_MENU_CHOICE) + else if (button == MB_MENU_CHOICE || button == MB_MENU_INITIALIZE) { - boolean show_screen; - - PlaySound(SND_MENU_ITEM_SELECTING); - - screen_nr++; - - FadeCrossSaveBackbuffer(); - - show_screen = DrawInfoScreen_CreditsScreen(screen_nr); - - if (show_screen) + if (button != MB_MENU_INITIALIZE) { - FadeCross(REDRAW_FIELD); + PlaySound(SND_MENU_ITEM_SELECTING); + + screen_nr++; } - else + + if (screen_nr >= num_screens) { FadeSoundsAndMusic(); - FadeOut(REDRAW_FIELD); info_mode = INFO_MODE_MAIN; DrawAndFadeInInfoScreen(REDRAW_FIELD); + + return; } + +#if 1 + if (screen_nr > 0) + FadeSetNextScreen(); +#endif + + if (button != MB_MENU_INITIALIZE) + FadeOut(REDRAW_FIELD); + + DrawInfoScreen_CreditsScreen(screen_nr); + + if (button != MB_MENU_INITIALIZE) + FadeIn(REDRAW_FIELD); } else { @@ -2375,49 +2747,55 @@ void HandleInfoScreen_Credits(int button) void DrawInfoScreen_Program() { - int ystart = 150, ystep = 30; - int ybottom = SYSIZE - 20; + int ystart1 = mSY - SY + 100; + int ystart2 = mSY - SY + 150; + int ybottom = mSY - SY + SYSIZE - 20; + int ystep = 30; SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_PROGRAM); +#if 1 FadeOut(REDRAW_FIELD); +#endif - ClearWindow(); + ClearField(); DrawHeadline(); - DrawTextSCentered(100, FONT_TEXT_1, "Program Information:"); + DrawTextSCentered(ystart1, FONT_TEXT_1, "Program Information:"); - DrawTextSCentered(ystart + 0 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 0 * ystep, FONT_TEXT_2, "This game is Freeware!"); - DrawTextSCentered(ystart + 1 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 1 * ystep, FONT_TEXT_2, "If you like it, send e-mail to:"); - DrawTextSCentered(ystart + 2 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 2 * ystep, FONT_TEXT_3, PROGRAM_EMAIL_STRING); - DrawTextSCentered(ystart + 3 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 3 * ystep, FONT_TEXT_2, "or SnailMail to:"); - DrawTextSCentered(ystart + 4 * ystep + 0, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 4 * ystep + 0, FONT_TEXT_3, "Holger Schemel"); - DrawTextSCentered(ystart + 4 * ystep + 20, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 4 * ystep + 20, FONT_TEXT_3, "Detmolder Strasse 189"); - DrawTextSCentered(ystart + 4 * ystep + 40, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 4 * ystep + 40, FONT_TEXT_3, "33604 Bielefeld"); - DrawTextSCentered(ystart + 4 * ystep + 60, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 4 * ystep + 60, FONT_TEXT_3, "Germany"); - DrawTextSCentered(ystart + 7 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 7 * ystep, FONT_TEXT_2, "More information and levels:"); - DrawTextSCentered(ystart + 8 * ystep, FONT_TEXT_3, + DrawTextSCentered(ystart2 + 8 * ystep, FONT_TEXT_3, PROGRAM_WEBSITE_STRING); - DrawTextSCentered(ystart + 9 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 9 * ystep, FONT_TEXT_2, "If you have created new levels,"); - DrawTextSCentered(ystart + 10 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 10 * ystep, FONT_TEXT_2, "send them to me to include them!"); - DrawTextSCentered(ystart + 11 * ystep, FONT_TEXT_2, + DrawTextSCentered(ystart2 + 11 * ystep, FONT_TEXT_2, ":-)"); DrawTextSCentered(ybottom, FONT_TEXT_4, "Press any key or button for info menu"); +#if 1 FadeIn(REDRAW_FIELD); +#endif } void HandleInfoScreen_Program(int button) @@ -2436,7 +2814,179 @@ void HandleInfoScreen_Program(int button) PlaySound(SND_MENU_ITEM_SELECTING); FadeSoundsAndMusic(); + +#if 0 + FadeOut(REDRAW_FIELD); +#endif + + info_mode = INFO_MODE_MAIN; + DrawAndFadeInInfoScreen(REDRAW_FIELD); + } + else + { + PlayMenuSoundIfLoop(); + } +} + +void DrawInfoScreen_Version() +{ + int font_header = FONT_TEXT_3; + int font_text = FONT_TEXT_2; + int xstep = getFontWidth(font_text); + int ystep = getFontHeight(font_text); + int ystart1 = mSY - SY + 100; + int ystart2 = mSY - SY + 150; + int ybottom = mSY - SY + SYSIZE - 20; + int xstart1 = mSX + 2 * xstep; + int xstart2 = mSX + 19 * xstep; +#if defined(TARGET_SDL) + int xstart3 = mSX + 29 * xstep; + SDL_version sdl_version_compiled; + const SDL_version *sdl_version_linked; + int driver_name_len = 8; + char driver_name[driver_name_len]; +#endif + + SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_VERSION); + +#if 1 + FadeOut(REDRAW_FIELD); +#endif + + ClearField(); + DrawHeadline(); + + DrawTextSCentered(ystart1, FONT_TEXT_1, "Version Information:"); + + DrawTextF(xstart1, ystart2, font_header, "Name"); + DrawTextF(xstart2, ystart2, font_text, PROGRAM_TITLE_STRING); + + ystart2 += ystep; + DrawTextF(xstart1, ystart2, font_header, "Version"); + DrawTextF(xstart2, ystart2, font_text, getProgramFullVersionString()); + + ystart2 += ystep; + DrawTextF(xstart1, ystart2, font_header, "Platform"); + DrawTextF(xstart2, ystart2, font_text, PLATFORM_STRING); + + ystart2 += ystep; + DrawTextF(xstart1, ystart2, font_header, "Target"); + DrawTextF(xstart2, ystart2, font_text, TARGET_STRING); + + ystart2 += ystep; + DrawTextF(xstart1, ystart2, font_header, "Compile time"); + DrawTextF(xstart2, ystart2, font_text, getCompileDateString()); + +#if defined(TARGET_SDL) + ystart2 += 3 * ystep; + DrawTextF(xstart1, ystart2, font_header, "Library"); + DrawTextF(xstart2, ystart2, font_header, "compiled"); + DrawTextF(xstart3, ystart2, font_header, "linked"); + + SDL_VERSION(&sdl_version_compiled); + sdl_version_linked = SDL_Linked_Version(); + + ystart2 += 2 * ystep; + DrawTextF(xstart1, ystart2, font_text, "SDL"); + DrawTextF(xstart2, ystart2, font_text, "%d.%d.%d", + sdl_version_compiled.major, + sdl_version_compiled.minor, + sdl_version_compiled.patch); + DrawTextF(xstart3, ystart2, font_text, "%d.%d.%d", + sdl_version_linked->major, + sdl_version_linked->minor, + sdl_version_linked->patch); + + SDL_IMAGE_VERSION(&sdl_version_compiled); + sdl_version_linked = IMG_Linked_Version(); + + ystart2 += ystep; + DrawTextF(xstart1, ystart2, font_text, "SDL_image"); + DrawTextF(xstart2, ystart2, font_text, "%d.%d.%d", + sdl_version_compiled.major, + sdl_version_compiled.minor, + sdl_version_compiled.patch); + DrawTextF(xstart3, ystart2, font_text, "%d.%d.%d", + sdl_version_linked->major, + sdl_version_linked->minor, + sdl_version_linked->patch); + + SDL_MIXER_VERSION(&sdl_version_compiled); + sdl_version_linked = Mix_Linked_Version(); + + ystart2 += ystep; + DrawTextF(xstart1, ystart2, font_text, "SDL_mixer"); + DrawTextF(xstart2, ystart2, font_text, "%d.%d.%d", + sdl_version_compiled.major, + sdl_version_compiled.minor, + sdl_version_compiled.patch); + DrawTextF(xstart3, ystart2, font_text, "%d.%d.%d", + sdl_version_linked->major, + sdl_version_linked->minor, + sdl_version_linked->patch); + + SDL_NET_VERSION(&sdl_version_compiled); + sdl_version_linked = SDLNet_Linked_Version(); + + ystart2 += ystep; + DrawTextF(xstart1, ystart2, font_text, "SDL_net"); + DrawTextF(xstart2, ystart2, font_text, "%d.%d.%d", + sdl_version_compiled.major, + sdl_version_compiled.minor, + sdl_version_compiled.patch); + DrawTextF(xstart3, ystart2, font_text, "%d.%d.%d", + sdl_version_linked->major, + sdl_version_linked->minor, + sdl_version_linked->patch); + + ystart2 += 3 * ystep; + DrawTextF(xstart1, ystart2, font_header, "Driver"); + DrawTextF(xstart2, ystart2, font_header, "Requested"); + DrawTextF(xstart3, ystart2, font_header, "Used"); + + SDL_VideoDriverName(driver_name, driver_name_len); + + ystart2 += 2 * ystep; + DrawTextF(xstart1, ystart2, font_text, "SDL_VideoDriver"); + DrawTextF(xstart2, ystart2, font_text, "%s", setup.system.sdl_videodriver); + DrawTextF(xstart3, ystart2, font_text, "%s", driver_name); + + SDL_AudioDriverName(driver_name, driver_name_len); + + ystart2 += ystep; + DrawTextF(xstart1, ystart2, font_text, "SDL_AudioDriver"); + DrawTextF(xstart2, ystart2, font_text, "%s", setup.system.sdl_audiodriver); + DrawTextF(xstart3, ystart2, font_text, "%s", driver_name); +#endif + + DrawTextSCentered(ybottom, FONT_TEXT_4, + "Press any key or button for info menu"); + +#if 1 + FadeIn(REDRAW_FIELD); +#endif +} + +void HandleInfoScreen_Version(int button) +{ + if (button == MB_MENU_LEAVE) + { + PlaySound(SND_MENU_ITEM_SELECTING); + + info_mode = INFO_MODE_MAIN; + DrawInfoScreen(); + + return; + } + else if (button == MB_MENU_CHOICE) + { + PlaySound(SND_MENU_ITEM_SELECTING); + + FadeSoundsAndMusic(); + +#if 0 FadeOut(REDRAW_FIELD); +#endif info_mode = INFO_MODE_MAIN; DrawAndFadeInInfoScreen(REDRAW_FIELD); @@ -2449,39 +2999,46 @@ void HandleInfoScreen_Program(int button) void DrawInfoScreen_LevelSet() { - int ystart = 150; - int ybottom = SYSIZE - 20; + struct TitleMessageInfo *tmi = &readme; char *filename = getLevelSetInfoFilename(); - int font_nr = FONT_LEVEL_NUMBER; - int font_width = getFontWidth(font_nr); - int font_height = getFontHeight(font_nr); - int pad_x = 32; - int pad_y = ystart; - int sx = SX + pad_x; - int sy = SY + pad_y; - int max_chars_per_line = (SXSIZE - 2 * pad_x) / font_width; - int max_lines_per_screen = (SYSIZE - pad_y) / font_height - 1; + + /* if chars set to "-1", automatically determine by text and font width */ + if (tmi->chars == -1) + tmi->chars = tmi->width / getFontWidth(tmi->font); + else + tmi->width = tmi->chars * getFontWidth(tmi->font); + + /* if lines set to "-1", automatically determine by text and font height */ + if (tmi->lines == -1) + tmi->lines = tmi->height / getFontHeight(tmi->font); + else + tmi->height = tmi->lines * getFontHeight(tmi->font); SetMainBackgroundImageIfDefined(IMG_BACKGROUND_INFO_LEVELSET); +#if 1 FadeOut(REDRAW_FIELD); +#endif - ClearWindow(); + ClearField(); DrawHeadline(); - DrawTextSCentered(100, FONT_TEXT_1, "Level Set Information:"); - - DrawTextSCentered(ybottom, FONT_TEXT_4, - "Press any key or button for info menu"); + DrawTextCentered(mSY + 100, FONT_TEXT_1, "Level Set Information:"); if (filename != NULL) - DrawTextFromFile(sx, sy, filename, font_nr, max_chars_per_line, - max_lines_per_screen, TRUE); + DrawTextFile(mSX + ALIGNED_TEXT_XPOS(tmi), mSY + ALIGNED_TEXT_YPOS(tmi), + filename, tmi->font, tmi->chars, -1, tmi->lines, -1, + tmi->autowrap, tmi->centered, tmi->parse_comments); else - DrawTextSCentered(ystart, FONT_TEXT_2, - "No information for this level set."); + DrawTextCentered(mSY + ALIGNED_TEXT_YPOS(tmi), FONT_TEXT_2, + "No information for this level set."); + + DrawTextCentered(mSY + SYSIZE - 20, FONT_TEXT_4, + "Press any key or button for info menu"); +#if 1 FadeIn(REDRAW_FIELD); +#endif } void HandleInfoScreen_LevelSet(int button) @@ -2500,7 +3057,10 @@ void HandleInfoScreen_LevelSet(int button) PlaySound(SND_MENU_ITEM_SELECTING); FadeSoundsAndMusic(); + +#if 0 FadeOut(REDRAW_FIELD); +#endif info_mode = INFO_MODE_MAIN; DrawAndFadeInInfoScreen(REDRAW_FIELD); @@ -2511,7 +3071,7 @@ void HandleInfoScreen_LevelSet(int button) } } -static void DrawInfoScreenExt(int redraw_mask, boolean do_fading) +static void DrawInfoScreenExt(int fade_mask, boolean do_fading) { SetMainBackgroundImage(IMG_BACKGROUND_INFO); @@ -2525,10 +3085,12 @@ static void DrawInfoScreenExt(int redraw_mask, boolean do_fading) DrawInfoScreen_Credits(); else if (info_mode == INFO_MODE_PROGRAM) DrawInfoScreen_Program(); + else if (info_mode == INFO_MODE_VERSION) + DrawInfoScreen_Version(); else if (info_mode == INFO_MODE_LEVELSET) DrawInfoScreen_LevelSet(); else - DrawInfoScreen_Main(redraw_mask, do_fading); + DrawInfoScreen_Main(fade_mask, do_fading); if (info_mode != INFO_MODE_MAIN && info_mode != INFO_MODE_TITLE && @@ -2539,14 +3101,14 @@ static void DrawInfoScreenExt(int redraw_mask, boolean do_fading) } } -void DrawAndFadeInInfoScreen(int redraw_mask) +void DrawAndFadeInInfoScreen(int fade_mask) { - DrawInfoScreenExt(redraw_mask, TRUE); + DrawInfoScreenExt(fade_mask, TRUE); } void DrawInfoScreen() { - DrawInfoScreenExt(REDRAW_ALL, FALSE); + DrawInfoScreenExt(REDRAW_FIELD, FALSE); } void HandleInfoScreen(int mx, int my, int dx, int dy, int button) @@ -2561,6 +3123,8 @@ void HandleInfoScreen(int mx, int my, int dx, int dy, int button) HandleInfoScreen_Credits(button); else if (info_mode == INFO_MODE_PROGRAM) HandleInfoScreen_Program(button); + else if (info_mode == INFO_MODE_VERSION) + HandleInfoScreen_Version(button); else if (info_mode == INFO_MODE_LEVELSET) HandleInfoScreen_LevelSet(button); else @@ -2576,77 +3140,72 @@ void HandleInfoScreen(int mx, int my, int dx, int dy, int button) void HandleTypeName(int newxpos, Key key) { + static char last_player_name[MAX_PLAYER_NAME_LEN + 1]; struct MainControlInfo *mci = getMainControlInfo(MAIN_CONTROL_NAME); -#if 1 - struct MenuPosInfo *pos = mci->pos_input; - int startx = mSX + ALIGNED_XPOS(pos->x, pos->width, pos->align); - int starty = mSY + pos->y; -#endif -#if 1 + struct TextPosInfo *pos = mci->pos_input; + int startx = mSX + ALIGNED_TEXT_XPOS(pos); + int starty = mSY + ALIGNED_TEXT_YPOS(pos); static int xpos = 0; -#else - static int xpos = 0, ypos = 2; -#endif - int font_nr = mci->font_input; + int font_nr = pos->font; int font_active_nr = FONT_ACTIVE(font_nr); int font_width = getFontWidth(font_active_nr); -#if 1 -#if 0 - int startx = mSX + mci->pos_input->x; - int starty = mSY + mci->pos_input->y; -#endif -#else - int name_width = getFontWidth(FONT_MENU_1) * strlen("Name:"); - int startx = mSX + 32 + name_width; - int starty = mSY + ypos * 32; -#endif + char key_char = getValidConfigValueChar(getCharFromKey(key)); + boolean is_valid_key_char = (key_char != 0 && (key_char != ' ' || xpos > 0)); + boolean is_active = TRUE; + + DrawBackgroundForFont(startx,starty, pos->width, pos->height, font_active_nr); if (newxpos) { - xpos = newxpos; - - DrawText(startx, starty, setup.player_name, font_active_nr); - DrawText(startx + xpos * font_width, starty, "_", font_active_nr); + strcpy(last_player_name, setup.player_name); - return; + xpos = newxpos; } - - if (((key >= KSYM_A && key <= KSYM_Z) || - (key >= KSYM_a && key <= KSYM_z)) && - xpos < MAX_PLAYER_NAME_LEN) + else if (is_valid_key_char && xpos < MAX_PLAYER_NAME_LEN) { - char ascii; - - if (key >= KSYM_A && key <= KSYM_Z) - ascii = 'A' + (char)(key - KSYM_A); - else - ascii = 'a' + (char)(key - KSYM_a); - - setup.player_name[xpos] = ascii; + setup.player_name[xpos] = key_char; setup.player_name[xpos + 1] = 0; xpos++; - - DrawText(startx, starty, setup.player_name, font_active_nr); - DrawText(startx + xpos * font_width, starty, "_", font_active_nr); } else if ((key == KSYM_Delete || key == KSYM_BackSpace) && xpos > 0) { xpos--; setup.player_name[xpos] = 0; - - DrawText(startx + xpos * font_width, starty, "_ ", font_active_nr); } else if (key == KSYM_Return && xpos > 0) { - DrawText(startx, starty, setup.player_name, font_nr); - DrawText(startx + xpos * font_width, starty, " ", font_active_nr); - SaveSetup(); + is_active = FALSE; + + game_status = GAME_MODE_MAIN; + } + else if (key == KSYM_Escape) + { + strcpy(setup.player_name, last_player_name); + + is_active = FALSE; + game_status = GAME_MODE_MAIN; } + + if (is_active) + { + pos->width = (strlen(setup.player_name) + 1) * font_width; + startx = mSX + ALIGNED_TEXT_XPOS(pos); + + DrawText(startx, starty, setup.player_name, font_active_nr); + DrawText(startx + xpos * font_width, starty, "_", font_active_nr); + } + else + { + pos->width = strlen(setup.player_name) * font_width; + startx = mSX + ALIGNED_TEXT_XPOS(pos); + + DrawText(startx, starty, setup.player_name, font_nr); + } } @@ -2663,12 +3222,19 @@ static void DrawChooseTree(TreeInfo **ti_ptr) CloseDoor(DOOR_CLOSE_2); - ClearWindow(); +#if 1 + FadeOut(REDRAW_FIELD); +#endif + + ClearField(); HandleChooseTree(0, 0, 0, 0, MB_MENU_INITIALIZE, ti_ptr); MapScreenTreeGadgets(*ti_ptr); - FadeToFront(); +#if 1 + FadeIn(REDRAW_FIELD); +#endif + InitAnimation(); } @@ -2704,8 +3270,10 @@ static void drawChooseTreeList(int first_entry, int num_page_entries, DrawTextSCentered(mSY - SY + yoffset, FONT_TITLE_1, title_string); +#if 0 /* force LEVELS font on artwork setup screen */ game_status = GAME_MODE_LEVELS; +#endif #if 1 /* clear tree list area, but not title or scrollbar */ @@ -2799,8 +3367,10 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, int last_game_status = game_status; /* save current game status */ boolean position_set_by_scrollbar = (dx == 999); +#if 0 /* force LEVELS draw offset on choose level and artwork setup screen */ game_status = GAME_MODE_LEVELS; +#endif if (num_entries <= NUM_MENU_ENTRIES_ON_SCREEN) num_page_entries = num_entries; @@ -2843,6 +3413,8 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, } else if (button == MB_MENU_LEAVE) { + FadeSetLeaveMenu(); + PlaySound(SND_MENU_ITEM_SELECTING); if (ti->node_parent) @@ -2852,18 +3424,19 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, } else if (game_status == GAME_MODE_SETUP) { - if (game_status == GAME_MODE_SETUP) - { - if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE) - execSetupGraphics(); - else - execSetupArtwork(); - } + if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED) + execSetupGame(); + else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE || + setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY) + execSetupGraphics(); + else + execSetupArtwork(); } else { game_status = GAME_MODE_MAIN; - DrawMainMenu(); + + DrawMainMenuExt(REDRAW_FIELD, FALSE); } return; @@ -2873,8 +3446,10 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, { int last_game_status = game_status; /* save current game status */ +#if 0 /* force LEVELS draw offset on artwork setup screen */ game_status = GAME_MODE_LEVELS; +#endif x = (mx - mSX) / 32; y = (my - mSY) / 32 - MENU_SCREEN_START_YPOS; @@ -2945,6 +3520,8 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, if (node_cursor->node_group) { + FadeSetEnterMenu(); + PlaySound(SND_MENU_ITEM_SELECTING); node_cursor->cl_first = ti->cl_first; @@ -2957,6 +3534,8 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, } else if (dx == -1 && ti->node_parent) { + FadeSetLeaveMenu(); + PlaySound(SND_MENU_ITEM_SELECTING); *ti_ptr = ti->node_parent; @@ -2995,6 +3574,8 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, if (node_cursor->node_group) { + FadeSetEnterMenu(); + node_cursor->cl_first = ti->cl_first; node_cursor->cl_cursor = ti->cl_cursor; *ti_ptr = node_cursor->node_group; @@ -3002,11 +3583,15 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, } else if (node_cursor->parent_link) { + FadeSetLeaveMenu(); + *ti_ptr = node_cursor->node_parent; DrawChooseTree(ti_ptr); } else { + FadeSetEnterScreen(); + node_cursor->cl_first = ti->cl_first; node_cursor->cl_cursor = ti->cl_cursor; *ti_ptr = node_cursor; @@ -3022,7 +3607,10 @@ static void HandleChooseTree(int mx, int my, int dx, int dy, int button, if (game_status == GAME_MODE_SETUP) { - if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE) + if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED) + execSetupGame(); + else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE || + setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY) execSetupGraphics(); else execSetupArtwork(); @@ -3072,7 +3660,13 @@ void DrawHallOfFame(int highlight_position) if (highlight_position < 0) LoadScore(level_nr); + FadeSetEnterScreen(); + + // printf("::: %d: %d\n", game_status, menu.enter_screen[game_status]); + +#if 1 FadeOut(REDRAW_FIELD); +#endif InitAnimation(); @@ -3081,7 +3675,9 @@ void DrawHallOfFame(int highlight_position) HandleHallOfFame(highlight_position, 0, 0, 0, MB_MENU_INITIALIZE); +#if 1 FadeIn(REDRAW_FIELD); +#endif } static void drawHallOfFameList(int first_entry, int highlight_position) @@ -3089,7 +3685,7 @@ static void drawHallOfFameList(int first_entry, int highlight_position) int i; SetMainBackgroundImage(IMG_BACKGROUND_SCORES); - ClearWindow(); + ClearField(); DrawTextSCentered(MENU_TITLE1_YPOS, FONT_TITLE_1, "Hall Of Fame"); DrawTextFCentered(MENU_TITLE2_YPOS, FONT_TITLE_2, @@ -3176,7 +3772,10 @@ void HandleHallOfFame(int mx, int my, int dx, int dy, int button) PlaySound(SND_MENU_ITEM_SELECTING); FadeSound(SND_BACKGROUND_SCORES); + +#if 0 FadeOut(REDRAW_FIELD); +#endif game_status = GAME_MODE_MAIN; @@ -3198,6 +3797,8 @@ static struct TokenInfo *setup_info; static int num_setup_info; static char *screen_mode_text; +static char *scroll_delay_text; +static char *game_speed_text; static char *graphics_set_name; static char *sounds_set_name; static char *music_set_name; @@ -3205,18 +3806,75 @@ static char *music_set_name; static void execSetupMain() { setup_mode = SETUP_MODE_MAIN; + DrawSetupScreen(); } static void execSetupGame() { + if (game_speeds == NULL) + { + int i; + + for (i = 0; game_speeds_list[i].value != -1; i++) + { + TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_UNDEFINED); + char identifier[32], name[32]; + int value = game_speeds_list[i].value; + char *text = game_speeds_list[i].text; + + ti->node_top = &game_speeds; + ti->sort_priority = 10000 - value; + + sprintf(identifier, "%d", value); + sprintf(name, "%s", text); + + setString(&ti->identifier, identifier); + setString(&ti->name, name); + setString(&ti->name_sorting, name); + setString(&ti->infotext, "Game Speed"); + + pushTreeInfo(&game_speeds, ti); + } + + /* sort game speed values to start with slowest game speed */ + sortTreeInfo(&game_speeds); + + /* set current game speed to configured game speed value */ + game_speed_current = + getTreeInfoFromIdentifier(game_speeds, i_to_a(setup.game_frame_delay)); + + /* if that fails, set current game speed to reliable default value */ + if (game_speed_current == NULL) + game_speed_current = + getTreeInfoFromIdentifier(game_speeds, i_to_a(GAME_FRAME_DELAY)); + + /* if that also fails, set current game speed to first available speed */ + if (game_speed_current == NULL) + game_speed_current = game_speeds; + } + + setup.game_frame_delay = atoi(game_speed_current->identifier); + + /* needed for displaying game speed text instead of identifier */ + game_speed_text = game_speed_current->name; + setup_mode = SETUP_MODE_GAME; + + DrawSetupScreen(); +} + +static void execSetupChooseGameSpeed() +{ + setup_mode = SETUP_MODE_CHOOSE_GAME_SPEED; + DrawSetupScreen(); } static void execSetupEditor() { setup_mode = SETUP_MODE_EDITOR; + DrawSetupScreen(); } @@ -3240,7 +3898,7 @@ static void execSetupGraphics() ti->sort_priority = x * 10000 + y; sprintf(identifier, "%dx%d", x, y); - sprintf(name, "%d x %d [%d:%d]", x, y, xx, yy); + sprintf(name, "%d x %d [%d:%d]", x, y, xx, yy); setString(&ti->identifier, identifier); setString(&ti->name, name); @@ -3278,6 +3936,55 @@ static void execSetupGraphics() screen_mode_text = screen_mode_current->name; } +#if 1 + if (scroll_delays == NULL) + { + int i; + + for (i = 0; scroll_delays_list[i].value != -1; i++) + { + TreeInfo *ti = newTreeInfo_setDefaults(TREE_TYPE_UNDEFINED); + char identifier[32], name[32]; + int value = scroll_delays_list[i].value; + char *text = scroll_delays_list[i].text; + + ti->node_top = &scroll_delays; + ti->sort_priority = value; + + sprintf(identifier, "%d", value); + sprintf(name, "%s", text); + + setString(&ti->identifier, identifier); + setString(&ti->name, name); + setString(&ti->name_sorting, name); + setString(&ti->infotext, "Scroll Delay"); + + pushTreeInfo(&scroll_delays, ti); + } + + /* sort scroll delay values to start with lowest scroll delay value */ + sortTreeInfo(&scroll_delays); + + /* set current scroll delay value to configured scroll delay value */ + scroll_delay_current = + getTreeInfoFromIdentifier(scroll_delays,i_to_a(setup.scroll_delay_value)); + + /* if that fails, set current scroll delay to reliable default value */ + if (scroll_delay_current == NULL) + scroll_delay_current = + getTreeInfoFromIdentifier(scroll_delays, i_to_a(STD_SCROLL_DELAY)); + + /* if that also fails, set current scroll delay to first available value */ + if (scroll_delay_current == NULL) + scroll_delay_current = scroll_delays; + } + + setup.scroll_delay_value = atoi(scroll_delay_current->identifier); + + /* needed for displaying scroll delay text instead of identifier */ + scroll_delay_text = scroll_delay_current->name; +#endif + setup_mode = SETUP_MODE_GRAPHICS; DrawSetupScreen(); } @@ -3288,12 +3995,21 @@ static void execSetupChooseScreenMode() return; setup_mode = SETUP_MODE_CHOOSE_SCREEN_MODE; + + DrawSetupScreen(); +} + +static void execSetupChooseScrollDelay() +{ + setup_mode = SETUP_MODE_CHOOSE_SCROLL_DELAY; + DrawSetupScreen(); } static void execSetupSound() { setup_mode = SETUP_MODE_SOUND; + DrawSetupScreen(); } @@ -3312,49 +4028,57 @@ static void execSetupArtwork() music_set_name = artwork.mus_current->name; setup_mode = SETUP_MODE_ARTWORK; + DrawSetupScreen(); } static void execSetupChooseGraphics() { setup_mode = SETUP_MODE_CHOOSE_GRAPHICS; + DrawSetupScreen(); } static void execSetupChooseSounds() { setup_mode = SETUP_MODE_CHOOSE_SOUNDS; + DrawSetupScreen(); } static void execSetupChooseMusic() { setup_mode = SETUP_MODE_CHOOSE_MUSIC; + DrawSetupScreen(); } static void execSetupInput() { setup_mode = SETUP_MODE_INPUT; + DrawSetupScreen(); } -static void execSetupShortcut1() +static void execSetupShortcuts1() { - setup_mode = SETUP_MODE_SHORTCUT_1; + setup_mode = SETUP_MODE_SHORTCUTS_1; + DrawSetupScreen(); } -static void execSetupShortcut2() +static void execSetupShortcuts2() { - setup_mode = SETUP_MODE_SHORTCUT_2; + setup_mode = SETUP_MODE_SHORTCUTS_2; + DrawSetupScreen(); } static void execExitSetup() { game_status = GAME_MODE_MAIN; - DrawMainMenu(); + + DrawMainMenuExt(REDRAW_FIELD, FALSE); } static void execSaveAndExitSetup() @@ -3371,8 +4095,8 @@ static struct TokenInfo setup_info_main[] = { TYPE_ENTER_MENU, execSetupSound, "Sound & Music" }, { TYPE_ENTER_MENU, execSetupArtwork, "Custom Artwork" }, { TYPE_ENTER_MENU, execSetupInput, "Input Devices" }, - { TYPE_ENTER_MENU, execSetupShortcut1, "Key Shortcuts 1" }, - { TYPE_ENTER_MENU, execSetupShortcut2, "Key Shortcuts 2" }, + { TYPE_ENTER_MENU, execSetupShortcuts1, "Key Shortcuts 1" }, + { TYPE_ENTER_MENU, execSetupShortcuts2, "Key Shortcuts 2" }, { TYPE_EMPTY, NULL, "" }, { TYPE_LEAVE_MENU, execExitSetup, "Exit" }, { TYPE_LEAVE_MENU, execSaveAndExitSetup, "Save and Exit" }, @@ -3388,6 +4112,8 @@ static struct TokenInfo setup_info_game[] = { TYPE_SWITCH, &setup.skip_levels, "Skip Unsolved Levels:" }, { TYPE_SWITCH, &setup.time_limit, "Time Limit:" }, { TYPE_SWITCH, &setup.autorecord, "Auto-Record Tapes:" }, + { TYPE_ENTER_LIST, execSetupChooseGameSpeed, "Game Speed:" }, + { TYPE_STRING, &game_speed_text, "" }, { TYPE_EMPTY, NULL, "" }, { TYPE_LEAVE_MENU, execSetupMain, "Back" }, @@ -3407,6 +4133,7 @@ static struct TokenInfo setup_info_editor[] = { TYPE_SWITCH, &setup.editor.el_dx_boulderdash,"DX-Boulderdash:" }, #endif { TYPE_SWITCH, &setup.editor.el_chars, "Text Characters:" }, + { TYPE_SWITCH, &setup.editor.el_steel_chars, "Text Characters (Steel):" }, { TYPE_SWITCH, &setup.editor.el_custom, "Custom & Group Elements:" }, #if 0 { TYPE_SWITCH, &setup.editor.el_headlines, "Headlines:" }, @@ -3431,10 +4158,13 @@ static struct TokenInfo setup_info_graphics[] = { TYPE_SWITCH, &setup.fullscreen, "Fullscreen:" }, { TYPE_ENTER_LIST, execSetupChooseScreenMode, "Fullscreen Mode:" }, { TYPE_STRING, &screen_mode_text, "" }, - { TYPE_SWITCH, &setup.scroll_delay, "Delayed Scrolling:" }, +#if 0 + { TYPE_SWITCH, &setup.scroll_delay, "Scroll Delay:" }, +#endif + { TYPE_ENTER_LIST, execSetupChooseScrollDelay, "Scroll Delay Value:" }, + { TYPE_STRING, &scroll_delay_text, "" }, #if 0 { TYPE_SWITCH, &setup.soft_scrolling, "Soft Scrolling:" }, - { TYPE_SWITCH, &setup.double_buffering,"Double-Buffering:" }, #endif { TYPE_SWITCH, &setup.fade_screens, "Fade Screens:" }, { TYPE_SWITCH, &setup.quick_switch, "Quick Player Focus Switch:" }, @@ -3504,7 +4234,7 @@ static struct TokenInfo setup_info_input[] = { 0, NULL, NULL } }; -static struct TokenInfo setup_info_shortcut_1[] = +static struct TokenInfo setup_info_shortcuts_1[] = { { TYPE_KEYTEXT, NULL, "Quick Save Game to Tape:", }, { TYPE_KEY, &setup.shortcut.save_game, "" }, @@ -3521,7 +4251,7 @@ static struct TokenInfo setup_info_shortcut_1[] = { 0, NULL, NULL } }; -static struct TokenInfo setup_info_shortcut_2[] = +static struct TokenInfo setup_info_shortcuts_2[] = { { TYPE_KEYTEXT, NULL, "Set Focus to Player 1:", }, { TYPE_KEY, &setup.shortcut.focus_player[0], "" }, @@ -3740,13 +4470,30 @@ static void DrawCursorAndText_Setup(int pos, boolean active) static void DrawSetupScreen_Generic() { + boolean redraw_all = FALSE; char *title_string = NULL; int i; UnmapAllGadgets(); CloseDoor(DOOR_CLOSE_2); - ClearWindow(); + if (redraw_mask & REDRAW_ALL) + redraw_all = TRUE; + +#if 0 + printf("::: %s\n", (redraw_mask & REDRAW_FIELD ? "REDRAW_FIELD" : + redraw_mask & REDRAW_ALL ? "REDRAW_ALL" : + int2str(0, redraw_mask))); +#endif + +#if 0 + /* !!! usually REDRAW_NONE => DOES NOT WORK (with fade) => CHECK THIS !!! */ + FadeOut(redraw_mask); +#else + FadeOut(REDRAW_FIELD); +#endif + + ClearField(); if (setup_mode == SETUP_MODE_MAIN) { @@ -3778,29 +4525,27 @@ static void DrawSetupScreen_Generic() setup_info = setup_info_artwork; title_string = "Custom Artwork"; } - else if (setup_mode == SETUP_MODE_SHORTCUT_1) + else if (setup_mode == SETUP_MODE_SHORTCUTS_1) { - setup_info = setup_info_shortcut_1; + setup_info = setup_info_shortcuts_1; title_string = "Setup Shortcuts"; } - else if (setup_mode == SETUP_MODE_SHORTCUT_2) + else if (setup_mode == SETUP_MODE_SHORTCUTS_2) { - setup_info = setup_info_shortcut_2; + setup_info = setup_info_shortcuts_2; title_string = "Setup Shortcuts"; } DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, title_string); num_setup_info = 0; - for (i = 0; setup_info[i].type != 0 && i < NUM_MENU_ENTRIES_ON_SCREEN; i++) - { - void *value_ptr = setup_info[i].value; #if 1 + for (i = 0; setup_info[i].type != 0 && i < MAX_MENU_ENTRIES_ON_SCREEN; i++) #else - int xpos = MENU_SCREEN_START_XPOS; - int ypos = MENU_SCREEN_START_YPOS + i; - int font_nr; + for (i = 0; setup_info[i].type != 0 && i < NUM_MENU_ENTRIES_ON_SCREEN; i++) #endif + { + void *value_ptr = setup_info[i].value; /* set some entries to "unchangeable" according to other variables */ if ((value_ptr == &setup.sound_simple && !audio.sound_available) || @@ -3817,13 +4562,7 @@ static void DrawSetupScreen_Generic() else if (setup_info[i].type & ~TYPE_SKIP_ENTRY) initCursor(i, IMG_MENU_BUTTON); -#if 1 DrawCursorAndText_Setup(i, FALSE); -#else - font_nr = getSetupTextFont(setup_info[i].type); - - DrawText(mSX + xpos * 32, mSY + ypos * 32, setup_info[i].text, font_nr); -#endif if (setup_info[i].type & TYPE_VALUE) drawSetupValue(i); @@ -3836,9 +4575,23 @@ static void DrawSetupScreen_Generic() "Joysticks deactivated in setup menu"); #endif - FadeToFront(); +#if 1 + HandleSetupScreen_Generic(0, 0, 0, 0, MB_MENU_INITIALIZE); +#endif + + if (redraw_all) + redraw_mask = REDRAW_ALL; + +#if 1 + FadeIn(redraw_mask); +#else + FadeIn(REDRAW_FIELD); +#endif + InitAnimation(); +#if 0 HandleSetupScreen_Generic(0, 0, 0, 0, MB_MENU_INITIALIZE); +#endif } void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) @@ -3856,11 +4609,7 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) choice++; choice_store[setup_mode] = choice; -#if 1 DrawCursorAndText_Setup(choice, TRUE); -#else - drawCursor(choice, TRUE); -#endif return; } @@ -3874,6 +4623,8 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) { void (*menu_callback_function)(void) = setup_info[y].value; + FadeSetLeaveMenu(); + menu_callback_function(); break; /* absolutely needed because function changes 'setup_info'! */ @@ -3915,13 +4666,8 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) { PlaySound(SND_MENU_ITEM_ACTIVATING); -#if 1 DrawCursorAndText_Setup(choice, FALSE); DrawCursorAndText_Setup(y, TRUE); -#else - drawCursor(choice, FALSE); - drawCursor(y, TRUE); -#endif choice = choice_store[setup_mode] = y; } @@ -3944,6 +4690,8 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) { void (*menu_callback_function)(void) = setup_info[y].value; + FadeSetFromType(setup_info[y].type); + menu_callback_function(); } else @@ -3957,11 +4705,13 @@ void HandleSetupScreen_Generic(int mx, int my, int dx, int dy, int button) void DrawSetupScreen_Input() { -#if 1 int i; + +#if 1 + FadeOut(REDRAW_FIELD); #endif - ClearWindow(); + ClearField(); #if 1 setup_info = setup_info_input; @@ -3970,7 +4720,20 @@ void DrawSetupScreen_Input() DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Setup Input"); #if 1 +#if 1 + DrawTextSCentered(SYSIZE - 20, FONT_TITLE_2, + "Joysticks deactivated on this screen"); +#else + DrawTextSCentered(SYSIZE - 20, FONT_TEXT_4, + "Joysticks deactivated on this screen"); +#endif +#endif + +#if 1 + for (i = 0; setup_info[i].type != 0 && i < MAX_MENU_ENTRIES_ON_SCREEN; i++) +#else for (i = 0; setup_info[i].type != 0 && i < NUM_MENU_ENTRIES_ON_SCREEN; i++) +#endif { if (setup_info[i].type & (TYPE_ENTER_MENU|TYPE_ENTER_LIST)) initCursor(i, IMG_MENU_BUTTON_ENTER_MENU); @@ -3981,23 +4744,19 @@ void DrawSetupScreen_Input() DrawCursorAndText_Setup(i, FALSE); } -#else - initCursor(0, IMG_MENU_BUTTON); - initCursor(1, IMG_MENU_BUTTON); - initCursor(2, IMG_MENU_BUTTON_ENTER_MENU); - initCursor(13, IMG_MENU_BUTTON_LEAVE_MENU); - - DrawText(mSX + 32, mSY + 2 * 32, "Player:", FONT_MENU_1); - DrawText(mSX + 32, mSY + 3 * 32, "Device:", FONT_MENU_1); - DrawText(mSX + 32, mSY + 15 * 32, "Back", FONT_MENU_1); -#endif #if 0 DeactivateJoystickForCalibration(); #endif + +#if 0 #if 1 + DrawTextSCentered(SYSIZE - 20, FONT_TITLE_2, + "Joysticks deactivated on this screen"); +#else DrawTextSCentered(SYSIZE - 20, FONT_TEXT_4, "Joysticks deactivated on this screen"); +#endif #endif /* create gadgets for setup input menu screen */ @@ -4008,7 +4767,11 @@ void DrawSetupScreen_Input() MapScreenMenuGadgets(SCREEN_MASK_INPUT); HandleSetupScreen_Input(0, 0, 0, 0, MB_MENU_INITIALIZE); - FadeToFront(); + +#if 1 + FadeIn(REDRAW_FIELD); +#endif + InitAnimation(); } @@ -4148,11 +4911,7 @@ void HandleSetupScreen_Input(int mx, int my, int dx, int dy, int button) { drawPlayerSetupInputInfo(input_player_nr, (choice == 2)); -#if 1 DrawCursorAndText_Setup(choice, TRUE); -#else - drawCursor(choice, TRUE); -#endif return; } @@ -4197,15 +4956,10 @@ void HandleSetupScreen_Input(int mx, int my, int dx, int dy, int button) { if (y != choice) { -#if 1 DrawCursorAndText_Setup(choice, FALSE); DrawCursorAndText_Setup(y, TRUE); drawPlayerSetupInputInfo(input_player_nr, (y == 2)); -#else - drawCursor(choice, FALSE); - drawCursor(y, TRUE); -#endif choice = y; } @@ -4250,6 +5004,8 @@ void HandleSetupScreen_Input(int mx, int my, int dx, int dy, int button) { InitJoysticks(); + FadeSetLeaveMenu(); + setup_mode = SETUP_MODE_MAIN; DrawSetupScreen(); } @@ -4280,12 +5036,17 @@ void CustomizeKeyboard(int player_nr) /* read existing key bindings from player setup */ custom_key = setup.input[player_nr].key; - ClearWindow(); + FadeSetEnterMenu(); + FadeOut(REDRAW_FIELD); + + ClearField(); DrawTextSCentered(mSY - SY + 16, FONT_TITLE_1, "Keyboard Input"); +#if 0 BackToFront(); InitAnimation(); +#endif step_nr = 0; DrawText(mSX, mSY + (2 + 2 * step_nr) * 32, @@ -4295,6 +5056,12 @@ void CustomizeKeyboard(int player_nr) DrawText(mSX + 4 * 32, mSY + (2 + 2 * step_nr + 1) * 32, getKeyNameFromKey(*customize_step[step_nr].key), FONT_VALUE_OLD); +#if 1 + FadeIn(REDRAW_FIELD); + + InitAnimation(); +#endif + while (!finished) { if (PendingEvent()) /* got event */ @@ -4311,6 +5078,9 @@ void CustomizeKeyboard(int player_nr) if (key == KSYM_Escape || (key == KSYM_Return && step_nr == 6)) { + if (key == KSYM_Escape) + FadeSkipNextFadeIn(); + finished = TRUE; break; } @@ -4409,7 +5179,10 @@ static boolean CalibrateJoystickMain(int player_nr) if (joystick_fd < 0 || !setup.input[player_nr].use_joystick) return FALSE; - ClearWindow(); + FadeSetEnterMenu(); + FadeOut(REDRAW_FIELD); + + ClearField(); for (y = 0; y < 3; y++) { @@ -4440,7 +5213,8 @@ static boolean CalibrateJoystickMain(int player_nr) new_joystick_ymiddle = joy_y; DrawGraphic(xpos + last_x, ypos + last_y, IMG_MENU_CALIBRATE_RED, 0); - BackToFront(); + + FadeIn(REDRAW_FIELD); while (Joystick(player_nr) & JOY_BUTTON); /* wait for released button */ InitAnimation(); @@ -4464,6 +5238,7 @@ static boolean CalibrateJoystickMain(int player_nr) break; case KSYM_Escape: + FadeSkipNextFadeIn(); result = 0; break; @@ -4582,7 +5357,7 @@ void CalibrateJoystick(int player_nr) int xpos = mSX - SX; int ypos = mSY - SY; - ClearWindow(); + ClearField(); DrawTextF(xpos + 16, ypos + 6 * 32, FONT_TITLE_1, " JOYSTICK %d ", nr); DrawTextF(xpos + 16, ypos + 7 * 32, FONT_TITLE_1, " NOT AVAILABLE! "); @@ -4606,8 +5381,12 @@ void DrawSetupScreen() if (setup_mode == SETUP_MODE_INPUT) DrawSetupScreen_Input(); + else if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED) + DrawChooseTree(&game_speed_current); else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE) DrawChooseTree(&screen_mode_current); + else if (setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY) + DrawChooseTree(&scroll_delay_current); else if (setup_mode == SETUP_MODE_CHOOSE_GRAPHICS) DrawChooseTree(&artwork.gfx_current); else if (setup_mode == SETUP_MODE_CHOOSE_SOUNDS) @@ -4631,8 +5410,12 @@ void HandleSetupScreen(int mx, int my, int dx, int dy, int button) { if (setup_mode == SETUP_MODE_INPUT) HandleSetupScreen_Input(mx, my, dx, dy, button); + else if (setup_mode == SETUP_MODE_CHOOSE_GAME_SPEED) + HandleChooseTree(mx, my, dx, dy, button, &game_speed_current); else if (setup_mode == SETUP_MODE_CHOOSE_SCREEN_MODE) HandleChooseTree(mx, my, dx, dy, button, &screen_mode_current); + else if (setup_mode == SETUP_MODE_CHOOSE_SCROLL_DELAY) + HandleChooseTree(mx, my, dx, dy, button, &scroll_delay_current); else if (setup_mode == SETUP_MODE_CHOOSE_GRAPHICS) HandleChooseTree(mx, my, dx, dy, button, &artwork.gfx_current); else if (setup_mode == SETUP_MODE_CHOOSE_SOUNDS) @@ -5014,8 +5797,10 @@ void CreateScreenGadgets() CreateScreenMenubuttons(); +#if 0 /* force LEVELS draw offset for scrollbar / scrollbutton gadgets */ game_status = GAME_MODE_LEVELS; +#endif CreateScreenScrollbuttons(); CreateScreenScrollbars(); diff --git a/src/tape.c b/src/tape.c index 1aaabf55..fc90ad51 100644 --- a/src/tape.c +++ b/src/tape.c @@ -566,6 +566,10 @@ static void TapeAppendRecording() DrawVideoDisplay(VIDEO_STATE_DATE_ON, tape.date); DrawVideoDisplay(VIDEO_STATE_PLAY_OFF | VIDEO_STATE_REC_ON, 0); + +#if 1 + UpdateAndDisplayGameControlValues(); +#endif } void TapeHaltRecording() diff --git a/src/tools.c b/src/tools.c index c85d5924..7e2c3752 100644 --- a/src/tools.c +++ b/src/tools.c @@ -118,7 +118,7 @@ void SetDrawtoField(int mode) drawto_field = fieldbuffer; } - else /* DRAW_DIRECT, DRAW_BACKBUFFER */ + else /* DRAW_BACKBUFFER */ { FX = SX; FY = SY; @@ -129,7 +129,7 @@ void SetDrawtoField(int mode) redraw_x1 = 0; redraw_y1 = 0; - drawto_field = (mode == DRAW_DIRECT ? window : backbuffer); + drawto_field = backbuffer; } } @@ -154,23 +154,17 @@ void RedrawPlayfield(boolean force_redraw, int x, int y, int width, int height) height = gfx.sysize + 2 * TILEY; } - if (force_redraw || setup.direct_draw) + if (force_redraw) { int xx, yy; int x1 = (x - SX) / TILEX, y1 = (y - SY) / TILEY; int x2 = (x - SX + width) / TILEX, y2 = (y - SY + height) / TILEY; - if (setup.direct_draw) - SetDrawtoField(DRAW_BACKBUFFER); - for (xx = BX1; xx <= BX2; xx++) for (yy = BY1; yy <= BY2; yy++) if (xx >= x1 && xx <= x2 && yy >= y1 && yy <= y2) DrawScreenField(xx, yy); DrawAllPlayers(); - - if (setup.direct_draw) - SetDrawtoField(DRAW_DIRECT); } if (setup.soft_scrolling) @@ -205,16 +199,16 @@ void DrawMaskedBorder_Rect(int x, int y, int width, int height) void DrawMaskedBorder_FIELD() { - if (game_status >= GAME_MODE_TITLE && - game_status <= GAME_MODE_PLAYING && - border.draw_masked[game_status]) + if (global.border_status >= GAME_MODE_TITLE && + global.border_status <= GAME_MODE_PLAYING && + border.draw_masked[global.border_status]) DrawMaskedBorder_Rect(REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE); } void DrawMaskedBorder_DOOR_1() { if (border.draw_masked[GFX_SPECIAL_ARG_DOOR] && - (game_status != GAME_MODE_EDITOR || + (global.border_status != GAME_MODE_EDITOR || border.draw_masked[GFX_SPECIAL_ARG_EDITOR])) DrawMaskedBorder_Rect(DX, DY, DXSIZE, DYSIZE); } @@ -222,7 +216,7 @@ void DrawMaskedBorder_DOOR_1() void DrawMaskedBorder_DOOR_2() { if (border.draw_masked[GFX_SPECIAL_ARG_DOOR] && - game_status != GAME_MODE_EDITOR) + global.border_status != GAME_MODE_EDITOR) DrawMaskedBorder_Rect(VX, VY, VXSIZE, VYSIZE); } @@ -241,9 +235,9 @@ void DrawMaskedBorder_ALL() void DrawMaskedBorder(int redraw_mask) { - /* do not draw masked screen borders when displaying title screens */ - if (effectiveGameStatus() == GAME_MODE_TITLE || - effectiveGameStatus() == GAME_MODE_MESSAGE) + /* never draw masked screen borders on borderless screens */ + if (effectiveGameStatus() == GAME_MODE_LOADING || + effectiveGameStatus() == GAME_MODE_TITLE) return; if (redraw_mask & REDRAW_ALL) @@ -266,9 +260,6 @@ void BackToFront() int x,y; DrawBuffer *buffer = (drawto_field == window ? backbuffer : drawto_field); - if (setup.direct_draw && game_status == GAME_MODE_PLAYING) - redraw_mask &= ~REDRAW_MAIN; - if (redraw_mask & REDRAW_TILES && redraw_tiles > REDRAWTILES_THRESHOLD) redraw_mask |= REDRAW_FIELD; @@ -449,95 +440,112 @@ void BackToFront() redraw_mask = REDRAW_NONE; } -void FadeToFront() +static void FadeCrossSaveBackbuffer() { -#if 0 - long fading_delay = 300; + BlitBitmap(backbuffer, bitmap_db_cross, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0); +} - if (setup.fading && (redraw_mask & REDRAW_FIELD)) +static void FadeExt(int fade_mask, int fade_mode, int fade_type) +{ + static int fade_type_skip = FADE_TYPE_NONE; + void (*draw_border_function)(void) = NULL; + Bitmap *bitmap = (fade_mode & FADE_TYPE_TRANSFORM ? bitmap_db_cross : NULL); + int x, y, width, height; + int fade_delay, post_delay; + + if (fade_type == FADE_TYPE_FADE_OUT) { + if (fade_type_skip != FADE_TYPE_NONE) + { +#if 0 + printf("::: skipping %d ... [%d] (X)\n", fade_mode, fade_type_skip); #endif -#if 0 - int x,y; + /* skip all fade operations until specified fade operation */ + if (fade_type & fade_type_skip) + fade_type_skip = FADE_TYPE_NONE; - ClearRectangle(window, REAL_SX,REAL_SY,FULL_SXSIZE,FULL_SYSIZE); - FlushDisplay(); + return; + } - for (i = 0; i < 2 * FULL_SYSIZE; i++) + if (fading.fade_mode & FADE_TYPE_TRANSFORM) { - for (y = 0; y < FULL_SYSIZE; y++) - { - BlitBitmap(backbuffer, window, - REAL_SX,REAL_SY+i, FULL_SXSIZE,1, REAL_SX,REAL_SY+i); - } - FlushDisplay(); - Delay(10); + FadeCrossSaveBackbuffer(); + + return; } + } + + redraw_mask |= fade_mask; + + if (fade_type == FADE_TYPE_SKIP) + { +#if 0 + printf("::: will skip %d ... [%d]\n", fade_mode, fade_type_skip); #endif + fade_type_skip = fade_mode; + + return; + } + + if (fade_type_skip != FADE_TYPE_NONE) + { #if 0 - for (i = 1; i < FULL_SYSIZE; i+=2) - BlitBitmap(backbuffer, window, - REAL_SX,REAL_SY+i, FULL_SXSIZE,1, REAL_SX,REAL_SY+i); - FlushDisplay(); - Delay(fading_delay); + printf("::: skipping %d ... [%d]\n", fade_mode, fade_type_skip); +#endif + + /* skip all fade operations until specified fade operation */ + if (fade_type & fade_type_skip) + fade_type_skip = FADE_TYPE_NONE; + + return; + } + +#if 1 + if (global.autoplay_leveldir) + { + // fading.fade_mode = FADE_MODE_NONE; + + return; + } #endif #if 0 - SetClipOrigin(clip_gc[PIX_FADEMASK], 0, 0); - BlitBitmapMasked(backbuffer, window, - REAL_SX,REAL_SY, FULL_SXSIZE,FULL_SYSIZE, - REAL_SX,REAL_SY); - FlushDisplay(); - Delay(fading_delay); - - SetClipOrigin(clip_gc[PIX_FADEMASK], -1, -1); - BlitBitmapMasked(backbuffer, window, - REAL_SX,REAL_SY, FULL_SXSIZE,FULL_SYSIZE, - REAL_SX,REAL_SY); - FlushDisplay(); - Delay(fading_delay); - - SetClipOrigin(clip_gc[PIX_FADEMASK], 0, -1); - BlitBitmapMasked(backbuffer, window, - REAL_SX,REAL_SY, FULL_SXSIZE,FULL_SYSIZE, - REAL_SX,REAL_SY); - FlushDisplay(); - Delay(fading_delay); - - SetClipOrigin(clip_gc[PIX_FADEMASK], -1, 0); - BlitBitmapMasked(backbuffer, window, - REAL_SX,REAL_SY, FULL_SXSIZE,FULL_SYSIZE, - REAL_SX,REAL_SY); - FlushDisplay(); - Delay(fading_delay); + if (fading.fade_mode == FADE_MODE_NONE) + { + BackToFront(); - redraw_mask &= ~REDRAW_MAIN; + return; } #endif - BackToFront(); -} + /* !!! what abount fade_mask == REDRAW_FIELD | REDRAW_ALL ??? !!! */ -void FadeExt(int fade_mask, int fade_mode) -{ - void (*draw_border_function)(void) = NULL; - Bitmap *bitmap = (fade_mode == FADE_MODE_CROSSFADE ? bitmap_db_cross : NULL); - int x, y, width, height; - int fade_delay, post_delay; +#if 0 + printf("::: NOW FADING %d ... [%d]\n", fade_mode, fade_type); +#endif + +#if 0 + if (fade_mask == REDRAW_NONE) + fade_mask = REDRAW_FIELD; +#endif - if (fade_mask & REDRAW_FIELD) + // if (fade_mask & REDRAW_FIELD) + if (fade_mask == REDRAW_FIELD) { x = REAL_SX; y = REAL_SY; width = FULL_SXSIZE; height = FULL_SYSIZE; - fade_delay = menu.fade_delay; - post_delay = (fade_mode == FADE_MODE_FADE_OUT ? menu.post_delay : 0); + fade_delay = fading.fade_delay; + post_delay = (fade_mode == FADE_MODE_FADE_OUT ? fading.post_delay : 0); - draw_border_function = DrawMaskedBorder_FIELD; + if (border.draw_masked_when_fading) + draw_border_function = DrawMaskedBorder_FIELD; /* update when fading */ + else + DrawMaskedBorder_FIELD(); /* draw once */ } else /* REDRAW_ALL */ { @@ -546,18 +554,33 @@ void FadeExt(int fade_mask, int fade_mode) width = WIN_XSIZE; height = WIN_YSIZE; - fade_delay = title.fade_delay_final; - post_delay = (fade_mode == FADE_MODE_FADE_OUT ? title.post_delay_final : 0); + fade_delay = fading.fade_delay; + post_delay = (fade_mode == FADE_MODE_FADE_OUT ? fading.post_delay : 0); } - redraw_mask |= fade_mask; - +#if 1 + if (!setup.fade_screens || + fade_delay == 0 || + fading.fade_mode == FADE_MODE_NONE) +#else if (!setup.fade_screens || fade_delay == 0) +#endif { if (fade_mode == FADE_MODE_FADE_OUT) + return; + +#if 0 + if (fade_mode == FADE_MODE_FADE_OUT && + fading.fade_mode != FADE_MODE_NONE) ClearRectangle(backbuffer, x, y, width, height); +#endif +#if 1 + BlitBitmap(backbuffer, window, x, y, width, height, x, y); + redraw_mask = REDRAW_NONE; +#else BackToFront(); +#endif return; } @@ -570,22 +593,111 @@ void FadeExt(int fade_mask, int fade_mode) void FadeIn(int fade_mask) { - FadeExt(fade_mask, FADE_MODE_FADE_IN); + if (fading.fade_mode & FADE_TYPE_TRANSFORM) + FadeExt(fade_mask, fading.fade_mode, FADE_TYPE_FADE_IN); + else + FadeExt(fade_mask, FADE_MODE_FADE_IN, FADE_TYPE_FADE_IN); } void FadeOut(int fade_mask) { - FadeExt(fade_mask, FADE_MODE_FADE_OUT); + if (fading.fade_mode & FADE_TYPE_TRANSFORM) + FadeExt(fade_mask, fading.fade_mode, FADE_TYPE_FADE_OUT); + else + FadeExt(fade_mask, FADE_MODE_FADE_OUT, FADE_TYPE_FADE_OUT); + + global.border_status = game_status; +} + +static void FadeSetLeaveNext(struct TitleFadingInfo fading_leave, boolean set) +{ + static struct TitleFadingInfo fading_leave_stored; + + if (set) + fading_leave_stored = fading_leave; + else + fading = fading_leave_stored; } -void FadeCross(int fade_mask) +void FadeSetEnterMenu() { - FadeExt(fade_mask, FADE_MODE_CROSSFADE); + fading = menu.enter_menu; + +#if 0 + printf("::: storing enter_menu\n"); +#endif + + FadeSetLeaveNext(fading, TRUE); /* (keep same fade mode) */ } -void FadeCrossSaveBackbuffer() +void FadeSetLeaveMenu() { - BlitBitmap(backbuffer, bitmap_db_cross, 0, 0, WIN_XSIZE, WIN_YSIZE, 0, 0); + fading = menu.leave_menu; + +#if 0 + printf("::: storing leave_menu\n"); +#endif + + FadeSetLeaveNext(fading, TRUE); /* (keep same fade mode) */ +} + +void FadeSetEnterScreen() +{ + fading = menu.enter_screen[game_status]; + +#if 0 + printf("::: storing leave_screen[%d]\n", game_status); +#endif + + FadeSetLeaveNext(menu.leave_screen[game_status], TRUE); /* store */ +} + +void FadeSetNextScreen() +{ + fading = menu.next_screen; + +#if 0 + printf("::: storing next_screen\n"); +#endif + + // (do not overwrite fade mode set by FadeSetEnterScreen) + // FadeSetLeaveNext(fading, TRUE); /* (keep same fade mode) */ +} + +void FadeSetLeaveScreen() +{ +#if 0 + printf("::: recalling last stored value\n"); +#endif + + FadeSetLeaveNext(menu.leave_screen[game_status], FALSE); /* recall */ +} + +void FadeSetFromType(int type) +{ + if (type & TYPE_ENTER_SCREEN) + FadeSetEnterScreen(); + else if (type & TYPE_ENTER) + FadeSetEnterMenu(); + else if (type & TYPE_LEAVE) + FadeSetLeaveMenu(); +} + +void FadeSetDisabled() +{ + static struct TitleFadingInfo fading_none = { FADE_MODE_NONE, -1, -1, -1 }; + + fading = fading_none; +} + +void FadeSkipNextFadeIn() +{ + FadeExt(0, FADE_MODE_SKIP_FADE_IN, FADE_TYPE_SKIP); +} + +void FadeSkipNextFadeOut() +{ + FadeExt(0, FADE_MODE_SKIP_FADE_OUT, FADE_TYPE_SKIP); } void SetWindowBackgroundImageIfDefined(int graphic) @@ -600,6 +712,20 @@ void SetMainBackgroundImageIfDefined(int graphic) SetMainBackgroundBitmap(graphic_info[graphic].bitmap); } +void SetDoorBackgroundImageIfDefined(int graphic) +{ + if (graphic_info[graphic].bitmap) + SetDoorBackgroundBitmap(graphic_info[graphic].bitmap); +} + +void SetWindowBackgroundImage(int graphic) +{ + SetWindowBackgroundBitmap(graphic == IMG_UNDEFINED ? NULL : + graphic_info[graphic].bitmap ? + graphic_info[graphic].bitmap : + graphic_info[IMG_BACKGROUND].bitmap); +} + void SetMainBackgroundImage(int graphic) { SetMainBackgroundBitmap(graphic == IMG_UNDEFINED ? NULL : @@ -657,7 +783,7 @@ void DrawBackgroundForGraphic(int x, int y, int width, int height, int graphic) DrawBackground(x, y, width, height); } -void ClearWindow() +void ClearField() { /* !!! "drawto" might still point to playfield buffer here (see above) !!! */ /* (when entering hall of fame after playing) */ @@ -671,12 +797,6 @@ void ClearWindow() } else SetDrawtoField(DRAW_BACKBUFFER); - - if (setup.direct_draw && game_status == GAME_MODE_PLAYING) - { - ClearRectangle(window, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE); - SetDrawtoField(DRAW_DIRECT); - } } void MarkTileDirty(int x, int y) @@ -710,6 +830,39 @@ void SetBorderElement() } } +void FloodFillLevel(int from_x, int from_y, int fill_element, + short field[MAX_LEV_FIELDX][MAX_LEV_FIELDY], + int max_fieldx, int max_fieldy) +{ + int i,x,y; + int old_element; + static int check[4][2] = { { -1, 0 }, { 0, -1 }, { 1, 0 }, { 0, 1 } }; + static int safety = 0; + + /* check if starting field still has the desired content */ + if (field[from_x][from_y] == fill_element) + return; + + safety++; + + if (safety > max_fieldx * max_fieldy) + Error(ERR_EXIT, "Something went wrong in 'FloodFill()'. Please debug."); + + old_element = field[from_x][from_y]; + field[from_x][from_y] = fill_element; + + for (i = 0; i < 4; i++) + { + x = from_x + check[i][0]; + y = from_y + check[i][1]; + + if (IN_FIELD(x, y, max_fieldx, max_fieldy) && field[x][y] == old_element) + FloodFillLevel(x, y, fill_element, field, max_fieldx, max_fieldy); + } + + safety--; +} + void SetRandomAnimationValue(int x, int y) { gfx.anim_random_frame = GfxRandom[x][y]; @@ -728,6 +881,82 @@ inline int getGraphicAnimationFrame(int graphic, int sync_frame) sync_frame); } +void getSizedGraphicSource(int graphic, int frame, int tilesize_raw, + Bitmap **bitmap, int *x, int *y) +{ + struct + { + int width_mult, width_div; + int height_mult, height_div; + } + offset_calc[6] = + { + { 15, 16, 2, 3 }, /* 1 x 1 */ + { 7, 8, 2, 3 }, /* 2 x 2 */ + { 3, 4, 2, 3 }, /* 4 x 4 */ + { 1, 2, 2, 3 }, /* 8 x 8 */ + { 0, 1, 2, 3 }, /* 16 x 16 */ + { 0, 1, 0, 1 }, /* 32 x 32 */ + }; + struct GraphicInfo *g = &graphic_info[graphic]; + Bitmap *src_bitmap = g->bitmap; + int tilesize = MIN(MAX(1, tilesize_raw), TILESIZE); + int offset_calc_pos = log_2(tilesize); + int width_mult = offset_calc[offset_calc_pos].width_mult; + int width_div = offset_calc[offset_calc_pos].width_div; + int height_mult = offset_calc[offset_calc_pos].height_mult; + int height_div = offset_calc[offset_calc_pos].height_div; + int startx = src_bitmap->width * width_mult / width_div; + int starty = src_bitmap->height * height_mult / height_div; + int src_x = g->src_x * tilesize / TILESIZE; + int src_y = g->src_y * tilesize / TILESIZE; + int width = g->width * tilesize / TILESIZE; + int height = g->height * tilesize / TILESIZE; + int offset_x = g->offset_x * tilesize / TILESIZE; + int offset_y = g->offset_y * tilesize / TILESIZE; + + if (g->offset_y == 0) /* frames are ordered horizontally */ + { + int max_width = g->anim_frames_per_line * width; + int pos = (src_y / height) * max_width + src_x + frame * offset_x; + + src_x = pos % max_width; + src_y = src_y % height + pos / max_width * height; + } + else if (g->offset_x == 0) /* frames are ordered vertically */ + { + int max_height = g->anim_frames_per_line * height; + int pos = (src_x / width) * max_height + src_y + frame * offset_y; + + src_x = src_x % width + pos / max_height * width; + src_y = pos % max_height; + } + else /* frames are ordered diagonally */ + { + src_x = src_x + frame * offset_x; + src_y = src_y + frame * offset_y; + } + + *bitmap = src_bitmap; + *x = startx + src_x; + *y = starty + src_y; +} + +void getMiniGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) +{ +#if 1 + getSizedGraphicSource(graphic, 0, MINI_TILESIZE, bitmap, x, y); +#else + struct GraphicInfo *g = &graphic_info[graphic]; + int mini_startx = 0; + int mini_starty = g->bitmap->height * 2 / 3; + + *bitmap = g->bitmap; + *x = mini_startx + g->src_x / 2; + *y = mini_starty + g->src_y / 2; +#endif +} + inline void getGraphicSourceExt(int graphic, int frame, Bitmap **bitmap, int *x, int *y, boolean get_backside) { @@ -819,21 +1048,27 @@ void DrawGraphicThruMaskExt(DrawBuffer *d, int dst_x, int dst_y, int graphic, BlitBitmapMasked(src_bitmap, d, src_x, src_y, TILEX, TILEY, dst_x, dst_y); } -void DrawMiniGraphic(int x, int y, int graphic) +void DrawSizedGraphic(int x, int y, int graphic, int frame, int tilesize) { - DrawMiniGraphicExt(drawto, SX + x * MINI_TILEX,SY + y * MINI_TILEY, graphic); - MarkTileDirty(x / 2, y / 2); + DrawSizedGraphicExt(drawto, SX + x * tilesize, SY + y * tilesize, graphic, + frame, tilesize); + MarkTileDirty(x / tilesize, y / tilesize); } -void getMiniGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y) +void DrawSizedGraphicExt(DrawBuffer *d, int x, int y, int graphic, int frame, + int tilesize) { - struct GraphicInfo *g = &graphic_info[graphic]; - int mini_startx = 0; - int mini_starty = g->bitmap->height * 2 / 3; + Bitmap *src_bitmap; + int src_x, src_y; - *bitmap = g->bitmap; - *x = mini_startx + g->src_x / 2; - *y = mini_starty + g->src_y / 2; + getSizedGraphicSource(graphic, frame, tilesize, &src_bitmap, &src_x, &src_y); + BlitBitmap(src_bitmap, d, src_x, src_y, tilesize, tilesize, x, y); +} + +void DrawMiniGraphic(int x, int y, int graphic) +{ + DrawMiniGraphicExt(drawto, SX + x * MINI_TILEX,SY + y * MINI_TILEY, graphic); + MarkTileDirty(x / 2, y / 2); } void DrawMiniGraphicExt(DrawBuffer *d, int x, int y, int graphic) @@ -1377,13 +1612,17 @@ void DrawScreenField(int x, int y) boolean cut_mode = NO_CUTTING; if (element == EL_QUICKSAND_EMPTYING || + element == EL_QUICKSAND_FAST_EMPTYING || element == EL_MAGIC_WALL_EMPTYING || element == EL_BD_MAGIC_WALL_EMPTYING || + element == EL_DC_MAGIC_WALL_EMPTYING || element == EL_AMOEBA_DROPPING) cut_mode = CUT_ABOVE; else if (element == EL_QUICKSAND_FILLING || + element == EL_QUICKSAND_FAST_FILLING || element == EL_MAGIC_WALL_FILLING || - element == EL_BD_MAGIC_WALL_FILLING) + element == EL_BD_MAGIC_WALL_FILLING || + element == EL_DC_MAGIC_WALL_FILLING) cut_mode = CUT_BELOW; if (cut_mode == CUT_ABOVE) @@ -1425,8 +1664,10 @@ void DrawScreenField(int x, int y) content_old = Store[oldx][oldy]; if (element_old == EL_QUICKSAND_EMPTYING || + element_old == EL_QUICKSAND_FAST_EMPTYING || element_old == EL_MAGIC_WALL_EMPTYING || element_old == EL_BD_MAGIC_WALL_EMPTYING || + element_old == EL_DC_MAGIC_WALL_EMPTYING || element_old == EL_AMOEBA_DROPPING) cut_mode = CUT_ABOVE; @@ -1573,9 +1814,17 @@ void AnimateEnvelope(int envelope_nr, int anim_mode, int action) for (yy = 0; yy < ysize; yy++) for (xx = 0; xx < xsize; xx++) DrawEnvelopeBackground(envelope_nr, sx,sy, xx,yy, xsize, ysize, font_nr); +#if 1 + DrawTextBuffer(SX + sx + font_width, SY + sy + font_height, + level.envelope[envelope_nr].text, font_nr, max_xsize, + xsize - 2, ysize - 2, mask_mode, + level.envelope[envelope_nr].autowrap, + level.envelope[envelope_nr].centered, FALSE); +#else DrawTextToTextArea(SX + sx + font_width, SY + sy + font_height, level.envelope[envelope_nr].text, font_nr, max_xsize, xsize - 2, ysize - 2, mask_mode); +#endif redraw_mask |= REDRAW_FIELD | REDRAW_FROM_BACKBUFFER; BackToFront(); @@ -1628,44 +1877,13 @@ void ShowEnvelope(int envelope_nr) BackToFront(); } -void getPreviewGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y, - int tilesize) -{ - struct - { - int width_mult, width_div; - int height_mult, height_div; - } offset_calc[4] = - { - { 0, 1, 0, 1 }, - { 0, 1, 2, 3 }, - { 1, 2, 2, 3 }, - { 3, 4, 2, 3 }, - }; - int offset_calc_pos = (tilesize < MICRO_TILESIZE || tilesize > TILESIZE ? 3 : - 5 - log_2(tilesize)); - Bitmap *src_bitmap = graphic_info[graphic].bitmap; - int width_mult = offset_calc[offset_calc_pos].width_mult; - int width_div = offset_calc[offset_calc_pos].width_div; - int height_mult = offset_calc[offset_calc_pos].height_mult; - int height_div = offset_calc[offset_calc_pos].height_div; - int mini_startx = src_bitmap->width * width_mult / width_div; - int mini_starty = src_bitmap->height * height_mult / height_div; - int src_x = mini_startx + graphic_info[graphic].src_x * tilesize / TILESIZE; - int src_y = mini_starty + graphic_info[graphic].src_y * tilesize / TILESIZE; - - *bitmap = src_bitmap; - *x = src_x; - *y = src_y; -} - void DrawPreviewElement(int dst_x, int dst_y, int element, int tilesize) { Bitmap *src_bitmap; int src_x, src_y; int graphic = el2preimg(element); - getPreviewGraphicSource(graphic, &src_bitmap, &src_x, &src_y, tilesize); + getSizedGraphicSource(graphic, 0, tilesize, &src_bitmap, &src_x, &src_y); BlitBitmap(src_bitmap, drawto, src_x, src_y, tilesize, tilesize, dst_x,dst_y); } @@ -1674,7 +1892,7 @@ void DrawLevel() int x,y; SetDrawBackgroundMask(REDRAW_NONE); - ClearWindow(); + ClearField(); for (x = BX1; x <= BX2; x++) for (y = BY1; y <= BY2; y++) @@ -1705,7 +1923,7 @@ static void DrawPreviewLevelExt(int from_x, int from_y) int real_preview_xsize = MIN(level_xsize, preview.xsize); int real_preview_ysize = MIN(level_ysize, preview.ysize); int dst_x = SX + ALIGNED_XPOS(preview.x, preview_width, preview.align); - int dst_y = SY + preview.y; + int dst_y = SY + ALIGNED_YPOS(preview.y, preview_height, preview.valign); int x, y; DrawBackground(dst_x, dst_y, preview_width, preview_height); @@ -1739,7 +1957,7 @@ static void DrawPreviewLevelExt(int from_x, int from_y) #define MICROLABEL_IMPORTED_BY_HEAD 6 #define MICROLABEL_IMPORTED_BY 7 -static int getMaxTextLength(struct MenuPosInfo *pos, int font_nr) +static int getMaxTextLength(struct TextPosInfo *pos, int font_nr) { int max_text_width = SXSIZE; int font_width = getFontWidth(font_nr); @@ -1756,9 +1974,18 @@ static int getMaxTextLength(struct MenuPosInfo *pos, int font_nr) static void DrawPreviewLevelLabelExt(int mode) { - struct MenuPosInfo *pos = &menu.main.text.level_info_2; + struct TextPosInfo *pos = &menu.main.text.level_info_2; char label_text[MAX_OUTPUT_LINESIZE + 1]; int max_len_label_text; +#if 1 + int font_nr = pos->font; + int i; + + if (mode == MICROLABEL_LEVEL_AUTHOR_HEAD || + mode == MICROLABEL_IMPORTED_FROM_HEAD || + mode == MICROLABEL_IMPORTED_BY_HEAD) + font_nr = pos->font_alt; +#else int font_nr = FONT_TEXT_2; int i; @@ -1766,6 +1993,7 @@ static void DrawPreviewLevelLabelExt(int mode) mode == MICROLABEL_IMPORTED_FROM_HEAD || mode == MICROLABEL_IMPORTED_BY_HEAD) font_nr = FONT_TEXT_3; +#endif #if 1 max_len_label_text = getMaxTextLength(pos, font_nr); @@ -1773,6 +2001,11 @@ static void DrawPreviewLevelLabelExt(int mode) max_len_label_text = SXSIZE / getFontWidth(font_nr); #endif +#if 1 + if (pos->size != -1) + max_len_label_text = pos->size; +#endif + for (i = 0; i < max_len_label_text; i++) label_text[i] = ' '; label_text[max_len_label_text] = '\0'; @@ -1827,8 +2060,10 @@ void DrawPreviewLevel(boolean restart) int level_ysize = lev_fieldy + (show_level_border ? 2 : 0); int last_game_status = game_status; /* save current game status */ +#if 0 /* force PREVIEW font on preview level */ game_status = GAME_MODE_PSEUDO_PREVIEW; +#endif if (restart) { @@ -1859,9 +2094,13 @@ void DrawPreviewLevel(boolean restart) if (leveldir_current->name) { - struct MenuPosInfo *pos = &menu.main.text.level_info_1; + struct TextPosInfo *pos = &menu.main.text.level_info_1; char label_text[MAX_OUTPUT_LINESIZE + 1]; +#if 1 + int font_nr = pos->font; +#else int font_nr = FONT_TEXT_1; +#endif #if 1 int max_len_label_text = getMaxTextLength(pos, font_nr); #else @@ -1872,6 +2111,11 @@ void DrawPreviewLevel(boolean restart) int lxpos, lypos; #endif +#if 1 + if (pos->size != -1) + max_len_label_text = pos->size; +#endif + strncpy(label_text, leveldir_current->name, max_len_label_text); label_text[max_len_label_text] = '\0'; @@ -2215,9 +2459,6 @@ void DrawPlayer(struct PlayerInfo *player) if (!IN_SCR_FIELD(sx, sy)) return; - if (setup.direct_draw) - SetDrawtoField(DRAW_BUFFERED); - /* ----------------------------------------------------------------------- */ /* draw things behind the player, if needed */ /* ----------------------------------------------------------------------- */ @@ -2396,18 +2637,6 @@ void DrawPlayer(struct PlayerInfo *player) DrawLevelFieldThruMask(jx, jy); } - if (setup.direct_draw) - { - int dst_x = SX + SCREENX(MIN(jx, last_jx)) * TILEX; - int dst_y = SY + SCREENY(MIN(jy, last_jy)) * TILEY; - int x_size = TILEX * (1 + ABS(jx - last_jx)); - int y_size = TILEY * (1 + ABS(jy - last_jy)); - - BlitBitmap(drawto_field, window, - dst_x, dst_y, x_size, y_size, dst_x, dst_y); - SetDrawtoField(DRAW_DIRECT); - } - MarkTileDirty(sx, sy); } @@ -2484,7 +2713,11 @@ boolean Request(char *text, unsigned int req_state) if (max_word_len > MAX_REQUEST_LINE_FONT1_LEN) { max_request_line_len = MAX_REQUEST_LINE_FONT2_LEN; +#if 1 + font_nr = FONT_TEXT_1; +#else font_nr = FONT_LEVEL_NUMBER; +#endif break; } @@ -2535,7 +2768,7 @@ boolean Request(char *text, unsigned int req_state) /* clear door drawing field */ DrawBackground(DX, DY, DXSIZE, DYSIZE); - /* force DOOR font on preview level */ + /* force DOOR font inside door area */ game_status = GAME_MODE_PSEUDO_DOOR; /* write text for request */ @@ -2696,6 +2929,11 @@ boolean Request(char *text, unsigned int req_state) case EVENT_KEYPRESS: switch (GetEventKey((KeyEvent *)&event, TRUE)) { + case KSYM_space: + if (req_state & REQ_CONFIRM) + result = 1; + break; + case KSYM_Return: result = 1; break; @@ -2707,6 +2945,7 @@ boolean Request(char *text, unsigned int req_state) default: break; } + if (req_state & REQ_PLAYER) result = 0; break; @@ -2730,6 +2969,24 @@ boolean Request(char *text, unsigned int req_state) result = 0; } +#if 1 + + if (game_status == GAME_MODE_PLAYING && local_player->LevelSolved_GameEnd) + { + HandleGameActions(); + } + else + { + DoAnimation(); + + if (!PendingEvent()) /* delay only if no pending events */ + Delay(10); + } + + BackToFront(); + +#else + DoAnimation(); #if 1 @@ -2738,6 +2995,8 @@ boolean Request(char *text, unsigned int req_state) #else /* don't eat all CPU time */ Delay(10); +#endif + #endif } @@ -2879,7 +3138,7 @@ unsigned int MoveDoor(unsigned int door_state) if (setup.quick_doors) { - stepsize = 20; /* must be choosen to always draw last frame */ + stepsize = 20; /* must be chosen to always draw last frame */ door_delay_value = 0; } @@ -4451,19 +4710,19 @@ em_object_mapping_list[] = }, { Xexit, TRUE, FALSE, - EL_EXIT_CLOSED, -1, -1 + EL_EM_EXIT_CLOSED, -1, -1 }, { Xexit_1, TRUE, FALSE, - EL_EXIT_OPEN, -1, -1 + EL_EM_EXIT_OPEN, -1, -1 }, { Xexit_2, FALSE, FALSE, - EL_EXIT_OPEN, -1, -1 + EL_EM_EXIT_OPEN, -1, -1 }, { Xexit_3, FALSE, FALSE, - EL_EXIT_OPEN, -1, -1 + EL_EM_EXIT_OPEN, -1, -1 }, { Xdynamite, TRUE, FALSE, @@ -4537,6 +4796,24 @@ em_object_mapping_list[] = Xsand_stonein_4, FALSE, TRUE, EL_ROCK, ACTION_FILLING, -1 }, +#if 1 + { + Xsand_stonesand_1, FALSE, FALSE, + EL_QUICKSAND_EMPTYING, -1, -1 + }, + { + Xsand_stonesand_2, FALSE, FALSE, + EL_QUICKSAND_EMPTYING, -1, -1 + }, + { + Xsand_stonesand_3, FALSE, FALSE, + EL_QUICKSAND_EMPTYING, -1, -1 + }, + { + Xsand_stonesand_4, FALSE, FALSE, + EL_QUICKSAND_EMPTYING, -1, -1 + }, +#else { Xsand_stonesand_1, FALSE, FALSE, EL_QUICKSAND_FULL, -1, -1 @@ -4553,6 +4830,7 @@ em_object_mapping_list[] = Xsand_stonesand_4, FALSE, FALSE, EL_QUICKSAND_FULL, -1, -1 }, +#endif { Xsand_stoneout_1, FALSE, FALSE, EL_ROCK, ACTION_EMPTYING, -1 @@ -4561,6 +4839,24 @@ em_object_mapping_list[] = Xsand_stoneout_2, FALSE, FALSE, EL_ROCK, ACTION_EMPTYING, -1 }, +#if 1 + { + Xsand_sandstone_1, FALSE, FALSE, + EL_QUICKSAND_FILLING, -1, -1 + }, + { + Xsand_sandstone_2, FALSE, FALSE, + EL_QUICKSAND_FILLING, -1, -1 + }, + { + Xsand_sandstone_3, FALSE, FALSE, + EL_QUICKSAND_FILLING, -1, -1 + }, + { + Xsand_sandstone_4, FALSE, FALSE, + EL_QUICKSAND_FILLING, -1, -1 + }, +#else { Xsand_sandstone_1, FALSE, FALSE, EL_QUICKSAND_FULL, -1, -1 @@ -4577,6 +4873,7 @@ em_object_mapping_list[] = Xsand_sandstone_4, FALSE, FALSE, EL_QUICKSAND_FULL, -1, -1 }, +#endif { Xplant, TRUE, FALSE, EL_EMC_PLANT, -1, -1 @@ -5372,10 +5669,14 @@ int get_next_element(int element) { case EL_QUICKSAND_FILLING: return EL_QUICKSAND_FULL; case EL_QUICKSAND_EMPTYING: return EL_QUICKSAND_EMPTY; + case EL_QUICKSAND_FAST_FILLING: return EL_QUICKSAND_FAST_FULL; + case EL_QUICKSAND_FAST_EMPTYING: return EL_QUICKSAND_FAST_EMPTY; case EL_MAGIC_WALL_FILLING: return EL_MAGIC_WALL_FULL; case EL_MAGIC_WALL_EMPTYING: return EL_MAGIC_WALL_ACTIVE; case EL_BD_MAGIC_WALL_FILLING: return EL_BD_MAGIC_WALL_FULL; case EL_BD_MAGIC_WALL_EMPTYING: return EL_BD_MAGIC_WALL_ACTIVE; + case EL_DC_MAGIC_WALL_FILLING: return EL_DC_MAGIC_WALL_FULL; + case EL_DC_MAGIC_WALL_EMPTYING: return EL_DC_MAGIC_WALL_ACTIVE; case EL_AMOEBA_DROPPING: return EL_AMOEBA_WET; default: return element; @@ -5475,11 +5776,139 @@ int el2preimg(int element) return element_info[element].special_graphic[GFX_SPECIAL_ARG_PREVIEW]; } +int el2panelimg(int element) +{ + element = GFX_ELEMENT(element); + + return element_info[element].special_graphic[GFX_SPECIAL_ARG_PANEL]; +} + int font2baseimg(int font_nr) { return font_info[font_nr].special_graphic[GFX_SPECIAL_ARG_DEFAULT]; } +int getBeltNrFromBeltElement(int element) +{ + return (element < EL_CONVEYOR_BELT_2_LEFT ? 0 : + element < EL_CONVEYOR_BELT_3_LEFT ? 1 : + element < EL_CONVEYOR_BELT_4_LEFT ? 2 : 3); +} + +int getBeltNrFromBeltActiveElement(int element) +{ + return (element < EL_CONVEYOR_BELT_2_LEFT_ACTIVE ? 0 : + element < EL_CONVEYOR_BELT_3_LEFT_ACTIVE ? 1 : + element < EL_CONVEYOR_BELT_4_LEFT_ACTIVE ? 2 : 3); +} + +int getBeltNrFromBeltSwitchElement(int element) +{ + return (element < EL_CONVEYOR_BELT_2_SWITCH_LEFT ? 0 : + element < EL_CONVEYOR_BELT_3_SWITCH_LEFT ? 1 : + element < EL_CONVEYOR_BELT_4_SWITCH_LEFT ? 2 : 3); +} + +int getBeltDirNrFromBeltElement(int element) +{ + static int belt_base_element[4] = + { + EL_CONVEYOR_BELT_1_LEFT, + EL_CONVEYOR_BELT_2_LEFT, + EL_CONVEYOR_BELT_3_LEFT, + EL_CONVEYOR_BELT_4_LEFT + }; + + int belt_nr = getBeltNrFromBeltElement(element); + int belt_dir_nr = element - belt_base_element[belt_nr]; + + return (belt_dir_nr % 3); +} + +int getBeltDirNrFromBeltSwitchElement(int element) +{ + static int belt_base_element[4] = + { + EL_CONVEYOR_BELT_1_SWITCH_LEFT, + EL_CONVEYOR_BELT_2_SWITCH_LEFT, + EL_CONVEYOR_BELT_3_SWITCH_LEFT, + EL_CONVEYOR_BELT_4_SWITCH_LEFT + }; + + int belt_nr = getBeltNrFromBeltSwitchElement(element); + int belt_dir_nr = element - belt_base_element[belt_nr]; + + return (belt_dir_nr % 3); +} + +int getBeltDirFromBeltElement(int element) +{ + static int belt_move_dir[3] = + { + MV_LEFT, + MV_NONE, + MV_RIGHT + }; + + int belt_dir_nr = getBeltDirNrFromBeltElement(element); + + return belt_move_dir[belt_dir_nr]; +} + +int getBeltDirFromBeltSwitchElement(int element) +{ + static int belt_move_dir[3] = + { + MV_LEFT, + MV_NONE, + MV_RIGHT + }; + + int belt_dir_nr = getBeltDirNrFromBeltSwitchElement(element); + + return belt_move_dir[belt_dir_nr]; +} + +int getBeltElementFromBeltNrAndBeltDirNr(int belt_nr, int belt_dir_nr) +{ + static int belt_base_element[4] = + { + EL_CONVEYOR_BELT_1_LEFT, + EL_CONVEYOR_BELT_2_LEFT, + EL_CONVEYOR_BELT_3_LEFT, + EL_CONVEYOR_BELT_4_LEFT + }; + + return belt_base_element[belt_nr] + belt_dir_nr; +} + +int getBeltElementFromBeltNrAndBeltDir(int belt_nr, int belt_dir) +{ + int belt_dir_nr = (belt_dir == MV_LEFT ? 0 : belt_dir == MV_RIGHT ? 2 : 1); + + return getBeltElementFromBeltNrAndBeltDirNr(belt_nr, belt_dir_nr); +} + +int getBeltSwitchElementFromBeltNrAndBeltDirNr(int belt_nr, int belt_dir_nr) +{ + static int belt_base_element[4] = + { + EL_CONVEYOR_BELT_1_SWITCH_LEFT, + EL_CONVEYOR_BELT_2_SWITCH_LEFT, + EL_CONVEYOR_BELT_3_SWITCH_LEFT, + EL_CONVEYOR_BELT_4_SWITCH_LEFT + }; + + return belt_base_element[belt_nr] + belt_dir_nr; +} + +int getBeltSwitchElementFromBeltNrAndBeltDir(int belt_nr, int belt_dir) +{ + int belt_dir_nr = (belt_dir == MV_LEFT ? 0 : belt_dir == MV_RIGHT ? 2 : 1); + + return getBeltSwitchElementFromBeltNrAndBeltDirNr(belt_nr, belt_dir_nr); +} + int getNumActivePlayers_EM() { int num_players = 0; @@ -5518,10 +5947,346 @@ unsigned int InitRND(long seed) return InitEngineRandom_RND(seed); } +#if 1 +static struct Mapping_EM_to_RND_object object_mapping[TILE_MAX]; +static struct Mapping_EM_to_RND_player player_mapping[MAX_PLAYERS][SPR_MAX]; +#endif + +inline static int get_effective_element_EM(int tile, int frame_em) +{ + int element = object_mapping[tile].element_rnd; + int action = object_mapping[tile].action; + boolean is_backside = object_mapping[tile].is_backside; + boolean action_removing = (action == ACTION_DIGGING || + action == ACTION_SNAPPING || + action == ACTION_COLLECTING); + + if (frame_em < 7) + { + switch (tile) + { + case Yacid_splash_eB: + case Yacid_splash_wB: + return (frame_em > 5 ? EL_EMPTY : element); + + default: + return element; + } + } + else /* frame_em == 7 */ + { + switch (tile) + { + case Yacid_splash_eB: + case Yacid_splash_wB: + return EL_EMPTY; + + case Yemerald_stone: + return EL_EMERALD; + + case Ydiamond_stone: + return EL_ROCK; + + case Xdrip_stretch: + case Xdrip_stretchB: + case Ydrip_s1: + case Ydrip_s1B: + case Xball_1B: + case Xball_2: + case Xball_2B: + case Yball_eat: + case Ykey_1_eat: + case Ykey_2_eat: + case Ykey_3_eat: + case Ykey_4_eat: + case Ykey_5_eat: + case Ykey_6_eat: + case Ykey_7_eat: + case Ykey_8_eat: + case Ylenses_eat: + case Ymagnify_eat: + case Ygrass_eat: + case Ydirt_eat: + case Xsand_stonein_1: + case Xsand_stonein_2: + case Xsand_stonein_3: + case Xsand_stonein_4: + return element; + + default: + return (is_backside || action_removing ? EL_EMPTY : element); + } + } +} + +inline static boolean check_linear_animation_EM(int tile) +{ + switch (tile) + { + case Xsand_stonesand_1: + case Xsand_sandstone_1: + case Xboom_1: + case Xdynamite_1: + case Ybug_w_n: + case Ybug_n_e: + case Ybug_e_s: + case Ybug_s_w: + case Ybug_e_n: + case Ybug_s_e: + case Ybug_w_s: + case Ybug_n_w: + case Ytank_w_n: + case Ytank_n_e: + case Ytank_e_s: + case Ytank_s_w: + case Ytank_e_n: + case Ytank_s_e: + case Ytank_w_s: + case Ytank_n_w: + return TRUE; + } + + return FALSE; +} + +inline static void set_crumbled_graphics_EM(struct GraphicInfo_EM *g_em, + boolean has_crumbled_graphics, + int crumbled, int sync_frame) +{ + /* if element can be crumbled, but certain action graphics are just empty + space (like instantly snapping sand to empty space in 1 frame), do not + treat these empty space graphics as crumbled graphics in EMC engine */ + if (crumbled == IMG_EMPTY_SPACE) + has_crumbled_graphics = FALSE; + + if (has_crumbled_graphics) + { + struct GraphicInfo *g_crumbled = &graphic_info[crumbled]; + int frame_crumbled = getAnimationFrame(g_crumbled->anim_frames, + g_crumbled->anim_delay, + g_crumbled->anim_mode, + g_crumbled->anim_start_frame, + sync_frame); + + getGraphicSource(crumbled, frame_crumbled, &g_em->crumbled_bitmap, + &g_em->crumbled_src_x, &g_em->crumbled_src_y); + + g_em->crumbled_border_size = graphic_info[crumbled].border_size; + + g_em->has_crumbled_graphics = TRUE; + } + else + { + g_em->crumbled_bitmap = NULL; + g_em->crumbled_src_x = 0; + g_em->crumbled_src_y = 0; + g_em->crumbled_border_size = 0; + + g_em->has_crumbled_graphics = FALSE; + } +} + +void ResetGfxAnimation_EM(int x, int y, int tile) +{ + GfxFrame[x][y] = 0; +} + +void SetGfxAnimation_EM(struct GraphicInfo_EM *g_em, + int tile, int frame_em, int x, int y) +{ + int action = object_mapping[tile].action; +#if 1 + int direction = object_mapping[tile].direction; + int effective_element = get_effective_element_EM(tile, frame_em); + int graphic = (direction == MV_NONE ? + el_act2img(effective_element, action) : + el_act_dir2img(effective_element, action, direction)); + struct GraphicInfo *g = &graphic_info[graphic]; + int sync_frame; +#endif + boolean action_removing = (action == ACTION_DIGGING || + action == ACTION_SNAPPING || + action == ACTION_COLLECTING); + boolean action_moving = (action == ACTION_FALLING || + action == ACTION_MOVING || + action == ACTION_PUSHING || + action == ACTION_EATING || + action == ACTION_FILLING || + action == ACTION_EMPTYING); + boolean action_falling = (action == ACTION_FALLING || + action == ACTION_FILLING || + action == ACTION_EMPTYING); + + if (action_removing || check_linear_animation_EM(tile)) + { + GfxFrame[x][y] = frame_em; + } + else if (action_moving) + { + boolean is_backside = object_mapping[tile].is_backside; + + if (is_backside) + { + int direction = object_mapping[tile].direction; + int move_dir = (action_falling ? MV_DOWN : direction); + + GfxFrame[x][y]++; + + if (move_dir == MV_LEFT) + GfxFrame[x - 1][y] = GfxFrame[x][y]; + else if (move_dir == MV_RIGHT) + GfxFrame[x + 1][y] = GfxFrame[x][y]; + else if (move_dir == MV_UP) + GfxFrame[x][y - 1] = GfxFrame[x][y]; + else if (move_dir == MV_DOWN) + GfxFrame[x][y + 1] = GfxFrame[x][y]; + } + } + else + { + GfxFrame[x][y]++; + } + +#if 1 + if (graphic_info[graphic].anim_global_sync) + sync_frame = FrameCounter; + else if (IN_FIELD(x, y, MAX_LEV_FIELDX, MAX_LEV_FIELDY)) + sync_frame = GfxFrame[x][y]; + else + sync_frame = 0; /* playfield border (pseudo steel) */ + + SetRandomAnimationValue(x, y); + + int frame = getAnimationFrame(g->anim_frames, + g->anim_delay, + g->anim_mode, + g->anim_start_frame, + sync_frame); + + g_em->unique_identifier = + (graphic << 16) | ((frame % 8) << 12) | (g_em->width << 6) | g_em->height; +#endif +} + +void getGraphicSourceObjectExt_EM(struct GraphicInfo_EM *g_em, + int tile, int frame_em, int x, int y) +{ + int action = object_mapping[tile].action; + int direction = object_mapping[tile].direction; + int effective_element = get_effective_element_EM(tile, frame_em); + int graphic = (direction == MV_NONE ? + el_act2img(effective_element, action) : + el_act_dir2img(effective_element, action, direction)); + int crumbled = (direction == MV_NONE ? + el_act2crm(effective_element, action) : + el_act_dir2crm(effective_element, action, direction)); + int base_graphic = el_act2img(effective_element, ACTION_DEFAULT); + int base_crumbled = el_act2crm(effective_element, ACTION_DEFAULT); + boolean has_crumbled_graphics = (base_crumbled != base_graphic); + struct GraphicInfo *g = &graphic_info[graphic]; +#if 0 + struct GraphicInfo *g_crumbled = &graphic_info[crumbled]; +#endif + int sync_frame; + +#if 0 + if (frame_em == 0) /* reset animation frame for certain elements */ + { + if (check_linear_animation_EM(tile)) + GfxFrame[x][y] = 0; + } +#endif + + if (graphic_info[graphic].anim_global_sync) + sync_frame = FrameCounter; + else if (IN_FIELD(x, y, MAX_LEV_FIELDX, MAX_LEV_FIELDY)) + sync_frame = GfxFrame[x][y]; + else + sync_frame = 0; /* playfield border (pseudo steel) */ + + SetRandomAnimationValue(x, y); + + int frame = getAnimationFrame(g->anim_frames, + g->anim_delay, + g->anim_mode, + g->anim_start_frame, + sync_frame); + + getGraphicSourceExt(graphic, frame, &g_em->bitmap, + &g_em->src_x, &g_em->src_y, FALSE); + + /* (updating the "crumbled" graphic definitions is probably not really needed, + as animations for crumbled graphics can't be longer than one EMC cycle) */ +#if 1 + set_crumbled_graphics_EM(g_em, has_crumbled_graphics, crumbled, + sync_frame); + +#else + + g_em->crumbled_bitmap = NULL; + g_em->crumbled_src_x = 0; + g_em->crumbled_src_y = 0; + + g_em->has_crumbled_graphics = FALSE; + + if (has_crumbled_graphics && crumbled != IMG_EMPTY_SPACE) + { + int frame_crumbled = getAnimationFrame(g_crumbled->anim_frames, + g_crumbled->anim_delay, + g_crumbled->anim_mode, + g_crumbled->anim_start_frame, + sync_frame); + + getGraphicSource(crumbled, frame_crumbled, &g_em->crumbled_bitmap, + &g_em->crumbled_src_x, &g_em->crumbled_src_y); + + g_em->has_crumbled_graphics = TRUE; + } +#endif +} + +void getGraphicSourcePlayerExt_EM(struct GraphicInfo_EM *g_em, + int player_nr, int anim, int frame_em) +{ + int element = player_mapping[player_nr][anim].element_rnd; + int action = player_mapping[player_nr][anim].action; + int direction = player_mapping[player_nr][anim].direction; + int graphic = (direction == MV_NONE ? + el_act2img(element, action) : + el_act_dir2img(element, action, direction)); + struct GraphicInfo *g = &graphic_info[graphic]; + int sync_frame; + + InitPlayerGfxAnimation(&stored_player[player_nr], action, direction); + + stored_player[player_nr].StepFrame = frame_em; + + sync_frame = stored_player[player_nr].Frame; + + int frame = getAnimationFrame(g->anim_frames, + g->anim_delay, + g->anim_mode, + g->anim_start_frame, + sync_frame); + + getGraphicSourceExt(graphic, frame, &g_em->bitmap, + &g_em->src_x, &g_em->src_y, FALSE); + +#if 0 + printf("::: %d: %d, %d [%d]\n", + player_nr, + stored_player[player_nr].Frame, + stored_player[player_nr].StepFrame, + FrameCounter); +#endif +} + void InitGraphicInfo_EM(void) { +#if 0 struct Mapping_EM_to_RND_object object_mapping[TILE_MAX]; struct Mapping_EM_to_RND_player player_mapping[MAX_PLAYERS][SPR_MAX]; +#endif int i, j, p; #if DEBUG_EM_GFX @@ -5593,9 +6358,11 @@ void InitGraphicInfo_EM(void) int action = object_mapping[i].action; int direction = object_mapping[i].direction; boolean is_backside = object_mapping[i].is_backside; +#if 0 boolean action_removing = (action == ACTION_DIGGING || action == ACTION_SNAPPING || action == ACTION_COLLECTING); +#endif boolean action_exploding = ((action == ACTION_EXPLODING || action == ACTION_SMASHED_BY_ROCK || action == ACTION_SMASHED_BY_SPRING) && @@ -5605,6 +6372,9 @@ void InitGraphicInfo_EM(void) for (j = 0; j < 8; j++) { +#if 1 + int effective_element = get_effective_element_EM(i, j); +#else int effective_element = (j > 5 && i == Yacid_splash_eB ? EL_EMPTY : j > 5 && i == Yacid_splash_wB ? EL_EMPTY : j < 7 ? element : @@ -5637,6 +6407,7 @@ void InitGraphicInfo_EM(void) is_backside ? EL_EMPTY : action_removing ? EL_EMPTY : element); +#endif int effective_action = (j < 7 ? action : i == Xdrip_stretch ? action : i == Xdrip_stretchB ? action : @@ -5678,6 +6449,9 @@ void InitGraphicInfo_EM(void) boolean has_action_graphics = (graphic != base_graphic); boolean has_crumbled_graphics = (base_crumbled != base_graphic); struct GraphicInfo *g = &graphic_info[graphic]; +#if 0 + struct GraphicInfo *g_crumbled = &graphic_info[crumbled]; +#endif struct GraphicInfo_EM *g_em = &graphic_info_em_object[i][7 - j]; Bitmap *src_bitmap; int src_x, src_y; @@ -5814,13 +6588,20 @@ void InitGraphicInfo_EM(void) g_em->width = TILEX; g_em->height = TILEY; + g_em->preserve_background = FALSE; + +#if 1 + set_crumbled_graphics_EM(g_em, has_crumbled_graphics, crumbled, + sync_frame); + +#else + g_em->crumbled_bitmap = NULL; g_em->crumbled_src_x = 0; g_em->crumbled_src_y = 0; g_em->crumbled_border_size = 0; g_em->has_crumbled_graphics = FALSE; - g_em->preserve_background = FALSE; #if 0 if (has_crumbled_graphics && crumbled == IMG_EMPTY_SPACE) @@ -5830,18 +6611,47 @@ void InitGraphicInfo_EM(void) #endif /* if element can be crumbled, but certain action graphics are just empty - space (like snapping sand with the original R'n'D graphics), do not + space (like instantly snapping sand to empty space in 1 frame), do not treat these empty space graphics as crumbled graphics in EMC engine */ if (has_crumbled_graphics && crumbled != IMG_EMPTY_SPACE) { - getGraphicSource(crumbled, frame, &src_bitmap, &src_x, &src_y); + int frame_crumbled = getAnimationFrame(g_crumbled->anim_frames, + g_crumbled->anim_delay, + g_crumbled->anim_mode, + g_crumbled->anim_start_frame, + sync_frame); + + getGraphicSource(crumbled, frame_crumbled, &src_bitmap, &src_x, &src_y); g_em->has_crumbled_graphics = TRUE; g_em->crumbled_bitmap = src_bitmap; g_em->crumbled_src_x = src_x; g_em->crumbled_src_y = src_y; g_em->crumbled_border_size = graphic_info[crumbled].border_size; + + +#if 0 + if (g_em == &graphic_info_em_object[207][0]) + printf("... %d, %d [%d, %d, %d, %d] [%d, %d, %d, %d, %d, %d => %d]\n", + graphic_info_em_object[207][0].crumbled_src_x, + graphic_info_em_object[207][0].crumbled_src_y, + + crumbled, frame, src_x, src_y, + + g->anim_frames, + g->anim_delay, + g->anim_mode, + g->anim_start_frame, + sync_frame, + gfx.anim_random_frame, + frame); +#endif + +#if 0 + printf("::: EMC tile %d is crumbled\n", i); +#endif } +#endif #if 0 if (element == EL_ROCK && @@ -6068,7 +6878,7 @@ void InitGraphicInfo_EM(void) g->anim_start_frame, sync_frame); - getGraphicSourceExt(graphic, frame, &src_bitmap, &src_x,&src_y, FALSE); + getGraphicSourceExt(graphic, frame, &src_bitmap, &src_x, &src_y, FALSE); g_em->bitmap = src_bitmap; g_em->src_x = src_x; @@ -6139,10 +6949,8 @@ void InitGraphicInfo_EM(void) #endif } -void PlayMenuSound() +void PlayMenuSoundExt(int sound) { - int sound = menu.sound[game_status]; - if (sound == SND_UNDEFINED) return; @@ -6156,6 +6964,11 @@ void PlayMenuSound() PlaySound(sound); } +void PlayMenuSound() +{ + PlayMenuSoundExt(menu.sound[game_status]); +} + void PlayMenuSoundStereo(int sound, int stereo_position) { if (sound == SND_UNDEFINED) @@ -6171,10 +6984,8 @@ void PlayMenuSoundStereo(int sound, int stereo_position) PlaySoundStereo(sound, stereo_position); } -void PlayMenuSoundIfLoop() +void PlayMenuSoundIfLoopExt(int sound) { - int sound = menu.sound[game_status]; - if (sound == SND_UNDEFINED) return; @@ -6186,10 +6997,13 @@ void PlayMenuSoundIfLoop() PlaySoundLoop(sound); } -void PlayMenuMusic() +void PlayMenuSoundIfLoop() { - int music = menu.music[game_status]; + PlayMenuSoundIfLoopExt(menu.sound[game_status]); +} +void PlayMenuMusicExt(int music) +{ if (music == MUS_UNDEFINED) return; @@ -6199,6 +7013,11 @@ void PlayMenuMusic() PlayMusic(music); } +void PlayMenuMusic() +{ + PlayMenuMusicExt(menu.music[game_status]); +} + void PlaySoundActivating() { #if 0 diff --git a/src/tools.h b/src/tools.h index 1c26b6d6..136a305c 100644 --- a/src/tools.h +++ b/src/tools.h @@ -18,7 +18,6 @@ #include "game.h" /* for SetDrawtoField */ -#define DRAW_DIRECT 0 #define DRAW_BUFFERED 1 #define DRAW_BACKBUFFER 2 @@ -72,16 +71,24 @@ void DrawMaskedBorder(int); void SetDrawtoField(int); void RedrawPlayfield(boolean, int, int, int, int); void BackToFront(); -void FadeToFront(); void FadeIn(int); void FadeOut(int); -void FadeCross(int); -void FadeCrossSaveBackbuffer(); - -void ClearWindow(); +void FadeSetEnterMenu(); +void FadeSetLeaveMenu(); +void FadeSetEnterScreen(); +void FadeSetNextScreen(); +void FadeSetLeaveScreen(); +void FadeSetFromType(int); +void FadeSetDisabled(); +void FadeSkipNextFadeIn(); +void FadeSkipNextFadeOut(); + +void ClearField(); void SetWindowBackgroundImageIfDefined(int); void SetMainBackgroundImageIfDefined(int); +void SetDoorBackgroundImageIfDefined(int); +void SetWindowBackgroundImage(int); void SetMainBackgroundImage(int); void SetDoorBackgroundImage(int); void SetPanelBackground(); @@ -91,6 +98,8 @@ void DrawBackgroundForGraphic(int, int, int, int, int); void MarkTileDirty(int, int); void SetBorderElement(); +void FloodFillLevel(int, int, int, short[MAX_LEV_FIELDX][MAX_LEV_FIELDY], + int, int); void SetRandomAnimationValue(int, int); int getGraphicAnimationFrame(int, int); @@ -105,6 +114,8 @@ void DrawAllPlayers(void); void DrawPlayerField(int, int); void DrawPlayer(struct PlayerInfo *); +void getSizedGraphicSource(int, int, int, Bitmap **, int *, int *); +void getMiniGraphicSource(int, Bitmap **, int *, int *); void getGraphicSourceExt(int, int, Bitmap **, int *, int *, boolean); void getGraphicSource(int, int, Bitmap **, int *, int *); void DrawGraphic(int, int, int, int); @@ -112,8 +123,9 @@ void DrawGraphicExt(DrawBuffer *, int, int, int, int); void DrawGraphicThruMask(int, int, int, int); void DrawGraphicThruMaskExt(DrawBuffer *, int, int, int, int); +void DrawSizedGraphic(int, int, int, int, int); +void DrawSizedGraphicExt(DrawBuffer *, int, int, int, int, int); void DrawMiniGraphic(int, int, int); -void getMiniGraphicSource(int, Bitmap **, int *, int *); void DrawMiniGraphicExt(DrawBuffer *, int, int, int); void DrawScreenElementExt(int, int, int, int, int, int, int); @@ -170,14 +182,30 @@ int el2baseimg(int); int el2img(int); int el2edimg(int); int el2preimg(int); +int el2panelimg(int); int font2baseimg(int); +int getBeltNrFromBeltElement(int); +int getBeltNrFromBeltActiveElement(int); +int getBeltNrFromBeltSwitchElement(int); +int getBeltDirNrFromBeltElement(int); +int getBeltDirNrFromBeltSwitchElement(int); +int getBeltDirFromBeltElement(int); +int getBeltDirFromBeltSwitchElement(int); +int getBeltElementFromBeltNrAndBeltDirNr(int, int); +int getBeltElementFromBeltNrAndBeltDir(int, int); +int getBeltSwitchElementFromBeltNrAndBeltDirNr(int, int); +int getBeltSwitchElementFromBeltNrAndBeltDir(int, int); + unsigned int InitRND(long); void InitGraphicInfo_EM(void); +void PlayMenuSoundExt(int); void PlayMenuSound(); void PlayMenuSoundStereo(int, int); +void PlayMenuSoundIfLoopExt(int); void PlayMenuSoundIfLoop(); +void PlayMenuMusicExt(int); void PlayMenuMusic(); void PlaySoundActivating(); void PlaySoundSelecting();