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() {
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);
}

View File

@ -86,7 +86,7 @@ public:
int stateSlot() const { return m_stateSlot; }
#ifdef USE_GDB_STUB
#ifdef USE_DEBUGGERS
mDebugger* debugger();
void setDebugger(mDebugger*);
#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]() {
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 @@ void ObjView::updateTilesGB(bool force) {
}
#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 @@ void ObjView::exportObj() {
PNGWriteClose(png, info);
delete[] buffer;
}
#endif
bool ObjView::ObjInfo::operator!=(const ObjInfo& other) {
return other.tile != tile ||

View File

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