diff --git a/src/testgame.cpp b/src/game.cpp similarity index 93% rename from src/testgame.cpp rename to src/game.cpp index 21ed3a9..659072f 100644 --- a/src/testgame.cpp +++ b/src/game.cpp @@ -17,7 +17,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include "testgame.h" +#include "game.h" #include #include @@ -42,7 +42,7 @@ namespace toruschess { return a; } - TestGame::TestGame(QWidget *parent) + GameWidget::GameWidget(QWidget *parent) : QMainWindow(parent), m_game(new Game()), m_optionDlg(new OptionDlg(m_game, this)), m_viewMode((ViewMode) -1) { connect(this, SIGNAL(changedViewMode(ViewMode)), m_optionDlg, SLOT(changedViewMode(ViewMode))); connect(m_optionDlg, SIGNAL(setViewMode(ViewMode)), this, SLOT(setViewMode(ViewMode))); @@ -88,19 +88,19 @@ namespace toruschess { updateGeometry(); } - void TestGame::gameChanged(GameState state) { + void GameWidget::gameChanged(GameState state) { statusBar()->showMessage(state2string(state)); } - void TestGame::menuRestart() { + void GameWidget::menuRestart() { m_game->restart(); } - void TestGame::menuOptions() { + void GameWidget::menuOptions() { m_optionDlg->exec(); } - void TestGame::setViewMode(ViewMode viewMode) { + void GameWidget::setViewMode(ViewMode viewMode) { if (m_viewMode == viewMode) return; m_viewMode = viewMode; switch (m_viewMode) { @@ -122,13 +122,13 @@ namespace toruschess { emit changedViewMode(viewMode); } - void TestGame::menuView2d() { + void GameWidget::menuView2d() { setViewMode(VIEW_2D); } - void TestGame::menuView3d() { + void GameWidget::menuView3d() { setViewMode(VIEW_3D); } - void TestGame::menuViewTorus() { + void GameWidget::menuViewTorus() { setViewMode(VIEW_TORUS); } diff --git a/src/testgame.h b/src/game.h similarity index 96% rename from src/testgame.h rename to src/game.h index e158069..2879e8e 100644 --- a/src/testgame.h +++ b/src/game.h @@ -39,10 +39,10 @@ */ namespace toruschess { - class TestGame : public QMainWindow { + class GameWidget : public QMainWindow { Q_OBJECT public: - TestGame(QWidget *parent = 0); + GameWidget(QWidget *parent = 0); ViewMode viewMode() const { return m_viewMode; } diff --git a/src/main.cpp b/src/main.cpp index 44c8f17..cd94235 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -21,7 +21,7 @@ #include -#include "testgame.h" +#include "game.h" using namespace toruschess; @@ -29,8 +29,8 @@ int main(int argc, char *argv[]) { QApplication app(argc, argv); Q_INIT_RESOURCE(media); - TestGame testGame; - testGame.show(); + GameWidget game; + game.show(); return app.exec(); } diff --git a/src/src.pro b/src/src.pro index d27c832..fb3cb61 100644 --- a/src/src.pro +++ b/src/src.pro @@ -1,38 +1,18 @@ -SOURCES += main.cpp \ - testgame.cpp \ - toruschess.cpp \ - field2d.cpp \ - piecelibrary.cpp \ - field3d.cpp \ - ai.cpp \ - optiondlg.cpp TEMPLATE = app -CONFIG += warn_on \ - thread \ - qt \ - opengl \ - debug -TARGET = toruschess -DESTDIR = ../bin -RESOURCES += media.qrc - -QT += svg \ -opengl -HEADERS += testgame.h \ -toruschess.h \ - field2d.h \ - piecelibrary.h \ - field3d.h \ - ai.h \ - optiondlg.h - -LIBS += -l3ds +CONFIG += warn_on thread qt opengl debug +CONFIG -= release +QT += svg opengl QMAKE_CXXFLAGS_RELEASE += -g -CONFIG -= release +TARGET = toruschess +DESTDIR = ../bin +RESOURCES += media.qrc +SOURCES += main.cpp game.cpp toruschess.cpp field2d.cpp piecelibrary.cpp field3d.cpp ai.cpp optiondlg.cpp +HEADERS += game.h toruschess.h field2d.h piecelibrary.h field3d.h ai.h optiondlg.h FORMS += optiondlg.ui -DISTFILES += ../README +LIBS += -l3ds +DISTFILES += ../README