X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FInterpreter.cpp;h=f9f57bfb55f1fa32a4432b12b5cda29bfc586fe8;hb=b02da898c7c8a08141df4e797774a61cf5e0163f;hp=42fb1216d18e207d4e20c843fd2856a0dde15bc4;hpb=be7b4addf295d6193ba2527cdd17cdb524339aed;p=l2e.git diff --git a/src/loader/Interpreter.cpp b/src/loader/Interpreter.cpp index 42fb121..f9f57bf 100644 --- a/src/loader/Interpreter.cpp +++ b/src/loader/Interpreter.cpp @@ -175,6 +175,7 @@ void *Interpreter::GetObject(int typeId, const Value &v) { int typeId(TypeDescription::GetTypeId(v.GetLiteral().GetTypeName())); const TypeDescription &td(TypeDescription::Get(typeId)); char *object(new char[td.Size()]); + td.Construct(object); int id(values[typeId].size()); values[typeId].push_back(object); ReadObject(typeId, id, object, *v.GetLiteral().GetProperties()); @@ -250,6 +251,7 @@ void *Interpreter::GetObject(int typeId, const Value &v) { const TypeDescription &td(TypeDescription::Get(typeId)); id = values[typeId].size(); char *object(new char[td.Size()]); + td.Construct(object); ReadObject(typeId, id, object, *v.GetLiteral().GetProperties()); } break; @@ -268,6 +270,7 @@ void Interpreter::ReadObject(const Definition &dfn) { const TypeDescription &td(TypeDescription::Get(typeId)); int id(values[typeId].size()); char *object(new char[td.Size()]); + td.Construct(object); values[typeId].push_back(object); ReadObject(typeId, id, object, *dfn.GetProperties()); parsedDefinitions.insert(make_pair(dfn.Identifier(), ParsedDefinition(&dfn, typeId, id))); @@ -290,6 +293,7 @@ void Interpreter::ReadObject(int typeId, int id, char *object, const PropertyLis char *iter(aggregate); vector list(i->second->GetLiteral().GetPropertyLists()); for (vector::const_iterator j(list.begin()), end(list.end()); j != end; ++j, iter += fieldType.Size()) { + fieldType.Construct(iter); ReadObject(fieldType.TypeId(), -1, iter, **j); } if (fd.IsReferenced()) {