ResidualVM logo ResidualVM website - Forums - Contact us BuildBot - Doxygen - Wiki curved edge

transform_struct.cpp

Go to the documentation of this file.
00001 /* ScummVM - Graphic Adventure Engine
00002  *
00003  * ScummVM is the legal property of its developers, whose names
00004  * are too numerous to list here. Please refer to the COPYRIGHT
00005  * file distributed with this source distribution.
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation; either version 2
00010  * of the License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00020  *
00021  */
00022 
00023 #include "graphics/transform_struct.h"
00024 #include "graphics/transparent_surface.h"
00025 
00026 namespace Graphics {
00027 
00028 void TransformStruct::init(Common::Point zoom, uint32 angle, Common::Point hotspot, bool alphaDisable, TSpriteBlendMode blendMode, uint32 rgbaMod, bool mirrorX, bool mirrorY, Common::Point offset) {
00029     _zoom = zoom;
00030     _angle = angle;
00031     _hotspot = hotspot;
00032     _blendMode = blendMode;
00033     _rgbaMod = rgbaMod;
00034     _alphaDisable = alphaDisable;
00035     _flip = 0;
00036     _flip += FLIP_H * mirrorX;
00037     _flip += FLIP_V * mirrorY;
00038     _offset = offset;
00039     _numTimesX = 1;
00040     _numTimesY = 1;
00041 }
00042 
00043 TransformStruct::TransformStruct(int32 zoomX, int32 zoomY, uint32 angle, int32 hotspotX, int32 hotspotY, TSpriteBlendMode blendMode, uint32 rgbaMod, bool mirrorX, bool mirrorY, int32 offsetX, int32 offsetY) {
00044     init(Common::Point(zoomX, zoomY),
00045         angle,
00046         Common::Point(hotspotX, hotspotY),
00047         false,
00048         blendMode,
00049         rgbaMod,
00050         mirrorX, mirrorY,
00051         Common::Point(offsetX, offsetY));
00052 }
00053 
00054 TransformStruct::TransformStruct(float zoomX, float zoomY, uint32 angle, int32 hotspotX, int32 hotspotY, TSpriteBlendMode blendMode, uint32 rgbaMod, bool mirrorX, bool mirrorY, int32 offsetX, int32 offsetY) {
00055     init(Common::Point((int)(zoomX / 100.0 * kDefaultZoomX),
00056              (int)(zoomY / 100.0 * kDefaultZoomY)),
00057         angle,
00058         Common::Point(hotspotX, hotspotY),
00059         false,
00060         blendMode,
00061         rgbaMod,
00062         mirrorX, mirrorY,
00063         Common::Point(offsetX, offsetY));
00064 }
00065 
00066 TransformStruct::TransformStruct(int32 zoomX, int32 zoomY, TSpriteBlendMode blendMode, uint32 rgbaMod, bool mirrorX, bool mirrorY) {
00067     init(Common::Point(zoomX, zoomY),
00068         kDefaultAngle,
00069         Common::Point(kDefaultHotspotX, kDefaultHotspotY),
00070         false,
00071         blendMode,
00072         rgbaMod,
00073         mirrorX,
00074         mirrorY,
00075         Common::Point(kDefaultOffsetX, kDefaultOffsetY));
00076 }
00077 
00078 TransformStruct::TransformStruct(int32 zoomX, int32 zoomY, uint32 angle, int32 hotspotX, int32 hotspotY) {
00079     init(Common::Point(zoomX, zoomY),
00080         angle,
00081         Common::Point(hotspotX, hotspotY),
00082         true,
00083         BLEND_NORMAL,
00084         kDefaultRgbaMod,
00085         false, false,
00086         Common::Point(kDefaultOffsetX, kDefaultOffsetY));
00087 }
00088 
00089 TransformStruct::TransformStruct(int32 numTimesX, int32 numTimesY) {
00090     init(Common::Point(kDefaultZoomX, kDefaultZoomY),
00091         kDefaultAngle,
00092         Common::Point(kDefaultHotspotX, kDefaultHotspotY),
00093         false,
00094         BLEND_NORMAL,
00095         kDefaultRgbaMod,
00096         false, false,
00097         Common::Point(kDefaultOffsetX, kDefaultOffsetY));
00098     _numTimesX = numTimesX;
00099     _numTimesY = numTimesY;
00100 }
00101 
00102 TransformStruct::TransformStruct() {
00103     init(Common::Point(kDefaultZoomX, kDefaultZoomY),
00104         kDefaultAngle,
00105         Common::Point(kDefaultHotspotX, kDefaultHotspotY),
00106         true,
00107         BLEND_NORMAL,
00108         kDefaultRgbaMod,
00109         false, false,
00110         Common::Point(kDefaultOffsetX, kDefaultOffsetY));
00111 }
00112 
00113 bool TransformStruct::getMirrorX() const {
00114     return (bool)(_flip & FLIP_H);
00115 }
00116 
00117 bool TransformStruct::getMirrorY() const {
00118     return (bool)(_flip & FLIP_V);
00119 }
00120 } // End of namespace Graphics


Generated on Sat Feb 16 2019 05:01:09 for ResidualVM by doxygen 1.7.1
curved edge   curved edge