X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FTypeDescription.cpp;h=ed88e8ec8eedee6e3d4f83d482ae7008f39e0440;hb=cddc8a96cce6117dac14248455ac70d332a4a9f8;hp=07be7b29f165dd091e36d78e292851377546c858;hpb=ac3755adc509404528ef7de58695bf8e3bfb7dcd;p=l2e.git diff --git a/src/loader/TypeDescription.cpp b/src/loader/TypeDescription.cpp index 07be7b2..ed88e8e 100644 --- a/src/loader/TypeDescription.cpp +++ b/src/loader/TypeDescription.cpp @@ -8,6 +8,7 @@ #include "TypeDescription.h" #include +#include #include using std::map; @@ -37,6 +38,14 @@ const FieldDescription &TypeDescription::GetField(const std::string &n) const { } } +void TypeDescription::Construct(void *data) const { + if (constructor) { + (*constructor)(data); + } else { + std::memset(data, 0, Size()); + } +} + void TypeDescription::AddSupertype(int id, std::ptrdiff_t offset) { supertypes[id] = offset;