mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-09 20:24:16 +00:00
dCinema improvements
* Visiblity and effect records * Recorder will catch effects from behaviors * Documentation for setting up a scene to play automatically. * Documentation for server-side preconditions.
This commit is contained in:
@@ -15,11 +15,21 @@
|
||||
|
||||
std::unordered_map<int32_t, float> RenderComponent::m_DurationCache{};
|
||||
|
||||
std::unordered_map<int32_t, std::vector<int32_t>> RenderComponent::m_AnimationGroupCache{};
|
||||
|
||||
RenderComponent::RenderComponent(Entity* parent, int32_t componentId): Component(parent) {
|
||||
m_Effects = std::vector<Effect*>();
|
||||
m_LastAnimationName = "";
|
||||
if (componentId == -1) return;
|
||||
|
||||
const auto& it = m_AnimationGroupCache.find(componentId);
|
||||
|
||||
if (it != m_AnimationGroupCache.end()) {
|
||||
m_animationGroupIds = it->second;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
auto query = CDClientDatabase::CreatePreppedStmt("SELECT * FROM RenderComponent WHERE id = ?;");
|
||||
query.bind(1, componentId);
|
||||
auto result = query.execQuery();
|
||||
@@ -41,6 +51,8 @@ RenderComponent::RenderComponent(Entity* parent, int32_t componentId): Component
|
||||
}
|
||||
}
|
||||
result.finalize();
|
||||
|
||||
m_AnimationGroupCache[componentId] = m_animationGroupIds;
|
||||
}
|
||||
|
||||
RenderComponent::~RenderComponent() {
|
||||
|
@@ -147,6 +147,11 @@ private:
|
||||
* Cache of queries that look for the length of each effect, indexed by effect ID
|
||||
*/
|
||||
static std::unordered_map<int32_t, float> m_DurationCache;
|
||||
|
||||
/**
|
||||
* Cache for animation groups, indexed by the component ID
|
||||
*/
|
||||
static std::unordered_map<int32_t, std::vector<int32_t>> m_AnimationGroupCache;
|
||||
};
|
||||
|
||||
#endif // RENDERCOMPONENT_H
|
||||
|
Reference in New Issue
Block a user