ScummVM API documentation
GraphicsDrawer.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_GRAPHICSDRAWER_H
29#define HPL_GRAPHICSDRAWER_H
30
31#include "common/array.h"
32#include "common/list.h"
33#include "hpl1/engine/graphics/BackgroundImage.h"
34#include "hpl1/engine/graphics/GraphicsTypes.h"
35#include "hpl1/std/multiset.h"
36
37namespace hpl {
38
39class iLowLevelGraphics;
40class cResourceImage;
41class cGfxObject;
42class cMaterialHandler;
43class iMaterial;
44
46public:
47 cGfxObject *mpObject;
48 cVector3f mvTransform;
49
50 bool mbIsColorAndSize;
51 cColor mColor;
52 cVector2f mvSize;
53 bool mbFlipH = false;
54 bool mbFlipV = false;
55 float mfAngle = 0;
56
57 iMaterial *GetMaterial() const;
58 float GetZ() const { return mvTransform.z; }
59};
60
62typedef tGfxObjectVec::iterator tGfxObjectVecIt;
63
65public:
66 bool operator()(const cGfxBufferObject &aObjectA, const cGfxBufferObject &aObjectB) const;
67};
68
70typedef tGfxBufferSet::iterator tGfxBufferSetIt;
71
72class cResources;
73
76
78public:
79 cGraphicsDrawer(iLowLevelGraphics *apLowLevelGraphics, cMaterialHandler *apMaterialHandler,
80 cResources *apResources);
82
88 void DrawGfxObject(cGfxObject *apObject, const cVector3f &avPos);
89
99 void DrawGfxObject(cGfxObject *apObject, const cVector3f &avPos,
100 const cVector2f &avSize, const cColor &aColor,
101 bool abFlipH = false, bool abFlipV = false, float afAngle = 0);
102
106 void DrawAll();
107
115 cGfxObject *CreateGfxObject(const tString &asFileName, const tString &asMaterialName,
116 bool abAddToList = true);
124 cGfxObject *CreateGfxObject(Bitmap2D *apBmp, const tString &asMaterialName,
125 bool abAddToList = true);
126
127 cGfxObject *CreateGfxObjectFromTexture(const tString &asFileName, const tString &asMaterialName,
128 bool abAddToList = true);
133
134 cBackgroundImage *AddBackgroundImage(const tString &asFileName, const tString &asMaterialName,
135 const cVector3f &avPos, bool abTile,
136 const cVector2f &avSize, const cVector2f &avPosPercent, const cVector2f &avVel);
137
138 void UpdateBackgrounds();
139 void DrawBackgrounds(const cRect2f &aCollideRect);
140 void ClearBackgrounds();
141
142private:
143 iLowLevelGraphics *mpLowLevelGraphics;
144 cMaterialHandler *mpMaterialHandler;
145 cResources *mpResources;
146
147 tGfxBufferSet m_setGfxBuffer;
148
149 tGfxObjectList mlstGfxObjects;
150
151 tBackgroundImageMap m_mapBackgroundImages;
152};
153
154} // namespace hpl
155
156#endif // HPL_GRAPHICSDRAWER_H
Definition: array.h:52
T * iterator
Definition: array.h:54
Definition: str.h:59
Definition: bitmap2D.h:42
Definition: BackgroundImage.h:38
Definition: Color.h:37
Definition: GraphicsDrawer.h:64
Definition: GraphicsDrawer.h:45
Definition: GfxObject.h:38
Definition: GraphicsDrawer.h:77
void DrawGfxObject(cGfxObject *apObject, const cVector3f &avPos)
void DestroyGfxObject(cGfxObject *apObject)
cGfxObject * CreateGfxObject(const tString &asFileName, const tString &asMaterialName, bool abAddToList=true)
cGfxObject * CreateGfxObject(Bitmap2D *apBmp, const tString &asMaterialName, bool abAddToList=true)
void DrawGfxObject(cGfxObject *apObject, const cVector3f &avPos, const cVector2f &avSize, const cColor &aColor, bool abFlipH=false, bool abFlipV=false, float afAngle=0)
Definition: MaterialHandler.h:38
Definition: Resources.h:160
Definition: LowLevelGraphics.h:200
Definition: Material.h:203
Definition: list_intern.h:54