Skip to content

Commit

Permalink
Oss release v1.4.6 created 2024-05-02-06-07 (#65)
Browse files Browse the repository at this point in the history
see CHANGELOG.md for details

Original commit sha: c94d5b4f38ab41b5c502c6b92617a5bca6d4de7b

Co-authored-by: Ramses Tech User <[email protected]>
Co-authored-by: Daniel Haas <[email protected]>
Co-authored-by: Mohamed Sharaf-El-Deen <[email protected]>
Co-authored-by: Mirko Sova <[email protected]>
Co-authored-by: Tobias Hammer <[email protected]>
Co-authored-by: Violin Yanev <[email protected]>
  • Loading branch information
7 people authored May 2, 2024
1 parent e7ebf21 commit 7754b8e
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 24 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
# v1.4.6

**CHANGED**

* SkinBindings are now updated at the end of logic update

# v1.4.5

**FIXED**

- SkinBinding update order bug where skin bindings use old values in update
* SkinBinding update order bug where skin bindings use old values in update

# v1.4.4

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cmake_minimum_required(VERSION 3.13)

set(RLOGIC_VERSION_MAJOR 1)
set(RLOGIC_VERSION_MINOR 4)
set(RLOGIC_VERSION_PATCH 5)
set(RLOGIC_VERSION_PATCH 6)

set(RLOGIC_VERSION ${RLOGIC_VERSION_MAJOR}.${RLOGIC_VERSION_MINOR}.${RLOGIC_VERSION_PATCH})
set(ramses-logic_VERSION "${RLOGIC_VERSION}" CACHE STRING "Ramses Logic version" FORCE)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ existing files exported with Logic Engine version **W** or newer (Binary file co

|Logic | Included Ramses version | Minimum required Ramses version | Binary file compatibility |
|----------|-------------------------------|------------------------------------|------------------------------|
|v1.4.6 | 27.0.139 | 27.0.102 | >= 1.0.0, F-Levels 01 - 05 |
|v1.4.5 | 27.0.139 | 27.0.102 | >= 1.0.0, F-Levels 01 - 05 |
|v1.4.4 | 27.0.139 | 27.0.102 | >= 1.0.0, F-Levels 01 - 05 |
|v1.4.3 | 27.0.130 | 27.0.102 | >= 1.0.0, F-Levels 01 - 05 |
Expand Down
67 changes: 45 additions & 22 deletions lib/impl/LogicEngineImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#include "impl/LuaModuleImpl.h"
#include "impl/LuaConfigImpl.h"
#include "impl/SaveFileConfigImpl.h"
#include "impl/SkinBindingImpl.h"
#include "impl/LogicEngineReportImpl.h"
#include "impl/RamsesRenderGroupBindingElementsImpl.h"

Expand Down Expand Up @@ -436,7 +437,11 @@ namespace rlogic::internal
// force dirty all timer nodes, anchor points and skinbindings
setNodeToBeAlwaysUpdatedDirty();

const bool success = updateNodes(*sortedNodes);
bool success = updateNodes(*sortedNodes);

// update skin bindings only if updating the other nodes succeeded
if (success)
success = updateSkinBindings();

if (m_statisticsEnabled || m_updateReportEnabled)
{
Expand All @@ -449,13 +454,24 @@ namespace rlogic::internal
return success;
}

bool LogicEngineImpl::updateSkinBindings()
{
for (SkinBinding* skinBinding : m_apiObjects->getApiObjectContainer<SkinBinding>()) {
if (!updateNode(skinBinding->m_skinBinding)) {
return false;
}
}
return true;
}

bool LogicEngineImpl::updateNodes(const NodeVector& sortedNodes)
{
for (LogicNodeImpl* nodeIter : sortedNodes)
{
LogicNodeImpl& node = *nodeIter;

if (!node.isDirty())
// skip also processing of SkinBindings, since they will be processed after updating everything else
if (!node.isDirty() || dynamic_cast<SkinBindingImpl*>(&node))
{
if (m_updateReportEnabled)
m_updateReport.nodeSkippedExecution(node);
Expand All @@ -464,33 +480,40 @@ namespace rlogic::internal
continue;
}

if (m_updateReportEnabled)
m_updateReport.nodeExecutionStarted(node);
if (m_statisticsEnabled)
m_statistics.nodeExecuted();

const std::optional<LogicNodeRuntimeError> potentialError = node.update();
if (potentialError)
{
m_errors.add(potentialError->message, m_apiObjects->getApiObject(node), EErrorType::RuntimeError);
if (!updateNode(node))
return false;
}
}

Property* outputs = node.getOutputs();
if (outputs != nullptr)
{
const size_t activatedLinks = activateLinksRecursive(*outputs->m_impl);
return true;
}

if (m_statisticsEnabled || m_updateReportEnabled)
m_updateReport.linksActivated(activatedLinks);
}
bool LogicEngineImpl::updateNode(LogicNodeImpl& node)
{
if (m_updateReportEnabled)
m_updateReport.nodeExecutionStarted(node);
if (m_statisticsEnabled)
m_statistics.nodeExecuted();

const std::optional<LogicNodeRuntimeError> potentialError = node.update();
if (potentialError)
{
m_errors.add(potentialError->message, m_apiObjects->getApiObject(node), EErrorType::RuntimeError);
return false;
}

if (m_updateReportEnabled)
m_updateReport.nodeExecutionFinished();
Property* outputs = node.getOutputs();
if (outputs != nullptr)
{
const size_t activatedLinks = activateLinksRecursive(*outputs->m_impl);

node.setDirty(false);
if (m_statisticsEnabled || m_updateReportEnabled)
m_updateReport.linksActivated(activatedLinks);
}

if (m_updateReportEnabled)
m_updateReport.nodeExecutionFinished();
node.setDirty(false);

return true;
}

Expand Down
3 changes: 3 additions & 0 deletions lib/impl/LogicEngineImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ namespace rlogic::internal

[[nodiscard]] bool updateNodes(const NodeVector& nodes);

[[nodiscard]] bool updateSkinBindings();
[[nodiscard]] bool updateNode(LogicNodeImpl& node);

[[nodiscard]] bool loadFromByteData(const void* byteData, size_t byteSize, ramses::Scene* scene, bool enableMemoryVerification, const std::string& dataSourceDescription);
[[nodiscard]] bool checkFileIdentifierBytes(const std::string& dataSourceDescription, const std::string& fileIdBytes);
[[nodiscard]] const char* getFileIdentifierMatchingFeatureLevel() const;
Expand Down

0 comments on commit 7754b8e

Please sign in to comment.