home *** CD-ROM | disk | FTP | other *** search
- /**************************************************************************
- * *
- * Title: Structures.h *
- * Purpose: Desktop Life *
- * Author: Copyright © 1995 Chris Taylor *
- * Version: 1.0 (22 January 1995) *
- * Comments: Slightly tweaked version of the source header file; *
- * neater and better commented than the real thing. *
- * *
- **************************************************************************/
-
- /*********************************** STRUCTURES ***************************/
-
- /* This is the bit-level structure: 16 rows of 16 bits. It serves double
- duty, since it is also used to compress the other arrays onto disc. */
-
- typedef struct cell_array_struct
- {
- int count;
- unsigned short row[16];
- }cell_array;
-
-
- /* The cells level structure:
- The 'next' array is only present during generation. */
-
- typedef struct cells_struct
- {
- cell_array *current;
- cell_array *next;
- }cells;
-
-
- /* The local structure: 16 x 16 cells structures. */
-
- typedef struct local_array_struct
- {
- int count;
- cells *c[16][16];
- }local_array;
-
-
- /* The regional structure: 16 x 16 local structures. */
-
- typedef struct regional_array_struct
- {
- int count;
- local_array *l[16][16];
- }regional_array;
-
-
- /* The global structure: 16 x 16 regional structures. */
-
- typedef struct global_array_struct
- {
- regional_array *r[16][16];
- }global_array;
-
-
- /* The plane structure: two global structures and supporting variables.
- The real one has more elements; this just shows the important bits. */
-
- struct plane_structure
- {
- int x;
- int y;
- global_array start;
- int startpop;
- global_array base;
- int gen;
- int pop;
- };
-
- /* The co-ordinates structure. */
-
- struct coord_bits
- {
- unsigned int c : 4;
- unsigned int l : 4;
- unsigned int r : 4;
- unsigned int g : 4;
- unsigned int : 16; /* unused */
- };
-
- /* The union which ties the co-ordinates to their component parts.
- Note that this only works on little-endian processors such as the ARM.
- A big-endian machine would need a reverse ordering. */
-
- typedef union plane_coordinate
- {
- int val;
- struct coord_bits bits;
- }plane_coord;
-
-