summaryrefslogtreecommitdiffstats
path: root/pacman-c++/client
diff options
context:
space:
mode:
Diffstat (limited to 'pacman-c++/client')
-rw-r--r--pacman-c++/client/client.cpp11
-rw-r--r--pacman-c++/client/client.pro2
-rw-r--r--pacman-c++/client/mainwidget.cpp2
3 files changed, 10 insertions, 5 deletions
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)
272 272
273 qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime())); 273 qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
274 274
275 /* load sound */
275 AudioManager::self(); 276 AudioManager::self();
276 277
277 Client client; 278 Client *client = new Client;
278 client.show(); 279 client->show();
279 client.setWindowTitle(app.applicationName()); 280 client->setWindowTitle(app.applicationName());
280
281 int ret = app.exec(); 281 int ret = app.exec();
282 282
283 /* delete client so that we'll disconnect from server before enet deinitialize */
284 delete client;
285
283 enet_deinitialize(); 286 enet_deinitialize();
284 287
285 /* Delete all global objects allocated by libprotobuf */ 288 /* 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 @@
1TEMPLATE = app 1TEMPLATE = app
2TARGET = pacman 2TARGET = pacman
3 3
4DEFINES += PACMAN_CLIENT
5
4SOURCES += clicklabel.cpp \ 6SOURCES += clicklabel.cpp \
5 client.cpp \ 7 client.cpp \
6 mainwidget.cpp 8 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)
231 timer->setInterval(Sound::length[Sound::Intro] + Constants::tick); 231 timer->setInterval(Sound::length[Sound::Intro] + Constants::tick);
232 connect(timer, SIGNAL(timeout()), this, SLOT(startGame())); 232 connect(timer, SIGNAL(timeout()), this, SLOT(startGame()));
233 timer->start(); 233 timer->start();
234 AudioManager::self()->play(Sound::Intro, true); 234 AudioManager::self()->audioPlayer()->play(Sound::Intro);
235 } 235 }
236 236
237 Transmission::map_t map = Util::createUninitialisedMap(); 237 Transmission::map_t map = Util::createUninitialisedMap();