//Initialise Particle System bool CParticleSystem::Initialise(ID3D11Device* device, std::string mFileName, std::string mFileType, std::string textureLocation) { bool result; //Texture Location std::string textureRelativePath = TextureFinder(textureLocation, mFileName, mFileType); if (FAILED(D3DX11CreateShaderResourceViewFromFile(device, textureRelativePath.c_str(), NULL, NULL, &m_Texture[0], NULL))) { //Output Error Message OutputDebugString("Unable to Load Texture: "); OutputDebugString(textureRelativePath.c_str()); OutputDebugString("\n"); return false; } //Initialise Particles in System result = InitialiseParticleSystem(); if (!result) { return false; } //Initialise Buffers result = InitialiseBuffers(device); if (!result) { return false; } return true; }
void RestartLevel() { //get the cd to start again at the beginning of the play list. ResetCDPlayForLevel(); CleanUpPheromoneSystem(); // now deallocate the module vis array DeallocateModuleVisArrays(); /* destroy the VDB list */ InitialiseVDBs(); InitialiseTxAnimBlocks(); // deallocate strategy and display blocks { int i ; i = maxstblocks; DestroyAllStrategyBlocks(); while(i--) ActiveStBlockList[i] = NULL; i = maxobjects; InitialiseObjectBlocks(); while(i --) ActiveBlockList[i] = NULL; } //stop all sound SoundSys_StopAll(); //reset the displayblock for modules to 0 { int i=2; while(MainScene.sm_module[i].m_type!=mtype_term) { MainScene.sm_module[i].m_dptr=0; i++; } } // set the Onscreenbloock lsit to zero NumOnScreenBlocks = 0; //start reinitialising stuff // InitialiseEquipment(); // InitHUD(); ProcessSystemObjects(); create_strategies_from_list (); AssignAllSBNames(); SetupVision(); InitObjectVisibilities(); InitPheromoneSystem(); InitHive(); InitSquad(); /* KJL 14:22:41 17/11/98 - reset HUD data, such as where the crosshair is, whether the Alien jaw is on-screen, and so on */ ReInitHUD(); InitialiseParticleSystem(); InitialiseSfxBlocks(); InitialiseLightElementSystem(); CreateRubberDucks(); InitialiseTriggeredFMVs(); CheckCDStatus(); /*Make sure we don't get a slow frame when we restart , since this can cause problems*/ ResetFrameCounter(); CurrentGameStats_Initialise(); MessageHistory_Initialise(); if(AvP.Network!=I_No_Network) { TeleportNetPlayerToAStartingPosition(Player->ObStrategyBlock,1); } else { //make sure the visibilities are up to date extern VIEWDESCRIPTORBLOCK* Global_VDB_Ptr; Global_VDB_Ptr->VDB_World = Player->ObWorld; AllNewModuleHandler(); DoObjectVisibilities(); } }