Merge branch 'master' into releases 3.2.5
authorHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:56:31 +0000 (10:56 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:56:31 +0000 (10:56 +0200)
28 files changed:
ChangeLog
Makefile
src/Makefile
src/conf_gfx.c
src/conf_gfx.h
src/conf_var.c
src/conftime.h
src/editor.c
src/files.c
src/game.c
src/game.h
src/game_em/export.h
src/game_em/synchro_2.c
src/init.c
src/libgame/image.c
src/libgame/misc.c
src/libgame/sdl.c
src/libgame/setup.c
src/libgame/sound.c
src/libgame/system.c
src/libgame/system.h
src/libgame/text.c
src/libgame/toons.c
src/libgame/x11.c
src/main.c
src/main.h
src/screens.c
src/tools.c

index 094f98477ef8a1d5263fdead502d719e5757931e..58278f94c7c816077893d4ed7193f7a96934bccf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,53 @@
+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
 
index a7a30e7d962bd053071f0a794fbfae45dacba7ba..ea1154ef1c2ea54566dc97b86ab836b3fda47884 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,7 @@
 # =============================================================================
 # Rocks'n'Diamonds Makefile
 # -----------------------------------------------------------------------------
-# (c) 1995-2006 Holger Schemel <info@artsoft.org>
+# (c) 1995-2007 Holger Schemel <info@artsoft.org>
 # =============================================================================
 
 # -----------------------------------------------------------------------------
@@ -38,8 +38,12 @@ X11_PATH = /usr/X11R6
 # 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
@@ -91,29 +95,25 @@ 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
 
 
 # -----------------------------------------------------------------------------
-# 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
@@ -148,53 +148,66 @@ backup_gfx:
 # 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
index 9fb3a9a961770a329c13d3109410f84c5348b349..6b82fb507336ffd46a8cb74be0b81e533352cfdc 100644 (file)
@@ -10,7 +10,7 @@
 
 .EXPORT_ALL_VARIABLES:
 
-ifndef PLATFORM                        # no platform specified -- try auto detection
+ifndef PLATFORM                                # unknown platform -- try auto detection
 ifdef COMSPEC
 PLATFORM = msdos
 else
@@ -18,7 +18,7 @@ PLATFORM = unix
 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)
@@ -28,39 +28,36 @@ endif
 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
@@ -69,63 +66,84 @@ PLATFORM = unix
 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)
 
@@ -136,9 +154,9 @@ OPTIONS = $(DEBUG) -Wall                    # only for debugging purposes
 # 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
 
@@ -214,8 +232,8 @@ RNDLIBS = $(LIBGAME) $(GAME_EM)
 
 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
@@ -288,6 +306,20 @@ clean-bin:
 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
 # -----------------------------------------------------------------------------
index f3bebdf5960ce02388e8a476cf51f2ce445e6383..fd978dae45dd7b10c2adf267f4656dca2252e810 100644 (file)
@@ -4975,6 +4975,7 @@ struct ConfigInfo image_config[] =
   { "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      },
@@ -5752,6 +5753,15 @@ struct ConfigInfo image_config[] =
   { "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"                },
index cde81fcb49df0f299b42985622187b7e40c1488b..471937df3b308d25fa2f7ce49d90fd395805ae54 100644 (file)
 #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 */
index 4a6389ad826491c77359b4429925038f8c73162b..f0993e6e4832d8c337af80dcc8b067dcb2f36ffe 100644 (file)
@@ -2748,6 +2748,38 @@ struct TokenIntPtrInfo image_config_vars[] =
     "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
index 5926ae2cb526e780330bf9c780daf165a86646a9..44ea4b9515bf1ac62e022134981ecfcc31ccecc0 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "2007-09-13 23:31"
+#define COMPILE_DATE_STRING "2007-10-09 00:21"
index fe8976f21c9254c4ad2cb7c0b14efbb95b1f85be..2fab93d6a7d73b5d5657f22b5b09f32378db25b8 100644 (file)
@@ -4988,10 +4988,36 @@ static void DrawDrawingArea(int id)
 
 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),
