mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 03:37:49 +02:00
Fix the joystick texture corruption
This commit is contained in:
parent
b0fee3fd8b
commit
1cc0a52597
1 changed files with 62 additions and 55 deletions
|
@ -28,6 +28,7 @@ void Basic2DWindowOpenGLDisplayPlugin::customizeContext() {
|
|||
qreal dpi = getFullscreenTarget()->physicalDotsPerInch();
|
||||
_virtualPadPixelSize = dpi * VirtualPad::Manager::BASE_DIAMETER_PIXELS / VirtualPad::Manager::DPI;
|
||||
|
||||
if (!_virtualPadStickTexture) {
|
||||
auto iconPath = PathUtils::resourcesPath() + "images/analog_stick.png";
|
||||
auto image = QImage(iconPath);
|
||||
if (image.format() != QImage::Format_ARGB32) {
|
||||
|
@ -48,9 +49,11 @@ void Basic2DWindowOpenGLDisplayPlugin::customizeContext() {
|
|||
_virtualPadStickTexture->assignStoredMip(0, image.byteCount(), image.constBits());
|
||||
_virtualPadStickTexture->setAutoGenerateMips(true);
|
||||
}
|
||||
}
|
||||
|
||||
iconPath = PathUtils::resourcesPath() + "images/analog_stick_base.png";
|
||||
image = QImage(iconPath);
|
||||
if (!_virtualPadStickBaseTexture) {
|
||||
auto iconPath = PathUtils::resourcesPath() + "images/analog_stick_base.png";
|
||||
auto image = QImage(iconPath);
|
||||
if (image.format() != QImage::Format_ARGB32) {
|
||||
image = image.convertToFormat(QImage::Format_ARGB32);
|
||||
}
|
||||
|
@ -69,10 +72,13 @@ void Basic2DWindowOpenGLDisplayPlugin::customizeContext() {
|
|||
_virtualPadStickBaseTexture->assignStoredMip(0, image.byteCount(), image.constBits());
|
||||
_virtualPadStickBaseTexture->setAutoGenerateMips(true);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
_virtualPadJumpBtnPixelSize = dpi * VirtualPad::Manager::JUMP_BTN_FULL_PIXELS / VirtualPad::Manager::DPI;
|
||||
iconPath = PathUtils::resourcesPath() + "images/fly.png";
|
||||
image = QImage(iconPath);
|
||||
if (!_virtualPadJumpBtnTexture) {
|
||||
auto iconPath = PathUtils::resourcesPath() + "images/fly.png";
|
||||
auto image = QImage(iconPath);
|
||||
if (image.format() != QImage::Format_ARGB32) {
|
||||
image = image.convertToFormat(QImage::Format_ARGB32);
|
||||
}
|
||||
|
@ -92,6 +98,7 @@ void Basic2DWindowOpenGLDisplayPlugin::customizeContext() {
|
|||
_virtualPadJumpBtnTexture->assignStoredMip(0, image.byteCount(), image.constBits());
|
||||
_virtualPadJumpBtnTexture->setAutoGenerateMips(true);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Parent::customizeContext();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue