ScummVM API documentation
beegee.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  *
21  * Based on the original sources
22  * Faery Tale II -- The Halls of the Dead
23  * (c) 1993-1996 The Wyrmkeep Entertainment Co.
24  */
25 
26 #ifndef SAGA2_BEEGEE_H
27 #define SAGA2_BEEGEE_H
28 
29 #include "saga2/objproto.h"
30 
31 namespace Saga2 {
32 
33 enum {
34  kNoEnemy = -1,
35  kAuxThemes = 2,
36  kMaxThemes = 16
37 };
38 
39 /* ===================================================================== *
40  Types
41  * ===================================================================== */
42 
43 //-----------------------------------------------------------------------
44 // Music selection brain
45 
46 struct AuxAudioTheme {
47  bool active;
48  Location l;
49  uint32 loopID;
50 
51  AuxAudioTheme() {
52  active = false;
53  loopID = 0;
54  l = Nowhere;
55  }
56 };
57 
58 class Deejay {
59 private:
60  int _enemy;
61  bool _aggr;
62  bool _day;
63  bool _ugd;
64  bool _susp;
65 
66  int _current;
67  int _currentID;
68 public:
69 
70  uint32 _currentTheme;
71  uint32 _auxTheme;
72  Point32 _themeAt;
73 
74  int32 _lastGameTime;
75  int32 _elapsedGameTime;
76 
77  int32 _pct;
78 
79  bool _playingExternalLoop;
80 
81  int _activeFactions[kMaxFactions];
82 
83  AuxAudioTheme _aats[kAuxThemes];
84 
85  Deejay() {
86  _enemy = -1;
87  _aggr = false;
88  _day = true;
89  _susp = false;
90  _ugd = false;
91  _current = 0;
92  _currentID = 0;
93 
94  _currentTheme = 0;
95  _auxTheme = 0;
96  _lastGameTime = 0;
97  _elapsedGameTime = 0;
98  _pct = 0;
99  _playingExternalLoop = false;
100  memset(_activeFactions, 0, sizeof(_activeFactions));
101  }
102  ~Deejay() {}
103 
104 private:
105  void select();
106 
107 public:
108  void setEnemy(int16 enemyType = -1) {
109  _enemy = enemyType;
110  select();
111  }
112  void setAggression(bool aggressive) {
113  _aggr = aggressive;
114  select();
115  }
116  void setDaytime(bool daytime) {
117  _day = daytime;
118  select();
119  }
120  void setSuspend(bool suspended) {
121  _susp = suspended;
122  select();
123  }
124  void setWorld(bool underground) {
125  _ugd = underground;
126  select();
127  }
128 };
129 
130 } // end of namespace Saga2
131 
132 #endif
Definition: rect.h:184
Definition: objproto.h:105
Definition: actor.h:32
Definition: beegee.h:46
Definition: beegee.h:58