123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121 |
- #ifndef __OHILLRES_H
- #define __OHILLRES_H
- #ifndef __ORESDB_H
- #include <ORESDB.h>
- #endif
- enum
- {
- HIGH_HILL_PRIORITY = 7,
- LOW_HILL_PRIORITY = 3,
- };
- struct HillBlockRec
- {
- enum { PATTERN_ID_LEN = 3, SUB_PATTERN_ID_LEN =3, PRIORITY_LEN = 1,
- OFFSET_LEN=3, FILE_NAME_LEN = 8, BITMAP_PTR_LEN = 4 };
- char pattern_id[PATTERN_ID_LEN];
- char sub_pattern_id[SUB_PATTERN_ID_LEN];
- char priority[PRIORITY_LEN];
- char special_flag;
- char layer;
- char bitmap_type;
- char offset_x[OFFSET_LEN];
- char offset_y[OFFSET_LEN];
- char file_name[FILE_NAME_LEN];
- char bitmap_ptr[BITMAP_PTR_LEN];
- };
- struct HillBlockInfo
- {
- short block_id;
- char pattern_id;
- char sub_pattern_id;
- char special_flag;
- char priority;
- char layer;
- char bitmap_type;
- short offset_x;
- short offset_y;
- char* bitmap_ptr;
- public:
- short bitmap_width() { return *(short *)bitmap_ptr; }
- short bitmap_height() { return *(((short *)bitmap_ptr)+1); }
- void draw(int xLoc, int yLoc, int layerMask=-1);
- void draw_at(int absBaseX, int absBaseY, int layerMask=-1);
- };
- class HillRes
- {
- public:
- HillBlockInfo* hill_block_info_array;
- short hill_block_count;
- short * first_block_index;
- short max_pattern_id;
- char init_flag;
- ResourceDb res_bitmap;
- public:
- HillRes();
- void init();
- void deinit();
-
- short locate(char patternId, char subPattern, char searchPriority, char specialFlag);
-
- short scan(char patternId, char searchPriority, char specialFlag, char findFirst);
-
- HillBlockInfo* operator[](int hillBlockId);
- short first_block(int hillPatternId);
- private:
- void load_hill_block_info();
- };
- extern HillRes hill_res;
- #endif
|