diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Asura.Engine/Containers/Map.h | 17 | ||||
-rw-r--r-- | Source/Asura.Engine/Containers/String.h | 78 | ||||
-rw-r--r-- | Source/Asura.Engine/Containers/StringMap.hpp | 32 | ||||
-rw-r--r-- | Source/Asura.Engine/Graphics/Image.h | 69 | ||||
-rw-r--r-- | Source/Asura.Engine/Graphics/Shader.h | 10 | ||||
-rw-r--r-- | Source/Asura.Engine/Map.cpp (renamed from Source/Asura.Engine/Containers/Map.cpp) | 0 | ||||
-rw-r--r-- | Source/Asura.Engine/Map.h | 14 | ||||
-rw-r--r-- | Source/Asura.Engine/Stack.cpp (renamed from Source/Asura.Engine/Containers/Stack.cpp) | 0 | ||||
-rw-r--r-- | Source/Asura.Engine/Stack.h (renamed from Source/Asura.Engine/Containers/Stack.h) | 0 | ||||
-rw-r--r-- | Source/Asura.Engine/String.cpp (renamed from Source/Asura.Engine/Containers/String.cpp) | 0 | ||||
-rw-r--r-- | Source/Asura.Engine/String.h | 75 | ||||
-rw-r--r-- | Source/Asura.Engine/StringMap.cpp (renamed from Source/Asura.Engine/Containers/StringMap.cpp) | 0 | ||||
-rw-r--r-- | Source/Asura.Engine/StringMap.hpp | 29 | ||||
-rw-r--r-- | Source/Asura.Engine/UnorderedMap.hpp (renamed from Source/Asura.Engine/Containers/UnorderedMap.hpp) | 0 | ||||
-rw-r--r-- | Source/Asura.Engine/Vector.hpp (renamed from Source/Asura.Engine/Containers/Vector.hpp) | 8 | ||||
-rw-r--r-- | Source/Asura.Framework/main.cpp | 0 |
16 files changed, 129 insertions, 203 deletions
diff --git a/Source/Asura.Engine/Containers/Map.h b/Source/Asura.Engine/Containers/Map.h deleted file mode 100644 index 999971c..0000000 --- a/Source/Asura.Engine/Containers/Map.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef __ASURA_ENGINE_MAP_H__ -#define __ASURA_ENGINE_MAP_H__ - -#include <map> - -namespace AsuraEngine -{ - namespace Containers - { - - template<typename key_type, typename value_type> - using Map = std::map<key_type, value_type>; - - } -} - -#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Containers/String.h b/Source/Asura.Engine/Containers/String.h deleted file mode 100644 index 4739b44..0000000 --- a/Source/Asura.Engine/Containers/String.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef __ASURA_ENGINE_STRING_H__ -#define __ASURA_ENGINE_STRING_H__ - -#include <string> - -namespace AsuraEngine -{ - namespace Containers - { - - /// - /// װstd::string - /// - class String : public std::string - { - public: - inline String() - : std::string() - { - } - - inline String(const std::string& str) - : std::string(str) - { - } - - inline String(const String& str) - : std::string(str) - { - } - - inline String(const char* str) - : std::string(str) - { - } - - inline String& operator = (const String& str) - { - std::string::operator=(str); - return *this; - } - - inline operator const char* () const - { - return this->c_str(); - } - - inline const char* str() const - { - return this->c_str(); - } - - inline String(const String& s2, size_type pos2, size_type len2) - : std::string(s2, pos2, len2) - { - } - - inline String(const char* buf, size_type bufsize) - : std::string(buf, bufsize) - { - } - - inline String(size_type repetitions, char c) - : std::string(repetitions, c) - { - } - - inline int length() const - { - return size(); - } - - }; - - } -} - -#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Containers/StringMap.hpp b/Source/Asura.Engine/Containers/StringMap.hpp deleted file mode 100644 index 208f16b..0000000 --- a/Source/Asura.Engine/Containers/StringMap.hpp +++ /dev/null @@ -1,32 +0,0 @@ -#ifndef __ASURA_ENGINE_STRINGMAP_H__ -#define __ASURA_ENGINE_STRINGMAP_H__ - -#include "String.h" - -namespace AsuraEngine -{ - namespace Containers - { - - /// - /// һ˫һһӦӳ䣬shader uniformsstatemathine state parameterID - /// - template<typename key_type> - class StringMap - { - public: - - bool ContainsKey(const key_type& key); - - bool ContainsString(const String& str); - - String GetStringByKey(const key_type& key); - - key_type GetKeyByString(const String& str); - - }; - - } -} - -#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Graphics/Image.h b/Source/Asura.Engine/Graphics/Image.h index 503baab..e84dd6c 100644 --- a/Source/Asura.Engine/Graphics/Image.h +++ b/Source/Asura.Engine/Graphics/Image.h @@ -1,9 +1,9 @@ #ifndef __ASURA_ENGINE_IMAGE_H__ #define __ASURA_ENGINE_IMAGE_H__ -#include "Containers/StringMap.hpp" -#include "Containers/String.h" -#include "Containers/Map.h" +#include "StringMap.hpp" +#include "String.h" +#include "Map.h" #include "Math/Vector2.h" #include "Manager.hpp" #include "Texture.h" @@ -57,69 +57,6 @@ namespace AsuraEngine }; - /// - /// - /// - class ImageManager : public Manager - { - public: - - /// - /// ͨIDȡ·dzͼƬString::Null - /// - Containers::String GetImagePath(uint ID); - - /// - /// ͨID·ȡIDûҵ0 - /// - uint GetImageID(const Containers::String& path); - - Image* GetImage(const Containers::String& path); - - Image* GetImage(const Containers::String& ID); - - uint AddImage(const Containers::String& path, Image* image); - - uint AddImage(Image* image); - - bool RemoveImage(uint ID); - - bool RemoveImage(Image* image); - - private: - - /// - /// еimage - /// - Containers::Map<uint, Image*> mImages; - - /// - /// image·IDӳ䡣Դ.asrimageͨ·õimageԲеimageڴmapС - /// imageֻͨIDȡԳҪID - /// - Containers::StringMap<uint> mImageIDs; - - }; - - /// - /// - /// - class ImageFactory : public Factory - { - public: - - /// - /// image pixelйimage - /// - Image* ReadBuffer(Color* pixels, int width, int height); - - /// - /// image externݲ - /// - Image* Decode(); - - }; - } } diff --git a/Source/Asura.Engine/Graphics/Shader.h b/Source/Asura.Engine/Graphics/Shader.h index aa5bd53..e15c6e0 100644 --- a/Source/Asura.Engine/Graphics/Shader.h +++ b/Source/Asura.Engine/Graphics/Shader.h @@ -3,8 +3,8 @@ #include "luax/luax.h" -#include "Containers/Map.h" -#include "Containers/StringMap.hpp" +#include "Map.h" +#include "StringMap.hpp" #include "Object.h" #include "Color.h" #include "Manager.hpp" @@ -33,12 +33,12 @@ namespace AsuraEngine /// /// shaderuniformsIDӳ䡣 /// - static Containers::StringMap<int> sUniformsID; + static StringMap<int> sUniformsID; /// /// uniformID /// - static int GetUniformID(const Containers::String& name); + static int GetUniformID(const String& name); /// /// ñ @@ -51,7 +51,7 @@ namespace AsuraEngine /// /// ӳuniforms IDlocation /// - Containers::Map<int, int> mLocations; + Map<int, int> mLocations; }; diff --git a/Source/Asura.Engine/Containers/Map.cpp b/Source/Asura.Engine/Map.cpp index e69de29..e69de29 100644 --- a/Source/Asura.Engine/Containers/Map.cpp +++ b/Source/Asura.Engine/Map.cpp diff --git a/Source/Asura.Engine/Map.h b/Source/Asura.Engine/Map.h new file mode 100644 index 0000000..3c538d4 --- /dev/null +++ b/Source/Asura.Engine/Map.h @@ -0,0 +1,14 @@ +#ifndef __ASURA_ENGINE_MAP_H__ +#define __ASURA_ENGINE_MAP_H__ + +#include <map> + +namespace AsuraEngine +{ + + template<typename key_type, typename value_type> + using Map = std::map<key_type, value_type>; + +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Containers/Stack.cpp b/Source/Asura.Engine/Stack.cpp index e69de29..e69de29 100644 --- a/Source/Asura.Engine/Containers/Stack.cpp +++ b/Source/Asura.Engine/Stack.cpp diff --git a/Source/Asura.Engine/Containers/Stack.h b/Source/Asura.Engine/Stack.h index e69de29..e69de29 100644 --- a/Source/Asura.Engine/Containers/Stack.h +++ b/Source/Asura.Engine/Stack.h diff --git a/Source/Asura.Engine/Containers/String.cpp b/Source/Asura.Engine/String.cpp index e69de29..e69de29 100644 --- a/Source/Asura.Engine/Containers/String.cpp +++ b/Source/Asura.Engine/String.cpp diff --git a/Source/Asura.Engine/String.h b/Source/Asura.Engine/String.h new file mode 100644 index 0000000..6d0ec3a --- /dev/null +++ b/Source/Asura.Engine/String.h @@ -0,0 +1,75 @@ +#ifndef __ASURA_ENGINE_STRING_H__ +#define __ASURA_ENGINE_STRING_H__ + +#include <string> + +namespace AsuraEngine +{ + + /// + /// װstd::string + /// + class String : public std::string + { + public: + inline String() + : std::string() + { + } + + inline String(const std::string& str) + : std::string(str) + { + } + + inline String(const String& str) + : std::string(str) + { + } + + inline String(const char* str) + : std::string(str) + { + } + + inline String& operator = (const String& str) + { + std::string::operator=(str); + return *this; + } + + inline operator const char* () const + { + return this->c_str(); + } + + inline const char* str() const + { + return this->c_str(); + } + + inline String(const String& s2, size_type pos2, size_type len2) + : std::string(s2, pos2, len2) + { + } + + inline String(const char* buf, size_type bufsize) + : std::string(buf, bufsize) + { + } + + inline String(size_type repetitions, char c) + : std::string(repetitions, c) + { + } + + inline int length() const + { + return size(); + } + + }; + +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Containers/StringMap.cpp b/Source/Asura.Engine/StringMap.cpp index e69de29..e69de29 100644 --- a/Source/Asura.Engine/Containers/StringMap.cpp +++ b/Source/Asura.Engine/StringMap.cpp diff --git a/Source/Asura.Engine/StringMap.hpp b/Source/Asura.Engine/StringMap.hpp new file mode 100644 index 0000000..92a157f --- /dev/null +++ b/Source/Asura.Engine/StringMap.hpp @@ -0,0 +1,29 @@ +#ifndef __ASURA_ENGINE_STRINGMAP_H__ +#define __ASURA_ENGINE_STRINGMAP_H__ + +#include "String.h" + +namespace AsuraEngine +{ + + /// + /// һ˫һһӦӳ䣬shader uniformsstatemathine state parameterID + /// + template<typename key_type> + class StringMap + { + public: + + bool ContainsKey(const key_type& key); + + bool ContainsString(const String& str); + + String GetStringByKey(const key_type& key); + + key_type GetKeyByString(const String& str); + + }; + +} + +#endif
\ No newline at end of file diff --git a/Source/Asura.Engine/Containers/UnorderedMap.hpp b/Source/Asura.Engine/UnorderedMap.hpp index e69de29..e69de29 100644 --- a/Source/Asura.Engine/Containers/UnorderedMap.hpp +++ b/Source/Asura.Engine/UnorderedMap.hpp diff --git a/Source/Asura.Engine/Containers/Vector.hpp b/Source/Asura.Engine/Vector.hpp index 5824b57..5e35312 100644 --- a/Source/Asura.Engine/Containers/Vector.hpp +++ b/Source/Asura.Engine/Vector.hpp @@ -5,12 +5,10 @@ namespace AsuraEngine { - namespace Containers - { - template<typename T> - using Vector = std::vector<T>; - } + template<typename T> + using Vector = std::vector<T>; + } #endif
\ No newline at end of file diff --git a/Source/Asura.Framework/main.cpp b/Source/Asura.Framework/main.cpp deleted file mode 100644 index e69de29..0000000 --- a/Source/Asura.Framework/main.cpp +++ /dev/null |