AbyssLib 1.310
あびす謹製ノベルゲームフレームワークライブラリ
|
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) 00808 void Blt(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX = 1.0f, float ScalingY = 1.0f, float Degree = 0.0f); 00809 //通常転送(抜き色あり) 00821 void AddBlt(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX = 1.0f, float ScalingY = 1.0f, float Degree = 0.0f); 00822 //加色転送(抜き色あり) 00834 void SubBlt(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX = 1.0f, float ScalingY = 1.0f, float Degree = 0.0f); 00835 //減色転送(抜き色あり) 00847 void BltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX = 1.0f, float ScalingY = 1.0f, float Degree = 0.0f); 00848 //通常転送(抜き色なし) 00860 void AddBltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX = 1.0f, float ScalingY = 1.0f, float Degree = 0.0f); 00861 //加色転送(抜き色なし) 00873 void SubBltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX = 1.0f, float ScalingY = 1.0f, float Degree = 0.0f); 00874 //減色転送(抜き色なし) 00875 //下位描画メソッドのヘルパー(2) 00883 void DrawFreeText(const TextTokenSection& Text, int x, int y, BYTE a); //文字列を描画(1) 00892 void DrawFreeText(const TextTokenSection& Text, int x, int y, BYTE a, COLORREF Color); //文字列を描画(2) 00908 void DrawFreeText(const string& Text, int x, int y, BYTE a, const string& Font, unsigned int Size, COLORREF Color, bool IsBold, bool IsItalic, float Degree = 0.0f); 00909 //文字列を描画(3) 00910 //下位描画メソッドのヘルパー(3) 00918 void DrawRect(RECT Rect, COLORREF Color, BYTE a, float Degree = 0.0f); //矩形を描画 00927 void DrawBorderRect(RECT Rect, COLORREF Color, BYTE a, unsigned int Border, COLORREF BorderColor); 00928 //縁付矩形を描画 00929 00934 void SaveE(IIOStream* IOStream); //保存(環境設定) 00941 void LoadE(IIOStream* IOStream, bool AllowChangeDisplayMode); //読み込み(環境設定) 00946 void SaveL(IIOStream* IOStream); //保存(ローカル) 00951 void LoadL(IIOStream* IOStream); //読み込み(ローカル) 00952 bool IsUsedSE(const char* FileName) const; //SEを使用しているか? 00953 bool IsUsedImage(const char* FileName) const; //画像を使用しているか? 00954 protected: 00962 virtual bool _LoadImage(const char* FileName) = 0; 00970 virtual bool _UnloadImage(const char* FileName) = 0; 00976 virtual void _Clear(COLORREF Color) = 0; 00991 virtual void _Blt(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree) = 0; 01006 virtual void _AddBlt(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree) = 0; 01021 virtual void _SubBlt(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree) = 0; 01036 virtual void _BltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree) = 0; 01051 virtual void _AddBltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree) = 0; 01066 virtual void _SubBltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree) = 0; 01085 virtual void _DrawFreeText(const string& Text, int x, int y, BYTE a, const string& Font, unsigned int Size, COLORREF Color, bool IsBold, bool IsItalic, float Degree) = 0; 01096 virtual void _DrawRect(RECT Rect, COLORREF Color, BYTE a, float Degree) = 0; 01097 private: 01098 //親エンジンのアドレス 01099 INovelEngine* Outer; //親エンジンのアドレス 01100 //画像 01101 vector<string> m_ImageName; //画像名 01102 //テキストの表示速度 01103 int m_TextSpeed; //テキストの表示速度 01104 unsigned int m_DefaultTextSpeed; //テキストの表示速度(デフォルト) 01105 //テキストウインドウ(共通) 01106 bool m_TextWindowIsShow; //表示状態 01107 bool m_TextWindowIsForceShow; //表示状態(強制表示か) 01108 bool m_TextWindowIsUsedImage; //描画に画像を使用するか? 01109 BYTE m_TextWindowA; //透過度 01110 //テキストウインドウ(画像) 01111 string m_TextWindowImageName; //画像名 01112 int m_TextWindowX, m_TextWindowY; //転送先座標 01113 RECT m_TextWindowImageSrcRect; //転送元矩形 01114 //テキストウインドウ(描画) 01115 RECT m_TextWindowPosition; //描画矩形 01116 COLORREF m_TextWindowColor, m_TextWindowBorderColor; //内部色、枠の色 01117 unsigned int m_TextWindowBorder; //枠の太さ 01118 //テキスト/発言者名 01119 string m_RubyFont; //ルビのフォント 01120 unsigned int m_RubySize; //ルビのサイズ 01121 int m_TextX, m_TextY; //テキストの座標 01122 int m_TalkerX, m_TalkerY; //発言者名の座標 01123 unsigned int m_TextMaxWidth, m_TextMaxHeight; //テキストの最大横幅/縦幅 01124 unsigned int m_TalkerMaxWidth, m_TalkerMaxHeight; //発言者名の最大横幅/縦幅 01125 COLORREF m_TextColor, m_TalkerColor; //テキスト/発言者名のカラー 01126 string m_TextFont, m_TalkerFont; //テキスト/発言者名のフォント 01127 unsigned int m_TextSize, m_TalkerSize; //テキスト/発言者名のサイズ 01128 TextTokenSection m_Text, m_Talker; //テキスト/発言者名 01129 //テキストカーソル 01130 unsigned int m_TextCursorMode; //状態 01131 bool m_TextCursorIsShowN, m_TextCursorIsShowC, m_TextCursorIsShowG, m_TextCursorIsShowB; 01132 //表示状態 01133 string m_TextCursorImageNameN, m_TextCursorImageNameC, m_TextCursorImageNameG, m_TextCursorImageNameB; 01134 //画像名 01135 int m_TextCursorXN, m_TextCursorXC, m_TextCursorXG, m_TextCursorXB; //転送先座標(X) 01136 int m_TextCursorYN, m_TextCursorYC, m_TextCursorYG, m_TextCursorYB; //転送先座標(Y) 01137 BYTE m_TextCursorAN, m_TextCursorAC, m_TextCursorAG, m_TextCursorAB; //透過度 01138 RECT m_TextCursorImageSrcRectN, m_TextCursorImageSrcRectC, m_TextCursorImageSrcRectG, m_TextCursorImageSrcRectB; 01139 //転送元矩形 01140 bool m_TextCursorIsABSN, m_TextCursorIsABSC, m_TextCursorIsABSG, m_TextCursorIsABSB; //座標設定 01141 //選択肢(共通) 01142 int m_SelectState; //押下状態 01143 string m_SelectVar; //関連付け変数 01144 vector<TextTokenSection> m_SelectText; //選択肢の文章 01145 unsigned int m_SelectTextSize; //文章のサイズ 01146 string m_SelectTextFont; //文章のフォント 01147 vector<bool> m_SelectIsPushed; //クリック検知用 01148 vector<bool> m_SelectIsCursored; //カーソル検知用 01149 unsigned int m_SelectTextMaxWidth, m_SelectTextMaxHeight; //テキストの最大横幅/縦幅 01150 COLORREF m_SelectTextNColor, m_SelectTextCColor, m_SelectTextHColor; //テキストのカラー(通常時/カーソル時/ホールド時) 01151 unsigned int m_SelectWindowUnderSpace; //ウインドウと画面下端の間隔 01152 string m_SelectCursorSE, m_SelectClickSE; //SE(カーソル時/クリック時) 01153 bool m_SelectWindowIsUsedImage; //描画に画像を使用するか? 01154 BYTE m_SelectWindowA; //透過度 01155 //選択肢(画像) 01156 string m_SelectWindowImageName; //画像名 01157 RECT m_SelectWindowImageSrcRectN, m_SelectWindowImageSrcRectC, m_SelectWindowImageSrcRectH; 01158 //転送元矩形 01159 //選択肢(描画) 01160 unsigned int m_SelectWindowAroundSpace; //テキストと枠の間隔 01161 COLORREF m_SelectWindowNColor, m_SelectWindowCColor, m_SelectWindowHColor; //内部色(通常字/カーソル時/ホールド時) 01162 unsigned int m_SelectWindowBorder; //枠の太さ 01163 COLORREF m_SelectWindowBorderNColor, m_SelectWindowBorderCColor, m_SelectWindowBorderHColor; 01164 //枠の色(通常字/カーソル時/ホールド時) 01165 //画面の消去色 01166 COLORREF m_ClearColor; //画面の消去色(設定) 01167 COLORREF m_PresentClearColor; //画面の消去色(現在) 01168 }; 01169 01170 //グラフィック用デバイス(ヌルデバイス) 01176 class NullDrawManager : public BaseDrawManager{ 01177 public: 01181 NullDrawManager(){} //デフォルトコンストラクタ 01182 01183 unsigned int GetScreenWidth() const{ return(0); } //画面の横幅を取得 01184 unsigned int GetScreenHeight() const{ return(0); } //画面の縦幅を取得 01185 bool GetFullScreen() const{ return(false); } //フルスクリーンか否かを取得 01186 void SetFullScreen(bool IsFullScreen){} //フルスクリーンか否かを設定 01187 void Flip(){} //画面を更新 01188 protected: 01189 bool _LoadImage(const char* FileName){ return(false); } 01190 bool _UnloadImage(const char* FileName){ return(false); } 01191 void _Clear(COLORREF Color){} 01192 void _Blt(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree){} 01193 void _AddBlt(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree){} 01194 void _SubBlt(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree){} 01195 void _BltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree){} 01196 void _AddBltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree){} 01197 void _SubBltFast(const string& FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree){} 01198 void _DrawFreeText(const string& Text, int x, int y, BYTE a, const string& Font, unsigned int Size, COLORREF Color, bool IsBold, bool IsItalic, float Degree){} 01199 void _DrawRect(RECT Rect, COLORREF Color, BYTE a, float Degree){} 01200 private: 01201 NullDrawManager(const NullDrawManager&); //コピーコンストラクタ(禁止) 01202 NullDrawManager& operator =(const NullDrawManager&); //代入演算子(禁止) 01203 }; 01204 01205 //グラフィック用デバイスのアクセッサ(インターフェース) 01211 class IDMAccessor{ 01212 public: 01216 virtual void Clear() = 0; //画面を消去 01222 virtual void UpdateClearColor() = 0; //画面の消去色(現在)を更新 01227 virtual COLORREF GetPresentClearColor() = 0; //画面の消去色(現在)を取得 01232 virtual void SetPresentClearColor(COLORREF Color) = 0; //画面の消去色(現在)を設定 01244 virtual void Blt(const char* FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree) = 0; 01245 //通常転送(抜き色あり) 01257 virtual void AddBlt(const char* FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree) = 0; 01258 //加色転送(抜き色あり) 01270 virtual void SubBlt(const char* FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree) = 0; 01271 //減色転送(抜き色あり) 01283 virtual void BltFast(const char* FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree) = 0; 01284 //通常転送(抜き色なし) 01296 virtual void AddBltFast(const char* FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree) = 0; 01297 //加色転送(抜き色なし) 01309 virtual void SubBltFast(const char* FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX, float ScalingY, float Degree) = 0; 01310 //減色転送(抜き色なし) 01318 virtual void DrawFreeText(const TextTokenSection& Text, int x, int y, BYTE a) = 0; //文字列を描画(1) 01327 virtual void DrawFreeText(const TextTokenSection& Text, int x, int y, BYTE a, COLORREF Color) = 0; 01328 //文字列を描画(2) 01344 virtual void DrawFreeText(const char* Text, int x, int y, BYTE a, const char* Font, unsigned int Size, COLORREF Color, bool IsBold, bool IsItalic, float Degree) = 0; 01345 //文字列を描画(3) 01353 virtual void DrawRect(RECT Rect, COLORREF Color, BYTE a, float Degree) = 0; //矩形を描画 01362 virtual void DrawBorderRect(RECT Rect, COLORREF Color, BYTE a, unsigned int Border, COLORREF BorderColor) = 0; 01363 //縁付矩形を描画 01364 }; 01365 01366 //グラフィック用デバイスのアクセッサ 01373 class DMAccessor : public IDMAccessor{ 01374 public: 01378 DMAccessor(){} //デフォルトコンストラクタ 01379 01384 void SetParent(INovelEngine* Parent); //親エンジンを設定 01385 01386 void Clear(); //画面を消去 01387 void UpdateClearColor(); //画面の消去色(現在)を更新 01388 COLORREF GetPresentClearColor(); //画面の消去色(現在)を取得 01389 void SetPresentClearColor(COLORREF Color); //画面の消去色(現在)を設定 01390 void Blt(const char* FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX = 1.0f, float ScalingY = 1.0f, float Degree = 0.0f); 01391 //通常転送(抜き色あり) 01392 void AddBlt(const char* FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX = 1.0f, float ScalingY = 1.0f, float Degree = 0.0f); 01393 //加色転送(抜き色あり) 01394 void SubBlt(const char* FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX = 1.0f, float ScalingY = 1.0f, float Degree = 0.0f); 01395 //減色転送(抜き色あり) 01396 void BltFast(const char* FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX = 1.0f, float ScalingY = 1.0f, float Degree = 0.0f); 01397 //通常転送(抜き色なし) 01398 void AddBltFast(const char* FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX = 1.0f, float ScalingY = 1.0f, float Degree = 0.0f); 01399 //加色転送(抜き色なし) 01400 void SubBltFast(const char* FileName, int x, int y, BYTE a, RECT SrcRect, float ScalingX = 1.0f, float ScalingY = 1.0f, float Degree = 0.0f); 01401 //減色転送(抜き色なし) 01402 void DrawFreeText(const TextTokenSection& Text, int x, int y, BYTE a); //文字列を描画(1) 01403 void DrawFreeText(const TextTokenSection& Text, int x, int y, BYTE a, COLORREF Color); //文字列を描画(2) 01404 void DrawFreeText(const char* Text, int x, int y, BYTE a, const char* Font, unsigned int Size, COLORREF Color, bool IsBold, bool IsItalic, float Degree = 0.0f); 01405 //文字列を描画(3) 01406 void DrawRect(RECT Rect, COLORREF Color, BYTE a, float Degree = 0.0f); //矩形を描画 01407 void DrawBorderRect(RECT Rect, COLORREF Color, BYTE a, unsigned int Border, COLORREF BorderColor); 01408 //縁付矩形を描画 01409 private: 01410 INovelEngine* Outer; //親エンジンのアドレス 01411 01412 DMAccessor(const DMAccessor&); //コピーコンストラクタ(禁止) 01413 DMAccessor& operator =(const DMAccessor&); //代入演算子(禁止) 01414 }; 01415 01416 #ifdef __cplusplus 01417 extern "C"{ 01418 #endif 01419 01420 //アクセッサを取得/設定 01425 __declspec(dllexport) IDMAccessor* GetDMAccessor(); //アクセッサを取得 01430 __declspec(dllexport) void SetDMAccessor(INovelEngine* Parent); //アクセッサを設定 01431 01432 #ifdef __cplusplus 01433 } 01434 #endif 01435 01436 } 01437 } 01438 01439 #endif