123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131 |
- #ifndef __OH
- #define __OH
- #ifndef __ORESX_H
- #include <ORESX.h>
- #endif
- #define MAX_TUTOR_TEXT_BLOCK 100
- struct TutorRec
- {
- enum { CODE_LEN=8, DES_LEN=40 };
- char code[CODE_LEN];
- char des[DES_LEN];
- };
- struct TutorInfo
- {
- enum { CODE_LEN=8, DES_LEN=40 };
- char code[CODE_LEN+1];
- char des[DES_LEN+1];
- };
- struct TutorTextBlock
- {
- enum { BUTTON_CODE_LEN=8 };
- char* text_ptr;
- short text_len;
- char button_code[BUTTON_CODE_LEN+1];
- };
- class Tutor
- {
- public:
- char init_flag;
- short tutor_count;
- TutorInfo* tutor_info_array;
- ResourceIdx res_tutor_text, res_tutor_intro;
-
- short cur_tutor_id;
- short cur_text_block_id;
- short last_text_block_id;
- int cur_speech_wav_id;
- char *tutor_text_buf;
- int tutor_text_buf_size;
- char *tutor_intro_buf;
- int tutor_intro_buf_size;
- TutorTextBlock *text_block_array;
- int text_block_count;
- public:
- Tutor();
- ~Tutor();
- void init();
- void deinit();
- int select_tutor(int);
- void select_run_tutor(int inGameCall);
- void run(int tutorId, int inGameCall);
- void load(int tutorId);
- char* get_intro(int tutorId);
- void disp();
- int detect();
- void prev_text_block();
- void next_text_block();
- void play_speech();
- void stop_speech();
- int write_file(File*);
- int read_file(File*);
- TutorInfo* operator[](int tutorId);
- private:
- void load_tutor_info();
- };
- extern Tutor tutor;
- #endif
|