Skip to content

Commit db6379f

Browse files
ramses-tech-usernVxxbojackHaasmanmohhsharafsmirko-dev
committed
Oss release v1.2.0 created 2022-09-21-07-11
see CHANGELOG.md for details Original commit sha: ea940ffc424e5c371f13d7124042f335cd2bb3d1 Co-authored-by: Askanaz Torosyan <[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]>
1 parent 87bab2e commit db6379f

File tree

11 files changed

+140
-76
lines changed

11 files changed

+140
-76
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ cmake_minimum_required(VERSION 3.13)
1414
#==========================================================================
1515

1616
set(RLOGIC_VERSION_MAJOR 1)
17-
set(RLOGIC_VERSION_MINOR 1)
18-
set(RLOGIC_VERSION_PATCH 1)
17+
set(RLOGIC_VERSION_MINOR 2)
18+
set(RLOGIC_VERSION_PATCH 0)
1919

2020
set(RLOGIC_VERSION ${RLOGIC_VERSION_MAJOR}.${RLOGIC_VERSION_MINOR}.${RLOGIC_VERSION_PATCH})
2121
set(ramses-logic_VERSION "${RLOGIC_VERSION}" CACHE STRING "Ramses Logic version" FORCE)

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -34,27 +34,27 @@ Prefer to learn by example? Have a look at our [self-contained example snippets]
3434

3535
|Logic | Included Ramses version | Minimum required Ramses version | Binary file compatibility |
3636
|---------|-------------------------------|------------------------------------|------------------------------|
37-
|1.2.0 | 27.0.122 | 27.0.102 | >= 1.0.0, F-Levels 01 - 03 |
38-
|1.1.x | 27.0.121 | 27.0.102 | >= 1.0.0, F-Levels 01, 02 |
39-
|1.0.x | 27.0.119 | 27.0.102 | >= 1.0.0 |
40-
|0.15.0 | 27.0.116 | 27.0.102 | >= 0.15.0 |
41-
|0.14.2 | 27.0.115 | 27.0.102 | >= 0.13.0 |
42-
|0.14.1 | 27.0.114 | 27.0.102 | >= 0.13.0 |
43-
|0.13.0 | 27.0.114 | 27.0.102 | >= 0.13.0 |
44-
|0.12.0 | 27.0.113 | 27.0.102 | 0.9.0 - 0.12.0 |
45-
|0.11.0 | 27.0.113 | 27.0.102 | 0.9.0 - 0.12.0 |
46-
|0.10.2 | 27.0.112 | 27.0.102 | 0.9.0 - 0.12.0 |
47-
|0.10.1 | 27.0.111 | 27.0.102 | 0.9.0 - 0.12.0 |
48-
|0.10.0 | 27.0.111 | 27.0.102 | 0.9.0 - 0.12.0 |
49-
|0.9.1 | 27.0.111 | 27.0.102 | 0.9.0 - 0.12.0 |
50-
|0.9.0 | 27.0.110 | 27.0.102 | 0.9.0 - 0.12.0 |
51-
|0.8.1 | 27.0.110 | 27.0.102 | 0.7.x or 0.8.x |
52-
|0.8.0 | 27.0.110 | 27.0.102 | 0.7.x or 0.8.x |
53-
|0.7.0 | 27.0.105 | 27.0.102 | 0.7.x |
54-
|0.6.2 | 27.0.105 | 27.0.102 | 0.6.x |
55-
|0.6.1 | 27.0.103 (includes 27.0.11) | 27.0.102 | 0.6.x |
56-
|0.6.0 | 27.0.102 (includes 27.0.10) | 27.0.100 | 0.6.x |
57-
|0.5.3 | 27.0.101 | 27.0.100 | 0.5.3 |
37+
|v1.2.0 | 27.0.122 | 27.0.102 | >= 1.0.0, F-Levels 01 - 03 |
38+
|v1.1.x | 27.0.121 | 27.0.102 | >= 1.0.0, F-Levels 01, 02 |
39+
|v1.0.x | 27.0.119 | 27.0.102 | >= 1.0.0 |
40+
|v0.15.0 | 27.0.116 | 27.0.102 | >= 0.15.0 |
41+
|v0.14.2 | 27.0.115 | 27.0.102 | >= 0.13.0 |
42+
|v0.14.1 | 27.0.114 | 27.0.102 | >= 0.13.0 |
43+
|v0.13.0 | 27.0.114 | 27.0.102 | >= 0.13.0 |
44+
|v0.12.0 | 27.0.113 | 27.0.102 | 0.9.0 - 0.12.0 |
45+
|v0.11.0 | 27.0.113 | 27.0.102 | 0.9.0 - 0.12.0 |
46+
|v0.10.2 | 27.0.112 | 27.0.102 | 0.9.0 - 0.12.0 |
47+
|v0.10.1 | 27.0.111 | 27.0.102 | 0.9.0 - 0.12.0 |
48+
|v0.10.0 | 27.0.111 | 27.0.102 | 0.9.0 - 0.12.0 |
49+
|v0.9.1 | 27.0.111 | 27.0.102 | 0.9.0 - 0.12.0 |
50+
|v0.9.0 | 27.0.110 | 27.0.102 | 0.9.0 - 0.12.0 |
51+
|v0.8.1 | 27.0.110 | 27.0.102 | 0.7.x or 0.8.x |
52+
|v0.8.0 | 27.0.110 | 27.0.102 | 0.7.x or 0.8.x |
53+
|v0.7.0 | 27.0.105 | 27.0.102 | 0.7.x |
54+
|v0.6.2 | 27.0.105 | 27.0.102 | 0.6.x |
55+
|v0.6.1 | 27.0.103 (includes 27.0.11) | 27.0.102 | 0.6.x |
56+
|v0.6.0 | 27.0.102 (includes 27.0.10) | 27.0.100 | 0.6.x |
57+
|v0.5.3 | 27.0.101 | 27.0.100 | 0.5.3 |
5858

