subtitlemanager.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. *
  20. * FILE
  21. * $Archive: /Commando/Code/BinkMovie/subtitlemanager.h $
  22. *
  23. * DESCRIPTION
  24. * Subtitling manager
  25. *
  26. * PROGRAMMER
  27. * Denzil E. Long, Jr.
  28. *
  29. * VERSION INFO
  30. * $Author: Denzil_l $
  31. * $Modtime: 1/15/02 9:13p $
  32. * $Revision: 2 $
  33. *
  34. ****************************************************************************/
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef _SUBTITLEMANAGER_H_
  39. #define _SUBTITLEMANAGER_H_
  40. #include "always.h"
  41. #include <wwlib\vector.h>
  42. #include "wwstring.h"
  43. #include <windows.h>
  44. #include "render2dsentence.h"
  45. class SubTitleClass;
  46. class Surface;
  47. class SubTitleManagerClass
  48. {
  49. public:
  50. // Instantiate a subtitle manager
  51. static SubTitleManagerClass* Create(const char* filename, const char* subtitlefilename, FontCharsClass* font);
  52. // Destroy subtitle manager
  53. ~SubTitleManagerClass();
  54. // Check if there are subtitles.
  55. bool Has_Sub_Titles(void) const { return (mSubTitles != NULL); }
  56. // Reset subtitles to start
  57. void Reset(void);
  58. // Process subtitles
  59. bool Process(unsigned long movieTime);
  60. void Render();
  61. private:
  62. // Prevent direct creation
  63. SubTitleManagerClass();
  64. void Set_Font(FontCharsClass* font);
  65. bool Load_Sub_Titles(const char* moviename, const char* subtitlefilename);
  66. void Draw_Sub_Title(const SubTitleClass* subtitle);
  67. DynamicVectorClass<class SubTitleClass*>* mSubTitles;
  68. int mSubTitleIndex;
  69. SubTitleClass* mActiveSubTitle;
  70. Render2DSentenceClass Renderer;
  71. };
  72. #endif // _SUBTITLEMANAGER_H_