Przeglądaj źródła

Fixed ResourceRefList serialization to XML.
Added direct HashMap/HashSet compatibility to StringHash & ShortStringHash classes.

Lasse Öörni 14 lat temu
rodzic
commit
95b8dfac47

+ 4 - 0
Engine/Core/StringHash.h

@@ -91,6 +91,8 @@ public:
     const unsigned* GetData() const { return &value_; }
     /// Return as string
     String ToString() const;
+    /// Return hash value for HashSet & HashMap
+    unsigned ToHash() const { return value_; }
     
     /// Calculate hash value case-insensitively from a C string
     static unsigned Calculate(const char* str);
@@ -174,6 +176,8 @@ public:
     const unsigned short* GetData() const { return &value_; }
     /// Return as string
     String ToString() const;
+    /// Return hash value for HashSet & HashMap
+    unsigned ToHash() const { return value_; }
     
     /// Calculate hash value case-insensitively from a C string
     static unsigned short Calculate(const char* str);

+ 1 - 1
Engine/Graphics/CMakeLists.txt

@@ -23,7 +23,7 @@ include_directories (
 
 # Define target & libraries to link
 add_library (${TARGET_NAME} STATIC ${SOURCE_FILES})
-target_link_libraries (${TARGET_NAME} Container Core GLee Math Resource Scene)
+target_link_libraries (${TARGET_NAME} Container Core Math Resource Scene)
 	
 if (USE_OPENGL)
     target_link_libraries (${TARGET_NAME} GLee)

+ 1 - 1
Engine/Resource/XMLElement.cpp

@@ -545,7 +545,7 @@ ResourceRefList XMLElement::GetResourceRefList() const
 {
     ResourceRefList ret;
     
-    Vector<String> values = GetAttribute("value").Split(' ');
+    Vector<String> values = GetAttribute("value").Split(';');
     if (values.Size() >= 1)
     {
         ret.type_ = ShortStringHash(values[0]);