- Esc exits fullscreen on macx.

- Drop OpenAL from default macx binary.
- Add some useful but commented build flags for macx to .pro files.


git-svn-id: https://gambatte.svn.sourceforge.net/svnroot/gambatte@224 9dfb2916-2d38-0410-aef4-c5fe6c9ffc24
This commit is contained in:
sinamas 2009-01-10 21:52:05 +00:00
parent 692b98eb12
commit 0bc8c18794
6 changed files with 42 additions and 18 deletions

View File

@ -18,10 +18,10 @@
***************************************************************************/
#include "addaudioengines.h"
#include "audioengines/openalengine.h"
//#include "audioengines/openalengine.h"
#include "audioengines/coreaudioengine.h"
void addAudioEngines(std::vector<AudioEngine*> &audioEngines, WId /*winId*/) {
audioEngines.push_back(new CoreAudioEngine);
audioEngines.push_back(new OpenAlEngine);
// audioEngines.push_back(new OpenAlEngine);
}

View File

@ -70,21 +70,27 @@ INCLUDEPATH += $$COMMONPATH
DEFINES += HAVE_STDINT_H
QMAKE_CXXFLAGS += -fno-exceptions -fno-rtti
macx {
macx {
# CONFIG += x86 ppc
# QMAKE_CFLAGS += -Xarch_ppc -DWORDS_BIGENDIAN
# QMAKE_CXXFLAGS += -fvisibility=hidden -Xarch_ppc -DWORDS_BIGENDIAN
# QMAKE_MAC_SDK = /Developer/SDKs/MacOSX10.4u.sdk
# QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.3
HEADERS += $$COMMONPATH/ringbuffer.h
SOURCES += framework/addaudioengines_macx.cpp \
framework/addblitterwidgets.cpp \
framework/getfullmodetoggler_macx.cpp
SOURCES += framework/SDL_Joystick/src/darwin/SDL_sysjoystick.c \
framework/audioengines/openalengine.cpp \
# framework/audioengines/openalengine.cpp \
framework/audioengines/coreaudioengine.cpp \
framework/fullmodetogglers/quartztoggler.cpp
HEADERS += framework/audioengines/openalengine.h \
framework/audioengines/coreaudioengine.h \
HEADERS += framework/audioengines/coreaudioengine.h \
# framework/audioengines/openalengine.h \
framework/fullmodetogglers/quartztoggler.h
# LIBS += -dead_strip
LIBS += -framework IOKit \
-framework AudioUnit \
-framework OpenAL
# -framework OpenAL \
-framework AudioUnit
}
else:unix {
DEFINES += PLATFORM_UNIX

View File

@ -321,16 +321,11 @@ void MainWindow::toggleFullScreen() {
}
void MainWindow::toggleMenuHidden() {
#ifdef Q_WS_MAC
// if (isFullScreen())
// toggleFullScreen();
#else
menuBar()->setVisible(!menuBar()->isVisible());
if (!menuBar()->isVisible()) {
hideCursor();
}
#endif
}
void MainWindow::clearInputVectors() {

View File

@ -154,7 +154,10 @@ mw(mw), source(source), frameTime(4389, 262144) {
settingsm->addSeparator();
{
QAction *fsAct = settingsm->addAction(tr("&Full Screen"), mw, SLOT(toggleFullScreen()), tr("Ctrl+F"));
#ifndef Q_WS_MAC
QAction *fsAct;
#endif
fsAct = settingsm->addAction(tr("&Full Screen"), mw, SLOT(toggleFullScreen()), tr("Ctrl+F"));
fsAct->setCheckable(true);
}
@ -171,10 +174,16 @@ mw(mw), source(source), frameTime(4389, 262144) {
mw->addActions(mw->menuBar()->actions());
QAction *hideMenuAct = new QAction(mw);
hideMenuAct->setShortcut(tr("Esc"));
connect(hideMenuAct, SIGNAL(triggered()), mw, SLOT(toggleMenuHidden()));
mw->addAction(hideMenuAct);
{
QAction *const escAct = new QAction(mw);
escAct->setShortcut(tr("Esc"));
#ifdef Q_WS_MAC
connect(escAct, SIGNAL(triggered()), this, SLOT(unsetFullScreen()));
#else
connect(escAct, SIGNAL(triggered()), mw, SLOT(toggleMenuHidden()));
#endif
mw->addAction(escAct);
}
mw->setFrameTime(frameTime.get().num, frameTime.get().denom);
mw->setSamplesPerFrame(35112);
@ -406,3 +415,10 @@ void GambatteMenuHandler::resetFrameRate() {
decFrameRateAction->setEnabled(true);
mw->setFrameTime(frameTime.get().num, frameTime.get().denom);
}
#ifdef Q_WS_MAC
void GambatteMenuHandler::unsetFullScreen() {
if (fsAct->isChecked())
fsAct->trigger();
}
#endif

View File

@ -81,6 +81,9 @@ class GambatteMenuHandler : public QObject {
QAction *decFrameRateAction;
QAction *incFrameRateAction;
QAction *forceDmgAction;
#ifdef Q_WS_MAC
QAction *fsAct;
#endif
QMenu *recentMenu;
QMenu *stateSlotMenu;
PaletteDialog *globalPaletteDialog;
@ -112,6 +115,9 @@ private slots:
void decFrameRate();
void incFrameRate();
void resetFrameRate();
#ifdef Q_WS_MAC
void unsetFullScreen();
#endif
public:
GambatteMenuHandler(MainWindow *mw, GambatteSource *source, int argc, const char *const argv[]);

View File

@ -12,6 +12,7 @@ TEMPLATE = app
CONFIG += warn_on \
release
TARGET = gambatte_qt
macx:TARGET = "Gambatte Qt"
DESTDIR = ../bin
INCLUDEPATH += ../../libgambatte/include
LIBS += -L../../libgambatte -lgambatte