]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/TypeDescription.cpp
added 500ms blackness between map transitions
[l2e.git] / src / loader / TypeDescription.cpp
index 07be7b29f165dd091e36d78e292851377546c858..8fd95d7437ef90f3744eea17d0135f4980d1aa64 100644 (file)
@@ -8,6 +8,7 @@
 #include "TypeDescription.h"
 
 #include <cassert>
+#include <cstring>
 #include <stdexcept>
 
 using std::map;
@@ -37,6 +38,20 @@ 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::Load(void *data) const {
+       if (loader) {
+               (*loader)(data);
+       }
+}
+
 
 void TypeDescription::AddSupertype(int id, std::ptrdiff_t offset) {
        supertypes[id] = offset;