ScummVM API documentation
ImageManager.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_IMAGEMANAGER_H
29#define HPL_IMAGEMANAGER_H
30
31#include "hpl1/engine/math/MathTypes.h"
32#include "hpl1/engine/resources/ResourceManager.h"
33
34namespace hpl {
35
36class cResourceImage;
37class cFrameTexture;
38class cFrameBitmap;
39class iLowLevelGraphics;
40class Bitmap2D;
41
42typedef Common::List<cFrameBitmap *> tFrameBitmapList;
43typedef tFrameBitmapList::iterator tFrameBitmapListIt;
44
45typedef Common::StableMap<int, cFrameTexture *> tFrameTextureMap;
46typedef tFrameTextureMap::iterator tFrameTextureMapIt;
47
49public:
50 cImageManager(cFileSearcher *apFileSearcher, iLowLevelGraphics *apLowLevelGraphics,
51 LowLevelResources *apLowLevelResources, LowLevelSystem *apLowLevelSystem);
53
54 iResourceBase *Create(const tString &asName);
55
56 void Destroy(iResourceBase *apResource);
57
58 void Unload(iResourceBase *apResource);
59
60 // Image specifc
61 iResourceBase *CreateInFrame(const tString &asName, int alFrameHandle);
62 cResourceImage *CreateImage(const tString &asName, int alFrameHandle = -1);
68 int FlushAll();
69 void DeleteAllBitmapFrames();
70
71 cResourceImage *CreateFromBitmap(const tString &asName, Bitmap2D *apBmp, int alFrameHandle = -1);
72
73 int CreateFrame(cVector2l avSize);
74 void SetFrameLocked(int alHandle, bool abLocked);
75
76private:
77 iLowLevelGraphics *mpLowLevelGraphics;
78
79 tFrameBitmapList mlstBitmapFrames;
80 tFrameTextureMap m_mapTextureFrames;
81
82 tStringList mlstFileFormats;
83 cVector2l mvFrameSize;
84 int mlFrameHandle;
85
86 cResourceImage *FindImage(const tString &asName, tString &asFilePath);
87 cResourceImage *AddToFrame(Bitmap2D *apBmp, int alFrameHandle);
88 cFrameBitmap *CreateBitmapFrame(cVector2l avSize);
89};
90
91} // namespace hpl
92
93#endif // HPL_RESOURCEMANAGER_H
ListInternal::Iterator< cFrameBitmap * > iterator
Definition: list.h:52
typename TreeT::BasicIterator iterator
Definition: stablemap.h:48
Definition: str.h:59
Definition: bitmap2D.h:42
Definition: low_level_resources.h:40
Definition: low_level_system.h:95
Definition: FileSearcher.h:43
Definition: FrameBitmap.h:59
Definition: ImageManager.h:48
Definition: ResourceImage.h:43
Definition: LowLevelGraphics.h:200
Definition: ResourceBase.h:36
Definition: ResourceManager.h:52