break;
case GD_TYPE_ELEMENT:
- appendStringPrint(&line, "%s", gd_elements[((GdElement *) value)[j]].filename);
+ appendStringPrint(&line, "%s", gd_element_properties[((GdElement *) value)[j]].filename);
if (((GdElement *) value)[j] != ((GdElement *) default_value)[j])
should_write = TRUE;
break;
// for effects, the property identifier is the effect name.
// "Effect=" is hardcoded; see above.
appendStringPrint(&line, "%s %s", prop_desc[i].identifier,
- gd_elements[((GdElement *) value)[j]].filename);
+ gd_element_properties[((GdElement *) value)[j]].filename);
if (((GdElement *) value)[j] != ((GdElement *) default_value)[j])
should_write = TRUE;
break;
{
// check if character is non-zero;
// the ...save() should have assigned a character to every element
- if (gd_elements[cave->map[y][x]].character_new == 0)
- Warn("gd_elements[cave->map[y][x]].character_new should be non-zero");
+ if (gd_element_properties[cave->map[y][x]].character_new == 0)
+ Warn("gd_element_properties[cave->map[y][x]].character_new should be non-zero");
- line[x] = gd_elements[cave->map[y][x]].character_new;
+ line[x] = gd_element_properties[cave->map[y][x]].character_new;
}
gd_ptr_array_add(out, getStringCopy(line));
// check if we need an own mapcode table ------
// copy original characters to character_new fields; new elements will be added to that one
for (i = 0; i < O_MAX; i++)
- gd_elements[i].character_new = gd_elements[i].character;
+ gd_element_properties[i].character_new = gd_element_properties[i].character;
// also regenerate this table as we use it
gd_create_char_to_element_table();
GdElement e = cave->map[y][x];
// if no character assigned
- if (gd_elements[e].character_new == 0)
+ if (gd_element_properties[e].character_new == 0)
{
int j;
if (j == 128)
Warn("variable j should be != 128");
- gd_elements[e].character_new = j;
+ gd_element_properties[e].character_new = j;
// we also record to this table, as we use it ^^ a few lines above
gd_char_to_element[j] = e;
for (i = 0; i < O_MAX; i++)
{
// if no character assigned by specification BUT (AND) we assigned one
- if (gd_elements[i].character == 0 && gd_elements[i].character_new != 0)
- gd_ptr_array_add(out, getStringPrint("%c=%s", gd_elements[i].character_new, gd_elements[i].filename));
+ if (gd_element_properties[i].character == 0 && gd_element_properties[i].character_new != 0)
+ gd_ptr_array_add(out, getStringPrint("%c=%s", gd_element_properties[i].character_new, gd_element_properties[i].filename));
}
gd_ptr_array_add(out, getStringCopy("[/mapcodes]"));
// then set fixed characters
for (i = 0; i < O_MAX; i++)
{
- int c = gd_elements[i].character;
+ int c = gd_element_properties[i].character;
if (c)
{
for (i = 0; i < O_MAX; i++)
{
- char *key_1 = getStringToUpper(gd_elements[i].filename);
+ char *key_1 = getStringToUpper(gd_element_properties[i].filename);
if (hashtable_exists(name_to_element, key_1)) // hash value may be 0
Warn("Name %s already used for element %x", key_1, i);
for (x = 0; x < O_MAX_ALL; x++)
{
elemmapping[x] = x;
- elemdrawing[x] = gd_elements[x].image_game;
+ elemdrawing[x] = gd_element_properties[x].image_game;
}
if (bonus_life_flash)
{
elemmapping[O_SPACE] = O_FAKE_BONUS;
- elemdrawing[O_SPACE] = gd_elements[O_FAKE_BONUS].image_game;
+ elemdrawing[O_SPACE] = gd_element_properties[O_FAKE_BONUS].image_game;
}
elemmapping[O_MAGIC_WALL] = (cave->magic_wall_state == GD_MW_ACTIVE ? O_MAGIC_WALL : O_BRICK);
- elemdrawing[O_MAGIC_WALL] = gd_elements[cave->magic_wall_state == GD_MW_ACTIVE ? O_MAGIC_WALL : O_BRICK].image_game;
+ elemdrawing[O_MAGIC_WALL] = gd_element_properties[cave->magic_wall_state == GD_MW_ACTIVE ? O_MAGIC_WALL : O_BRICK].image_game;
elemmapping[O_CREATURE_SWITCH] = (cave->creatures_backwards ? O_CREATURE_SWITCH_ON : O_CREATURE_SWITCH);
- elemdrawing[O_CREATURE_SWITCH] = gd_elements[cave->creatures_backwards ? O_CREATURE_SWITCH_ON : O_CREATURE_SWITCH].image_game;
+ elemdrawing[O_CREATURE_SWITCH] = gd_element_properties[cave->creatures_backwards ? O_CREATURE_SWITCH_ON : O_CREATURE_SWITCH].image_game;
elemmapping[O_EXPANDING_WALL_SWITCH] = (cave->expanding_wall_changed ? O_EXPANDING_WALL_SWITCH_VERT : O_EXPANDING_WALL_SWITCH_HORIZ);
- elemdrawing[O_EXPANDING_WALL_SWITCH] = gd_elements[cave->expanding_wall_changed ? O_EXPANDING_WALL_SWITCH_VERT : O_EXPANDING_WALL_SWITCH_HORIZ].image_game;
+ elemdrawing[O_EXPANDING_WALL_SWITCH] = gd_element_properties[cave->expanding_wall_changed ? O_EXPANDING_WALL_SWITCH_VERT : O_EXPANDING_WALL_SWITCH_HORIZ].image_game;
elemmapping[O_GRAVITY_SWITCH] = (cave->gravity_switch_active ? O_GRAVITY_SWITCH_ACTIVE : O_GRAVITY_SWITCH);
- elemdrawing[O_GRAVITY_SWITCH] = gd_elements[cave->gravity_switch_active ? O_GRAVITY_SWITCH_ACTIVE : O_GRAVITY_SWITCH].image_game;
+ elemdrawing[O_GRAVITY_SWITCH] = gd_element_properties[cave->gravity_switch_active ? O_GRAVITY_SWITCH_ACTIVE : O_GRAVITY_SWITCH].image_game;
elemmapping[O_REPLICATOR_SWITCH] = (cave->replicators_active ? O_REPLICATOR_SWITCH_ON : O_REPLICATOR_SWITCH_OFF);
- elemdrawing[O_REPLICATOR_SWITCH] = gd_elements[cave->replicators_active ? O_REPLICATOR_SWITCH_ON : O_REPLICATOR_SWITCH_OFF].image_game;
+ elemdrawing[O_REPLICATOR_SWITCH] = gd_element_properties[cave->replicators_active ? O_REPLICATOR_SWITCH_ON : O_REPLICATOR_SWITCH_OFF].image_game;
if (cave->replicators_active)
// if the replicators are active, animate them.
elemdrawing[O_REPLICATOR] = ABS(elemdrawing[O_REPLICATOR]);
elemmapping[O_CONVEYOR_SWITCH] = (cave->conveyor_belts_active ? O_CONVEYOR_SWITCH_ON : O_CONVEYOR_SWITCH_OFF);
- elemdrawing[O_CONVEYOR_SWITCH] = gd_elements[cave->conveyor_belts_active ? O_CONVEYOR_SWITCH_ON : O_CONVEYOR_SWITCH_OFF].image_game;
+ elemdrawing[O_CONVEYOR_SWITCH] = gd_element_properties[cave->conveyor_belts_active ? O_CONVEYOR_SWITCH_ON : O_CONVEYOR_SWITCH_OFF].image_game;
if (cave->conveyor_belts_direction_changed)
{
elemdrawing[O_CONVEYOR_RIGHT] = temp;
elemmapping[O_CONVEYOR_DIR_SWITCH] = O_CONVEYOR_DIR_CHANGED;
- elemdrawing[O_CONVEYOR_DIR_SWITCH] = gd_elements[O_CONVEYOR_DIR_CHANGED].image_game;
+ elemdrawing[O_CONVEYOR_DIR_SWITCH] = gd_element_properties[O_CONVEYOR_DIR_CHANGED].image_game;
}
else
{
elemmapping[O_CONVEYOR_DIR_SWITCH] = O_CONVEYOR_DIR_NORMAL;
- elemdrawing[O_CONVEYOR_DIR_SWITCH] = gd_elements[O_CONVEYOR_DIR_NORMAL].image_game;
+ elemdrawing[O_CONVEYOR_DIR_SWITCH] = gd_element_properties[O_CONVEYOR_DIR_NORMAL].image_game;
}
if (cave->conveyor_belts_active)
if (player_blinking && player_tapping)
{
map = O_PLAYER_TAP_BLINK;
- draw = gd_elements[O_PLAYER_TAP_BLINK].image_game;
+ draw = gd_element_properties[O_PLAYER_TAP_BLINK].image_game;
}
else if (player_blinking)
{
map = O_PLAYER_BLINK;
- draw = gd_elements[O_PLAYER_BLINK].image_game;
+ draw = gd_element_properties[O_PLAYER_BLINK].image_game;
}
else if (player_tapping)
{
map = O_PLAYER_TAP;
- draw = gd_elements[O_PLAYER_TAP].image_game;
+ draw = gd_element_properties[O_PLAYER_TAP].image_game;
}
else
{
map = O_PLAYER;
- draw = gd_elements[O_PLAYER].image_game;
+ draw = gd_element_properties[O_PLAYER].image_game;
}
}
else if (cave->last_direction == GD_MV_UP && use_bd_up_down_graphics())
{
map = O_PLAYER_UP;
- draw = gd_elements[O_PLAYER_UP].image_game;
+ draw = gd_element_properties[O_PLAYER_UP].image_game;
}
else if (cave->last_direction == GD_MV_DOWN && use_bd_up_down_graphics())
{
map = O_PLAYER_DOWN;
- draw = gd_elements[O_PLAYER_DOWN].image_game;
+ draw = gd_element_properties[O_PLAYER_DOWN].image_game;
}
else if (cave->last_horizontal_direction == GD_MV_LEFT)
{
map = O_PLAYER_LEFT;
- draw = gd_elements[O_PLAYER_LEFT].image_game;
+ draw = gd_element_properties[O_PLAYER_LEFT].image_game;
}
else
{
// of course this is GD_MV_RIGHT.
map = O_PLAYER_RIGHT;
- draw = gd_elements[O_PLAYER_RIGHT].image_game;
+ draw = gd_element_properties[O_PLAYER_RIGHT].image_game;
}
elemmapping[O_PLAYER] = map;
}
elemmapping[O_INBOX] = (cave->inbox_flash_toggle ? O_INBOX_OPEN : O_INBOX_CLOSED);
- elemdrawing[O_INBOX] = gd_elements[cave->inbox_flash_toggle ? O_OUTBOX_OPEN : O_OUTBOX_CLOSED].image_game;
+ elemdrawing[O_INBOX] = gd_element_properties[cave->inbox_flash_toggle ? O_OUTBOX_OPEN : O_OUTBOX_CLOSED].image_game;
elemmapping[O_OUTBOX] = (cave->inbox_flash_toggle ? O_OUTBOX_OPEN : O_OUTBOX_CLOSED);
- elemdrawing[O_OUTBOX] = gd_elements[cave->inbox_flash_toggle ? O_OUTBOX_OPEN : O_OUTBOX_CLOSED].image_game;
+ elemdrawing[O_OUTBOX] = gd_element_properties[cave->inbox_flash_toggle ? O_OUTBOX_OPEN : O_OUTBOX_CLOSED].image_game;
- // hack, not fit into gd_elements
+ // hack, not fit into gd_element_properties
elemmapping[O_BITER_SWITCH] = O_BITER_SWITCH_1 + cave->biter_delay_frame;
- // hack, not fit into gd_elements
- elemdrawing[O_BITER_SWITCH] = gd_elements[O_BITER_SWITCH].image_game + cave->biter_delay_frame;
+ // hack, not fit into gd_element_properties
+ elemdrawing[O_BITER_SWITCH] = gd_element_properties[O_BITER_SWITCH].image_game + cave->biter_delay_frame;
// visual effects
elemmapping[O_DIRT] = cave->dirt_looks_like;
// if covered, real element is not important
if (actual & COVERED)
- draw = gd_elements[O_COVERED].image_game;
+ draw = gd_element_properties[O_COVERED].image_game;
else
draw = elemdrawing[actual];
for (y = 0; y < cave->h; y++)
for (x = 0; x < cave->w; x++)
{
- *a += gd_elements[cave->map[y][x] & O_MASK].character;
+ *a += gd_element_properties[cave->map[y][x] & O_MASK].character;
*b += *a;
*a %= 65521;
extern const GdColor gd_flash_color;
extern const GdColor gd_select_color;
-enum _element_property
+enum _element_property_enum
{
E_P_SLOPED_LEFT, // stones and diamonds roll down to left on this
E_P_SLOPED_RIGHT, // stones and diamonds roll down to right on this
// ELEMENTS DESCRIPTION
-typedef struct _elements
+typedef struct _element_property
{
GdElement element; // element number. for example O_DIRT
+ // In the array, should be equal to the index of the array item.
char *name; // name in editor, for example "Dirt". some have
// different names than their real engine meaning!
unsigned int properties; // engine properties, like P_SLOPED or P_EXPLODES
// generated inside the game.
char character_new; // character given automatically for elements which
// don't have one defined in original bdcff description
-} GdElements;
+} GdElementProperty;
typedef char GdString[MAX_LINE_LEN];
indexes which are in the png have to be given as numeric constants.
for generated cells (ie. guard + an arrow), use the above enum
*/
-GdElements gd_elements[] =
+GdElementProperty gd_element_properties[] =
{
{
O_SPACE, N_("Space"),
lowercase_names = FALSE;
// check element database for faults.
- for (i = 0; gd_elements[i].element != -1; i++)
+ for (i = 0; gd_element_properties[i].element != -1; i++)
{
- if (gd_elements[i].element != i)
- Error("element: i:0x%x != 0x%x", i, gd_elements[i].element);
+ if (gd_element_properties[i].element != i)
+ Error("element: i:0x%x != 0x%x", i, gd_element_properties[i].element);
// if it has a name, create a lowercase name (of the translated one).
// will be used by the editor
- if (gd_elements[i].name)
+ if (gd_element_properties[i].name)
{
if (lowercase_names)
// the function allocates a new string, but it is needed as long as the app is running
- gd_elements[i].lowercase_name = getStringToLower(gettext(gd_elements[i].name));
+ gd_element_properties[i].lowercase_name = getStringToLower(gettext(gd_element_properties[i].name));
else
// only translate, no lowercase.
- gd_elements[i].lowercase_name = gettext(gd_elements[i].name);
+ gd_element_properties[i].lowercase_name = gettext(gd_element_properties[i].name);
}
// we do not like generated pixbufs for games. only those that are in the png.
- if (ABS(gd_elements[i].image_game) > GD_NUM_OF_CELLS_X * GD_NUM_OF_CELLS_Y)
- Error("game pixbuf for element %x (%s) bigger than png size", i, gd_elements[i].name);
+ if (ABS(gd_element_properties[i].image_game) > GD_NUM_OF_CELLS_X * GD_NUM_OF_CELLS_Y)
+ Error("game pixbuf for element %x (%s) bigger than png size", i, gd_element_properties[i].name);
- if (gd_elements[i].image < 0)
- Error("editor pixbuf for element %x (%s) should not be animated", i, gd_elements[i].name);
+ if (gd_element_properties[i].image < 0)
+ Error("editor pixbuf for element %x (%s) should not be animated", i, gd_element_properties[i].name);
- if (gd_elements[i].properties & P_CAN_BE_HAMMERED && gd_element_get_hammered((GdElement) i) == O_NONE)
- Error("element %x (%s) can be hammered, but get_hammered_element does not define another one", i, gd_elements[i].name);
+ if (gd_element_properties[i].properties & P_CAN_BE_HAMMERED && gd_element_get_hammered((GdElement) i) == O_NONE)
+ Error("element %x (%s) can be hammered, but get_hammered_element does not define another one", i, gd_element_properties[i].name);
}
/*
#include "bd_cave.h"
-extern GdElements gd_elements[];
+extern GdElementProperty gd_element_properties[];
extern const GdStructDescriptor gd_cave_properties[];
extern const GdStructDescriptor gd_replay_properties[];
// returns true if the element can fall
static inline boolean el_can_fall(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_CAN_FALL) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_CAN_FALL) != 0;
}
// returns true if the element is diggable
static inline boolean el_diggable(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_DIGGABLE) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_DIGGABLE) != 0;
}
// returns true if the element can smash the player
static inline boolean explodes_by_hit_dir(const GdCave *cave, const int x,
const int y, GdDirection dir)
{
- return (gd_elements[get_dir(cave, x, y, dir) & O_MASK].properties & P_EXPLODES_BY_HIT) != 0;
+ return (gd_element_properties[get_dir(cave, x, y, dir) & O_MASK].properties & P_EXPLODES_BY_HIT) != 0;
}
// returns true if the element is not explodable, for example the steel wall
static inline boolean non_explodable(const GdCave *cave, const int x, const int y)
{
- return (gd_elements[get(cave, x,y) & O_MASK].properties & P_NON_EXPLODABLE) != 0;
+ return (gd_element_properties[get(cave, x,y) & O_MASK].properties & P_NON_EXPLODABLE) != 0;
}
// returns true if the element can be eaten by the amoeba, eg. space and dirt.
static inline boolean amoeba_eats_dir(const GdCave *cave, const int x, const int y,
const GdDirection dir)
{
- return (gd_elements[get_dir(cave, x, y, dir) & O_MASK].properties & P_AMOEBA_CONSUMES) != 0;
+ return (gd_element_properties[get_dir(cave, x, y, dir) & O_MASK].properties & P_AMOEBA_CONSUMES) != 0;
}
// returns true if the element is sloped, so stones and diamonds roll down on it.
switch (slop)
{
case GD_MV_LEFT:
- return (gd_elements[get_dir(cave, x, y, dir) & O_MASK].properties & P_SLOPED_LEFT) != 0;
+ return (gd_element_properties[get_dir(cave, x, y, dir) & O_MASK].properties & P_SLOPED_LEFT) != 0;
case GD_MV_RIGHT:
- return (gd_elements[get_dir(cave, x, y, dir) & O_MASK].properties & P_SLOPED_RIGHT) != 0;
+ return (gd_element_properties[get_dir(cave, x, y, dir) & O_MASK].properties & P_SLOPED_RIGHT) != 0;
case GD_MV_UP:
- return (gd_elements[get_dir(cave, x, y, dir) & O_MASK].properties & P_SLOPED_UP) != 0;
+ return (gd_element_properties[get_dir(cave, x, y, dir) & O_MASK].properties & P_SLOPED_UP) != 0;
case GD_MV_DOWN:
- return (gd_elements[get_dir(cave, x, y, dir) & O_MASK].properties & P_SLOPED_DOWN) != 0;
+ return (gd_element_properties[get_dir(cave, x, y, dir) & O_MASK].properties & P_SLOPED_DOWN) != 0;
default:
break;
static inline boolean sloped_for_bladder_dir (const GdCave *cave, const int x, const int y,
const GdDirection dir)
{
- return (gd_elements[get_dir(cave, x, y, dir) & O_MASK].properties & P_BLADDER_SLOPED) != 0;
+ return (gd_element_properties[get_dir(cave, x, y, dir) & O_MASK].properties & P_BLADDER_SLOPED) != 0;
}
static inline boolean blows_up_flies_dir(const GdCave *cave, const int x, const int y,
const GdDirection dir)
{
- return (gd_elements[get_dir(cave, x, y, dir) & O_MASK].properties & P_BLOWS_UP_FLIES) != 0;
+ return (gd_element_properties[get_dir(cave, x, y, dir) & O_MASK].properties & P_BLOWS_UP_FLIES) != 0;
}
// returns true if the element is a counter-clockwise creature
static inline boolean rotates_ccw (const GdCave *cave, const int x, const int y)
{
- return (gd_elements[get(cave, x, y) & O_MASK].properties & P_CCW) != 0;
+ return (gd_element_properties[get(cave, x, y) & O_MASK].properties & P_CCW) != 0;
}
// returns true if the element is a player
boolean is_player(const GdCave *cave, const int x, const int y)
{
- return (gd_elements[get(cave, x, y) & O_MASK].properties & P_PLAYER) != 0;
+ return (gd_element_properties[get(cave, x, y) & O_MASK].properties & P_PLAYER) != 0;
}
// returns true if the element is a player
static inline boolean is_player_dir(const GdCave *cave, const int x, const int y,
const GdDirection dir)
{
- return (gd_elements[get_dir(cave, x, y, dir) & O_MASK].properties & P_PLAYER) != 0;
+ return (gd_element_properties[get_dir(cave, x, y, dir) & O_MASK].properties & P_PLAYER) != 0;
}
static inline boolean can_be_hammered_dir(const GdCave *cave, const int x, const int y,
const GdDirection dir)
{
- return (gd_elements[get_dir(cave, x, y, dir) & O_MASK].properties & P_CAN_BE_HAMMERED) != 0;
+ return (gd_element_properties[get_dir(cave, x, y, dir) & O_MASK].properties & P_CAN_BE_HAMMERED) != 0;
}
// returns true if the element can be pushed
boolean can_be_pushed_dir(const GdCave *cave, const int x, const int y,
const GdDirection dir)
{
- return (gd_elements[get_dir(cave, x, y, dir) & O_MASK].properties & P_PUSHABLE) != 0;
+ return (gd_element_properties[get_dir(cave, x, y, dir) & O_MASK].properties & P_PUSHABLE) != 0;
}
// returns true if the element is explodable and explodes to space, for example the player
static inline boolean is_first_stage_of_explosion(const GdCave *cave, const int x, const int y)
{
- return (gd_elements[get(cave, x, y) & O_MASK].properties & P_EXPLOSION_FIRST_STAGE) != 0;
+ return (gd_element_properties[get(cave, x, y) & O_MASK].properties & P_EXPLOSION_FIRST_STAGE) != 0;
}
// returns true if the element is moved by the conveyor belt
static inline boolean moved_by_conveyor_top_dir(const GdCave *cave, const int x, const int y,
const GdDirection dir)
{
- return (gd_elements[get_dir(cave, x, y, dir) & O_MASK].properties & P_MOVED_BY_CONVEYOR_TOP) != 0;
+ return (gd_element_properties[get_dir(cave, x, y, dir) & O_MASK].properties & P_MOVED_BY_CONVEYOR_TOP) != 0;
}
// returns true if the element is moved by the conveyor belt
static inline boolean moved_by_conveyor_bottom_dir(const GdCave *cave, const int x, const int y,
const GdDirection dir)
{
- return (gd_elements[get_dir(cave, x, y, dir) & O_MASK].properties & P_MOVED_BY_CONVEYOR_BOTTOM) != 0;
+ return (gd_element_properties[get_dir(cave, x, y, dir) & O_MASK].properties & P_MOVED_BY_CONVEYOR_BOTTOM) != 0;
}
static inline boolean is_scanned_dir(const GdCave *cave, const int x, const int y,
GdElement examined = get_dir(cave, x, y, dir);
// if it is a dirt-like, change to dirt, so equality will evaluate to true
- if (gd_elements[examined & O_MASK].properties & P_DIRT)
+ if (gd_element_properties[examined & O_MASK].properties & P_DIRT)
examined = O_DIRT;
- if (gd_elements[e & O_MASK].properties & P_DIRT)
+ if (gd_element_properties[e & O_MASK].properties & P_DIRT)
e = O_DIRT;
// if the element on the map is a lava, it should be like space
}
// add the ckdelay correction value for every element seen.
- cave->ckdelay += gd_elements[get(cave, x, y) & O_MASK].ckdelay;
+ cave->ckdelay += gd_element_properties[get(cave, x, y) & O_MASK].ckdelay;
switch (get(cave, x, y))
{
for (x = 0; x < cave->w; x++)
{
// add the ckdelay correction value for every element seen.
- cave->ckdelay += gd_elements[get(cave, x, y) & O_MASK].ckdelay;
+ cave->ckdelay += gd_element_properties[get(cave, x, y) & O_MASK].ckdelay;
}
}
switch (object->type)
{
case GD_POINT:
- return getStringPrint("Point=%d %d %s", object->x1, object->y1, gd_elements[object->element].filename);
+ return getStringPrint("Point=%d %d %s", object->x1, object->y1, gd_element_properties[object->element].filename);
case GD_LINE:
- return getStringPrint("Line=%d %d %d %d %s", object->x1, object->y1, object->x2, object->y2, gd_elements[object->element].filename);
+ return getStringPrint("Line=%d %d %d %d %s", object->x1, object->y1, object->x2, object->y2, gd_element_properties[object->element].filename);
case GD_RECTANGLE:
- return getStringPrint("Rectangle=%d %d %d %d %s", object->x1, object->y1, object->x2, object->y2, gd_elements[object->element].filename);
+ return getStringPrint("Rectangle=%d %d %d %d %s", object->x1, object->y1, object->x2, object->y2, gd_element_properties[object->element].filename);
case GD_FILLED_RECTANGLE:
// if elements are not the same
if (object->fill_element!=object->element)
- return getStringPrint("FillRect=%d %d %d %d %s %s", object->x1, object->y1, object->x2, object->y2, gd_elements[object->element].filename, gd_elements[object->fill_element].filename);
+ return getStringPrint("FillRect=%d %d %d %d %s %s", object->x1, object->y1, object->x2, object->y2, gd_element_properties[object->element].filename, gd_element_properties[object->fill_element].filename);
// they are the same
- return getStringPrint("FillRect=%d %d %d %d %s", object->x1, object->y1, object->x2, object->y2, gd_elements[object->element].filename);
+ return getStringPrint("FillRect=%d %d %d %d %s", object->x1, object->y1, object->x2, object->y2, gd_element_properties[object->element].filename);
case GD_RASTER:
- return getStringPrint("Raster=%d %d %d %d %d %d %s", object->x1, object->y1, (object->x2-object->x1)/object->dx+1, (object->y2-object->y1)/object->dy+1, object->dx, object->dy, gd_elements[object->element].filename);
+ return getStringPrint("Raster=%d %d %d %d %d %d %s", object->x1, object->y1, (object->x2-object->x1)/object->dx+1, (object->y2-object->y1)/object->dy+1, object->dx, object->dy, gd_element_properties[object->element].filename);
case GD_JOIN:
- return getStringPrint("Add=%d %d %s %s", object->dx, object->dy, gd_elements[object->element].filename, gd_elements[object->fill_element].filename);
+ return getStringPrint("Add=%d %d %s %s", object->dx, object->dy, gd_element_properties[object->element].filename, gd_element_properties[object->fill_element].filename);
case GD_FLOODFILL_BORDER:
- return getStringPrint("BoundaryFill=%d %d %s %s", object->x1, object->y1, gd_elements[object->fill_element].filename, gd_elements[object->element].filename);
+ return getStringPrint("BoundaryFill=%d %d %s %s", object->x1, object->y1, gd_element_properties[object->fill_element].filename, gd_element_properties[object->element].filename);
case GD_FLOODFILL_REPLACE:
- return getStringPrint("FloodFill=%d %d %s %s", object->x1, object->y1, gd_elements[object->fill_element].filename, gd_elements[object->element].filename);
+ return getStringPrint("FloodFill=%d %d %s %s", object->x1, object->y1, gd_element_properties[object->fill_element].filename, gd_element_properties[object->element].filename);
case GD_MAZE:
case GD_MAZE_UNICURSAL:
break;
}
- return getStringPrint("Maze=%d %d %d %d %d %d %d %d %d %d %d %d %s %s %s", object->x1, object->y1, object->x2, object->y2, object->dx, object->dy, object->horiz, object->seed[0], object->seed[1], object->seed[2], object->seed[3], object->seed[4], gd_elements[object->element].filename, gd_elements[object->fill_element].filename, type);
+ return getStringPrint("Maze=%d %d %d %d %d %d %d %d %d %d %d %d %s %s %s", object->x1, object->y1, object->x2, object->y2, object->dx, object->dy, object->horiz, object->seed[0], object->seed[1], object->seed[2], object->seed[3], object->seed[4], gd_element_properties[object->element].filename, gd_element_properties[object->fill_element].filename, type);
case GD_RANDOM_FILL:
- appendStringPrint(&str, "%s=%d %d %d %d %d %d %d %d %d %s", object->c64_random?"RandomFillC64":"RandomFill", object->x1, object->y1, object->x2, object->y2, object->seed[0], object->seed[1], object->seed[2], object->seed[3], object->seed[4], gd_elements[object->fill_element].filename);
+ appendStringPrint(&str, "%s=%d %d %d %d %d %d %d %d %d %s", object->c64_random?"RandomFillC64":"RandomFill", object->x1, object->y1, object->x2, object->y2, object->seed[0], object->seed[1], object->seed[2], object->seed[3], object->seed[4], gd_element_properties[object->fill_element].filename);
// seed and initial fill
for (j = 0; j < 4; j++)
if (object->random_fill_probability[j] != 0)
- appendStringPrint(&str, " %s %d", gd_elements[object->random_fill[j]].filename, object->random_fill_probability[j]);
+ appendStringPrint(&str, " %s %d", gd_element_properties[object->random_fill[j]].filename, object->random_fill_probability[j]);
if (object->element != O_NONE)
- appendStringPrint(&str, " %s", gd_elements[object->element].filename);
+ appendStringPrint(&str, " %s", gd_element_properties[object->element].filename);
return str;
// returns true if the element is a player
static inline boolean el_player(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_PLAYER) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_PLAYER) != 0;
}
#if 0
// returns true if the element is walkable
static inline boolean el_walkable(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_WALKABLE) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_WALKABLE) != 0;
}
#endif
// returns true if the element is diggable
static inline boolean el_diggable(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_DIGGABLE) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_DIGGABLE) != 0;
}
#if 0
// returns true if the element is collectible
static inline boolean el_collectible(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_COLLECTIBLE) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_COLLECTIBLE) != 0;
}
#endif
// returns true if the element is pushable
static inline boolean el_pushable(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_PUSHABLE) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_PUSHABLE) != 0;
}
// returns true if the element can move
static inline boolean el_can_move(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_CAN_MOVE) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_CAN_MOVE) != 0;
}
// returns true if the element can fall
static inline boolean el_can_fall(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_CAN_FALL) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_CAN_FALL) != 0;
}
// returns true if the element can grow
static inline boolean el_can_grow(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_CAN_GROW) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_CAN_GROW) != 0;
}
// returns true if the element can dig
static inline boolean el_can_dig(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_CAN_DIG) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_CAN_DIG) != 0;
}
// returns true if the element can fall
static inline boolean el_falling(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_FALLING) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_FALLING) != 0;
}
// returns true if the element is growing
static inline boolean el_growing(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_GROWING) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_GROWING) != 0;
}
// returns true if the element is exploding
static inline boolean el_explosion(const int element)
{
- return (gd_elements[element & O_MASK].properties & P_EXPLOSION) != 0;
+ return (gd_element_properties[element & O_MASK].properties & P_EXPLOSION) != 0;
}
static inline boolean el_smooth_movable(const int element)
draw, frame,
new_x, new_y,
old_x, old_y,
- gd_elements[draw].name);
+ gd_element_properties[draw].name);
}
}
#endif