#include <glib.h>
#include "bd_elements.h"
+#include "bd_random.h"
// colors
for example diamond + arrow = falling diamond */
#define GD_NUM_OF_CELLS (GD_NUM_OF_CELLS_X*GD_NUM_OF_CELLS_Y+80)
+/* maximum replay size (maximum seconds x game cycles per second) */
+#define MAX_REPLAY_LEN (10000 * FRAMES_PER_SECOND / 8)
+
extern const GdColor gd_flash_color;
extern const GdColor gd_select_color;
int score;
} GdHighScore;
+typedef struct _replay_movements
+{
+ unsigned char data[MAX_REPLAY_LEN];
+ unsigned int len;
+} GdReplayMovements;
+
/* maximum seed value for the cave random generator. should be smaller than a signed int. */
#define GD_CAVE_SEED_MAX (1 << 30)
guint32 checksum; /* checksum of the rendered cave. */
boolean wrong_checksum;
- GByteArray *movements;
+ GdReplayMovements *movements;
int current_playing_pos;
} GdReplay;
boolean hatched; /* hatching has happened. (timers may run, ...) */
boolean gate_open; /* self-explaining */
guint32 render_seed; /* the seed value, which was used to render the cave, is saved here. will be used by record&playback */
- GRand *random; /* random number generator of rendered cave */
+ GdRand *random; /* random number generator of rendered cave */
int rendered; /* if not zero, rendered at level x */
int timing_factor; /* number of "milliseconds" in each second :) 1000 for ntsc, 1200 for pal. */
gpointer **objects_order; /* two-dimensional map of cave; each cell is a pointer to the drawing object, which created this element. NULL if map or random. */
boolean bonus_life_flash, int animcycle, boolean hate_invisible_outbox);
/* function to copy a GdString */
-static inline int
-gd_strcpy(GdString dest, const GdString src)
+static inline char *gd_strcpy(GdString dest, const GdString src)
{
- return g_strlcpy(dest, src, sizeof(GdString));
+ return strncpy(dest, src, sizeof(GdString));
}
int gd_cave_time_show(const GdCave *cave, int internal_time);