Some checks are pending
ContinuousDelivery / linux-ubuntu (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousDelivery / windows (push) Waiting to run
ContinuousDelivery / windows-asan (push) Waiting to run
ContinuousDelivery / dumpsyms (push) Blocked by required conditions
ContinuousDelivery / release (push) Blocked by required conditions
ContinuousIntegration / linux (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousIntegration / macos (push) Waiting to run
ContinuousIntegration / windows (push) Waiting to run
41 lines
1.1 KiB
C++
41 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include <solanaceae/object_store/fwd.hpp>
|
|
#include <solanaceae/contact/fwd.hpp>
|
|
#include <solanaceae/util/bitset.hpp>
|
|
|
|
#include "./texture_cache.hpp"
|
|
|
|
#include <entt/entity/entity.hpp>
|
|
#include <entt/entity/registry.hpp>
|
|
#include <entt/entity/handle.hpp>
|
|
|
|
#include <optional>
|
|
|
|
struct ObjectContactSub final {
|
|
ObjectHandle o;
|
|
Contact4 c{entt::null};
|
|
};
|
|
|
|
template<>
|
|
struct std::hash<ObjectContactSub> {
|
|
std::size_t operator()(ObjectContactSub const& ocs) const noexcept {
|
|
const std::size_t h1 = reinterpret_cast<std::size_t>(ocs.o.registry());
|
|
const std::size_t h2 = entt::to_integral(ocs.o.entity());
|
|
const std::size_t h3 = entt::to_integral(ocs.c);
|
|
return (h1 << 3) ^ (h3 << 7) ^ (h2 * 11400714819323198485llu);
|
|
}
|
|
};
|
|
|
|
class BitsetImageLoader {
|
|
BitSet _tmp_bitset;
|
|
|
|
std::optional<TextureEntry> haveToTexture(TextureUploaderI& tu, BitSet& have, ObjectHandle o);
|
|
|
|
public:
|
|
BitsetImageLoader(void);
|
|
TextureLoaderResult load(TextureUploaderI& tu, ObjectHandle o);
|
|
std::optional<TextureEntry> load(TextureUploaderI& tu, ObjectContactSub ocs);
|
|
};
|
|
|