ScummVM API documentation
resource_he.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 SCUMM_HE_RESOURCE_HE_H
23 #define SCUMM_HE_RESOURCE_HE_H
24 
25 #include "common/macresman.h"
26 
27 namespace Common {
28 class PEResources;
29 }
30 
31 namespace Scumm {
32 
33 class ScummEngine_v70he;
34 
35 class ResExtractor {
36 public:
38  virtual ~ResExtractor();
39 
40  void setCursor(int id);
41 
42 protected:
43  struct CachedCursor {
44  bool valid;
45  int id;
46  byte *bitmap;
47  int width, height;
48  int hotspotX, hotspotY;
49  uint32 lastUsed;
50  byte *palette;
51  int palSize;
52  };
53 
54  Common::Path _fileName;
55  ScummEngine_v70he *_vm;
56 
57  virtual bool extractResource(int id, CachedCursor *cc) = 0;
58 
59 private:
60  enum {
61  MAX_CACHED_CURSORS = 10
62  };
63 
64  ResExtractor::CachedCursor *findCachedCursor(int id);
65  ResExtractor::CachedCursor *getCachedCursorSlot();
66 
67  CachedCursor _cursorCache[MAX_CACHED_CURSORS];
68 };
69 
71 public:
73  ~Win32ResExtractor() override;
74 
75 private:
76  Common::PEResources *_exe;
77 
78  bool extractResource(int id, CachedCursor *cc) override;
79 };
80 
81 class MacResExtractor : public ResExtractor {
82 public:
84  ~MacResExtractor() override {}
85 
86 private:
87  Common::MacResManager *_resMgr;
88 
89  bool extractResource(int id, CachedCursor *cc) override;
90 };
91 
92 } // End of namespace Scumm
93 
94 #endif
Definition: macresman.h:125
Definition: resource_he.h:43
Definition: winexe_pe.h:48
Definition: resource_he.h:81
Definition: path.h:52
Definition: intern_he.h:147
Definition: resource_he.h:70
Definition: algorithm.h:29
Definition: resource_he.h:35
Definition: actor.h:30