@@ -4999,6 +5025,10 @@ static void ScrollMiniLevel(int from_x, int from_y, int scroll)
             (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);
@@ -5012,6 +5042,8 @@ static void ScrollMiniLevel(int from_x, int from_y, int scroll)
       DrawMiniElementOrWall(x, y, from_x, from_y);
   }
 
+  printf("::: ScrollMiniLevel: Z\n");
+
   redraw_mask |= REDRAW_FIELD;
   BackToFront();
 }
@@ -10300,7 +10332,10 @@ static void HandleCounterButtons(struct GadgetInfo *gi)
   if (counter_id == ED_COUNTER_ID_SELECT_LEVEL)
   {
       LoadLevel(level_nr);
+      LoadScore(level_nr);
+
       TapeErase();
+
       ResetUndoBuffer();
       DrawEditModeWindow();
 
index 48fb5865fa9e81004159d5fd03d9365cee25a5ef..3b51e6e28b92236f2126c769e29d3f78f924735a 100644 (file)
@@ -8013,8 +8013,9 @@ void SaveScore(int nr)
 #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
@@ -8142,6 +8143,7 @@ static struct TokenInfo global_setup_tokens[] =
   { 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;
@@ -8290,12 +8292,13 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   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;
@@ -8350,6 +8353,12 @@ static void setSetupInfoToDefaults(struct SetupInfo *si)
   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)
@@ -8968,7 +8977,11 @@ void LoadMenuDesignSettings()
   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);
index 2cd5f41f7c9b42d5e41e3d761fb8affab20bda05..708c0510debe1782b44f865456fb4c26785d6ff9 100644 (file)
 #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
 {
@@ -419,6 +420,11 @@ static struct GamePanelControlInfo game_panel_controls[] =
     &game.panel.score,
     TYPE_INTEGER,
   },
+  {
+    GAME_PANEL_HIGHSCORE,
+    &game.panel.highscore,
+    TYPE_INTEGER,
+  },
   {
     GAME_PANEL_TIME,
     &game.panel.time,
@@ -2078,7 +2084,7 @@ void InitGameControlValues()
 
     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");
     }
 
@@ -2244,6 +2250,7 @@ void UpdateGameControlValues()
   }
 
   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;
 
@@ -7558,10 +7565,18 @@ void StartMoving(int x, int y)
       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;
@@ -7595,10 +7610,18 @@ void StartMoving(int x, int y)
       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;
@@ -8655,7 +8678,7 @@ void ContinueMoving(int x, int y)
   }
 
 #if USE_NEW_CUSTOM_VALUE
-    CustomValue[newx][newy] = CustomValue[x][y];
+  CustomValue[newx][newy] = CustomValue[x][y];
 #endif
 
   ChangeDelay[x][y] = 0;
index c1fb5b127127675c74e5ac749ad53eb9f2d7eccc..f4216805b6606b776b1e06cb562de5db66416b2b 100644 (file)
@@ -42,6 +42,7 @@ struct GamePanelInfo
   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;
index 209872535a9ab391758c7633f247e15d7620ae49..05e7ae65c5d8ce7c5ccec27055d7d3c32d00a0e1 100644 (file)
@@ -353,6 +353,12 @@ enum
   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,
index 7657bf8ddfda096fbbf52f131f4bd540900ec8a8..82ca79b64730c41c3bad652cbb196a3d5c6c68b5 100644 (file)
@@ -4716,6 +4716,16 @@ void synchro_2(void)
        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;
@@ -4724,15 +4734,24 @@ void synchro_2(void)
          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;
@@ -4777,6 +4796,16 @@ void synchro_2(void)
       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;
index 512c2756d2bdb8478cc8d46a9ce99a7deaad5eca..9c89ceb5db0b7137d87db9969c5e95a3b46b8741 100644 (file)
@@ -201,24 +201,41 @@ void DrawInitAnim()
   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;
 
@@ -1237,9 +1254,10 @@ 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)
+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;
 
