Qt: Fix builds without GDB stub and libpng
Anty-Lemon Anty-Lemon@users.noreply.github.com
Fri, 28 Apr 2017 12:04:27 -0400
4 files changed,
12 insertions(+),
3 deletions(-)
M
src/platform/qt/GameController.cpp
→
src/platform/qt/GameController.cpp
@@ -332,7 +332,7 @@ m_audioProcessor->setInput(&m_threadContext);
} } -#ifdef USE_GDB_STUB +#ifdef USE_DEBUGGERS mDebugger* GameController::debugger() { if (!isLoaded()) { return nullptr;@@ -622,8 +622,9 @@ void GameController::closeGame() {
if (!m_gameOpen) { return; } - +#ifdef USE_DEBUGGERS setDebugger(nullptr); +#endif if (mCoreThreadIsPaused(&m_threadContext)) { mCoreThreadUnpause(&m_threadContext); }
M
src/platform/qt/GameController.h
→
src/platform/qt/GameController.h
@@ -86,7 +86,7 @@ void setConfig(const mCoreConfig*);
int stateSlot() const { return m_stateSlot; } -#ifdef USE_GDB_STUB +#ifdef USE_DEBUGGERS mDebugger* debugger(); void setDebugger(mDebugger*); #endif
M
src/platform/qt/ObjView.cpp
→
src/platform/qt/ObjView.cpp
@@ -51,7 +51,11 @@ connect(m_ui.objId, SIGNAL(valueChanged(int)), this, SLOT(selectObj(int)));
connect(m_ui.magnification, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this]() { updateTiles(true); }); +#ifdef USE_PNG connect(m_ui.exportButton, SIGNAL(clicked()), this, SLOT(exportObj())); +#else + m_ui.exportButton->setVisible(false); +#endif } void ObjView::selectObj(int obj) {@@ -242,6 +246,7 @@ m_ui.mode->setText(tr("N/A"));
} #endif +#ifdef USE_PNG void ObjView::exportObj() { GameController::Interrupter interrupter(m_controller); QString filename = GBAApp::app()->getSaveFileName(this, tr("Export sprite"),@@ -282,6 +287,7 @@ PNGWritePixels8(png, m_objInfo.width * 8, m_objInfo.height * 8, m_objInfo.width * 8, static_cast<void*>(buffer));
PNGWriteClose(png, info); delete[] buffer; } +#endif bool ObjView::ObjInfo::operator!=(const ObjInfo& other) { return other.tile != tile ||
M
src/platform/qt/ObjView.h
→
src/platform/qt/ObjView.h
@@ -21,8 +21,10 @@
public: ObjView(GameController* controller, QWidget* parent = nullptr); +#ifdef USE_PNG public slots: void exportObj(); +#endif private slots: void selectObj(int);