Skip to content
This repository has been archived by the owner on Apr 29, 2024. It is now read-only.

Commit

Permalink
Use old font rendering code for New Horizons and older
Browse files Browse the repository at this point in the history
  • Loading branch information
Hammie committed Sep 5, 2023
1 parent 60a8613 commit 8a138f5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/libs/renderer/src/font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,14 @@ bool FONT::Init(const char *font_name, const char *iniName)
charDescriptors_[codepoint].Tuv.x1 + static_cast<float>(ltmp - 1.f) / static_cast<float>(textureSizeX_);
if (!MakeLong(&pData, &ltmp))
throw std::runtime_error("invalid font record");
charDescriptors_[codepoint].Pos.y1 =
static_cast<float>(height_ - static_cast<int32_t>(ltmp * verticalAspectRatio_));
charDescriptors_[codepoint].Pos.y2 = static_cast<float>(height_); //((int32_t)(ltmp*m_fAspectRatioV));
if (core.GetTargetEngineVersion() <= storm::ENGINE_VERSION::PIRATES_OF_THE_CARIBBEAN) {
charDescriptors_[codepoint].Pos.y2 = static_cast<float>(ltmp*verticalAspectRatio_);
}
else {
charDescriptors_[codepoint].Pos.y1 =
static_cast<float>(height_ - static_cast<int32_t>(ltmp * verticalAspectRatio_));
charDescriptors_[codepoint].Pos.y2 = static_cast<float>(height_);
}
charDescriptors_[codepoint].Tuv.y2 =
charDescriptors_[codepoint].Tuv.y1 + static_cast<float>(ltmp - 1.f) / static_cast<float>(textureSizeY_);
}
Expand Down

0 comments on commit 8a138f5

Please sign in to comment.