- applied patch to allow tilesets to not force random object placement

This commit is contained in:
Mark Vejvoda 2013-10-08 04:36:21 +00:00
parent c1305bdd1b
commit 42912e0b74
3 changed files with 14 additions and 0 deletions

View File

@ -52,6 +52,9 @@ Object::Object(ObjectType *objectType, const Vec3f &pos, const Vec2i &mapPos) :
if(tmt->getRotationAllowed() != true) {
rotation=0;
}
if(tmt->getRandomPositionEnabled() != true) {
this->pos = pos;
}
animated=tmt->getAnimSpeed()>0;
}
visible=false;

View File

@ -43,6 +43,7 @@ private:
ModelParticleSystemTypes particleTypes;
int height;
bool rotationAllowed;
bool randomPositionEnabled;
bool smoothTwoFrameAnim;
int animSpeed;
@ -64,6 +65,9 @@ public:
inline bool getRotationAllowed() const {return rotationAllowed;}
inline void setRotationAllowed(bool rotationAllowed) {this->rotationAllowed=rotationAllowed;}
inline bool getRandomPositionEnabled() const {return randomPositionEnabled;}
inline void setRandomPositionEnabled(bool randomPositionEnabled) {this->randomPositionEnabled=randomPositionEnabled;}
inline bool getSmoothTwoFrameAnim() const {return smoothTwoFrameAnim;}
inline void setSmoothTwoFrameAnim(bool smoothTwoFrameAnim) {this->smoothTwoFrameAnim=smoothTwoFrameAnim;}

View File

@ -349,6 +349,13 @@ void Tileset::load(const string &dir, Checksum *checksum, Checksum *tilesetCheck
else{
tmt->setRotationAllowed(true);
}
//randomPositionEnabled
if(modelNode->hasAttribute("randomPositionEnabled") == true) {
tmt->setRandomPositionEnabled(modelNode->getAttribute("randomPositionEnabled")->getBoolValue());
}
else{
tmt->setRandomPositionEnabled(true);
}
//smoothTwoFrameAnim
if(modelNode->hasAttribute("smoothTwoFrameAnim") == true) {