This commit is contained in:
aozhiwei 2023-03-27 18:37:20 +08:00
parent 67465bc565
commit dd2da45e78
4 changed files with 18 additions and 3 deletions

View File

@ -30,6 +30,7 @@ namespace mtb
float scale() const { return scale_; };
const std::string map_collider() const { return map_collider_; };
const std::string world_object_file() const { return world_object_file_; };
const std::string terrain_file() const { return terrain_file_; };
bool has_map_id() const { return __flags__.test(0);};
bool has_template_list() const { return __flags__.test(1);};
@ -51,6 +52,7 @@ namespace mtb
bool has_scale() const { return __flags__.test(17);};
bool has_map_collider() const { return __flags__.test(18);};
bool has_world_object_file() const { return __flags__.test(19);};
bool has_terrain_file() const { return __flags__.test(20);};
protected:
@ -74,9 +76,10 @@ namespace mtb
float scale_ = 0.0f;
std::string map_collider_;
std::string world_object_file_;
std::string terrain_file_;
public:
std::bitset<20> __flags__;
std::bitset<21> __flags__;
};
};

View File

@ -67,7 +67,7 @@ namespace mtb
{
a8::reflect::Class* meta_class = nullptr;
if (!meta_class) {
meta_class = new a8::reflect::Class("Map", 20, 0);
meta_class = new a8::reflect::Class("Map", 21, 0);
meta_class->SetSimpleField(0, "map_id", a8::reflect::ET_INT32, my_offsetof2(Map, map_id_));
meta_class->SetSimpleField(1, "template_list", a8::reflect::ET_STRING, my_offsetof2(Map, template_list_));
meta_class->SetSimpleField(2, "map_name", a8::reflect::ET_STRING, my_offsetof2(Map, map_name_));
@ -88,6 +88,7 @@ namespace mtb
meta_class->SetSimpleField(17, "scale", a8::reflect::ET_FLOAT, my_offsetof2(Map, scale_));
meta_class->SetSimpleField(18, "map_collider", a8::reflect::ET_STRING, my_offsetof2(Map, map_collider_));
meta_class->SetSimpleField(19, "world_object_file", a8::reflect::ET_STRING, my_offsetof2(Map, world_object_file_));
meta_class->SetSimpleField(20, "terrain_file", a8::reflect::ET_STRING, my_offsetof2(Map, terrain_file_));
}
return meta_class;
}

View File

@ -35,6 +35,7 @@ message Map
optional float scale = 18;
optional string map_collider = 19;
optional string world_object_file = 20;
optional string terrain_file = 21;
}
message MapArea

View File

@ -16,4 +16,14 @@ message HeightData{
message HeightInfo{
optional int32 t = 1;
required int32 h = 2;
}
}
message vector3{
required float x = 1;
required float y = 2;
required float z = 3;
}
message vertex{
repeated vector3 vectors = 1;
repeated int32 triangles = 2;
}