home · contact · privacy
Added a gameplay recording system and restructured everything to make it fit in.
[plomrogue] / roguelike.h
index da80489859921bee7795925f798573a15e7ced02..26ca0a443d4b3da16943fe5283d91f051f6d347c 100644 (file)
@@ -1,33 +1,45 @@
 struct World {
+  char interactive;
   struct KeyBinding * keybindings;
   struct KeysWinData * keyswindata;
-  int turn;
+  uint32_t seed;
+  uint32_t turn;
   char * log;
   struct Map * map;
   struct Monster * monster;
   struct Player * player; };
 
 struct Map {
-  int width;
-  int height;
-  int offset_x;
-  int offset_y;
+  uint16_t width;
+  uint16_t height;
+  uint16_t offset_x;
+  uint16_t offset_y;
   char * cells; };
 
 struct Player {
-  int y;
-  int x; };
+  uint16_t y;
+  uint16_t x; };
 
 struct Monster {
-  int y;
-  int x; };
+  uint16_t y;
+  uint16_t x; };
 
+uint16_t rrand(char, uint32_t);
+uint16_t read_uint16_bigendian(FILE * file);
+void write_uint16_bigendian(uint16_t x, FILE * file);
+uint32_t read_uint32_bigendian(FILE * file);
+void write_uint32_bigendian(uint32_t x, FILE * file);
+void load_game(struct World *);
+void save_game(struct World *);
 void toggle_window (struct WinMeta *, struct Win *);
 void growshrink_active_window (struct WinMeta *, char);
 struct Map init_map ();
 void map_scroll (struct Map *, char);
 void next_turn (struct World *);
 void update_log (struct World *, char *);
-char is_passable (struct World *, int, int);
+char is_passable (struct World *, uint16_t, uint16_t);
+void record_action (char);
 void move_player (struct World *, char);
 void player_wait(struct World *);
+void startpos(struct World *);
+unsigned char meta_keys(int, struct World *, struct WinMeta *, struct Win *, struct Win *, struct Win *, struct Win *);