More text cleanup
This commit is contained in:
@@ -23,8 +23,9 @@ namespace OpenVulkano::Scene
|
||||
Shader DEFAULT_SHADER_SDF = TextDrawable::MakeDefaultShader(FontAtlasType::SDF);
|
||||
Shader DEFAULT_SHADER_MSDF = TextDrawable::MakeDefaultShader(FontAtlasType::MSDF);
|
||||
|
||||
void HandleSpecialCharacter(const std::map<uint32_t, GlyphInfo>& symbols, uint32_t c, float heightBetweenLines,
|
||||
float initialPosX, float& cursorX, float& cursorY, float& prevGlyphXBound)
|
||||
void HandleSpecialCharacter(const std::map<uint32_t, GlyphInfo>& symbols, uint32_t c,
|
||||
const float heightBetweenLines, const float initialPosX,
|
||||
float& cursorX, float& cursorY, float& prevGlyphXBound)
|
||||
{
|
||||
if (c == '\n')
|
||||
{
|
||||
@@ -80,16 +81,6 @@ namespace OpenVulkano::Scene
|
||||
: Drawable(DrawEncoder::GetDrawEncoder<TextDrawable>()), m_cfg(config)
|
||||
{}
|
||||
|
||||
TextDrawable::TextDrawable(const std::string& atlasMetadataFile, const TextConfig& config)
|
||||
: TextDrawable(Utils::ReadFile(atlasMetadataFile), config)
|
||||
{}
|
||||
|
||||
TextDrawable::TextDrawable(const Array<char>& atlasMetadata, const TextConfig& config)
|
||||
: Drawable(DrawEncoder::GetDrawEncoder<TextDrawable>()), m_cfg(config)
|
||||
{
|
||||
m_atlasData = std::make_shared<FontAtlas>(atlasMetadata);
|
||||
}
|
||||
|
||||
TextDrawable::TextDrawable(const std::shared_ptr<FontAtlas>& atlasData, const TextConfig& config)
|
||||
: Drawable(DrawEncoder::GetDrawEncoder<TextDrawable>()), m_atlasData(atlasData), m_cfg(config)
|
||||
{
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "Drawable.hpp"
|
||||
#include "Texture.hpp"
|
||||
#include "VertexBuffer.hpp"
|
||||
#include "Image/Image.hpp"
|
||||
#include "Text/FontAtlas.hpp"
|
||||
|
||||
namespace OpenVulkano::Scene
|
||||
@@ -47,8 +46,6 @@ namespace OpenVulkano::Scene
|
||||
|
||||
public:
|
||||
TextDrawable(const TextConfig& config = TextConfig());
|
||||
TextDrawable(const std::string& atlasMetadataFile, const TextConfig& config = TextConfig());
|
||||
TextDrawable(const Array<char>& atlasMetadata, const TextConfig& config = TextConfig());
|
||||
TextDrawable(const std::shared_ptr<FontAtlas>& atlasData, const TextConfig& config = TextConfig());
|
||||
|
||||
void GenerateText(const std::string& text, const Math::Vector2f& pos = Math::Vector2f(0.f), float scale = 1.0f);
|
||||
@@ -61,7 +58,7 @@ namespace OpenVulkano::Scene
|
||||
[[nodiscard]] const std::shared_ptr<FontAtlas>& GetAtlasData() { return m_atlasData; }
|
||||
|
||||
[[nodiscard]] VertexBuffer* GetVertexBuffer() { return &m_vertexBuffer; }
|
||||
[[nodiscard]] Texture* GetTexture() { return m_atlasData->GetTexture(); }
|
||||
[[nodiscard]] Texture* GetTexture() const { return m_atlasData->GetTexture(); }
|
||||
[[nodiscard]] size_t GetSymbolCount() const { return m_symbolCount; }
|
||||
|
||||
[[nodiscard]] static Shader MakeDefaultShader(FontAtlasType type);
|
||||
|
||||
Reference in New Issue
Block a user