add some typedefs

master
Eduardo Bart 13 years ago
parent e87297c1b5
commit 05edcc218d

@ -49,7 +49,7 @@ public:
void setOnLog(const OnLogCallback& onLog) { m_onLog = onLog; } void setOnLog(const OnLogCallback& onLog) { m_onLog = onLog; }
private: private:
std::vector<LogMessage> m_logMessages; std::list<LogMessage> m_logMessages;
OnLogCallback m_onLog; OnLogCallback m_onLog;
bool m_terminated; bool m_terminated;
}; };

@ -68,7 +68,7 @@ uint Texture::internalLoadGLTexture(uchar *pixels, int channels, int width, int
glGenTextures(1, &id); glGenTextures(1, &id);
glBindTexture(GL_TEXTURE_2D, id); glBindTexture(GL_TEXTURE_2D, id);
std::vector<uchar> tmp; std::vector<uint8> tmp;
// old opengl drivers only accept power of two dimensions // old opengl drivers only accept power of two dimensions
if(!g_graphics.isExtensionSupported("GL_ARB_texture_non_power_of_two") && pixels) { if(!g_graphics.isExtensionSupported("GL_ARB_texture_non_power_of_two") && pixels) {

@ -41,18 +41,20 @@ private:
std::string m_hookedWidgetId; std::string m_hookedWidgetId;
}; };
typedef std::vector<UIAnchor> UIAnchorList;
class UIAnchorGroup class UIAnchorGroup
{ {
public: public:
UIAnchorGroup() : m_updated(true) { } UIAnchorGroup() : m_updated(true) { }
void addAnchor(const UIAnchor& anchor); void addAnchor(const UIAnchor& anchor);
const std::vector<UIAnchor>& getAnchors() const { return m_anchors; } const UIAnchorList& getAnchors() const { return m_anchors; }
bool isUpdated() const { return m_updated; } bool isUpdated() const { return m_updated; }
void setUpdated(bool updated) { m_updated = updated; } void setUpdated(bool updated) { m_updated = updated; }
private: private:
std::vector<UIAnchor> m_anchors; UIAnchorList m_anchors;
bool m_updated; bool m_updated;
}; };

@ -45,10 +45,10 @@ public:
private: private:
uint32 m_signature; uint32 m_signature;
std::vector<ThingAttributes> m_itemsAttributes; ThingAttributesList m_itemsAttributes;
std::vector<ThingAttributes> m_creaturesAttributes; ThingAttributesList m_creaturesAttributes;
std::vector<ThingAttributes> m_effectsAttributes; ThingAttributesList m_effectsAttributes;
std::vector<ThingAttributes> m_shotsAttributes; ThingAttributesList m_shotsAttributes;
}; };
extern DatManager g_dat; extern DatManager g_dat;

@ -41,4 +41,6 @@ typedef std::shared_ptr<Effect> EffectPtr;
typedef std::shared_ptr<Player> PlayerPtr; typedef std::shared_ptr<Player> PlayerPtr;
typedef std::shared_ptr<LocalPlayer> LocalPlayerPtr; typedef std::shared_ptr<LocalPlayer> LocalPlayerPtr;
typedef std::vector<ThingPtr> ThingList;
#endif #endif

@ -108,7 +108,7 @@ void Map::draw(const Rect& rect)
for(int iy = -5; iy <= 5; ++iy) { for(int iy = -5; iy <= 5; ++iy) {
Position itemPos = Position(playerPos.x + ix, playerPos.y + iy, playerPos.z); Position itemPos = Position(playerPos.x + ix, playerPos.y + iy, playerPos.z);
if(const TilePtr& tile = m_tiles[itemPos]) { if(const TilePtr& tile = m_tiles[itemPos]) {
std::vector<ThingPtr> creatures = tile->getCreatures(); auto& creatures = tile->getCreatures();
for(auto it = creatures.rbegin(), end = creatures.rend(); it != end; ++it) { for(auto it = creatures.rbegin(), end = creatures.rend(); it != end; ++it) {
const ThingPtr& thing = *it; const ThingPtr& thing = *it;
const CreaturePtr& creature = thing->asCreature(); const CreaturePtr& creature = thing->asCreature();

@ -72,4 +72,6 @@ struct ThingAttributes
Otc::ThingAttributesGroup group; Otc::ThingAttributesGroup group;
}; };
typedef std::vector<ThingAttributes> ThingAttributesList;
#endif #endif

@ -44,15 +44,15 @@ public:
int getStackSize(int stop); int getStackSize(int stop);
std::vector<ThingPtr> getCreatures() { return m_creatures; } const ThingList& getCreatures() { return m_creatures; }
int getDrawNextOffset() { return m_drawNextOffset; } int getDrawNextOffset() { return m_drawNextOffset; }
private: private:
ThingPtr m_ground; ThingPtr m_ground;
std::vector<ThingPtr> m_itemsBottom; ThingList m_itemsBottom;
std::vector<ThingPtr> m_creatures; ThingList m_creatures;
std::vector<ThingPtr> m_itemsTop; ThingList m_itemsTop;
std::vector<ThingPtr> m_effects; ThingList m_effects;
int m_drawNextOffset; int m_drawNextOffset;
}; };

Loading…
Cancel
Save