123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- #ifndef __OWALLRES_H
- #define __OWALLRES_H
- #ifndef __ORESDB_H
- #include <ORESDB.h>
- #endif
- #define WALL_SPACE_LOC 5
- #define BUILD_WALL_COST 10
- #define DESTRUCT_WALL_COST 5
- struct WallRec
- {
- enum { WALL_ID_LEN=2, OFFSET_LEN=4, LOC_OFF_LEN=2, FILE_NAME_LEN=8, BITMAP_PTR_LEN=4 };
- char wall_id[WALL_ID_LEN];
- char gate_flag;
- char trans_flag;
- char offset_x[OFFSET_LEN];
- char offset_y[OFFSET_LEN];
- char loc_off_x[LOC_OFF_LEN];
- char loc_off_y[LOC_OFF_LEN];
- char draw_wall[WALL_ID_LEN];
- char file_name[FILE_NAME_LEN];
- char bitmap_ptr[BITMAP_PTR_LEN];
- };
- struct WallInfo
- {
- char wall_id;
- char flags;
- short offset_x;
- short offset_y;
- char loc_off_x;
- char loc_off_y;
- char draw_wall_id;
- char dummy;
- char* bitmap_ptr;
- public:
- int is_gate() { return flags & 1; }
- int is_trans() { return flags & 2; }
- void set_gate() { flags |= 1;}
- void set_trans() { flags |= 2;}
- short bitmap_width() { return *(short *)bitmap_ptr; }
- short bitmap_height() { return *(((short *)bitmap_ptr)+1); }
- void draw(int xLoc, int yLoc, char *remapTbl = NULL);
- void draw_at(int absBaseX, int absBaseY, char *remapTbl = NULL);
- };
- class WallRes
- {
- public:
- WallInfo* wall_info_array;
- WallInfo** wall_index;
- short wall_count;
- char max_wall_id;
- char init_flag;
- ResourceDb res_bitmap;
- short selected_x_loc;
- short selected_y_loc;
- public:
- WallRes();
- void init();
- void deinit();
- void disp_info(int refreshFlag);
- void draw_selected();
- WallInfo* operator[](int WallId);
- private:
- void load_wall_info();
- };
- extern WallRes wall_res;
- #endif
|