Renamed AbstractFontAtlas to AbstractAtlas
Former-commit-id: 2908a05a7d2d6d44e2e29e96c52cafe962382b71
This commit is contained in:
@@ -4,8 +4,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_ABSTRACTFONTATLAS_HPP
|
||||
#define NAZARA_ABSTRACTFONTATLAS_HPP
|
||||
#ifndef NAZARA_ABSTRACTATLAS_HPP
|
||||
#define NAZARA_ABSTRACTATLAS_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/SparsePtr.hpp>
|
||||
@@ -15,13 +15,13 @@
|
||||
class NzAbstractImage;
|
||||
class NzImage;
|
||||
|
||||
class NAZARA_API NzAbstractFontAtlas
|
||||
class NAZARA_API NzAbstractAtlas
|
||||
{
|
||||
public:
|
||||
class Listener;
|
||||
|
||||
NzAbstractFontAtlas();
|
||||
virtual ~NzAbstractFontAtlas();
|
||||
NzAbstractAtlas();
|
||||
virtual ~NzAbstractAtlas();
|
||||
|
||||
void AddListener(Listener* font, void* userdata = nullptr) const;
|
||||
|
||||
@@ -39,8 +39,8 @@ class NAZARA_API NzAbstractFontAtlas
|
||||
Listener() = default;
|
||||
virtual ~Listener();
|
||||
|
||||
virtual bool OnAtlasCleared(const NzAbstractFontAtlas* atlas, void* userdata);
|
||||
virtual void OnAtlasReleased(const NzAbstractFontAtlas* atlas, void* userdata);
|
||||
virtual bool OnAtlasCleared(const NzAbstractAtlas* atlas, void* userdata);
|
||||
virtual void OnAtlasReleased(const NzAbstractAtlas* atlas, void* userdata);
|
||||
};
|
||||
|
||||
protected:
|
||||
@@ -51,4 +51,4 @@ class NAZARA_API NzAbstractFontAtlas
|
||||
bool m_listenersLocked;
|
||||
};
|
||||
|
||||
#endif // NAZARA_ABSTRACTFONTATLAS_HPP
|
||||
#endif // NAZARA_ABSTRACTATLAS_HPP
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <Nazara/Core/NonCopyable.hpp>
|
||||
#include <Nazara/Core/ResourceRef.hpp>
|
||||
#include <Nazara/Core/ResourceLoader.hpp>
|
||||
#include <Nazara/Utility/AbstractFontAtlas.hpp>
|
||||
#include <Nazara/Utility/AbstractAtlas.hpp>
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
@@ -29,9 +29,8 @@ using NzFontConstRef = NzResourceRef<const NzFont>;
|
||||
using NzFontLoader = NzResourceLoader<NzFont, NzFontParams>;
|
||||
using NzFontRef = NzResourceRef<NzFont>;
|
||||
|
||||
class NAZARA_API NzFont : public NzResource, NzAbstractFontAtlas::Listener, NzNonCopyable
|
||||
class NAZARA_API NzFont : public NzResource, NzAbstractAtlas::Listener, NzNonCopyable
|
||||
{
|
||||
friend NzAbstractFontAtlas;
|
||||
friend NzFontLoader;
|
||||
|
||||
public:
|
||||
@@ -51,7 +50,7 @@ class NAZARA_API NzFont : public NzResource, NzAbstractFontAtlas::Listener, NzNo
|
||||
|
||||
bool ExtractGlyph(unsigned int characterSize, char32_t character, nzUInt32 style, NzFontGlyph* glyph) const;
|
||||
|
||||
const NzAbstractFontAtlas* GetAtlas() const;
|
||||
const NzAbstractAtlas* GetAtlas() const;
|
||||
unsigned int GetCachedGlyphCount(unsigned int characterSize, nzUInt32 style) const;
|
||||
unsigned int GetCachedGlyphCount() const;
|
||||
NzString GetFamilyName() const;
|
||||
@@ -72,7 +71,7 @@ class NAZARA_API NzFont : public NzResource, NzAbstractFontAtlas::Listener, NzNo
|
||||
bool OpenFromMemory(const void* data, std::size_t size, const NzFontParams& params = NzFontParams());
|
||||
bool OpenFromStream(NzInputStream& stream, const NzFontParams& params = NzFontParams());
|
||||
|
||||
void SetAtlas(std::shared_ptr<NzAbstractFontAtlas> atlas);
|
||||
void SetAtlas(std::shared_ptr<NzAbstractAtlas> atlas);
|
||||
void SetGlyphBorder(unsigned int borderSize);
|
||||
void SetMinimumStepSize(unsigned int minimumSizeStep);
|
||||
|
||||
@@ -108,11 +107,11 @@ class NAZARA_API NzFont : public NzResource, NzAbstractFontAtlas::Listener, NzNo
|
||||
using GlyphMap = std::unordered_map<char32_t, Glyph>;
|
||||
|
||||
nzUInt64 ComputeKey(unsigned int characterSize, nzUInt32 style) const;
|
||||
bool OnAtlasCleared(const NzAbstractFontAtlas* atlas, void* userdata) override;
|
||||
void OnAtlasReleased(const NzAbstractFontAtlas* atlas, void* userdata) override;
|
||||
bool OnAtlasCleared(const NzAbstractAtlas* atlas, void* userdata) override;
|
||||
void OnAtlasReleased(const NzAbstractAtlas* atlas, void* userdata) override;
|
||||
const Glyph& PrecacheGlyph(GlyphMap& glyphMap, unsigned int characterSize, nzUInt32 style, char32_t character) const;
|
||||
|
||||
std::shared_ptr<NzAbstractFontAtlas> m_atlas;
|
||||
std::shared_ptr<NzAbstractAtlas> m_atlas;
|
||||
std::unique_ptr<NzFontData> m_data;
|
||||
mutable std::unordered_map<nzUInt64, std::unordered_map<nzUInt64, int>> m_kerningCache;
|
||||
mutable std::unordered_map<nzUInt64, GlyphMap> m_glyphes;
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/GuillotineBinPack.hpp>
|
||||
#include <Nazara/Utility/AbstractFontAtlas.hpp>
|
||||
#include <Nazara/Utility/AbstractAtlas.hpp>
|
||||
#include <Nazara/Utility/AbstractImage.hpp>
|
||||
#include <Nazara/Utility/Image.hpp>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class NAZARA_API NzGuillotineImageAtlas : public NzAbstractFontAtlas
|
||||
class NAZARA_API NzGuillotineImageAtlas : public NzAbstractAtlas
|
||||
{
|
||||
public:
|
||||
NzGuillotineImageAtlas();
|
||||
|
||||
Reference in New Issue
Block a user