00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef SUBSCREENHANDLER_H_
00021 #define SUBSCREENHANDLER_H_
00022
00023 #include "types.h"
00024
00025 class Card;
00026 class TextBox;
00027 class ScreensHandler;
00028
00030 class SubScreenHandler
00031 {
00032 public:
00034 SubScreenHandler ();
00035
00037 void Init (Types::SubScreenMode::mode screen_mode,
00038 GameMode::mode game_mode,
00039 ScreensHandler* screens_handler);
00041 void SwitchMode (Types::SubScreenMode::mode screen_mode,
00042 GameMode::mode game_mode);
00043
00045 void PrintCard (const Card& card);
00047 void PrintBoards (int score, int accuracy);
00049 void PrintTick (int position);
00051 void PrintCross (int position);
00053 void PrintScreen (std::string kanji1, std::string kanji2,
00054 std::string kanji3, std::string kanji4,
00055 int score, int answers);
00057 void PrintOptions(unsigned grade_min, unsigned grade_max,
00058 unsigned strokes_min, unsigned strokes_max,
00059 bool romaji_conversion);
00061 void PrintOptions (bool romaji_conversion);
00063 void DrawBgImage ();
00065 void Fill (unsigned short color);
00066
00068 ~SubScreenHandler();
00069
00070 private:
00072 void SetMode (Types::SubScreenMode::mode screen_mode,
00073 GameMode::mode game_mode,
00074 ScreensHandler* screens_handler);
00076 const unsigned int* GetBitmapPtr ();
00078 const unsigned short* GetPalPtr ();
00080 void ClearMembers ();
00082 ScreensHandler* screens_handler_;
00084 Types::SubScreenMode::mode screen_mode_;
00085 TextBox *card_number_,
00086 *scoreboard_,
00087 *accuracy_,
00088 *box1_,
00089 *box2_,
00090 *box3_,
00091 *box4_,
00092 *mode_title_,
00093 *caption_grade_,
00094 *caption_strokes_,
00095 *caption_romaji_,
00096 *grade_min_,
00097 *grade_max_,
00098 *strokes_min_,
00099 *strokes_max_,
00100 *romaji_checkbox_;
00101
00102 unsigned prev_grade_min_,
00103 prev_grade_max_,
00104 prev_strokes_min_,
00105 prev_strokes_max_;
00106 bool romaji_conversion_;
00107
00109 GameMode::mode game_mode_;
00111 int bgid_;
00112 };
00113
00116 int randomize_positions (int card_index, int package_records, int& card0,
00117 int& card1, int& card2, int& card3);
00118
00119 #endif // SUBSCREENHANDLER_H_