Guard model texs

This commit is contained in:
Zach Pomerantz 2016-03-30 14:11:45 -07:00
parent e4f12c81e0
commit 54b8a9278d
2 changed files with 15 additions and 2 deletions

View file

@ -42,6 +42,17 @@ ModelEntityItem::ModelEntityItem(const EntityItemID& entityItemID) : EntityItem(
_color[0] = _color[1] = _color[2] = 0;
}
const QString ModelEntityItem::getTextures() const {
QReadLocker locker(&_texturesLock);
auto textures = _textures;
return textures;
}
void ModelEntityItem::setTextures(const QString& textures) {
QWriteLocker locker(&_texturesLock);
_textures = textures;
}
EntityItemProperties ModelEntityItem::getProperties(EntityPropertyFlags desiredProperties) const {
EntityItemProperties properties = EntityItem::getProperties(desiredProperties); // get the properties from our base class
COPY_ENTITY_PROPERTY_TO_PROPERTIES(color, getXColor);

View file

@ -110,8 +110,8 @@ public:
float getAnimationFPS() const { return _animationLoop.getFPS(); }
static const QString DEFAULT_TEXTURES;
const QString& getTextures() const { return _textures; }
void setTextures(const QString& textures) { _textures = textures; }
const QString getTextures() const;
void setTextures(const QString& textures);
virtual bool shouldBePhysical() const;
@ -159,7 +159,9 @@ protected:
AnimationPropertyGroup _animationProperties;
AnimationLoop _animationLoop;
mutable QReadWriteLock _texturesLock;
QString _textures;
ShapeType _shapeType = SHAPE_TYPE_NONE;
// used on client side