diff options
Diffstat (limited to 'engines/wintermute/graphics')
-rw-r--r-- | engines/wintermute/graphics/transform_struct.cpp | 20 | ||||
-rw-r--r-- | engines/wintermute/graphics/transform_struct.h | 22 | ||||
-rw-r--r-- | engines/wintermute/graphics/transform_tools.cpp | 4 |
3 files changed, 23 insertions, 23 deletions
diff --git a/engines/wintermute/graphics/transform_struct.cpp b/engines/wintermute/graphics/transform_struct.cpp index c179d42ab1..8edbf765b5 100644 --- a/engines/wintermute/graphics/transform_struct.cpp +++ b/engines/wintermute/graphics/transform_struct.cpp @@ -51,14 +51,14 @@ TransformStruct::TransformStruct(int32 zoomX, int32 zoomY, uint32 angle, int32 h TransformStruct::TransformStruct(int32 zoomX, int32 zoomY, TSpriteBlendMode blendMode, uint32 rgbaMod, bool mirrorX, bool mirrorY) { init(Point32(zoomX, zoomY), - DEFAULT_ANGLE, - Point32(DEFAULT_HOTSPOT_X, DEFAULT_HOTSPOT_Y), + kDefaultAngle, + Point32(kDefaultHotspotX, kDefaultHotspotY), false, blendMode, rgbaMod, mirrorX, mirrorY, - Point32(DEFAULT_OFFSET_X, DEFAULT_OFFSET_Y)); + Point32(kDefaultOffsetX, kDefaultOffsetY)); } TransformStruct::TransformStruct(int32 zoomX, int32 zoomY, uint32 angle, int32 hotspotX, int32 hotspotY) { @@ -67,20 +67,20 @@ TransformStruct::TransformStruct(int32 zoomX, int32 zoomY, uint32 angle, int32 h Point32(hotspotX, hotspotY), true, BLEND_NORMAL, - DEFAULT_RGBAMOD, + kDefaultRgbaMod, false, false, - Point32(DEFAULT_OFFSET_X, DEFAULT_OFFSET_Y)); + Point32(kDefaultOffsetX, kDefaultOffsetY)); } TransformStruct::TransformStruct() { - init(Point32(DEFAULT_ZOOM_X, DEFAULT_ZOOM_Y), - DEFAULT_ANGLE, - Point32(DEFAULT_HOTSPOT_X, DEFAULT_HOTSPOT_Y), + init(Point32(kDefaultZoomX, kDefaultZoomY), + kDefaultAngle, + Point32(kDefaultHotspotX, kDefaultHotspotY), true, BLEND_NORMAL, - DEFAULT_RGBAMOD, + kDefaultRgbaMod, false, false, - Point32(DEFAULT_OFFSET_X, DEFAULT_OFFSET_Y)); + Point32(kDefaultOffsetX, kDefaultOffsetY)); } bool TransformStruct::getMirrorX() const { diff --git a/engines/wintermute/graphics/transform_struct.h b/engines/wintermute/graphics/transform_struct.h index 6b021b5cd5..3fec9c0d0d 100644 --- a/engines/wintermute/graphics/transform_struct.h +++ b/engines/wintermute/graphics/transform_struct.h @@ -20,21 +20,21 @@ * */ -#ifndef GRAPHICS_TRANSFORM_STRUCT_H -#define GRAPHICS_TRANSFORM_STRUCT_H +#ifndef WINTERMUTE_TRANSFORM_STRUCT_H +#define WINTERMUTE_TRANSFORM_STRUCT_H #include "engines/wintermute/math/rect32.h" #include "engines/wintermute/dctypes.h" -#define DEFAULT_ZOOM_X 100.0 -#define DEFAULT_ZOOM_Y 100.0 -#define DEFAULT_RGBAMOD 0xFFFFFFFF -#define DEFAULT_HOTSPOT_X 0 -#define DEFAULT_HOTSPOT_Y 0 -#define DEFAULT_OFFSET_X 0 -#define DEFAULT_OFFSET_Y 0 -#define DEFAULT_ANGLE 0 - +const float kDefaultZoomX = 100.0; +const float kDefaultZoomY = 100.0; +const uint32 kDefaultRgbaMod = 0xFFFFFFFF; +const int32 kDefaultHotspotX = 0; +const int32 kDefaultHotspotY = 0; +const int32 kDefaultOffsetX = 0; +const int32 kDefaultOffsetY = 0; +const int32 kDefaultAngle = 0; + namespace Wintermute { /** * Contains all the required information that define a transform. diff --git a/engines/wintermute/graphics/transform_tools.cpp b/engines/wintermute/graphics/transform_tools.cpp index 01e8b486ce..1ba48433ef 100644 --- a/engines/wintermute/graphics/transform_tools.cpp +++ b/engines/wintermute/graphics/transform_tools.cpp @@ -29,8 +29,8 @@ namespace Wintermute { FloatPoint TransformTools::transformPoint(const FloatPoint &point, const float rotate, const Point32 &zoom, const bool mirrorX, const bool mirrorY) { float rotateRad = rotate * M_PI / 180; FloatPoint newPoint; - newPoint.x = (point.x * cos(rotateRad) - point.y * sin(rotateRad))*zoom.x/DEFAULT_ZOOM_X; - newPoint.y = (point.x * sin(rotateRad) + point.y * cos(rotateRad))*zoom.y/DEFAULT_ZOOM_Y; + newPoint.x = (point.x * cos(rotateRad) - point.y * sin(rotateRad))*zoom.x/kDefaultZoomX; + newPoint.y = (point.x * sin(rotateRad) + point.y * cos(rotateRad))*zoom.y/kDefaultZoomY; if (mirrorX) { newPoint.x *= -1; } |