Qt: Fix builds without GDB stub and libpng

This commit is contained in:
Anty-Lemon 2017-04-28 12:04:27 -04:00 committed by endrift
parent a5f029c2fa
commit a861af6a97
4 changed files with 12 additions and 3 deletions

View File

@ -332,7 +332,7 @@ void GameController::setConfig(const mCoreConfig* config) {
} }
} }
#ifdef USE_GDB_STUB #ifdef USE_DEBUGGERS
mDebugger* GameController::debugger() { mDebugger* GameController::debugger() {
if (!isLoaded()) { if (!isLoaded()) {
return nullptr; return nullptr;
@ -622,8 +622,9 @@ void GameController::closeGame() {
if (!m_gameOpen) { if (!m_gameOpen) {
return; return;
} }
#ifdef USE_DEBUGGERS
setDebugger(nullptr); setDebugger(nullptr);
#endif
if (mCoreThreadIsPaused(&m_threadContext)) { if (mCoreThreadIsPaused(&m_threadContext)) {
mCoreThreadUnpause(&m_threadContext); mCoreThreadUnpause(&m_threadContext);
} }

View File

@ -86,7 +86,7 @@ public:
int stateSlot() const { return m_stateSlot; } int stateSlot() const { return m_stateSlot; }
#ifdef USE_GDB_STUB #ifdef USE_DEBUGGERS
mDebugger* debugger(); mDebugger* debugger();
void setDebugger(mDebugger*); void setDebugger(mDebugger*);
#endif #endif

View File

@ -51,7 +51,11 @@ ObjView::ObjView(GameController* controller, QWidget* parent)
connect(m_ui.magnification, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this]() { connect(m_ui.magnification, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), [this]() {
updateTiles(true); updateTiles(true);
}); });
#ifdef USE_PNG
connect(m_ui.exportButton, SIGNAL(clicked()), this, SLOT(exportObj())); connect(m_ui.exportButton, SIGNAL(clicked()), this, SLOT(exportObj()));
#else
m_ui.exportButton->setVisible(false);
#endif
} }
void ObjView::selectObj(int obj) { void ObjView::selectObj(int obj) {
@ -242,6 +246,7 @@ void ObjView::updateTilesGB(bool force) {
} }
#endif #endif
#ifdef USE_PNG
void ObjView::exportObj() { void ObjView::exportObj() {
GameController::Interrupter interrupter(m_controller); GameController::Interrupter interrupter(m_controller);
QString filename = GBAApp::app()->getSaveFileName(this, tr("Export sprite"), QString filename = GBAApp::app()->getSaveFileName(this, tr("Export sprite"),
@ -282,6 +287,7 @@ void ObjView::exportObj() {
PNGWriteClose(png, info); PNGWriteClose(png, info);
delete[] buffer; delete[] buffer;
} }
#endif
bool ObjView::ObjInfo::operator!=(const ObjInfo& other) { bool ObjView::ObjInfo::operator!=(const ObjInfo& other) {
return other.tile != tile || return other.tile != tile ||

View File

@ -21,8 +21,10 @@ Q_OBJECT
public: public:
ObjView(GameController* controller, QWidget* parent = nullptr); ObjView(GameController* controller, QWidget* parent = nullptr);
#ifdef USE_PNG
public slots: public slots:
void exportObj(); void exportObj();
#endif
private slots: private slots:
void selectObj(int); void selectObj(int);