浏览代码

Changed several structures to HashMap / HashSet for better performance.

Lasse Öörni 13 年之前
父节点
当前提交
c48f640a18

+ 2 - 2
Engine/Container/Hash.h

@@ -26,13 +26,13 @@
 /// Pointer hash function.
 template <class T> unsigned MakeHash(T* value)
 {
-    return ((unsigned)value) / sizeof(T);
+    return (unsigned)value;
 }
 
 /// Const pointer hash function.
 template <class T> unsigned MakeHash(const T* value)
 {
-    return ((unsigned)value) / sizeof(T);
+    return (unsigned)value;
 }
 
 /// Generic hash function.

+ 4 - 4
Engine/Container/HashBase.h

@@ -32,18 +32,18 @@ struct HashNodeBase
 {
     /// Construct.
     HashNodeBase() :
+        down_(0),
         prev_(0),
-        next_(0),
-        down_(0)
+        next_(0)
     {
     }
     
+    /// Next node in the bucket.
+    HashNodeBase* down_;
     /// Previous node.
     HashNodeBase* prev_;
     /// Next node.
     HashNodeBase* next_;
-    /// Next node in the bucket.
-    HashNodeBase* down_;
 };
 
 /// Hash set/map iterator base class.

+ 2 - 0
Engine/Container/Map.h

@@ -322,6 +322,7 @@ private:
     Node* Root() const { return reinterpret_cast<Node*>(root_); }
     
     /// Find the node with smallest key.
+    /// \todo Should be cached
     Node* FindFirst() const
     {
         Node* node = Root();
@@ -331,6 +332,7 @@ private:
     }
     
     /// Find the node with largest key.