@@ -1323,6 +1341,13 @@ static void set_graphic_parameters_ext(int graphic, struct GraphicInfo *g,
     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;
 
@@ -1485,8 +1510,7 @@ static void set_graphic_parameters(int graphic)
                                               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
 
@@ -5360,11 +5384,13 @@ static void InitArtworkConfig()
 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;
@@ -5422,6 +5448,7 @@ void InitGfx()
   InitGfxDoor1Info(DX, DY, DXSIZE, DYSIZE);
   InitGfxDoor2Info(VX, VY, VXSIZE, VYSIZE);
   InitGfxScrollbufferInfo(FXSIZE, FYSIZE);
+  InitGfxCustomArtworkInfo();
 
   bitmap_font_initial = LoadCustomImage(filename_font_initial);
 
@@ -5497,13 +5524,38 @@ void InitGfx()
     }
   }
 
-  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;
 
@@ -5550,7 +5602,7 @@ static void InitLevelInfo()
   LoadLevelSetup_SeriesInfo();                 /* last played level info */
 }
 
-void InitLevelArtworkInfo()
+static void InitLevelArtworkInfo()
 {
   LoadLevelArtworkInfo();
 }
@@ -5656,6 +5708,76 @@ void InitNetworkServer()
 #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 };
@@ -5663,7 +5785,11 @@ static char *getNewArtworkIdentifier(int type)
   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
@@ -5780,6 +5906,8 @@ void ReloadCustomArtwork(int force_reload)
   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);
@@ -5952,6 +6080,9 @@ void OpenAll()
   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");
 
index 85a73a54f2a29322acb80ce9e4b9fab4f779ebd7..8ccf1fcbe81350e15ed3502299e481600c109266 100644 (file)
@@ -649,7 +649,11 @@ void ZoomPixmap(Display *display, GC gc, Pixmap src_pixmap, Pixmap dst_pixmap,
 
   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;
@@ -657,7 +661,11 @@ void ZoomPixmap(Display *display, GC gc, Pixmap src_pixmap, Pixmap dst_pixmap,
   }
   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) */
   }
index 3d63cc5c07316f7fa039ed938144e705552ffc75..9d23c75f838c42301f3b44f07ad27d530e9f124b 100644 (file)
@@ -664,6 +664,7 @@ void GetOptions(char *argv[], void (*print_usage_function)(void))
   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 */
@@ -789,6 +790,10 @@ void GetOptions(char *argv[], void (*print_usage_function)(void))
     {
       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)
@@ -2662,11 +2667,21 @@ void LoadArtworkConfig(struct ArtworkListInfo *artwork_info)
     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);
   }
index 66320a5b296d12265eea5b96e13c454eafae1432..ab3ac82d20e80fa80ebb2f1ea29ad41f790a2da0 100644 (file)
@@ -402,8 +402,6 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
   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;
@@ -498,6 +496,7 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
     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);
@@ -520,7 +519,6 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
 
     while (!done)
     {
-      float steps;
       int steps_final;
 
       time_last = time_current;
@@ -610,6 +608,9 @@ void SDLFadeRectangle(Bitmap *bitmap_cross, int x, int y, int width, int height,
   }
   else
   {
+    float alpha;
+    int alpha_final;
+
     for (alpha = 0.0; alpha < 255.0;)
     {
       time_last = time_current;
index df6e2f8a0bc8ebad3299240c2bf449f3786e8307..9d095724b4363edf088ebf8b0928f6741c4ac846 100644 (file)
@@ -262,14 +262,14 @@ static char *getDefaultMusicDir(char *music_subdir)
   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) :
@@ -337,12 +337,18 @@ char *setLevelArtworkDir(TreeInfo *ti)
     *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));
 
@@ -350,8 +356,8 @@ char *setLevelArtworkDir(TreeInfo *ti)
 
     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
     {
@@ -518,7 +524,7 @@ char *getLevelSetTitleMessageFilename(int nr, boolean initial)
 
   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);
