Skip to content

Commit f18211d

Browse files
committed
asset save fixes
1 parent b6dfa8b commit f18211d

File tree

14 files changed

+37
-67
lines changed

14 files changed

+37
-67
lines changed

sources/Core/FlowGraph/FlowGraph.cpp

Lines changed: 0 additions & 22 deletions
This file was deleted.

sources/Core/FlowGraph/FlowGraph.ixx

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module;
22
#include "Serialization/serialization_defines.h"
3+
#include "Serialization/serialization_archives.h"
34
export module FlowGraph;
45

56

@@ -831,17 +832,17 @@ export
831832

832833
}
833834

834-
/*
835-
BOOST_CLASS_EXPORT_KEY(FlowGraph::window);
836-
BOOST_CLASS_EXPORT_KEY(FlowGraph::Node);
837-
BOOST_CLASS_EXPORT_KEY(FlowGraph::input);
838-
BOOST_CLASS_EXPORT_KEY(FlowGraph::output);
839-
BOOST_CLASS_EXPORT_KEY(FlowGraph::graph);
840-
BOOST_CLASS_EXPORT_KEY(FlowGraph::graph_input);
841-
BOOST_CLASS_EXPORT_KEY(FlowGraph::graph_output);
842-
BOOST_CLASS_EXPORT_KEY(FlowGraph::parameter_type);
843-
BOOST_CLASS_EXPORT_KEY(FlowGraph::strict_parameter);
844-
*/
835+
836+
BOOST_CLASS_EXPORT(FlowGraph::window);
837+
BOOST_CLASS_EXPORT(FlowGraph::Node);
838+
BOOST_CLASS_EXPORT(FlowGraph::input);
839+
BOOST_CLASS_EXPORT(FlowGraph::output);
840+
BOOST_CLASS_EXPORT(FlowGraph::graph);
841+
BOOST_CLASS_EXPORT(FlowGraph::graph_input);
842+
BOOST_CLASS_EXPORT(FlowGraph::graph_output);
843+
BOOST_CLASS_EXPORT(FlowGraph::parameter_type);
844+
BOOST_CLASS_EXPORT(FlowGraph::strict_parameter);
845+
845846
module:private;
846847

847848
namespace FlowGraph

sources/Core/Math/Primitives/AABB.ixx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module;
22
#include "Serialization/serialization_defines.h"
3+
#include "Serialization/serialization_archives.h"
34
export module AABB;
45

56
export import Constants;
@@ -42,6 +43,7 @@ private:
4243
}
4344
};
4445

46+
BOOST_CLASS_EXPORT(AABB);
4547

4648
module: private;
4749

sources/Core/Math/Primitives/Frustum.ixx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module;
22
#include "Serialization/serialization_defines.h"
3+
#include "Serialization/serialization_archives.h"
34
export module Frustum;
45

56
export import Constants;

sources/Core/Math/Primitives/Intersections.ixx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module;
22
#include "Serialization/serialization_defines.h"
3+
#include "Serialization/serialization_archives.h"
34
export module Intersections;
45

56
export import Constants;

sources/Core/Math/Primitives/Plane.ixx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module;
22
#include "Serialization/serialization_defines.h"
3+
#include "Serialization/serialization_archives.h"
34
export module Plane;
45

56
export import Constants;

sources/Core/Math/Primitives/Primitive.ixx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module;
22
#include "Serialization/serialization_defines.h"
3+
#include "Serialization/serialization_archives.h"
34
export module Primitive;
45

56
export import Constants;

sources/Core/Math/Primitives/Ray.ixx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module;
22
#include "Serialization/serialization_defines.h"
3+
#include "Serialization/serialization_archives.h"
34
export module Ray;
45

56
export import Constants;

sources/Core/Math/Primitives/Sphere.ixx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module;
22
#include "Serialization/serialization_defines.h"
3+
#include "Serialization/serialization_archives.h"
34
export module Sphere;
45

56
export import Constants;

