-2007-10-04
+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)
# -----------------------------------------------------------------------------
-# development only
+# development, test, distribution build and packaging targets
# -----------------------------------------------------------------------------
auto-conf:
# 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
CONFIG_GAME = $(CONFIG_GAME_DIR) $(CONFIG_SCORE_ENTRIES) $(CONFIG_SPECIAL)
CONFIG = $(CONFIG_GAME) $(JOYSTICK)
-DEBUG = -DDEBUG -g
+# DEBUG = -DDEBUG -g
# PROFILING = $(PROFILING_FLAGS)
# OPTIONS = $(DEBUG) -Wall # only for debugging purposes
-#define COMPILE_DATE_STRING "2007-10-03 23:58"
+#define COMPILE_DATE_STRING "2007-10-09 00:21"
# =============================================================================
# Rocks'n'Diamonds Makefile (game_em)
# -----------------------------------------------------------------------------
-# (c) 1995-2006 Holger Schemel <info@artsoft.org>
+# (c) 1995-2005 Holger Schemel <info@artsoft.org>
# -----------------------------------------------------------------------------
# Emerald Mine for X11 © 2000,2001 David Tritscher
# =============================================================================
static void InitMixer()
{
OpenAudio();
+
StartMixer();
}
LoadLevelSetup_SeriesInfo(); /* last played level info */
}
-void InitLevelArtworkInfo()
+static void InitLevelArtworkInfo()
{
LoadLevelArtworkInfo();
}
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)
if (filename_local != NULL && !strEqual(filename_base, filename_local))
redefined_ce_found |= CheckArtworkConfigForCustomElements(filename_local);
-#if 0
- printf("::: redefined_ce_found == %d\n", redefined_ce_found);
-#endif
-
if (!redefined_ce_found)
{
gfx.override_level_graphics = TRUE;
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)
#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) */
#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);
#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);
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;
}
boolean network;
boolean verbose;
boolean debug;
+ boolean debug_x11_sync;
};
struct ScreenModeInfo
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"
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);
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;