mirror of https://github.com/mgba-emu/mgba.git
Qt, OpenGL: Disable integer scaling for dimensions that don't fit
This commit is contained in:
parent
3920c6191f
commit
29fc787fc9
1
CHANGES
1
CHANGES
|
@ -87,6 +87,7 @@ Misc:
|
|||
- Switch: Support file associations
|
||||
- Qt: Show error message if file failed to load
|
||||
- Qt: Scale pixel color values to full range (fixes mgba.io/i/1511)
|
||||
- Qt, OpenGL: Disable integer scaling for dimensions that don't fit
|
||||
|
||||
0.7.2: (2019-05-25)
|
||||
Emulation fixes:
|
||||
|
|
|
@ -88,8 +88,12 @@ static void mGLContextResized(struct VideoBackend* v, unsigned w, unsigned h) {
|
|||
}
|
||||
}
|
||||
if (v->lockIntegerScaling) {
|
||||
drawW -= drawW % v->width;
|
||||
drawH -= drawH % v->height;
|
||||
if (drawW >= v->width) {
|
||||
drawW -= drawW % v->width;
|
||||
}
|
||||
if (drawH >= v->height) {
|
||||
drawH -= drawH % v->height;
|
||||
}
|
||||
}
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
|
|
@ -201,8 +201,12 @@ static void mGLES2ContextResized(struct VideoBackend* v, unsigned w, unsigned h)
|
|||
}
|
||||
}
|
||||
if (v->lockIntegerScaling) {
|
||||
drawW -= drawW % v->width;
|
||||
drawH -= drawH % v->height;
|
||||
if (drawW >= v->width) {
|
||||
drawW -= drawW % v->width;
|
||||
}
|
||||
if (drawH >= v->height) {
|
||||
drawH -= drawH % v->height;
|
||||
}
|
||||
}
|
||||
glBindFramebuffer(GL_FRAMEBUFFER, 0);
|
||||
glViewport((w - drawW) / 2, (h - drawH) / 2, drawW, drawH);
|
||||
|
|
|
@ -106,8 +106,12 @@ void DisplayQt::paintEvent(QPaintEvent*) {
|
|||
}
|
||||
}
|
||||
if (isIntegerScalingLocked()) {
|
||||
ds.setWidth(ds.width() - ds.width() % m_width);
|
||||
ds.setHeight(ds.height() - ds.height() % m_height);
|
||||
if (ds.width() >= m_width) {
|
||||
ds.setWidth(ds.width() - ds.width() % m_width);
|
||||
}
|
||||
if (ds.height() >= m_height) {
|
||||
ds.setHeight(ds.height() - ds.height() % m_height);
|
||||
}
|
||||
}
|
||||
QPoint origin = QPoint((s.width() - ds.width()) / 2, (s.height() - ds.height()) / 2);
|
||||
QRect full(origin, ds);
|
||||
|
|
|
@ -1962,8 +1962,12 @@ void WindowBackground::paintEvent(QPaintEvent* event) {
|
|||
}
|
||||
}
|
||||
if (m_lockIntegerScaling) {
|
||||
ds.setWidth(ds.width() - ds.width() % m_aspectWidth);
|
||||
ds.setHeight(ds.height() - ds.height() % m_aspectHeight);
|
||||
if (ds.width() >= m_aspectWidth) {
|
||||
ds.setWidth(ds.width() - ds.width() % m_aspectWidth);
|
||||
}
|
||||
if (ds.height() >= m_aspectHeight) {
|
||||
ds.setHeight(ds.height() - ds.height() % m_aspectHeight);
|
||||
}
|
||||
}
|
||||
QPoint origin = QPoint((s.width() - ds.width()) / 2, (s.height() - ds.height()) / 2);
|
||||
QRect full(origin, ds);
|
||||
|
|
Loading…
Reference in New Issue