[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: playground/games/granatier/src
From: Mathias Kraus <k.hias () gmx ! de>
Date: 2009-09-09 22:48:54
Message-ID: 1252536534.246321.8317.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1021749 by mkraus:
make granatier build with the latest gluon
M +19 -19 game.cpp
M +6 -6 game.h
M +18 -18 kapman.cpp
M +3 -3 kapman.h
--- trunk/playground/games/granatier/src/game.cpp #1021748:1021749
@@ -33,15 +33,15 @@
setSoundsEnabled(Settings::sounds());
//init KALEngine
- soundEngine = KALEngine::getInstance();
- soundSourcePutBomb = new KALSource(KALBuffer::fromOgg(KStandardDirs::locate("appdata", \
"sounds/putbomb.ogg")), soundEngine);
- soundSourceExplode = new KALSource(KALBuffer::fromOgg(KStandardDirs::locate("appdata", \
"sounds/explode.ogg")), soundEngine);
- soundSourceExplode->setGain(1);
- soundSourceBonus = new KALSource(KALBuffer::fromOgg(KStandardDirs::locate("appdata", \
"sounds/wow.ogg")), soundEngine); + soundEngine = KALEngine::instance();
+ soundPutBomb = new KALSound(new KALBuffer(KStandardDirs::locate("appdata", "sounds/putbomb.ogg")), \
soundEngine); + soundExplode = new KALSound(new KALBuffer(KStandardDirs::locate("appdata", \
"sounds/explode.ogg")), soundEngine); + soundExplode->setGain(1);
+ soundBonus = new KALSound(new KALBuffer(KStandardDirs::locate("appdata", "sounds/wow.ogg")), \
soundEngine);
soundBufferDie = new KALBuffer(KStandardDirs::locate("appdata", "sounds/die.ogg"));
soundBufferWilhelmScream = new KALBuffer(KStandardDirs::locate("appdata", \
"sounds/wilhelmscream.ogg"));
- soundSourceDie = new KALSource(soundBufferDie, soundEngine);
- soundSourceWilhelmScream = new KALSource(soundBufferWilhelmScream, soundEngine);
+ soundDie = new KALSound(soundBufferDie, soundEngine);
+ soundWilhelmScream = new KALSound(soundBufferWilhelmScream, soundEngine);
m_arena = 0;
m_gameScene = 0;
@@ -124,11 +124,11 @@
cleanUp();
- delete soundSourcePutBomb;
- delete soundSourceExplode;
- delete soundSourceBonus;
- delete soundSourceWilhelmScream;
- delete soundSourceDie;
+ delete soundPutBomb;
+ delete soundExplode;
+ delete soundBonus;
+ delete soundWilhelmScream;
+ delete soundDie;
delete soundBufferWilhelmScream;
delete soundBufferDie;
}
@@ -318,7 +318,7 @@
{
m_bonus.removeAt(m_bonus.indexOf(bonus));
//do not delete the Bonus, because the ElementItem will delete it
- soundSourceBonus->play();
+ soundBonus->play();
}
void Game::createBlock(QPointF p_position, const QString& p_imageId)
@@ -706,7 +706,7 @@
connect(bomb, SIGNAL(bombDetonated(Bomb*)), player, SLOT(slot_refillBombArmory()));
m_bombs.append(bomb);
player->decrementBombArmory();
- soundSourcePutBomb->play();
+ soundPutBomb->play();
}
void Game::removeBomb(Bomb* bomb)
@@ -724,15 +724,15 @@
void Game::slot_bombDetonated(Bomb* bomb)
{
//playSound(KStandardDirs::locate("data", "granatier/sounds/explode.ogg"));
- soundSourceExplode->setMaxGain(10);
+ soundExplode->setMaxGain(10);
- if(soundSourceExplode->elapsedTime() == 0)
+ if(soundExplode->elapsedTime() == 0)
{
- soundSourceExplode->setGain(1);
+ soundExplode->setGain(1);
}
- soundSourceExplode->play();
- soundSourceExplode->setGain(soundSourceExplode->gain()*1.2);
+ soundExplode->play();
+ soundExplode->setGain(soundExplode->gain()*1.2);
}
void Game::blockDestroyed(const int row, const int col, Block* block)
--- trunk/playground/games/granatier/src/game.h #1021748:1021749
@@ -32,7 +32,7 @@
#include <Phonon/MediaObject>
#include <KDE/KALEngine>
-#include <KDE/KALSource>
+#include <KDE/KALSound>
#include <KDE/KALBuffer>
class GameScene;
@@ -104,13 +104,13 @@
Phonon::MediaObject* m_media2;
KALEngine* soundEngine;
- KALSource* soundSourcePutBomb;
- KALSource* soundSourceExplode;
- KALSource* soundSourceBonus;
+ KALSound* soundPutBomb;
+ KALSound* soundExplode;
+ KALSound* soundBonus;
KALBuffer* soundBufferDie;
KALBuffer* soundBufferWilhelmScream;
- KALSource* soundSourceDie;
- KALSource* soundSourceWilhelmScream;
+ KALSound* soundDie;
+ KALSound* soundWilhelmScream;
bool m_gameOver;
QString m_strWinner;
--- trunk/playground/games/granatier/src/kapman.cpp #1021748:1021749
@@ -40,19 +40,19 @@
m_key.moveDown = Qt::Key_Down;
m_key.dropBomb = Qt::Key_Return;
- m_soundSourceDie = NULL;
- m_soundSourceWilhelmScream = NULL;
+ m_soundDie = NULL;
+ m_soundWilhelmScream = NULL;
}
Kapman::~Kapman()
{
- if(m_soundSourceDie)
+ if(m_soundDie)
{
- delete m_soundSourceDie;
+ delete m_soundDie;
}
- if(m_soundSourceWilhelmScream)
+ if(m_soundWilhelmScream)
{
- delete m_soundSourceWilhelmScream;
+ delete m_soundWilhelmScream;
}
}
@@ -326,41 +326,41 @@
void Kapman::setSoundDie(KALBuffer* buffer)
{
- if(m_soundSourceDie)
+ if(m_soundDie)
{
- delete m_soundSourceDie;
- m_soundSourceDie = NULL;
+ delete m_soundDie;
+ m_soundDie = NULL;
}
if(buffer)
{
- m_soundSourceDie = new KALSource(buffer, KALEngine::getInstance());
+ m_soundDie = new KALSound(buffer, KALEngine::instance());
}
}
void Kapman::setSoundWilhelmScream(KALBuffer* buffer)
{
- if(m_soundSourceWilhelmScream)
+ if(m_soundWilhelmScream)
{
- delete m_soundSourceWilhelmScream;
- m_soundSourceWilhelmScream = NULL;
+ delete m_soundWilhelmScream;
+ m_soundWilhelmScream = NULL;
}
if(buffer)
{
- m_soundSourceWilhelmScream = new KALSource(buffer, KALEngine::getInstance());
+ m_soundWilhelmScream = new KALSound(buffer, KALEngine::instance());
}
}
void Kapman::die()
{
- if(m_imageId == "player1" && m_soundSourceWilhelmScream != NULL && \
m_soundSourceWilhelmScream->elapsedTime() == 0) + if(m_imageId == "player1" && m_soundWilhelmScream != \
NULL && m_soundWilhelmScream->elapsedTime() == 0) {
- m_soundSourceWilhelmScream->play();
+ m_soundWilhelmScream->play();
}
- else if(m_imageId != "player1" && m_soundSourceDie != NULL && m_soundSourceDie->elapsedTime() == 0)
+ else if(m_imageId != "player1" && m_soundDie != NULL && m_soundDie->elapsedTime() == 0)
{
- m_soundSourceDie->play();
+ m_soundDie->play();
}
if(!m_death)
--- trunk/playground/games/granatier/src/kapman.h #1021748:1021749
@@ -23,7 +23,7 @@
#include <QKeyEvent>
#include <KDE/KALBuffer>
-#include <KDE/KALSource>
+#include <KDE/KALSound>
/**
* @brief This class represents the main character of the game.
@@ -58,8 +58,8 @@
/** Points from the player */
int m_points;
- KALSource* m_soundSourceDie;
- KALSource* m_soundSourceWilhelmScream;
+ KALSound* m_soundDie;
+ KALSound* m_soundWilhelmScream;
public:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic