Utility: Replace UInt32 by TextStyleFlags

This commit is contained in:
Lynix
2019-04-13 13:09:53 +02:00
parent e665ea5373
commit 0582cbfc26
9 changed files with 52 additions and 40 deletions

View File

@@ -16,6 +16,7 @@
#include <Nazara/Core/ResourceLoader.hpp>
#include <Nazara/Core/ResourceParameters.hpp>
#include <Nazara/Utility/AbstractAtlas.hpp>
#include <Nazara/Utility/Enums.hpp>
#include <memory>
#include <unordered_map>
@@ -58,14 +59,14 @@ namespace Nz
bool Create(FontData* data);
void Destroy();
bool ExtractGlyph(unsigned int characterSize, char32_t character, UInt32 style, FontGlyph* glyph) const;
bool ExtractGlyph(unsigned int characterSize, char32_t character, TextStyleFlags style, FontGlyph* glyph) const;
const std::shared_ptr<AbstractAtlas>& GetAtlas() const;
std::size_t GetCachedGlyphCount(unsigned int characterSize, UInt32 style) const;
std::size_t GetCachedGlyphCount(unsigned int characterSize, TextStyleFlags style) const;
std::size_t GetCachedGlyphCount() const;
String GetFamilyName() const;
int GetKerning(unsigned int characterSize, char32_t first, char32_t second) const;
const Glyph& GetGlyph(unsigned int characterSize, UInt32 style, char32_t character) const;
const Glyph& GetGlyph(unsigned int characterSize, TextStyleFlags style, char32_t character) const;
unsigned int GetGlyphBorder() const;
unsigned int GetMinimumStepSize() const;
const SizeInfo& GetSizeInfo(unsigned int characterSize) const;
@@ -73,8 +74,8 @@ namespace Nz
bool IsValid() const;
bool Precache(unsigned int characterSize, UInt32 style, char32_t character) const;
bool Precache(unsigned int characterSize, UInt32 style, const String& characterSet) const;
bool Precache(unsigned int characterSize, TextStyleFlags style, char32_t character) const;
bool Precache(unsigned int characterSize, TextStyleFlags style, const String& characterSet) const;
void SetAtlas(const std::shared_ptr<AbstractAtlas>& atlas);
void SetGlyphBorder(unsigned int borderSize);
@@ -130,11 +131,11 @@ namespace Nz
private:
using GlyphMap = std::unordered_map<char32_t, Glyph>;
UInt64 ComputeKey(unsigned int characterSize, UInt32 style) const;
UInt64 ComputeKey(unsigned int characterSize, TextStyleFlags style) const;
void OnAtlasCleared(const AbstractAtlas* atlas);
void OnAtlasLayerChange(const AbstractAtlas* atlas, AbstractImage* oldLayer, AbstractImage* newLayer);
void OnAtlasRelease(const AbstractAtlas* atlas);
const Glyph& PrecacheGlyph(GlyphMap& glyphMap, unsigned int characterSize, UInt32 style, char32_t character) const;
const Glyph& PrecacheGlyph(GlyphMap& glyphMap, unsigned int characterSize, TextStyleFlags style, char32_t character) const;
static bool Initialize();
static void Uninitialize();