diff --git a/hecl/blender/hecl/mapa.py b/hecl/blender/hecl/mapa.py index e7fa0afd1..0929f6e54 100644 --- a/hecl/blender/hecl/mapa.py +++ b/hecl/blender/hecl/mapa.py @@ -8,6 +8,8 @@ def cook(writebuf, mesh_obj): if mesh_obj.type != 'MESH': raise RuntimeError("%s is not a mesh" % mesh_obj.name) + obj_vismodes = dict((i[0], i[3]) for i in bpy.types.Object.retro_mapobj_vis_mode[1]['items']) + # Write out visibility type vis_types = dict((i[0], i[3]) for i in bpy.types.Scene.retro_map_vis_mode[1]['items']) writebuf(struct.pack('I', vis_types[bpy.context.scene.retro_map_vis_mode])) @@ -169,7 +171,7 @@ def cook(writebuf, mesh_obj): for obj in bpy.context.scene.objects: if obj.retro_mappable_type != -1: writebuf(struct.pack('III', - obj.retro_mappable_type, obj.retro_mappable_unk, int(obj.retro_mappable_sclyid, 0))) + obj.retro_mappable_type, obj_vismodes[obj.retro_mapobj_vis_mode], int(obj.retro_mappable_sclyid, 0))) writebuf(struct.pack('ffffffffffffffff', obj.matrix_world[0][0], obj.matrix_world[0][1], obj.matrix_world[0][2], obj.matrix_world[0][3], obj.matrix_world[1][0], obj.matrix_world[1][1], obj.matrix_world[1][2], obj.matrix_world[1][3], @@ -180,16 +182,21 @@ def draw(layout, context): obj = context.active_object layout.prop(context.scene, 'retro_map_vis_mode', text='Visibility Mode') if obj and obj.retro_mappable_type != -1: - layout.prop(obj, 'retro_mappable_type', text='Type') - layout.prop(obj, 'retro_mappable_unk', text='Unk') + layout.prop(obj, 'retro_mappable_type', text='Object Type') + layout.prop(obj, 'retro_mapobj_vis_mode', text='Object Visibility Mode') layout.prop(obj, 'retro_mappable_sclyid', text='Object ID') def register(): bpy.types.Object.retro_mappable_type = bpy.props.IntProperty(name='Retro: MAPA object type', default=-1) - bpy.types.Object.retro_mappable_unk = bpy.props.IntProperty(name='Retro: MAPA object unk') bpy.types.Object.retro_mappable_sclyid = bpy.props.StringProperty(name='Retro: MAPA object SCLY ID') bpy.types.Scene.retro_map_vis_mode = bpy.props.EnumProperty(items=[('ALWAYS', 'Always', 'Always Visible', 0), ('MAPSTATIONORVISIT', 'Map Station or Visit', 'Visible after Map Station or Visit', 1), ('VISIT', 'Visit', 'Visible after Visit', 2), ('NEVER', 'Never', 'Never Visible', 3)], name='Retro: Map Visibility Mode') + bpy.types.Object.retro_mapobj_vis_mode = bpy.props.EnumProperty(items=[('ALWAYS', 'Always', 'Always Visible', 0), + ('MAPSTATIONORVISIT', 'Map Station or Visit', 'Visible after Map Station or Visit', 1), + ('VISIT', 'Visit', 'Visible after Door Visit', 2), + ('NEVER', 'Never', 'Never Visible', 3), + ('MAPSTATIONORVISIT2', 'Map Station or Visit 2', 'Visible after Map Station or Visit', 4)], + name='Retro: Map Object Visibility Mode') diff --git a/hecl/include/hecl/Blender/BlenderConnection.hpp b/hecl/include/hecl/Blender/BlenderConnection.hpp index 8a9407a0e..6aea3911d 100644 --- a/hecl/include/hecl/Blender/BlenderConnection.hpp +++ b/hecl/include/hecl/Blender/BlenderConnection.hpp @@ -734,7 +734,7 @@ public: struct POI { uint32_t type; - uint32_t unk; + uint32_t visMode; uint32_t objid; Matrix4f xf; POI(BlenderConnection& conn); diff --git a/hecl/include/hecl/UniformBufferPool.hpp b/hecl/include/hecl/UniformBufferPool.hpp index 634dacd6e..e7158b79d 100644 --- a/hecl/include/hecl/UniformBufferPool.hpp +++ b/hecl/include/hecl/UniformBufferPool.hpp @@ -21,12 +21,14 @@ namespace hecl template class UniformBufferPool { +public: /* Resolve div_t type using ssize_t as basis */ #if _WIN32 using IndexTp = SSIZE_T; #else using IndexTp = ssize_t; #endif +private: struct InvalidTp {}; using DivTp = std::conditional_t::value, std::lldiv_t, std::conditional_t::value, std::ldiv_t, diff --git a/hecl/include/hecl/VertexBufferPool.hpp b/hecl/include/hecl/VertexBufferPool.hpp index 556586c1b..5b1bd1f10 100644 --- a/hecl/include/hecl/VertexBufferPool.hpp +++ b/hecl/include/hecl/VertexBufferPool.hpp @@ -21,12 +21,14 @@ namespace hecl template class VertexBufferPool { +public: /* Resolve div_t type using ssize_t as basis */ #if _WIN32 using IndexTp = SSIZE_T; #else using IndexTp = ssize_t; #endif +private: struct InvalidTp {}; using DivTp = std::conditional_t::value, std::lldiv_t, std::conditional_t::value, std::ldiv_t,