@@ -560,7 +566,7 @@ char *getLevelSetTitleMessageFilename(int nr, boolean initial)
   }
 
   /* 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;
 
@@ -615,7 +621,7 @@ char *getCustomImageFilename(char *basename)
 
   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);
@@ -650,7 +656,7 @@ char *getCustomImageFilename(char *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;
 
@@ -661,13 +667,11 @@ char *getCustomImageFilename(char *basename)
   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) */
@@ -688,7 +692,7 @@ char *getCustomSoundFilename(char *basename)
 
   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);
@@ -723,7 +727,7 @@ char *getCustomSoundFilename(char *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;
 
@@ -734,9 +738,12 @@ char *getCustomSoundFilename(char *basename)
   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);
@@ -756,7 +763,7 @@ char *getCustomMusicFilename(char *basename)
 
   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);
@@ -791,7 +798,7 @@ char *getCustomMusicFilename(char *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;
 
@@ -802,9 +809,12 @@ char *getCustomMusicFilename(char *basename)
   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);
@@ -850,7 +860,7 @@ char *getCustomMusicDirectory(void)
 
   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);
@@ -885,7 +895,7 @@ char *getCustomMusicDirectory(void)
   }
 
   /* 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;
 
@@ -3501,7 +3511,7 @@ void LoadArtworkInfo()
     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);
 
@@ -3509,7 +3519,7 @@ void LoadArtworkInfo()
     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);
 
@@ -3517,7 +3527,7 @@ void LoadArtworkInfo()
     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);
 
@@ -3627,7 +3637,7 @@ void LoadLevelArtworkInfo()
       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);
   }
@@ -3638,7 +3648,7 @@ void LoadLevelArtworkInfo()
       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);
   }
@@ -3649,7 +3659,7 @@ void LoadLevelArtworkInfo()
       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);
   }
@@ -3825,6 +3835,13 @@ void LoadLevelSetup_LastSeries()
   /* 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 =
index b80cccab57ca3636078e1d8af1e23fb376d2f97e..d620dd93d0614b38ac5dfff9244d3abb518d5f7b 100644 (file)
@@ -474,8 +474,8 @@ static void WriteReloadInfoToPipe(char *set_identifier, int type)
   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;
@@ -534,8 +534,8 @@ static void ReadReloadInfoFromPipe(SoundControl *snd_ctrl)
   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);
 
index 9ed186f1e8143312974f1a4ea0c9807a50030d00..7a6618eb9176dc7b08b8de21a9a5891c50c0e25b 100644 (file)
@@ -201,6 +201,15 @@ void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void))
   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;
@@ -375,16 +384,18 @@ Bitmap *CreateBitmapStruct(void)
 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;
 }
index db3c511833ca2d1cb4bab202bb9709f9b363d74b..28e5a2eaf8a6395656e09f0ea84753d5aed7df34 100644 (file)
@@ -48,9 +48,6 @@
 #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 :                  \
@@ -648,6 +656,7 @@ struct OptionInfo
   boolean network;
   boolean verbose;
   boolean debug;
+  boolean debug_x11_sync;
 };
 
 struct ScreenModeInfo
@@ -725,6 +734,12 @@ struct GfxInfo
   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);
@@ -858,6 +873,7 @@ struct SetupInfo
   boolean override_level_graphics;
   boolean override_level_sounds;
   boolean override_level_music;
+  boolean auto_override_artwork;
 
   struct SetupEditorInfo editor;
   struct SetupEditorCascadeInfo editor_cascade;
@@ -1131,6 +1147,7 @@ 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 InitGfxCustomArtworkInfo();
 void SetDrawDeactivationMask(int);
 void SetDrawBackgroundMask(int);
 void SetWindowBackgroundBitmap(Bitmap *);
index f5e9c0666d504c6b5917b5f96c303626506caf4b..f0cdb01adaecedd75fb3325b440ba40dd840b1dd 100644 (file)
@@ -203,6 +203,7 @@ void DrawInitTextExt(char *text, int ypos, int font_nr, boolean force)
     return;
 
   if (window != NULL &&
+      gfx.draw_init_text &&
       gfx.num_fonts > 0 &&
       gfx.font_bitmap_info[font_nr].bitmap != NULL)
   {
index 2a233e4cbb847f1e3c101bfd7d78ad60c5f6cc4d..300ae70bf3da93d4f8505d87896424cc7bc3ae13 100644 (file)
@@ -149,9 +149,6 @@ void DrawAnim(Bitmap *toon_bitmap, GC toon_clip_gc,
         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)
   {
index 12f4e1e4268cabf8e8b39591d442bc67905d3f99..fe022c5bf3f8ddb1f50d9d8c7b776c4f7694894b 100644 (file)
 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 */