+    /// \todo Should be cached
     Node* FindLast() const
     {
         Node* node = Root();

+ 2 - 0
Engine/Container/Set.h

@@ -273,6 +273,7 @@ private:
     Node* Root() const { return reinterpret_cast<Node*>(root_); }
     
     /// Find the node with smallest key.
+    /// \todo Should be cached
     Node* FindFirst() const
     {
         Node* node = Root();
@@ -282,6 +283,7 @@ private:
     }
     
     /// Find the node with largest key.
+    /// \todo Should be cached
     Node* FindLast() const
     {
         Node* node = Root();

+ 9 - 9
Engine/Core/Context.cpp

@@ -28,9 +28,9 @@
 
 static String noType;
 
-void RemoveNamedAttribute(Map<ShortStringHash, Vector<AttributeInfo> >& attributes, ShortStringHash objectType, const String& name)
+void RemoveNamedAttribute(HashMap<ShortStringHash, Vector<AttributeInfo> >& attributes, ShortStringHash objectType, const String& name)
 {
-    Map<ShortStringHash, Vector<AttributeInfo> >::Iterator i = attributes.Find(objectType);
+    HashMap<ShortStringHash, Vector<AttributeInfo> >::Iterator i = attributes.Find(objectType);
     if (i == attributes.End())
         return;
     
@@ -58,15 +58,15 @@ Context::Context() :
 Context::~Context()
 {
     // Release the subsystems before the event receiver maps are destroyed
-    for (Map<ShortStringHash, SharedPtr<Object> >::Iterator i = subsystems_.Begin(); i != subsystems_.End(); ++i)
-        i->second_.Reset();
+    //for (HashMap<ShortStringHash, SharedPtr<Object> >::Iterator i = subsystems_.Begin(); i != subsystems_.End(); ++i)
+    //    i->second_.Reset();
     subsystems_.Clear();
     factories_.Clear();
 }
 
 SharedPtr<Object> Context::CreateObject(ShortStringHash objectType)
 {
-    Map<ShortStringHash, SharedPtr<ObjectFactory> >::ConstIterator i = factories_.Find(objectType);
+    HashMap<ShortStringHash, SharedPtr<ObjectFactory> >::ConstIterator i = factories_.Find(objectType);
     if (i != factories_.End())
         return i->second_->CreateObject();
     else
@@ -124,7 +124,7 @@ void Context::CopyBaseAttributes(ShortStringHash baseType, ShortStringHash deriv
 
 Object* Context::GetSubsystem(ShortStringHash type) const
 {
-    Map<ShortStringHash, SharedPtr<Object> >::ConstIterator i = subsystems_.Find(type);
+    HashMap<ShortStringHash, SharedPtr<Object> >::ConstIterator i = subsystems_.Find(type);
     if (i != subsystems_.End())
         return i->second_;
     else
@@ -142,7 +142,7 @@ Object* Context::GetEventSender() const
 const String& Context::GetTypeName(ShortStringHash type) const
 {
     // Search factories to find the hash-to-name mapping
-    Map<ShortStringHash, SharedPtr<ObjectFactory> >::ConstIterator i = factories_.Find(type);
+    HashMap<ShortStringHash, SharedPtr<ObjectFactory> >::ConstIterator i = factories_.Find(type);
     return i != factories_.End() ? i->second_->GetTypeName() : noType;
 }
 
@@ -164,14 +164,14 @@ void Context::RemoveEventSender(Object* sender)
 
 void Context::RemoveEventReceiver(Object* receiver, StringHash eventType)
 {
-    Set<Object*>* group = GetEventReceivers(eventType);
+    HashSet<Object*>* group = GetEventReceivers(eventType);
     if (group)
         group->Erase(receiver);
 }
 
 void Context::RemoveEventReceiver(Object* receiver, Object* sender, StringHash eventType)
 {
-    Set<Object*>* group = GetEventReceivers(sender, eventType);
+    HashSet<Object*>* group = GetEventReceivers(sender, eventType);
     if (group)
         group->Erase(receiver);
 }

+ 16 - 16
Engine/Core/Context.h

@@ -25,7 +25,7 @@
 
 #include "Attribute.h"
 #include "Object.h"
-#include "Set.h"
+#include "HashSet.h"
 
 /// Urho3D execution context. Provides access to subsystems, object factories and attributes, and event receivers.
 class Context : public RefCounted
@@ -62,9 +62,9 @@ public:
     /// Return subsystem by type.
     Object* GetSubsystem(ShortStringHash type) const;
     /// Return all subsystems.
-    const Map<ShortStringHash, SharedPtr<Object> >& GetSubsystems() const { return subsystems_; }
+    const HashMap<ShortStringHash, SharedPtr<Object> >& GetSubsystems() const { return subsystems_; }
     /// Return all object factories.
-    const Map<ShortStringHash, SharedPtr<ObjectFactory> >& GetObjectFactories() const { return factories_; }
+    const HashMap<ShortStringHash, SharedPtr<ObjectFactory> >& GetObjectFactories() const { return factories_; }
     /// Return active event sender. Null outside event handling.
     Object* GetEventSender() const;
     /// Return active event handler. Set by Object. Null outside event handling.
@@ -77,24 +77,24 @@ public:
     /// Return attribute descriptions for an object type, or null if none defined.
     const Vector<AttributeInfo>* GetAttributes(ShortStringHash type) const
     {
-        Map<ShortStringHash, Vector<AttributeInfo> >::ConstIterator i = attributes_.Find(type);
+        HashMap<ShortStringHash, Vector<AttributeInfo> >::ConstIterator i = attributes_.Find(type);
         return i != attributes_.End() ? &i->second_ : 0;
     }
     
     /// Return network replication attribute descriptions for an object type, or null if none defined.
     const Vector<AttributeInfo>* GetNetworkAttributes(ShortStringHash type) const
     {
-        Map<ShortStringHash, Vector<AttributeInfo> >::ConstIterator i = networkAttributes_.Find(type);
+        HashMap<ShortStringHash, Vector<AttributeInfo> >::ConstIterator i = networkAttributes_.Find(type);
         return i != networkAttributes_.End() ? &i->second_ : 0;
     }
     
     /// Return event receivers for a sender and event type, or null if they do not exist.
-    Set<Object*>* GetEventReceivers(Object* sender, StringHash eventType)
+    HashSet<Object*>* GetEventReceivers(Object* sender, StringHash eventType)
     {
-        Map<Object*, Map<StringHash, Set<Object*> > >::Iterator i = specificEventReceivers_.Find(sender);
+        HashMap<Object*, HashMap<StringHash, HashSet<Object*> > >::Iterator i = specificEventReceivers_.Find(sender);
         if (i != specificEventReceivers_.End())
         {
-            Map<StringHash, Set<Object*> >::Iterator j = i->second_.Find(eventType);
+            HashMap<StringHash, HashSet<Object*> >::Iterator j = i->second_.Find(eventType);
             return j != i->second_.End() ? &j->second_ : 0;
         }
         else
@@ -102,9 +102,9 @@ public:
     }
     
     /// Return event receivers for an event type, or null if they do not exist.
-    Set<Object*>* GetEventReceivers(StringHash eventType)
+    HashSet<Object*>* GetEventReceivers(StringHash eventType)
     {
-        Map<StringHash, Set<Object*> >::Iterator i = eventReceivers_.Find(eventType);
+        HashMap<StringHash, HashSet<Object*> >::Iterator i = eventReceivers_.Find(eventType);
         return i != eventReceivers_.End() ? &i->second_ : 0;
     }
     
@@ -127,17 +127,17 @@ private:
     void EndSendEvent();
 
     /// Object factories.
-    Map<ShortStringHash, SharedPtr<ObjectFactory> > factories_;
+    HashMap<ShortStringHash, SharedPtr<ObjectFactory> > factories_;
     /// Subsystems.
-    Map<ShortStringHash, SharedPtr<Object> > subsystems_;
+    HashMap<ShortStringHash, SharedPtr<Object> > subsystems_;
     /// Attribute descriptions per object type.
-    Map<ShortStringHash, Vector<AttributeInfo> > attributes_;
+    HashMap<ShortStringHash, Vector<AttributeInfo> > attributes_;
     /// Network replication attribute descriptions per object type.
-    Map<ShortStringHash, Vector<AttributeInfo> > networkAttributes_;
+    HashMap<ShortStringHash, Vector<AttributeInfo> > networkAttributes_;
     /// Event receivers for non-specific events.
-    Map<StringHash, Set<Object*> > eventReceivers_;
+    HashMap<StringHash, HashSet<Object*> > eventReceivers_;
     /// Event receivers for specific senders' events.
-    Map<Object*, Map<StringHash, Set<Object*> > > specificEventReceivers_;
+    HashMap<Object*, HashMap<StringHash, HashSet<Object*> > > specificEventReceivers_;
     /// Event sender stack.
     PODVector<Object*> eventSenders_;
     /// Active event handler. Not stored in a stack for performance reasons; is needed only in esoteric cases.

+ 18 - 19
Engine/Core/Object.cpp

@@ -23,7 +23,6 @@
 
 #include "Precompiled.h"
 #include "Context.h"
-#include "HashSet.h"
 
 #include "DebugNew.h"
 
@@ -45,7 +44,7 @@ void Object::OnEvent(Object* sender, bool broadcast, StringHash eventType, Varia
     Context* context = context_;
     
     // Check first the specific event handlers, which have priority
-    Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::ConstIterator i = eventHandlers_.Find(
+    HashMap<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::ConstIterator i = eventHandlers_.Find(
         MakePair(sender, eventType));
     if (i != eventHandlers_.End())
     {
@@ -89,10 +88,10 @@ void Object::SubscribeToEvent(Object* sender, StringHash eventType, EventHandler
 
 void Object::UnsubscribeFromEvent(StringHash eventType)
 {
-    for (Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator i = eventHandlers_.Begin();
+    for (HashMap<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator i = eventHandlers_.Begin();
         i != eventHandlers_.End();)
     {
-        Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator current = i++;
+        HashMap<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator current = i++;
         if (current->first_.second_ == eventType)
         {
             if (current->first_.first_)
@@ -108,7 +107,7 @@ void Object::UnsubscribeFromEvent(Object* sender, StringHash eventType)
 {
     Pair<Object*, StringHash> combination(sender, eventType);
     
-    Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator i = eventHandlers_.Find(combination);
+    HashMap<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator i = eventHandlers_.Find(combination);
     if (i != eventHandlers_.End())
     {
         context_->RemoveEventReceiver(this, i->first_.first_, i->first_.second_);
@@ -121,10 +120,10 @@ void Object::UnsubscribeFromEvents(Object* sender)
     if (!sender)
         return;
     
-    for (Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator i = eventHandlers_.Begin();
+    for (HashMap<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator i = eventHandlers_.Begin();
         i != eventHandlers_.End();)
     {
-        Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator current = i++;
+        HashMap<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator current = i++;
         if (current->first_.first_ == sender)
         {
             context_->RemoveEventReceiver(this, current->first_.first_, current->first_.second_);
@@ -135,7 +134,7 @@ void Object::UnsubscribeFromEvents(Object* sender)
 
 void Object::UnsubscribeFromAllEvents()
 {
-    for (Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator i = eventHandlers_.Begin();
+    for (HashMap<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator i = eventHandlers_.Begin();
         i != eventHandlers_.End(); ++i)
     {
         if (i->first_.first_)
@@ -149,12 +148,12 @@ void Object::UnsubscribeFromAllEvents()
 
 void Object::UnsubscribeFromAllEventsWithUserData()
 {
-    for (Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator i = eventHandlers_.Begin();
+    for (HashMap<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator i = eventHandlers_.Begin();
         i != eventHandlers_.End(); )
     {
         if (i->second_->GetUserData())
         {
-            Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator current = i++;
+            HashMap<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator current = i++;
             if (current->first_.first_)
                 context_->RemoveEventReceiver(this, current->first_.first_, current->first_.second_);
             else
@@ -183,12 +182,12 @@ void Object::SendEvent(StringHash eventType, VariantMap& eventData)
     context->BeginSendEvent(this);
     
     // Check first the specific event receivers
-    const Set<Object*>* group = context->GetEventReceivers(this, eventType);
+    const HashSet<Object*>* group = context->GetEventReceivers(this, eventType);
     if (group)
     {
-        for (Set<Object*>::ConstIterator i = group->Begin(); i != group->End();)
+        for (HashSet<Object*>::ConstIterator i = group->Begin(); i != group->End();)
         {
-            Set<Object*>::ConstIterator current = i++;
+            HashSet<Object*>::ConstIterator current = i++;
             Object* receiver = *current;
             Object* next = 0;
             if (i != group->End())
@@ -219,9 +218,9 @@ void Object::SendEvent(StringHash eventType, VariantMap& eventData)
     {
         if (processed.Empty())
         {
-            for (Set<Object*>::ConstIterator i = group->Begin(); i != group->End();)
+            for (HashSet<Object*>::ConstIterator i = group->Begin(); i != group->End();)
             {
-                Set<Object*>::ConstIterator current = i++;
+                HashSet<Object*>::ConstIterator current = i++;
                 Object* receiver = *current;
                 Object* next = 0;
                 if (i != group->End())
@@ -243,9 +242,9 @@ void Object::SendEvent(StringHash eventType, VariantMap& eventData)
         else
         {
             // If there were specific receivers, check that the event is not sent doubly to them
-            for (Set<Object*>::ConstIterator i = group->Begin(); i != group->End();)
+            for (HashSet<Object*>::ConstIterator i = group->Begin(); i != group->End();)
             {
-                Set<Object*>::ConstIterator current = i++;
+                HashSet<Object*>::ConstIterator current = i++;
                 Object* receiver = *current;
                 Object* next = 0;
                 if (i != group->End())
@@ -324,10 +323,10 @@ bool Object::HasSubscribedToEvent(Object* sender, StringHash eventType) const
 
 void Object::RemoveEventSender(Object* sender)
 {
-    for (Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator i = eventHandlers_.Begin();
+    for (HashMap<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator i = eventHandlers_.Begin();
         i != eventHandlers_.End();)
     {
-        Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator current = i++;
+        HashMap<Pair<Object*, StringHash>, SharedPtr<EventHandler> >::Iterator current = i++;
         if (current->first_.first_ == sender)
             eventHandlers_.Erase(current);
     }

+ 2 - 2
Engine/Core/Object.h

@@ -23,7 +23,7 @@
 
 #pragma once
 
-#include "Map.h"
+#include "HashMap.h"
 #include "Ptr.h"
 #include "Variant.h"
 
@@ -95,7 +95,7 @@ private:
     void RemoveEventSender(Object* sender);
     
     /// Event handlers. Sender is null for non-specific handlers.
-    Map<Pair<Object*, StringHash>, SharedPtr<EventHandler> > eventHandlers_;
+    HashMap<Pair<Object*, StringHash>, SharedPtr<EventHandler> > eventHandlers_;
 };
 
 template <class T> T* Object::GetSubsystem() const { return static_cast<T*>(GetSubsystem(T::GetTypeStatic())); }

+ 2 - 2
Engine/Engine/Engine.cpp

@@ -355,10 +355,10 @@ void Engine::DumpProfilingData()
 void Engine::DumpResources()
 {
     ResourceCache* cache = GetSubsystem<ResourceCache>();
-    const Map<ShortStringHash, ResourceGroup>& resourceGroups = cache->GetAllResources();
+    const HashMap<ShortStringHash, ResourceGroup>& resourceGroups = cache->GetAllResources();
     LOGRAW("\n");
     
-    for (Map<ShortStringHash, ResourceGroup>::ConstIterator i = resourceGroups.Begin();
+    for (HashMap<ShortStringHash, ResourceGroup>::ConstIterator i = resourceGroups.Begin();
         i != resourceGroups.End(); ++i)
     {
         unsigned num = i->second_.resources_.Size();

+ 2 - 2
Engine/Engine/MathAPI.cpp

@@ -803,7 +803,7 @@ static void DestructPolyhedron(Polyhedron* ptr)
 
 void PolyhedronAddFaceArray(CScriptArray* arr, Polyhedron* ptr)
 {
-    Vector<Vector3> face;
+    PODVector<Vector3> face;
     unsigned numVertices = arr->GetSize();
     
     face.Resize(numVertices);
@@ -819,7 +819,7 @@ static unsigned PolyhedronGetNumFaces(Polyhedron* ptr)
 
 static CScriptArray* PolyhedronGetFace(unsigned index, Polyhedron* ptr)
 {
-    Vector<Vector3> face;
+    PODVector<Vector3> face;
     if (index < ptr->faces_.Size())
         face = ptr->faces_[index];
     return VectorToArray<Vector3>(face, "Array<Vector3>");

+ 2 - 2
Engine/Engine/NetworkAPI.cpp

@@ -126,7 +126,7 @@ static Network* GetNetwork()
 
 static CScriptArray* NetworkGetClientConnections(Network* ptr)
 {
-    const Map<kNet::MessageConnection*, SharedPtr<Connection> >& connections = ptr->GetClientConnections();
+    const HashMap<kNet::MessageConnection*, SharedPtr<Connection> >& connections = ptr->GetClientConnections();
     
     asIScriptContext *context = asGetActiveContext();
     if (context)
@@ -135,7 +135,7 @@ static CScriptArray* NetworkGetClientConnections(Network* ptr)
         CScriptArray* arr = new CScriptArray(connections.Size(), type);
         
         unsigned index = 0;
-        for (Map<kNet::MessageConnection*, SharedPtr<Connection> >::ConstIterator i = connections.Begin();
+        for (HashMap<kNet::MessageConnection*, SharedPtr<Connection> >::ConstIterator i = connections.Begin();
             i != connections.End(); ++i)
         {
             // Increment reference count for storing in the array

+ 2 - 2
Engine/Engine/SceneAPI.cpp

@@ -117,12 +117,12 @@ static CScriptArray* SceneGetRequiredPackageFiles(Scene* ptr)
 
 static CScriptArray* GetAvailableComponents(Scene* ptr)
 {
-    const Map<ShortStringHash, SharedPtr<ObjectFactory> >& factories = GetScriptContext()->GetObjectFactories();
+    const HashMap<ShortStringHash, SharedPtr<ObjectFactory> >& factories = GetScriptContext()->GetObjectFactories();
     Vector<String> components;
     
     // Simply try to create each of the objects, and check which derive from Component.
     // This assumes that creating any of them does not have harmful side-effects
-    for (Map<ShortStringHash, SharedPtr<ObjectFactory> >::ConstIterator i = factories.Begin(); i != factories.End(); ++i)
+    for (HashMap<ShortStringHash, SharedPtr<ObjectFactory> >::ConstIterator i = factories.Begin(); i != factories.End(); ++i)
     {
         SharedPtr<Object> object = i->second_->CreateObject();
         if (dynamic_cast<Component*>(object.Get()))

+ 0 - 1
Engine/Graphics/AnimationController.cpp

@@ -27,7 +27,6 @@
 #include "AnimationController.h"
 #include "AnimationState.h"
 #include "Context.h"
-#include "HashSet.h"
 #include "Log.h"
 #include "MemoryBuffer.h"
 #include "Profiler.h"

+ 1 - 1
Engine/Graphics/DebugRenderer.cpp

@@ -206,7 +206,7 @@ void DebugRenderer::AddPolyhedron(const Polyhedron& poly, const Color& color, bo
     
     for (unsigned i = 0; i < poly.faces_.Size(); ++i)
     {
-        const Vector<Vector3>& face = poly.faces_[i];
+        const PODVector<Vector3>& face = poly.faces_[i];
         if (face.Size() >= 3)
         {
             for (unsigned j = 0; j < face.Size(); ++j)

+ 0 - 1
Engine/Graphics/Direct3D9/D3D9Graphics.h

@@ -24,7 +24,6 @@
 #pragma once
 
 #include "Color.h"
-#include "HashMap.h"
 #include "Object.h"
 #include "Rect.h"
 #include "GraphicsDefs.h"

+ 0 - 1
Engine/Graphics/Direct3D9/D3D9Shader.h

@@ -23,7 +23,6 @@
 
 #pragma once
 
-#include "HashMap.h"
 #include "Resource.h"
 
 class ShaderVariation;

+ 0 - 1
Engine/Graphics/Material.h

@@ -24,7 +24,6 @@
 #pragma once
 
 #include "GraphicsDefs.h"
-#include "HashMap.h"
 #include "Resource.h"
 #include "Vector4.h"
 

+ 1 - 0
Engine/Graphics/Model.h

@@ -25,6 +25,7 @@
 
 #include "ArrayPtr.h"
 #include "BoundingBox.h"
+#include "Map.h"
 #include "Skeleton.h"
 #include "Resource.h"
 #include "Ptr.h"

+ 0 - 1
Engine/Graphics/PostProcess.h

@@ -24,7 +24,6 @@
 #pragma once
 
 #include "GraphicsDefs.h"
-#include "HashMap.h"
 #include "Object.h"
 
 class Texture2D;

+ 0 - 1
Engine/Graphics/Renderer.h

@@ -26,7 +26,6 @@
 #include "Batch.h"
 #include "Color.h"
 #include "Drawable.h"
-#include "HashMap.h"
 #include "HashSet.h"
 #include "Mutex.h"
 #include "Viewport.h"

+ 1 - 1
Engine/IO/FileSystem.cpp

@@ -286,7 +286,7 @@ bool FileSystem::CheckAccess(const String& pathName)
         return false;
     
     // Check if the path is a partial match of any of the allowed directories
-    for (Set<String>::ConstIterator i = allowedPaths_.Begin(); i != allowedPaths_.End(); ++i)
+    for (HashSet<String>::ConstIterator i = allowedPaths_.Begin(); i != allowedPaths_.End(); ++i)
     {
         if (fixedPath.Find(*i) == 0)
             return true;

+ 2 - 2
Engine/IO/FileSystem.h

@@ -24,7 +24,7 @@
 #pragma once
 
 #include "Object.h"
-#include "Set.h"
+#include "HashSet.h"
 
 /// Return files.
 static const unsigned SCAN_FILES = 0x1;
@@ -84,7 +84,7 @@ private:
         const String& filter, unsigned flags, bool recursive);
     
     /// Allowed directories.
-    Set<String> allowedPaths_;
+    HashSet<String> allowedPaths_;
 };
 
 /// Split a full path to path, filename and extension. The extension will be converted to lowercase.

+ 1 - 1
Engine/IO/PackageFile.cpp

@@ -90,7 +90,7 @@ bool PackageFile::Exists(const String& fileName) const
 
 const PackageEntry* PackageFile::GetEntry(const String& fileName) const
 {
-    Map<String, PackageEntry>::ConstIterator i = entries_.Find(fileName.ToLower());
+    HashMap<String, PackageEntry>::ConstIterator i = entries_.Find(fileName.ToLower());
     if (i != entries_.End())
         return &i->second_;
     else

+ 2 - 2
Engine/IO/PackageFile.h

@@ -56,7 +56,7 @@ public:
     /// Return the file entry corresponding to the name, or null if not found.
     const PackageEntry* GetEntry(const String& fileName) const;
     /// Return all file entries.
-    const Map<String, PackageEntry>& GetEntries() const { return entries_; }
+    const HashMap<String, PackageEntry>& GetEntries() const { return entries_; }
     /// Return the package file name.
     const String& GetName() const { return fileName_; }
     /// Return hash of the package file name.
@@ -70,7 +70,7 @@ public:
     
 private:
     /// File entries.
-    Map<String, PackageEntry> entries_;
+    HashMap<String, PackageEntry> entries_;
     /// File name.
     String fileName_;
     /// Package file name hash.

+ 1 - 1
Engine/Math/BoundingBox.cpp

@@ -73,7 +73,7 @@ void BoundingBox::Merge(const Polyhedron& poly)
 {
     for (unsigned i = 0; i < poly.faces_.Size(); ++i)
     {
-        const Vector<Vector3>& face = poly.faces_[i];
+        const PODVector<Vector3>& face = poly.faces_[i];
         if (!face.Empty())
             Merge(&face[0], face.Size());
     }

+ 12 - 12
Engine/Math/Polyhedron.cpp

@@ -66,7 +66,7 @@ void Polyhedron::Define(const Frustum& frustum)
 void Polyhedron::AddFace(const Vector3& v0, const Vector3& v1, const Vector3& v2)
 {
     faces_.Resize(faces_.Size() + 1);
-    Vector<Vector3>& face = faces_[faces_.Size() - 1];
+    PODVector<Vector3>& face = faces_[faces_.Size() - 1];
     face.Resize(3);
     face[0] = v0;
     face[1] = v1;
@@ -76,7 +76,7 @@ void Polyhedron::AddFace(const Vector3& v0, const Vector3& v1, const Vector3& v2
 void Polyhedron::AddFace(const Vector3& v0, const Vector3& v1, const Vector3& v2, const Vector3& v3)
 {
     faces_.Resize(faces_.Size() + 1);
-    Vector<Vector3>& face = faces_[faces_.Size() - 1];
+    PODVector<Vector3>& face = faces_[faces_.Size() - 1];
     face.Resize(4);
     face[0] = v0;
     face[1] = v1;
@@ -84,7 +84,7 @@ void Polyhedron::AddFace(const Vector3& v0, const Vector3& v1, const Vector3& v2
     face[3] = v3;
 }
 
-void Polyhedron::AddFace(const Vector<Vector3>& face)
+void Polyhedron::AddFace(const PODVector<Vector3>& face)
 {
     faces_.Push(face);
 }
@@ -95,7 +95,7 @@ void Polyhedron::Clip(const Plane& plane)
     
     for (unsigned i = 0; i < faces_.Size(); ++i)
     {
-        Vector<Vector3>& face = faces_[i];
+        PODVector<Vector3>& face = faces_[i];
         outFace_.Clear();
         
         Vector3 lastVertex;
@@ -231,7 +231,7 @@ void Polyhedron::Transform(const Matrix3& transform)
 {
     for (unsigned i = 0; i < faces_.Size(); ++i)
     {
-        Vector<Vector3>& face = faces_[i];
+        PODVector<Vector3>& face = faces_[i];
         for (unsigned j = 0; j < face.Size(); ++j)
             face[j] = transform * face[j];
     }
@@ -241,7 +241,7 @@ void Polyhedron::Transform(const Matrix3x4& transform)
 {
     for (unsigned i = 0; i < faces_.Size(); ++i)
     {
-        Vector<Vector3>& face = faces_[i];
+        PODVector<Vector3>& face = faces_[i];
         for (unsigned j = 0; j < face.Size(); ++j)
             face[j] = transform * face[j];
     }
@@ -254,8 +254,8 @@ Polyhedron Polyhedron::Transformed(const Matrix3& transform) const
     
     for (unsigned i = 0; i < faces_.Size(); ++i)
     {
-        const Vector<Vector3>& face = faces_[i];
-        Vector<Vector3>& newFace = ret.faces_[i];
+        const PODVector<Vector3>& face = faces_[i];
+        PODVector<Vector3>& newFace = ret.faces_[i];
         newFace.Resize(face.Size());
         
         for (unsigned j = 0; j < face.Size(); ++j)
@@ -272,8 +272,8 @@ Polyhedron Polyhedron::Transformed(const Matrix3x4& transform) const
     
     for (unsigned i = 0; i < faces_.Size(); ++i)
     {
-        const Vector<Vector3>& face = faces_[i];
-        Vector<Vector3>& newFace = ret.faces_[i];
+        const PODVector<Vector3>& face = faces_[i];
+        PODVector<Vector3>& newFace = ret.faces_[i];
         newFace.Resize(face.Size());
         
         for (unsigned j = 0; j < face.Size(); ++j)
@@ -285,7 +285,7 @@ Polyhedron Polyhedron::Transformed(const Matrix3x4& transform) const
 
 void Polyhedron::SetFace(unsigned index, const Vector3& v0, const Vector3& v1, const Vector3& v2)
 {
-    Vector<Vector3>& face = faces_[index];
+    PODVector<Vector3>& face = faces_[index];
     face.Resize(3);
     face[0] = v0;
     face[1] = v1;
@@ -294,7 +294,7 @@ void Polyhedron::SetFace(unsigned index, const Vector3& v0, const Vector3& v1, c
 
 void Polyhedron::SetFace(unsigned index, const Vector3& v0, const Vector3& v1, const Vector3& v2, const Vector3& v3)
 {
-    Vector<Vector3>& face = faces_[index];
+    PODVector<Vector3>& face = faces_[index];
     face.Resize(4);
     face[0] = v0;
     face[1] = v1;

+ 5 - 5
Engine/Math/Polyhedron.h

@@ -47,7 +47,7 @@ public:
     }
     
     /// Construct from a list of faces.
-    Polyhedron(const Vector<Vector<Vector3> >& faces) :
+    Polyhedron(const Vector<PODVector<Vector3> >& faces) :
         faces_(faces)
     {
     }
@@ -76,7 +76,7 @@ public:
     /// Add a quadrilateral face.
     void AddFace(const Vector3& v0, const Vector3& v1, const Vector3& v2, const Vector3& v3);
     /// Add an arbitrary face.
-    void AddFace(const Vector<Vector3>& face);
+    void AddFace(const PODVector<Vector3>& face);
     /// Clip with a plane.
     void Clip(const Plane& plane);
     /// Clip with a bounding box.
@@ -98,7 +98,7 @@ public:
     bool Empty() const { return faces_.Empty(); }
     
     /// Polygon faces.
-    Vector<Vector<Vector3> > faces_;
+    Vector<PODVector<Vector3> > faces_;
     
 private:
     /// %Set a triangle face by index.
@@ -106,7 +106,7 @@ private:
     /// %Set a quadrilateral face by index.
     void SetFace(unsigned index, const Vector3& v0, const Vector3& v1, const Vector3& v2, const Vector3& v3);
     /// Internal vector for clipped vertices.
-    Vector<Vector3> clippedVertices_;
+    PODVector<Vector3> clippedVertices_;
     /// Internal vector for the new face being constructed.
-    Vector<Vector3> outFace_;
+    PODVector<Vector3> outFace_;
 };

+ 1 - 1
Engine/Math/Sphere.cpp

@@ -95,7 +95,7 @@ void Sphere::Merge(const Polyhedron& poly)
 {
     for (unsigned i = 0; i < poly.faces_.Size(); ++i)
     {
-        const Vector<Vector3>& face = poly.faces_[i];
+        const PODVector<Vector3>& face = poly.faces_[i];
         if (!face.Empty())
             Merge(&face[0], face.Size());
     }

+ 0 - 1
Engine/Network/Connection.h

@@ -24,7 +24,6 @@
 #pragma once
 
 #include "Controls.h"
-#include "HashMap.h"
 #include "HashSet.h"
 #include "Object.h"
 #include "ReplicationState.h"

+ 6 - 6
Engine/Network/Network.cpp

@@ -175,7 +175,7 @@ void Network::ClientDisconnected(kNet::MessageConnection* connection)
     connection->Disconnect(0);
     
     // Remove the client connection that corresponds to this MessageConnection
-    Map<kNet::MessageConnection*, SharedPtr<Connection> >::Iterator i = clientConnections_.Find(connection);
+    HashMap<kNet::MessageConnection*, SharedPtr<Connection> >::Iterator i = clientConnections_.Find(connection);
     if (i != clientConnections_.End())
     {
         Connection* connection = i->second_;
@@ -286,14 +286,14 @@ void Network::BroadcastMessage(int msgID, bool reliable, bool inOrder, const uns
 
 void Network::BroadcastRemoteEvent(StringHash eventType, bool inOrder, const VariantMap& eventData)
 {
-    for (Map<kNet::MessageConnection*, SharedPtr<Connection> >::ConstIterator i = clientConnections_.Begin();
+    for (HashMap<kNet::MessageConnection*, SharedPtr<Connection> >::ConstIterator i = clientConnections_.Begin();
         i != clientConnections_.End(); ++i)
         i->second_->SendRemoteEvent(eventType, inOrder, eventData);
 }
 
 void Network::BroadcastRemoteEvent(Scene* scene, StringHash eventType, bool inOrder, const VariantMap& eventData)
 {
-    for (Map<kNet::MessageConnection*, SharedPtr<Connection> >::ConstIterator i = clientConnections_.Begin();
+    for (HashMap<kNet::MessageConnection*, SharedPtr<Connection> >::ConstIterator i = clientConnections_.Begin();
         i != clientConnections_.End(); ++i)
     {
         if (i->second_->GetScene() == scene)
@@ -315,7 +315,7 @@ void Network::BroadcastRemoteEvent(Node* receiver, StringHash eventType, bool in
     }
     
     Scene* scene = receiver->GetScene();
-    for (Map<kNet::MessageConnection*, SharedPtr<Connection> >::ConstIterator i = clientConnections_.Begin();
+    for (HashMap<kNet::MessageConnection*, SharedPtr<Connection> >::ConstIterator i = clientConnections_.Begin();
         i != clientConnections_.End(); ++i)
     {
         if (i->second_->GetScene() == scene)
@@ -352,7 +352,7 @@ void Network::SetPackageCacheDir(const String& path)
 
 Connection* Network::GetConnection(kNet::MessageConnection* connection) const
 {
-    Map<kNet::MessageConnection*, SharedPtr<Connection> >::ConstIterator i = clientConnections_.Find(connection);
+    HashMap<kNet::MessageConnection*, SharedPtr<Connection> >::ConstIterator i = clientConnections_.Find(connection);
     if (i != clientConnections_.End())
         return i->second_;
     else if (serverConnection_ && serverConnection_->GetMessageConnection() == connection)
@@ -424,7 +424,7 @@ void Network::PostUpdate(float timeStep)
         if (IsServerRunning())
         {
             // Send server updates for each client connection
-            for (Map<kNet::MessageConnection*, SharedPtr<Connection> >::ConstIterator i = clientConnections_.Begin();
+            for (HashMap<kNet::MessageConnection*, SharedPtr<Connection> >::ConstIterator i = clientConnections_.Begin();
                 i != clientConnections_.End(); ++i)
             {
                 i->second_->SendServerUpdate();

+ 9 - 3
Engine/Network/Network.h

@@ -24,6 +24,7 @@
 #pragma once
 
 #include "Connection.h"
+#include "HashSet.h"
 #include "Object.h"
 #include "VectorBuffer.h"
 
@@ -33,6 +34,11 @@
 class MemoryBuffer;
 class Scene;
 
+namespace kNet
+{
+    class MessageConnection;
+}
+
 /// %Network subsystem. Manages client-server communications using the UDP protocol.
 class Network : public Object, public kNet::IMessageHandler, public kNet::INetworkServerListener
 {
@@ -89,7 +95,7 @@ public:
     /// Return the connection to the server. Null if not connected.
     Connection* GetServerConnection() const;
     /// Return all client connections.
-    const Map<kNet::MessageConnection*, SharedPtr<Connection> > GetClientConnections() const { return clientConnections_; }
+    const HashMap<kNet::MessageConnection*, SharedPtr<Connection> > GetClientConnections() const { return clientConnections_; }
     /// Return whether the server is running.
     bool IsServerRunning() const;
     /// Return whether a remote event is allowed to be sent and received. If no events are registered, all are allowed.
@@ -117,9 +123,9 @@ private:
     /// Client's server connection.
     SharedPtr<Connection> serverConnection_;
     /// Server's client connections.
-    Map<kNet::MessageConnection*, SharedPtr<Connection> > clientConnections_;
+    HashMap<kNet::MessageConnection*, SharedPtr<Connection> > clientConnections_;
     /// Allowed remote events.
-    Set<StringHash> allowedRemoteEvents_;
+    HashSet<StringHash> allowedRemoteEvents_;
     /// Update FPS.
     int updateFps_;
     /// Update time interval.

+ 29 - 30
Engine/Resource/ResourceCache.cpp

@@ -26,7 +26,6 @@
 #include "CoreEvents.h"
 #include "FileSystem.h"
 #include "FileWatcher.h"
-#include "HashSet.h"
 #include "Image.h"
 #include "Log.h"
 #include "PackageFile.h"
@@ -120,8 +119,8 @@ void ResourceCache::AddPackageFile(PackageFile* package, bool addAsFirst)
         packages_.Push(SharedPtr<PackageFile>(package));
     
     // Scan the package for files and add their hash-to-name mappings
-    const Map<String, PackageEntry>& entries = package->GetEntries();
-    for (Map<String, PackageEntry>::ConstIterator i = entries.Begin(); i != entries.End(); ++i)
+    const HashMap<String, PackageEntry>& entries = package->GetEntries();
+    for (HashMap<String, PackageEntry>::ConstIterator i = entries.Begin(); i != entries.End(); ++i)
         StoreNameHash(i->first_);
     
     LOGINFO("Added resource package " + package->GetName());
@@ -221,15 +220,15 @@ void ResourceCache::ReleaseResources(ShortStringHash type, bool force)
 {
     bool released = false;
     
-    for (Map<ShortStringHash, ResourceGroup>::Iterator i = resourceGroups_.Begin();
+    for (HashMap<ShortStringHash, ResourceGroup>::Iterator i = resourceGroups_.Begin();
         i != resourceGroups_.End(); ++i)
     {
         if (i->first_ == type)
         {
-            for (Map<StringHash, SharedPtr<Resource> >::Iterator j = i->second_.resources_.Begin();
+            for (HashMap<StringHash, SharedPtr<Resource> >::Iterator j = i->second_.resources_.Begin();
                 j != i->second_.resources_.End();)
             {
-                Map<StringHash, SharedPtr<Resource> >::Iterator current = j++;
+                HashMap<StringHash, SharedPtr<Resource> >::Iterator current = j++;
                 // If other references exist, do not release, unless forced
                 if (current->second_.Refs() == 1 || force)
                 {
@@ -248,15 +247,15 @@ void ResourceCache::ReleaseResources(ShortStringHash type, const String& partial
 {
     bool released = false;
     
-    for (Map<ShortStringHash, ResourceGroup>::Iterator i = resourceGroups_.Begin();
+    for (HashMap<ShortStringHash, ResourceGroup>::Iterator i = resourceGroups_.Begin();
         i != resourceGroups_.End(); ++i)
     {
         if (i->first_ == type)
         {
-            for (Map<StringHash, SharedPtr<Resource> >::Iterator j = i->second_.resources_.Begin();
+            for (HashMap<StringHash, SharedPtr<Resource> >::Iterator j = i->second_.resources_.Begin();
                 j != i->second_.resources_.End();)
             {
-                Map<StringHash, SharedPtr<Resource> >::Iterator current = j++;
+                HashMap<StringHash, SharedPtr<Resource> >::Iterator current = j++;
                 if (current->second_->GetName().Find(partialName) != String::NPOS)
                 {
                     // If other references exist, do not release, unless forced
@@ -276,15 +275,15 @@ void ResourceCache::ReleaseResources(ShortStringHash type, const String& partial
 
 void ResourceCache::ReleaseAllResources(bool force)
 {
-    for (Map<ShortStringHash, ResourceGroup>::Iterator i = resourceGroups_.Begin();
+    for (HashMap<ShortStringHash, ResourceGroup>::Iterator i = resourceGroups_.Begin();
         i != resourceGroups_.End(); ++i)
     {
         bool released = false;
         
-        for (Map<StringHash, SharedPtr<Resource> >::Iterator j = i->second_.resources_.Begin();
+        for (HashMap<StringHash, SharedPtr<Resource> >::Iterator j = i->second_.resources_.Begin();
             j != i->second_.resources_.End();)
         {
-            Map<StringHash, SharedPtr<Resource> >::Iterator current = j++;
+            HashMap<StringHash, SharedPtr<Resource> >::Iterator current = j++;
             // If other references exist, do not release, unless forced
             if (current->second_.Refs() == 1 || force)
             {
@@ -437,10 +436,10 @@ Resource* ResourceCache::GetResource(ShortStringHash type, StringHash nameHash)
 void ResourceCache::GetResources(PODVector<Resource*>& result, ShortStringHash type) const
 {
     result.Clear();
-    Map<ShortStringHash, ResourceGroup>::ConstIterator i = resourceGroups_.Find(type);
+    HashMap<ShortStringHash, ResourceGroup>::ConstIterator i = resourceGroups_.Find(type);
     if (i != resourceGroups_.End())
     {
-        for (Map<StringHash, SharedPtr<Resource> >::ConstIterator j = i->second_.resources_.Begin();
+        for (HashMap<StringHash, SharedPtr<Resource> >::ConstIterator j = i->second_.resources_.Begin();
             j != i->second_.resources_.End(); ++j)
             result.Push(j->second_);
     }
@@ -474,7 +473,7 @@ bool ResourceCache::Exists(StringHash nameHash) const
 
 unsigned ResourceCache::GetMemoryBudget(ShortStringHash type) const
 {
-    Map<ShortStringHash, ResourceGroup>::ConstIterator i = resourceGroups_.Find(type);
+    HashMap<ShortStringHash, ResourceGroup>::ConstIterator i = resourceGroups_.Find(type);
     if (i != resourceGroups_.End())
         return i->second_.memoryBudget_;
     else
@@ -483,7 +482,7 @@ unsigned ResourceCache::GetMemoryBudget(ShortStringHash type) const
 
 unsigned ResourceCache::GetMemoryUse(ShortStringHash type) const
 {
-    Map<ShortStringHash, ResourceGroup>::ConstIterator i = resourceGroups_.Find(type);
+    HashMap<ShortStringHash, ResourceGroup>::ConstIterator i = resourceGroups_.Find(type);
     if (i != resourceGroups_.End())
         return i->second_.memoryUse_;
     else
@@ -493,14 +492,14 @@ unsigned ResourceCache::GetMemoryUse(ShortStringHash type) const
 unsigned ResourceCache::GetTotalMemoryUse() const
 {
     unsigned total = 0;
-    for (Map<ShortStringHash, ResourceGroup>::ConstIterator i = resourceGroups_.Begin(); i != resourceGroups_.End(); ++i)
+    for (HashMap<ShortStringHash, ResourceGroup>::ConstIterator i = resourceGroups_.Begin(); i != resourceGroups_.End(); ++i)
         total += i->second_.memoryUse_;
     return total;
 }
 
 const String& ResourceCache::GetResourceName(StringHash nameHash) const
 {
-    Map<StringHash, String>::ConstIterator i = hashToName_.Find(nameHash);
+    HashMap<StringHash, String>::ConstIterator i = hashToName_.Find(nameHash);
     if (i == hashToName_.End())
         return noName;
     else
@@ -563,7 +562,7 @@ void ResourceCache::StoreNameHash(const String& name)
     StringHash hash(name);
     
     // If entry exists, check for difference (collision)
-    Map<StringHash, String>::Iterator i = hashToName_.Find(hash);
+    HashMap<StringHash, String>::Iterator i = hashToName_.Find(hash);
     if (i != hashToName_.End())
     {
         if (i->second_.Compare(name, false))
@@ -576,10 +575,10 @@ void ResourceCache::StoreNameHash(const String& name)
 
 const SharedPtr<Resource>& ResourceCache::FindResource(ShortStringHash type, StringHash nameHash)
 {
-    Map<ShortStringHash, ResourceGroup>::Iterator i = resourceGroups_.Find(type);
+    HashMap<ShortStringHash, ResourceGroup>::Iterator i = resourceGroups_.Find(type);
     if (i == resourceGroups_.End())
         return noResource;
-    Map<StringHash, SharedPtr<Resource> >::Iterator j = i->second_.resources_.Find(nameHash);
+    HashMap<StringHash, SharedPtr<Resource> >::Iterator j = i->second_.resources_.Find(nameHash);
     if (j == i->second_.resources_.End())
         return noResource;
     
@@ -590,16 +589,16 @@ void ResourceCache::ReleasePackageResources(PackageFile* package, bool force)
 {
     HashSet<ShortStringHash> affectedGroups;
     
-    const Map<String, PackageEntry>& entries = package->GetEntries();
-    for (Map<String, PackageEntry>::ConstIterator i = entries.Begin(); i != entries.End(); ++i)
+    const HashMap<String, PackageEntry>& entries = package->GetEntries();
+    for (HashMap<String, PackageEntry>::ConstIterator i = entries.Begin(); i != entries.End(); ++i)
     {
         StringHash nameHash(i->first_);
         
         // We do not know the actual resource type, so search all type containers
-        for (Map<ShortStringHash, ResourceGroup>::Iterator j = resourceGroups_.Begin();
+        for (HashMap<ShortStringHash, ResourceGroup>::Iterator j = resourceGroups_.Begin();
             j != resourceGroups_.End(); ++j)
         {
-            Map<StringHash, SharedPtr<Resource> >::Iterator k = j->second_.resources_.Find(nameHash);
+            HashMap<StringHash, SharedPtr<Resource> >::Iterator k = j->second_.resources_.Find(nameHash);
             if (k != j->second_.resources_.End())
             {
                 // If other references exist, do not release, unless forced
@@ -619,7 +618,7 @@ void ResourceCache::ReleasePackageResources(PackageFile* package, bool force)
 
 void ResourceCache::UpdateResourceGroup(ShortStringHash type)
 {
-    Map<ShortStringHash, ResourceGroup>::Iterator i = resourceGroups_.Find(type);
+    HashMap<ShortStringHash, ResourceGroup>::Iterator i = resourceGroups_.Find(type);
     if (i == resourceGroups_.End())
         return;
     
@@ -627,9 +626,9 @@ void ResourceCache::UpdateResourceGroup(ShortStringHash type)
     {
         unsigned totalSize = 0;
         unsigned oldestTimer = 0;
-        Map<StringHash, SharedPtr<Resource> >::Iterator oldestResource = i->second_.resources_.End();
+        HashMap<StringHash, SharedPtr<Resource> >::Iterator oldestResource = i->second_.resources_.End();
         
-        for (Map<StringHash, SharedPtr<Resource> >::Iterator j = i->second_.resources_.Begin();
+        for (HashMap<StringHash, SharedPtr<Resource> >::Iterator j = i->second_.resources_.Begin();
             j != i->second_.resources_.End(); ++j)
         {
             totalSize += j->second_->GetMemoryUse();
@@ -668,9 +667,9 @@ void ResourceCache::HandleBeginFrame(StringHash eventType, VariantMap& eventData
         while (fileWatchers_[i]->GetNextChange(fileName))
         {
             // If the filename is a resource we keep track of, reload it
-            for (Map<ShortStringHash, ResourceGroup>::Iterator j = resourceGroups_.Begin(); j != resourceGroups_.End(); ++j)
+            for (HashMap<ShortStringHash, ResourceGroup>::Iterator j = resourceGroups_.Begin(); j != resourceGroups_.End(); ++j)
             {
-                Map<StringHash, SharedPtr<Resource> >::Iterator k = j->second_.resources_.Find(StringHash(fileName));
+                HashMap<StringHash, SharedPtr<Resource> >::Iterator k = j->second_.resources_.Find(StringHash(fileName));
                 if (k != j->second_.resources_.End())
                 {
                     LOGDEBUG("Reloading changed resource " + fileName);

+ 4 - 4
Engine/Resource/ResourceCache.h

@@ -44,7 +44,7 @@ struct ResourceGroup
     /// Current memory use.
     unsigned memoryUse_;
     /// Resources.
-    Map<StringHash, SharedPtr<Resource> > resources_;
+    HashMap<StringHash, SharedPtr<Resource> > resources_;
 };
 
 /// %Resource cache subsystem. Loads resources on demand and stores them for later access.
@@ -96,7 +96,7 @@ public:
     /// Return all loaded resources of a specific type.
     void GetResources(PODVector<Resource*>& result, ShortStringHash type) const;
     /// Return all loaded resources.
-    const Map<ShortStringHash, ResourceGroup>& GetAllResources() const { return resourceGroups_; }
+    const HashMap<ShortStringHash, ResourceGroup>& GetAllResources() const { return resourceGroups_; }
     /// Return added resource load directories.
     const Vector<String>& GetResourceDirs() const { return resourceDirs_; }
     /// Return added package files.
@@ -140,7 +140,7 @@ private:
     void HandleBeginFrame(StringHash eventType, VariantMap& eventData);
     
     /// Resources by type.
-    Map<ShortStringHash, ResourceGroup> resourceGroups_;
+    HashMap<ShortStringHash, ResourceGroup> resourceGroups_;
     /// Resource load directories.
     Vector<String> resourceDirs_;
     /// File watchers for resource directories, if automatic reloading enabled.
@@ -148,7 +148,7 @@ private:
     /// Package files.
     Vector<SharedPtr<PackageFile> > packages_;
     /// Mapping of hashes to filenames.
-    Map<StringHash, String> hashToName_;
+    HashMap<StringHash, String> hashToName_;
     /// Automatic resource reloading flag.
     bool autoReloadResources_;
 };

+ 1 - 1
Engine/Scene/Scene.cpp

@@ -35,7 +35,7 @@
 #include "WorkQueue.h"
 #include "XMLFile.h"
 
-static const int ASYNC_LOAD_MIN_FPS = 50;
+static const int ASYNC_LOAD_MIN_FPS = 30;
 static const int ASYNC_LOAD_MAX_MSEC = (int)(1000.0f / ASYNC_LOAD_MIN_FPS);
 static const float DEFAULT_SMOOTHING_CONSTANT = 50.0f;
 static const float DEFAULT_SNAP_THRESHOLD = 1.0f;

+ 2 - 2
Engine/Script/ScriptFile.cpp

@@ -257,7 +257,7 @@ asIScriptObject* ScriptFile::CreateObject(const String& className)
     
     // Ensure that the type implements the "ScriptObject" interface, so it can be returned to script properly
     bool found = false;
-    Map<asIObjectType*, bool>::ConstIterator i = validClasses_.Find(type);
+    HashMap<asIObjectType*, bool>::ConstIterator i = validClasses_.Find(type);
     if (i != validClasses_.End())
         found = i->second_;
     else
@@ -315,7 +315,7 @@ asIScriptFunction* ScriptFile::GetMethod(asIScriptObject* object, const String&
     asIObjectType* type = object->GetObjectType();
     if (!type)
         return 0;
-    Map<asIObjectType*, HashMap<String, asIScriptFunction*> >::ConstIterator i = methods_.Find(type);
+    HashMap<asIObjectType*, HashMap<String, asIScriptFunction*> >::ConstIterator i = methods_.Find(type);
     if (i != methods_.End())
     {
         HashMap<String, asIScriptFunction*>::ConstIterator j = i->second_.Find(declaration);

+ 2 - 3
Engine/Script/ScriptFile.h

@@ -23,7 +23,6 @@
 
 #pragma once
 
-#include "HashMap.h"
 #include "HashSet.h"
 #include "Resource.h"
 #include "ScriptEventListener.h"
@@ -99,11 +98,11 @@ private:
     /// Encountered include files during script file loading.
     HashSet<String> includeFiles_;
     /// Search cache for checking whether script classes implement "ScriptObject" interface.
-    Map<asIObjectType*, bool> validClasses_;
+    HashMap<asIObjectType*, bool> validClasses_;
     /// Search cache for functions.
     HashMap<String, asIScriptFunction*> functions_;
     /// Search cache for methods.
-    Map<asIObjectType*, HashMap<String, asIScriptFunction*> > methods_;
+    HashMap<asIObjectType*, HashMap<String, asIScriptFunction*> > methods_;
 };
 
 /// Get currently executing script file.

+ 0 - 1
Engine/UI/Font.h

@@ -24,7 +24,6 @@
 #pragma once
 
 #include "ArrayPtr.h"
-#include "HashMap.h"
 #include "Resource.h"
 
 class Graphics;

+ 1 - 0
Tools/OgreImporter/OgreImporterUtils.h

@@ -26,6 +26,7 @@
 #include "Animation.h"
 #include "BoundingBox.h"
 #include "Graphics.h"
+#include "Map.h"
 #include "Serializer.h"
 #include "Matrix3x4.h"
 

+ 2 - 0
Tools/ShaderCompiler/ShaderCompiler.cpp

@@ -25,8 +25,10 @@
 #include "File.h"
 #include "FileSystem.h"
 #include "List.h"
+#include "Map.h"
 #include "Mutex.h"
 #include "ProcessUtils.h"
+#include "Set.h"
 #include "StringUtils.h"
 #include "Thread.h"
 #include "XMLFile.h"