00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <iostream>
00013 #include <irrlicht.h>
00014 #include "IrrLibBase.h"
00015 #include <strings.h>
00016 #include <sstream>
00017
00018 using namespace irr;
00019 using namespace core;
00020 using namespace scene;
00021 using namespace video;
00022 using namespace io;
00023 using namespace gui;
00024
00025 using namespace std;
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 void IrrLibBase::SetDriver(IVideoDriver* driver)
00065 {
00066 this->driver = driver;
00067 }
00068
00069 void IrrLibBase::SetSmgr(ISceneManager* smgr)
00070 {
00071 this->smgr = smgr;
00072 }
00073
00074 std::string IrrLibBase::wchar_to_stdstring (const wchar_t* wc)
00075 {
00076
00077
00078 char c[255];
00079 for(int t = 0; wc[t] != '\0'; t++)
00080 c[t] = (char)wc[t];
00081
00082
00083
00084
00085 std::stringstream ss;
00086 ss << c;
00087
00088 return ss.str();
00089 }
00090
00091 std::string IrrLibBase::int_to_string (int t)
00092 {
00093 std::stringstream ss;
00094 ss << t;
00095 return ss.str();
00096 }
00097
00098 std::string IrrLibBase::stringw_to_stdstring(irr::core::stringw sw)
00099 {
00100 std::stringstream ss;
00101 ss << sw.c_str();
00102 return ss.str();
00103 }
00104 irr::core::stringw IrrLibBase::stdstring_to_stringw(std::string ss)
00105 {
00106 stringw tmpw(ss.c_str());
00107 return tmpw;
00108 }
00109
00110 void IrrLibBase::SetDevice(irr::IrrlichtDevice *device)
00111 {
00112 this->device = device;
00113 }
00114
00115 void IrrLibBase::init()
00116 {
00117
00118 }
00119
00120
00121
00122
00123
00124
00125
00126