@@ -55,6 +62,14 @@ static void X11InitDisplay()
     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);
index a86ed44786697fa199b13b2a539126caa2ba3103..aae4944aace422cf3f208817a530c3be47c35015 100644 (file)
@@ -5524,6 +5524,7 @@ static void print_usage()
         "      --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"
index 69b9b501cdccf10d5ac49d4921d0978388a5d36b..763195b9b7aa6db58295ea39d476d1c243ba294f 100644 (file)
 /* 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
index ec482ba103a418556d8560a9f1dae19642673a35..0d162f25ad657553682f4caef1220b34abab48f8 100644 (file)
@@ -1141,7 +1141,10 @@ void DrawTitleScreenImage(int nr, boolean initial)
   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);
 
@@ -1293,6 +1296,7 @@ void DrawMainMenuExt(int fade_mask, boolean do_fading)
     level_nr = leveldir_current->handicap_level;
 
   LoadLevel(level_nr);
+  LoadScore(level_nr);
 
   SetMainBackgroundImage(IMG_BACKGROUND_MAIN);
 
@@ -4202,6 +4206,7 @@ static struct TokenInfo setup_info_artwork[] =
   { 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:"     },
index 7e2c3752d3a63f193abf5f86c2d66bdb1d659797..b26add564164aa3468f02f09a5e8bb8c9cf2fff5 100644 (file)
@@ -257,9 +257,19 @@ void DrawMaskedBorder(int redraw_mask)
 
 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;
 
@@ -427,8 +437,12 @@ void BackToFront()
     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();
@@ -1364,6 +1378,13 @@ void DrawLevelFieldThruMask(int x, int y)
   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;
@@ -1386,7 +1407,11 @@ static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame)
   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;
@@ -1402,8 +1427,13 @@ static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame)
                 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)
       {
@@ -1435,18 +1465,29 @@ static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame)
       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;
@@ -1600,6 +1641,7 @@ void DrawScreenField(int x, int y)
       element = getBorderElement(lx, ly);
 
     DrawScreenElement(x, y, element);
+
     return;
   }
 
@@ -1625,8 +1667,22 @@ void DrawScreenField(int x, int y)
             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);
 
@@ -1635,8 +1691,16 @@ void DrawScreenField(int x, int y)
     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];
@@ -1891,7 +1955,13 @@ void DrawLevel()
 {
   int x,y;
 
+#if 1
+  SetMainBackgroundImage(IMG_BACKGROUND_PLAYING);
+  SetDrawBackgroundMask(REDRAW_FIELD);
+#else
   SetDrawBackgroundMask(REDRAW_NONE);
+#endif
+
   ClearField();
 
   for (x = BX1; x <= BX2; x++)
@@ -3148,6 +3218,11 @@ unsigned int MoveDoor(unsigned int door_state)
     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);
@@ -4813,6 +4888,14 @@ em_object_mapping_list[] =
     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,
@@ -6024,7 +6107,10 @@ inline static boolean check_linear_animation_EM(int tile)
   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:
@@ -6117,10 +6203,29 @@ void SetGfxAnimation_EM(struct GraphicInfo_EM *g_em,
                             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;
@@ -6145,8 +6250,21 @@ void SetGfxAnimation_EM(struct GraphicInfo_EM *g_em,
   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;