summaryrefslogtreecommitdiffhomepage
path: root/loader/atlas-loader.inl
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-02-11 02:15:08 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-02-11 08:49:52 +0100
commit7abfbd9961072bb4e358c675d417cc8e8bb16d70 (patch)
tree0d6adff5305e35561429d9267383b88200bbd13c /loader/atlas-loader.inl
parentc6abddc2349685a9476b6838a59893a17e443d2f (diff)
wip atlas
Diffstat (limited to 'loader/atlas-loader.inl')
-rw-r--r--loader/atlas-loader.inl15
1 files changed, 8 insertions, 7 deletions
diff --git a/loader/atlas-loader.inl b/loader/atlas-loader.inl
index c1093f82..6c341ba0 100644
--- a/loader/atlas-loader.inl
+++ b/loader/atlas-loader.inl
@@ -64,7 +64,6 @@ const std::shared_ptr<ATLAS>& atlas_loader<ATLAS, TRAITS>::get_atlas(StringView
{
ensure_atlas_list();
const std::shared_ptr<Atlas>& invalid_atlas = t.atlas_of(get_invalid_atlas());
- fm_debug_assert(invalid_atlas);
switch (p)
{
@@ -122,15 +121,17 @@ const std::shared_ptr<ATLAS>& atlas_loader<ATLAS, TRAITS>::get_atlas(StringView
}
}
}
- else if (Optional<Cell> c_{t.make_cell(name)}) // todo!
+ else if (Optional<Cell> c_{t.make_cell(name)})
{
- size_t index = s.cell_array.size();
+ fm_debug_assert(t.name_of(*c_));
+ fm_debug_assert(!t.atlas_of(*c_));
+ const size_t index{s.cell_array.size()};
+ if (t.name_of(c_).isSmall())
+ t.name_of(c_) = { AllocatedInit, t.name_of(c_) };
s.cell_array.emplace_back(Utility::move(*c_));
- Cell& c = s.cell_array.back();
- fm_debug_assert(!t.name_of(c)); fm_debug_assert(!t.atlas_of(c));
+ Cell& c{s.cell_array.back()};
t.atlas_of(c) = make_atlas(name, c);
- t.name_of(c) = String{AllocatedInit, name};
- fm_debug_assert(t.name_of(c)); fm_debug_assert(t.atlas_of(c));
+ fm_debug_assert(t.atlas_of(c));
s.name_map[t.name_of(c)] = index;
return t.atlas_of(c);
}