ScummVM API documentation
TileSet.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_TILESET_H
29 #define HPL_TILESET_H
30 
31 #include "common/array.h"
32 #include "hpl1/engine/math/MathTypes.h"
33 #include "hpl1/engine/resources/ResourceBase.h"
34 #include "hpl1/engine/scene/TileData.h"
35 #include "hpl1/engine/system/SystemTypes.h"
36 
37 class TiXmlElement;
38 
39 namespace hpl {
40 
41 #define kMaxTileFrameWidth (9)
42 
43 typedef Common::Array<iTileData *> tTileDataVec;
44 typedef tTileDataVec::iterator tTileDataVecIt;
45 
46 class cResources;
47 
48 class cTileSet : public iResourceBase {
49 public:
50  cTileSet(tString asName, cGraphics *apGraphics, cResources *apResources);
51  ~cTileSet();
52 
53  // resource stuff:
54  bool reload() { return false; }
55  void unload() {}
56  void destroy() {}
57 
58  void Add(iTileData *apData);
59  iTileData *Get(int alNum);
60 
61  bool CreateFromFile(const tString &asFile);
62 
63 private:
64  float mfTileSize;
65  tTileDataVec mvData;
66  cResources *mpResources;
67  cGraphics *mpGraphics;
68 
69  int mlNum;
70  int mvImageHandle[eMaterialTexture_LastEnum];
71  cVector2l mvFrameSize;
72 
73  bool LoadData(TiXmlElement *pElement);
74  void GetTileNum(TiXmlElement *apElement);
75 };
76 
77 } // namespace hpl
78 
79 #endif // HPL_TILESET_H
Definition: AI.h:36
bool reload()
Definition: TileSet.h:54
Definition: str.h:59
Definition: ResourceBase.h:36
Definition: TileSet.h:48
T * iterator
Definition: array.h:54
Definition: TileData.h:53
void destroy()
Definition: TileSet.h:56
void unload()
Definition: TileSet.h:55
Definition: Resources.h:160
Definition: tinyxml.h:864
Definition: Graphics.h:46