ScummVM API documentation
mode.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 GRAPHICS_MODE_H
23
#define GRAPHICS_MODE_H
24
25
#include "common/array.h"
26
#include "graphics/pixelformat.h"
27
28
namespace
Graphics
{
29
33
struct
Mode
{
34
int16
width
;
35
int16
height
;
36
37
Mode
(
const
int16 w,
const
int16 h) :
38
width(w),
39
height(h) {}
40
41
bool
operator<(
const
Mode
&other)
const
{
42
return
width < other.
width
&& height < other.
height
;
43
}
44
};
45
46
typedef
Common::Array<Mode>
ModeList
;
47
51
struct
ModeWithFormat
{
52
int16
width
;
53
int16
height
;
54
bool
hasFormat
;
55
Graphics::PixelFormat
format
;
56
57
ModeWithFormat
(
const
int16 w,
const
int16 h) :
58
width(w), height(h), hasFormat(false) {}
59
ModeWithFormat
(
const
int16 w,
const
int16 h,
const
Graphics::PixelFormat
&f) :
60
width
(w),
height
(h), hasFormat(
true
), format(f) {}
61
ModeWithFormat
(
const
int16 w,
const
int16 h,
const
Graphics::PixelFormat
*f) :
62
width
(w),
height
(h), hasFormat(f !=
nullptr
) {
63
if
(f !=
nullptr
)
64
format = *f;
65
}
66
};
67
68
typedef
Common::Array<ModeWithFormat>
ModeWithFormatList
;
69
70
}
71
72
#endif
Graphics::ModeWithFormat::width
int16 width
The width in pixels.
Definition:
mode.h:52
Graphics::ModeWithFormat::height
int16 height
The height in pixels.
Definition:
mode.h:53
Graphics::Mode
Definition:
mode.h:33
Common::Array
Definition:
array.h:52
Graphics::PixelFormat
Definition:
pixelformat.h:138
Graphics::ModeWithFormat
Definition:
mode.h:51
Graphics
Definition:
formatinfo.h:28
Graphics::ModeWithFormat::format
Graphics::PixelFormat format
Pixel format.
Definition:
mode.h:55
Graphics::ModeWithFormat::hasFormat
bool hasFormat
Whether pixel format is valid.
Definition:
mode.h:54
Graphics::Mode::height
int16 height
The height in pixels.
Definition:
mode.h:35
Graphics::Mode::width
int16 width
The width in pixels.
Definition:
mode.h:34
graphics
mode.h
Generated on Fri Jan 23 2026 09:18:37 for ScummVM API documentation by
1.8.13