5959
# License
6060

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
leak:libxcb.so
22
leak:calloc
3+
4+
# TODO(mirko) suppress leaks from swrast executables
5+
leak:ramses-logic-viewer-test_SWRAST
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Race in swrast_dri lib
2+
race:ramses_internal::Context_EGL::~Context_EGL

ci/scripts/check_versions.sh

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
#!/usr/bin/env bash
2+
3+
# -------------------------------------------------------------------------
4+
# Copyright (C) 2022 BMW AG
5+
# -------------------------------------------------------------------------
6+
# This Source Code Form is subject to the terms of the Mozilla Public
7+
# License, v. 2.0. If a copy of the MPL was not distributed with this
8+
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
9+
# -------------------------------------------------------------------------
10+
11+
set -e
12+
13+
usage() { echo "Usage: $0 -t <tag> -r <root>]" 1>&2; exit 1; }
14+
15+
while getopts ":t:r:" o; do
16+
case "${o}" in
17+
t)
18+
tag=${OPTARG}
19+
;;
20+
r)
21+
root=${OPTARG}
22+
;;
23+
*)
24+
usage
25+
;;
26+
esac
27+
done
28+
shift $((OPTIND-1))
29+
30+
if [ -z "${tag}" ]; then
31+
echo "Missing tag!"
32+
usage
33+
fi
34+
35+
cmakelists="${root}/CMakeLists.txt"
36+
if [ -f "$cmakelists" ]; then
37+
echo "Comparing $tag against version declared in $cmakelists"
38+
39+
VERSION_MAJOR=`cat $cmakelists | grep "set(RLOGIC_VERSION_MAJOR" | sed 's/^[^0-9]*\([0-9]*\).*$/\1/'`
40+
VERSION_MINOR=`cat $cmakelists | grep "set(RLOGIC_VERSION_MINOR" | sed 's/^[^0-9]*\([0-9]*\).*$/\1/'`
41+
VERSION_PATCH=`cat $cmakelists | grep "set(RLOGIC_VERSION_PATCH" | sed 's/^[^0-9]*\([0-9]*\).*$/\1/'`
42+
cmake_version="v$VERSION_MAJOR.$VERSION_MINOR.$VERSION_PATCH"
43+
44+
if [ "$cmake_version" = "$tag" ]; then
45+
echo "Tag $tag matches version in $cmakelists"
46+
else
47+
echo "Tag $tag does not match the version in $cmakelists ($cmake_version)" 1>&2
48+
exit 1
49+
fi
50+
else
51+
echo "Could not find CMakeLists ($cmakelists)!" 1>&2
52+
exit 1
53+
fi
54+
55+
changelog="${root}/CHANGELOG.md"
56+
if [ -f "$changelog" ]; then
57+
echo "Checking if version $tag is mentioned in $changelog"
58+
59+
if [ -n "$(cat $changelog | grep $tag)" ]; then
60+
echo "Tag $tag is mentioned in $changelog"
61+
else
62+
echo "Tag $tag is not mentioned in $changelog" 1>&2
63+
exit 1
64+
fi
65+
66+
else
67+
echo "Could not find changelog ($changelog)!" 1>&2
68+
exit 1
69+
fi
70+
71+
readme="${root}/README.md"
72+
if [ -f "$readme" ]; then
73+
echo "Checking if version $tag is mentioned in $readme"
74+
75+
if [ -n "$(cat $readme | grep $tag)" ]; then
76+
echo "Tag $tag is mentioned in $readme"
77+
else
78+
echo "Tag $tag is not mentioned in $readme" 1>&2
79+
exit 1
80+
fi
81+
82+
else
83+
echo "Could not find the readme ($readme)!" 1>&2
84+
exit 1
85+
fi

