Fixing dialogues

This commit is contained in:
Vladislav Khorev committed 2026-07-05 14:48:46 +03:00
1 parent 8a6366098c
commit 2d8f80b675
11 files changed
+3633 -6454

No files matched your search

+6 -4
View File
@@ -20,6 +20,7 @@ bool DialogueOverlay::init(Renderer& renderer, const std::string& zipFile) {
textboxTexture = renderer.textureManager.LoadFromPng("resources/dialogue/textbox_bg.png", zipFile);
textboxChoiceTexture = renderer.textureManager.LoadFromPng("resources/dialogue/DialogChoice001.png", zipFile);
textboxChoicePortraitTexture = renderer.textureManager.LoadFromPng("resources/dialogue/DialogChoicePortrait001.png", zipFile);
choiceMainTexture = renderer.textureManager.LoadFromPng("resources/dialogue/ChoiceNormal001.png", zipFile);
choiceOptionalTexture = renderer.textureManager.LoadFromPng("resources/dialogue/ChoiceNormal001.png", zipFile);
@@ -156,10 +157,11 @@ void DialogueOverlay::drawLandscape(Renderer& renderer, const PresentationModel&
if (model.mode == PresentationMode::Choice) {
const float choiceStartY = 270.f-35;
const float choiceHeight = 121.f*0.9;
const float choiceSpacing = -30.f;
const float choiceWidth = 913.f * 0.9;
float choiceStartY = 400.f - (choiceHeight + choiceSpacing) * (model.choices.size());
if (choiceQuads.size() < model.choices.size()) {
choiceQuads.resize(model.choices.size());
@@ -213,8 +215,8 @@ void DialogueOverlay::drawPortrait(Renderer& renderer, const PresentationModel&
const float H = Environment::projectionHeight;
// Panel: DialogChoice001.png scaled to full screen width, aspect ratio preserved.
const float texAspect = static_cast<float>(textboxChoiceTexture->getWidth())
/ static_cast<float>(textboxChoiceTexture->getHeight());
const float texAspect = static_cast<float>(textboxChoicePortraitTexture->getWidth())
/ static_cast<float>(textboxChoicePortraitTexture->getHeight());
const float panelW = W;
const float panelH = panelW / texAspect;
const float clipAtBottom = 18.f;
@@ -259,7 +261,7 @@ void DialogueOverlay::drawPortrait(Renderer& renderer, const PresentationModel&
renderer.LoadIdentity();
renderer.RenderUniform1f("uAlpha", 1.0f);
glBindTexture(GL_TEXTURE_2D, textboxChoiceTexture->getTexID());
glBindTexture(GL_TEXTURE_2D, textboxChoicePortraitTexture->getTexID());
renderer.DrawVertexRenderStruct(portraitPanelQuad.mesh);
if (model.portraitPath != "resources/dialogue/portrait_phone.png")
+1
View File
@@ -28,6 +28,7 @@ private:
std::shared_ptr<Texture> textboxTexture;
std::shared_ptr<Texture> textboxChoiceTexture;
std::shared_ptr<Texture> textboxChoicePortraitTexture;
std::shared_ptr<Texture> choiceMainTexture;
std::shared_ptr<Texture> choiceOptionalTexture;