- applied patch to allow tilesets to not force random object placement
This commit is contained in:
parent
c1305bdd1b
commit
42912e0b74
|
@ -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;
|
||||
|
|
|
@ -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;}
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue