+2007-10-09
+ * fixed nasty bug with auto-override and normal override not working on
+ program startup (especially when current level set has custom artwork)
+
+2007-10-05
+ * version 3.2.5 released as special edition "R'n'D jue"
+
+2007-10-05
+ * fixed X11 crash bug when blitting masked title screens over background
+
+2007-10-04
+ * changed build system to support special editions (like "R'n'D jue")
+ * added (hardcoded) loading graphics for "R'n'D jue" special edition
+ * fixed X11 crash bug when scaling images with width/height less than 32
+
+2007-09-27
+ * added "background.PLAYING" (only visible as two-pixel border in game)
+ * added default level set for first start of special R'n'D version
+ * changed door animations for editor always behaving like "quick doors"
+
+2007-09-26
+ * added new custom artwork setup option "auto-override non-CE sets" for
+ automatic artwork override that is only used for level sets without
+ custom element artwork (as it does not make much sense to override
+ any artwork that redefines custom element artwork for sets using CEs)
+ * fixed default artwork for "special" R'n'D versions always using the
+ "classic" artwork as the base if base artwork is not explicitly
+ defined in "levelinfo.conf", regardless of different default artwork
+ used by the special R'n'D version -- this is needed because any such
+ custom artwork is designed using the "classic" artwork definitions as
+ the base (including menu definitions and screen positions etc., which
+ would otherwise be taken from the different special default artwork)
+
+2007-09-17
+ * fixed drawing of animated "quicksand.filling" and "quicksand.emptying"
+ for both EMC and R'n'D graphics engine (heavy workarounds needed due
+ to massively broken handling of quicksand in R'n'D game engine)
+ * fixed off-limits access to array in DrawLevelFieldCrumbledSandExt()
+ * fixed crash bug (hopefully) when scrolling with cursor keys in editor
+
+2007-09-16
+ * fixed small bug in toon drawing (introduced when fixing the crash bug)
+
+2007-09-15
+ * added graphics definition "game.panel.highscore" to display the
+ current levels current high score in the game panel
+
+2007-09-13
+ * version number set to 3.2.5
+
2007-09-13
* version 3.2.4 released
# =============================================================================
# Rocks'n'Diamonds Makefile
# -----------------------------------------------------------------------------
-# (c) 1995-2006 Holger Schemel <info@artsoft.org>
+# (c) 1995-2007 Holger Schemel <info@artsoft.org>
# =============================================================================
# -----------------------------------------------------------------------------
# SCORE_ENTRIES = MANY_PER_NAME
# paths for cross-compiling (only needed for non-native MS-DOS and Win32 build)
-CROSS_PATH_MSDOS=/usr/local/cross-msdos/i386-msdosdjgpp
-CROSS_PATH_WIN32=/usr/local/cross-tools/i386-mingw32msvc
+CROSS_PATH_MSDOS = /usr/local/cross-msdos/i386-msdosdjgpp
+CROSS_PATH_WIN32 = /usr/local/cross-tools/i386-mingw32msvc
+
+# compile special edition of R'n'D instead of the normal (classic) version
+SPECIAL_EDITION = rnd_jue
+
# -----------------------------------------------------------------------------
# there should be no need to change anything below
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
# -----------------------------------------------------------------------------
-# development only
+# development, test, distribution build and packaging targets
# -----------------------------------------------------------------------------
auto-conf:
@$(MAKE_CMD) auto-conf
run: all
- @./rocksndiamonds --verbose
+ @$(MAKE_CMD) run
gdb: all
- @gdb -batch -x GDB_COMMANDS ./rocksndiamonds
+ @$(MAKE_CMD) gdb
valgrind: all
- @valgrind -v --leak-check=yes ./rocksndiamonds 2> valgrind.out
+ @$(MAKE_CMD) valgrind
enginetest: all
./Scripts/make_enginetest.sh
# prerelease:
# ./Scripts/make_prerelease.sh
-dist-unix:
+dist-clean:
+ @$(MAKE_CMD) dist-clean
+
+dist-build-unix:
+ @BUILD_DIST=TRUE $(MAKE) x11
+
+dist-build-msdos:
+ @BUILD_DIST=TRUE $(MAKE) cross-msdos
+
+dist-build-win32:
+ @BUILD_DIST=TRUE $(MAKE) cross-win32
+
+dist-build-macosx:
+ # (this is done by "dist-package-macosx" target)
+
+dist-package-unix:
./Scripts/make_dist.sh unix .
-dist-msdos:
+dist-package-msdos:
./Scripts/make_dist.sh dos .
-dist-win32:
+dist-package-win32:
./Scripts/make_dist.sh win .
-dist-macosx:
+dist-package-macosx:
./Scripts/make_dist.sh mac . $(MAKE)
-upload-unix:
+dist-upload-unix:
./Scripts/make_dist.sh unix . upload
-upload-msdos:
+dist-upload-msdos:
./Scripts/make_dist.sh dos . upload
-upload-win32:
+dist-upload-win32:
./Scripts/make_dist.sh win . upload
-upload-macosx:
+dist-upload-macosx:
./Scripts/make_dist.sh mac . upload
-dist-clean:
- @$(MAKE_CMD) dist-clean
-
-dist-build-unix:
- @BUILD_DIST=TRUE $(MAKE) x11
-
-dist-build-win32:
- @BUILD_DIST=TRUE $(MAKE) cross-win32
-
-dist-build-msdos:
- @BUILD_DIST=TRUE $(MAKE) cross-msdos
-
dist-build-all:
$(MAKE) clean
$(MAKE) dist-build-unix ; $(MAKE) dist-clean
$(MAKE) dist-build-win32 ; $(MAKE) dist-clean
# $(MAKE) dist-build-msdos ; $(MAKE) dist-clean
-# dist-all: dist-build-all dist-unix dist-msdos dist-win32 dist-macosx
-dist-all: dist-build-all dist-unix dist-win32 dist-macosx
+dist-package-all:
+ $(MAKE) dist-package-unix
+ $(MAKE) dist-package-win32
+ $(MAKE) dist-package-macosx
+# $(MAKE) dist-package-msdos
+
+dist-upload-all:
+ $(MAKE) dist-upload-unix
+ $(MAKE) dist-upload-win32
+ $(MAKE) dist-upload-macosx
+# $(MAKE) dist-upload-msdos
+
+dist-all: dist-build-all dist-package-all
-# upload-all: upload-unix upload-msdos upload-win32 upload-macosx
-upload-all: upload-unix upload-win32 upload-macosx
+upload-all: dist-upload-all
tags:
$(MAKE_CMD) tags
.EXPORT_ALL_VARIABLES:
-ifndef PLATFORM # no platform specified -- try auto detection
+ifndef PLATFORM # unknown platform -- try auto detection
ifdef COMSPEC
PLATFORM = msdos
else
endif
endif
-ifdef X11_PATH # path to X11 specified by top level Makefile
+ifdef X11_PATH # path to X11 from top level Makefile
XINC_PATH = $(X11_PATH)/include
XLIB_PATH = $(X11_PATH)/lib
X11_INCL = -I$(XINC_PATH)
AR = ar
RANLIB = ranlib
ETAGS = etags
+RM = rm -f
BMP2ICO = bmp2ico
WINDRES = windres
-ifeq ($(PLATFORM),msdos) # MS-DOS native compiling
-
-RM = del
-
-PROGBASE = rocks
-PROGNAME = ../$(PROGBASE).exe
+PROGBASE = rocksndiamonds
-SYS_CFLAGS = -DTARGET_X11
-SYS_LDFLAGS = -s -lalleg
+ifdef SPECIAL_EDITION # create special edition
+PROGBASE = $(SPECIAL_EDITION)
+endif
-else # Unix or cross-compiling for MS-DOS and Win32
+PROGNAME = ../$(PROGBASE)
-RM = rm -f
-PROGBASE = rocksndiamonds
-PROGNAME = ../$(PROGBASE)
+# -----------------------------------------------------------------------------
+# configuring platform
+# -----------------------------------------------------------------------------
-ifeq ($(PLATFORM),solaris)
+ifeq ($(PLATFORM),solaris) # native compiling to Solaris
EXTRA_LDFLAGS = -lnsl -lsocket -R$(XLIB_PATH)
PLATFORM = unix
endif
-ifeq ($(PLATFORM),macosx)
+ifeq ($(PLATFORM),macosx) # native compiling to Mac OS X
EXTRA_LDFLAGS = -lstdc++
PLATFORM = unix
TARGET = sdl
endif
-ifeq ($(PLATFORM),os2)
+ifeq ($(PLATFORM),os2) # native compiling to OS/2
RANLIB = echo
PROGNAME = ../$(PROGBASE).exe
EXTRA_CFLAGS = -Zbin-files -D__ST_MT_ERRNO__ -Zmtd -fomit-frame-pointer
TARGET = x11
endif
-ifeq ($(PLATFORM),unix)
+ifeq ($(PLATFORM),unix) # native compiling to Unix (generic)
PROFILING_FLAGS = -pg
endif
-ifeq ($(PLATFORM),cross-msdos)
+ifeq ($(PLATFORM),cross-win32) # cross-compiling to Windows
+PROGNAME = ../$(PROGBASE).exe
+EXTRA_LDFLAGS = -lshfolder -lwsock32
+TARGET = sdl
+endif
+
+ifeq ($(PLATFORM),cross-msdos) # cross-compiling to MS-DOS
PROGBASE = rocks
PROGNAME = ../$(PROGBASE).exe
TARGET = allegro
endif
-ifeq ($(PLATFORM),cross-win32)
-EXTRA_LDFLAGS = -lshfolder -lwsock32
+ifeq ($(PLATFORM),msdos) # native compiling to MS-DOS
+PROGBASE = rocks
PROGNAME = ../$(PROGBASE).exe
-TARGET = sdl
+SYS_CFLAGS = -DTARGET_X11
+SYS_LDFLAGS = -s -lalleg
+RM = del
endif
-ifeq ($(TARGET),x11)
+
+# -----------------------------------------------------------------------------
+# configuring target
+# -----------------------------------------------------------------------------
+
+ifeq ($(TARGET),x11) # compiling for X11 target
SYS_CFLAGS = -DTARGET_X11 $(X11_INCL)
SYS_LDFLAGS = $(X11_LIBS)
endif
-ifeq ($(TARGET),sdl)
+ifeq ($(TARGET),sdl) # compiling for SDL target
SYS_CFLAGS = -DTARGET_SDL $(shell sdl-config --cflags)
SDL_LIBS = -lSDL_image -lSDL_mixer -lSDL_net -lsmpeg
SYS_LDFLAGS = $(SDL_LIBS) $(shell sdl-config --libs)
endif
-ifeq ($(TARGET),sdl-static)
+ifeq ($(TARGET),sdl-static) # compiling for SDL target (static)
SYS_CFLAGS = -DTARGET_SDL $(shell sdl-config --cflags)
SDL_LIBS = -lSDL_image -lSDL_mixer -lSDL_net -lsmpeg
SYS_LDFLAGS = $(SDL_LIBS) $(shell sdl-config --static-libs)
endif
-ifeq ($(TARGET),allegro)
+ifeq ($(TARGET),allegro) # compiling for Allegro target
SYS_CFLAGS = -DTARGET_ALLEGRO -I$(CROSS_PATH_MSDOS)/include
SYS_LDFLAGS = -lalleg
endif
-endif # (PLATFORM != msdos)
+# -----------------------------------------------------------------------------
+# configuring compile-time definitions
+# -----------------------------------------------------------------------------
-ifdef RO_GAME_DIR # path to read-only game data specified
+ifdef RO_GAME_DIR # path to read-only game data specified
CONFIG_RO_GAME_DIR = -DRO_GAME_DIR="\"$(RO_GAME_DIR)\""
endif
-ifdef RW_GAME_DIR # path to writable game data specified
+ifdef RW_GAME_DIR # path to writable game data specified
CONFIG_RW_GAME_DIR = -DRW_GAME_DIR="\"$(RW_GAME_DIR)\""
endif
-ifdef SCORE_ENTRIES # number of score entries per player specified
+ifdef SCORE_ENTRIES # number of score entries per player
CONFIG_SCORE_ENTRIES = -D$(SCORE_ENTRIES)
endif
-CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR)
+ifdef SPECIAL_EDITION
+ifeq ($(SPECIAL_EDITION),rnd_jue) # create special edition
+CONFIG_SPECIAL = -DCREATE_SPECIAL_EDITION -DCREATE_SPECIAL_EDITION_RND_JUE
+endif
+endif
+CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR)
+CONFIG_GAME = $(CONFIG_GAME_DIR) $(CONFIG_SCORE_ENTRIES) $(CONFIG_SPECIAL)
-CONFIG = $(CONFIG_GAME_DIR) $(CONFIG_SCORE_ENTRIES) $(JOYSTICK)
+CONFIG = $(CONFIG_GAME) $(JOYSTICK)
# DEBUG = -DDEBUG -g
# PROFILING = $(PROFILING_FLAGS)
# OPTIONS = -O3 -Wall -ansi -pedantic
# OPTIONS = -O3 -Wall
# OPTIONS = -O3
-# OPTIONS = -DSYSV -Ae # may be needed for HP-UX
+# OPTIONS = -DSYSV -Ae # may be needed for HP-UX
-ifdef BUILD_DIST # distribution build
+ifdef BUILD_DIST # distribution build
OPTIONS = -O3 -Wall
endif
ICONBASE = windows_icon
ifeq ($(PLATFORM),cross-win32)
-ifdef SPECIAL_ICON
-ICONSUFFIX = 32x32_$(SPECIAL_ICON)
+ifdef SPECIAL_EDITION
+ICONSUFFIX = 32x32_$(SPECIAL_EDITION)
else
ICONSUFFIX = 32x32
endif
clean: clean-obj clean-ico clean-bin
+# -----------------------------------------------------------------------------
+# run and test targets
+# -----------------------------------------------------------------------------
+
+run: all
+ $(PROGNAME) --verbose
+
+gdb: all
+ gdb -batch -x ../GDB_COMMANDS $(PROGNAME)
+
+valgrind: all
+ valgrind -v --leak-check=yes $(PROGNAME) 2> ../valgrind.out
+
+
# -----------------------------------------------------------------------------
# development only
# -----------------------------------------------------------------------------
{ "background.INFO[VERSION]", UNDEFINED_FILENAME },
{ "background.INFO[LEVELSET]", UNDEFINED_FILENAME },
{ "background.SETUP", UNDEFINED_FILENAME },
+ { "background.PLAYING", UNDEFINED_FILENAME },
{ "background.DOOR", UNDEFINED_FILENAME },
{ "background.titlescreen_initial_1", UNDEFINED_FILENAME },
{ "game.panel.score.draw_masked", "true" },
{ "game.panel.score.draw_order", "0" },
+ { "game.panel.highscore.x", "-1" },
+ { "game.panel.highscore.y", "-1" },
+ { "game.panel.highscore.align", "left" },
+ { "game.panel.highscore.valign", "top" },
+ { "game.panel.highscore.digits", "5" },
+ { "game.panel.highscore.font", "font.text_2" },
+ { "game.panel.highscore.draw_masked", "true" },
+ { "game.panel.highscore.draw_order", "0" },
+
{ "game.panel.time.x", "50" },
{ "game.panel.time.y", "194" },
{ "game.panel.time.align", "center" },
#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 IMG_BACKGROUND_PLAYING 1757
+#define IMG_BACKGROUND_DOOR 1758
+#define IMG_BACKGROUND_TITLESCREEN_INITIAL_1 1759
+#define IMG_BACKGROUND_TITLESCREEN_INITIAL_2 1760
+#define IMG_BACKGROUND_TITLESCREEN_INITIAL_3 1761
+#define IMG_BACKGROUND_TITLESCREEN_INITIAL_4 1762
+#define IMG_BACKGROUND_TITLESCREEN_INITIAL_5 1763
+#define IMG_BACKGROUND_TITLESCREEN_1 1764
+#define IMG_BACKGROUND_TITLESCREEN_2 1765
+#define IMG_BACKGROUND_TITLESCREEN_3 1766
+#define IMG_BACKGROUND_TITLESCREEN_4 1767
+#define IMG_BACKGROUND_TITLESCREEN_5 1768
+#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_1 1769
+#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_2 1770
+#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_3 1771
+#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_4 1772
+#define IMG_BACKGROUND_TITLEMESSAGE_INITIAL_5 1773
+#define IMG_BACKGROUND_TITLEMESSAGE_1 1774
+#define IMG_BACKGROUND_TITLEMESSAGE_2 1775
+#define IMG_BACKGROUND_TITLEMESSAGE_3 1776
+#define IMG_BACKGROUND_TITLEMESSAGE_4 1777
+#define IMG_BACKGROUND_TITLEMESSAGE_5 1778
+#define IMG_BACKGROUND_ENVELOPE_1 1779
+#define IMG_BACKGROUND_ENVELOPE_2 1780
+#define IMG_BACKGROUND_ENVELOPE_3 1781
+#define IMG_BACKGROUND_ENVELOPE_4 1782
+#define IMG_TITLESCREEN_INITIAL_1 1783
+#define IMG_TITLESCREEN_INITIAL_2 1784
+#define IMG_TITLESCREEN_INITIAL_3 1785
+#define IMG_TITLESCREEN_INITIAL_4 1786
+#define IMG_TITLESCREEN_INITIAL_5 1787
+#define IMG_TITLESCREEN_1 1788
+#define IMG_TITLESCREEN_2 1789
+#define IMG_TITLESCREEN_3 1790
+#define IMG_TITLESCREEN_4 1791
+#define IMG_TITLESCREEN_5 1792
-#define NUM_IMAGE_FILES 1792
+#define NUM_IMAGE_FILES 1793
#endif /* CONF_GFX_H */
"game.panel.score.draw_order",
&game.panel.score.sort_priority
},
+ {
+ "game.panel.highscore.x",
+ &game.panel.highscore.x
+ },
+ {
+ "game.panel.highscore.y",
+ &game.panel.highscore.y
+ },
+ {
+ "game.panel.highscore.align",
+ &game.panel.highscore.align
+ },
+ {
+ "game.panel.highscore.valign",
+ &game.panel.highscore.valign
+ },
+ {
+ "game.panel.highscore.digits",
+ &game.panel.highscore.size
+ },
+ {
+ "game.panel.highscore.font",
+ &game.panel.highscore.font
+ },
+ {
+ "game.panel.highscore.draw_masked",
+ &game.panel.highscore.draw_masked
+ },
+ {
+ "game.panel.highscore.draw_order",
+ &game.panel.highscore.sort_priority
+ },
{
"game.panel.time.x",
&game.panel.time.x
-#define COMPILE_DATE_STRING "2007-09-13 23:31"
+#define COMPILE_DATE_STRING "2007-10-09 00:21"
static void ScrollMiniLevel(int from_x, int from_y, int scroll)
{
- int x,y;
+#if 1
+ static Bitmap *tmp_backbuffer = NULL;
+#endif
+ int x, y;
int dx = (scroll == ED_SCROLL_LEFT ? -1 : scroll == ED_SCROLL_RIGHT ? 1 : 0);
int dy = (scroll == ED_SCROLL_UP ? -1 : scroll == ED_SCROLL_DOWN ? 1 : 0);
+#if 1
+ if (tmp_backbuffer == NULL)
+ tmp_backbuffer = CreateBitmap(WIN_XSIZE, WIN_YSIZE, 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, tmp_backbuffer,
+ SX + (dx == -1 ? MINI_TILEX : 0),
+ SY + (dy == -1 ? MINI_TILEY : 0),
+ (ed_fieldx * MINI_TILEX) - (dx != 0 ? MINI_TILEX : 0),
+ (ed_fieldy * MINI_TILEY) - (dy != 0 ? MINI_TILEY : 0),
+ SX + (dx == +1 ? MINI_TILEX : 0),
+ SY + (dy == +1 ? MINI_TILEY : 0));
+ BlitBitmap(tmp_backbuffer, drawto,
+ SX + (dx == +1 ? MINI_TILEX : 0),
+ SY + (dy == +1 ? MINI_TILEY : 0),
+ (ed_fieldx * MINI_TILEX) - (dx != 0 ? MINI_TILEX : 0),
+ (ed_fieldy * MINI_TILEY) - (dy != 0 ? MINI_TILEY : 0),
+ SX + (dx == +1 ? MINI_TILEX : 0),
+ SY + (dy == +1 ? MINI_TILEY : 0));
+
+#else
+
BlitBitmap(drawto, drawto,
SX + (dx == -1 ? MINI_TILEX : 0),
SY + (dy == -1 ? MINI_TILEY : 0),
(ed_fieldy * MINI_TILEY) - (dy != 0 ? MINI_TILEY : 0),
SX + (dx == +1 ? MINI_TILEX : 0),
SY + (dy == +1 ? MINI_TILEY : 0));
+#endif
+
+ printf("::: ScrollMiniLevel: A.1\n");
+
if (dx)
{
x = (dx == 1 ? 0 : ed_fieldx - 1);
DrawMiniElementOrWall(x, y, from_x, from_y);
}
+ printf("::: ScrollMiniLevel: Z\n");
+
redraw_mask |= REDRAW_FIELD;
BackToFront();
}
if (counter_id == ED_COUNTER_ID_SELECT_LEVEL)
{
LoadLevel(level_nr);
+ LoadScore(level_nr);
+
TapeErase();
+
ResetUndoBuffer();
DrawEditModeWindow();
#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 28
#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 29
#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 30
+#define SETUP_TOKEN_AUTO_OVERRIDE_ARTWORK 31
-#define NUM_GLOBAL_SETUP_TOKENS 31
+#define NUM_GLOBAL_SETUP_TOKENS 32
/* editor setup */
#define SETUP_TOKEN_EDITOR_EL_BOULDERDASH 0
{ TYPE_SWITCH, &si.override_level_graphics, "override_level_graphics" },
{ TYPE_SWITCH, &si.override_level_sounds, "override_level_sounds" },
{ TYPE_SWITCH, &si.override_level_music, "override_level_music" },
+ { TYPE_SWITCH, &si.auto_override_artwork, "auto_override_artwork" },
};
static boolean not_used = 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);
- si->music_set = getStringCopy(MUS_CLASSIC_SUBDIR);
+ si->graphics_set = getStringCopy(GFX_DEFAULT_SUBDIR);
+ si->sounds_set = getStringCopy(SND_DEFAULT_SUBDIR);
+ si->music_set = getStringCopy(MUS_DEFAULT_SUBDIR);
si->override_level_graphics = FALSE;
si->override_level_sounds = FALSE;
si->override_level_music = FALSE;
+ si->auto_override_artwork = FALSE;
si->editor.el_boulderdash = TRUE;
si->editor.el_emerald_mine = TRUE;
si->system.audio_fragment_size = DEFAULT_AUDIO_FRAGMENT_SIZE;
si->options.verbose = FALSE;
+
+#if defined(CREATE_SPECIAL_EDITION_RND_JUE)
+ si->handicap = FALSE;
+ si->fullscreen = TRUE;
+ si->auto_override_artwork = TRUE;
+#endif
}
static void setSetupInfoToDefaults_EditorCascade(struct SetupInfo *si)
InitMenuDesignSettings_Static();
InitMenuDesignSettings_SpecialPreProcessing();
+#if 1
+ if (!GFX_OVERRIDE_ARTWORK(ARTWORK_TYPE_GRAPHICS))
+#else
if (!SETUP_OVERRIDE_ARTWORK(setup, ARTWORK_TYPE_GRAPHICS))
+#endif
{
/* first look for special settings configured in level series config */
filename_base = getCustomArtworkLevelConfigFilename(ARTWORK_TYPE_GRAPHICS);
#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
+#define GAME_PANEL_HIGHSCORE 30
+#define GAME_PANEL_TIME 31
+#define GAME_PANEL_TIME_HH 32
+#define GAME_PANEL_TIME_MM 33
+#define GAME_PANEL_TIME_SS 34
+#define GAME_PANEL_SHIELD_NORMAL 35
+#define GAME_PANEL_SHIELD_NORMAL_TIME 36
+#define GAME_PANEL_SHIELD_DEADLY 37
+#define GAME_PANEL_SHIELD_DEADLY_TIME 38
+#define GAME_PANEL_EXIT 39
+#define GAME_PANEL_EMC_MAGIC_BALL 40
+#define GAME_PANEL_EMC_MAGIC_BALL_SWITCH 41
+#define GAME_PANEL_LIGHT_SWITCH 42
+#define GAME_PANEL_LIGHT_SWITCH_TIME 43
+#define GAME_PANEL_TIMEGATE_SWITCH 44
+#define GAME_PANEL_TIMEGATE_SWITCH_TIME 45
+#define GAME_PANEL_SWITCHGATE_SWITCH 46
+#define GAME_PANEL_EMC_LENSES 47
+#define GAME_PANEL_EMC_LENSES_TIME 48
+#define GAME_PANEL_EMC_MAGNIFIER 49
+#define GAME_PANEL_EMC_MAGNIFIER_TIME 50
+#define GAME_PANEL_BALLOON_SWITCH 51
+#define GAME_PANEL_DYNABOMB_NUMBER 52
+#define GAME_PANEL_DYNABOMB_SIZE 53
+#define GAME_PANEL_DYNABOMB_POWER 54
+#define GAME_PANEL_PENGUINS 55
+#define GAME_PANEL_SOKOBAN_OBJECTS 56
+#define GAME_PANEL_SOKOBAN_FIELDS 57
+#define GAME_PANEL_ROBOT_WHEEL 58
+#define GAME_PANEL_CONVEYOR_BELT_1 59
+#define GAME_PANEL_CONVEYOR_BELT_2 60
+#define GAME_PANEL_CONVEYOR_BELT_3 61
+#define GAME_PANEL_CONVEYOR_BELT_4 62
+#define GAME_PANEL_CONVEYOR_BELT_1_SWITCH 63
+#define GAME_PANEL_CONVEYOR_BELT_2_SWITCH 64
+#define GAME_PANEL_CONVEYOR_BELT_3_SWITCH 65
+#define GAME_PANEL_CONVEYOR_BELT_4_SWITCH 66
+#define GAME_PANEL_MAGIC_WALL 67
+#define GAME_PANEL_MAGIC_WALL_TIME 68
+#define GAME_PANEL_GRAVITY_STATE 69
+#define GAME_PANEL_GRAPHIC_1 70
+#define GAME_PANEL_GRAPHIC_2 71
+#define GAME_PANEL_GRAPHIC_3 72
+#define GAME_PANEL_GRAPHIC_4 73
+#define GAME_PANEL_GRAPHIC_5 74
+#define GAME_PANEL_GRAPHIC_6 75
+#define GAME_PANEL_GRAPHIC_7 76
+#define GAME_PANEL_GRAPHIC_8 77
+#define GAME_PANEL_ELEMENT_1 78
+#define GAME_PANEL_ELEMENT_2 79
+#define GAME_PANEL_ELEMENT_3 80
+#define GAME_PANEL_ELEMENT_4 81
+#define GAME_PANEL_ELEMENT_5 82
+#define GAME_PANEL_ELEMENT_6 83
+#define GAME_PANEL_ELEMENT_7 84
+#define GAME_PANEL_ELEMENT_8 85
+#define GAME_PANEL_ELEMENT_COUNT_1 86
+#define GAME_PANEL_ELEMENT_COUNT_2 87
+#define GAME_PANEL_ELEMENT_COUNT_3 88
+#define GAME_PANEL_ELEMENT_COUNT_4 89
+#define GAME_PANEL_ELEMENT_COUNT_5 90
+#define GAME_PANEL_ELEMENT_COUNT_6 91
+#define GAME_PANEL_ELEMENT_COUNT_7 92
+#define GAME_PANEL_ELEMENT_COUNT_8 93
+#define GAME_PANEL_CE_SCORE_1 94
+#define GAME_PANEL_CE_SCORE_2 95
+#define GAME_PANEL_CE_SCORE_3 96
+#define GAME_PANEL_CE_SCORE_4 97
+#define GAME_PANEL_CE_SCORE_5 98
+#define GAME_PANEL_CE_SCORE_6 99
+#define GAME_PANEL_CE_SCORE_7 100
+#define GAME_PANEL_CE_SCORE_8 101
+#define GAME_PANEL_CE_SCORE_1_ELEMENT 102
+#define GAME_PANEL_CE_SCORE_2_ELEMENT 103
+#define GAME_PANEL_CE_SCORE_3_ELEMENT 104
+#define GAME_PANEL_CE_SCORE_4_ELEMENT 105
+#define GAME_PANEL_CE_SCORE_5_ELEMENT 106
+#define GAME_PANEL_CE_SCORE_6_ELEMENT 107
+#define GAME_PANEL_CE_SCORE_7_ELEMENT 108
+#define GAME_PANEL_CE_SCORE_8_ELEMENT 109
+#define GAME_PANEL_PLAYER_NAME 110
+#define GAME_PANEL_LEVEL_NAME 111
+#define GAME_PANEL_LEVEL_AUTHOR 112
+
+#define NUM_GAME_PANEL_CONTROLS 113
struct GamePanelOrderInfo
{
&game.panel.score,
TYPE_INTEGER,
},
+ {
+ GAME_PANEL_HIGHSCORE,
+ &game.panel.highscore,
+ TYPE_INTEGER,
+ },
{
GAME_PANEL_TIME,
&game.panel.time,
if (nr != i)
{
- Error(ERR_INFO, "'game_panel_controls' structure corrupted");
+ Error(ERR_INFO, "'game_panel_controls' structure corrupted at %d", i);
Error(ERR_EXIT, "this should not happen -- please debug");
}
}
game_panel_controls[GAME_PANEL_SCORE].value = score;
+ game_panel_controls[GAME_PANEL_HIGHSCORE].value = highscore[0].Score;
game_panel_controls[GAME_PANEL_TIME].value = time;
else if (Feld[x][y + 1] == EL_QUICKSAND_EMPTY)
{
if (!MovDelay[x][y])
+ {
MovDelay[x][y] = TILEY + 1;
+ ResetGfxAnimation(x, y);
+ ResetGfxAnimation(x, y + 1);
+ }
+
if (MovDelay[x][y])
{
+ DrawLevelElement(x, y, EL_QUICKSAND_EMPTYING);
+ DrawLevelElement(x, y + 1, EL_QUICKSAND_FILLING);
+
MovDelay[x][y]--;
if (MovDelay[x][y])
return;
else if (Feld[x][y + 1] == EL_QUICKSAND_FAST_EMPTY)
{
if (!MovDelay[x][y])
+ {
MovDelay[x][y] = TILEY + 1;
+ ResetGfxAnimation(x, y);
+ ResetGfxAnimation(x, y + 1);
+ }
+
if (MovDelay[x][y])
{
+ DrawLevelElement(x, y, EL_QUICKSAND_FAST_EMPTYING);
+ DrawLevelElement(x, y + 1, EL_QUICKSAND_FAST_FILLING);
+
MovDelay[x][y]--;
if (MovDelay[x][y])
return;
}
#if USE_NEW_CUSTOM_VALUE
- CustomValue[newx][newy] = CustomValue[x][y];
+ CustomValue[newx][newy] = CustomValue[x][y];
#endif
ChangeDelay[x][y] = 0;
struct TextPosInfo key_white;
struct TextPosInfo key_white_count;
struct TextPosInfo score;
+ struct TextPosInfo highscore;
struct TextPosInfo time;
struct TextPosInfo time_hh;
struct TextPosInfo time_mm;
Xsand_stonesand_2,
Xsand_stonesand_3,
Xsand_stonesand_4,
+
+#ifdef EM_ENGINE_USE_ADDITIONAL_ELEMENTS
+ Xsand_stonesand_quickout_1,
+ Xsand_stonesand_quickout_2,
+#endif
+
Xsand_stoneout_1,
Xsand_stoneout_2,
Xsand_sandstone_1,
case Xacid_6:
case Xacid_7:
case Xacid_8:
+#if 1
+ Cave[y][x] = Xsand_stonesand_quickout_1;
+ if (Cave[y][x+1] == Xblank)
+ Cave[y][x+1] = Yacid_splash_eB;
+ if (Cave[y][x-1] == Xblank)
+ Cave[y][x-1] = Yacid_splash_wB;
+ Next[y][x] = Xsand_stonesand_quickout_2;
+ play_element_sound(x, y, SAMPLE_acid, Xacid_1);
+ goto loop;
+#else
Cave[y][x] = Xsand_stonesand_3;
if (Cave[y][x+1] == Xblank)
Cave[y][x+1] = Yacid_splash_eB;
Next[y][x] = Xsand_stonesand_4;
play_element_sound(x, y, SAMPLE_acid, Xacid_1);
goto loop;
+#endif
case Xblank:
case Yacid_splash_eB:
case Yacid_splash_wB:
+#if 1
+ Cave[y][x] = Xsand_stonesand_quickout_1;
+ Cave[y+1][x] = Xsand_stoneout_1;
+ Next[y][x] = Xsand_stonesand_quickout_2;
+ Next[y+1][x] = Xsand_stoneout_2;
+ goto loop;
+#else
Cave[y][x] = Xsand_stonesand_3;
Cave[y+1][x] = Xsand_stoneout_1;
Next[y][x] = Xsand_stonesand_4;
Next[y+1][x] = Xsand_stoneout_2;
goto loop;
+#endif
case Xsand:
Cave[y][x] = Xsand_stonesand_1;
Next[y][x] = Xsand;
goto loop;
+#if 1
+ case Xsand_stonesand_quickout_1:
+ Next[y][x] = Xsand_stonesand_quickout_2;
+ goto loop;
+
+ case Xsand_stonesand_quickout_2:
+ Next[y][x] = Xsand;
+ goto loop;
+#endif
+
case Xsand_stoneout_1:
Next[y][x] = Xsand_stoneout_2;
goto loop;
y = WIN_YSIZE / 2 - TILESIZE / 2;
#endif
+ graphic_info = &anim_initial; /* graphic == 0 => anim_initial */
+
#if 0
{
static boolean done = FALSE;
- if (!done)
- printf("::: %d, %d, %d, %d => %d, %d\n",
+ // if (!done)
+ printf("::: %d, %d, %d, %d => %d, %d [%d, %d] [%d, %d]\n",
init.busy.x, init.busy.y,
init.busy.align, init.busy.valign,
- x, y);
+ x, y,
+ graphic_info[graphic].width,
+ graphic_info[graphic].height,
+ sync_frame, anim_initial.anim_delay);
done = TRUE;
}
#endif
- graphic_info = &anim_initial; /* graphic == 0 => anim_initial */
-
if (sync_frame % anim_initial.anim_delay == 0)
+ {
+#if 1
+ Bitmap *src_bitmap;
+ int src_x, src_y;
+ int width = graphic_info[graphic].width;
+ int height = graphic_info[graphic].height;
+ int frame = getGraphicAnimationFrame(graphic, sync_frame);
+
+ getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y);
+ BlitBitmap(src_bitmap, window, src_x, src_y, width, height, x, y);
+#else
+ /* !!! this can only draw TILEX/TILEY size animations !!! */
DrawGraphicAnimationExt(window, x, y, graphic, sync_frame, NO_MASKING);
+#endif
+ }
graphic_info = graphic_info_last;
return original_height * scale_up_factor;
}
-static void set_graphic_parameters_ext(int graphic, struct GraphicInfo *g,
- int *parameter, Bitmap *src_bitmap)
+static void set_graphic_parameters_ext(int graphic, int *parameter,
+ Bitmap *src_bitmap)
{
+ struct GraphicInfo *g = &graphic_info[graphic];
int anim_frames_per_row = 1, anim_frames_per_col = 1;
int anim_frames_per_line = 1;
int src_image_width = get_scaled_graphic_width(graphic);
int src_image_height = get_scaled_graphic_height(graphic);
+ if (src_image_width == 0 || src_image_height == 0)
+ {
+ /* only happens when loaded outside artwork system (like "global.busy") */
+ src_image_width = src_bitmap->width;
+ src_image_height = src_bitmap->height;
+ }
+
anim_frames_per_row = src_image_width / g->width;
anim_frames_per_col = src_image_height / g->height;
image_config_suffix[i].token,
image_config_suffix[i].type);
- set_graphic_parameters_ext(graphic, &graphic_info[graphic],
- parameter, src_bitmap);
+ set_graphic_parameters_ext(graphic, parameter, src_bitmap);
#else
static void InitMixer()
{
OpenAudio();
+
StartMixer();
}
void InitGfx()
{
+ struct GraphicInfo *graphic_info_last = graphic_info;
char *filename_font_initial = NULL;
char *filename_anim_initial = NULL;
Bitmap *bitmap_font_initial = NULL;
InitGfxDoor1Info(DX, DY, DXSIZE, DYSIZE);
InitGfxDoor2Info(VX, VY, VXSIZE, VYSIZE);
InitGfxScrollbufferInfo(FXSIZE, FYSIZE);
+ InitGfxCustomArtworkInfo();
bitmap_font_initial = LoadCustomImage(filename_font_initial);
}
}
- set_graphic_parameters_ext(0, &anim_initial, parameter, NULL);
+#if defined(CREATE_SPECIAL_EDITION_RND_JUE)
+ filename_anim_initial = "loading.pcx";
+
+ parameter[GFX_ARG_X] = 0;
+ parameter[GFX_ARG_Y] = 0;
+ parameter[GFX_ARG_WIDTH] = 128;
+ parameter[GFX_ARG_HEIGHT] = 40;
+ parameter[GFX_ARG_FRAMES] = 32;
+ parameter[GFX_ARG_DELAY] = 4;
+ parameter[GFX_ARG_FRAMES_PER_LINE] = ARG_UNDEFINED_VALUE;
+#endif
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);
+ graphic_info = &anim_initial; /* graphic == 0 => anim_initial */
+
+ set_graphic_parameters_ext(0, parameter, anim_initial.bitmap);
+
+#if 0
+ printf("::: INIT_GFX: anim_frames_per_line == %d [%d / %d] [%d, %d]\n",
+ graphic_info[0].anim_frames_per_line,
+ get_scaled_graphic_width(0),
+ graphic_info[0].width,
+ getOriginalImageWidthFromImageID(0),
+ graphic_info[0].scale_up_factor);
+#endif
+
+ graphic_info = graphic_info_last;
+
init.busy.width = anim_initial.width;
init.busy.height = anim_initial.height;
LoadLevelSetup_SeriesInfo(); /* last played level info */
}
-void InitLevelArtworkInfo()
+static void InitLevelArtworkInfo()
{
LoadLevelArtworkInfo();
}
#endif
}
+static boolean CheckArtworkConfigForCustomElements(char *filename)
+{
+ SetupFileHash *setup_file_hash;
+ boolean redefined_ce_found = FALSE;
+
+ /* !!! CACHE THIS BY USING HASH 'filename' => 'true/false' !!! */
+
+ if ((setup_file_hash = loadSetupFileHash(filename)) != NULL)
+ {
+ BEGIN_HASH_ITERATION(setup_file_hash, itr)
+ {
+ char *token = HASH_ITERATION_TOKEN(itr);
+
+ if (strPrefix(token, "custom_"))
+ {
+ redefined_ce_found = TRUE;
+
+ break;
+ }
+ }
+ END_HASH_ITERATION(setup_file_hash, itr)
+
+ freeSetupFileHash(setup_file_hash);
+ }
+
+ return redefined_ce_found;
+}
+
+static void InitOverrideArtwork()
+{
+ boolean init_override_from_setup = TRUE;
+
+ gfx.override_level_graphics = FALSE;
+ gfx.override_level_sounds = FALSE;
+ gfx.override_level_music = FALSE;
+
+ if (setup.auto_override_artwork)
+ {
+ char *filename_base, *filename_local;
+ boolean redefined_ce_found = FALSE;
+
+ /* first look for special artwork configured in level series config */
+ filename_base = getCustomArtworkLevelConfigFilename(ARTWORK_TYPE_GRAPHICS);
+
+ if (fileExists(filename_base))
+ redefined_ce_found |= CheckArtworkConfigForCustomElements(filename_base);
+
+ filename_local = getCustomArtworkConfigFilename(ARTWORK_TYPE_GRAPHICS);
+
+ if (filename_local != NULL && !strEqual(filename_base, filename_local))
+ redefined_ce_found |= CheckArtworkConfigForCustomElements(filename_local);
+
+ if (!redefined_ce_found)
+ {
+ gfx.override_level_graphics = TRUE;
+ gfx.override_level_sounds = TRUE;
+ gfx.override_level_music = TRUE;
+
+ init_override_from_setup = FALSE;
+ }
+ }
+
+ if (init_override_from_setup)
+ {
+ gfx.override_level_graphics = setup.override_level_graphics;
+ gfx.override_level_sounds = setup.override_level_sounds;
+ gfx.override_level_music = setup.override_level_music;
+ }
+}
+
static char *getNewArtworkIdentifier(int type)
{
static char *leveldir_current_identifier[3] = { NULL, NULL, NULL };
static boolean last_has_level_artwork_set[3] = { FALSE, FALSE, FALSE };
static boolean initialized[3] = { FALSE, FALSE, FALSE };
TreeInfo *artwork_first_node = ARTWORK_FIRST_NODE(artwork, type);
+#if 1
+ boolean setup_override_artwork = GFX_OVERRIDE_ARTWORK(type);
+#else
boolean setup_override_artwork = SETUP_OVERRIDE_ARTWORK(setup, type);
+#endif
char *setup_artwork_set = SETUP_ARTWORK_SET(setup, type);
char *leveldir_identifier = leveldir_current->identifier;
#if 1
boolean force_reload_mus = (force_reload & (1 << ARTWORK_TYPE_MUSIC));
boolean reload_needed;
+ InitOverrideArtwork();
+
force_reload_gfx |= AdjustGraphicsForEMC();
gfx_new_identifier = getNewArtworkIdentifier(ARTWORK_TYPE_GRAPHICS);
InitLevelArtworkInfo();
print_timestamp_time("InitLevelArtworkInfo");
+ InitOverrideArtwork(); /* needs to know current level directory */
+ print_timestamp_time("InitOverrideArtwork");
+
InitImages(); /* needs to know current level directory */
print_timestamp_time("InitImages");
if (scale_down)
{
+#if 1
+ zoom_factor = MIN(src_width / dst_width, src_height / dst_height);
+#else
zoom_factor = src_width / dst_width;
+#endif
/* adjust source image size to integer multiple of destination size */
src_width = dst_width * zoom_factor;
}
else
{
+#if 1
+ zoom_factor = MIN(dst_width / src_width, dst_height / src_height);
+#else
zoom_factor = dst_width / src_width;
+#endif
/* no adjustment needed when scaling up (some pixels may be left blank) */
}
options.network = FALSE;
options.verbose = FALSE;
options.debug = FALSE;
+ options.debug_x11_sync = FALSE;
#if !defined(PLATFORM_UNIX)
if (*options_left == NULL) /* no options given -- enable verbose mode */
{
options.debug = TRUE;
}
+ else if (strncmp(option, "-debug-x11-sync", option_len) == 0)
+ {
+ options.debug_x11_sync = TRUE;
+ }
else if (strncmp(option, "-execute", option_len) == 0)
{
if (option_arg == NULL)
artwork_info->num_property_mapping_entries = 0;
}
+#if 1
+ if (!GFX_OVERRIDE_ARTWORK(artwork_info->type))
+#else
if (!SETUP_OVERRIDE_ARTWORK(setup, artwork_info->type))
+#endif
{
/* first look for special artwork configured in level series config */
filename_base = getCustomArtworkLevelConfigFilename(artwork_info->type);
+#if 0
+ printf("::: filename_base == '%s' [%s, %s]\n", filename_base,
+ leveldir_current->graphics_set,
+ leveldir_current->graphics_path);
+#endif
+
if (fileExists(filename_base))
LoadArtworkConfigFromFilename(artwork_info, filename_base);
}
int src_x = x, src_y = y;
int dst_x = x, dst_y = y;
unsigned int time_last, time_current;
- float alpha;
- int alpha_final;
src_rect.x = src_x;
src_rect.y = src_y;
int ypos[melt_columns];
int max_steps = height / 8 + 32;
int steps_done = 0;
+ float steps = 0;
int i;
SDL_BlitSurface(surface_source, &src_rect, surface_screen, &dst_rect);
while (!done)
{
- float steps;
int steps_final;
time_last = time_current;
}
else
{
+ float alpha;
+ int alpha_final;
+
for (alpha = 0.0; alpha < 255.0;)
{
time_last = time_current;
return music_dir;
}
-static char *getDefaultArtworkSet(int type)
+static char *getClassicArtworkSet(int type)
{
return (type == TREE_TYPE_GRAPHICS_DIR ? GFX_CLASSIC_SUBDIR :
type == TREE_TYPE_SOUNDS_DIR ? SND_CLASSIC_SUBDIR :
type == TREE_TYPE_MUSIC_DIR ? MUS_CLASSIC_SUBDIR : "");
}
-static char *getDefaultArtworkDir(int type)
+static char *getClassicArtworkDir(int type)
{
return (type == TREE_TYPE_GRAPHICS_DIR ?
getDefaultGraphicsDir(GFX_CLASSIC_SUBDIR) :
*artwork_path_ptr = getStringCopy(getSetupArtworkDir(level_artwork));
else
{
- /* No (or non-existing) artwork configured in "levelinfo.conf". This would
- normally result in using the artwork configured in the setup menu. But
- if an artwork subdirectory exists (which might contain custom artwork
- or an artwork configuration file), this level artwork must be treated
- as relative to the default "classic" artwork, not to the artwork that
- is currently configured in the setup menu. */
+ /*
+ No (or non-existing) artwork configured in "levelinfo.conf". This would
+ normally result in using the artwork configured in the setup menu. But
+ if an artwork subdirectory exists (which might contain custom artwork
+ or an artwork configuration file), this level artwork must be treated
+ as relative to the default "classic" artwork, not to the artwork that
+ is currently configured in the setup menu.
+
+ Update: For "special" versions of R'n'D (like "R'n'D jue"), do not use
+ the "default" artwork (which would be "jue0" for "R'n'D jue"), but use
+ the real "classic" artwork from the original R'n'D (like "gfx_classic").
+ */
char *dir = getPath2(getCurrentLevelDir(), ARTWORK_DIRECTORY(ti->type));
if (fileExists(dir))
{
- *artwork_path_ptr = getStringCopy(getDefaultArtworkDir(ti->type));
- *artwork_set_ptr = getStringCopy(getDefaultArtworkSet(ti->type));
+ *artwork_path_ptr = getStringCopy(getClassicArtworkDir(ti->type));
+ *artwork_set_ptr = getStringCopy(getClassicArtworkSet(ti->type));
}
else
{
basename = getLevelSetTitleMessageBasename(nr, initial);
- if (!setup.override_level_graphics)
+ if (!gfx.override_level_graphics)
{
/* 1st try: look for special artwork in current level series directory */
filename = getPath3(getCurrentLevelDir(), GRAPHICS_DIRECTORY, basename);
}
/* 5th try: look for default artwork in new default artwork directory */
- filename = getPath2(getDefaultGraphicsDir(GFX_CLASSIC_SUBDIR), basename);
+ filename = getPath2(getDefaultGraphicsDir(GFX_DEFAULT_SUBDIR), basename);
if (fileExists(filename))
return filename;
basename = getCorrectedArtworkBasename(basename);
- if (!setup.override_level_graphics)
+ if (!gfx.override_level_graphics)
{
/* 1st try: look for special artwork in current level series directory */
filename = getPath3(getCurrentLevelDir(), GRAPHICS_DIRECTORY, basename);
}
/* 4th try: look for default artwork in new default artwork directory */
- filename = getPath2(getDefaultGraphicsDir(GFX_CLASSIC_SUBDIR), basename);
+ filename = getPath2(getDefaultGraphicsDir(GFX_DEFAULT_SUBDIR), basename);
if (fileExists(filename))
return filename;
if (fileExists(filename))
return filename;
-#if CREATE_SPECIAL_EDITION
+#if defined(CREATE_SPECIAL_EDITION)
free(filename);
- /* !!! INSERT WARNING HERE TO REPORT MISSING ARTWORK FILES !!! */
-#if 0
- printf("::: MISSING ARTWORK FILE '%s'\n", basename);
-#endif
+ if (options.debug)
+ Error(ERR_WARN, "cannot find artwork file '%s' (using fallback)", basename);
/* 6th try: look for fallback artwork in old default artwork directory */
/* (needed to prevent errors when trying to access unused artwork files) */
basename = getCorrectedArtworkBasename(basename);
- if (!setup.override_level_sounds)
+ if (!gfx.override_level_sounds)
{
/* 1st try: look for special artwork in current level series directory */
filename = getPath3(getCurrentLevelDir(), SOUNDS_DIRECTORY, basename);
}
/* 4th try: look for default artwork in new default artwork directory */
- filename = getPath2(getDefaultSoundsDir(SND_CLASSIC_SUBDIR), basename);
+ filename = getPath2(getDefaultSoundsDir(SND_DEFAULT_SUBDIR), basename);
if (fileExists(filename))
return filename;
if (fileExists(filename))
return filename;
-#if CREATE_SPECIAL_EDITION
+#if defined(CREATE_SPECIAL_EDITION)
free(filename);
+ if (options.debug)
+ Error(ERR_WARN, "cannot find artwork file '%s' (using fallback)", basename);
+
/* 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);
basename = getCorrectedArtworkBasename(basename);
- if (!setup.override_level_music)
+ if (!gfx.override_level_music)
{
/* 1st try: look for special artwork in current level series directory */
filename = getPath3(getCurrentLevelDir(), MUSIC_DIRECTORY, basename);
}
/* 4th try: look for default artwork in new default artwork directory */
- filename = getPath2(getDefaultMusicDir(MUS_CLASSIC_SUBDIR), basename);
+ filename = getPath2(getDefaultMusicDir(MUS_DEFAULT_SUBDIR), basename);
if (fileExists(filename))
return filename;
if (fileExists(filename))
return filename;
-#if CREATE_SPECIAL_EDITION
+#if defined(CREATE_SPECIAL_EDITION)
free(filename);
+ if (options.debug)
+ Error(ERR_WARN, "cannot find artwork file '%s' (using fallback)", basename);
+
/* 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);
checked_free(directory);
- if (!setup.override_level_music)
+ if (!gfx.override_level_music)
{
/* 1st try: look for special artwork in current level series directory */
directory = getPath2(getCurrentLevelDir(), MUSIC_DIRECTORY);
}
/* 4th try: look for default artwork in new default artwork directory */
- directory = getStringCopy(getDefaultMusicDir(MUS_CLASSIC_SUBDIR));
+ directory = getStringCopy(getDefaultMusicDir(MUS_DEFAULT_SUBDIR));
if (fileExists(directory))
return directory;
getTreeInfoFromIdentifier(artwork.gfx_first, setup.graphics_set);
if (artwork.gfx_current == NULL)
artwork.gfx_current =
- getTreeInfoFromIdentifier(artwork.gfx_first, GFX_CLASSIC_SUBDIR);
+ getTreeInfoFromIdentifier(artwork.gfx_first, GFX_DEFAULT_SUBDIR);
if (artwork.gfx_current == NULL)
artwork.gfx_current = getFirstValidTreeInfoEntry(artwork.gfx_first);
getTreeInfoFromIdentifier(artwork.snd_first, setup.sounds_set);
if (artwork.snd_current == NULL)
artwork.snd_current =
- getTreeInfoFromIdentifier(artwork.snd_first, SND_CLASSIC_SUBDIR);
+ getTreeInfoFromIdentifier(artwork.snd_first, SND_DEFAULT_SUBDIR);
if (artwork.snd_current == NULL)
artwork.snd_current = getFirstValidTreeInfoEntry(artwork.snd_first);
getTreeInfoFromIdentifier(artwork.mus_first, setup.music_set);
if (artwork.mus_current == NULL)
artwork.mus_current =
- getTreeInfoFromIdentifier(artwork.mus_first, MUS_CLASSIC_SUBDIR);
+ getTreeInfoFromIdentifier(artwork.mus_first, MUS_DEFAULT_SUBDIR);
if (artwork.mus_current == NULL)
artwork.mus_current = getFirstValidTreeInfoEntry(artwork.mus_first);
getTreeInfoFromIdentifier(artwork.gfx_first, setup.graphics_set);
if (artwork.gfx_current == NULL)
artwork.gfx_current =
- getTreeInfoFromIdentifier(artwork.gfx_first, GFX_CLASSIC_SUBDIR);
+ getTreeInfoFromIdentifier(artwork.gfx_first, GFX_DEFAULT_SUBDIR);
if (artwork.gfx_current == NULL)
artwork.gfx_current = getFirstValidTreeInfoEntry(artwork.gfx_first);
}
getTreeInfoFromIdentifier(artwork.snd_first, setup.sounds_set);
if (artwork.snd_current == NULL)
artwork.snd_current =
- getTreeInfoFromIdentifier(artwork.snd_first, SND_CLASSIC_SUBDIR);
+ getTreeInfoFromIdentifier(artwork.snd_first, SND_DEFAULT_SUBDIR);
if (artwork.snd_current == NULL)
artwork.snd_current = getFirstValidTreeInfoEntry(artwork.snd_first);
}
getTreeInfoFromIdentifier(artwork.mus_first, setup.music_set);
if (artwork.mus_current == NULL)
artwork.mus_current =
- getTreeInfoFromIdentifier(artwork.mus_first, MUS_CLASSIC_SUBDIR);
+ getTreeInfoFromIdentifier(artwork.mus_first, MUS_DEFAULT_SUBDIR);
if (artwork.mus_current == NULL)
artwork.mus_current = getFirstValidTreeInfoEntry(artwork.mus_first);
}
/* always start with reliable default values */
leveldir_current = getFirstValidTreeInfoEntry(leveldir_first);
+#if defined(CREATE_SPECIAL_EDITION_RND_JUE)
+ leveldir_current = getTreeInfoFromIdentifier(leveldir_first,
+ "jue_start");
+ if (leveldir_current == NULL)
+ leveldir_current = getFirstValidTreeInfoEntry(leveldir_first);
+#endif
+
if ((level_setup_hash = loadSetupFileHash(filename)))
{
char *last_level_series =
unsigned long str_size4 = strlen(ti->basepath) + 1;
unsigned long str_size5 = strlen(ti->fullpath) + 1;
boolean override_level_artwork = (type == SND_CTRL_RELOAD_SOUNDS ?
- setup.override_level_sounds :
- setup.override_level_music);
+ gfx.override_level_sounds :
+ gfx.override_level_music);
if (IS_CHILD_PROCESS())
return;
unsigned long str_size1, str_size2, str_size3, str_size4, str_size5;
static char *set_identifier = NULL;
boolean *override_level_artwork = (snd_ctrl->state & SND_CTRL_RELOAD_SOUNDS ?
- &setup.override_level_sounds :
- &setup.override_level_music);
+ &gfx.override_level_sounds :
+ &gfx.override_level_music);
checked_free(set_identifier);
gfx.draw_busy_anim_function = draw_busy_anim_function;
}
+void InitGfxCustomArtworkInfo()
+{
+ gfx.override_level_graphics = FALSE;
+ gfx.override_level_sounds = FALSE;
+ gfx.override_level_music = FALSE;
+
+ gfx.draw_init_text = TRUE;
+}
+
void SetDrawDeactivationMask(int draw_deactivation_mask)
{
gfx.draw_deactivation_mask = draw_deactivation_mask;
Bitmap *CreateBitmap(int width, int height, int depth)
{
Bitmap *new_bitmap = CreateBitmapStruct();
- int real_depth = GetRealDepth(depth);
+ int real_width = MAX(1, width); /* prevent zero bitmap width */
+ int real_height = MAX(1, height); /* prevent zero bitmap height */
+ int real_depth = GetRealDepth(depth);
#if defined(TARGET_SDL)
- SDLCreateBitmapContent(new_bitmap, width, height, real_depth);
+ SDLCreateBitmapContent(new_bitmap, real_width, real_height, real_depth);
#else
- X11CreateBitmapContent(new_bitmap, width, height, real_depth);
+ X11CreateBitmapContent(new_bitmap, real_width, real_height, real_depth);
#endif
- new_bitmap->width = width;
- new_bitmap->height = height;
+ new_bitmap->width = real_width;
+ new_bitmap->height = real_height;
return new_bitmap;
}
#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
#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
+#if defined(CREATE_SPECIAL_EDITION_RND_JUE)
+#define GFX_DEFAULT_SUBDIR "jue0"
+#define SND_DEFAULT_SUBDIR "jue0"
+#define MUS_DEFAULT_SUBDIR "jue0"
+#else
+#define GFX_DEFAULT_SUBDIR GFX_CLASSIC_SUBDIR
+#define SND_DEFAULT_SUBDIR SND_CLASSIC_SUBDIR
+#define MUS_DEFAULT_SUBDIR MUS_CLASSIC_SUBDIR
+#endif
+
+#if defined(CREATE_SPECIAL_EDITION)
#define GFX_FALLBACK_FILENAME "fallback.pcx"
#define SND_FALLBACK_FILENAME "fallback.wav"
#define MUS_FALLBACK_FILENAME "fallback.wav"
(setup).override_level_sounds : \
(setup).override_level_music)
+#define GFX_OVERRIDE_ARTWORK(type) \
+ ((type) == ARTWORK_TYPE_GRAPHICS ? \
+ gfx.override_level_graphics : \
+ (type) == ARTWORK_TYPE_SOUNDS ? \
+ gfx.override_level_sounds : \
+ gfx.override_level_music)
+
#define ARTWORK_FIRST_NODE(artwork, type) \
((type) == ARTWORK_TYPE_GRAPHICS ? \
(artwork).gfx_first : \
boolean network;
boolean verbose;
boolean debug;
+ boolean debug_x11_sync;
};
struct ScreenModeInfo
Bitmap *background_bitmap;
int background_bitmap_mask;
+ boolean override_level_graphics;
+ boolean override_level_sounds;
+ boolean override_level_music;
+
+ boolean draw_init_text;
+
int num_fonts;
struct FontBitmapInfo *font_bitmap_info;
int (*select_font_function)(int);
boolean override_level_graphics;
boolean override_level_sounds;
boolean override_level_music;
+ boolean auto_override_artwork;
struct SetupEditorInfo editor;
struct SetupEditorCascadeInfo editor_cascade;
void InitGfxDoor2Info(int, int, int, int);
void InitGfxScrollbufferInfo(int, int);
void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void));
+void InitGfxCustomArtworkInfo();
void SetDrawDeactivationMask(int);
void SetDrawBackgroundMask(int);
void SetWindowBackgroundBitmap(Bitmap *);
return;
if (window != NULL &&
+ gfx.draw_init_text &&
gfx.num_fonts > 0 &&
gfx.font_bitmap_info[font_nr].bitmap != NULL)
{
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)
{
static void X11InitDisplay();
static DrawWindow *X11InitWindow();
+static int X11DebugErrorHandler(Display *display, XErrorEvent *event)
+{
+ int x = 0;
+
+ return 1 / x; /* !!! crash program to give backtrace in gdb !!! */
+}
+
void X11InitVideoDisplay(void)
{
/* initialize X11 video */
Error(ERR_EXIT, "cannot connect to X server %s",
XDisplayName(options.display_name));
+ if (options.debug_x11_sync)
+ {
+ Error(ERR_WARN, "running in X11 synchronous mode (debug only)");
+
+ XSynchronize(display, True);
+ XSetErrorHandler(X11DebugErrorHandler);
+ }
+
screen = DefaultScreen(display);
visual = DefaultVisual(display, screen);
depth = DefaultDepth(display, screen);
" --serveronly only start network server\n"
" -v, --verbose verbose mode\n"
" --debug display debugging information\n"
+ " --debug-x11-sync enable X11 synchronous mode\n"
" -e, --execute COMMAND execute batch COMMAND\n"
"\n"
"Valid commands for '--execute' option:\n"
/* program information and versioning definitions */
#define PROGRAM_VERSION_MAJOR 3
#define PROGRAM_VERSION_MINOR 2
-#define PROGRAM_VERSION_PATCH 4
-#define PROGRAM_VERSION_BUILD 3
+#define PROGRAM_VERSION_PATCH 5
+#define PROGRAM_VERSION_BUILD 0
#define PROGRAM_TITLE_STRING "Rocks'n'Diamonds"
#define PROGRAM_AUTHOR_STRING "Holger Schemel"
#define PROGRAM_GAME_BY_STRING "A Game by Artsoft Entertainment"
#define PROGRAM_UNIX_DATADIR_STRING ".rocksndiamonds"
-#if CREATE_SPECIAL_EDITION_RND_JUE
+#if defined(CREATE_SPECIAL_EDITION_RND_JUE)
#undef PROGRAM_TITLE_STRING
-#define PROGRAM_TITLE_STRING "R'n'D - jue"
+#define PROGRAM_TITLE_STRING "R'n'D jue"
#undef PROGRAM_UNIX_DATADIR_STRING
-#define PROGRAM_UNIX_DATADIR_STRING ".rocksndiamonds-jue"
+#define PROGRAM_UNIX_DATADIR_STRING ".rnd_jue"
#endif
#define ICON_TITLE_STRING PROGRAM_TITLE_STRING
ClearRectangleOnBackground(drawto, 0, 0, WIN_XSIZE, WIN_YSIZE);
if (DrawingOnBackground(dst_x, dst_y))
+ {
+ SetClipOrigin(bitmap, bitmap->stored_clip_gc, dst_x - src_x, dst_y - src_y);
BlitBitmapMasked(bitmap, drawto, src_x, src_y, width, height, dst_x, dst_y);
+ }
else
BlitBitmap(bitmap, drawto, src_x, src_y, width, height, dst_x, dst_y);
level_nr = leveldir_current->handicap_level;
LoadLevel(level_nr);
+ LoadScore(level_nr);
SetMainBackgroundImage(IMG_BACKGROUND_MAIN);
{ TYPE_YES_NO, &setup.override_level_graphics,"Override Level Graphics:" },
{ TYPE_YES_NO, &setup.override_level_sounds, "Override Level Sounds:" },
{ TYPE_YES_NO, &setup.override_level_music, "Override Level Music:" },
+ { TYPE_YES_NO, &setup.auto_override_artwork, "Auto-Override Non-CE Sets:" },
#else
{ TYPE_STRING, NULL, "Override Level Artwork:"},
{ TYPE_YES_NO, &setup.override_level_graphics, "Graphics:" },
void BackToFront()
{
- int x,y;
+ int x, y;
DrawBuffer *buffer = (drawto_field == window ? backbuffer : drawto_field);
+#if 0
+ printf("::: TILES TO REFRESH: %d\n", redraw_tiles);
+ for (x = 0; x < SCR_FIELDX; x++)
+ for (y = 0 ; y < SCR_FIELDY; y++)
+ if (redraw[redraw_x1 + x][redraw_y1 + y])
+ printf("::: - %d, %d [%s]\n",
+ LEVELX(x), LEVELY(y),
+ EL_NAME(Feld[LEVELX(x)][LEVELY(y)]));
+#endif
+
if (redraw_mask & REDRAW_TILES && redraw_tiles > REDRAWTILES_THRESHOLD)
redraw_mask |= REDRAW_FIELD;
if (!global.fps_slowdown)
info1[0] = '\0';
- sprintf(text, "%.1f fps%s", global.frames_per_second, info1);
+ sprintf(text, "%04.1f fps%s", global.frames_per_second, info1);
+#if 1
+ DrawTextExt(window, SX + SXSIZE + SX, 0, text, FONT_TEXT_2, BLIT_OPAQUE);
+#else
DrawTextExt(window, SX, SY, text, FONT_TEXT_2, BLIT_OPAQUE);
+#endif
}
FlushDisplay();
DrawLevelElementExt(x, y, 0, 0, Feld[x][y], NO_CUTTING, USE_MASKING);
}
+/* !!! implementation of quicksand is totally broken !!! */
+#define IS_CRUMBLED_TILE(x, y, e) \
+ (GFX_CRUMBLED(e) && (!IN_LEV_FIELD(x, y) || \
+ !IS_MOVING(x, y) || \
+ (e) == EL_QUICKSAND_EMPTYING || \
+ (e) == EL_QUICKSAND_FAST_EMPTYING))
+
static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame)
{
Bitmap *src_bitmap;
element = TILE_GFX_ELEMENT(x, y);
/* crumble field itself */
+#if 1
+ if (IS_CRUMBLED_TILE(x, y, element))
+#else
if (GFX_CRUMBLED(element) && !IS_MOVING(x, y))
+#endif
{
if (!IN_SCR_FIELD(sx, sy))
return;
BorderElement);
/* check if neighbour field is of same type */
+#if 1
+ if (IS_CRUMBLED_TILE(xx, yy, element))
+ continue;
+#else
if (GFX_CRUMBLED(element) && !IS_MOVING(xx, yy))
continue;
+#endif
if (i == 1 || i == 2)
{
int sxx = sx + xy[i][0];
int syy = sy + xy[i][1];
+#if 1
+ if (!IN_LEV_FIELD(xx, yy) ||
+ !IN_SCR_FIELD(sxx, syy))
+ continue;
+#else
if (!IN_LEV_FIELD(xx, yy) ||
!IN_SCR_FIELD(sxx, syy) ||
IS_MOVING(xx, yy))
continue;
+#endif
if (Feld[xx][yy] == EL_ELEMENT_SNAPPING)
continue;
element = TILE_GFX_ELEMENT(xx, yy);
+#if 1
+ if (!IS_CRUMBLED_TILE(xx, yy, element))
+ continue;
+#else
if (!GFX_CRUMBLED(element))
continue;
+#endif
graphic = el_act2crm(element, ACTION_DEFAULT);
crumbled_border_size = graphic_info[graphic].border_size;
element = getBorderElement(lx, ly);
DrawScreenElement(x, y, element);
+
return;
}
element == EL_DC_MAGIC_WALL_FILLING)
cut_mode = CUT_BELOW;
+#if 0
+ if (lx == 9 && ly == 1)
+ printf("::: %s [%d] [%d, %d] [%d]\n",
+ EL_NAME(TILE_GFX_ELEMENT(lx, ly)),
+ el_act2crm(TILE_GFX_ELEMENT(lx, ly), ACTION_DEFAULT),
+ element_info[EL_QUICKSAND_EMPTYING].graphic[ACTION_DEFAULT],
+ element_info[EL_QUICKSAND_EMPTYING].crumbled[ACTION_DEFAULT],
+ GFX_CRUMBLED(TILE_GFX_ELEMENT(lx, ly)));
+#endif
+
if (cut_mode == CUT_ABOVE)
+#if 1
+ DrawScreenElement(x, y, element);
+#else
DrawScreenElementShifted(x, y, 0, 0, element, NO_CUTTING);
+#endif
else
DrawScreenElement(x, y, EL_EMPTY);
else if (cut_mode == NO_CUTTING)
DrawScreenElementShifted(x, y, 0, MovPos[lx][ly], element, cut_mode);
else
+ {
DrawScreenElementShifted(x, y, 0, MovPos[lx][ly], content, cut_mode);
+#if 1
+ if (cut_mode == CUT_BELOW &&
+ IN_LEV_FIELD(lx, ly + 1) && IN_SCR_FIELD(x, y + 1))
+ DrawLevelElement(lx, ly + 1, element);
+#endif
+ }
+
if (content == EL_ACID)
{
int dir = MovDir[lx][ly];
{
int x,y;
+#if 1
+ SetMainBackgroundImage(IMG_BACKGROUND_PLAYING);
+ SetDrawBackgroundMask(REDRAW_FIELD);
+#else
SetDrawBackgroundMask(REDRAW_NONE);
+#endif
+
ClearField();
for (x = BX1; x <= BX2; x++)
door_state &= ~DOOR_CLOSE_ALL;
}
+#if 1
+ if (game_status == GAME_MODE_EDITOR)
+ door_state |= DOOR_NO_DELAY;
+#endif
+
if (door_state & DOOR_ACTION)
{
boolean handle_door_1 = (door_state & DOOR_ACTION_1);
Xsand_stonesand_4, FALSE, FALSE,
EL_QUICKSAND_EMPTYING, -1, -1
},
+ {
+ Xsand_stonesand_quickout_1, FALSE, FALSE,
+ EL_QUICKSAND_EMPTYING, -1, -1
+ },
+ {
+ Xsand_stonesand_quickout_2, FALSE, FALSE,
+ EL_QUICKSAND_EMPTYING, -1, -1
+ },
#else
{
Xsand_stonesand_1, FALSE, FALSE,
switch (tile)
{
case Xsand_stonesand_1:
+ case Xsand_stonesand_quickout_1:
case Xsand_sandstone_1:
+ case Xsand_stonein_1:
+ case Xsand_stoneout_1:
case Xboom_1:
case Xdynamite_1:
case Ybug_w_n:
action == ACTION_FILLING ||
action == ACTION_EMPTYING);
+#if 0
+ if (tile == Xsand_stonesand_1 ||
+ tile == Xsand_stonesand_2 ||
+ tile == Xsand_stonesand_3 ||
+ tile == Xsand_stonesand_4)
+ printf("::: 1: quicksand frame %d [%d]\n", GfxFrame[x][y], tile);
+#endif
+
+#if 1
+ if ((action_removing || check_linear_animation_EM(tile)) && frame_em == 0)
+ {
+ GfxFrame[x][y] = 0;
+
+ // printf("::: resetting... [%d]\n", tile);
+ }
+#else
if (action_removing || check_linear_animation_EM(tile))
{
GfxFrame[x][y] = frame_em;
+
+ // printf("::: resetting... [%d]\n", tile);
}
+#endif
else if (action_moving)
{
boolean is_backside = object_mapping[tile].is_backside;
else
{
GfxFrame[x][y]++;
+
+ /* special case: animation for Xsand_stonesand_quickout_1/2 twice as fast */
+ if (tile == Xsand_stonesand_quickout_1 ||
+ tile == Xsand_stonesand_quickout_2)
+ GfxFrame[x][y]++;
}
+#if 0
+ if (tile == Xsand_stonesand_1 ||
+ tile == Xsand_stonesand_2 ||
+ tile == Xsand_stonesand_3 ||
+ tile == Xsand_stonesand_4)
+ printf("::: 2: quicksand frame %d [%d]\n", GfxFrame[x][y], tile);
+#endif
+
#if 1
if (graphic_info[graphic].anim_global_sync)
sync_frame = FrameCounter;