mirror of
https://github.com/lubosz/overte.git
synced 2025-04-14 03:06:20 +02:00
Merge remote-tracking branch 'gcgithub/android_goto_splash' into android_goto_splash
This commit is contained in:
commit
fe3c6cf8d6
4 changed files with 31 additions and 20 deletions
|
@ -2626,6 +2626,9 @@ void Application::initializeUi() {
|
|||
offscreenUi->resume();
|
||||
connect(_window, &MainWindow::windowGeometryChanged, [this](const QRect& r){
|
||||
resizeGL();
|
||||
if (_touchscreenVirtualPadDevice) {
|
||||
_touchscreenVirtualPadDevice->resize();
|
||||
}
|
||||
});
|
||||
|
||||
// This will set up the input plugins UI
|
||||
|
|
|
@ -147,20 +147,21 @@ void Basic2DWindowOpenGLDisplayPlugin::compositeExtra() {
|
|||
batch.setViewportTransform(ivec4(uvec2(0), getRecommendedRenderSize()));
|
||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||
});
|
||||
|
||||
// render stick head
|
||||
auto jumpTransform = DependencyManager::get<CompositorHelper>()->getPoint2DTransform(virtualPadManager.getJumpButtonPosition(),
|
||||
_virtualPadJumpBtnPixelSize, _virtualPadJumpBtnPixelSize);
|
||||
render([&](gpu::Batch& batch) {
|
||||
batch.enableStereo(false);
|
||||
batch.setProjectionTransform(mat4());
|
||||
batch.setPipeline(_cursorPipeline);
|
||||
batch.setResourceTexture(0, _virtualPadJumpBtnTexture);
|
||||
batch.resetViewTransform();
|
||||
batch.setModelTransform(jumpTransform);
|
||||
batch.setViewportTransform(ivec4(uvec2(0), getRecommendedRenderSize()));
|
||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||
});
|
||||
if (!virtualPadManager.getLeftVirtualPad()->isBeingTouched()) {
|
||||
// render stick head
|
||||
auto jumpTransform = DependencyManager::get<CompositorHelper>()->getPoint2DTransform(virtualPadManager.getJumpButtonPosition(),
|
||||
_virtualPadJumpBtnPixelSize, _virtualPadJumpBtnPixelSize);
|
||||
render([&](gpu::Batch& batch) {
|
||||
batch.enableStereo(false);
|
||||
batch.setProjectionTransform(mat4());
|
||||
batch.setPipeline(_cursorPipeline);
|
||||
batch.setResourceTexture(0, _virtualPadJumpBtnTexture);
|
||||
batch.resetViewTransform();
|
||||
batch.setModelTransform(jumpTransform);
|
||||
batch.setViewportTransform(ivec4(uvec2(0), getRecommendedRenderSize()));
|
||||
batch.draw(gpu::TRIANGLE_STRIP, 4);
|
||||
});
|
||||
}
|
||||
}
|
||||
#endif
|
||||
Parent::compositeExtra();
|
||||
|
|
|
@ -43,6 +43,18 @@ void TouchscreenVirtualPadDevice::init() {
|
|||
_fixedPosition = true; // This should be config
|
||||
_viewTouchUpdateCount = 0;
|
||||
|
||||
resize();
|
||||
|
||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||
|
||||
if (_fixedPosition) {
|
||||
virtualPadManager.getLeftVirtualPad()->setShown(virtualPadManager.isEnabled() && !virtualPadManager.isHidden()); // Show whenever it's enabled
|
||||
}
|
||||
|
||||
KeyboardMouseDevice::enableTouch(false); // Touch for view controls is managed by this plugin
|
||||
}
|
||||
|
||||
void TouchscreenVirtualPadDevice::resize() {
|
||||
QScreen* eventScreen = qApp->primaryScreen();
|
||||
if (_screenDPIProvided != eventScreen->physicalDotsPerInch()) {
|
||||
_screenWidthCenter = eventScreen->size().width() / 2;
|
||||
|
@ -59,12 +71,6 @@ void TouchscreenVirtualPadDevice::init() {
|
|||
|
||||
auto& virtualPadManager = VirtualPad::Manager::instance();
|
||||
setupControlsPositions(virtualPadManager, true);
|
||||
|
||||
if (_fixedPosition) {
|
||||
virtualPadManager.getLeftVirtualPad()->setShown(virtualPadManager.isEnabled() && !virtualPadManager.isHidden()); // Show whenever it's enabled
|
||||
}
|
||||
|
||||
KeyboardMouseDevice::enableTouch(false); // Touch for view controls is managed by this plugin
|
||||
}
|
||||
|
||||
void TouchscreenVirtualPadDevice::setupControlsPositions(VirtualPad::Manager& virtualPadManager, bool force) {
|
||||
|
|
|
@ -26,6 +26,7 @@ public:
|
|||
|
||||
// Plugin functions
|
||||
virtual void init() override;
|
||||
virtual void resize();
|
||||
virtual bool isSupported() const override;
|
||||
virtual const QString getName() const override { return NAME; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue