SplashManager.cpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. #include "SplashManager.h"
  2. const float blood_resp = 0.50f;
  3. #include "../PostProcess/PostProcess.h"
  4. SplashManager:: SplashManager()
  5. {
  6. PostProcessService *p = (PostProcessService *)api->GetService("PostProcessService");
  7. if( p )
  8. splash = p->GetSplashFilter();
  9. else
  10. splash = null;
  11. bloodResp = 0.0f;
  12. }
  13. SplashManager::~SplashManager()
  14. {
  15. if( splash )
  16. splash->Release(this);
  17. }
  18. bool SplashManager::Create (MOPReader &reader)
  19. {
  20. InitParams(reader);
  21. Show (true);
  22. Activate(true);
  23. return true;
  24. }
  25. bool SplashManager::EditMode_Update(MOPReader &reader)
  26. {
  27. InitParams(reader);
  28. return true;
  29. }
  30. void SplashManager::Show(bool isShow)
  31. {
  32. MissionObject::Show(isShow);
  33. if( isShow )
  34. SetUpdate(&SplashManager::Draw,ML_ALPHA5);
  35. else
  36. DelUpdate(&SplashManager::Draw);
  37. }
  38. void SplashManager::Activate(bool isActive)
  39. {
  40. MissionObject::Activate(isActive);
  41. //
  42. }
  43. void _cdecl SplashManager::Draw(float dltTime, long level)
  44. {
  45. if( splash )
  46. splash->Update(this,dltTime);
  47. /* bloodResp -= dltTime;
  48. if( bloodResp < 0.0f )
  49. {
  50. bloodResp = blood_resp;
  51. AddBloodPuff();
  52. }*/
  53. }
  54. void SplashManager::Command(const char *id, dword numParams, const char **params)
  55. {
  56. //
  57. }
  58. void SplashManager::AddBloodPuff()
  59. {
  60. if( splash )
  61. splash->AddBloodPuff(this);
  62. }
  63. void SplashManager::InitParams(MOPReader &reader)
  64. {
  65. //
  66. }
  67. /*
  68. MOP_BEGINLISTCG(SplashManager, "SplashManager", '1.00', 2000, "SplashManager", "Default")
  69. MOP_ENDLIST(SplashManager)
  70. */
  71. MOP_BEGINLIST(SplashManager, "", '1.00', 2000)
  72. MOP_ENDLIST(SplashManager)