[add] MapData Load and Save

[add] MapContainerObject Load and Save
[fix] MapTool Mode
[add] TestData file
This commit is contained in:
JinhoBa
2025-11-13 21:48:12 +09:00
parent c324e6fe41
commit d7edae9734
16 changed files with 650 additions and 818 deletions
@@ -1,500 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<Land>
<Container Name="3Broom_Ext">
<Container Name="Key">
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
<PartObject Lod_Level="3">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Ext_Awning_Trim</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Ext_Awning_Trim_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Ext_Awning_Trim_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Ext_Awning_Trim_Lod3</PrototypeTag>
<PartObject Lod_Level="2" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ArchSmall</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ArchSmall_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ArchSmall_Lod2</PrototypeTag>
<Position x="0" y="0" z="5"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2" Key_Index="1">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ArchSmall</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ArchSmall_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ArchSmall_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="3">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrels</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrels_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrels_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrels_Lod3</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="1">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrels_sign</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrels_sign_Lod1</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrel_stands</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrel_stands_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrel_stands_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="3">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_chimneys_B</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_chimneys_B_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_chimneys_B_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_chimneys_B_Lod3</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_decals</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_decals_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_decals_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="1">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_Decals_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_Decals_A_Lod1</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Ext_DoorFrameSide</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Ext_DoorFrameSide_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Ext_DoorFrameSide_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_Dormer_Wood_Slats</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_roof</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_roof_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_roof_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_roof_copper_tops</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_roof_copper_tops_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_roof_copper_tops_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="1">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_roof_decals</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_roof_decals_Lod1</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_side_garden_box</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_side_garden_box_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_side_garden_box_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="3">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_trim</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_trim_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_trim_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_trim_Lod3</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="3">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_trim_stone</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_trim_stone_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_trim_stone_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_trim_stone_Lod3</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_walls</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_walls_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_walls_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="1">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_wood_Corbels</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_wood_Corbels_Lod1</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="3">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_fireplace</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_fireplace_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_fireplace_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_fireplace_Lod3</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Door_L</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Door_L_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Door_L_Lod2</PrototypeTag>
<Position x="-1.05" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Door_R</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Door_R_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Door_R_Lod2</PrototypeTag>
<Position x="1.05" y="0" z="0"/>
<Scale x="0.99999952" y="1" z="0.99999952"/>
<Rotation x="-0" y="180" z="-0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_DoorFrame</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_DoorFrame_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_DoorFrame_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="1">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Window_Glass</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Window_Glass_Lod1</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="3">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Roof_Debris_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Roof_Debris_A_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Roof_Debris_A_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Roof_Debris_A_Lod3</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="3">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Roof_Debris_B</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Roof_Debris_B_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Roof_Debris_B_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Roof_Debris_B_Lod3</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
</Container>
<Container Name="3Broom_Int">
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_Bar</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_Bar_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_Bar_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_floors</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_floors_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_floors_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="1">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_stairs_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_stairs_A_Lod1</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_stairs_B</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_stairs_B_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_stairs_B_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="1">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_stairs_D</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_stairs_D_Lod1</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_Stairs_Upper_Floors</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_Stairs_Upper_Floors_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_Stairs_Upper_Floors_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="3">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_walls</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_walls_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_walls_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_walls_Lod3</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="1">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_windows</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_windows_Lod1</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="3">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_A</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_A_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_A_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_A_Lod3</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="3">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_B</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_B_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_B_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_B_Lod3</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="3">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_C</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_C_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_C_Lod2</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_C_Lod3</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_Stairs</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_Stairs_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_Stairs_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2">
<PrototypeTag>Prototype_GameObject_SM_Broom_01</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_Broom_01_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_Broom_01_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
</Container>
<Container Name="3Broom_Ext">
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrel_stands</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrel_stands</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_barrels</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Door_R</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
</Container>
<Container Name="">
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Door_L</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_ext_Decals_A</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
</Container>
<Container Name="HW_GreatHall">
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_FloorMain</PrototypeTag>
<Position x="46.552219" y="0" z="38.898628"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_FloorEnd</PrototypeTag>
<Position x="46.580196" y="-9.5367432e-07" z="66.865234"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_Sconce_Gryffindor</PrototypeTag>
<Position x="46.54007" y="0.49999908" z="68.490913"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_WallIntWindowB</PrototypeTag>
<Position x="8.5603905" y="0" z="9.6546278"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_WallIntWindowB</PrototypeTag>
<Position x="4.9284835" y="-9.5367432e-07" z="9.5142498"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_WallIntWindowC</PrototypeTag>
<Position x="12.268991" y="0" z="9.9082165"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_WallPaneling</PrototypeTag>
<Position x="10.824334" y="0" z="5.5098476"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_WallInt_FlatCeilingB</PrototypeTag>
<Position x="4.8808293" y="5.9000006" z="1.8310394"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_Sconce_Gryffindor</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_Sconce_HufflePuff</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_Sconce_Slytherin</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ShadowCaster</PrototypeTag>
<Position x="46.50058" y="7.8999949" z="23.989874"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_Table</PrototypeTag>
<Position x="47.032993" y="0" z="50.447128"/>
<Scale x="0.99999988" y="1" z="0.99999988"/>
<Rotation x="0" y="89.999985" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_Table</PrototypeTag>
<Position x="39.611012" y="4.7683716e-07" z="50.22493"/>
<Scale x="0.99999988" y="1" z="0.99999988"/>
<Rotation x="0" y="89.999985" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_Table</PrototypeTag>
<Position x="55.278839" y="0" z="49.968864"/>
<Scale x="0.99999988" y="1" z="0.99999988"/>
<Rotation x="0" y="89.999985" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_TableRunnerGryff</PrototypeTag>
<Position x="46.985992" y="9.6857548e-07" z="50.450001"/>
<Scale x="0.99999988" y="1" z="0.99999988"/>
<Rotation x="0" y="89.999985" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_TableRunnerHufflePuff</PrototypeTag>
<Position x="39.449162" y="0" z="50.225445"/>
<Scale x="0.99999988" y="1" z="0.99999988"/>
<Rotation x="0" y="89.999985" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_TableRunnerRaven</PrototypeTag>
<Position x="55.339188" y="0" z="49.954151"/>
<Scale x="0.99999988" y="1" z="0.99999988"/>
<Rotation x="0" y="89.999985" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_WallColumnAB</PrototypeTag>
<Position x="58.90229" y="0" z="33.904556"/>
<Scale x="0.99999988" y="1" z="0.99999988"/>
<Rotation x="0" y="89.999985" z="0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_WallColumnAC</PrototypeTag>
<Position x="59.996658" y="0" z="32.924282"/>
<Scale x="0.99999988" y="1" z="0.99999988"/>
<Rotation x="-0" y="-89.999985" z="-0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_WallColumnC</PrototypeTag>
<Position x="29.750357" y="-4.7683716e-07" z="65.084366"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="-0" y="-70.000008" z="-0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_WallDoor</PrototypeTag>
<Position x="52.069908" y="-4.7683716e-07" z="29.919998"/>
<Scale x="0.99999952" y="1" z="0.99999952"/>
<Rotation x="-0" y="-179.99998" z="-0"/>
</PartObject>
<PartObject Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_WallDoorB</PrototypeTag>
<Position x="44.34584" y="0" z="52.525215"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
</Container>
</Land>
@@ -1,123 +1,56 @@
<?xml version="1.0" encoding="UTF-8"?>
<Land>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Ext_Awning_Trim.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Container Name="Key">
<Position x="33.378426" y="0" z="36.928886"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Ext_DoorFrameSide.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<PartObject Lod_Level="2" Key_Index="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ArchSmall</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ArchSmall_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ArchSmall_Lod2</PrototypeTag>
<Position x="0" y="0" z="5"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
<PartObject Lod_Level="2" Key_Index="1">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ArchSmall</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ArchSmall_Lod1</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ArchSmall_Lod2</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</PartObject>
</Container>
<Object Type="1" Lod_Level="1">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_FloorMain</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HW_GH_FloorMain_Lod1</PrototypeTag>
<Position x="48.988075" y="0" z="58.2355"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_MERGED_Entry_Base_Stones.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
</Object>
<Object Type="1" Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_WallWindow</PrototypeTag>
<Position x="48.56007" y="1.9073486e-06" z="51.822701"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_MERGED_Side_Stone_Steps.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
</Object>
<Object Type="1" Lod_Level="1">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_WallTimbers</PrototypeTag>
<PrototypeTag>Prototype_GameObject_SM_HW_GH_WallTimbers_Lod1</PrototypeTag>
<Position x="45.475964" y="1.9073486e-06" z="47.131371"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_MERGED_Winter_Kit_Icicles.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
</Object>
<Object Type="1" Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_Table</PrototypeTag>
<Position x="39.54475" y="0" z="69.756302"/>
<Scale x="0.99999976" y="1" z="0.99999976"/>
<Rotation x="0" y="89.999962" z="0"/>
</Object>
<Object Type="1" Lod_Level="0">
<PrototypeTag>Prototype_GameObject_SM_HW_GH_ShadowCaster</PrototypeTag>
<Position x="48.098145" y="1.9073486e-06" z="37.810532"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_MERGED_Winter_Kit_Snow.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Roof_Debris_A.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Roof_Debris_A_Decal.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Roof_Debris_B_Decal.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Roof_Snow_Winter.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Window_Glass.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Wood_Steps_B.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_Wood_Steps_C.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_walls.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_A.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_B.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_wood_Stairs.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_windows.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_walls.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
<Model>
<PrototypeTag>Prototype_GameObject_SM_HM_3Broom_int_Stairs_Upper_Floors.mo</PrototypeTag>
<Position x="0" y="0" z="0"/>
<Scale x="1" y="1" z="1"/>
<Rotation x="0" y="0" z="0"/>
</Model>
</Object>
</Land>
@@ -4,6 +4,7 @@
#include "Terrain.h"
#include "Layer.h"
#include "VIBuffer_Terrain.h"
#include "PartObject.h"
CBuildingContainer::CBuildingContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
:CMapContainer(pDevice, pContext)
@@ -139,7 +140,6 @@ void CBuildingContainer::Describe_Entity()
{
pTerrain->Get_Component<CVIBuffer_Terrain>()->Picking(pTerrain->Get_Component<CTransform>(), m_vPosition);
}
}
GUI::Text("----- Rotation ----");
+10
View File
@@ -50,6 +50,8 @@
#include "MapObject_Static.h"
#include "MapObject_LOD.h"
#include "MapObject_Manager.h"
#include "MapElement_Interactable.h"
#include "MapElement_Static.h"
#pragma endregion
@@ -862,6 +864,14 @@ HRESULT CLoader::Loading_For_MapViewer()
if (FAILED(m_pGameInstance->Add_Prototype<CMapObject_LOD>(g_iStaticLevel, CMapObject_LOD::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_MapElement_Interactable */
if (FAILED(m_pGameInstance->Add_Prototype<CMapElement_Interactable>(g_iStaticLevel, CMapElement_Interactable::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_MapElement_Static */
if (FAILED(m_pGameInstance->Add_Prototype<CMapElement_Static>(g_iStaticLevel, CMapElement_Static::Create(m_pDevice, m_pContext))))
return E_FAIL;
/* For.Prototype_GameObject_Terrain */
if (FAILED(m_pGameInstance->Add_Prototype<CTerrain>(g_iStaticLevel, CTerrain::Create(m_pDevice, m_pContext))))
return E_FAIL;
@@ -70,6 +70,7 @@ HRESULT CMapContainer::Save_PartObjects(tinyxml2::XMLDocument& Doc, tinyxml2::XM
// <PartObject>
tinyxml2::XMLElement* PartObject = Doc.NewElement("PartObject");
PartObject->SetAttribute("Lod_Level", pMapObject->Get_LodLevel());
PartObject->SetAttribute("Key_Index", pMapObject->Get_iKeyIndex());
Container->InsertEndChild(PartObject);
for (_uint i = 0; i < pMapObject->Get_LodLevel() + 1; ++i)
@@ -110,7 +111,6 @@ HRESULT CMapContainer::Save_PartObjects(tinyxml2::XMLDocument& Doc, tinyxml2::XM
RotationElem->SetAttribute("y", vRotation.y);
RotationElem->SetAttribute("z", vRotation.z);
PartObject->InsertEndChild(RotationElem);
}
return S_OK;
@@ -13,6 +13,14 @@ CMapElement::CMapElement(const CMapElement& rhs)
{
}
const _wstring& CMapElement::Get_PrototypeTag(_uint iIndex)
{
if (m_iMaxLodLevel < iIndex)
return m_ModelPrototypeTags[0];
return m_ModelPrototypeTags[iIndex];
}
void CMapElement::Priority_Update(_float fTimeDelta)
{
}
@@ -2,6 +2,9 @@
#include "MapElement_Interactable.h"
#include "GameInstance.h"
#include "Terrain.h"
#include "Layer.h"
#include "VIBuffer_Terrain.h"
CMapElement_Interactable::CMapElement_Interactable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CMapElement{ pDevice, pContext }
@@ -20,12 +23,33 @@ HRESULT CMapElement_Interactable::Initialize_Prototype()
HRESULT CMapElement_Interactable::Initialize(void* pArg)
{
MAPOBJECT_LOD_DESC* pDesc = static_cast<MAPOBJECT_LOD_DESC*>(pArg);
m_iMaxLodLevel = pDesc->iMaxLodLevel;
for (_uint i = 0; i < m_iMaxLodLevel + 1; i++)
{
m_ModelPrototypeTags.push_back(pDesc->ModelPrototypeTags[i]);
//m_ModelPathIndices.push_back((*pDesc->pModelPathIndices)[i]);
}
if (FAILED(__super::Initialize(pArg)))
return E_FAIL;
if (FAILED(Ready_Components(pArg)))
return E_FAIL;
#ifdef _DEBUG
m_bSelected = false;
m_vPosition = pDesc->vPosition;
m_vScale = pDesc->vScale;
m_vRotation = pDesc->vRotation;
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f));
m_pTransformCom->Set_Scale(m_vScale);
m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
#endif // _DEBUG
return S_OK;
}
@@ -58,6 +82,9 @@ void CMapElement_Interactable::Late_Update(_float fTimeDelta)
HRESULT CMapElement_Interactable::Render()
{
if (FAILED(Bind_ShaderResources()))
return E_FAIL;
_uint iNumMeshes = m_pModelComs[m_iLodIndex]->Get_NumMeshes();
for (_uint i = 0; i < iNumMeshes; i++)
@@ -96,6 +123,23 @@ HRESULT CMapElement_Interactable::Ready_Components(void* pArg)
return E_FAIL;
}
for (_uint i = 0; i < m_iMaxLodLevel + 1; ++i)
{
CModel* pModel = { nullptr };
/* Com_Model */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_ModelPrototypeTags[i],
reinterpret_cast<CComponent**>(&pModel))))
return E_FAIL;
m_pModelComs.push_back(pModel);
}
/* Com_Shader */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
reinterpret_cast<CComponent**>(&m_pShaderCom))))
return E_FAIL;
return S_OK;
}
@@ -147,6 +191,10 @@ CGameObject* CMapElement_Interactable::Clone(void* pArg, CGameObject* pOwner)
void CMapElement_Interactable::Free()
{
__super::Free();
SAFE_RELEASE(m_pShaderCom);
for (auto& pModel : m_pModelComs)
SAFE_RELEASE(pModel);
}
void CMapElement_Interactable::Describe_Entity()
@@ -165,7 +213,7 @@ void CMapElement_Interactable::Describe_Entity()
GUI::InputFloat("Y##Position", &m_vPosition.y, 0.1f, 1.f);
GUI::InputFloat("Z##Position", &m_vPosition.z, 0.1f, 1.f);
/*if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT))
if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT))
{
CTerrain* pTerrain = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Terrain"))->Get_Object<CTerrain>();
if (nullptr != pTerrain)
@@ -173,7 +221,7 @@ void CMapElement_Interactable::Describe_Entity()
pTerrain->Get_Component<CVIBuffer_Terrain>()->Picking(pTerrain->Get_Component<CTransform>(), m_vPosition);
}
}*/
}
GUI::Text("----- Rotation ----");
GUI::InputFloat("X##Rotation", &m_vRotation.x, 10.f, 45.f);
@@ -3,6 +3,10 @@
#include "GameInstance.h"
#include "Terrain.h"
#include "Layer.h"
#include "VIBuffer_Terrain.h"
CMapElement_Static::CMapElement_Static(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CMapElement{ pDevice, pContext }
{
@@ -20,12 +24,33 @@ HRESULT CMapElement_Static::Initialize_Prototype()
HRESULT CMapElement_Static::Initialize(void* pArg)
{
MAPOBJECT_LOD_DESC* pDesc = static_cast<MAPOBJECT_LOD_DESC*>(pArg);
m_iMaxLodLevel = pDesc->iMaxLodLevel;
for (_uint i = 0; i < m_iMaxLodLevel + 1; i++)
{
m_ModelPrototypeTags.push_back(pDesc->ModelPrototypeTags[i]);
//m_ModelPathIndices.push_back((*pDesc->pModelPathIndices)[i]);
}
if (FAILED(__super::Initialize(pArg)))
return E_FAIL;
if (FAILED(Ready_Components(pArg)))
return E_FAIL;
#ifdef _DEBUG
m_bSelected = false;
m_vPosition = pDesc->vPosition;
m_vScale = pDesc->vScale;
m_vRotation = pDesc->vRotation;
m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&m_vPosition), 1.f));
m_pTransformCom->Set_Scale(m_vScale);
m_pTransformCom->Rotation(XMConvertToRadians(m_vRotation.x), XMConvertToRadians(m_vRotation.y), XMConvertToRadians(m_vRotation.z));
#endif // _DEBUG
return S_OK;
}
@@ -58,6 +83,9 @@ void CMapElement_Static::Late_Update(_float fTimeDelta)
HRESULT CMapElement_Static::Render()
{
if (FAILED(Bind_ShaderResources()))
return E_FAIL;
_uint iNumMeshes = m_pModelComs[m_iLodIndex]->Get_NumMeshes();
for (_uint i = 0; i < iNumMeshes; i++)
@@ -95,6 +123,23 @@ HRESULT CMapElement_Static::Ready_Components(void* pArg)
return E_FAIL;
}
for (_uint i = 0; i < m_iMaxLodLevel + 1; ++i)
{
CModel* pModel = { nullptr };
/* Com_Model */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_ModelPrototypeTags[i],
reinterpret_cast<CComponent**>(&pModel))))
return E_FAIL;
m_pModelComs.push_back(pModel);
}
/* Com_Shader */
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH,
reinterpret_cast<CComponent**>(&m_pShaderCom))))
return E_FAIL;
return S_OK;
}
@@ -146,6 +191,10 @@ CGameObject* CMapElement_Static::Clone(void* pArg, CGameObject* pOwner)
void CMapElement_Static::Free()
{
__super::Free();
SAFE_RELEASE(m_pShaderCom);
for (auto& pModel : m_pModelComs)
SAFE_RELEASE(pModel);
}
void CMapElement_Static::Describe_Entity()
@@ -164,7 +213,7 @@ void CMapElement_Static::Describe_Entity()
GUI::InputFloat("Y##Position", &m_vPosition.y, 0.1f, 1.f);
GUI::InputFloat("Z##Position", &m_vPosition.z, 0.1f, 1.f);
/*if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT))
if (m_pGameInstance->Mouse_Down(DIM_LBUTTON) && m_pGameInstance->Key_Pressing(DIK_LSHIFT))
{
CTerrain* pTerrain = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Terrain"))->Get_Object<CTerrain>();
if (nullptr != pTerrain)
@@ -172,7 +221,7 @@ void CMapElement_Static::Describe_Entity()
pTerrain->Get_Component<CVIBuffer_Terrain>()->Picking(pTerrain->Get_Component<CTransform>(), m_vPosition);
}
}*/
}
GUI::Text("----- Rotation ----");
GUI::InputFloat("X##Rotation", &m_vRotation.x, 10.f, 45.f);
@@ -57,6 +57,11 @@ _wstring CMapObject::Get_PrototypeTag(_uint iLodIndex)
return _wstring();
}
_uint CMapObject::Get_LodLevel()
{
return m_iMaxLodLevel;
}
HRESULT CMapObject::Initialize_Prototype()
{
return S_OK;
@@ -32,7 +32,7 @@ HRESULT CMapObject_LOD::Initialize(void* pArg)
for (_uint i = 0; i < m_iMaxLodLevel + 1; i++)
{
m_ModelPrototypeTags.push_back(pDesc->ModelPrototypeTags[i]);
m_ModelPathIndices.push_back((*pDesc->pModelPathIndices)[i]);
//m_ModelPathIndices.push_back((*pDesc->pModelPathIndices)[i]);
}
if (FAILED(__super::Initialize(pArg)))
@@ -8,6 +8,8 @@
#include "MapObject_LOD.h"
#include "MapObject_Static.h"
#include "BuildingContainer.h"
#include "MapElement_Static.h"
#include "MapElement_Interactable.h"
CMapObject_Manager::CMapObject_Manager(ID3D11Device * pDevice, ID3D11DeviceContext * pContext)
@@ -20,6 +22,7 @@ CMapObject_Manager::CMapObject_Manager(const CMapObject_Manager& rhs)
, m_ModelPrototypeTags{ rhs.m_ModelPrototypeTags }
, m_LODModelPrototypeTags{ rhs.m_LODModelPrototypeTags }
, m_ModelPrototypePaths{ rhs.m_ModelPrototypePaths }
, m_PartObjectKeyCount{ rhs.m_PartObjectKeyCount }
{
}
@@ -32,6 +35,10 @@ HRESULT CMapObject_Manager::Initialize_Prototype(vector<_wstring>& ModelPrototyp
{
m_LODModelPrototypeTags.push_back(ModelPrototypeTags[i]);
}
else
{
m_PartObjectKeyCount.emplace(ModelPrototypeTags[i], 0);
}
m_ModelPrototypeTags.push_back(ModelPrototypeTags[i]);
m_ModelPrototypePaths.push_back(ModelPrototypePaths[i]);
@@ -65,20 +72,34 @@ void CMapObject_Manager::Priority_Update(_float fTimeDelta)
void CMapObject_Manager::Update(_float fTimeDelta)
{
GUI::Begin("File");
const char* ModeNames[3] =
{
"CONTAINER",
"ELEMENT_STATIC",
"ELEMENT_INTERACT"
};
GUI::Combo("MODE", (_int*)(&m_eType), ModeNames, IM_ARRAYSIZE(ModeNames));
GUI::InputText("MapFileName", m_szSaveFileName, MAX_PATH);
if (GUI::Button("Save_Map"))
{
Save_MapData("Test");
Save_MapData(m_szSaveFileName);
}
if (GUI::Button("Load_Map"))
{
Load_MapData("Test");
Load_MapData(m_szSaveFileName);
}
GUI::InputText("Containter Name", m_szSaveContainerName, MAX_PATH);
if (GUI::Button("Save_Container"))
if (ADD_TYPE::CONTAINER == m_eType)
{
Save_ContainerData("ContainerTest", m_szSaveContainerName);
if (GUI::Button("Save_Container"))
{
Save_ContainerData("ContainerTest", m_szSaveContainerName);
}
}
if (GUI::Button("Load_Container"))
{
@@ -90,9 +111,15 @@ void CMapObject_Manager::Update(_float fTimeDelta)
Update_ObjectList();
Update_Edit();
if (ADD_TYPE::CONTAINER != m_eType)
{
Update_Edit();
}
Update_ContainerObject();
if (ADD_TYPE::CONTAINER == m_eType)
{
Update_ContainerObject();
}
for (auto* pObject : m_MapObjects)
{
@@ -148,22 +175,13 @@ HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName)
tinyxml2::XMLError loadResult = doc.LoadFile(strPath.c_str());
tinyxml2::XMLElement* land = {};
tinyxml2::XMLElement* container = {};
doc.Clear();
doc.InsertFirstChild(doc.NewDeclaration());
if (loadResult != tinyxml2::XML_SUCCESS)
{
doc.InsertFirstChild(doc.NewDeclaration());
land = doc.NewElement("Land");
doc.InsertEndChild(land);
}
else
{
land = doc.FirstChildElement("Land");
}
tinyxml2::XMLElement* land = doc.NewElement("Land");
doc.InsertEndChild(land);
#pragma region SAVE_BUILDING
CLayer* pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Building"));
if (nullptr == pLayer)
@@ -171,7 +189,6 @@ HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName)
const list<CGameObject*>* pList = pLayer->Get_Objects();
for (auto pGamObject : *pList)
{
CBuildingContainer* pContainerObject = dynamic_cast<CBuildingContainer*>(pGamObject);
@@ -196,7 +213,6 @@ HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName)
vRotation.y = XMConvertToDegrees(vRotation.y);
vRotation.z = XMConvertToDegrees(vRotation.z);
#pragma region CONTAINER_TRANSFORM
tinyxml2::XMLElement* Position = doc.NewElement("Position");
Position->SetAttribute("x", vPosition.x);
@@ -217,15 +233,147 @@ HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName)
container->InsertEndChild(Rotation);
#pragma endregion
#pragma region SAVE_PARTOBJECT
if (FAILED(pContainerObject->Save_PartObjects(doc, container)))
return E_FAIL;
#pragma endregion
}
#pragma endregion
#pragma region ELEMENT_STATIC
pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Element_Static"));
if (nullptr != pLayer)
{
const list<CGameObject*>* pList = pLayer->Get_Objects();
for (auto pGamObject : *pList)
{
CMapElement* pElement = dynamic_cast<CMapElement*>(pGamObject);
if (nullptr == pElement)
return E_FAIL;
_uint iLodLevel = pElement->Get_LodLevel();
tinyxml2::XMLElement* object = doc.NewElement("Object");
object->SetAttribute("Type", ENUM_CLASS(MAPOBJECT_TYPE::ELEMENT_STATIC));
object->SetAttribute("Lod_Level", iLodLevel);
land->InsertEndChild(object);
#pragma region PROTOTYPETAG
for (_uint i = 0; i < iLodLevel + 1; ++i)
{
tinyxml2::XMLElement* prototype = doc.NewElement("PrototypeTag");
prototype->SetText(CMyTools::ToString(pElement->Get_PrototypeTag(i)).c_str());
object->InsertEndChild(prototype);
}
#pragma endregion
#pragma region TRANSFORM
_float3 vPosition = {};
XMStoreFloat3(&vPosition, pGamObject->Get_Component<CTransform>()->Get_State(STATE::POSITION));
_float3 vScale = pGamObject->Get_Component<CTransform>()->Get_Scale();
_float3 vRotation = {};
XMStoreFloat3(&vRotation, pGamObject->Get_Component<CTransform>()->Get_RollPitchYawVector());
vRotation.x = XMConvertToDegrees(vRotation.x);
vRotation.y = XMConvertToDegrees(vRotation.y);
vRotation.z = XMConvertToDegrees(vRotation.z);
tinyxml2::XMLElement* Position = doc.NewElement("Position");
Position->SetAttribute("x", vPosition.x);
Position->SetAttribute("y", vPosition.y);
Position->SetAttribute("z", vPosition.z);
object->InsertEndChild(Position);
tinyxml2::XMLElement* Scale = doc.NewElement("Scale");
Scale->SetAttribute("x", vScale.x);
Scale->SetAttribute("y", vScale.y);
Scale->SetAttribute("z", vScale.z);
object->InsertEndChild(Scale);
tinyxml2::XMLElement* Rotation = doc.NewElement("Rotation");
Rotation->SetAttribute("x", vRotation.x);
Rotation->SetAttribute("y", vRotation.y);
Rotation->SetAttribute("z", vRotation.z);
object->InsertEndChild(Rotation);
#pragma endregion
}
}
#pragma endregion
#pragma region ELEMENT_INTERACTABEL
pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Element_Interactable"));
if (nullptr != pLayer)
{
const list<CGameObject*>* pList = pLayer->Get_Objects();
for (auto pGamObject : *pList)
{
CMapElement* pElement = dynamic_cast<CMapElement*>(pGamObject);
if (nullptr == pElement)
return E_FAIL;
_uint iLodLevel = pElement->Get_LodLevel();
tinyxml2::XMLElement* object = doc.NewElement("Object");
object->SetAttribute("Type", ENUM_CLASS(MAPOBJECT_TYPE::ELEMENT_INTERACT));
object->SetAttribute("Lod_Level", iLodLevel);
land->InsertEndChild(object);
#pragma region PROTOTYPETAG
for (_uint i = 0; i < iLodLevel + 1; ++i)
{
tinyxml2::XMLElement* prototype = doc.NewElement("PrototypeTag");
prototype->SetText(CMyTools::ToString(pElement->Get_PrototypeTag(i)).c_str());
object->InsertEndChild(prototype);
}
#pragma endregion
#pragma region TRANSFORM
_float3 vPosition = {};
XMStoreFloat3(&vPosition, pGamObject->Get_Component<CTransform>()->Get_State(STATE::POSITION));
_float3 vScale = pGamObject->Get_Component<CTransform>()->Get_Scale();
_float3 vRotation = {};
XMStoreFloat3(&vRotation, pGamObject->Get_Component<CTransform>()->Get_RollPitchYawVector());
vRotation.x = XMConvertToDegrees(vRotation.x);
vRotation.y = XMConvertToDegrees(vRotation.y);
vRotation.z = XMConvertToDegrees(vRotation.z);
tinyxml2::XMLElement* Position = doc.NewElement("Position");
Position->SetAttribute("x", vPosition.x);
Position->SetAttribute("y", vPosition.y);
Position->SetAttribute("z", vPosition.z);
object->InsertEndChild(Position);
tinyxml2::XMLElement* Scale = doc.NewElement("Scale");
Scale->SetAttribute("x", vScale.x);
Scale->SetAttribute("y", vScale.y);
Scale->SetAttribute("z", vScale.z);
object->InsertEndChild(Scale);
tinyxml2::XMLElement* Rotation = doc.NewElement("Rotation");
Rotation->SetAttribute("x", vRotation.x);
Rotation->SetAttribute("y", vRotation.y);
Rotation->SetAttribute("z", vRotation.z);
object->InsertEndChild(Rotation);
#pragma endregion
}
}
#pragma endregion
// ÀúÀå
if (doc.SaveFile(strPath.c_str()) != tinyxml2::XML_SUCCESS) {
MSG_BOX("Failed to Save File");
@@ -235,11 +383,6 @@ HRESULT CMapObject_Manager::Save_MapData(const _char* pFileName)
MSG_BOX("Succeed to Save File");
}
return S_OK;
return S_OK;
}
@@ -300,7 +443,10 @@ HRESULT CMapObject_Manager::Save_ContainerData(const _char* pFileName, const _ch
{
// <PartObject>
tinyxml2::XMLElement* PartObject = doc.NewElement("PartObject");
PartObject->SetAttribute("Lod_Level", pMapObject->Get_LodLevel());
_uint iLodLvel = pMapObject->Get_LodLevel();
PartObject->SetAttribute("Lod_Level", iLodLvel);
PartObject->SetAttribute("Key_Index", pMapObject->Get_iKeyIndex());
container->InsertEndChild(PartObject);
for (_uint i = 0; i < pMapObject->Get_LodLevel() + 1; ++i)
@@ -417,86 +563,96 @@ HRESULT CMapObject_Manager::Load_MapData(const _char* pFileName)
for (auto* PartObject = Container->FirstChildElement("PartObject"); PartObject; PartObject = PartObject->NextSiblingElement("PartObject"))
{
_uint iLodLevel = {};
_uint iKeyIndex = {};
PartObject->QueryUnsignedAttribute("Lod_Level", &iLodLevel);
#pragma region MAPOBJECT_STATIC
if (0 == iLodLevel) /* MapObject_Static */
{
MAPOBJECT_STATIC_DESC Desc = {};
string strTag = {};
auto* PrototypeTag = PartObject->FirstChildElement("PrototypeTag");
strTag = PrototypeTag->GetText();
Desc.strModelPrototypeTag = CMyTools::ToWstring(strTag);
Desc.pParentTransform = pContainerObject->Get_Component<CTransform>();
const string strKey = strTag;
/* Position */
tinyxml2::XMLElement* Position = PartObject->FirstChildElement("Position");
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
/* Scale */
tinyxml2::XMLElement* Scale = PartObject->FirstChildElement("Scale");
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
/* Rotation */
tinyxml2::XMLElement* Rotation = PartObject->FirstChildElement("Rotation");
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
pContainerObject->Add_Part<CMapObject_Static>(strKey, g_iStaticLevel, nullptr, &Desc);
}
#pragma endregion
PartObject->QueryUnsignedAttribute("Key_Index", &iKeyIndex);
#pragma region MAPOBJECT_LOD
else
MAPOBJECT_LOD_DESC Desc = {};
string strTag = {};
for (auto* PrototypeTag = PartObject->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
{
MAPOBJECT_LOD_DESC Desc = {};
string strTag = {};
for (auto* PrototypeTag = PartObject->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
{
strTag = PrototypeTag->GetText();
strTag = PrototypeTag->GetText();
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(strTag));
}
Desc.pParentTransform = pContainerObject->Get_Component<CTransform>();
const string strKey = strTag;
/* Position */
tinyxml2::XMLElement* Position = PartObject->FirstChildElement("Position");
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
/* Scale */
tinyxml2::XMLElement* Scale = PartObject->FirstChildElement("Scale");
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
/* Rotation */
tinyxml2::XMLElement* Rotation = PartObject->FirstChildElement("Rotation");
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
pContainerObject->Add_Part<CMapObject_LOD>(strKey, g_iStaticLevel, nullptr, &Desc);
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(strTag));
}
Desc.iMaxLodLevel = iLodLevel;
Desc.pParentTransform = pContainerObject->Get_Component<CTransform>();
const string strKey = CMyTools::ToString(Desc.ModelPrototypeTags.front()) + to_string(iKeyIndex);
/* Position */
tinyxml2::XMLElement* Position = PartObject->FirstChildElement("Position");
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
/* Scale */
tinyxml2::XMLElement* Scale = PartObject->FirstChildElement("Scale");
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
/* Rotation */
tinyxml2::XMLElement* Rotation = PartObject->FirstChildElement("Rotation");
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
CMapObject_LOD* pMapObject;
if (FAILED(pContainerObject->Add_Part<CMapObject_LOD>(strKey, g_iStaticLevel, &pMapObject, &Desc)))
return E_FAIL;
pMapObject->Set_KeyIndex(iKeyIndex);
SAFE_RELEASE(pMapObject);
#pragma endregion
}
#pragma endregion
}
for (auto* Object = root->FirstChildElement("Object"); Object; Object = Object->NextSiblingElement("Object"))
{
MAPOBJECT_LOD_DESC Desc = {};
MAPOBJECT_TYPE eType = {};
Object->QueryUnsignedAttribute("Type", (_uint*)(&eType));
Object->QueryUnsignedAttribute("Lod_Level", &Desc.iMaxLodLevel);
auto* Position = Object->FirstChildElement("Position");
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
auto* Scale = Object->FirstChildElement("Scale");
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
auto* Rotation = Object->FirstChildElement("Rotation");
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
string strTag = {};
for (auto* PrototypeTag = Object->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
{
strTag = PrototypeTag->GetText();
Desc.ModelPrototypeTags.push_back(CMyTools::ToWstring(strTag));
}
if(MAPOBJECT_TYPE::ELEMENT_STATIC == eType)
m_pGameInstance->Add_GameObject_ToLayer<CMapElement_Static>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Static"), &Desc);
else if(MAPOBJECT_TYPE::ELEMENT_INTERACT == eType)
m_pGameInstance->Add_GameObject_ToLayer<CMapElement_Interactable>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Interact"), &Desc);
}
return S_OK;
}
@@ -568,48 +724,12 @@ HRESULT CMapObject_Manager::Load_ContainerData(const _char* pFileName, const _ch
for (auto* PartObject = TargetContainer->FirstChildElement("PartObject"); PartObject; PartObject = PartObject->NextSiblingElement("PartObject"))
{
_uint iLodLevel = {};
_uint iKeyIndex = {};
PartObject->QueryUnsignedAttribute("Lod_Level", &iLodLevel);
#pragma region MAPOBJECT_STATIC
if (0 == iLodLevel) /* MapObject_Static */
{
MAPOBJECT_STATIC_DESC Desc = {};
string strTag = {};
auto* PrototypeTag = PartObject->FirstChildElement("PrototypeTag");
strTag = PrototypeTag->GetText();
Desc.strModelPrototypeTag = CMyTools::ToWstring(strTag);
Desc.iMaxLodLevel = iLodLevel;
Desc.pParentTransform = pContainerObject->Get_Component<CTransform>();
const string strKey = strTag;
/* Position */
tinyxml2::XMLElement* Position = PartObject->FirstChildElement("Position");
Position->QueryFloatAttribute("x", &Desc.vPosition.x);
Position->QueryFloatAttribute("y", &Desc.vPosition.y);
Position->QueryFloatAttribute("z", &Desc.vPosition.z);
/* Scale */
tinyxml2::XMLElement* Scale = PartObject->FirstChildElement("Scale");
Scale->QueryFloatAttribute("x", &Desc.vScale.x);
Scale->QueryFloatAttribute("y", &Desc.vScale.y);
Scale->QueryFloatAttribute("z", &Desc.vScale.z);
/* Rotation */
tinyxml2::XMLElement* Rotation = PartObject->FirstChildElement("Rotation");
Rotation->QueryFloatAttribute("x", &Desc.vRotation.x);
Rotation->QueryFloatAttribute("y", &Desc.vRotation.y);
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
pContainerObject->Add_Part<CMapObject_Static>(strKey, g_iStaticLevel, nullptr, &Desc);
}
#pragma endregion
PartObject->QueryUnsignedAttribute("Key_Index", &iKeyIndex);
#pragma region MAPOBJECT_LOD
else
{
MAPOBJECT_LOD_DESC Desc = {};
string strTag = {};
for (auto* PrototypeTag = PartObject->FirstChildElement("PrototypeTag"); PrototypeTag; PrototypeTag = PrototypeTag->NextSiblingElement("PrototypeTag"))
@@ -620,7 +740,7 @@ HRESULT CMapObject_Manager::Load_ContainerData(const _char* pFileName, const _ch
}
Desc.iMaxLodLevel = iLodLevel;
Desc.pParentTransform = pContainerObject->Get_Component<CTransform>();
const string strKey = strTag;
const string strKey = CMyTools::ToString(Desc.ModelPrototypeTags.front()) + to_string(iKeyIndex);
/* Position */
tinyxml2::XMLElement* Position = PartObject->FirstChildElement("Position");
@@ -641,7 +761,6 @@ HRESULT CMapObject_Manager::Load_ContainerData(const _char* pFileName, const _ch
Rotation->QueryFloatAttribute("z", &Desc.vRotation.z);
pContainerObject->Add_Part<CMapObject_LOD>(strKey, g_iStaticLevel, nullptr, &Desc);
}
#pragma endregion
}
@@ -661,69 +780,29 @@ void CMapObject_Manager::Update_PrototypeList()
{
auto& Tag = m_ModelPrototypeTags[i];
if (_wstring::npos != Tag.find(L"Lod")){
if (_wstring::npos != Tag.find(L"Lod")) {
continue;
}
if (ImGui::Button(CMyTools::ToString(Tag).c_str()))
{
vector<_uint> LodModelIndices;
if(false == Find_Lod_Prototype(Tag, LodModelIndices))
switch (m_eType)
{
MAPOBJECT_STATIC_DESC Desc = {};
case Editor::CMapObject_Manager::ADD_TYPE::CONTAINER:
Create_PartObject(Tag);
break;
Desc.strModelPrototypeTag = Tag;
Desc.pParentTransform = m_pTransformCom;
Desc.vPosition = _float3(0.f, 0.f, 0.f);
Desc.vRotation = _float3(0.f, 0.f, 0.f);
Desc.vScale = _float3(1.f, 1.f, 1.f);
Desc.iModelPathIndex = i;
case Editor::CMapObject_Manager::ADD_TYPE::ELEMENT_STATIC:
Create_Elemnt_Static(Tag);
break;
CMapObject_Static* pMapObject = { nullptr };
const string strKey = CMyTools::ToString(Tag);
pMapObject = m_pGameInstance->Clone_Prototype<CMapObject_Static>(g_iStaticLevel, &Desc);
/* if(FAILED(m_pContainer->Add_Part<CMapObject_Static>(strKey, 0, &pMapObject, &Desc)))
break;*/
m_MapObjects.push_back(pMapObject);
}
else
{
MAPOBJECT_LOD_DESC Desc = {};
vector<_wstring> PrototypeTags;
PrototypeTags.push_back(Tag);
Desc.iMaxLodLevel = 0;
Desc.ModelPrototypeTags = PrototypeTags;
Desc.pParentTransform = m_pTransformCom;
Desc.vPosition = _float3(0.f, 0.f, 0.f);
Desc.vRotation = _float3(0.f, 0.f, 0.f);
Desc.vScale = _float3(1.f, 1.f, 1.f);
Desc.pModelPathIndices = &LodModelIndices;
CMapObject_LOD* pMapObject = { nullptr };
const string strKey = CMyTools::ToString(Tag);
pMapObject = m_pGameInstance->Clone_Prototype<CMapObject_LOD>(g_iStaticLevel, &Desc);
//if (FAILED(m_pContainer->Add_Part<CMapObject_LOD>(strKey, 0, &pMapObject, &Desc)))
// break;
m_MapObjects.push_back(pMapObject);
for (_uint i = 0; i < LodModelIndices.size(); ++i)
{
_wstring strLodTag = Tag + L"_Lod" + to_wstring(i + 1);
pMapObject->Add_LodModel(strLodTag.c_str());
}
case Editor::CMapObject_Manager::ADD_TYPE::ELEMENT_INTERACT:
Create_Elemnt_Interact(Tag);
break;
default:
break;
}
}
}
GUI::End();
@@ -732,10 +811,7 @@ void CMapObject_Manager::Update_PrototypeList()
void CMapObject_Manager::Update_ObjectList()
{
//CLayer* pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_MapObject"));
//if (nullptr == pLayer)
// return;
CLayer* pLayer = { nullptr };
//m_pMapObjects = pLayer->Get_Objects();
@@ -744,41 +820,93 @@ void CMapObject_Manager::Update_ObjectList()
_uint iObjectIndex = {};
string strSrc;
if (false == m_MapObjects.empty())
if(ADD_TYPE::CONTAINER == m_eType)
{
for (auto pMapObject : m_MapObjects)
if (false == m_MapObjects.empty())
{
CMapObject* pCurrentMapObject = static_cast<CMapObject*>(pMapObject);
for (auto pMapObject : m_MapObjects)
{
CMapObject* pCurrentMapObject = static_cast<CMapObject*>(pMapObject);
if (nullptr == pCurrentMapObject)
continue;
wstring strPrototypeTag = pCurrentMapObject->Get_PrototypeTag();
strSrc = CMyTools::ToString(strPrototypeTag) + to_string(iObjectIndex) + "##" + to_string(iObjectIndex++);
if (ImGui::Button(strSrc.c_str()))
{
m_pSelectObject = pCurrentMapObject;
}
}
}
}
else
{
if (ADD_TYPE::ELEMENT_STATIC == m_eType)
pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Element_Static"));
else if (ADD_TYPE::ELEMENT_INTERACT == m_eType)
pLayer = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::MAP), TEXT("Layer_Element_Interact"));
if (nullptr == pLayer)
{
GUI::End();
return;
}
const list<class CGameObject*>* pObjectList = pLayer->Get_Objects();
for (auto pObject : *pObjectList)
{
CMapElement* pCurrentMapObject = static_cast<CMapElement*>(pObject);
if (nullptr == pCurrentMapObject)
continue;
wstring strPrototypeTag = pCurrentMapObject->Get_PrototypeTag();
wstring strPrototypeTag = pCurrentMapObject->Get_PrototypeTag(0);
strSrc = CMyTools::ToString(strPrototypeTag) + to_string(iObjectIndex) + "##" + to_string(iObjectIndex++);
if (ImGui::Button(strSrc.c_str()))
{
m_pSelectObject = pCurrentMapObject;
m_pSelectElemnt = pCurrentMapObject;
}
}
}
GUI::End();
}
void CMapObject_Manager::Update_Edit()
{
GUI::Begin("Edit");
if (m_pGameInstance->Mouse_Down(DIM_4))
m_pSelectObject = nullptr;
if (nullptr != m_pSelectObject)
if (ADD_TYPE::CONTAINER == m_eType)
{
m_pSelectObject->Describe_Entity();
if (m_pSelectObject->isDead())
if (m_pGameInstance->Mouse_Down(DIM_4))
m_pSelectObject = nullptr;
if (nullptr != m_pSelectObject)
{
m_pSelectObject->Describe_Entity();
if (m_pSelectObject->isDead())
m_pSelectObject = nullptr;
}
}
else
{
if (m_pGameInstance->Mouse_Down(DIM_4))
m_pSelectElemnt = nullptr;
if (nullptr != m_pSelectElemnt)
{
m_pSelectElemnt->Describe_Entity();
if (m_pSelectElemnt->isDead())
m_pSelectElemnt = nullptr;
}
}
GUI::End();
@@ -823,12 +951,111 @@ void CMapObject_Manager::Update_ContainerObject()
GUI::End();
}
void CMapObject_Manager::Create_PartObject(_wstring& strPrototypeTag)
{
vector<_uint> LodModelIndices;
MAPOBJECT_LOD_DESC Desc = {};
vector<_wstring> PrototypeTags;
Find_Lod_Prototype(strPrototypeTag, LodModelIndices);
PrototypeTags.push_back(strPrototypeTag);
for (_uint i = 0; i < LodModelIndices.size(); ++i)
{
_wstring strLodTag = strPrototypeTag + L"_Lod" + to_wstring(i + 1);
PrototypeTags.push_back(strLodTag);
}
Desc.iMaxLodLevel = (_uint)LodModelIndices.size() - 1;
Desc.ModelPrototypeTags = PrototypeTags;
Desc.pParentTransform = m_pTransformCom;
Desc.vPosition = _float3(0.f, 0.f, 0.f);
Desc.vRotation = _float3(0.f, 0.f, 0.f);
Desc.vScale = _float3(1.f, 1.f, 1.f);
Desc.pModelPathIndices = &LodModelIndices;
CMapObject_LOD* pMapObject = { nullptr };
const string strKey = CMyTools::ToString(strPrototypeTag);
pMapObject = m_pGameInstance->Clone_Prototype<CMapObject_LOD>(g_iStaticLevel, &Desc);
pMapObject->Set_KeyIndex(Get_KeyCount(strPrototypeTag));
m_MapObjects.push_back(pMapObject);
}
void CMapObject_Manager::Create_Elemnt_Static(_wstring& strPrototypeTag)
{
vector<_uint> LodModelIndices;
MAPOBJECT_LOD_DESC Desc = {};
vector<_wstring> PrototypeTags;
Find_Lod_Prototype(strPrototypeTag, LodModelIndices);
PrototypeTags.push_back(strPrototypeTag);
for (_uint i = 0; i < LodModelIndices.size(); ++i)
{
_wstring strLodTag = strPrototypeTag + L"_Lod" + to_wstring(i + 1);
PrototypeTags.push_back(strLodTag);
}
Desc.iMaxLodLevel = (_uint)LodModelIndices.size() - 1;
Desc.ModelPrototypeTags = PrototypeTags;
Desc.pParentTransform = m_pTransformCom;
Desc.vPosition = _float3(0.f, 0.f, 0.f);
Desc.vRotation = _float3(0.f, 0.f, 0.f);
Desc.vScale = _float3(1.f, 1.f, 1.f);
Desc.pModelPathIndices = &LodModelIndices;
CMapElement_Static* pMapObject = { nullptr };
const string strKey = CMyTools::ToString(strPrototypeTag);
m_pGameInstance->Add_GameObject_ToLayer<CMapElement_Static>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Static"), &Desc);
}
void CMapObject_Manager::Create_Elemnt_Interact(_wstring& strPrototypeTag)
{
vector<_uint> LodModelIndices;
MAPOBJECT_LOD_DESC Desc = {};
vector<_wstring> PrototypeTags;
Find_Lod_Prototype(strPrototypeTag, LodModelIndices);
PrototypeTags.push_back(strPrototypeTag);
for (_uint i = 0; i < LodModelIndices.size(); ++i)
{
_wstring strLodTag = strPrototypeTag + L"_Lod" + to_wstring(i + 1);
PrototypeTags.push_back(strLodTag);
}
Desc.iMaxLodLevel = (_uint)LodModelIndices.size() - 1;
Desc.ModelPrototypeTags = PrototypeTags;
Desc.pParentTransform = m_pTransformCom;
Desc.vPosition = _float3(0.f, 0.f, 0.f);
Desc.vRotation = _float3(0.f, 0.f, 0.f);
Desc.vScale = _float3(1.f, 1.f, 1.f);
Desc.pModelPathIndices = &LodModelIndices;
CMapElement_Interactable* pMapObject = { nullptr };
const string strKey = CMyTools::ToString(strPrototypeTag);
m_pGameInstance->Add_GameObject_ToLayer<CMapElement_Interactable>(g_iStaticLevel, NEXT_LEVEL, TEXT("Layer_Element_Interact"), &Desc);
}
_bool CMapObject_Manager::Find_Lod_Prototype(_wstring strPrototypeTag, vector<_uint>& LodModelIndices)
{
// for (auto& Tag : m_LODModelPrototypeTags)
for(_uint i = 0 ; i < m_ModelPrototypeTags.size(); ++i)
{
if (_wstring::npos != m_ModelPrototypeTags[i].find(strPrototypeTag))
if (_wstring::npos != m_ModelPrototypeTags[i].find(strPrototypeTag) && 5 > (m_ModelPrototypeTags[i].size() - strPrototypeTag.size()))
LodModelIndices.push_back(i);
}
if (0 < LodModelIndices.size()) {
@@ -839,6 +1066,16 @@ _bool CMapObject_Manager::Find_Lod_Prototype(_wstring strPrototypeTag, vector<_u
// return true;
}
_uint CMapObject_Manager::Get_KeyCount(_wstring strPrototypeTag)
{
auto iter = m_PartObjectKeyCount.find(strPrototypeTag);
if (iter == m_PartObjectKeyCount.end())
return 0;
return iter->second++;
}
CMapObject_Manager* CMapObject_Manager::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, vector<_wstring>& ModelPrototypeTags, vector<filesystem::path>& ModelPrototypePaths)
{
@@ -7,8 +7,6 @@ NS_BEGIN(Editor)
class CBuildingContainer final : public CMapContainer
{
public:
CBuildingContainer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CBuildingContainer(const CBuildingContainer& rhs);
@@ -17,6 +17,10 @@ class CMapElement abstract : public CGameObject
CMapElement(const CMapElement& rhs);
virtual ~CMapElement() = default;
public:
_uint Get_LodLevel() const{ return m_iMaxLodLevel; }
const _wstring& Get_PrototypeTag(_uint iIndex);
public:
virtual void Priority_Update(_float fTimeDelta) override;
virtual void Update(_float fTimeDelta) override;
+3 -1
View File
@@ -25,7 +25,8 @@ class CMapObject abstract : public CPartObject
public:
virtual _wstring Get_PrototypeTag(_uint iLodIndex = 0);
virtual _uint Get_LodLevel() { return m_iMaxLodLevel; }
_uint Get_LodLevel();
_uint Get_iKeyIndex() const { return m_iKeyIndex; }
protected:
@@ -39,6 +40,7 @@ class CMapObject abstract : public CPartObject
protected:
_bool m_bSelected = {};
_uint m_iKeyIndex = {};
_uint m_iMaxLodLevel = {};
_float3 m_vPosition = {};
@@ -23,12 +23,14 @@ class CMapObject_LOD final : public CMapObject // LOD
public:
virtual _wstring Get_PrototypeTag(_uint iLodIndex = 0);
HRESULT Add_LodModel(const _tchar* pModelPrototypeTag);
void Set_KeyIndex(_uint iIndex) {
m_iKeyIndex = iIndex;
}
private:
CShader* m_pShaderCom = { nullptr };
vector<CModel*> m_pModelComs;
_uint m_iMaxLodLevel = {};
_uint m_iLodIndex = {};
vector<_wstring> m_ModelPrototypeTags;
@@ -12,6 +12,8 @@ NS_BEGIN(Editor)
class CMapObject_Manager final : public CGameObject
{
enum class ADD_TYPE {CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT};
private:
CMapObject_Manager(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CMapObject_Manager(const CMapObject_Manager& Prototype);
@@ -28,15 +30,20 @@ class CMapObject_Manager final : public CGameObject
const filesystem::path Get_PrototypePath(_uint iModelIndex);
private:
ADD_TYPE m_eType = {};
class CMapObject* m_pSelectObject = { nullptr };
class CMapElement* m_pSelectElemnt = { nullptr };
list<class CMapObject*> m_MapObjects = {};
vector<_wstring> m_ModelPrototypeTags;
map<_wstring, _uint> m_PartObjectKeyCount;
vector<_wstring> m_LODModelPrototypeTags;
vector<filesystem::path> m_ModelPrototypePaths;
_uint m_iContainerObjectIndex = {};
class CBuildingContainer* m_pContainer = { nullptr };
_char m_szSaveFileName[MAX_PATH] = {};
_char m_szSaveContainerName[MAX_PATH] = {};
private:
HRESULT Ready_Components();
@@ -44,8 +51,9 @@ class CMapObject_Manager final : public CGameObject
#pragma region SAVE_LOAD
HRESULT Save_MapData(const _char* pFileName);
HRESULT Save_ContainerData(const _char* pFileName, const _char* pContainerName);
HRESULT Load_MapData(const _char* pFileName);
HRESULT Save_ContainerData(const _char* pFileName, const _char* pContainerName);
HRESULT Load_ContainerData(const _char* pFileName, const _char* pContainerName);
#pragma endregion
@@ -54,8 +62,12 @@ class CMapObject_Manager final : public CGameObject
void Update_Edit();
void Update_ContainerObject();
_bool Find_Lod_Prototype(_wstring strPrototypeTag, vector<_uint>& LodModelIndices);
void Create_PartObject(_wstring& strPrototypeTag);
void Create_Elemnt_Static(_wstring& strPrototypeTag);
void Create_Elemnt_Interact(_wstring& strPrototypeTag);
_bool Find_Lod_Prototype(_wstring strPrototypeTag, vector<_uint>& LodModelIndices);
_uint Get_KeyCount(_wstring strPrototypeTag);
public:
static CMapObject_Manager* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, vector<_wstring>& ModelPrototypeTags, vector<filesystem::path>& ModelPrototypePaths);
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;