aboutsummaryrefslogtreecommitdiff
path: root/visualization
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2022-02-28 00:54:20 -0500
committerGravatar Chris Xiong <chirs241097@gmail.com> 2022-02-28 00:56:37 -0500
commit07ee50be7c390668f8c600b8eb5805f56cf6a8a1 (patch)
tree7f91ffcd88638d4978f3d55ed26b8739e71ec253 /visualization
parent3123c15dc60de97ce1696ea1e33aeae46c9831ba (diff)
downloadQMidiPlayer-07ee50be7c390668f8c600b8eb5805f56cf6a8a1.tar.xz
Fix clipped output in rendering if video resolution > monitor resolution.
Diffstat (limited to 'visualization')
m---------visualization/SMELT0
-rw-r--r--visualization/qmpvisualization.cpp5
-rw-r--r--visualization/qmpvisualization.hpp2
3 files changed, 4 insertions, 3 deletions
diff --git a/visualization/SMELT b/visualization/SMELT
-Subproject d57232938d0c538922154e9223bf994e78c6b06
+Subproject 752937d5c647b3b30c64eba0b988f388d333676
diff --git a/visualization/qmpvisualization.cpp b/visualization/qmpvisualization.cpp
index e18426c..db896fd 100644
--- a/visualization/qmpvisualization.cpp
+++ b/visualization/qmpvisualization.cpp
@@ -149,6 +149,7 @@ void qmpVisualization::showThread()
nebuf = new smEntity3DBuffer();
tdscn = sm->smTargetCreate(wwidth * wsupersample, wheight * wsupersample, wmultisample);
tdparticles = sm->smTargetCreate(wwidth * wsupersample, wheight * wsupersample, wmultisample);
+ rdrtrg = rendermode ? sm->smTargetCreate(wwidth, wheight) : 0;
if (!api->getOptionString("Visualization/font2").length() || !font.loadTTF(api->getOptionString("Visualization/font2").c_str(), fontsize))
if (!font.loadTTF("/usr/share/fonts/truetype/freefont/FreeMono.ttf", fontsize))
if (!font.loadTTF("/usr/share/fonts/gnu-free/FreeMono.otf", fontsize))
@@ -921,7 +922,7 @@ bool qmpVisualization::update()
}
if (!flat)
updateVisualization3D();
- sm->smRenderBegin2D();
+ sm->smRenderBegin2D(false, rdrtrg);
sm->smClrscr(0xFF666666);
q.blend = BLEND_ALPHABLEND;
for (int i = 0; i < 4; ++i)
@@ -1051,7 +1052,6 @@ bool qmpVisualization::update()
font.render(xp, yp += 3 * step, 0.5, 0xFFFFFFFF, align);
font.render(xp - 1, yp - 1, 0.5, 0xFF000000, align);
}
- sm->smRenderEnd();
if (rendermode)
{
if (ctk > api->getMaxTick())
@@ -1062,6 +1062,7 @@ bool qmpVisualization::update()
framecb(fbcont, 4 * wwidth * wheight, ctk, api->getMaxTick());
}
}
+ sm->smRenderEnd();
return shouldclose;
}
diff --git a/visualization/qmpvisualization.hpp b/visualization/qmpvisualization.hpp
index c53f548..c4fcfa0 100644
--- a/visualization/qmpvisualization.hpp
+++ b/visualization/qmpvisualization.hpp
@@ -29,7 +29,7 @@ private:
smHandler *h, *closeh;
std::stack<uint32_t> pendingt[16][128], pendingv[16][128];
SMELT *sm;
- SMTRG tdscn, tdparticles;
+ SMTRG tdscn, tdparticles, rdrtrg;
SMTEX chequer, bgtex, particletex, pianotex;
smTTFont font, font2, fonthdpi;
qmpVirtualPiano3D *p3d[16];