ScummVM API documentation
transform_struct.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_TRANSFORM_STRUCT_H
23#define GRAPHICS_TRANSFORM_STRUCT_H
24
25#include "common/rect.h"
26
27namespace Graphics {
28
29enum TSpriteBlendMode {
30 BLEND_UNKNOWN = -1,
31 BLEND_NORMAL = 0,
32 BLEND_ADDITIVE = 1,
33 BLEND_SUBTRACTIVE = 2,
34 BLEND_MULTIPLY = 3,
35 NUM_BLEND_MODES
36};
37
38enum AlphaType {
39 ALPHA_OPAQUE = 0,
40 ALPHA_BINARY = 1,
41 ALPHA_FULL = 2
42};
43
51 FLIP_H = 1,
53 FLIP_V = 2,
58};
59
66const int32 kDefaultZoomX = 100;
67const int32 kDefaultZoomY = 100;
68const uint32 kDefaultRgbaMod = 0xFFFFFFFF;
69const int32 kDefaultHotspotX = 0;
70const int32 kDefaultHotspotY = 0;
71const int32 kDefaultOffsetX = 0;
72const int32 kDefaultOffsetY = 0;
73const int32 kDefaultAngle = 0;
74
76private:
77 void init(Common::Point zoom, uint32 angle, Common::Point hotspot, bool alphaDisable, TSpriteBlendMode blendMode, uint32 alpha, bool mirrorX, bool mirrorY, Common::Point offset);
78
79public:
80 TransformStruct(int32 zoomX, int32 zoomY, uint32 angle, int32 hotspotX, int32 hotspotY, TSpriteBlendMode blendMode, uint32 alpha, bool mirrorX = false, bool mirrorY = false, int32 offsetX = 0, int32 offsetY = 0);
81 TransformStruct(float zoomX, float zoomY, uint32 angle, int32 hotspotX, int32 hotspotY, TSpriteBlendMode blendMode, uint32 alpha, bool mirrorX = false, bool mirrorY = false, int32 offsetX = 0, int32 offsetY = 0);
82 TransformStruct(int32 zoomX, int32 zoomY, TSpriteBlendMode blendMode, uint32 alpha, bool mirrorX = false, bool mirrorY = false);
83 TransformStruct(int32 zoomX, int32 zoomY, uint32 angle, int32 hotspotX = 0, int32 hotspotY = 0);
84 TransformStruct(int32 numTimesX, int32 numTimesY);
86
89 int32 _angle;
90 byte _flip;
91 bool _alphaDisable;
92 TSpriteBlendMode _blendMode;
93 uint32 _rgbaMod;
94 Common::Point _offset;
95 int32 _numTimesX;
96 int32 _numTimesY;
97
98 bool getMirrorX() const;
99 bool getMirrorY() const;
100
101 bool operator==(const TransformStruct &compare) const {
102 return (compare._angle == _angle &&
103 compare._flip == _flip &&
104 compare._zoom == _zoom &&
105 compare._offset == _offset &&
106 compare._alphaDisable == _alphaDisable &&
107 compare._rgbaMod == _rgbaMod &&
108 compare._blendMode == _blendMode &&
109 compare._numTimesX == _numTimesX &&
110 compare._numTimesY == _numTimesY
111 );
112 }
113
114 bool operator!=(const TransformStruct &compare) const {
115 return !(compare == *this);
116 }
117};
118} // End of namespace Graphics
119#endif
Definition: formatinfo.h:28
const int32 kDefaultZoomX
Definition: transform_struct.h:66
FLIP_FLAGS
The possible flipping parameters for the blit method.
Definition: transform_struct.h:47
@ FLIP_VH
The image will be flipped at the horizontal and vertical axis.
Definition: transform_struct.h:57
@ FLIP_V
The image will be flipped at the vertical axis.
Definition: transform_struct.h:53
@ FLIP_NONE
The image will not be flipped.
Definition: transform_struct.h:49
@ FLIP_HV
The image will be flipped at the horizontal and vertical axis.
Definition: transform_struct.h:55
@ FLIP_H
The image will be flipped at the horizontal axis.
Definition: transform_struct.h:51
Definition: rect.h:144
Definition: transform_struct.h:75
uint32 _rgbaMod
RGBa.
Definition: transform_struct.h:93
int32 _angle
Rotation angle, in degrees.
Definition: transform_struct.h:89
byte _flip
Bitflag: see FLIP_XXX.
Definition: transform_struct.h:90
Common::Point _hotspot
Position of the hotspot.
Definition: transform_struct.h:88
Common::Point _zoom
Zoom; 100 = no zoom.
Definition: transform_struct.h:87