00001
00002
00003
00004
00005 #pragma once
00006 #ifndef __C_NUS_H__
00007 #define __C_NUS_H__
00008
00009 #include "NGE_CompileConfig.hpp"
00010 #include "Irrlicht/irrlicht.h"
00011
00012 using namespace irr;
00013 using namespace irr::core;
00014 using namespace irr::io;
00015 using namespace irr::scene;
00016 using namespace irr::video;
00017
00018 namespace nge
00019 {
00020 namespace core
00021 {
00022
00024
00025 class NUS
00026 {
00027 public:
00030 static stringw& reverseLetters(stringw& st)
00031 {
00032
00033 reverseArray((wchar_t*)st.c_str(), (wchar_t*)st.c_str() + st.size() - 1);
00034 return st;
00035 }
00036
00037 static EKEY_CODE convertIrrKeyCode(stringc str);
00038
00039 static c8* convertIrrKeyCode(EKEY_CODE value);
00040
00041 private:
00043 template <class T>
00044 static void reverseArray(T* beg, T* end)
00045 {
00046 _NGE_DEBUG_BREAK_IF(end<beg);
00047
00048 while (beg < end)
00049 {
00050 T tmp(*beg);
00051 *beg++ = *end;
00052 *end-- = tmp;
00053 }
00054 }
00055 };
00056
00058
00063 #define MAKE_HEB(str) NUS::reverseLetters( stringw((L##str)) )
00064
00067 IAnimatedMesh* createMeshFromFile(ISceneManager* smgr, IReadFile* file);
00068
00069 ITexture* addTextureFromSColor(IVideoDriver* driver, SColor const& color, c8* name, dimension2di const& size = dimension2di(512,512));
00070
00071 }
00072 }
00073
00074 #endif // __C_NUS_H__