00001
00002
00003
00004
00005
00006
00007
00008 #ifndef _ERROR_H_
00009 #define _ERROR_H_
00010
00011 #include <string>
00012 #include <sstream>
00013 #include "defines.h"
00014 #include "configFile.h"
00015
00016 using namespace std;
00017
00018 namespace zak {
00019
00020 class ZAKENGINE_API Message {
00021 public:
00022 enum MessageCodes {
00023 NoError=0,
00024 CreateWindowError=1,
00025 D3DDeviceError=2,
00026 GetAdapterDisplayError=3,
00027 CreateDeviceError=4,
00028 GetViewportError=5,
00029 ProjectionMatrixError=6,
00030 Supported=7,
00031 NotSupported=8,
00032 VertexProcess=9,
00033 FullscreenMode=10,
00034 WindowedMode=11,
00035 ScreenWidth=12,
00036 ScreenHeight=13,
00037 AdapterCheckBegin=14,
00038 AdapterAvailable=15,
00039 Adapter=16,
00040 Driver=17,
00041 DriverDesc=18,
00042 DriverVersion=19,
00043 PixelFormatCheckBegin=20,
00044 Format=21,
00045 TexArrayFull=22,
00046 ConfigIniNotFound=23,
00047 InitializingEngine=24,
00048 EngineInitialized=25,
00049 RendererLoadTextureErrror=26,
00050 InvalidData=27,
00051 NotAvailable=28,
00052 OutOfVideoMemory=29,
00053 InvalidCall=30,
00054 OutOfMemory=31,
00055 CantCreateFont=32,
00056 SSEOperativeSystemSupported=33,
00057 Processor=34,
00058 CheckProcessor=35,
00059 CheckAudioDevices=36,
00060 InitGame=37,
00061 BitsPerPixel=38,
00062 VSync=39,
00063 Refresh=40,
00064 CantRead=41,
00065 MissingFileNameInDefFile=42,
00066 CannotInitFrames=43,
00067 FramesCount=44,
00068 AnimationSpeed=45,
00069 InitInput=46,
00070 InputEnumError=47,
00071 CreateDeviceJoy=48,
00072 DeviceNotReg=49,
00073 InvalidParam=50,
00074 NoInterface=51,
00075 NotInitialized=52,
00076 CoopLevel=53,
00077 DataFormat=54,
00078 Device=55,
00079 Number=56,
00080 MsgBox=57,
00081 ScriptCompile=58,
00082 ScriptException=59,
00083 FuncProt=60,
00084 Line=61,
00085 Module=62,
00086 Section=63,
00087 Description=64,
00088 NoContext=65,
00089 CreateNewFile=66,
00090 CantCreateFile=67,
00091 AnimationSpeedFPS=68,
00092 InvalidStatement=69,
00093 UnrecognizedCommand=70,
00094 CommandList=71,
00095 Loading=72,
00096 Compiled=73,
00097 Added=74,
00098 Removed=75,
00099 ScriptListCleared=76,
00100 ExecuteScript=77,
00101 Usage=78,
00102 };
00103
00104 static bool CreateMsgFile(string filename);
00105 static int getLastErrorNum();
00106 static string getLastMessage();
00107
00108 static string getMessage(int msgNum);
00109 static void setError(int msgNum);
00110 static void setLanguaje(string lang);
00111 static string getLanguaje();
00112 static bool openDefaultMsgFile();
00113 static bool openMsgFile(string filename);
00114 static void closeMsgFile();
00115
00116 private:
00117 static int _message;
00118 static string _description;
00119 static string _languaje;
00120 static string _msgFilename;
00121 static FILE _msgFile;
00122 static ConfigFile* _parser;
00123
00124 };
00125
00126 }
00127
00128 #endif