X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Fgame_bd%2Fbd_caveobject.h;h=13dbcffd006c2f6b43a70543a5848a902acacc34;hb=refs%2Fheads%2Fmaster-next-major-release;hp=5b2a3f7e7bf554fd3c779f7be585a2144d67f44f;hpb=d2b7c541271aec188c9394af58cdb8d9f66d88b9;p=rocksndiamonds.git diff --git a/src/game_bd/bd_caveobject.h b/src/game_bd/bd_caveobject.h index 5b2a3f7e..13dbcffd 100644 --- a/src/game_bd/bd_caveobject.h +++ b/src/game_bd/bd_caveobject.h @@ -17,27 +17,25 @@ #ifndef BD_CAVEOBJECT_H #define BD_CAVEOBJECT_H -#include - #include "bd_cave.h" typedef enum _gd_object_type { - NONE, /* this one to be zero. */ - GD_POINT, /* single point of object1 */ - GD_LINE, /* line from (1) to (2) of object1 */ - GD_RECTANGLE, /* rectangle with corners (1) and (2) of object1 */ - GD_FILLED_RECTANGLE, /* rectangle with corners (1) and (2) of object1, filled with object2 */ - GD_RASTER, /* aligned plots */ - GD_JOIN, /* every object1 has an object2 next to it, relative (dx,dy) */ - GD_FLOODFILL_REPLACE, /* fill by replacing */ - GD_FLOODFILL_BORDER, /* fill to another element, a border */ - GD_MAZE, /* maze */ - GD_MAZE_UNICURSAL, /* unicursal maze */ - GD_MAZE_BRAID, /* braid maze */ - GD_RANDOM_FILL, /* random fill */ - GD_COPY_PASTE, /* copy & paste with optional mirror and flip */ + NONE, // this one to be zero. + GD_POINT, // single point of object1 + GD_LINE, // line from (1) to (2) of object1 + GD_RECTANGLE, // rectangle with corners (1) and (2) of object1 + GD_FILLED_RECTANGLE, // rectangle with corners (1) and (2) of object1, filled with object2 + GD_RASTER, // aligned plots + GD_JOIN, // every object1 has an object2 next to it, relative (dx,dy) + GD_FLOODFILL_REPLACE, // fill by replacing + GD_FLOODFILL_BORDER, // fill to another element, a border + GD_MAZE, // maze + GD_MAZE_UNICURSAL, // unicursal maze + GD_MAZE_BRAID, // braid maze + GD_RANDOM_FILL, // random fill + GD_COPY_PASTE, // copy & paste with optional mirror and flip } GdObjectType; typedef enum _gd_object_levels @@ -59,20 +57,20 @@ extern GdObjectLevels gd_levels_mask[]; typedef struct _gd_object { - GdObjectType type; /* type */ - GdObjectLevels levels; /* levels to show this object on */ + GdObjectType type; // type + GdObjectLevels levels; // levels to show this object on - int x1, y1; /* (first) coordinate */ - int x2, y2; /* second coordinate */ - int dx, dy; /* distance of elements for raster or join */ - GdElement element, fill_element; /* element type */ + int x1, y1; // (first) coordinate + int x2, y2; // second coordinate + int dx, dy; // distance of elements for raster or join + GdElement element, fill_element; // element type - gint32 seed[5]; /* for maze and random fill */ - int horiz; /* for maze */ + int seed[5]; // for maze and random fill + int horiz; // for maze - boolean mirror, flip; /* for copy */ + boolean mirror, flip; // for copy - boolean c64_random; /* random fill objects: use c64 random generator */ + boolean c64_random; // random fill objects: use c64 random generator GdElement random_fill[4]; int random_fill_probability[4]; @@ -86,16 +84,17 @@ GdObject *gd_object_new_raster(GdObjectLevels levels, int x1, int y1, int x2, in GdObject *gd_object_new_join(GdObjectLevels levels, int dx, int dy, GdElement search, GdElement replace); GdObject *gd_object_new_floodfill_border(GdObjectLevels levels, int x1, int y1, GdElement fill, GdElement border); GdObject *gd_object_new_floodfill_replace(GdObjectLevels levels, int x1, int y1, GdElement fill, GdElement to_replace); -GdObject *gd_object_new_maze(GdObjectLevels levels, int x1, int y1, int x2, int y2, int wall_w, int path_w, GdElement wall_e, GdElement path_e, int horiz_percent, const gint32 seed[5]); -GdObject *gd_object_new_maze_unicursal(GdObjectLevels levels, int x1, int y1, int x2, int y2, int wall_w, int path_w, GdElement wall_e, GdElement path_e, int horiz_percent, const gint32 seed[5]); -GdObject *gd_object_new_maze_braid(GdObjectLevels levels, int x1, int y1, int x2, int y2, int wall_w, int path_w, GdElement wall_e, GdElement path_e, int horiz_percent, const gint32 seed[5]); -GdObject *gd_object_new_random_fill(GdObjectLevels levels, int x1, int y1, int x2, int y2, const gint32 seed[5], GdElement initial, const GdElement random[4], const gint32 prob[4], GdElement replace_only, boolean c64); +GdObject *gd_object_new_maze(GdObjectLevels levels, int x1, int y1, int x2, int y2, int wall_w, int path_w, GdElement wall_e, GdElement path_e, int horiz_percent, const int seed[5]); +GdObject *gd_object_new_maze_unicursal(GdObjectLevels levels, int x1, int y1, int x2, int y2, int wall_w, int path_w, GdElement wall_e, GdElement path_e, int horiz_percent, const int seed[5]); +GdObject *gd_object_new_maze_braid(GdObjectLevels levels, int x1, int y1, int x2, int y2, int wall_w, int path_w, GdElement wall_e, GdElement path_e, int horiz_percent, const int seed[5]); +GdObject *gd_object_new_random_fill(GdObjectLevels levels, int x1, int y1, int x2, int y2, const int seed[5], GdElement initial, const GdElement random[4], const int prob[4], GdElement replace_only, boolean c64); GdObject *gd_object_new_copy_paste(GdObjectLevels levels, int x1, int y1, int x2, int y2, int dx, int dy, boolean mirror, boolean flip); void gd_cave_draw_object(GdCave *cave, const GdObject *object, int level); +char *gd_object_get_bdcff(const GdObject *object); GdObject *gd_object_new_from_string(char *str); -GdCave *gd_cave_new_rendered(const GdCave *data, const int level, guint32 seed); +GdCave *gd_cave_new_rendered(const GdCave *data, const int level, unsigned int seed); void gd_flatten_cave(GdCave *cave, const int level); #endif // BD_CAVEOBJECT_H