forked from TheSuperHackers/GeneralsGameCode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRayEffect.h
More file actions
90 lines (70 loc) · 3.28 KB
/
RayEffect.h
File metadata and controls
90 lines (70 loc) · 3.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/*
** Command & Conquer Generals Zero Hour(tm)
** Copyright 2025 Electronic Arts Inc.
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
////////////////////////////////////////////////////////////////////////////////
// //
// (c) 2001-2003 Electronic Arts Inc. //
// //
////////////////////////////////////////////////////////////////////////////////
// FILE: RayEffect.h //////////////////////////////////////////////////////////////////////////////
// Created: Colin Day, May 2001
// Desc: Ray effect manager
///////////////////////////////////////////////////////////////////////////////////////////////////
#pragma once
// INCLUDE ////////////////////////////////////////////////////////////////////////////////////////
#include "Lib/BaseType.h"
#include "Common/SubsystemInterface.h"
// FORWARD REFERENCES /////////////////////////////////////////////////////////////////////////////
class Drawable;
//-------------------------------------------------------------------------------------------------
/** Data the ray effect system keeps for an entry */
//-------------------------------------------------------------------------------------------------
struct RayEffectData
{
const Drawable *draw; ///< the drawable
Coord3D startLoc; ///< start location for ray
Coord3D endLoc; ///< end location for ray
};
//-------------------------------------------------------------------------------------------------
/** This class maintains all the ray effects visible in the world */
//-------------------------------------------------------------------------------------------------
class RayEffectSystem : public SubsystemInterface
{
public:
RayEffectSystem();
virtual ~RayEffectSystem() override;
virtual void init() override;
virtual void reset() override;
virtual void update() override { }
/// add a ray effect entry for this drawable
void addRayEffect( const Drawable *draw, const Coord3D *startLoc, const Coord3D *endLoc );
/// given a drawable, remove its effect from the system
void deleteRayEffect( const Drawable *draw );
/** given a drawable, if it is in the ray effect system list retrieve
the ray effect data for its entry */
void getRayEffectData( const Drawable *draw, RayEffectData *effectData );
protected:
/// find an effect data entry based on the drawable
RayEffectData *findEntry( const Drawable *draw );
enum
{
MAX_RAY_EFFECTS = 128
};
RayEffectData m_effectData[ MAX_RAY_EFFECTS ]; ///< all the ray effects
};
// EXTERN /////////////////////////////////////////////////////////////////////////////////////////
extern RayEffectSystem *TheRayEffects; ///< the ray effects singleton external