Richard Boegli's CnC_Generals_Zero_Hour Fork
WIP
This is documentation of Richard Boegil's Zero Hour Fork
Loading...
Searching...
No Matches
animatedsoundmgr.h
Go to the documentation of this file.
1
/*
2
** Command & Conquer Generals Zero Hour(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
*** 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 : ww3d2 *
24
* *
25
* $Archive:: /Commando/Code/ww3d2/animatedsoundmgr.h $*
26
* *
27
* Author:: Patrick Smith *
28
* *
29
* $Modtime:: 12/13/01 6:05p $*
30
* *
31
* $Revision:: 2 $*
32
* *
33
*---------------------------------------------------------------------------------------------*
34
* Functions: *
35
* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
36
//
37
// MBL Update for CNC3 INCURSION - 10.23.2002 - Expanded param handling, Added STOP command
38
//
39
40
#if defined(_MSC_VER)
41
#pragma once
42
#endif
43
44
#ifndef __ANIMATEDSOUNDMGR_H
45
#define __ANIMATEDSOUNDMGR_H
46
47
#include "
simplevec.h
"
48
#include "vector.h"
49
#include "
hashtemplate.h
"
50
51
53
// Forward declarations
55
class
HTreeClass
;
56
class
HAnimClass
;
57
class
Matrix3D
;
58
class
SoundLibraryBridgeClass
;
59
61
//
62
// AnimatedSoundMgrClass
63
//
65
class
AnimatedSoundMgrClass
66
{
67
public
:
68
70
// Public methods
72
73
//
74
// Initialization and shutdown
75
//
76
static
void
Initialize
(
const
char
*ini_filename =
NULL
);
77
static
void
Shutdown
(
void
);
78
79
//
80
// Sound playback
81
//
82
static
const
char
*
Get_Embedded_Sound_Name
(
HAnimClass
*anim);
83
static
float
Trigger_Sound
(
HAnimClass
*anim,
float
old_frame,
float
new_frame,
const
Matrix3D
&tm);
84
85
// Bridges E&B code with WW3D.
86
static
void
Set_Sound_Library
(
SoundLibraryBridgeClass
* library);
87
88
private
:
89
91
// Private data types
93
struct
AnimSoundInfo
94
{
95
AnimSoundInfo() : Frame(0), SoundName(), Is2D(
false
), IsStop(
false
) {}
96
int
Frame;
97
StringClass
SoundName;
98
bool
Is2D;
99
bool
IsStop;
100
};
101
102
typedef
AnimSoundInfo ANIM_SOUND_INFO;
103
104
struct
AnimSoundList
105
{
106
AnimSoundList() :
List
(), BoneName(
"root"
) {}
107
~AnimSoundList()
108
{
109
for
(
int
i = 0; i <
List
.Count(); i++) {
110
delete
List
[i];
111
}
112
}
113
void
Add_Sound_Info(ANIM_SOUND_INFO* info) {
List
.
Add
(info);}
114
115
SimpleDynVecClass<ANIM_SOUND_INFO*>
List
;
116
StringClass
BoneName;
117
};
118
119
typedef
AnimSoundList ANIM_SOUND_LIST;
120
122
// Private member data
124
static
HashTemplateClass<StringClass, ANIM_SOUND_LIST *>
AnimationNameHash;
125
static
DynamicVectorClass<ANIM_SOUND_LIST *>
AnimSoundLists;
126
127
static
SoundLibraryBridgeClass
* SoundLibrary;
128
130
// Private methods
132
static
ANIM_SOUND_LIST * Find_Sound_List (
HAnimClass
*anim);
133
};
134
135
136
#endif
//__ANIMATEDSOUNDMGR_H
NULL
#define NULL
Definition
BaseType.h:92
AnimatedSoundMgrClass
Definition
animatedsoundmgr.h:66
AnimatedSoundMgrClass::Shutdown
static void Shutdown(void)
Definition
animatedsoundmgr.cpp:408
AnimatedSoundMgrClass::Set_Sound_Library
static void Set_Sound_Library(SoundLibraryBridgeClass *library)
Definition
animatedsoundmgr.cpp:562
AnimatedSoundMgrClass::Initialize
static void Initialize(const char *ini_filename=NULL)
Definition
animatedsoundmgr.cpp:246
AnimatedSoundMgrClass::Get_Embedded_Sound_Name
static const char * Get_Embedded_Sound_Name(HAnimClass *anim)
Definition
animatedsoundmgr.cpp:439
AnimatedSoundMgrClass::Trigger_Sound
static float Trigger_Sound(HAnimClass *anim, float old_frame, float new_frame, const Matrix3D &tm)
Definition
animatedsoundmgr.cpp:488
DynamicVectorClass
Definition
Vector.H:474
HAnimClass
Definition
hanim.h:76
HTreeClass
Definition
htree.h:75
HashTemplateClass
Definition
hashtemplate.h:75
List
Definition
list.h:60
List::Add
void Add(ListNode *node)
Definition
list.cpp:184
Matrix3D
Definition
matrix3d.h:133
SimpleDynVecClass
Definition
simplevec.h:256
SoundLibraryBridgeClass
Definition
soundlibrarybridge.h:42
StringClass
Definition
wwstring.h:72
hashtemplate.h
simplevec.h
Code
Libraries
Source
WWVegas
WW3D2
animatedsoundmgr.h
Generated by
1.13.2