Skip to content

Commit

Permalink
Oss release master created 2021-10-15-07-41
Browse files Browse the repository at this point in the history
see CHANGELOG.md for details

Original commit sha: 24111414aa11d4ba3f35c16c77cbf7ffbcf1c68c

Co-authored-by: Daniel Haas <25718295+bojackHaasman@users.noreply.github.com>
Co-authored-by: Tobias Hammer <tohammer@users.noreply.github.com>
Co-authored-by: Bernhard Kisslinger <65217745+bkisslinger@users.noreply.github.com>
Co-authored-by: Violin Yanev <violinyanev@users.noreply.github.com>
  • Loading branch information
5 people committed Oct 15, 2021
1 parent ff66548 commit ad45360
Show file tree
Hide file tree
Showing 100 changed files with 4,698 additions and 961 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# master

# v0.10.0

**API Changes**

* Added LuaModule that can be used to load Lua source code to be shared in one or more Lua scripts
* LogicEngine::createLuaScriptFromSource and LogicEngine::createLuaScriptFromFile have new optional argument
to provide list of module dependencies and access alias for each of them
* Modules can use other modules recursively
* Reworked API for creating scripts (accepts an optional configuration object which can be used to refer to modules)
* Old API methods (createLuaScriptFromSource and createLuaScriptFromFile) are not available any more
* New API createLuaScript accepts Lua source code, and optionally configuration object and a name
* File handling is expected to be performed outside the Logic Engine
* Rationale: text file loading is not considered a core functionality of the logic engine
* Also removed corresponding LuaScript::getFilename() method
* Standard modules must be loaded explicitly via the LuaConfig object
* When loading older binary files, standard modules are implicitly loaded for compatibility
* New code should request standard modules explicitly and only where needed

**Bugfixes**

* Property::isLinked() is correctly exported in the shared library
* LogicEngine move constructor and assignment are correctly exported in the shared library

# v0.9.1

Summary: update Ramses to version 27.0.111
Expand All @@ -11,6 +34,7 @@ Summary: update Ramses to version 27.0.111
in your runtime or use the built-in ramses shipped with v0.9.1. Otherwise the scene
may look wrong!


# v0.9.0

Summary:
Expand Down
13 changes: 2 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ cmake_minimum_required(VERSION 3.13)
#==========================================================================

