@@ -48,44 +48,36 @@ namespace dmRive
48
48
{
49
49
rive::Artboard* artboard = scene_data->m_File ->artboard (i);
50
50
51
- scene_data->m_ArtboardIdLists [i].m_ArtboardNameHash = dmHashString64 (artboard->name ().c_str ());
51
+ RiveArtboardIdList* id_list = new RiveArtboardIdList ();
52
+ scene_data->m_ArtboardIdLists [i] = id_list;
52
53
53
- #if 0
54
- dmLogInfo("Artboard[%d]: %s", i, artboard->name().c_str());
55
- #endif
54
+ id_list->m_ArtboardNameHash = dmHashString64 (artboard->name ().c_str ());
56
55
57
56
// Setup state machine ID lists
58
57
uint32_t state_machine_count = (uint32_t )artboard->stateMachineCount ();
59
58
if (state_machine_count)
60
59
{
61
- scene_data-> m_ArtboardIdLists [i]. m_StateMachines .SetCapacity (state_machine_count);
62
- scene_data-> m_ArtboardIdLists [i]. m_StateMachines .SetSize (state_machine_count);
60
+ id_list-> m_StateMachines .SetCapacity (state_machine_count);
61
+ id_list-> m_StateMachines .SetSize (state_machine_count);
63
62
64
63
for (int j = 0 ; j < state_machine_count; ++j)
65
64
{
66
65
rive::StateMachine* state_machine = artboard->stateMachine (j);
67
- scene_data->m_ArtboardIdLists [i].m_StateMachines [j] = dmHashString64 (state_machine->name ().c_str ());
68
- #if 0
69
- dmLogInfo(" State machine[%d]: %s", j, state_machine->name().c_str());
70
- #endif
66
+ id_list->m_StateMachines [j] = dmHashString64 (state_machine->name ().c_str ());
71
67
}
72
68
}
73
69
74
70
// Setup animation ID lists
75
71
uint32_t animation_count = (uint32_t )artboard->animationCount ();
76
72
if (animation_count)
77
73
{
78
- scene_data-> m_ArtboardIdLists [i]. m_LinearAnimations .SetCapacity (animation_count);
79
- scene_data-> m_ArtboardIdLists [i]. m_LinearAnimations .SetSize (animation_count);
74
+ id_list-> m_LinearAnimations .SetCapacity (animation_count);
75
+ id_list-> m_LinearAnimations .SetSize (animation_count);
80
76
81
77
for (int j = 0 ; j < animation_count; ++j)
82
78
{
83
79
rive::LinearAnimation* animation = artboard->animation (j);
84
- scene_data->m_ArtboardIdLists [i].m_LinearAnimations [j] = dmHashString64 (animation->name ().c_str ());
85
-
86
- #if 0
87
- dmLogInfo(" Animation[%d]: %s", j, animation->name().c_str());
88
- #endif
80
+ id_list->m_LinearAnimations [j] = dmHashString64 (animation->name ().c_str ());
89
81
}
90
82
}
91
83
}
@@ -127,6 +119,10 @@ namespace dmRive
127
119
128
120
static void DeleteData (RiveSceneData* scene_data)
129
121
{
122
+ for (int i = 0 ; i < scene_data->m_ArtboardIdLists .Size (); ++i)
123
+ {
124
+ delete scene_data->m_ArtboardIdLists [i];
125
+ }
130
126
delete scene_data->m_File ;
131
127
delete scene_data;
132
128
}
0 commit comments