From: Holger Schemel Date: Wed, 23 Oct 2013 20:33:49 +0000 (+0200) Subject: rocksndiamonds-3.3.1.0 X-Git-Tag: 3.3.1.0^2 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c91aa2b237bef6003ead8dfc98cdcab89f97c654;p=rocksndiamonds.git rocksndiamonds-3.3.1.0 * version 3.3.1.0 released * version number set to 3.3.1.0 --- diff --git a/ChangeLog b/ChangeLog index 48c60341..0ae29c85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2013-10-23 + * version 3.3.1.0 released + +2013-10-21 + * version number set to 3.3.1.0 + 2012-10-13 * fixed display of level time switching from ascending to descending when making use of the "time orb bug" (see element setting in editor) diff --git a/Makefile b/Makefile index 75fde6be..b2d8476c 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ # ============================================================================= # Rocks'n'Diamonds Makefile # ----------------------------------------------------------------------------- -# (c) 1995-2007 Holger Schemel +# (c) 1995-2013 Holger Schemel # ============================================================================= # ----------------------------------------------------------------------------- @@ -175,6 +175,9 @@ dist-build-win32: dist-build-macosx: # (this is done by "dist-package-macosx" target) +dist-build-macosx-ppc: + # (this is done by "dist-package-macosx-ppc" target) + dist-package-unix: ./Scripts/make_dist.sh unix . @@ -187,6 +190,9 @@ dist-package-win32: dist-package-macosx: ./Scripts/make_dist.sh mac . $(MAKE) +dist-package-macosx-ppc: + ./Scripts/make_dist.sh mac-ppc . $(MAKE) + dist-upload-unix: ./Scripts/make_dist.sh unix . upload @@ -199,6 +205,9 @@ dist-upload-win32: dist-upload-macosx: ./Scripts/make_dist.sh mac . upload +dist-upload-macosx-ppc: + ./Scripts/make_dist.sh mac-ppc . upload + dist-build-all: $(MAKE) clean $(MAKE) dist-build-unix ; $(MAKE) dist-clean @@ -209,12 +218,14 @@ dist-package-all: $(MAKE) dist-package-unix $(MAKE) dist-package-win32 $(MAKE) dist-package-macosx + $(MAKE) dist-package-macosx-ppc # $(MAKE) dist-package-msdos dist-upload-all: $(MAKE) dist-upload-unix $(MAKE) dist-upload-win32 $(MAKE) dist-upload-macosx + $(MAKE) dist-upload-macosx-ppc # $(MAKE) dist-upload-msdos dist-all: dist-build-all dist-package-all diff --git a/src/Makefile b/src/Makefile index 9820c4de..3a9230f2 100644 --- a/src/Makefile +++ b/src/Makefile @@ -110,7 +110,7 @@ endif 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 +SDL_LIBS = -lSDL_image -lSDL_mixer -lSDL_net -lsmpeg -lmikmod SYS_LDFLAGS = $(SDL_LIBS) $(shell sdl-config --static-libs) endif @@ -146,7 +146,7 @@ CONFIG_GAME_DIR = $(CONFIG_RO_GAME_DIR) $(CONFIG_RW_GAME_DIR) 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 diff --git a/src/conf_gfx.c b/src/conf_gfx.c index c7ea0459..b04ca43f 100644 --- a/src/conf_gfx.c +++ b/src/conf_gfx.c @@ -5169,11 +5169,11 @@ struct ConfigInfo image_config[] = { "editor.element_border_input.ypos", "7" }, { "editor.cascade_list", "RocksMore.pcx" }, - { "editor.cascade_list.xpos", "10" }, + { "editor.cascade_list.xpos", "9" }, { "editor.cascade_list.ypos", "8" }, { "editor.cascade_list.frames", "1" }, { "editor.cascade_list.active", "RocksMore.pcx" }, - { "editor.cascade_list.active.xpos", "9" }, + { "editor.cascade_list.active.xpos", "10" }, { "editor.cascade_list.active.ypos", "8" }, { "editor.cascade_list.active.frames", "1" }, diff --git a/src/conftime.h b/src/conftime.h index 5dbe469e..304aecb5 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "2013-09-16 20:53" +#define COMPILE_DATE_STRING "2013-10-23 22:33" diff --git a/src/files.c b/src/files.c index 21aea238..7ff37822 100644 --- a/src/files.c +++ b/src/files.c @@ -3364,7 +3364,8 @@ static void LoadLevelFromFileInfo_RND(struct LevelInfo *level, else /* check for pre-2.0 file format with cookie string */ { strcpy(cookie, chunk_name); - fgets(&cookie[4], MAX_LINE_LEN - 4, file); + if (fgets(&cookie[4], MAX_LINE_LEN - 4, file) == NULL) + cookie[4] = '\0'; if (strlen(cookie) > 0 && cookie[strlen(cookie) - 1] == '\n') cookie[strlen(cookie) - 1] = '\0'; @@ -6416,7 +6417,8 @@ static void LoadLevelFromFileInfo_DC(struct LevelInfo *level, if (level_file_info->packed) { /* read "magic bytes" from start of file */ - fgets(magic_bytes, num_magic_bytes + 1, file); + if (fgets(magic_bytes, num_magic_bytes + 1, file) == NULL) + magic_bytes[0] = '\0'; /* check "magic bytes" for correct file format */ if (!strPrefix(magic_bytes, "DC2")) @@ -8799,7 +8801,8 @@ void LoadTapeFromFilename(char *filename) else /* check for pre-2.0 file format with cookie string */ { strcpy(cookie, chunk_name); - fgets(&cookie[4], MAX_LINE_LEN - 4, file); + if (fgets(&cookie[4], MAX_LINE_LEN - 4, file) == NULL) + cookie[4] = '\0'; if (strlen(cookie) > 0 && cookie[strlen(cookie) - 1] == '\n') cookie[strlen(cookie) - 1] = '\0'; @@ -9142,7 +9145,8 @@ void LoadScore(int nr) return; /* check file identifier */ - fgets(cookie, MAX_LINE_LEN, file); + if (fgets(cookie, MAX_LINE_LEN, file) == NULL) + cookie[0] = '\0'; if (strlen(cookie) > 0 && cookie[strlen(cookie) - 1] == '\n') cookie[strlen(cookie) - 1] = '\0'; @@ -9155,10 +9159,12 @@ void LoadScore(int nr) for (i = 0; i < MAX_SCORE_ENTRIES; i++) { - fscanf(file, "%d", &highscore[i].Score); - fgets(line, MAX_LINE_LEN, file); + if (fscanf(file, "%d", &highscore[i].Score) == EOF) + Error(ERR_WARN, "fscanf() failed; %s", strerror(errno)); + if (fgets(line, MAX_LINE_LEN, file) == NULL) + line[0] = '\0'; - if (line[strlen(line) - 1] == '\n') + if (strlen(line) > 0 && line[strlen(line) - 1] == '\n') line[strlen(line) - 1] = '\0'; for (line_ptr = line; *line_ptr; line_ptr++) diff --git a/src/game_em/sound.c b/src/game_em/sound.c index 9ed5ac3d..f03abf1e 100644 --- a/src/game_em/sound.c +++ b/src/game_em/sound.c @@ -65,7 +65,7 @@ int sound_thread(void) { int audio_fd; /* file descriptor of /dev/audio or -1 if not open */ int audio_format; - int sample_rate; + // int sample_rate; int fragment_size; unsigned char *audio_buffer; /* actual buffer pumped to /dev/audio */ short *mix_buffer; @@ -80,7 +80,7 @@ int sound_thread(void) audio_fd = -1; audio_format = AUDIO_ULAW; /* defaults for non-OSS /dev/audio */ - sample_rate = 8000; + // sample_rate = 8000; fragment_size = 256; audio_buffer = 0; mix_buffer = 0; @@ -242,7 +242,7 @@ int sound_thread(void) goto reset; } - sample_rate = i; + // sample_rate = i; if (ioctl(audio_fd, SNDCTL_DSP_GETBLKSIZE, &i) == -1) { Error(ERR_WARN, "unable to get block size in sound thread"); diff --git a/src/libgame/misc.c b/src/libgame/misc.c index 4c94b778..60dbcf06 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -1193,7 +1193,8 @@ boolean getFileChunk(FILE *file, char *chunk_name, int *chunk_size, const int chunk_name_length = 4; /* read chunk name */ - fgets(chunk_name, chunk_name_length + 1, file); + if (fgets(chunk_name, chunk_name_length + 1, file) == NULL) + return FALSE; if (chunk_size != NULL) { diff --git a/src/libgame/sound.c b/src/libgame/sound.c index 0d7ed67c..ff42562a 100644 --- a/src/libgame/sound.c +++ b/src/libgame/sound.c @@ -19,6 +19,7 @@ #include #include #include +#include #include "platform.h" @@ -1152,7 +1153,7 @@ static void Mixer_Main_DSP() for (i = 0; i < audio.num_channels; i++) { - void *sample_ptr; + // void *sample_ptr; int sample_len; int sample_pos; int sample_size; @@ -1167,7 +1168,7 @@ static void Mixer_Main_DSP() } /* pointer, lenght and actual playing position of sound sample */ - sample_ptr = mixer[i].data_ptr; + // sample_ptr = mixer[i].data_ptr; sample_len = mixer[i].data_len; sample_pos = mixer[i].playing_pos; sample_size = MIN(max_sample_size, sample_len - sample_pos); @@ -1265,7 +1266,8 @@ static void Mixer_Main_DSP() } /* finally play the sound fragment */ - write(audio.device_fd, playing_buffer, fragment_size); + if (write(audio.device_fd, playing_buffer, fragment_size) == -1) + Error(ERR_WARN, "write() failed; %s", strerror(errno)); if (!mixer_active_channels) CloseAudioDevice(&audio.device_fd); diff --git a/src/main.h b/src/main.h index 75d882b4..434d3c93 100644 --- a/src/main.h +++ b/src/main.h @@ -2065,8 +2065,8 @@ /* program information and versioning definitions */ #define PROGRAM_VERSION_MAJOR 3 #define PROGRAM_VERSION_MINOR 3 -#define PROGRAM_VERSION_PATCH 0 -#define PROGRAM_VERSION_BUILD 2 +#define PROGRAM_VERSION_PATCH 1 +#define PROGRAM_VERSION_BUILD 0 #define PROGRAM_TITLE_STRING "Rocks'n'Diamonds" #define PROGRAM_AUTHOR_STRING "Holger Schemel" diff --git a/src/netserv.c b/src/netserv.c index 4a834923..b895a303 100644 --- a/src/netserv.c +++ b/src/netserv.c @@ -97,7 +97,8 @@ static void flushuser(struct NetworkServerPlayerInfo *player) #if defined(TARGET_SDL) SDLNet_TCP_Send(player->fd, player->writbuffer, player->nwrite); #else - write(player->fd, player->writbuffer, player->nwrite); + if (write(player->fd, player->writbuffer, player->nwrite) == -1) + Error(ERR_WARN, "write() failed; %s", strerror(errno)); #endif player->nwrite = 0; } @@ -586,7 +587,8 @@ void NetworkServer(int port, int serveronly) setsid(); if (fork()) exit(0); - chdir("/"); + if (chdir("/") == -1) + Error(ERR_WARN, "chdir() failed; %s", strerror(errno)); /* open a fake stdin, stdout, stderr, just in case */ open("/dev/null", O_RDONLY); diff --git a/src/network.c b/src/network.c index 9c149138..b13e4c9a 100644 --- a/src/network.c +++ b/src/network.c @@ -87,7 +87,8 @@ static void SendBufferToServer(int size) #if defined(TARGET_SDL) SDLNet_TCP_Send(sfd, writbuffer, nwrite); #else - write(sfd, writbuffer, nwrite); + if (write(sfd, writbuffer, nwrite) == -1) + Error(ERR_WARN, "write() failed; %s", strerror(errno)); #endif nwrite = 0; }