Game :: Game( QObject* apParent ) : QObject( apParent ) { mScore = 0; mFieldBlocksCnt = 0; mpCurrentFigure = NULL; mGameLevel = 1; mIsSound = true; mIsGameOver = false; mIsAmbientMusic = true; mpAmbientMusicObject = new Phonon :: MediaObject( this ); mpBlockFallSoundObject = new Phonon :: MediaObject( this ); mpAudioAmbient = new Phonon :: AudioOutput( Phonon :: MusicCategory, this ); mpAudioSound = new Phonon :: AudioOutput( Phonon :: MusicCategory, this ); Phonon :: createPath( mpAmbientMusicObject, mpAudioAmbient ); Phonon :: createPath( mpBlockFallSoundObject, mpAudioSound ); mpAmbientMusicObject -> setCurrentSource( Phonon :: MediaSource( "Sounds/Ambient.mp3") ); mpBlockFallSoundObject -> setCurrentSource( Phonon :: MediaSource( "Sounds/Fall.wav") ); connect( mpAmbientMusicObject, SIGNAL( finished() ), SLOT( PlayAmbientMusic() ) ); connect( mpBlockFallSoundObject, SIGNAL( finished() ), SLOT( PrepairFallSound() ) ); InitializeStaticData(); CreateBorderBlocks(); mPresentFigures.clear(); for ( int i = 0; i < FIGURES_MAX_CNT; i++ ) mPresentFigures.push_back( msGameFigures[ i ] ); mpSaveFile = new QFile( SAVE_FILE, this ); mSaveStream.setDevice( mpSaveFile ); }
// #include "MapGuideCommon.h" #ifdef _WIN32 #include "windows.h" #else #include <dlfcn.h> #endif #define EXCEPTION_CLASS_CREATOR(className) \ fact->Register(MapGuide_Exception_##className, className::CreateObject); static bool InitializeStaticData(); static bool initStatic = InitializeStaticData(); bool InitializeStaticData() { MgClassFactory* fact = MgClassFactory::GetInstance(); //put in the map any class that can be serialized EXCEPTION_CLASS_CREATOR(MgAllProviderConnectionsUsedException) EXCEPTION_CLASS_CREATOR(MgAuthenticationFailedException) EXCEPTION_CLASS_CREATOR(MgConnectionFailedException) EXCEPTION_CLASS_CREATOR(MgConnectionNotOpenException) EXCEPTION_CLASS_CREATOR(MgDbException) EXCEPTION_CLASS_CREATOR(MgDbXmlException) EXCEPTION_CLASS_CREATOR(MgDuplicateGroupException) EXCEPTION_CLASS_CREATOR(MgDuplicateNameException) EXCEPTION_CLASS_CREATOR(MgDuplicateParameterException)