From 0548cd8fd0353c19608df8a7079fc2c39cc4ce27 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Sat, 15 Feb 2003 00:08:47 +0100 Subject: [PATCH] rnd-20030215-1-src --- src/Makefile | 3 ++- src/conf_e2g.c | 12 ------------ src/conf_esg.c | 24 ++++++++++++++++++++++++ src/conftime.h | 2 +- src/files.c | 2 +- src/init.c | 6 ++++-- src/libgame/misc.c | 5 +++++ src/libgame/pcx.c | 11 +++++++++++ src/libgame/toons.c | 6 +++++- src/netserv.c | 2 +- 10 files changed, 54 insertions(+), 19 deletions(-) diff --git a/src/Makefile b/src/Makefile index 89e04758..c994eaa9 100644 --- a/src/Makefile +++ b/src/Makefile @@ -106,7 +106,8 @@ DEBUG = -DDEBUG -g # PROFILING = $(PROFILING_FLAGS) # OPTIONS = $(DEBUG) -Wall # only for debugging purposes -OPTIONS = $(DEBUG) -O3 -Wall # only for debugging purposes +# OPTIONS = $(DEBUG) -O3 -Wall # only for debugging purposes +OPTIONS = $(DEBUG) -Wall # only for debugging purposes # OPTIONS = $(DEBUG) -Wall -ansi -pedantic # only for debugging purposes # OPTIONS = -O3 -Wall -ansi -pedantic # OPTIONS = -O3 -Wall diff --git a/src/conf_e2g.c b/src/conf_e2g.c index 176701b6..82d0051f 100644 --- a/src/conf_e2g.c +++ b/src/conf_e2g.c @@ -2252,10 +2252,6 @@ element_to_graphic[] = EL_ARROW_RED_DOWN, -1, -1, IMG_ARROW_RED_DOWN }, - { - EL_BUG, -1, -1, - IMG_BUG_RIGHT - }, { EL_DOOR_WHITE, -1, -1, IMG_CHAR_QUESTION @@ -2292,10 +2288,6 @@ element_to_graphic[] = EL_KEY_WHITE, -1, -1, IMG_CHAR_QUESTION }, - { - EL_PACMAN, -1, -1, - IMG_PACMAN_RIGHT - }, { EL_SIGN_EXIT, -1, -1, IMG_CHAR_QUESTION @@ -2336,10 +2328,6 @@ element_to_graphic[] = EL_SIGN_YINYANG, -1, -1, IMG_CHAR_QUESTION }, - { - EL_SPACESHIP, -1, -1, - IMG_SPACESHIP_RIGHT - }, { EL_CHAR_SPACE, -1, -1, IMG_CHAR_SPACE diff --git a/src/conf_esg.c b/src/conf_esg.c index eb9aa0f0..83ddda90 100644 --- a/src/conf_esg.c +++ b/src/conf_esg.c @@ -223,6 +223,30 @@ element_to_special_graphic[] = EL_INVISIBLE_STEELWALL_VERTICAL, GFX_SPECIAL_ARG_EDITOR, IMG_INVISIBLE_STEELWALL_VERTICAL_EDITOR }, + { + EL_BUG, GFX_SPECIAL_ARG_EDITOR, + IMG_BUG_RIGHT + }, + { + EL_BUG, GFX_SPECIAL_ARG_PREVIEW, + IMG_BUG_RIGHT + }, + { + EL_PACMAN, GFX_SPECIAL_ARG_EDITOR, + IMG_PACMAN_RIGHT + }, + { + EL_PACMAN, GFX_SPECIAL_ARG_PREVIEW, + IMG_PACMAN_RIGHT + }, + { + EL_SPACESHIP, GFX_SPECIAL_ARG_EDITOR, + IMG_SPACESHIP_RIGHT + }, + { + EL_SPACESHIP, GFX_SPECIAL_ARG_PREVIEW, + IMG_SPACESHIP_RIGHT + }, { -1, -1, -1 diff --git a/src/conftime.h b/src/conftime.h index 6fe78b7f..49fba991 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-02-11 10:29]" +#define COMPILE_DATE_STRING "[2003-02-15 00:07]" diff --git a/src/files.c b/src/files.c index 902b3b89..a0e20357 100644 --- a/src/files.c +++ b/src/files.c @@ -1493,7 +1493,7 @@ static void setSetupInfoToDefaults(struct SetupInfo *si) si->editor.el_diamond_caves = TRUE; si->editor.el_dx_boulderdash = TRUE; si->editor.el_chars = TRUE; - si->editor.el_custom = FALSE; + si->editor.el_custom = TRUE; si->shortcut.save_game = DEFAULT_KEY_SAVE_GAME; si->shortcut.load_game = DEFAULT_KEY_LOAD_GAME; diff --git a/src/init.c b/src/init.c index cf6987db..862365fa 100644 --- a/src/init.c +++ b/src/init.c @@ -977,13 +977,14 @@ static void set_graphic_parameters(int graphic, char **parameter_raw) static void InitGraphicInfo() { - static boolean clipmasks_initialized = FALSE; int fallback_graphic = IMG_CHAR_EXCLAM; struct FileInfo *fallback_image = getImageListEntry(fallback_graphic); Bitmap *fallback_bitmap = getBitmapFromImageID(fallback_graphic); int num_images = getImageListSize(); int i; + #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) + static boolean clipmasks_initialized = FALSE; Pixmap src_pixmap; XGCValues clip_gc_values; unsigned long clip_gc_valuemask; @@ -1105,6 +1106,7 @@ static void InitGraphicInfo() clip_gc_values.graphics_exposures = False; clip_gc_values.clip_mask = graphic_info[i].clip_mask; clip_gc_valuemask = GCGraphicsExposures | GCClipMask; + graphic_info[i].clip_gc = XCreateGC(display, window->drawable, clip_gc_valuemask, &clip_gc_values); #endif @@ -1113,9 +1115,9 @@ static void InitGraphicInfo() #if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND) if (copy_clipmask_gc) XFreeGC(display, copy_clipmask_gc); -#endif clipmasks_initialized = TRUE; +#endif } static void InitElementSoundInfo() diff --git a/src/libgame/misc.c b/src/libgame/misc.c index f35620c2..d68316d8 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -537,6 +537,11 @@ void GetOptions(char *argv[]) options.verbose = FALSE; options.debug = FALSE; +#if !defined(PLATFORM_UNIX) + if (*options_left == NULL) /* no options given -- enable verbose mode */ + options.verbose = TRUE; +#endif + while (*options_left) { char option_str[MAX_OPTION_LEN]; diff --git a/src/libgame/pcx.c b/src/libgame/pcx.c index 97923314..7756b240 100644 --- a/src/libgame/pcx.c +++ b/src/libgame/pcx.c @@ -122,14 +122,23 @@ static boolean PCX_ReadBitmap(FILE *file, struct PCX_Header *pcx, Image *image) if (count == 0) { if ((value_int = fgetc(file)) == EOF) + { + free(row_buffer); return FALSE; + } + value = (byte)value_int; if ((value & 0xc0) == 0xc0) /* this is a repeat count byte */ { count = value & 0x3f; /* extract repeat count from byte */ + if ((value_int = fgetc(file)) == EOF) + { + free(row_buffer); return FALSE; + } + value = (byte)value_int; } else @@ -186,6 +195,8 @@ static boolean PCX_ReadBitmap(FILE *file, struct PCX_Header *pcx, Image *image) bitmap_ptr += image->bytes_per_row; } + free(row_buffer); + return TRUE; } diff --git a/src/libgame/toons.c b/src/libgame/toons.c index c8c71e3a..94c72152 100644 --- a/src/libgame/toons.c +++ b/src/libgame/toons.c @@ -317,6 +317,10 @@ void HandleAnimation(int mode) if (!setup.toons) return; + /* this may happen after reloading graphics and redefining "num_toons" */ + if (toon_nr >= screen_info.num_toons) + anim_restart = TRUE; + switch(mode) { case ANIM_START: @@ -359,7 +363,7 @@ void HandleAnimation(int mode) toon_nr = SimpleRND(screen_info.num_toons); } - anim_restart = reset_delay = AnimateToon(toon_nr,anim_restart); + anim_restart = reset_delay = AnimateToon(toon_nr, anim_restart); } void InitAnimation() diff --git a/src/netserv.c b/src/netserv.c index 21a48572..58c32a6e 100644 --- a/src/netserv.c +++ b/src/netserv.c @@ -478,7 +478,7 @@ void NetworkServer(int port, int serveronly) if (is_daemon) { /* become a daemon, breaking all ties with the controlling terminal */ - options.verbose = 0; + options.verbose = FALSE; for (i=0; i<255; i++) { if (i != lfd) -- 2.34.1