diff --git a/src/framework/core/logger.h b/src/framework/core/logger.h index fbbc5489..93455a02 100644 --- a/src/framework/core/logger.h +++ b/src/framework/core/logger.h @@ -49,7 +49,7 @@ public: void setOnLog(const OnLogCallback& onLog) { m_onLog = onLog; } private: - std::vector m_logMessages; + std::list m_logMessages; OnLogCallback m_onLog; bool m_terminated; }; diff --git a/src/framework/graphics/texture.cpp b/src/framework/graphics/texture.cpp index a557e1d2..9a9af1cc 100644 --- a/src/framework/graphics/texture.cpp +++ b/src/framework/graphics/texture.cpp @@ -68,7 +68,7 @@ uint Texture::internalLoadGLTexture(uchar *pixels, int channels, int width, int glGenTextures(1, &id); glBindTexture(GL_TEXTURE_2D, id); - std::vector tmp; + std::vector tmp; // old opengl drivers only accept power of two dimensions if(!g_graphics.isExtensionSupported("GL_ARB_texture_non_power_of_two") && pixels) { diff --git a/src/framework/ui/uianchorlayout.h b/src/framework/ui/uianchorlayout.h index 38db2ac2..13cdc6df 100644 --- a/src/framework/ui/uianchorlayout.h +++ b/src/framework/ui/uianchorlayout.h @@ -41,18 +41,20 @@ private: std::string m_hookedWidgetId; }; +typedef std::vector UIAnchorList; + class UIAnchorGroup { public: UIAnchorGroup() : m_updated(true) { } void addAnchor(const UIAnchor& anchor); - const std::vector& getAnchors() const { return m_anchors; } + const UIAnchorList& getAnchors() const { return m_anchors; } bool isUpdated() const { return m_updated; } void setUpdated(bool updated) { m_updated = updated; } private: - std::vector m_anchors; + UIAnchorList m_anchors; bool m_updated; }; diff --git a/src/otclient/core/datmanager.h b/src/otclient/core/datmanager.h index e2bc81a3..b376049f 100644 --- a/src/otclient/core/datmanager.h +++ b/src/otclient/core/datmanager.h @@ -45,10 +45,10 @@ public: private: uint32 m_signature; - std::vector m_itemsAttributes; - std::vector m_creaturesAttributes; - std::vector m_effectsAttributes; - std::vector m_shotsAttributes; + ThingAttributesList m_itemsAttributes; + ThingAttributesList m_creaturesAttributes; + ThingAttributesList m_effectsAttributes; + ThingAttributesList m_shotsAttributes; }; extern DatManager g_dat; diff --git a/src/otclient/core/declarations.h b/src/otclient/core/declarations.h index c908e9b7..f3779d3d 100644 --- a/src/otclient/core/declarations.h +++ b/src/otclient/core/declarations.h @@ -41,4 +41,6 @@ typedef std::shared_ptr EffectPtr; typedef std::shared_ptr PlayerPtr; typedef std::shared_ptr LocalPlayerPtr; +typedef std::vector ThingList; + #endif diff --git a/src/otclient/core/map.cpp b/src/otclient/core/map.cpp index 6a61b77d..45040a24 100644 --- a/src/otclient/core/map.cpp +++ b/src/otclient/core/map.cpp @@ -108,7 +108,7 @@ void Map::draw(const Rect& rect) for(int iy = -5; iy <= 5; ++iy) { Position itemPos = Position(playerPos.x + ix, playerPos.y + iy, playerPos.z); if(const TilePtr& tile = m_tiles[itemPos]) { - std::vector creatures = tile->getCreatures(); + auto& creatures = tile->getCreatures(); for(auto it = creatures.rbegin(), end = creatures.rend(); it != end; ++it) { const ThingPtr& thing = *it; const CreaturePtr& creature = thing->asCreature(); diff --git a/src/otclient/core/thingattributes.h b/src/otclient/core/thingattributes.h index ccf48108..f8c377ac 100644 --- a/src/otclient/core/thingattributes.h +++ b/src/otclient/core/thingattributes.h @@ -72,4 +72,6 @@ struct ThingAttributes Otc::ThingAttributesGroup group; }; +typedef std::vector ThingAttributesList; + #endif diff --git a/src/otclient/core/tile.h b/src/otclient/core/tile.h index 15d89647..fc5f53a7 100644 --- a/src/otclient/core/tile.h +++ b/src/otclient/core/tile.h @@ -44,15 +44,15 @@ public: int getStackSize(int stop); - std::vector getCreatures() { return m_creatures; } + const ThingList& getCreatures() { return m_creatures; } int getDrawNextOffset() { return m_drawNextOffset; } private: ThingPtr m_ground; - std::vector m_itemsBottom; - std::vector m_creatures; - std::vector m_itemsTop; - std::vector m_effects; + ThingList m_itemsBottom; + ThingList m_creatures; + ThingList m_itemsTop; + ThingList m_effects; int m_drawNextOffset; };