AbyssLib 1.301
あびす謹製ノベルゲームフレームワークライブラリ
|
00001 /************************************************* 00002 ファイル名:DrawManager.h 00003 作成者 :あびす 00004 役割 :グラフィック関連 00005 *************************************************/ 00010 #ifndef ABYSSLIB_DRAWMANAGER_H 00011 #define ABYSSLIB_DRAWMANAGER_H 00012 00013 namespace nsAbyssLib{ 00014 00015 namespace nsCore{ 00016 //依存クラス(参照先:AbyssLib.h) 00017 class INovelEngine; 00018 } 00019 00020 namespace nsDrawManager{ 00021 00022 //テキストカーソルの状態 00028 enum TEXTCURSOR{ 00034 TEXTCURSOR_NONE, //通常 00040 TEXTCURSOR_CLICK, //クリック待ち 00046 TEXTCURSOR_GONEXT, //改ページ待ち 00052 TEXTCURSOR_BACKLOG, //既読履歴時 00053 }; 00054 00055 //グラフィック用デバイス(インターフェース) 00062 class IDrawManager{ 00063 public: 00064 //画像 00069 virtual bool UnloadAllImage() = 0; //全画像をメモリから解放する 00075 virtual bool LoadImage(const char* FileName) = 0; //画像をメモリに読み込む 00081 virtual bool UnloadImage(const char* FileName) = 0; //画像をメモリから解放する 00082 //画面 00089 virtual unsigned int GetScreenWidth() const = 0; //画面の横幅を取得 00096 virtual unsigned int GetScreenHeight() const = 0; //画面の縦幅を取得 00104 virtual bool GetFullScreen() const = 0; //フルスクリーンか否かを取得 00112 virtual void SetFullScreen(bool IsFullScreen) = 0; //フルスクリーンか否かを設定 00113 //テキストの表示速度 00119 virtual int GetTextSpeed() const = 0; //テキストの表示速度を取得 00127 virtual void SetTextSpeed(int TextSpeed) = 0; //テキストの表示速度を設定 00133 virtual unsigned int GetDefaultTextSpeed() const = 0; //テキストの表示速度を取得(デフォルト) 00139 virtual void SetDefaultTextSpeed(unsigned int DefaultTextSpeed) = 0; //テキストの表示速度を設定(デフォルト) 00140 //テキストウインドウ 00146 virtual bool GetTextWindowShow() const = 0; //テキストウインドウの表示状態を取得 00152 virtual void SetTextWindowShow(bool IsShow) = 0; //テキストウインドウの表示状態を設定 00160 virtual bool GetTextWindowForceShow() const = 0; //テキストウインドウの表示状態(強制表示か)を取得 00168 virtual void SetTextWindowForceShow(bool IsForceShow) = 0; //テキストウインドウの表示状態(強制表示か)を設定 00178 virtual void SetTextWindow(const char* FileName, int x, int y, BYTE a, RECT Image) = 0; //テキストウインドウを設定(画像) 00188 virtual void SetTextWindow(RECT Position, COLORREF Color, BYTE a, unsigned int Border, COLORREF BorderColor) = 0; 00189 //テキストウインドウを設定(描画) 00190 //テキスト/発言者名 00195 virtual const char* GetRubyFont() const = 0; //ルビのフォントを取得 00200 virtual void SetRubyFont(const char* Font) = 0; //ルビのフォントを設定 00205 virtual unsigned int GetRubySize() const = 0; //ルビのサイズを取得 00210 virtual void SetRubySize(unsigned int Size) = 0; //ルビのサイズを設定 00216 virtual void GetTextPos(int& x, int& y) const = 0; //テキストの座標を取得 00222 virtual void SetTextPos(int x, int y) = 0; //テキストの座標を設定 00229 virtual unsigned int GetTextMaxWidth() const = 0; //テキストの最大横幅を取得 00236 virtual void SetTextMaxWidth(unsigned int Width) = 0; //テキストの最大横幅を設定 00243 virtual unsigned int GetTextMaxHeight() const = 0; //テキストの最大縦幅を取得 00250 virtual void SetTextMaxHeight(unsigned int Height) = 0; //テキストの最大縦幅を設定 00255 virtual COLORREF GetTextColor() const = 0; //テキストのカラーを取得 00260 virtual void SetTextColor(COLORREF Color) = 0; //テキストのカラーを設定 00265 virtual const char* GetTextFont() const = 0; //テキストのフォントを取得 00270 virtual void SetTextFont(const char* Font) = 0; //テキストのフォントを設定 00275 virtual unsigned int GetTextSize() const = 0; //テキストのサイズを取得(pt数) 00280 virtual void SetTextSize(unsigned int Size) = 0; //テキストのサイズを設定(pt数) 00286 virtual void GetTalkerPos(int& x, int& y) const = 0; //発言者名の座標を取得 00292 virtual void SetTalkerPos(int x, int y) = 0; //発言者名の座標を設定 00299 virtual unsigned int GetTalkerMaxWidth() const = 0; //発言者名の最大横幅を取得 00306 virtual void SetTalkerMaxWidth(unsigned int Width) = 0; //発言者名の最大横幅を設定 00313 virtual unsigned int GetTalkerMaxHeight() const = 0; //発言者名の最大縦幅を取得 00320 virtual void SetTalkerMaxHeight(unsigned int Height) = 0; //発言者名の最大縦幅を設定 00325 virtual COLORREF GetTalkerColor() const = 0; //発言者名のカラーを取得 00330 virtual void SetTalkerColor(COLORREF Color) = 0; //発言者名のカラーを設定 00335 virtual const char* GetTalkerFont() const = 0; //発言者名のフォントを取得 00340 virtual void SetTalkerFont(const char* Font) = 0; //発言者名のフォントを設定 00345 virtual unsigned int GetTalkerSize() const = 0; //発言者名のサイズを取得(pt数) 00350 virtual void SetTalkerSize(unsigned int Size) = 0; //発言者名のサイズを設定(pt数) 00355 virtual const TextTokenSection& GetText() const = 0; //テキストを取得 00360 virtual void SetText(const TextTokenSection& Text) = 0; //テキストを設定 00365 virtual const TextTokenSection& GetTalker() const = 0; //発言者名を取得 00370 virtual void SetTalker(const TextTokenSection& Talker) = 0; //発言者名を設定 00371 //テキストカーソル 00377 virtual void SetTextCursorMode(unsigned int Mode) = 0; //テキストカーソルの状態を設定 00389 virtual void SetTextCursorShow(bool None, bool Click, bool GoNext, bool BackLog) = 0; //テキストカーソルの各表示状態を設定 00401 virtual void SetTextCursorNone(const char* FileName, int x, int y, BYTE a, RECT Image, bool IsABS) = 0; 00402 //テキストカーソル(通常)を設定 00414 virtual void SetTextCursorClick(const char* FileName, int x, int y, BYTE a, RECT Image, bool IsABS) = 0; 00415 //テキストカーソル(クリック待ち)を設定 00427 virtual void SetTextCursorGoNext(const char* FileName, int x, int y, BYTE a, RECT Image, bool IsABS) = 0; 00428 //テキストカーソル(改ページ待ち)を設定 00440 virtual void SetTextCursorBackLog(const char* FileName, int x, int y, BYTE a, RECT Image, bool IsABS) = 0; 00441 //テキストカーソル(既読履歴時)を設定 00442 //選択肢 00447 virtual unsigned int GetSelectTextSize() const = 0; //選択肢のテキストのサイズを取得 00452 virtual void SetSelectTextSize(unsigned int Size) = 0; //選択肢のテキストのサイズを設定 00457 virtual const char* GetSelectTextFont() const = 0; //選択肢のテキストのフォントを取得 00462 virtual void SetSelectTextFont(const char* Font) = 0; //選択肢のテキストのフォントを設定 00469 virtual unsigned int GetSelectTextMaxWidth() const = 0; //選択肢のテキストの最大横幅を取得 00476 virtual void SetSelectTextMaxWidth(unsigned int Width) = 0; //選択肢のテキストの最大横幅を設定 00483 virtual unsigned int GetSelectTextMaxHeight() const = 0; //選択肢のテキストの最大縦幅を取得 00490 virtual void SetSelectTextMaxHeight(unsigned int Height) = 0; //選択肢のテキストの最大縦幅を設定 00495 virtual void SetSelectTextNColor(COLORREF Color) = 0; //選択肢のテキストのカラー(通常時)を設定 00500 virtual void SetSelectTextCColor(COLORREF Color) = 0; //選択肢のテキストのカラー(カーソル時)を設定 00505 virtual void SetSelectTextHColor(COLORREF Color) = 0; //選択肢のテキストのカラー(ホールド時)を設定 00512 virtual void SetSelectWindowUnderSpace(unsigned int Space) = 0; //選択肢のウインドウと画面下端の間隔を設定 00517 virtual void SetSelectClickSE(const char* FileName) = 0; //選択肢のSE(クリック時)を設定 00522 virtual void SetSelectCursorSE(const char* FileName) = 0; //選択肢のSE(カーソル時)を設定 00537 virtual void SetSelectWindow(const char* FileName, BYTE a, RECT Normal, RECT OnCursor, RECT OnHold) = 0; 00538 //選択肢を設定(画像) 00559 virtual void SetSelectWindow(unsigned int AroundSpace, COLORREF NColor, COLORREF CColor, COLORREF HColor, BYTE a, unsigned int Border, COLORREF BorderNColor, COLORREF BorderCColor, COLORREF BorderHColor) = 0; 00560 //選択肢を設定(描画) 00566 virtual bool CheckSelect() = 0; //選択肢の押下状態を調べる 00573 virtual void SetSelect(const char* Var, unsigned int NumText, const TextTokenSection Text[]) = 0; 00574 //選択肢を設定 00578 virtual void ClearSelect() = 0; //選択肢を消去 00579 //画面を消去 00587 virtual COLORREF GetClearColor() const = 0; //画面の消去色(設定)を取得 00594 virtual void SetClearColor(COLORREF Color) = 0; //画面の消去色(設定)を設定 00595 //その他 00602 virtual bool IsUsedSE(const char* FileName) const = 0; //SEを使用しているか? 00609 virtual bool IsUsedImage(const char* FileName) const = 0; //画像を使用しているか? 00610 }; 00611 00612 //グラフィック用デバイス 00618 class BaseDrawManager : public IDrawManager{ 00619 public: 00623 BaseDrawManager(); //デフォルトコンストラクタ 00627 virtual ~BaseDrawManager(){} //仮想デストラクタ 00628 00632 void Initialize(); //初期化 00633 00640 void SetParent(INovelEngine* Parent); //親エンジンを設定 00641 00642 bool UnloadAllImage(); //全画像をメモリから解放する 00643 bool LoadImage(const char* FileName); //画像をメモリに読み込む 00644 bool UnloadImage(const char* FileName); //画像をメモリから解放する 00645 00646 int GetTextSpeed() const; //テキストの表示速度を取得 00647 void SetTextSpeed(int TextSpeed); //テキストの表示速度を設定 00648 unsigned int GetDefaultTextSpeed() const; //テキストの表示速度を取得(デフォルト) 00649 void SetDefaultTextSpeed(unsigned int DefaultTextSpeed); //テキストの表示速度を設定(デフォルト) 00650 00651 bool GetTextWindowShow() const; //テキストウインドウの表示状態を取得 00652 void SetTextWindowShow(bool IsShow); //テキストウインドウの表示状態を設定 00653 bool GetTextWindowForceShow() const; //テキストウインドウの表示状態(強制表示か)を取得 00654 void SetTextWindowForceShow(bool IsForceShow); //テキストウインドウの表示状態(強制表示か)を設定 00655 void SetTextWindow(const char* FileName, int x, int y, BYTE a, RECT Image); //テキストウインドウを設定(画像) 00656 void SetTextWindow(RECT Position, COLORREF Color, BYTE a, unsigned int Border, COLORREF BorderColor); 00657 //テキストウインドウを設定(描画) 00658 00659 const char* GetRubyFont() const; //ルビのフォントを取得 00660 void SetRubyFont(const char* Font); //ルビのフォントを設定 00661 unsigned int GetRubySize() const; //ルビのサイズを取得 00662 void SetRubySize(unsigned int Size); //ルビのサイズを設定 00663 void GetTextPos(int& x, int& y) const; //テキストの座標を取得 00664 void SetTextPos(int x, int y); //テキストの座標を設定 00665 unsigned int GetTextMaxWidth() const; //テキストの最大横幅を取得 00666 void SetTextMaxWidth(unsigned int Width); //テキストの最大横幅を設定 00667 unsigned int GetTextMaxHeight() const; //テキストの最大縦幅を取得 00668 void SetTextMaxHeight(unsigned int Height); //テキストの最大縦幅を設定 00669 COLORREF GetTextColor() const; //テキストのカラーを取得 00670 void SetTextColor(COLORREF Color); //テキストのカラーを設定 00671 const char* GetTextFont() const; //テキストのフォントを取得 00672 void SetTextFont(const char* Font); //テキストのフォントを設定 00673 unsigned int GetTextSize() const; //テキストのサイズを取得(pt数) 00674 void SetTextSize(unsigned int Size); //テキストのサイズを設定(pt数) 00675 void GetTalkerPos(int& x, int& y) const; //発言者名の座標を取得 00676 void SetTalkerPos(int x, int y); //発言者名の座標を設定 00677 unsigned int GetTalkerMaxWidth() const; //発言者名の最大横幅を取得 00678 void SetTalkerMaxWidth(unsigned int Width); //発言者名の最大横幅を設定 00679 unsigned int GetTalkerMaxHeight() const; //発言者名の最大縦幅を取得 00680 void SetTalkerMaxHeight(unsigned int Height); //発言者名の最大縦幅を設定 00681 COLORREF GetTalkerColor() const; //発言者名のカラーを取得 00682 void SetTalkerColor(COLORREF Color); //発言者名のカラーを設定 00683 const char* GetTalkerFont() const; //発言者名のフォントを取得 00684 void SetTalkerFont(const char* Font); //発言者名のフォントを設定 00685 unsigned int GetTalkerSize() const; //発言者名のサイズを取得(pt数) 00686 void SetTalkerSize(unsigned int Size); //発言者名のサイズを設定(pt数) 00687 const TextTokenSection& GetText() const; //テキストを取得 00688 void SetText(const TextTokenSection& Text); //テキストを設定 00689 const TextTokenSection& GetTalker() const; //発言者名を取得 00690 void SetTalker(const TextTokenSection& Talker); //発言者名を設定 00691 00692 void SetTextCursorMode(unsigned int Mode); //テキストカーソルの状態を設定 00693 void SetTextCursorShow(bool None, bool Click, bool GoNext, bool BackLog); //テキストカーソルの各表示状態を設定 00694 void SetTextCursorNone(const char* FileName, int x, int y, BYTE a, RECT Image, bool IsABS); 00695 //テキストカーソル(通常)を設定 00696 void SetTextCursorClick(const char* FileName, int x, int y, BYTE a, RECT Image, bool IsABS); 00697 //テキストカーソル(クリック待ち)を設定 00698 void SetTextCursorGoNext(const char* FileName, int x, int y, BYTE a, RECT Image, bool IsABS); 00699 //テキストカーソル(改ページ待ち)を設定 00700 void SetTextCursorBackLog(const char* FileName, int x, int y, BYTE a, RECT Image, bool IsABS); 00701 //テキストカーソル(既読履歴時)を設定 00702 00703 unsigned int GetSelectTextSize() const; //選択肢のテキストのサイズを取得 00704 void SetSelectTextSize(unsigned int Size); //選択肢のテキストのサイズを設定 00705 const char* GetSelectTextFont() const; //選択肢のテキストのフォントを取得 00706 void SetSelectTextFont(const char* Font); //選択肢のテキストのフォントを設定 00707 unsigned int GetSelectTextMaxWidth() const; //選択肢のテキストの最大横幅を取得 00708 void SetSelectTextMaxWidth(unsigned int Width); //選択肢のテキストの最大横幅を設定 00709 unsigned int GetSelectTextMaxHeight() const; //選択肢のテキストの最大縦幅を取得 00710 void SetSelectTextMaxHeight(unsigned int Height); //選択肢のテキストの最大縦幅を設定 00711 void SetSelectTextNColor(COLORREF Color); //選択肢のテキストのカラー(通常時)を設定 00712 void SetSelectTextCColor(COLORREF Color); //選択肢のテキストのカラー(カーソル時)を設定 00713 void SetSelectTextHColor(COLORREF Color); //選択肢のテキストのカラー(ホールド時)を設定 00714 void SetSelectWindowUnderSpace(unsigned int Space); //選択肢のウインドウと画面下端の間隔を設定 00715 void SetSelectClickSE(const char* FileName); //選択肢のSE(クリック時)を設定 00716 void SetSelectCursorSE(const char* FileName); //選択肢のSE(カーソル時)を設定 00717 void SetSelectWindow(const char* FileName, BYTE a, RECT Normal, RECT OnCursor, RECT OnHold); 00718 //選択肢を設定(画像) 00719 void SetSelectWindow(unsigned int AroundSpace, COLORREF NColor, COLORREF CColor, COLORREF HColor, BYTE a, unsigned int Border, COLORREF BorderNColor, COLORREF BorderCColor, COLORREF BorderHColor); 00720 //選択肢を設定(描画) 00721 bool CheckSelect(); //選択肢の押下状態を調べる 00722 void SetSelect(const char* Var, unsigned int NumText, const TextTokenSection Text[]); //選択肢を設定 00723 void ClearSelect(); //選択肢を消去 00724 00728 void Clear(); //画面を消去 00734 void UpdateClearColor(); //画面の消去色(現在)を更新 00735 COLORREF GetClearColor() const; //画面の消去色(設定)を取得 00736 void SetClearColor(COLORREF Color); //画面の消去色(設定)を設定 00741 COLORREF GetPresentClearColor() const; //画面の消去色(現在)を取得 00746 void SetPresentClearColor(COLORREF Color); //画面の消去色(現在)を設定 00747 00753 virtual void Flip() = 0; 00757 virtual void DrawText(); //テキストを描画(1) 00762 virtual void DrawText(COLORREF Color); //テキストを描画(2) 00766 virtual void DrawTalker(); //発言者名を描画(1) 00771 virtual void DrawTalker(COLORREF Color); //発言者名を描画(2) 00775 virtual void DrawTaskList(); //タスクリストを描画 00779 virtual void DrawTextWindow(); //テキストウインドウを描画 00783 virtual void DrawTextCursor(); //テキストカーソルを描画 00787 virtual void DrawSelect(); //選択肢を描画 00794 virtual void OnDrawEX(){} //拡張画面描画メソッド 00795 00796 //下位描画メソッドのヘルパー(1) 00805 void Blt(const string& FileName, int x, int y, BYTE a, RECT SrcRect); //通常転送(抜き色あり) 00814 void AddBlt(const string& FileName, int x, int y, BYTE a, RECT SrcRect); //加色転送(抜き色あり) 00823 void SubBlt(const string& FileName, int x, int y, BYTE a, RECT SrcRect); //減色転送(抜き色あり) 00832 void BltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect); //通常転送(抜き色なし) 00841 void AddBltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect); //加色転送(抜き色なし) 00850 void SubBltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect); //減色転送(抜き色なし) 00851 //下位描画メソッドのヘルパー(2) 00859 void DrawFreeText(const TextTokenSection& Text, int x, int y, BYTE a); //文字列を描画(1) 00868 void DrawFreeText(const TextTokenSection& Text, int x, int y, BYTE a, COLORREF Color); //文字列を描画(2) 00883 void DrawFreeText(const string& Text, int x, int y, BYTE a, const string& Font, unsigned int Size, COLORREF Color, bool IsBold, bool IsItalic); 00884 //文字列を描画(3) 00885 //下位描画メソッドのヘルパー(3) 00892 void DrawRect(RECT Rect, COLORREF Color, BYTE a); //矩形を描画 00901 void DrawBorderRect(RECT Rect, COLORREF Color, BYTE a, unsigned int Border, COLORREF BorderColor); 00902 //縁付矩形を描画 00903 00908 void SaveE(IIOStream* IOStream); //保存(環境設定) 00915 void LoadE(IIOStream* IOStream, bool AllowChangeDisplayMode); //読み込み(環境設定) 00920 void SaveL(IIOStream* IOStream); //保存(ローカル) 00925 void LoadL(IIOStream* IOStream); //読み込み(ローカル) 00926 bool IsUsedSE(const char* FileName) const; //SEを使用しているか? 00927 bool IsUsedImage(const char* FileName) const; //画像を使用しているか? 00928 protected: 00936 virtual bool _LoadImage(const char* FileName) = 0; 00944 virtual bool _UnloadImage(const char* FileName) = 0; 00950 virtual void _Clear(COLORREF Color) = 0; 00961 virtual void _Blt(const string& FileName, int x, int y, BYTE a, RECT SrcRect) = 0; 00972 virtual void _AddBlt(const string& FileName, int x, int y, BYTE a, RECT SrcRect) = 0; 00983 virtual void _SubBlt(const string& FileName, int x, int y, BYTE a, RECT SrcRect) = 0; 00994 virtual void _BltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect) = 0; 01005 virtual void _AddBltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect) = 0; 01016 virtual void _SubBltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect) = 0; 01033 virtual void _DrawFreeText(const string& Text, int x, int y, BYTE a, const string& Font, unsigned int Size, COLORREF Color, bool IsBold, bool IsItalic) = 0; 01042 virtual void _DrawRect(RECT Rect, COLORREF Color, BYTE a) = 0; 01043 private: 01044 //親エンジンのアドレス 01045 INovelEngine* Outer; //親エンジンのアドレス 01046 //画像 01047 vector<string> m_ImageName; //画像名 01048 //テキストの表示速度 01049 int m_TextSpeed; //テキストの表示速度 01050 unsigned int m_DefaultTextSpeed; //テキストの表示速度(デフォルト) 01051 //テキストウインドウ(共通) 01052 bool m_TextWindowIsShow; //表示状態 01053 bool m_TextWindowIsForceShow; //表示状態(強制表示か) 01054 bool m_TextWindowIsUsedImage; //描画に画像を使用するか? 01055 BYTE m_TextWindowA; //透過度 01056 //テキストウインドウ(画像) 01057 string m_TextWindowImageName; //画像名 01058 int m_TextWindowX, m_TextWindowY; //転送先座標 01059 RECT m_TextWindowImageSrcRect; //転送元矩形 01060 //テキストウインドウ(描画) 01061 RECT m_TextWindowPosition; //描画矩形 01062 COLORREF m_TextWindowColor, m_TextWindowBorderColor; //内部色、枠の色 01063 unsigned int m_TextWindowBorder; //枠の太さ 01064 //テキスト/発言者名 01065 string m_RubyFont; //ルビのフォント 01066 unsigned int m_RubySize; //ルビのサイズ 01067 int m_TextX, m_TextY; //テキストの座標 01068 int m_TalkerX, m_TalkerY; //発言者名の座標 01069 unsigned int m_TextMaxWidth, m_TextMaxHeight; //テキストの最大横幅/縦幅 01070 unsigned int m_TalkerMaxWidth, m_TalkerMaxHeight; //発言者名の最大横幅/縦幅 01071 COLORREF m_TextColor, m_TalkerColor; //テキスト/発言者名のカラー 01072 string m_TextFont, m_TalkerFont; //テキスト/発言者名のフォント 01073 unsigned int m_TextSize, m_TalkerSize; //テキスト/発言者名のサイズ 01074 TextTokenSection m_Text, m_Talker; //テキスト/発言者名 01075 //テキストカーソル 01076 unsigned int m_TextCursorMode; //状態 01077 bool m_TextCursorIsShowN, m_TextCursorIsShowC, m_TextCursorIsShowG, m_TextCursorIsShowB; 01078 //表示状態 01079 string m_TextCursorImageNameN, m_TextCursorImageNameC, m_TextCursorImageNameG, m_TextCursorImageNameB; 01080 //画像名 01081 int m_TextCursorXN, m_TextCursorXC, m_TextCursorXG, m_TextCursorXB; //転送先座標(X) 01082 int m_TextCursorYN, m_TextCursorYC, m_TextCursorYG, m_TextCursorYB; //転送先座標(Y) 01083 BYTE m_TextCursorAN, m_TextCursorAC, m_TextCursorAG, m_TextCursorAB; //透過度 01084 RECT m_TextCursorImageSrcRectN, m_TextCursorImageSrcRectC, m_TextCursorImageSrcRectG, m_TextCursorImageSrcRectB; 01085 //転送元矩形 01086 bool m_TextCursorIsABSN, m_TextCursorIsABSC, m_TextCursorIsABSG, m_TextCursorIsABSB; //座標設定 01087 //選択肢(共通) 01088 int m_SelectState; //押下状態 01089 string m_SelectVar; //関連付け変数 01090 vector<TextTokenSection> m_SelectText; //選択肢の文章 01091 unsigned int m_SelectTextSize; //文章のサイズ 01092 string m_SelectTextFont; //文章のフォント 01093 vector<bool> m_SelectIsPushed; //クリック検知用 01094 vector<bool> m_SelectIsCursored; //カーソル検知用 01095 unsigned int m_SelectTextMaxWidth, m_SelectTextMaxHeight; //テキストの最大横幅/縦幅 01096 COLORREF m_SelectTextNColor, m_SelectTextCColor, m_SelectTextHColor; //テキストのカラー(通常時/カーソル時/ホールド時) 01097 unsigned int m_SelectWindowUnderSpace; //ウインドウと画面下端の間隔 01098 string m_SelectCursorSE, m_SelectClickSE; //SE(カーソル時/クリック時) 01099 bool m_SelectWindowIsUsedImage; //描画に画像を使用するか? 01100 BYTE m_SelectWindowA; //透過度 01101 //選択肢(画像) 01102 string m_SelectWindowImageName; //画像名 01103 RECT m_SelectWindowImageSrcRectN, m_SelectWindowImageSrcRectC, m_SelectWindowImageSrcRectH; 01104 //転送元矩形 01105 //選択肢(描画) 01106 unsigned int m_SelectWindowAroundSpace; //テキストと枠の間隔 01107 COLORREF m_SelectWindowNColor, m_SelectWindowCColor, m_SelectWindowHColor; //内部色(通常字/カーソル時/ホールド時) 01108 unsigned int m_SelectWindowBorder; //枠の太さ 01109 COLORREF m_SelectWindowBorderNColor, m_SelectWindowBorderCColor, m_SelectWindowBorderHColor; 01110 //枠の色(通常字/カーソル時/ホールド時) 01111 //画面の消去色 01112 COLORREF m_ClearColor; //画面の消去色(設定) 01113 COLORREF m_PresentClearColor; //画面の消去色(現在) 01114 }; 01115 01116 //グラフィック用デバイス(ヌルデバイス) 01122 class NullDrawManager : public BaseDrawManager{ 01123 public: 01127 NullDrawManager(){} //デフォルトコンストラクタ 01128 01129 unsigned int GetScreenWidth() const{ return(0); } //画面の横幅を取得 01130 unsigned int GetScreenHeight() const{ return(0); } //画面の縦幅を取得 01131 bool GetFullScreen() const{ return(false); } //フルスクリーンか否かを取得 01132 void SetFullScreen(bool IsFullScreen){} //フルスクリーンか否かを設定 01133 void Flip(){} //画面を更新 01134 protected: 01135 bool _LoadImage(const char* FileName){ return(false); } 01136 bool _UnloadImage(const char* FileName){ return(false); } 01137 void _Clear(COLORREF Color){} 01138 void _Blt(const string& FileName, int x, int y, BYTE a, RECT SrcRect){} 01139 void _AddBlt(const string& FileName, int x, int y, BYTE a, RECT SrcRect){} 01140 void _SubBlt(const string& FileName, int x, int y, BYTE a, RECT SrcRect){} 01141 void _BltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect){} 01142 void _AddBltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect){} 01143 void _SubBltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect){} 01144 void _DrawFreeText(const string& Text, int x, int y, BYTE a, const string& Font, unsigned int Size, COLORREF Color, bool IsBold, bool IsItalic){} 01145 void _DrawRect(RECT Rect, COLORREF Color, BYTE a){} 01146 private: 01147 NullDrawManager(const NullDrawManager&); //コピーコンストラクタ(禁止) 01148 NullDrawManager& operator =(const NullDrawManager&); //代入演算子(禁止) 01149 }; 01150 01151 //グラフィック用デバイスのアクセッサ(インターフェース) 01157 class IDMAccessor{ 01158 public: 01162 virtual void Clear() = 0; //画面を消去 01168 virtual void UpdateClearColor() = 0; //画面の消去色(現在)を更新 01173 virtual COLORREF GetPresentClearColor() = 0; //画面の消去色(現在)を取得 01178 virtual void SetPresentClearColor(COLORREF Color) = 0; //画面の消去色(現在)を設定 01187 virtual void Blt(const char* FileName, int x, int y, BYTE a, RECT SrcRect) = 0; //通常転送(抜き色あり) 01196 virtual void AddBlt(const char* FileName, int x, int y, BYTE a, RECT SrcRect) = 0; //加色転送(抜き色あり) 01205 virtual void SubBlt(const char* FileName, int x, int y, BYTE a, RECT SrcRect) = 0; //減色転送(抜き色あり) 01214 virtual void BltFast(const char* FileName, int x, int y, BYTE a, RECT SrcRect) = 0; //通常転送(抜き色なし) 01223 virtual void AddBltFast(const char* FileName, int x, int y, BYTE a, RECT SrcRect) = 0; //加色転送(抜き色なし) 01232 virtual void SubBltFast(const char* FileName, int x, int y, BYTE a, RECT SrcRect) = 0; //減色転送(抜き色なし) 01240 virtual void DrawFreeText(const TextTokenSection& Text, int x, int y, BYTE a) = 0; //文字列を描画(1) 01249 virtual void DrawFreeText(const TextTokenSection& Text, int x, int y, BYTE a, COLORREF Color) = 0; 01250 //文字列を描画(2) 01265 virtual void DrawFreeText(const char* Text, int x, int y, BYTE a, const char* Font, unsigned int Size, COLORREF Color, bool IsBold, bool IsItalic) = 0; 01266 //文字列を描画(3) 01273 virtual void DrawRect(RECT Rect, COLORREF Color, BYTE a) = 0; //矩形を描画 01282 virtual void DrawBorderRect(RECT Rect, COLORREF Color, BYTE a, unsigned int Border, COLORREF BorderColor) = 0; 01283 //縁付矩形を描画 01284 }; 01285 01286 //グラフィック用デバイスのアクセッサ 01293 class DMAccessor : public IDMAccessor{ 01294 public: 01298 DMAccessor(){} //デフォルトコンストラクタ 01299 01304 void SetParent(INovelEngine* Parent); //親エンジンを設定 01305 01306 void Clear(); //画面を消去 01307 void UpdateClearColor(); //画面の消去色(現在)を更新 01308 COLORREF GetPresentClearColor(); //画面の消去色(現在)を取得 01309 void SetPresentClearColor(COLORREF Color); //画面の消去色(現在)を設定 01310 void Blt(const char* FileName, int x, int y, BYTE a, RECT SrcRect); //通常転送(抜き色あり) 01311 void AddBlt(const char* FileName, int x, int y, BYTE a, RECT SrcRect); //加色転送(抜き色あり) 01312 void SubBlt(const char* FileName, int x, int y, BYTE a, RECT SrcRect); //減色転送(抜き色あり) 01313 void BltFast(const char* FileName, int x, int y, BYTE a, RECT SrcRect); //通常転送(抜き色なし) 01314 void AddBltFast(const char* FileName, int x, int y, BYTE a, RECT SrcRect); //加色転送(抜き色なし) 01315 void SubBltFast(const char* FileName, int x, int y, BYTE a, RECT SrcRect); //減色転送(抜き色なし) 01316 void DrawFreeText(const TextTokenSection& Text, int x, int y, BYTE a); //文字列を描画(1) 01317 void DrawFreeText(const TextTokenSection& Text, int x, int y, BYTE a, COLORREF Color); //文字列を描画(2) 01318 void DrawFreeText(const char* Text, int x, int y, BYTE a, const char* Font, unsigned int Size, COLORREF Color, bool IsBold, bool IsItalic); 01319 //文字列を描画(3) 01320 void DrawRect(RECT Rect, COLORREF Color, BYTE a); //矩形を描画 01321 void DrawBorderRect(RECT Rect, COLORREF Color, BYTE a, unsigned int Border, COLORREF BorderColor); 01322 //縁付矩形を描画 01323 private: 01324 INovelEngine* Outer; //親エンジンのアドレス 01325 01326 DMAccessor(const DMAccessor&); //コピーコンストラクタ(禁止) 01327 DMAccessor& operator =(const DMAccessor&); //代入演算子(禁止) 01328 }; 01329 01330 #ifdef __cplusplus 01331 extern "C"{ 01332 #endif 01333 01334 //アクセッサを取得/設定 01339 __declspec(dllexport) IDMAccessor* GetDMAccessor(); //アクセッサを取得 01344 __declspec(dllexport) void SetDMAccessor(INovelEngine* Parent); //アクセッサを設定 01345 01346 #ifdef __cplusplus 01347 } 01348 #endif 01349 01350 } 01351 } 01352 01353 #endif