| @@ -74,15 +74,16 @@ static inline int isnan(float f) | |||||
| #endif | #endif | ||||
| // Base types | // Base types | ||||
| #include "lol/debug.h" | |||||
| #include "lol/math/math.h" | |||||
| #include "lol/math/half.h" | |||||
| #include "lol/math/real.h" | |||||
| #include "lol/math/vector.h" | |||||
| #include <lol/debug.h> | |||||
| #include <lol/core/array.h> | |||||
| #include <lol/core/string.h> | |||||
| #include <lol/math/math.h> | |||||
| #include <lol/math/half.h> | |||||
| #include <lol/math/real.h> | |||||
| #include <lol/math/vector.h> | |||||
| #include "numeric.h" | #include "numeric.h" | ||||
| #include "timer.h" | #include "timer.h" | ||||
| #include "thread/thread.h" | #include "thread/thread.h" | ||||
| #include "array.h" | |||||
| // Static classes | // Static classes | ||||
| #include "log.h" | #include "log.h" | ||||
| @@ -0,0 +1,75 @@ | |||||
| // | |||||
| // Lol Engine | |||||
| // | |||||
| // Copyright: (c) 2010-2012 Sam Hocevar <sam@hocevar.net> | |||||
| // This program is free software; you can redistribute it and/or | |||||
| // modify it under the terms of the Do What The Fuck You Want To | |||||
| // Public License, Version 2, as published by Sam Hocevar. See | |||||
| // http://sam.zoy.org/projects/COPYING.WTFPL for more details. | |||||
| // | |||||
| // | |||||
| // The String class | |||||
| // ---------------- | |||||
| // A very simple String class, based on Array. | |||||
| // | |||||
| #if !defined __LOL_STRING_H__ | |||||
| #define __LOL_STRING_H__ | |||||
| #include <lol/core/array.h> | |||||
| namespace lol | |||||
| { | |||||
| class String : protected Array<char> | |||||
| { | |||||
| private: | |||||
| typedef Array<char> super; | |||||
| public: | |||||
| inline String() | |||||
| : Array() | |||||
| { | |||||
| Push('\0'); | |||||
| } | |||||
| inline String(char const *str) | |||||
| : Array() | |||||
| { | |||||
| do | |||||
| { | |||||
| Push(*str); | |||||
| } | |||||
| while (*str++); | |||||
| } | |||||
| inline char &operator [](int n) | |||||
| { | |||||
| return ((super &)*this)[n]; | |||||
| } | |||||
| inline char const &operator [](int n) const | |||||
| { | |||||
| return ((super const &)*this)[n]; | |||||
| } | |||||
| inline String operator +(String const &s) | |||||
| { | |||||
| String ret(*this); | |||||
| return ret += s; | |||||
| } | |||||
| inline String operator +=(String const &s) | |||||
| { | |||||
| /* Be careful, we have a trailing zero we don't want! */ | |||||
| --m_count; | |||||
| (super &)*this += (super const &)s; | |||||
| return *this; | |||||
| } | |||||
| }; | |||||
| } /* namespace lol */ | |||||
| #endif // __LOL_STRING_H__ | |||||
| @@ -300,7 +300,6 @@ | |||||
| </ItemGroup> | </ItemGroup> | ||||
| <ItemGroup> | <ItemGroup> | ||||
| <ClInclude Include="application\application.h" /> | <ClInclude Include="application\application.h" /> | ||||
| <ClInclude Include="array.h" /> | |||||
| <ClInclude Include="audio.h" /> | <ClInclude Include="audio.h" /> | ||||
| <ClInclude Include="bitfield.h" /> | <ClInclude Include="bitfield.h" /> | ||||
| <ClInclude Include="bullet\btBulletCollisionCommon.h" /> | <ClInclude Include="bullet\btBulletCollisionCommon.h" /> | ||||
| @@ -583,6 +582,7 @@ | |||||
| <ClInclude Include="log.h" /> | <ClInclude Include="log.h" /> | ||||
| <ClInclude Include="loldebug.h" /> | <ClInclude Include="loldebug.h" /> | ||||
| <ClInclude Include="lolgl.h" /> | <ClInclude Include="lolgl.h" /> | ||||
| <ClInclude Include="lol\core\array.h" /> | |||||
| <ClInclude Include="lol\debug.h" /> | <ClInclude Include="lol\debug.h" /> | ||||
| <ClInclude Include="lol\math\half.h" /> | <ClInclude Include="lol\math\half.h" /> | ||||
| <ClInclude Include="lol\math\math.h" /> | <ClInclude Include="lol\math\math.h" /> | ||||