THEME.H 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. /*
  2. ** Command & Conquer Red Alert(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. /* $Header: /CounterStrike/THEME.H 1 3/03/97 10:26a Joe_bostic $ */
  19. /***********************************************************************************************
  20. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Command & Conquer *
  24. * *
  25. * File Name : THEME.H *
  26. * *
  27. * Programmer : Joe L. Bostic *
  28. * *
  29. * Start Date : August 14, 1994 *
  30. * *
  31. * Last Update : August 14, 1994 [JLB] *
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef THEME_H
  37. #define THEME_H
  38. class ThemeClass
  39. {
  40. private:
  41. static char const * Theme_File_Name(ThemeType theme);
  42. int Current; // Handle to current score.
  43. ThemeType Score; // Score number currently being played.
  44. ThemeType Pending; // Score to play next.
  45. typedef struct {
  46. char const * Name; // Filename of score.
  47. int Fullname; // Text number for full score name.
  48. int Scenario; // Scenario when it first becomes available.
  49. int Duration; // Duration of theme in seconds.
  50. bool Normal; // Allowed in normal game play?
  51. bool Repeat; // Always repeat this score?
  52. bool Available; // Is the score available?
  53. int Owner; // What houses are allowed to play this theme (bit field)?
  54. } ThemeControl;
  55. static ThemeControl _themes[THEME_COUNT];
  56. enum {
  57. THEME_DELAY=TIMER_SECOND
  58. };
  59. public:
  60. ThemeClass(void);
  61. ThemeType From_Name(char const * name) const;
  62. ThemeType Next_Song(ThemeType index) const;
  63. ThemeType What_Is_Playing(void) const {return Score;}
  64. bool Is_Allowed(ThemeType index) const;
  65. bool Is_Regular(ThemeType theme) const {return(theme != THEME_NONE && _themes[theme].Normal);}
  66. char const * Base_Name(ThemeType index) const;
  67. char const * Full_Name(ThemeType index) const;
  68. int Max_Themes(void) const {return THEME_COUNT;}
  69. int Play_Song(ThemeType index);
  70. int Still_Playing(void) const;
  71. int Track_Length(ThemeType index) const;
  72. static void Scan(void);
  73. void AI(void);
  74. void Fade_Out(void) {Queue_Song(THEME_QUIET);}
  75. void Queue_Song(ThemeType index);
  76. void Set_Theme_Data(ThemeType theme, int scenario, int owners);
  77. void Stop(void);
  78. void Suspend(void);
  79. };
  80. #endif