mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 02:37:12 +02:00
Revert virtualpad code. It works on Pixel XL
This commit is contained in:
parent
3f49046f1c
commit
f97155b6cd
1 changed files with 61 additions and 61 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,10 +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);
|
||||
}
|
||||
|
@ -70,11 +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);
|
||||
}
|
||||
|
@ -94,16 +98,12 @@ void Basic2DWindowOpenGLDisplayPlugin::customizeContext() {
|
|||
_virtualPadJumpBtnTexture->assignStoredMip(0, image.byteCount(), image.constBits());
|
||||
_virtualPadJumpBtnTexture->setAutoGenerateMips(true);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Parent::customizeContext();
|
||||
}
|
||||
|
||||
void Basic2DWindowOpenGLDisplayPlugin::uncustomizeContext() {
|
||||
#if defined(Q_OS_ANDROID)
|
||||
_virtualPadStickTexture.reset();
|
||||
_virtualPadStickBaseTexture.reset();
|
||||
_virtualPadJumpBtnTexture.reset();
|
||||
#endif
|
||||
Parent::uncustomizeContext();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue