From 1a6c940ed9d7f6136da0e13148314072665342c5 Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 10 May 2011 22:28:58 +0200 Subject: - refactorized audio once more: audio is now a plugin which gets loaded at runtime - thus server has no dependency to phonon any more - remove client dependency to qtnetwork - fix enet deinitialization on windows --- pacman-c++/client/client.cpp | 11 +++++++---- pacman-c++/client/client.pro | 2 ++ pacman-c++/client/mainwidget.cpp | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'pacman-c++/client') diff --git a/pacman-c++/client/client.cpp b/pacman-c++/client/client.cpp index 96ee59a..da505d1 100644 --- a/pacman-c++/client/client.cpp +++ b/pacman-c++/client/client.cpp @@ -272,14 +272,17 @@ int main(int argc, char **argv) qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime())); + /* load sound */ AudioManager::self(); - Client client; - client.show(); - client.setWindowTitle(app.applicationName()); - + Client *client = new Client; + client->show(); + client->setWindowTitle(app.applicationName()); int ret = app.exec(); + /* delete client so that we'll disconnect from server before enet deinitialize */ + delete client; + enet_deinitialize(); /* Delete all global objects allocated by libprotobuf */ diff --git a/pacman-c++/client/client.pro b/pacman-c++/client/client.pro index 4b326fe..178ccf4 100644 --- a/pacman-c++/client/client.pro +++ b/pacman-c++/client/client.pro @@ -1,6 +1,8 @@ TEMPLATE = app TARGET = pacman +DEFINES += PACMAN_CLIENT + SOURCES += clicklabel.cpp \ client.cpp \ mainwidget.cpp diff --git a/pacman-c++/client/mainwidget.cpp b/pacman-c++/client/mainwidget.cpp index f6f088b..f2e3f46 100644 --- a/pacman-c++/client/mainwidget.cpp +++ b/pacman-c++/client/mainwidget.cpp @@ -231,7 +231,7 @@ void MainWidget::tick(ENetEvent *event) timer->setInterval(Sound::length[Sound::Intro] + Constants::tick); connect(timer, SIGNAL(timeout()), this, SLOT(startGame())); timer->start(); - AudioManager::self()->play(Sound::Intro, true); + AudioManager::self()->audioPlayer()->play(Sound::Intro); } Transmission::map_t map = Util::createUninitialisedMap(); -- cgit v1.2.3