add some typedefs

This commit is contained in:
Eduardo Bart 2011-08-28 13:31:01 -03:00
parent e87297c1b5
commit 05edcc218d
8 changed files with 20 additions and 14 deletions

View File

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

View File

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

View File

@ -41,18 +41,20 @@ private:
std::string m_hookedWidgetId;
};
typedef std::vector<UIAnchor> UIAnchorList;
class UIAnchorGroup
{
public:
UIAnchorGroup() : m_updated(true) { }
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; }
void setUpdated(bool updated) { m_updated = updated; }
private:
std::vector<UIAnchor> m_anchors;
UIAnchorList m_anchors;
bool m_updated;
};

View File

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

View File

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

View File

@ -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<ThingPtr> 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();

View File

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

View File

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