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

transform_struct.h

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 #ifndef GRAPHICS_TRANSFORM_STRUCT_H
00024 #define GRAPHICS_TRANSFORM_STRUCT_H
00025 
00026 #include "common/rect.h"
00027 
00028 namespace Graphics {
00029 
00030 enum TSpriteBlendMode {
00031     BLEND_UNKNOWN       = -1,
00032     BLEND_NORMAL        = 0,
00033     BLEND_ADDITIVE      = 1,
00034     BLEND_SUBTRACTIVE   = 2,
00035     BLEND_MULTIPLY      = 3,
00036     NUM_BLEND_MODES
00037 };
00038 
00045 const int32 kDefaultZoomX = 100;
00046 const int32 kDefaultZoomY = 100;
00047 const uint32 kDefaultRgbaMod = 0xFFFFFFFF;
00048 const int32 kDefaultHotspotX = 0;
00049 const int32 kDefaultHotspotY = 0;
00050 const int32 kDefaultOffsetX = 0;
00051 const int32 kDefaultOffsetY = 0;
00052 const int32 kDefaultAngle = 0;
00053 
00054 struct TransformStruct {
00055 private:
00056     void init(Common::Point zoom, uint32 angle, Common::Point hotspot, bool alphaDisable, TSpriteBlendMode blendMode, uint32 alpha, bool mirrorX, bool mirrorY, Common::Point offset);
00057 
00058 public:
00059     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);
00060     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);
00061     TransformStruct(int32 zoomX, int32 zoomY, TSpriteBlendMode blendMode, uint32 alpha, bool mirrorX = false, bool mirrorY = false);
00062     TransformStruct(int32 zoomX, int32 zoomY, uint32 angle, int32 hotspotX = 0, int32 hotspotY = 0);
00063     TransformStruct(int32 numTimesX, int32 numTimesY);
00064     TransformStruct();
00065 
00066     Common::Point _zoom;   
00067     Common::Point _hotspot; 
00068     int32 _angle;   
00069     byte _flip;      
00070     bool _alphaDisable;
00071     TSpriteBlendMode _blendMode;
00072     uint32 _rgbaMod;      
00073     Common::Point _offset;
00074     int32 _numTimesX;
00075     int32 _numTimesY;
00076 
00077     bool getMirrorX() const;
00078     bool getMirrorY() const;
00079 
00080     bool operator==(const TransformStruct &compare) const {
00081         return (compare._angle == _angle &&
00082                 compare._flip == _flip &&
00083                 compare._zoom == _zoom  &&
00084                 compare._offset == _offset &&
00085                 compare._alphaDisable == _alphaDisable  &&
00086                 compare._rgbaMod == _rgbaMod &&
00087                 compare._blendMode == _blendMode &&
00088                 compare._numTimesX == _numTimesX &&
00089                 compare._numTimesY == _numTimesY
00090                );
00091     }
00092 
00093     bool operator!=(const TransformStruct &compare) const {
00094         return !(compare == *this);
00095     }
00096 };
00097 } // End of namespace Graphics
00098 #endif


Generated on Sat Feb 23 2019 05:01:19 for ResidualVM by doxygen 1.7.1
curved edge   curved edge