- 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) {
|
if(tmt->getRotationAllowed() != true) {
|
||||||
rotation=0;
|
rotation=0;
|
||||||
}
|
}
|
||||||
|
if(tmt->getRandomPositionEnabled() != true) {
|
||||||
|
this->pos = pos;
|
||||||
|
}
|
||||||
animated=tmt->getAnimSpeed()>0;
|
animated=tmt->getAnimSpeed()>0;
|
||||||
}
|
}
|
||||||
visible=false;
|
visible=false;
|
||||||
|
|
|
@ -43,6 +43,7 @@ private:
|
||||||
ModelParticleSystemTypes particleTypes;
|
ModelParticleSystemTypes particleTypes;
|
||||||
int height;
|
int height;
|
||||||
bool rotationAllowed;
|
bool rotationAllowed;
|
||||||
|
bool randomPositionEnabled;
|
||||||
bool smoothTwoFrameAnim;
|
bool smoothTwoFrameAnim;
|
||||||
|
|
||||||
int animSpeed;
|
int animSpeed;
|
||||||
|
@ -65,6 +66,9 @@ public:
|
||||||
inline bool getRotationAllowed() const {return rotationAllowed;}
|
inline bool getRotationAllowed() const {return rotationAllowed;}
|
||||||
inline void setRotationAllowed(bool rotationAllowed) {this->rotationAllowed=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 bool getSmoothTwoFrameAnim() const {return smoothTwoFrameAnim;}
|
||||||
inline void setSmoothTwoFrameAnim(bool smoothTwoFrameAnim) {this->smoothTwoFrameAnim=smoothTwoFrameAnim;}
|
inline void setSmoothTwoFrameAnim(bool smoothTwoFrameAnim) {this->smoothTwoFrameAnim=smoothTwoFrameAnim;}
|
||||||
|
|
||||||
|
|
|
@ -349,6 +349,13 @@ void Tileset::load(const string &dir, Checksum *checksum, Checksum *tilesetCheck
|
||||||
else{
|
else{
|
||||||
tmt->setRotationAllowed(true);
|
tmt->setRotationAllowed(true);
|
||||||
}
|
}
|
||||||
|
//randomPositionEnabled
|
||||||
|
if(modelNode->hasAttribute("randomPositionEnabled") == true) {
|
||||||
|
tmt->setRandomPositionEnabled(modelNode->getAttribute("randomPositionEnabled")->getBoolValue());
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
tmt->setRandomPositionEnabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
//smoothTwoFrameAnim
|
//smoothTwoFrameAnim
|
||||||
if(modelNode->hasAttribute("smoothTwoFrameAnim") == true) {
|
if(modelNode->hasAttribute("smoothTwoFrameAnim") == true) {
|
||||||
|
|
Loading…
Reference in New Issue