ScummVM API documentation
graphics.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 HOLLYWOOD_MONSTERS_GRAPHICS_H
23#define HOLLYWOOD_MONSTERS_GRAPHICS_H
24
25#include "common/array.h"
26#include "common/types.h"
27#include "graphics/managed_surface.h"
28#include "graphics/palette.h"
29
30#include "hollywood/resource.h"
31
32namespace Graphics {
33struct Surface;
34}
35
36namespace Hollywood {
37
38enum {
39 kPaletteSize = 0x300,
40 kSceneBufferByteCount = 0x78000,
41 kFrameDescriptorSize = 14
42};
43
52public:
54
55 void setFrom6Bit(const Common::Array<byte> &palette);
56 void markAllDirty();
57 bool upload();
58 bool uploadFrom6Bit(const Common::Array<byte> &palette);
59
60 const Graphics::Palette &palette() const { return _palette; }
61
62private:
63 Graphics::Palette _palette;
64 uint _dirtyStart;
65 uint _dirtyEnd;
66};
67
75public:
77
78 void resize(uint byteCount);
79 void clear(byte value = 0);
80
81 bool empty() const { return _surface.empty(); }
82 uint size() const { return _byteCount; }
83 byte *data();
84 const byte *data() const;
85 byte &operator[](uint offset);
86 const byte &operator[](uint offset) const;
87 Graphics::ManagedSurface &managedSurface() { return _surface; }
88 const Graphics::ManagedSurface &managedSurface() const { return _surface; }
89 Graphics::Surface &surface() { return *_surface.surfacePtr(); }
90 const Graphics::Surface &surface() const { return _surface.rawSurface(); }
91
92private:
94 uint _byteCount;
95};
96
97void presentIndexedFrame(const Graphics::Surface &framebuffer, const Common::Array<byte> &palette,
98 Graphics::ManagedSurface &screen, Palette6Bit &convertedPalette, uint rowOffset = 0, uint xOffset = 0);
99
100void copySurfaceRun(const Graphics::Surface &source, Graphics::Surface &destination, int y, int x, int width);
101void clearSurfaceRun(Graphics::Surface &destination, int y, int x, int width);
102
103void restoreSpriteBackground(const Common::Array<byte> &resource, uint32 baseOffset, uint32 descriptorTableOffset,
104 uint16 descriptorCount, uint16 descriptorIndex, const Graphics::Surface &background,
105 Graphics::Surface &destination, int yOffset = 0);
106void restoreSpriteBackground(const Common::Array<byte> &resource, uint32 baseOffset, uint32 descriptorTableOffset,
107 uint16 descriptorCount, uint16 descriptorIndex, const Graphics::ManagedSurface &background,
108 Graphics::ManagedSurface &destination, int yOffset = 0);
109void drawStripSpriteFrame(const Common::Array<byte> &resource, uint32 baseOffset, uint32 descriptorTableOffset,
110 uint16 descriptorCount, uint16 descriptorIndex, Graphics::Surface &destination, int yOffset = 0);
111void drawStripSpriteFrame(const Common::Array<byte> &resource, uint32 baseOffset, uint32 descriptorTableOffset,
112 uint16 descriptorCount, uint16 descriptorIndex, Graphics::ManagedSurface &destination, int yOffset = 0);
113void drawResourceBlockList(const Common::Array<byte> &resource, uint32 baseOffset, Graphics::Surface &destination, int yOffset = 0);
114void drawResourceBlockList(const Common::Array<byte> &resource, uint32 baseOffset, Graphics::ManagedSurface &destination, int yOffset = 0);
115
116} // End of namespace Hollywood
117
118#endif // HOLLYWOOD_MONSTERS_GRAPHICS_H
Definition: managed_surface.h:51
const Surface & rawSurface() const
Definition: managed_surface.h:195
bool empty() const
Definition: managed_surface.h:214
Simple class for handling a palette data.
Definition: palette.h:61
Definition: graphics.h:74
Definition: graphics.h:51
Definition: formatinfo.h:28
Definition: surface.h:67