sources/Core/Utils/utils.ixx

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -229,30 +229,6 @@ export
229229
}
230230
};
231231

232-
233-
234-
struct guid_compare {
235-
bool operator()(const Guid& l, const Guid& r) const {
236-
auto& a = l.bytes();
237-
auto& b = r.bytes();
238-
239-
240-
for (unsigned int i = 0; i < b.size(); i++)
241-
{
242-
if (a[i] != b[i])
243-
return a[i] < b[i];
244-
}
245-
246-
return false;
247-
}
248-
};
249-
250-
251-
using guid_set = std::set<Guid, guid_compare>;
252-
253-
template<class T>
254-
using guid_map = std::map<Guid, T, guid_compare>;
255-
256232
}
257233

258234
module: private;

sources/Modules/crossguid/crossguid.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#define isValid() operator<(const Guid &rhs) const { return _bytes < rhs._bytes;} \
2+
bool isValid()
3+
14
#include <crossguid/guid.hpp>
25

3-
using Guid = xg::Guid;
6+
#undef isValid

sources/Modules/crossguid/crossguid.ixx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ export module crossguid;
22

33
export import "crossguid.h";
44

5-
export using Guid = xg::Guid;
5+
6+
export using Guid = xg::Guid;

sources/RenderSystem/Assets/Asset.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -748,9 +748,9 @@ void AssetStorage::save()
748748
{
749749
}
750750

751-
guid_set AssetHolder::get_reference_ids()
751+
std::set<Guid> AssetHolder::get_reference_ids()
752752
{
753-
guid_set r;
753+
std::set<Guid> r;
754754
m.lock();
755755

756756
for (auto a : assets)

sources/RenderSystem/Assets/Asset.h

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ class AssetHolder
303303
protected:
304304
virtual void on_asset_change(std::shared_ptr<Asset> asset);
305305
public:
306-
guid_set get_reference_ids();
306+
std::set<Guid> get_reference_ids();
307307

308308
SERIALIZE()
309309
{
@@ -416,7 +416,7 @@ class AssetStorage : public std::enable_shared_from_this<AssetStorage>, public E
416416
Guid id;
417417
std::wstring name;
418418

419-
guid_set references;
419+
std::set<Guid> references;
420420
std::set<std::wstring> additional_files;
421421
Asset_Type type;
422422

@@ -492,7 +492,7 @@ class AssetStorage : public std::enable_shared_from_this<AssetStorage>, public E
492492
folder_item* get_folder();
493493
static AssetStorage::ptr try_load(file::ptr f);
494494

495-
guid_set get_references()
495+
std::set<Guid> get_references()
496496
{
497497
return header->references;
498498
}
@@ -553,7 +553,7 @@ class AssetManager : public Singleton<AssetManager>, public EditContainer, publi
553553

554554
AssetManager();
555555
~AssetManager();
556-
guid_map<AssetStorage::ptr> assets;
556+
std::map<Guid, AssetStorage::ptr> assets;
557557
std::mutex m;
558558
std::vector<std::function<void()>> funcs;
559559
folder_item::ptr tree_folders;
@@ -653,7 +653,7 @@ class AssetManager : public Singleton<AssetManager>, public EditContainer, publi
653653
return MessageBoxA(0, str.c_str(), "message", MB_YESNO) == IDOK;
654654
};
655655

656-
guid_map<AssetStorage::ptr> get_assets()
656+
std::map<Guid, AssetStorage::ptr> get_assets()
657657
{
658658
return assets;
659659
}
@@ -748,8 +748,11 @@ class EngineAsset
748748
auto data = Hasher::hash(convert(name));
749749

750750
std::array<unsigned char, 16> ids;
751-
for (int i = 0; i < 16; i++)
751+
for (int i = 0; i < data.size(); i++)
752752
ids[i] = data[i];
753+
754+
for (int i = data.size(); i < 16; i++)
755+
ids[i] = 0;
753756
id = Guid(ids);
754757

755758
}

0 commit comments

Comments
 (0)