lib/impl/AnchorPointImpl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ namespace rlogic::internal
101101
return nullptr;
102102
}
103103

104-
RamsesNodeBindingImpl* nodeBinding = deserializationMap.resolveNodeBinding(anchorPoint.nodeBindingId());
105-
RamsesCameraBindingImpl* cameraBinding = deserializationMap.resolveCameraBinding(anchorPoint.cameraBindingId());
104+
auto* nodeBinding = deserializationMap.resolveLogicObject<RamsesNodeBindingImpl>(anchorPoint.nodeBindingId());
105+
auto* cameraBinding = deserializationMap.resolveLogicObject<RamsesCameraBindingImpl>(anchorPoint.cameraBindingId());
106106
if (!nodeBinding || !cameraBinding)
107107
{
108108
errorReporting.add("Fatal error during loading of AnchorPoint: could not resolve NodeBinding and/or CameraBinding!", nullptr, EErrorType::BinaryVersionMismatch);

lib/impl/LuaModuleImpl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -150,15 +150,14 @@ namespace rlogic::internal
150150
errorReporting.add(fmt::format("Fatal error during loading of LuaModule '{}' module data: missing name!", name), nullptr, EErrorType::BinaryVersionMismatch);
151151
return nullptr;
152152
}
153-
const LuaModule* moduleUsed = deserializationMap.resolveLuaModule(mod->moduleId());
154-
153+
const auto* moduleUsed = deserializationMap.resolveLogicObject<LuaModuleImpl>(mod->moduleId());
155154
if (!moduleUsed)
156155
{
157156
errorReporting.add(fmt::format("Fatal error during loading of LuaModule '{}' module data: could not resolve dependent module with id={}!", name, mod->moduleId()), nullptr, EErrorType::BinaryVersionMismatch);
158157
return nullptr;
159158
}
160159

161-
modulesUsed.emplace(mod->name()->str(), moduleUsed);
160+
modulesUsed.emplace(mod->name()->str(), moduleUsed->getLogicObject().as<LuaModule>());
162161
}
163162

164163
std::string source = (featureLevel == EFeatureLevel_01 ? module.source()->str() : "");

lib/impl/LuaScriptImpl.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -197,15 +197,14 @@ namespace rlogic::internal
197197
errorReporting.add(fmt::format("Fatal error during loading of LuaScript '{}' module data: missing name!", name), nullptr, EErrorType::BinaryVersionMismatch);
198198
return nullptr;
199199
}
200-
const LuaModule* moduleUsed = deserializationMap.resolveLuaModule(module->moduleId());
201-
200+
const auto* moduleUsed = deserializationMap.resolveLogicObject<LuaModuleImpl>(module->moduleId());
202201
if (!moduleUsed)
203202
{
204203
errorReporting.add(fmt::format("Fatal error during loading of LuaScript '{}' module data: could not resolve dependent module with id={}!", name, module->moduleId()), nullptr, EErrorType::BinaryVersionMismatch);
205204
return nullptr;
206205
}
207206

208-
userModules.emplace(module->name()->str(), moduleUsed);
207+
userModules.emplace(module->name()->str(), moduleUsed->getLogicObject().as<LuaModule>());
209208
}
210209

211210
if (!luaScript.standardModules())

lib/internals/ApiObjects.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,7 +1136,7 @@ namespace rlogic::internal
11361136
LuaModule* luaModule = up.get();
11371137
deserialized->m_luaModules.push_back(luaModule);
11381138
deserialized->registerLogicObject(std::move(up));
1139-
deserializationMap.storeLuaModule(luaModule->getId(), *deserialized->m_luaModules.back());
1139+
deserializationMap.storeLogicObject(luaModule->getId(), deserialized->m_luaModules.back()->m_impl);
11401140
}
11411141

