More text cleanup

This commit is contained in:
Georg Hagen
2025-03-02 19:39:34 +01:00
parent fdea7ce0ba
commit c2c19b6383
4 changed files with 10 additions and 24 deletions

View File

@@ -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)
{