+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)
# =============================================================================
# Rocks'n'Diamonds Makefile
# -----------------------------------------------------------------------------
-# (c) 1995-2007 Holger Schemel <info@artsoft.org>
+# (c) 1995-2013 Holger Schemel <info@artsoft.org>
# =============================================================================
# -----------------------------------------------------------------------------
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 .
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
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
$(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
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
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
{ "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" },
-#define COMPILE_DATE_STRING "2013-09-16 20:53"
+#define COMPILE_DATE_STRING "2013-10-23 22:33"
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';
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"))
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';
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';
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++)
{
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;
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;
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");
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)
{
#include <dirent.h>
#include <signal.h>
#include <math.h>
+#include <errno.h>
#include "platform.h"
for (i = 0; i < audio.num_channels; i++)
{
- void *sample_ptr;
+ // void *sample_ptr;
int sample_len;
int sample_pos;
int sample_size;
}
/* 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);
}
/* 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);
/* 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"
#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;
}
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);
#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;
}