11421142
const auto& luascripts = *apiObjects.luaScripts();
@@ -1208,7 +1208,7 @@ namespace rlogic::internal
12081208
RamsesNodeBinding* nodeBinding = up.get();
12091209
deserialized->m_ramsesNodeBindings.push_back(nodeBinding);
12101210
deserialized->registerLogicObject(std::move(up));
1211-
deserializationMap.storeNodeBinding(nodeBinding->getId(), nodeBinding->m_nodeBinding);
1211+
deserializationMap.storeLogicObject(nodeBinding->getId(), nodeBinding->m_nodeBinding);
12121212
}
12131213
else
12141214
{
@@ -1251,7 +1251,7 @@ namespace rlogic::internal
12511251
RamsesCameraBinding* camBinding = up.get();
12521252
deserialized->m_ramsesCameraBindings.push_back(camBinding);
12531253
deserialized->registerLogicObject(std::move(up));
1254-
deserializationMap.storeCameraBinding(camBinding->getId(), camBinding->m_cameraBinding);
1254+
deserializationMap.storeLogicObject(camBinding->getId(), camBinding->m_cameraBinding);
12551255
}
12561256
else
12571257
{

lib/internals/DeserializationMap.h

Lines changed: 12 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ namespace rlogic_serialization
1919
namespace rlogic
2020
{
2121
class DataArray;
22-
class LuaModule;
2322
}
2423

2524
namespace rlogic::internal
2625
{
2726
class PropertyImpl;
28-
class RamsesNodeBindingImpl;
29-
class RamsesCameraBindingImpl;
27+
class LogicObjectImpl;
3028

3129
// Remembers flatbuffers pointers to deserialized objects temporarily during deserialization
3230
class DeserializationMap
@@ -52,34 +50,21 @@ namespace rlogic::internal
5250
return *Get(&flatbufferObject, m_dataArrays);
5351
}
5452

55-
void storeLuaModule(uint64_t luaModuleId, const LuaModule& luaModule)
53+
void storeLogicObject(uint64_t id, LogicObjectImpl& obj)
5654
{
57-
Store(luaModuleId, &luaModule, m_luaModules);
55+
Store(id, &obj, m_logicObjects);
5856
}
5957

60-
const LuaModule* resolveLuaModule(uint64_t luaModuleId) const
58+
template <typename ImplT>
59+
ImplT* resolveLogicObject(uint64_t id) const
6160
{
62-
return Get(luaModuleId, m_luaModules);
63-
}
64-
65-
void storeNodeBinding(uint64_t id, RamsesNodeBindingImpl& nodeBinding)
66-
{
67-
Store(id, &nodeBinding, m_nodeBindings);
68-
}
61+
// fail queries using IDs gracefully if given ID not found
62+
// file can be OK on flatbuffer schema level but might still contain corrupted ID value
63+
const auto it = m_logicObjects.find(id);
64+
if (it != m_logicObjects.cend())
65+
return dynamic_cast<ImplT*>(it->second);
6966

70-
RamsesNodeBindingImpl* resolveNodeBinding(uint64_t id) const
71-
{
72-
return Get(id, m_nodeBindings);
73-
}
74-
75-
void storeCameraBinding(uint64_t id, RamsesCameraBindingImpl& cameraBinding)
76-
{
77-
Store(id, &cameraBinding, m_cameraBindings);
78-
}
79-
80-
RamsesCameraBindingImpl* resolveCameraBinding(uint64_t id) const
81-
{
82-
return Get(id, m_cameraBindings);
67+
return nullptr;
8368
}
8469

8570
private:
@@ -99,20 +84,9 @@ namespace rlogic::internal
9984
return it->second;
10085
}
10186

102-
// fail queries using IDs gracefully if given ID not found
103-
// file can be OK on flatbuffer schema level but might still contain corrupted value
104-
template <typename Value>
105-
[[nodiscard]] static Value Get(uint64_t key, const std::unordered_map<uint64_t, Value>& container)
106-
{
107-
const auto it = container.find(key);
108-
return (it == container.cend()) ? nullptr : it->second;
109-
}
110-
11187
std::unordered_map<const rlogic_serialization::Property*, PropertyImpl*> m_properties;
11288
std::unordered_map<const rlogic_serialization::DataArray*, const DataArray*> m_dataArrays;
113-
std::unordered_map<uint64_t, const LuaModule*> m_luaModules;
114-
std::unordered_map<uint64_t, RamsesNodeBindingImpl*> m_nodeBindings;
115-
std::unordered_map<uint64_t, RamsesCameraBindingImpl*> m_cameraBindings;
89+
std::unordered_map<uint64_t, LogicObjectImpl*> m_logicObjects;
11690
};
11791

11892
}

0 commit comments

Comments
 (0)