ScummVM API documentation
Tile.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 HPL1 Engine.
26  */
27 
28 #ifndef HPL_TILE_H
29 #define HPL_TILE_H
30 
31 #include "common/list.h"
32 #include "hpl1/engine/graphics/GraphicsTypes.h"
33 #include "hpl1/engine/math/MathTypes.h"
34 #include "hpl1/engine/scene/TileData.h"
35 #include "hpl1/engine/system/SystemTypes.h"
36 
37 namespace hpl {
38 
39 #define eTileFlag_Breakable (eFlagBit_0)
40 
41 class cTile {
42 public:
43  cTile(iTileData *apTileData, eTileRotation aAngle,
44  const cVector3f &avPos, const cVector2f &avSize, cCollisionMesh2D *apCollMesh);
45  ~cTile();
46 
47  iTileData *GetTileData() { return mpTileData; }
48  void SetTileData(iTileData *apTileData) { mpTileData = apTileData; }
49 
50  eTileRotation GetAngle() { return mAngle; }
51 
52  void SetTile(iTileData *apTileData, eTileRotation aAngle,
53  const cVector3f &avPos, const cVector2f &avSize);
54  void SetAngle(eTileRotation aAngle) { mAngle = aAngle; }
55 
56  const cVector3f &GetPosition() const { return mvPosition; }
57  cVector3f *GetPositionPtr() { return &mvPosition; }
58 
59  cCollisionMesh2D *GetCollisionMesh() { return mpCollMesh; }
60  void SetCollisionMesh(cCollisionMesh2D *apMesh) { mpCollMesh = apMesh; }
61 
62  tFlag GetFlags() { return mlFlags; }
63  void SetFlags(tFlag alFlags) { mlFlags = alFlags; }
64 
65 private:
66  cCollisionMesh2D *mpCollMesh;
67 
68  tFlag mlFlags;
69  iTileData *mpTileData;
70  cVector3f mvPosition;
71  eTileRotation mAngle; // 0:normal. 1:90 CW. 2:180. CW 3:270 CW.
72  // 4: flip horisontally. 5: flip vertically. 6: flip both.
73 };
74 
77 
78 } // namespace hpl
79 
80 #endif // HPL_TILE_H
Definition: AI.h:36
Definition: Tile.h:41
Definition: list.h:44
Definition: TileData.h:53
Definition: Mesh2d.h:51
Definition: list_intern.h:51