ScummVM API documentation
GameItem.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
22
/*
23
* Copyright (C) 2006-2010 - Frictional Games
24
*
25
* This file is part of Penumbra Overture.
26
*/
27
28
#ifndef GAME_GAME_ITEM_H
29
#define GAME_GAME_ITEM_H
30
31
#include "hpl1/engine/engine.h"
32
#include "hpl1/penumbra-overture/GameEntity.h"
33
34
using namespace
hpl
;
35
36
//-----------------------------------------
37
38
class
cGameItem_SaveData
:
public
iGameEntity_SaveData
{
39
kSerializableClassInit(
cGameItem_SaveData
);
40
41
public
:
42
bool
mbHasBeenFlashed;
43
float
mfEnterFlashDist;
44
float
mfExitFlashDist;
45
46
iGameEntity
*CreateEntity();
47
};
48
49
//------------------------------------------
50
51
class
cGameItem_InViewRay
:
public
iPhysicsRayCallback
{
52
public
:
53
void
SetUp(
iPhysicsBody
*apSkipBody);
54
bool
OnIntersect(
iPhysicsBody
*pBody,
cPhysicsRayParams
*apParams);
55
56
bool
mbIntersected;
57
iPhysicsBody
*mpSkipBody;
58
};
59
60
//------------------------------------------
61
62
class
cGameItem
:
public
iGameEntity
{
63
typedef
iGameEntity
super
;
64
friend
class
cEntityLoader_GameItem
;
65
66
public
:
67
cGameItem
(
cInit
*apInit,
const
tString
&asName);
68
~
cGameItem
(
void
);
69
70
void
OnWorldLoad();
71
72
void
OnPlayerPick();
73
74
void
OnPlayerInteract();
75
76
void
Update(
float
afTimeStep);
77
78
void
OnPostSceneDraw();
79
80
float
GetFlashAlpha() {
return
mfFlashAlpha; }
81
82
const
tString
&GetImageFile() {
return
msImageFile; }
83
eGameItemType GetItemType() {
return
mItemType; }
84
85
bool
CanBeDropped() {
return
mbCanBeDropped; }
86
87
bool
HasCount() {
return
mbHasCount; }
88
int
GetCount() {
return
mlCount; }
89
90
tString
GetHudModelFile() {
return
msHudModelFile; }
91
tString
GetHudModelName() {
return
msHudModelName; }
92
93
// SaveObject implementation
94
iGameEntity_SaveData
*CreateSaveData();
95
void
SaveToSaveData(
iGameEntity_SaveData
*apSaveData);
96
void
LoadFromSaveData(
iGameEntity_SaveData
*apSaveData);
97
98
private
:
99
bool
IsInView(
float
afMinDist);
100
101
tString
msImageFile;
102
eGameItemType mItemType;
103
bool
mbCanBeDropped;
104
bool
mbHasCount;
105
int
mlCount;
106
107
float
mfCheckFlashCount;
108
float
mfCheckFlashMax;
109
float
mfStartFlashCount;
110
float
mfFlashAlpha;
111
float
mfFlashAlphaAdd;
112
bool
mbHasBeenFlashed;
113
float
mfEnterFlashDist;
114
float
mfExitFlashDist;
115
116
bool
mbSkipRayCheck;
117
118
cGameItem_InViewRay
mRayCallback;
119
120
tString
msHudModelFile;
121
tString
msHudModelName;
122
123
tString
msPickUpSound;
124
};
125
126
//--------------------------------------
127
128
class
cEntityLoader_GameItem
:
public
cEntityLoader_Object
{
129
130
public
:
131
cEntityLoader_GameItem
(
const
tString
&asName,
cInit
*apInit);
132
~
cEntityLoader_GameItem
();
133
134
static
eGameItemType ToItemType(
const
char
*apString);
135
136
private
:
137
void
BeforeLoad(
TiXmlElement
*apRootElem,
const
cMatrixf
&a_mtxTransform,
cWorld3D
*apWorld);
138
void
AfterLoad(
TiXmlElement
*apRootElem,
const
cMatrixf
&a_mtxTransform,
cWorld3D
*apWorld);
139
140
cInit
*mpInit;
141
};
142
143
#endif // GAME_GAME_ITEM_H
hpl
Definition:
AI.h:36
Common::String
Definition:
str.h:59
hpl::cPhysicsRayParams
Definition:
PhysicsWorld.h:92
cGameItem
Definition:
GameItem.h:62
hpl::iPhysicsRayCallback
Definition:
PhysicsWorld.h:100
iGameEntity_SaveData
Definition:
GameEntity.h:76
cGameItem_SaveData
Definition:
GameItem.h:38
hpl::iPhysicsBody
Definition:
PhysicsBody.h:117
hpl::cWorld3D
Definition:
World3D.h:179
cGameItem_InViewRay
Definition:
GameItem.h:51
hpl::cEntityLoader_Object
Definition:
EntityLoader_Object.h:52
TiXmlElement
Definition:
tinyxml.h:864
hpl::cMatrix< float >
cEntityLoader_GameItem
Definition:
GameItem.h:128
iGameEntity
Definition:
GameEntity.h:126
cInit
Definition:
Init.h:70
engines
hpl1
penumbra-overture
GameItem.h
Generated on Mon Dec 23 2024 09:14:23 for ScummVM API documentation by
1.8.13