return NULL;
rows = checked_malloc((cave->h) * sizeof(gpointer));
- rows[0] = getMemCopy (maplines[0], cell_size * cave->w * cave->h);
+ rows[0] = get_memcpy (maplines[0], cell_size * cave->w * cave->h);
for (y = 1; y < cave->h; y++)
rows[y] = (char *)rows[0] + cell_size * cave->w * y;
if (cave->tags)
hashtable_destroy(cave->tags);
- if (cave->random) /* random generator is a GRand * */
- g_rand_free(cave->random);
+ if (cave->random) /* random generator is a GdRand * */
+ gd_rand_free(cave->random);
/* free strings */
for (i = 0; gd_cave_properties[i].identifier != NULL; i++)
dest->objects = NULL; /* new empty list */
for (iter = src->objects; iter != NULL; iter = iter->next) /* do a deep copy */
- dest->objects = list_append(dest->objects, getMemCopy (iter->data, sizeof (GdObject)));
+ dest->objects = list_append(dest->objects, get_memcpy (iter->data, sizeof (GdObject)));
}
/* copy replays */
/* copy random number generator */
if (src->random)
- dest->random = g_rand_copy(src->random);
+ dest->random = gd_rand_copy(src->random);
}
/* create new cave, which is a copy of the cave given. */
gd_c64_random_set_seed(&cave->c64_rand, seed1, seed2);
}
-/*
- select random colors for a given cave.
- this function will select colors so that they should look somewhat nice; for example
- brick walls won't be the darkest color, for example.
-*/
-static inline void swap(int *i1, int *i2)
-{
- int t = *i1;
- *i1 = *i2;
- *i2 = t;
-}
-
/*
shrink cave
if last line or last row is just steel wall (or (invisible) outbox).
{
/* blinking and tapping is started at the beginning of animation sequences. */
/* 1/4 chance of blinking, every sequence. */
- player_blinking = g_random_int_range(0, 4) == 0;
+ player_blinking = gd_random_int_range(0, 4) == 0;
/* 1/16 chance of starting or stopping tapping. */
- if (g_random_int_range(0, 16) == 0)
+ if (gd_random_int_range(0, 16) == 0)
player_tapping = !player_tapping;
}
}
{
GdReplay *rep;
- rep = getMemCopy(orig, sizeof(GdReplay));
+ rep = get_memcpy(orig, sizeof(GdReplay));
/* replicate dynamic data */
rep->comment = getStringCopy(orig->comment);