set(RLOGIC_VERSION_MAJOR 0)
set(RLOGIC_VERSION_MINOR 9)
set(RLOGIC_VERSION_PATCH 1)
set(RLOGIC_VERSION_MINOR 10)
set(RLOGIC_VERSION_PATCH 0)

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 All @@ -37,7 +37,6 @@ set(ramses-logic_RAMSES_TARGET "ramses-shared-lib-client-only" CACHE
set(ramses-logic_FOLDER_PREFIX "" CACHE
STRING "Set a custom prefix for target folders in Visual Studio. If not set, will be set based on project's relative path")
set(ramses-logic_BUILD_RAMSES_RENDERER false CACHE BOOL "Set whether the ramses renderer will be built as part of this build. If this option is set to ON, ramses-logic_RAMSES_TARGET has to be set to a shared library target of ramses which contains a renderer (e.g ramses-shared-lib-android-egl-es-3-0)")
option(ramses-logic_BUILD_ANDROID "Enable/disable Android build" OFF)
option(ramses-logic_ALLOW_RAMSES_BUILD "Set this to OFF to explicitly disable Ramses build, even if ramses-logic_RAMSES_TARGET is not a valid ramses target" ON)
option(ramses-logic_FIND_RAMSES_FROM_SYSTEM "Set this to ON if you want to use an existing installation or package of Ramses (find_package)" OFF)
set(ramses-logic_PLATFORM "" CACHE
Expand Down Expand Up @@ -234,14 +233,6 @@ endif()

include(cmake/addCheckerTargets.cmake)

# TODO implement public android build scripts
if(ramses-logic_BUILD_ANDROID)
if(NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/android")
message(FATAL_ERROR "Missing android build scripts. Please provide your own gradle scripts in android/")
endif()
add_subdirectory(android)
endif()

#==========================================================================
# build and install documentation
#==========================================================================
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Prefer to learn by example? Have a look at our [self-contained example snippets]

|Logic | Included Ramses version | Minimum required Ramses version | Binary file compatibility |
|---------|-------------------------------|------------------------------------|------------------------------|
|0.10.0 | 27.0.111 | same as 0.6.0 | 0.9.x |
|0.9.1 | 27.0.111 | same as 0.6.0 | 0.9.x |
|0.9.0 | 27.0.110 | same as 0.6.0 | 0.9.x |
|0.8.1 | 27.0.110 | same as 0.6.0 | 0.7.x or 0.8.x |
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/compile_lua.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
#include "benchmark/benchmark.h"

#include "ramses-logic/LogicEngine.h"
#include "ramses-logic/LuaScript.h"
#include "fmt/format.h"

namespace rlogic
{
static void CompileLua(LogicEngine& logicEngine, std::string_view src)
{
LuaScript* script = logicEngine.createLuaScriptFromSource(src);
LuaScript* script = logicEngine.createLuaScript(src);
logicEngine.destroy(*script);
}

Expand Down
7 changes: 4 additions & 3 deletions benchmarks/links.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "benchmark/benchmark.h"

#include "ramses-logic/LogicEngine.h"
#include "ramses-logic/LuaScript.h"
#include "impl/LogicEngineImpl.h"
#include "ramses-logic/Property.h"

Expand All @@ -33,8 +34,8 @@ namespace rlogic
end
)", propertyCount);

LuaScript* srcScript = logicEngine.createLuaScriptFromSource(scriptSrc);
LuaScript* destScript = logicEngine.createLuaScriptFromSource(scriptSrc);
LuaScript* srcScript = logicEngine.createLuaScript(scriptSrc);
LuaScript* destScript = logicEngine.createLuaScript(scriptSrc);
const Property* from = srcScript->getOutputs()->getChild("src0");
Property* to = destScript->getInputs()->getChild("target0");

Expand Down Expand Up @@ -72,7 +73,7 @@ namespace rlogic
std::vector<LuaScript*> scripts(scriptCount);
for (int64_t i = 0; i < scriptCount; ++i)
{
scripts[i] = logicEngine.createLuaScriptFromSource(scriptSrc);
scripts[i] = logicEngine.createLuaScript(scriptSrc);

if (i >= 1)
{
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/property.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "benchmark/benchmark.h"

#include "ramses-logic/LogicEngine.h"
#include "ramses-logic/LuaScript.h"
#include "ramses-logic/Property.h"

#include "impl/LogicEngineImpl.h"
Expand All @@ -32,7 +33,7 @@ namespace rlogic
end
)", propertyCount);

LuaScript* script = logicEngine.createLuaScriptFromSource(scriptSrc);
LuaScript* script = logicEngine.createLuaScript(scriptSrc);
Property* property = script->getInputs()->getChild("param0");
// Need different value, otherwise triggers internal caching (can't disable value check)
int32_t increasingValue = 0;
Expand Down
3 changes: 2 additions & 1 deletion benchmarks/serialization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "benchmark/benchmark.h"

#include "ramses-logic/LogicEngine.h"
#include "ramses-logic/LuaScript.h"
#include "ramses-logic/Property.h"

#include "fmt/format.h"
Expand All @@ -34,7 +35,7 @@ namespace rlogic
std::vector<LuaScript*> scripts(scriptCount);
for (int64_t i = 0; i < scriptCount; ++i)
{
scripts[i] = logicEngine.createLuaScriptFromSource(scriptSrc);
scripts[i] = logicEngine.createLuaScript(scriptSrc);

if (i >= 1)
{
Expand Down
9 changes: 5 additions & 4 deletions benchmarks/update.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "benchmark/benchmark.h"

#include "ramses-logic/LogicEngine.h"
#include "ramses-logic/LuaScript.h"
#include "ramses-logic/Property.h"

#include "impl/LogicEngineImpl.h"
Expand All @@ -34,7 +35,7 @@ namespace rlogic
end
)", loopCount);

logicEngine.createLuaScriptFromSource(scriptSrc);
logicEngine.createLuaScript(scriptSrc);

for (auto _ : state) // NOLINT(clang-analyzer-deadcode.DeadStores) False positive
{
Expand Down Expand Up @@ -83,7 +84,7 @@ namespace rlogic
end
)", loopCount);

logicEngine.createLuaScriptFromSource(scriptSrc);
logicEngine.createLuaScript(scriptSrc);

for (auto _ : state) // NOLINT(clang-analyzer-deadcode.DeadStores) False positive
{
Expand Down Expand Up @@ -112,7 +113,7 @@ namespace rlogic
end
)", loopCount);

logicEngine.createLuaScriptFromSource(scriptSrc);
logicEngine.createLuaScript(scriptSrc);

for (auto _ : state) // NOLINT(clang-analyzer-deadcode.DeadStores) False positive
{
Expand Down Expand Up @@ -161,7 +162,7 @@ namespace rlogic
std::vector<LuaScript*> scripts(scriptCount);
for (int64_t i = 0; i < scriptCount; ++i)
{
scripts[i] = logicEngine.createLuaScriptFromSource(scriptSrc, fmt::format("script{}", i));
scripts[i] = logicEngine.createLuaScript(scriptSrc, {}, fmt::format("script{}", i));

if (i >= 1)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int main()
{
std::cout << "Start ramses-logic-shared-lib-check\n";
rlogic::LogicEngine logicEngine;
rlogic::LuaScript* script = logicEngine.createLuaScriptFromSource(R"(
rlogic::LuaScript* script = logicEngine.createLuaScript(R"(
function interface()
IN.int = INT
OUT.float = FLOAT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ int main()
{
std::cout << "Start ramses-logic-submodule-check\n";
rlogic::LogicEngine logicEngine;
rlogic::LuaScript* script = logicEngine.createLuaScriptFromSource(R"(
rlogic::LuaScript* script = logicEngine.createLuaScript(R"(
function interface()
IN.int = INT
OUT.float = FLOAT
Expand Down
9 changes: 5 additions & 4 deletions doc/sphinx/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ You can create scripts using the :class:`rlogic::LogicEngine` class like this:
)"
LogicEngine engine;
LuaScript* script = engine.createLuaScriptFromSource(source, "simple script");
LuaScript* script = engine.createLuaScript(source, "simple script");
script->getInputs()->getChild("gear")->set<int32_t>(4);
script->execute();
Expand Down Expand Up @@ -197,7 +197,7 @@ Here is a simple example how links are created:
:linenos:
LogicEngine logicEngine;
LuaScript* sourceScript = logicEngine.createLuaScriptFromSource(R"(
LuaScript* sourceScript = logicEngine.createLuaScript(R"(
function interface()
OUT.source = STRING
end
Expand All @@ -206,7 +206,7 @@ Here is a simple example how links are created:
end
)");
LuaScript* destinationScript = logicEngine.createLuaScriptFromSource(R"(
LuaScript* destinationScript = logicEngine.createLuaScript(R"(
function interface()
IN.destination = STRING
end
Expand Down Expand Up @@ -409,7 +409,7 @@ you own one like this:
:linenos:
LogicEngine logicEngine;
LuaScript* script = logicEngine.createLuaScriptFromSource(R"(
LuaScript* script = logicEngine.createLuaScript(R"(
function interface()
end
function run()
Expand Down Expand Up @@ -680,3 +680,4 @@ List of all examples
examples/06_override_print
examples/07_links
examples/08_animation
examples/09_modules
18 changes: 18 additions & 0 deletions doc/sphinx/classes/EStandardModule.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
..
-------------------------------------------------------------------------
Copyright (C) 2021 BMW AG
-------------------------------------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
-------------------------------------------------------------------------
.. default-domain:: cpp
.. highlight:: cpp

=========================
EStandardModule
=========================

.. doxygenenum:: rlogic::EStandardModule

18 changes: 18 additions & 0 deletions doc/sphinx/classes/LuaConfig.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
..
-------------------------------------------------------------------------
Copyright (C) 2021 BMW AG
-------------------------------------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
-------------------------------------------------------------------------
.. default-domain:: cpp
.. highlight:: cpp

=========================
LuaConfig
=========================

.. doxygenclass:: rlogic::LuaConfig
:members:
18 changes: 18 additions & 0 deletions doc/sphinx/classes/LuaModule.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
..
-------------------------------------------------------------------------
Copyright (C) 2021 BMW AG
-------------------------------------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
-------------------------------------------------------------------------
.. default-domain:: cpp
.. highlight:: cpp

=========================
LuaModule
=========================

.. doxygenclass:: rlogic::LuaModule
:members:
3 changes: 3 additions & 0 deletions doc/sphinx/classes/generate_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
'options': ' :members:',
'items': [
'LogicEngine',
'LuaModule',
'LuaScript',
'RamsesNodeBinding',
'RamsesAppearanceBinding',
Expand All @@ -30,6 +31,7 @@
'AnimationNode',
'Iterator',
'Collection',
'LuaConfig',
],
},
{
Expand Down Expand Up @@ -76,6 +78,7 @@
'namespace_prefix': 'rlogic::',
'options': '',
'items': [
'EStandardModule',
'EPropertyType',
'EInterpolationType',
'ELogMessageType',
Expand Down
3 changes: 3 additions & 0 deletions doc/sphinx/classes/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Class Index


LogicEngine
LuaModule
LuaScript
RamsesNodeBinding
RamsesAppearanceBinding
Expand All @@ -29,6 +30,7 @@ Class Index
AnimationNode
Iterator
Collection
LuaConfig


.. toctree::
Expand Down Expand Up @@ -70,6 +72,7 @@ Class Index
:caption: Enums


EStandardModule
EPropertyType
EInterpolationType
ELogMessageType
Expand Down
19 changes: 19 additions & 0 deletions doc/sphinx/examples/09_modules.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
..
-------------------------------------------------------------------------
Copyright (C) 2021 BMW AG
-------------------------------------------------------------------------
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at https://mozilla.org/MPL/2.0/.
-------------------------------------------------------------------------
.. default-domain:: cpp
.. highlight:: cpp

================================
Modules example
================================

.. literalinclude:: ../../../examples/09_modules/main.cpp
:start-after: #include <cassert>
:end-before: return 0;
Loading

0 comments on commit ad45360

Please sign in to comment.