level.cpp 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** Confidential - Westwood Studios ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Commando *
  23. * *
  24. * $Archive:: /Commando/Code/commando/level.cpp $*
  25. * *
  26. * $Author:: Patrick $*
  27. * *
  28. * $Modtime:: 1/16/02 8:56a $*
  29. * *
  30. * $Revision:: 81 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #include "level.h"
  36. #include "combat.h"
  37. #include "pscene.h"
  38. #include "savegame.h"
  39. #include "WWAudio.H"
  40. #include "SoundScene.h"
  41. #include "gameobjmanager.h"
  42. #include "assets.h"
  43. #include "transition.h"
  44. #include "conversationmgr.h"
  45. #include "wwprofile.h"
  46. #include "phys.h"
  47. #include "rendobj.h"
  48. /*
  49. ** Release all objects and resources loaded for this level
  50. */
  51. void LevelManager::Release_Level( void )
  52. {
  53. WWPROFILE( "Release Level" );
  54. SaveGameManager::Set_Map_Filename( NULL );
  55. ConversationMgrClass::Reset_Active_Conversations ();
  56. //
  57. // Stop (and free) any currently playing sounds
  58. //
  59. WWASSERT(WWAudioClass::Get_Instance() != NULL);
  60. SoundSceneClass *sound_scene = WWAudioClass::Get_Instance ()->Get_Sound_Scene ();
  61. if( sound_scene != NULL ) {
  62. sound_scene->Flush_Scene ();
  63. }
  64. WWAudioClass::Get_Instance ()->Flush_Playlist ();
  65. GameObjManager::Destroy_All(); // Kill All Objects (including the Camera)
  66. TransitionManager::Reset();
  67. {WWPROFILE( "Scene remove" );
  68. COMBAT_SCENE->Remove_All();
  69. }
  70. {WWPROFILE( "Free assets" );
  71. WW3DAssetManager::Get_Instance()->Free_Assets();
  72. }
  73. }