- some speed optimizations in areas mentioned by perf tool

This commit is contained in:
Mark Vejvoda 2012-09-27 15:04:28 +00:00
parent 4e195e10af
commit 5e57921fef
3 changed files with 32 additions and 32 deletions

View File

@ -66,13 +66,13 @@ public:
TilesetModelType* loadModel(const string &path, std::map<string,vector<pair<string, string> > > *loadedFileList=NULL,
string parentLoader="");
TilesetModelType *getTilesetModelType(int i) {return modeltypes[i];}
int getModelCount() const {return modeltypes.size();}
const Vec3f &getColor() const {return color;}
int getClass() const {return objectClass;}
bool getWalkable() const {return walkable;}
int getHeight() const {return height;}
bool isATree() const {return objectClass==tree1 || objectClass==tree2;}
inline TilesetModelType *getTilesetModelType(int i) {return modeltypes[i];}
inline int getModelCount() const {return modeltypes.size();}
inline const Vec3f &getColor() const {return color;}
inline int getClass() const {return objectClass;}
inline bool getWalkable() const {return walkable;}
inline int getHeight() const {return height;}
inline bool isATree() const {return objectClass==tree1 || objectClass==tree2;}
void deletePixels();
};

View File

@ -247,25 +247,25 @@ public:
virtual string toString() const;
//get
int getAttackStrength() const {return attackStrength;}
int getAttackVar() const {return attackVar;}
int getAttackRange() const {return attackRange;}
const AttackType *getAttackType() const {return attackType;}
bool getAttackField(Field field) const {return attackFields[field];}
float getAttackStartTime() const {return attackStartTime;}
string getSpawnUnit() const {return spawnUnit;}
int getSpawnUnitCount() const {return spawnUnitcount;}
inline int getAttackStrength() const {return attackStrength;}
inline int getAttackVar() const {return attackVar;}
inline int getAttackRange() const {return attackRange;}
inline const AttackType *getAttackType() const {return attackType;}
inline bool getAttackField(Field field) const {return attackFields[field];}
inline float getAttackStartTime() const {return attackStartTime;}
inline string getSpawnUnit() const {return spawnUnit;}
inline int getSpawnUnitCount() const {return spawnUnitcount;}
//get proj
bool getProjectile() const {return projectile;}
ParticleSystemTypeProjectile * getProjParticleType() const {return projectileParticleSystemType;}
StaticSound *getProjSound() const {return projSounds.getRandSound();}
inline bool getProjectile() const {return projectile;}
inline ParticleSystemTypeProjectile * getProjParticleType() const {return projectileParticleSystemType;}
inline StaticSound *getProjSound() const {return projSounds.getRandSound();}
//get splash
bool getSplash() const {return splash;}
int getSplashRadius() const {return splashRadius;}
bool getSplashDamageAll() const {return splashDamageAll;}
ParticleSystemTypeSplash * getSplashParticleType() const {return splashParticleSystemType;}
inline bool getSplash() const {return splash;}
inline int getSplashRadius() const {return splashRadius;}
inline bool getSplashDamageAll() const {return splashDamageAll;}
inline ParticleSystemTypeSplash * getSplashParticleType() const {return splashParticleSystemType;}
//misc
int getTotalAttackStrength(const TotalUpgrade *totalUpgrade) const;

View File

@ -51,21 +51,21 @@ public:
~TilesetModelType();
void addParticleSystem(ObjectParticleSystemType *particleSystem);
bool hasParticles() const {return particleTypes.empty() == false;}
ModelParticleSystemTypes* getParticleTypes() { return &particleTypes ;}
inline bool hasParticles() const {return particleTypes.empty() == false;}
inline ModelParticleSystemTypes* getParticleTypes() { return &particleTypes ;}
Model * getModel() const {return model;}
void setModel(Model *model) {this->model=model;}
inline Model * getModel() const {return model;}
inline void setModel(Model *model) {this->model=model;}
int getHeight() const {return height;}
void setHeight(int height) {this->height=height;}
inline int getHeight() const {return height;}
inline void setHeight(int height) {this->height=height;}
bool getRotationAllowed() const {return rotationAllowed;}
void setRotationAllowed(bool rotationAllowed) {this->rotationAllowed=rotationAllowed;}
inline bool getRotationAllowed() const {return rotationAllowed;}
inline void setRotationAllowed(bool rotationAllowed) {this->rotationAllowed=rotationAllowed;}
int getAnimSpeed() const {return animSpeed;}
void setAnimSpeed(int value) {animSpeed = value;}
inline int getAnimSpeed() const {return animSpeed;}
inline void setAnimSpeed(int value) {animSpeed = value;}
};
}}//end namespace