mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 11:37:58 +02:00
Merge pull request #3353 from ZappoMan/virtualEntities
fix couple of Entities issues: possible static memory corruption, sphere colors
This commit is contained in:
commit
fb8b3020e5
4 changed files with 8 additions and 7 deletions
|
@ -2862,7 +2862,7 @@ function handeMenuEvent(menuItem) {
|
||||||
properties.gravity.z = array[index++].value;
|
properties.gravity.z = array[index++].value;
|
||||||
properties.lifetime = array[index++].value; // give ourselves that many more seconds
|
properties.lifetime = array[index++].value; // give ourselves that many more seconds
|
||||||
|
|
||||||
if (properties.type == "Box") {
|
if (properties.type == "Box" || properties.type == "Sphere") {
|
||||||
properties.color.red = array[index++].value;
|
properties.color.red = array[index++].value;
|
||||||
properties.color.green = array[index++].value;
|
properties.color.green = array[index++].value;
|
||||||
properties.color.blue = array[index++].value;
|
properties.color.blue = array[index++].value;
|
||||||
|
|
|
@ -50,8 +50,6 @@ public:
|
||||||
EntityItemID convertToCreatorTokenVersion() const;
|
EntityItemID convertToCreatorTokenVersion() const;
|
||||||
|
|
||||||
// these methods allow you to create models, and later edit them.
|
// these methods allow you to create models, and later edit them.
|
||||||
//static uint32_t getIDfromCreatorTokenID(uint32_t creatorTokenID);
|
|
||||||
|
|
||||||
static EntityItemID getIDfromCreatorTokenID(uint32_t creatorTokenID);
|
static EntityItemID getIDfromCreatorTokenID(uint32_t creatorTokenID);
|
||||||
static uint32_t getNextCreatorTokenID();
|
static uint32_t getNextCreatorTokenID();
|
||||||
static void handleAddEntityResponse(const QByteArray& packet);
|
static void handleAddEntityResponse(const QByteArray& packet);
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
QMap<EntityTypes::EntityType, QString> EntityTypes::_typeToNameMap;
|
QMap<EntityTypes::EntityType, QString> EntityTypes::_typeToNameMap;
|
||||||
QMap<QString, EntityTypes::EntityType> EntityTypes::_nameToTypeMap;
|
QMap<QString, EntityTypes::EntityType> EntityTypes::_nameToTypeMap;
|
||||||
EntityTypeFactory EntityTypes::_factories[EntityTypes::LAST];
|
EntityTypeFactory EntityTypes::_factories[EntityTypes::LAST + 1];
|
||||||
bool EntityTypes::_factoriesInitialized = false;
|
bool EntityTypes::_factoriesInitialized = false;
|
||||||
|
|
||||||
const QString ENTITY_TYPE_NAME_UNKNOWN = "Unknown";
|
const QString ENTITY_TYPE_NAME_UNKNOWN = "Unknown";
|
||||||
|
@ -58,8 +58,11 @@ bool EntityTypes::registerEntityType(EntityType entityType, const char* name, En
|
||||||
memset(&_factories,0,sizeof(_factories));
|
memset(&_factories,0,sizeof(_factories));
|
||||||
_factoriesInitialized = true;
|
_factoriesInitialized = true;
|
||||||
}
|
}
|
||||||
|
if (entityType >= 0 && entityType <= LAST) {
|
||||||
_factories[entityType] = factoryMethod;
|
_factories[entityType] = factoryMethod;
|
||||||
return true;
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
EntityItem* EntityTypes::constructEntityItem(EntityType entityType, const EntityItemID& entityID, const EntityItemProperties& properties) {
|
EntityItem* EntityTypes::constructEntityItem(EntityType entityType, const EntityItemID& entityID, const EntityItemProperties& properties) {
|
||||||
|
|
|
@ -45,7 +45,7 @@ public:
|
||||||
private:
|
private:
|
||||||
static QMap<EntityType, QString> _typeToNameMap;
|
static QMap<EntityType, QString> _typeToNameMap;
|
||||||
static QMap<QString, EntityTypes::EntityType> _nameToTypeMap;
|
static QMap<QString, EntityTypes::EntityType> _nameToTypeMap;
|
||||||
static EntityTypeFactory _factories[LAST];
|
static EntityTypeFactory _factories[LAST + 1];
|
||||||
static bool _factoriesInitialized;
|
static bool _factoriesInitialized;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue