refl bugfix
This commit is contained in:
parent
0828271799
commit
ba8692659f
@ -13,8 +13,8 @@ namespace refl {
|
||||
inline bool Convert::Construct(Any& dst, const Any& src)
|
||||
{
|
||||
if (dst.Check(src.cls)) {
|
||||
dst.cls->InitObject((void*)dst.ptr);
|
||||
dst.cls->CopyObject((void*)dst.ptr, src.ptr);
|
||||
dst.cls->parent->InitObject((void*)dst.ptr);
|
||||
dst.cls->parent->CopyObject((void*)dst.ptr, src.ptr);
|
||||
return true;
|
||||
}
|
||||
auto it = ClassMap.find(dst.cls);
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
#pragma once
|
||||
#include "uclass.h"
|
||||
namespace refl {
|
||||
template<typename Func, typename... Args>
|
||||
|
||||
@ -18,6 +18,9 @@ namespace refl {
|
||||
for (auto& field : fields) {
|
||||
size += field.data.member.offset;
|
||||
}
|
||||
if (size == 0) {
|
||||
size = 1;
|
||||
}
|
||||
return size;
|
||||
}
|
||||
enum MetaFlag :uint32_t {
|
||||
|
||||
1
engine/3rdparty/zlib/include/refl/macro.h
vendored
1
engine/3rdparty/zlib/include/refl/macro.h
vendored
@ -1,3 +1,4 @@
|
||||
#pragma once
|
||||
#if !defined(__cppast)
|
||||
#define __cppast(...)
|
||||
#endif
|
||||
9
engine/3rdparty/zlib/test/refl/vertex.h
vendored
9
engine/3rdparty/zlib/test/refl/vertex.h
vendored
@ -12,14 +12,14 @@ struct vec3_parent {
|
||||
struct vec4 {
|
||||
string name{ "hello" };
|
||||
};
|
||||
struct vec3_Meta;
|
||||
class vec3_Meta;
|
||||
struct vec3 : public vec3_parent {
|
||||
using MyMeta = vec3_Meta;
|
||||
__cppast(Meta = { 0.f})
|
||||
__cppast(Meta = { 1.f})
|
||||
float x = 1;
|
||||
__cppast(Meta = { 0.f})
|
||||
__cppast(Meta = { 2.f})
|
||||
float y = 2;
|
||||
__cppast(Meta = { 0.f})
|
||||
__cppast(Meta = { 5.f})
|
||||
float z = 3;
|
||||
__cppast(Meta = { "hello meta"})
|
||||
string name = "???";
|
||||
@ -50,5 +50,4 @@ struct vec3 : public vec3_parent {
|
||||
cout << x1 << "::norm3" << endl;
|
||||
}
|
||||
};
|
||||
|
||||
#include "meta_vertex_gen.inl"
|
||||
Loading…
Reference in New Issue
Block a user