# =============================================================================
# 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
.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
-#define COMPILE_DATE_STRING "2007-09-27 09:57"
+#define COMPILE_DATE_STRING "2007-09-30 19:56"
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->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)
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;
}
-#if 1
-static char *getDefaultArtworkSet(int type)
-{
- return (type == TREE_TYPE_GRAPHICS_DIR ? "gfx_classic" :
- type == TREE_TYPE_SOUNDS_DIR ? "snd_classic" :
- type == TREE_TYPE_MUSIC_DIR ? "mus_classic" : "");
-}
-
-static char *getDefaultArtworkDir(int type)
-{
- return (type == TREE_TYPE_GRAPHICS_DIR ?
- getDefaultGraphicsDir("gfx_classic") :
- type == TREE_TYPE_SOUNDS_DIR ?
- getDefaultSoundsDir("snd_classic") :
- type == TREE_TYPE_MUSIC_DIR ?
- getDefaultMusicDir("mus_classic") : "");
-}
-
-#else
-
-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) :
type == TREE_TYPE_MUSIC_DIR ?
getDefaultMusicDir(MUS_CLASSIC_SUBDIR) : "");
}
-#endif
static char *getUserGraphicsDir()
{
*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
{
}
/* 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;
}
/* 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 !!! */
}
/* 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);
/* 6th try: look for fallback artwork in old default artwork directory */
}
/* 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);
/* 6th try: look for fallback artwork in old default artwork 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 CREATE_SPECIAL_EDITION_RND_JUE
+#if defined(CREATE_SPECIAL_EDITION_RND_JUE)
leveldir_current = getTreeInfoFromIdentifier(leveldir_first,
"jue_start");
if (leveldir_current == NULL)
#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"
#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
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();