From 33f33af0aaca49bd4b02a1596e2c677dbd1c4063 Mon Sep 17 00:00:00 2001 From: Leonardo Zide Date: Wed, 6 Dec 2017 22:08:56 -0800 Subject: [PATCH] iOS fixes. --- common/lc_context.cpp | 6 ++++++ common/lc_global.h | 2 +- qt/lc_renderdialog.cpp | 14 ++++++++++++-- qt/lc_renderdialog.h | 2 ++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/common/lc_context.cpp b/common/lc_context.cpp index 52290b80..54fc5770 100644 --- a/common/lc_context.cpp +++ b/common/lc_context.cpp @@ -365,6 +365,7 @@ void lcContext::SetDefaultState() } else { +#ifndef LC_OPENGLES glEnableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); @@ -374,6 +375,7 @@ void lcContext::SetDefaultState() glNormalPointer(GL_BYTE, 0, nullptr); glTexCoordPointer(2, GL_FLOAT, 0, nullptr); glColorPointer(4, GL_FLOAT, 0, nullptr); +#endif } mNormalEnabled = false; @@ -797,6 +799,7 @@ void lcContext::ClearVertexBuffer() } else { +#ifndef LC_OPENGLES if (mNormalEnabled) glDisableClientState(GL_NORMAL_ARRAY); @@ -810,6 +813,7 @@ void lcContext::ClearVertexBuffer() glNormalPointer(GL_BYTE, 0, nullptr); glTexCoordPointer(2, GL_FLOAT, 0, nullptr); glColorPointer(4, GL_FLOAT, 0, nullptr); +#endif } } @@ -974,6 +978,7 @@ void lcContext::SetVertexFormat(int BufferOffset, int PositionSize, int NormalSi } else { +#ifndef LC_OPENGLES if (mVertexBufferOffset != VertexBufferPointer) { glVertexPointer(PositionSize, GL_FLOAT, VertexSize, VertexBufferPointer); @@ -1033,6 +1038,7 @@ void lcContext::SetVertexFormat(int BufferOffset, int PositionSize, int NormalSi glDisableClientState(GL_COLOR_ARRAY); mColorEnabled = false; } +#endif } } diff --git a/common/lc_global.h b/common/lc_global.h index c6e3aa55..cf963c01 100644 --- a/common/lc_global.h +++ b/common/lc_global.h @@ -8,7 +8,7 @@ #include #include -#if !defined(EGL_VERSION_1_0) && !defined(GL_ES_VERSION_2_0) && !defined(GL_ES_VERSION_3_0) +#if !defined(EGL_VERSION_1_0) && !defined(GL_ES_VERSION_2_0) && !defined(GL_ES_VERSION_3_0) && !defined(QT_OPENGL_ES) #undef GL_LINES_ADJACENCY_EXT #undef GL_LINE_STRIP_ADJACENCY_EXT #undef GL_TRIANGLES_ADJACENCY_EXT diff --git a/qt/lc_renderdialog.cpp b/qt/lc_renderdialog.cpp index 6f766479..2f30591c 100644 --- a/qt/lc_renderdialog.cpp +++ b/qt/lc_renderdialog.cpp @@ -12,7 +12,9 @@ lcRenderDialog::lcRenderDialog(QWidget* Parent) : QDialog(Parent), ui(new Ui::lcRenderDialog) { +#ifndef QT_NO_PROCESS mProcess = nullptr; +#endif mSharedMemory.setNativeKey("leocad-povray"); ui->setupUi(this); @@ -44,9 +46,11 @@ QString lcRenderDialog::GetPOVFileName() const void lcRenderDialog::CloseProcess() { +#ifndef QT_NO_PROCESS delete mProcess; mProcess = nullptr; - +#endif + QFile::remove(GetPOVFileName()); ui->RenderButton->setText(tr("Render")); @@ -54,6 +58,7 @@ void lcRenderDialog::CloseProcess() bool lcRenderDialog::PromptCancel() { +#ifndef QT_NO_PROCESS if (mProcess) { if (QMessageBox::question(this, tr("Cancel Render"), tr("Are you sure you want to cancel the current render?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) @@ -67,7 +72,8 @@ bool lcRenderDialog::PromptCancel() else return false; } - +#endif + return true; } @@ -79,6 +85,7 @@ void lcRenderDialog::reject() void lcRenderDialog::on_RenderButton_clicked() { +#ifndef QT_NO_PROCESS if (!PromptCancel()) return; @@ -133,10 +140,12 @@ void lcRenderDialog::on_RenderButton_clicked() QMessageBox::warning(this, tr("Error"), tr("Error starting POV-Ray.")); CloseProcess(); } +#endif } void lcRenderDialog::Update() { +#ifndef QT_NO_PROCESS if (mProcess) { if (mProcess->state() == QProcess::NotRunning) @@ -152,6 +161,7 @@ void lcRenderDialog::Update() CloseProcess(); } } +#endif #ifdef Q_OS_WIN if (!mSharedMemory.isAttached() && !mSharedMemory.attach()) diff --git a/qt/lc_renderdialog.h b/qt/lc_renderdialog.h index 843a4dff..326be1a8 100644 --- a/qt/lc_renderdialog.h +++ b/qt/lc_renderdialog.h @@ -24,7 +24,9 @@ protected: void CloseProcess(); bool PromptCancel(); +#ifndef QT_NO_PROCESS QProcess* mProcess; +#endif QTimer mUpdateTimer; QSharedMemory mSharedMemory;