Update of /cvsroot/xconq/xconq/src/include/gdl/gamearea
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv23113/gamearea
Modified Files:
area.h feature.h layers.h
Log Message:
Add CVS serialization support.
Fix copyrights.
Index: feature.h
===================================================================
RCS file: /cvsroot/xconq/xconq/src/include/gdl/gamearea/feature.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** feature.h 29 May 2006 19:24:54 -0000 1.1
--- feature.h 2 Jun 2006 16:58:34 -0000 1.2
***************
*** 85,88 ****
--- 85,93 ----
} Feature;
+ // Global Variables
+
+ //! List of features.
+ extern Feature *featurelist;
+
// Queries
Index: area.h
===================================================================
RCS file: /cvsroot/xconq/xconq/src/include/gdl/gamearea/area.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** area.h 29 May 2006 19:24:54 -0000 1.1
--- area.h 2 Jun 2006 16:58:34 -0000 1.2
***************
*** 330,333 ****
--- 330,343 ----
extern void interp_area(Obj *form);
+ //! Serialize game areas to GDL.
+ /*!
+ Write info about the area in the world. This code uses run-length
+ encoding to reduce the size of each written layer as much as
+ possible. Note also that each layer is written as a separate form,
+ so that the Lisp reader doesn't have to read really large forms
+ back in.
+ */
+ extern void write_areas(struct a_module *module);
+
NAMESPACE_GDL_END
NAMESPACE_XCONQ_END
Index: layers.h
===================================================================
RCS file: /cvsroot/xconq/xconq/src/include/gdl/gamearea/layers.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** layers.h 29 May 2006 19:24:54 -0000 1.1
--- layers.h 2 Jun 2006 16:58:34 -0000 1.2
***************
*** 63,66 ****
--- 63,69 ----
#define CALM (0)
+ //! Cell has no user.
+ #define NOUSER (0)
+
// Function Macros: Queries
***************
*** 144,147 ****
--- 147,153 ----
(aux_terrain_defined(c) ? (aux_terrain_at(x, y, c) & (1 << (dir))) : FALSE)
+ //! Get cell value from features layer.
+ #define raw_feature_at(x,y) aref(area.features, x, y)
+
//! Get cell value from elevations layer.
#define elev_at(x,y) aref(area.elevations, x, y)
***************
*** 168,171 ****
--- 174,183 ----
#define people_side_at(x,y) aref(area.peopleside, x, y)
+ //! Get cell value from side control layer.
+ #define control_side_at(x,y) aref(area.controlside, x, y)
+
+ //! Get cell value from cell users layer.
+ #define user_at(x, y) aref(area.user, x, y)
+
//! Get cell value from scratch layer 1.
#define tmp1_at(x,y) aref(area.tmp1, x, y)
***************
*** 260,263 ****
--- 272,302 ----
// Game Area Layers Accessors
+ //! Get cell value from terrain layer.
+ extern int fn_terrain_at(int x, int y);
+ //! Get cell value from aux terrains layers.
+ extern int fn_aux_terrain_at(int x, int y);
+ //! Get cell value from features layer.
+ extern int fn_feature_at(int x, int y);
+ //! Get cell value from elevations layer.
+ extern int fn_elevation_at(int x, int y);
+ //! Get cell value from people sides layer.
+ extern int fn_people_side_at(int x, int y);
+ //! Get cell value from side control layer.
+ extern int fn_control_side_at(int x, int y);
+ //! Get cell value from materials layers.
+ extern int fn_material_at(int x, int y);
+ //! Get cell value from temperatures layer.
+ extern int fn_temperature_at(int x, int y);
+ //! Get cell value from clouds layer.
+ extern int fn_raw_cloud_at(int x, int y);
+ //! Get cell value from cloud bottoms layer.
+ extern int fn_raw_cloud_bottom_at(int x, int y);
+ //! Get cell value from cloud tops/heights layer.
+ extern int fn_raw_cloud_height_at(int x, int y);
+ //! Get cell value from winds layer.
+ extern int fn_raw_wind_at(int x, int y);
+ //! Get cell value from cell users layer.
+ extern int fn_user_at(int x, int y);
+
//! Set cell in terrain layer.
extern void fn_set_terrain_at(int x, int y, int val);
***************
*** 366,369 ****
--- 405,445 ----
extern void fill_in_users(Obj *contents);
+ //! Encode and write textual run-length encodings.
+ /*!
+ This is a generalized routine to do run-length-encoding of area
+ layers. It uses hook fns to acquire data at a point and an
+ optional translator to do any last-minute fixing. It can use
+ either a char or numeric encoding, depending on the expected range
+ of values.
+ */
+ extern void write_rle(
+ int (*datafn)(int, int),
+ int lo, int hi,
+ int (*translator)(int),
+ int compress);
+
+ //! Serialize terrain layer to GDL.
+ extern void write_area_terrain(int compress);
+ //! Serialize aux terrain layers to GDL.
+ extern void write_area_aux_terrain(int compress);
+ //! Serialize features layer to GDL.
+ extern void write_area_features(int compress);
+ //! Serialize elevations layer to GDL.
+ extern void write_area_elevations(int compress);
+ //! Serialize people sides layer to GDL.
+ extern void write_area_people_sides(int compress);
+ //! Serialize control sides layer to GDL.
+ extern void write_area_control_sides(int compress);
+ //! Serialize materials layers to GDL.
+ extern void write_area_materials(int compress);
+ //! Serialize temperatures layer to GDL.
+ extern void write_area_temperatures(int compress);
+ //! Serialize clouds layers to GDL.
+ extern void write_area_clouds(int compress);
+ //! Serialize winds layer to GDL.
+ extern void write_area_winds(int compress);
+ //! Serialize cell users layer to GDL.
+ extern void write_area_users(int compress);
+
NAMESPACE_GDL_END
NAMESPACE_XCONQ_END
|