123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- #ifndef __OSERES_H
- #define __OSERES_H
- struct SERec
- {
- enum { RECNO_LEN=3, CODE_LEN=12, VERB_LEN=4, OUT_FRAME_LEN=3, FILE_NAME_LEN=8};
- char subject_type;
- char subject_code[CODE_LEN];
- char subject_id[RECNO_LEN];
- char action[VERB_LEN];
- char object_type;
- char object_id[RECNO_LEN];
- char out_frame[OUT_FRAME_LEN];
- char file_name[FILE_NAME_LEN];
- };
- struct SEInfo
- {
- enum { VERB_LEN=4, FILE_NAME_LEN=8 };
- char subject_type;
- short subject_id;
- char action[VERB_LEN+1];
- char object_type;
- short object_id;
- short out_frame;
- char file_name[FILE_NAME_LEN+1];
- short effect_id;
- int match(char, short, char *, char, short);
- };
- struct SEInfoIndex
- {
- char subject_type;
- char dummy;
- short subject_id;
- int start_rec;
- int end_rec;
- };
- struct SETypeIndex
- {
- char subject_type;
- char dummy;
- int start_rec;
- int end_rec;
- };
- class SECtrl;
- class SERes
- {
- public:
- int init_flag;
- SECtrl* se_output;
- int se_array_count;
- SEInfo* se_array;
- int se_index_count;
- SEInfoIndex *se_index_array;
- int type_index_count;
- SETypeIndex *type_index_array;
- static unsigned long last_select_time;
- static unsigned long last_command_time;
- static unsigned long select_sound_length;
- unsigned seed;
- public:
- SERes();
- ~SERes();
- void init1();
- void init2(SECtrl*);
- void deinit();
- SEInfo* scan(char,short, char *, char,short, int findFirst=0);
- short scan_id(char,short, char *, char,short, int findFirst=0);
- SEInfo* operator[] (int);
- void sound(short xLoc, short yLoc, short frame, char,short, char *, char=0,short=0);
- void far_sound(short xLoc, short yLoc, short frame, char,short, char *, char=0,short=0);
- static int mark_select_object_time();
- static int mark_command_time();
- private:
- void load_info();
- void sort_info();
- void build_index();
- unsigned random(unsigned);
- };
- extern SERes se_res;
- #endif
|