00001 /************************************************************************/ 00002 /* Ex Nihlo Engine by Hermanns Christophe */ 00003 /************************************************************************/ 00004 /* This program is free software; you can redistribute it and/or */ 00005 /* modify it under the terms of the GNU General Public License */ 00006 /* as published by the Free Software Foundation; either version 2 */ 00007 /* of the License, or (at your option) any later version. */ 00008 /* */ 00009 /* This program is distributed in the hope that it will be useful, */ 00010 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */ 00011 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. */ 00012 /* */ 00013 /* See the GNU General Public License for more details. */ 00014 /* */ 00015 /* You should have received a copy of the GNU General Public License */ 00016 /* along with this program; if not, write to the Free Software */ 00017 /* Foundation, Inc., 59 Temple Place - Suite 330, */ 00018 /* Boston, MA 02111-1307, USA. */ 00019 /* */ 00020 /* If you use a important part of this code please send me a mail */ 00021 /* I just want to see where my code go thks :) */ 00022 /************************************************************************/ 00023 00024 /************************************************************************/ 00025 /* Contact */ 00026 /************************************************************************/ 00027 /* ExNihilo Website :www.ploksoftware.org */ 00028 /* */ 00029 /* Hermanns Christophe ExNihilo creator and main programmer */ 00030 /* */ 00031 /* Mail : Data@ploksoftware.org */ 00032 /* ICQ : 8030901 */ 00033 /* MSN Messenger : Data_7@hotmail.com */ 00034 /* */ 00035 /* */ 00036 /************************************************************************/ 00037 00038 /************************************************************************/ 00039 /* File Description */ 00040 /************************************************************************/ 00041 /* File Name :ExManagerConsole.h */ 00042 /* */ 00043 /* Start Date :03/15/2002 */ 00044 /* */ 00045 /* Last Update :06/20/2003 */ 00046 /* */ 00047 /* File Description : */ 00048 /* */ 00049 /* For update of this file check : www.ploksoftware.org */ 00050 /************************************************************************/ 00051 00052 #ifndef __EXMANAGERCONSOLE_H__ 00053 #define __EXMANAGERCONSOLE_H__ 00054 //------------------------------------------------------------------------ 00055 //Includes 00056 //------------------------------------------------------------------------ 00057 #include "ExDefine.h" 00058 #include "ExNihiloNameSpace.h" 00059 #include "ExCCommand.h" 00060 #include "ExCAction.h" 00061 //#include <stdarg.h> 00062 //------------------------------------------------------------------------ 00063 #include "Math/ExMath.h" 00064 //------------------------------------------------------------------------ 00065 #include "Manager/ExManager.h" 00066 #include "Manager/ExManagerWindow.h" 00067 //------------------------------------------------------------------------ 00068 #include "Manager/ManagerObject/ExManagerTexture.h" 00069 //------------------------------------------------------------------------ 00070 //Define 00071 //------------------------------------------------------------------------ 00072 #define HIDE 0 00073 #define HALF 1 00074 #define FULL 2 00075 #define HIDETOHALF 3 00076 #define HIDETOFULL 4 00077 #define HALFTOFULL 5 00078 #define FULLTOHALF 6 00079 #define FULLTOHIDE 7 00080 #define HALFTOHIDE 8 00081 #define PREDIFINEDCOMMAND 10 00082 //------------------------------------------------------------------------ 00083 class ExManagerConsole : public ExManager 00084 { 00085 private: 00086 //------------------------------------------------------------------------ 00087 // Variable 00088 //------------------------------------------------------------------------ 00089 ExManagerWindow *ManagerWindow; 00090 ExManagerTexture *ManagerTexture; 00091 int m_ConsoleState; //HIDE,HALF,FULL 00092 int m_LineCounter; 00093 int m_ConsoleTrans; 00094 int m_NextConsoleState; 00095 int m_ConsoleTransPalier; 00096 bool console_move; 00097 int m_Move; 00098 bool LogConsol; 00099 bool m_BackGroundTextureState; 00100 bool m_Blending; 00101 float m_fBlending; 00102 float m_fBackGroundBlue; 00103 float m_fBackGroundRed; 00104 float m_fBackGroundGreen; 00105 int m_LineToStar; 00106 int m_LineInConsol; 00107 std::ofstream logfilecsl; 00108 int PosIntoBuffOldCommand; 00109 00110 std::string m_BackGroundTexture; 00111 std::string m_BuffCommand; 00112 std::vector<std::string> m_BuffOldCommand; 00113 00114 typedef std::pair<std::string,int> StringAction; 00115 std::vector<StringAction> m_VecStringAction; 00116 std::vector<StringAction>::iterator m_ItVecStringAction; 00117 00118 std::vector<std::string> m_BufferConsol; 00119 std::vector<std::string>::reverse_iterator m_RItBufferConsol; 00120 std::vector<std::string>::iterator m_ItBufferConsol; 00121 00122 float TabTextures[8],TabVertices[8]; 00123 //------------------------------------------------------------------------ 00124 // Methode 00125 //------------------------------------------------------------------------ 00126 void AddStringAction(std::string String,int Action); 00127 void AddStringAction(StringAction StrAction); 00128 ExCAction ApplyBuffCommand(void); 00129 void WriteInDaFile (std::string str); 00130 00131 void UpdateConsolBuffer(void); 00132 //------------------------------------------------------------------------ 00133 // Singleton creation 00134 //------------------------------------------------------------------------ 00135 static bool m_flag; 00136 static ExManagerConsole *m_instance; 00137 ExManagerConsole(void); 00138 ~ExManagerConsole(void); 00139 public: 00140 static ExManagerConsole* CreateSingleton(void); 00141 //------------------------------------------------------------------------ 00142 // Methode 00143 //------------------------------------------------------------------------ 00144 inline void SetManagerWindow(ExManagerWindow *Window){ManagerWindow = Window;} 00145 inline void SetManagerTexture(ExManagerTexture *Texture){ManagerTexture = Texture;} 00146 00147 void ClearConsol(void); 00148 void Reset(void); 00149 void Write (const char *); 00150 void Draw(void); 00151 00152 void Init(void); 00153 int NextAviableState(void); 00154 void SetConsoleState(int state); 00155 int GetConsoleState (void) { return m_ConsoleState; } 00156 void ConsoleMove (bool); 00157 bool isConsoleMove (void) { return console_move; } 00158 void SetConsoleBackGroudTexture(std::string FileName); 00159 inline void SetConsoleBackGroudTextureState(bool state){m_BackGroundTextureState=state;} 00160 inline void SetConsoleBackGroudBlendingState(bool state){m_Blending=state;} 00161 inline void SetConsoleBackGroudBlending(float blending){m_fBlending=blending;} 00162 inline void SetConsoleBackGroudColorRed(float value){m_fBackGroundRed=value;} 00163 inline void SetConsoleBackGroudColorGreen(float value){m_fBackGroundGreen=value;} 00164 inline void SetConsoleBackGroudColorBlue(float value){m_fBackGroundBlue=value;} 00165 inline void SetConsoleBackGroudColor(float R,float G,float B ){m_fBackGroundBlue=B;m_fBackGroundGreen=G;m_fBackGroundRed=R;} 00166 00167 void LoadStringActionFile(const char *FileName); 00168 00169 ExCAction InputCommand(ExCCommand Command); 00170 void ListConsoleCommand(void); 00171 00172 void LineUp(void); 00173 void LineDown(void); 00174 00175 ExCAction InputAction(ExCAction Action); 00176 }; 00177 //------------------------------------------------------------------------ 00178 #endif //__EXMANAGERCONSOLE_H__