ScummVM API documentation
gfx_context.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
* Copyright 2020 Google
21
*
22
*/
23
#ifndef HADESCH_GFX_CONTEXT_H
24
#define HADESCH_GFX_CONTEXT_H
25
26
#include "common/ptr.h"
27
#include "common/rect.h"
28
#include "graphics/managed_surface.h"
29
30
namespace
Hadesch
{
31
class
GfxContext
{
32
public
:
33
virtual
void
blitVideo(byte *sourcePixels,
int
sourcePitch,
int
sourceW,
int
sourceH,
34
byte *palette,
Common::Point
offset) = 0;
35
// Use only in pod_image.cpp because of palette format
36
virtual
void
blitPodImage(byte *sourcePixels,
int
sourcePitch,
int
sourceW,
int
sourceH,
37
byte *palette,
size_t
ncolours,
Common::Point
offset) = 0;
38
virtual
void
clear() = 0;
39
virtual
void
renderSubtitle(
const
Common::U32String
&,
Common::Point
viewPoint) = 0;
40
virtual
void
fade(
int
val) = 0;
41
virtual
void
renderToScreen(
Common::Point
viewPoint) = 0;
42
virtual
~
GfxContext
() {}
43
};
44
45
class
GfxContext8Bit
:
public
GfxContext
,
Common::NonCopyable
{
46
public
:
47
void
blitVideo(byte *sourcePixels,
int
sourcePitch,
int
sourceW,
int
sourceH,
48
byte *palette,
Common::Point
offset)
override
;
49
void
blitPodImage(byte *sourcePixels,
int
sourcePitch,
int
sourceW,
int
sourceH,
50
byte *palette,
size_t
ncolours,
Common::Point
offset)
override
;
51
void
clear()
override
;
52
void
fade(
int
val)
override
;
53
void
renderToScreen(
Common::Point
viewPoint)
override
;
54
void
renderSubtitle(
const
Common::U32String
&,
Common::Point
viewPoint)
override
;
55
byte findColor(byte r, byte g, byte b);
56
57
GfxContext8Bit
(
int
canvasW,
int
canvasH);
58
~
GfxContext8Bit
() {}
59
60
private
:
61
Graphics::ManagedSurface
surf;
62
byte _palette[256 * 4];
63
bool
_paletteUsed[256];
64
};
65
66
void
blendVideo8To8(byte *targetPixels,
int
targetPitch,
int
targetW,
int
targetH,
67
byte *sourcePixels,
int
sourceW,
int
sourceH,
Common::Point
offset);
68
69
}
70
71
#endif
Graphics::ManagedSurface
Definition:
managed_surface.h:51
Hadesch
Definition:
ambient.h:30
Common::NonCopyable
Definition:
noncopyable.h:39
Hadesch::GfxContext
Definition:
gfx_context.h:31
Common::U32String
Definition:
ustr.h:57
Common::Point
Definition:
rect.h:45
Hadesch::GfxContext8Bit
Definition:
gfx_context.h:45
engines
hadesch
gfx_context.h
Generated on Thu Nov 14 2024 09:13:24 for ScummVM API documentation by
1.8.13