ScummVM API documentation
cache.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#ifndef SCI_GRAPHICS_CACHE_H
23#define SCI_GRAPHICS_CACHE_H
24
25#include "common/hashmap.h"
26
27namespace Sci {
28
29class GfxFont;
30class GfxView;
31
32typedef Common::HashMap<int, GfxFont *> FontCache;
33typedef Common::HashMap<int, GfxView *> ViewCache;
34
38class GfxCache {
39public:
40 GfxCache(ResourceManager *resMan, GfxScreen *screen, GfxPalette *palette);
41 ~GfxCache();
42
43 GfxFont *getFont(GuiResourceId fontId);
44 GfxView *getView(GuiResourceId viewId);
45
46 int16 kernelViewGetCelWidth(GuiResourceId viewId, int16 loopNo, int16 celNo);
47 int16 kernelViewGetCelHeight(GuiResourceId viewId, int16 loopNo, int16 celNo);
48 int16 kernelViewGetLoopCount(GuiResourceId viewId);
49 int16 kernelViewGetCelCount(GuiResourceId viewId, int16 loopNo);
50
51private:
52 void purgeFontCache();
53 void purgeViewCache();
54
55 ResourceManager *_resMan;
56 GfxScreen *_screen;
57 GfxPalette *_palette;
58
59 FontCache _cachedFonts;
60 ViewCache _cachedViews;
61};
62
63} // End of namespace Sci
64
65#endif // SCI_GRAPHICS_CACHE_H
Definition: cache.h:38
Definition: scifont.h:37
Definition: palette16.h:41
Definition: screen.h:70
Definition: view.h:59
Definition: resource.h:327
Definition: console.h:28