aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/VectorRenderer.cpp32
-rw-r--r--graphics/VectorRenderer.h2
-rw-r--r--graphics/VectorRendererSpec.cpp186
-rw-r--r--graphics/VectorRendererSpec.h90
-rw-r--r--graphics/cursorman.h2
-rw-r--r--graphics/font.cpp2
-rw-r--r--graphics/imageman.cpp2
-rw-r--r--graphics/scaler.cpp10
-rw-r--r--graphics/surface.h8
-rw-r--r--graphics/thumbnail.cpp2
-rw-r--r--graphics/video/smk_player.cpp12
11 files changed, 174 insertions, 174 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp
index 8c7f9662cf..e67f81a363 100644
--- a/graphics/VectorRenderer.cpp
+++ b/graphics/VectorRenderer.cpp
@@ -58,12 +58,12 @@ void VectorRenderer::drawStep(const Common::Rect &area, const DrawStep &step, ui
if (step.fgColor.set)
setFgColor(step.fgColor.r, step.fgColor.g, step.fgColor.b);
-
+
if (step.bevelColor.set)
setBevelColor(step.bevelColor.r, step.bevelColor.g, step.bevelColor.b);
if (step.gradColor1.set && step.gradColor2.set)
- setGradientColors(step.gradColor1.r, step.gradColor1.g, step.gradColor1.b,
+ setGradientColors(step.gradColor1.r, step.gradColor1.g, step.gradColor1.b,
step.gradColor2.r, step.gradColor2.g, step.gradColor2.b);
setShadowOffset(_disableShadows ? 0 : step.shadow);
@@ -71,7 +71,7 @@ void VectorRenderer::drawStep(const Common::Rect &area, const DrawStep &step, ui
setGradientFactor(step.factor);
setStrokeWidth(step.stroke);
setFillMode((FillMode)step.fillMode);
-
+
_dynamicData = extra;
(this->*(step.drawingCall))(area, step);
@@ -94,25 +94,25 @@ int VectorRenderer::stepGetRadius(const DrawStep &step, const Common::Rect &area
void VectorRenderer::stepGetPositions(const DrawStep &step, const Common::Rect &area, uint16 &in_x, uint16 &in_y, uint16 &in_w, uint16 &in_h) {
if (!step.autoWidth) {
in_w = step.w == -1 ? area.height() : step.w;
-
+
switch(step.xAlign) {
case Graphics::DrawStep::kVectorAlignManual:
if (step.x >= 0) in_x = area.left + step.x;
else in_x = area.left + area.width() + step.x; // value relative to the opposite corner.
break;
-
+
case Graphics::DrawStep::kVectorAlignCenter:
- in_x = area.left + (area.width() / 2) - (in_w / 2);
+ in_x = area.left + (area.width() / 2) - (in_w / 2);
break;
-
+
case Graphics::DrawStep::kVectorAlignLeft:
in_x = area.left;
break;
-
+
case Graphics::DrawStep::kVectorAlignRight:
in_x = area.left + area.width() - in_w;
break;
-
+
default:
error("Vertical alignment in horizontal data.");
}
@@ -120,28 +120,28 @@ void VectorRenderer::stepGetPositions(const DrawStep &step, const Common::Rect &
in_x = area.left;
in_w = area.width();
}
-
+
if (!step.autoHeight) {
in_h = step.h == -1 ? area.width() : step.h;
-
+
switch(step.yAlign) {
case Graphics::DrawStep::kVectorAlignManual:
if (step.y >= 0) in_y = area.top + step.y;
else in_y = area.top + area.height() + step.y; // relative
break;
-
+
case Graphics::DrawStep::kVectorAlignCenter:
- in_y = area.top + (area.height() / 2) - (in_h / 2);
+ in_y = area.top + (area.height() / 2) - (in_h / 2);
break;
-
+
case Graphics::DrawStep::kVectorAlignTop:
in_y = area.top;
break;
-
+
case Graphics::DrawStep::kVectorAlignBottom:
in_y = area.top + area.height() - in_h;
break;
-
+
default:
error("Horizontal alignment in vertical data.");
}
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index f0c319fe76..ca61720d06 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -56,7 +56,7 @@ struct DrawStep {
bool autoWidth, autoHeight;
int16 x, y, w, h; /**< width, height and position, if not measured automatically.
- negative values mean counting from the opposite direction */
+ negative values mean counting from the opposite direction */
enum VectorAlignment {
kVectorAlignManual,
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index 36dfba19a0..f4e9d6b098 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -22,7 +22,7 @@
* $Id$
*
*/
-
+
#include "common/util.h"
#include "common/system.h"
#include "common/events.h"
@@ -61,7 +61,7 @@ inline uint32 fp_sqroot(uint32 x) {
}
/*
- HELPER MACROS for Bresenham's circle drawing algorithm
+ HELPER MACROS for Bresenham's circle drawing algorithm
Note the proper spelling on this header.
*/
#define __BE_ALGORITHM() { \
@@ -125,7 +125,7 @@ inline uint32 fp_sqroot(uint32 x) {
} \
ptr_right += pitch; \
ptr_left += pitch;
-
+
/** HELPER MACROS for WU's circle drawing algorithm **/
#define __WU_DRAWCIRCLE(ptr1,ptr2,ptr3,ptr4,x,y,px,py,a) { \
blendPixelPtr(ptr1 + (y) - (px), color, a); \
@@ -154,7 +154,7 @@ inline uint32 fp_sqroot(uint32 x) {
extern int gBitFormat;
namespace Graphics {
-
+
VectorRenderer *createRenderer(int mode) {
#ifdef DISABLE_FANCY_THEMES
assert(mode == GUI::ThemeEngine::kGfxStandard16bit);
@@ -190,7 +190,7 @@ VectorRenderer *createRenderer(int mode) {
#undef CREATE_RENDERER_16
#endif
}
-
+
#ifndef DISABLE_FANCY_THEMES
template <typename PixelType, typename PixelFormat>
void VectorRendererSpec<PixelType, PixelFormat>::
@@ -199,31 +199,31 @@ areaConvolution(const Common::Rect &area, const int filter[3][3], int filterDiv,
int newR, newG, newB;
uint8 r, g, b;
int yVal;
-
+
for (int y = area.top; y < area.bottom; ++y) {
for (int x = area.left; x < area.right; ++x) {
newR = newG = newB = 0;
for (int j = 0; j < 3; ++j) {
yVal = MIN(MAX(y - 1 + j, 0), area.bottom - 1);
-
+
for (int i = 0; i < 3; ++i) {
ptr = (PixelType *)Base::_activeSurface->getBasePtr(MIN(MAX(x - 1 + j, 0), area.right - 1), yVal);
colorToRGB<PixelFormat>((uint32)*ptr, r, g, b);
-
+
newR += r * filter[j][i];
newG += g * filter[j][i];
newB += b * filter[j][i];
}
}
-
+
newR = (newR / filterDiv) + offset;
newG = (newG / filterDiv) + offset;
newB = (newB / filterDiv) + offset;
-
+
ptr = (PixelType *)Base::_activeSurface->getBasePtr(x, y);
*ptr = RGBToColor<PixelFormat>(CLIP(newR, 0, 255), CLIP(newG, 0, 255), CLIP(newB, 0, 255));
- }
+ }
}
}
#endif
@@ -268,12 +268,12 @@ copyFrame(OSystem *sys, const Common::Rect &r) {
sys->copyRectToOverlay(
#ifdef OVERLAY_MULTIPLE_DEPTHS
- (const PixelType*)
+ (const PixelType*)
#else
(const OverlayColor*)
#endif
- _activeSurface->getBasePtr(r.left, r.top), _activeSurface->w,
+ _activeSurface->getBasePtr(r.left, r.top), _activeSurface->w,
r.left, r.top, r.width(), r.height()
);
}
@@ -282,7 +282,7 @@ template <typename PixelType, typename PixelFormat>
void VectorRendererSpec<PixelType, PixelFormat>::
blitSurface(const Graphics::Surface *source, const Common::Rect &r) {
assert(source->w == _activeSurface->w && source->h == _activeSurface->h);
-
+
PixelType *dst_ptr = (PixelType *)_activeSurface->getBasePtr(r.left, r.top);
PixelType *src_ptr = (PixelType *)source->getBasePtr(r.left, r.top);
@@ -303,12 +303,12 @@ void VectorRendererSpec<PixelType, PixelFormat>::
blitSubSurface(const Graphics::Surface *source, const Common::Rect &r) {
PixelType *dst_ptr = (PixelType *)_activeSurface->getBasePtr(r.left, r.top);
PixelType *src_ptr = (PixelType *)source->getBasePtr(0, 0);
-
+
int dst_pitch = surfacePitch();
int src_pitch = source->pitch / source->bytesPerPixel;
-
+
int h = r.height(), w = r.width();
-
+
while (h--) {
memcpy(dst_ptr, src_ptr, w * sizeof(PixelType));
dst_ptr += dst_pitch;
@@ -321,32 +321,32 @@ void VectorRendererSpec<PixelType, PixelFormat>::
blitAlphaBitmap(const Graphics::Surface *source, const Common::Rect &r) {
int16 x = r.left;
int16 y = r.top;
-
+
if (r.width() > source->w)
x = x + (r.width() >> 1) - (source->w >> 1);
-
+
if (r.height() > source->h)
y = y + (r.height() >> 1) - (source->h >> 1);
-
+
PixelType *dst_ptr = (PixelType *)_activeSurface->getBasePtr(x, y);
PixelType *src_ptr = (PixelType *)source->getBasePtr(0, 0);
-
+
int dst_pitch = surfacePitch();
int src_pitch = source->pitch / source->bytesPerPixel;
-
+
int w, h = source->h;
-
+
while (h--) {
w = source->w;
-
+
while (w--) {
if (*src_ptr != _bitmapAlphaColor)
*dst_ptr = *src_ptr;
-
+
dst_ptr++;
src_ptr++;
}
-
+
dst_ptr = dst_ptr - source->w + dst_pitch;
src_ptr = src_ptr - source->w + src_pitch;
}
@@ -361,15 +361,15 @@ applyScreenShading(GUI::ThemeEngine::ShadingStyle shadingStyle) {
uint lum;
const uint32 shiftMask = (uint32)~(
- (1 << PixelFormat::kGreenShift) |
- (1 << PixelFormat::kRedShift) |
+ (1 << PixelFormat::kGreenShift) |
+ (1 << PixelFormat::kRedShift) |
(1 << PixelFormat::kBlueShift)) >> 1;
-
+
if (shadingStyle == GUI::ThemeEngine::kShadingDim) {
int n = (pixels + 7) >> 3;
switch (pixels % 8) {
- case 0: do {
+ case 0: do {
*ptr = (*ptr >> 1) & shiftMask; ++ptr;
case 7: *ptr = (*ptr >> 1) & shiftMask; ++ptr;
case 6: *ptr = (*ptr >> 1) & shiftMask; ++ptr;
@@ -413,7 +413,7 @@ inline PixelType VectorRendererSpec<PixelType, PixelFormat>::
calcGradient(uint32 pos, uint32 max) {
PixelType output = 0;
pos = (MIN(pos * Base::_gradientFactor, max) << 12) / max;
-
+
output |= (_gradientStart + ((Base::_gradientBytes[0] * pos) >> 12)) & PixelFormat::kRedMask;
output |= (_gradientStart + ((Base::_gradientBytes[1] * pos) >> 12)) & PixelFormat::kGreenMask;
output |= (_gradientStart + ((Base::_gradientBytes[2] * pos) >> 12)) & PixelFormat::kBlueMask;
@@ -428,7 +428,7 @@ colorFill(PixelType *first, PixelType *last, PixelType color) {
register int count = (last - first);
register int n = (count + 7) >> 3;
switch (count % 8) {
- case 0: do {
+ case 0: do {
*first++ = color;
case 7: *first++ = color;
case 6: *first++ = color;
@@ -448,11 +448,11 @@ colorFill(PixelType *first, PixelType *last, PixelType color) {
********************************************************************/
template <typename PixelType, typename PixelFormat>
void VectorRendererSpec<PixelType, PixelFormat>::
-drawString(const Graphics::Font *font, const Common::String &text, const Common::Rect &area,
+drawString(const Graphics::Font *font, const Common::String &text, const Common::Rect &area,
Graphics::TextAlign alignH, GUI::ThemeEngine::TextAlignVertical alignV, int deltax, bool ellipsis) {
int offset = area.top;
-
+
if (font->getFontHeight() < area.height()) {
switch (alignV) {
case GUI::ThemeEngine::kTextAlignVCenter:
@@ -465,7 +465,7 @@ drawString(const Graphics::Font *font, const Common::String &text, const Common:
break;
}
}
-
+
font->drawString(_activeSurface, text, area.left, offset, area.width(), _fgColor, alignH, deltax, ellipsis);
}
@@ -488,7 +488,7 @@ drawLine(int x1, int y1, int x2, int y2) {
int dy = ABS(y2 - y1);
// this is a point, not a line. stoopid.
- if (dy == 0 && dx == 0)
+ if (dy == 0 && dx == 0)
return;
if (Base::_strokeWidth == 0)
@@ -501,7 +501,7 @@ drawLine(int x1, int y1, int x2, int y2) {
if (dy == 0) { // horizontal lines
// these can be filled really fast with a single memset.
colorFill(ptr, ptr + dx + 1, (PixelType)_fgColor);
-
+
for (int i = 0, p = pitch; i < st; ++i, p += pitch) {
colorFill(ptr + p, ptr + dx + 1 + p, (PixelType)_fgColor);
colorFill(ptr - p, ptr + dx + 1 - p, (PixelType)_fgColor);
@@ -536,7 +536,7 @@ drawCircle(int x, int y, int r) {
x - r < 0 || y - r < 0 || x == 0 || y == 0 || r <= 0)
return;
- if (Base::_fillMode != kFillDisabled && Base::_shadowOffset
+ if (Base::_fillMode != kFillDisabled && Base::_shadowOffset
&& x + r + Base::_shadowOffset < Base::_activeSurface->w
&& y + r + Base::_shadowOffset < Base::_activeSurface->h) {
drawCircleAlg(x + Base::_shadowOffset + 1, y + Base::_shadowOffset + 1, r, 0, kFillForeground);
@@ -611,7 +611,7 @@ drawRoundedSquare(int x, int y, int r, int w, int h) {
if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h ||
w <= 0 || h <= 0 || x < 0 || y < 0 || r <= 0)
return;
-
+
if ((r << 1) > w || (r << 1) > h)
r = MIN(w >> 1, h >> 1);
@@ -639,7 +639,7 @@ drawRoundedSquare(int x, int y, int r, int w, int h) {
case kFillGradient:
if (Base::_strokeWidth > 1) {
drawRoundedSquareAlg(x, y, r, w, h, _fgColor, kFillForeground);
- VectorRendererSpec::drawRoundedSquareAlg(x + Base::_strokeWidth/2, y + Base::_strokeWidth/2,
+ VectorRendererSpec::drawRoundedSquareAlg(x + Base::_strokeWidth/2, y + Base::_strokeWidth/2,
r - Base::_strokeWidth/2, w - Base::_strokeWidth, h - Base::_strokeWidth, 0, kFillGradient);
} else {
VectorRendererSpec::drawRoundedSquareAlg(x, y, r, w, h, 0, kFillGradient);
@@ -648,7 +648,7 @@ drawRoundedSquare(int x, int y, int r, int w, int h) {
}
break;
}
-
+
if (Base::_bevel)
drawRoundedSquareFakeBevel(x, y, r, w, h, Base::_bevel);
}
@@ -659,25 +659,25 @@ drawTab(int x, int y, int r, int w, int h) {
if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h ||
w <= 0 || h <= 0 || x < 0 || y < 0 || r > w || r > h)
return;
-
+
if (r == 0 && Base::_bevel > 0) {
drawBevelTabAlg(x, y, w, h, Base::_bevel, _bevelColor, _fgColor, (Base::_dynamicData >> 16), (Base::_dynamicData & 0xFFFF));
return;
}
-
+
if (r == 0) return;
-
+
switch (Base::_fillMode) {
case kFillDisabled:
return;
-
+
case kFillGradient:
case kFillBackground:
drawTabAlg(x, y, w, h, r, (Base::_fillMode == kFillBackground) ? _bgColor : _fgColor, Base::_fillMode);
if (Base::_strokeWidth)
drawTabAlg(x, y, w, h, r, _fgColor, kFillDisabled, (Base::_dynamicData >> 16), (Base::_dynamicData & 0xFFFF));
break;
-
+
case kFillForeground:
drawTabAlg(x, y, w, h, r, (Base::_fillMode == kFillBackground) ? _bgColor : _fgColor, Base::_fillMode);
break;
@@ -687,7 +687,7 @@ drawTab(int x, int y, int r, int w, int h) {
template<typename PixelType, typename PixelFormat>
void VectorRendererSpec<PixelType, PixelFormat>::
drawTriangle(int x, int y, int w, int h, TriangleOrientation orient) {
-
+
if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h)
return;
@@ -703,10 +703,10 @@ drawTriangle(int x, int y, int w, int h, TriangleOrientation orient) {
return;
color = _fgColor;
}
-
+
if (Base::_dynamicData != 0)
orient = (TriangleOrientation)Base::_dynamicData;
-
+
int newW = w / 2;
if (newW % 2) newW++;
@@ -745,7 +745,7 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer:
int x, y, px, py;
int pitch = Base::surfacePitch();
int sw = 0, sp = 0, hp = 0;
-
+
PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r);
PixelType *ptr_tr = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + r);
PixelType *ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1);
@@ -762,7 +762,7 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer:
__BE_RESET();
r--;
-
+
while (x++ < y) {
__BE_ALGORITHM();
*(ptr_tr + (y) - (px)) = color;
@@ -776,7 +776,7 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer:
*(ptr_tl - (x) - (py)) = color;
*(ptr_tl - (y) - (px - pitch)) = color;
}
- }
+ }
}
ptr_fill += pitch * real_radius;
@@ -785,7 +785,7 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer:
colorFill(ptr_fill + w - Base::_strokeWidth + 1, ptr_fill + w + 1, color);
ptr_fill += pitch;
}
-
+
if (baseLeft) {
sw = 0;
ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1 + h + 1);
@@ -794,7 +794,7 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer:
ptr_fill += pitch;
}
}
-
+
if (baseRight) {
sw = 0;
ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w, y1 + h + 1);
@@ -808,24 +808,24 @@ drawTabAlg(int x1, int y1, int w, int h, int r, PixelType color, VectorRenderer:
PixelType color1, color2;
color1 = color2 = color;
-
+
while (x++ < y) {
__BE_ALGORITHM();
-
+
if (fill_m == kFillGradient) {
color1 = calcGradient(real_radius - x, long_h);
color2 = calcGradient(real_radius - y, long_h);
}
-
+
colorFill(ptr_tl - x - py, ptr_tr + x - py, color2);
colorFill(ptr_tl - y - px, ptr_tr + y - px, color1);
-
+
*(ptr_tr + (y) - (px)) = color1;
*(ptr_tr + (x) - (py)) = color2;
*(ptr_tl - (x) - (py)) = color2;
*(ptr_tl - (y) - (px)) = color1;
}
-
+
ptr_fill += pitch * r;
while (short_h--) {
if (fill_m == kFillGradient)
@@ -843,9 +843,9 @@ void VectorRendererSpec<PixelType, PixelFormat>::
drawBevelTabAlg(int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color, int baseLeft, int baseRight) {
int pitch = Base::surfacePitch();
int i, j;
-
+
PixelType *ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
-
+
i = bevel;
while (i--) {
colorFill(ptr_left, ptr_left + w, top_color);
@@ -869,12 +869,12 @@ drawBevelTabAlg(int x, int y, int w, int h, int bevel, PixelType top_color, Pixe
if (j > 0) j--;
ptr_left += pitch;
}
-
+
i = bevel;
ptr_left = (PixelType *)_activeSurface->getBasePtr(x + w - bevel, y + h - bevel);
while (i--) {
colorFill(ptr_left, ptr_left + baseRight + bevel, bottom_color);
-
+
if (baseLeft)
colorFill(ptr_left - w - baseLeft + bevel, ptr_left - w + bevel + bevel, top_color);
ptr_left += pitch;
@@ -888,7 +888,7 @@ drawSquareAlg(int x, int y, int w, int h, PixelType color, VectorRenderer::FillM
PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x, y);
int pitch = Base::surfacePitch();
int max_h = h;
-
+
if (fill_m != kFillDisabled) {
while (h--) {
if (fill_m == kFillGradient)
@@ -919,25 +919,25 @@ template<typename PixelType, typename PixelFormat>
void VectorRendererSpec<PixelType, PixelFormat>::
drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, PixelType bottom_color, bool fill) {
int pitch = Base::surfacePitch();
-
+
int height = h;
PixelType *ptr_fill = (PixelType *)_activeSurface->getBasePtr(x, y);
-
+
if (fill) {
while (height--) {
blendFill(ptr_fill, ptr_fill + w, _bgColor, 200);
ptr_fill += pitch;
}
}
-
+
int i, j;
x = MAX(x - bevel, 0);
y = MAX(y - bevel, 0);
h += bevel << 1;
w += bevel << 1;
-
+
PixelType *ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);
-
+
i = bevel;
while (i--) {
colorFill(ptr_left, ptr_left + w, top_color);
@@ -1105,9 +1105,9 @@ drawTriangleFast(int x1, int y1, int size, bool inverted, PixelType color, Vecto
int pitch = Base::surfacePitch();
int hstep = 0, dy = size;
bool grad = (fill_m == kFillGradient);
-
+
PixelType *ptr_right = 0, *ptr_left = 0;
-
+
if (inverted) {
ptr_left = (PixelType *)_activeSurface->getBasePtr(x1, y1);
ptr_right = (PixelType *)_activeSurface->getBasePtr(x1 + size, y1);
@@ -1116,7 +1116,7 @@ drawTriangleFast(int x1, int y1, int size, bool inverted, PixelType color, Vecto
ptr_right = (PixelType *)_activeSurface->getBasePtr(x1 + size, y1 + size);
pitch = -pitch;
}
-
+
if (fill_m == kFillDisabled) {
while (ptr_left < ptr_right) {
*ptr_left = color;
@@ -1136,7 +1136,7 @@ drawTriangleFast(int x1, int y1, int size, bool inverted, PixelType color, Vecto
if (hstep++ % 2) {
ptr_left++;
ptr_right--;
- }
+ }
}
}
}
@@ -1149,7 +1149,7 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto
int x, y, px, py;
int pitch = Base::surfacePitch();
int sw = 0, sp = 0, hp = h * pitch;
-
+
PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r);
PixelType *ptr_tr = (PixelType *)Base::_activeSurface->getBasePtr(x1 + w - r, y1 + r);
PixelType *ptr_bl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + h - r);
@@ -1168,7 +1168,7 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto
__BE_RESET();
r--;
-
+
while (x++ < y) {
__BE_ALGORITHM();
__BE_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py);
@@ -1177,7 +1177,7 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto
__BE_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x - 1, y, px, py);
__BE_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px - pitch, py);
}
- }
+ }
}
ptr_fill += pitch * real_radius;
@@ -1189,27 +1189,27 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto
} else {
__BE_RESET();
PixelType color1, color2, color3, color4;
-
+
if (fill_m == kFillGradient) {
while (x++ < y) {
__BE_ALGORITHM();
-
+
color1 = calcGradient(real_radius - x, long_h);
color2 = calcGradient(real_radius - y, long_h);
color3 = calcGradient(long_h - r + x, long_h);
color4 = calcGradient(long_h - r + y, long_h);
-
+
colorFill(ptr_tl - x - py, ptr_tr + x - py, color2);
colorFill(ptr_tl - y - px, ptr_tr + y - px, color1);
colorFill(ptr_bl - x + py, ptr_br + x + py, color4);
colorFill(ptr_bl - y + px, ptr_br + y + px, color3);
-
+
__BE_DRAWCIRCLE_XCOLOR(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py);
}
} else {
while (x++ < y) {
- __BE_ALGORITHM();
+ __BE_ALGORITHM();
colorFill(ptr_tl - x - py, ptr_tr + x - py, color);
colorFill(ptr_tl - y - px, ptr_tr + y - px, color);
@@ -1378,7 +1378,7 @@ drawRoundedSquareFakeBevel(int x1, int y1, int r, int w, int h, int amount) {
uint32 rsq = (r * r) << 16;
uint32 T = 0, oldT;
uint8 a1, a2;
-
+
PixelType color = _bevelColor; //RGBToColor<PixelFormat>(63, 60, 17);
PixelType *ptr_tl = (PixelType *)Base::_activeSurface->getBasePtr(x1 + r, y1 + r);
@@ -1387,14 +1387,14 @@ drawRoundedSquareFakeBevel(int x1, int y1, int r, int w, int h, int amount) {
PixelType *ptr_fill = (PixelType *)Base::_activeSurface->getBasePtr(x1, y1);
int short_h = h - 2 * r;
-
+
while (sw++ < amount) {
colorFill(ptr_fill + sp + r, ptr_fill + w + 1 + sp - r, color);
sp += p;
x = r - (sw - 1); y = 0; T = 0;
px = p * x; py = 0;
-
+
while (x > y++) {
__WU_ALGORITHM();
@@ -1404,14 +1404,14 @@ drawRoundedSquareFakeBevel(int x1, int y1, int r, int w, int h, int amount) {
blendPixelPtr(ptr_tl - (y) - (px - p), color, a2);
blendPixelPtr(ptr_bl - (y) + (px - p), color, a2);
blendPixelPtr(ptr_bl - (x - 1) + (py), color, a2);
-
+
blendPixelPtr(ptr_tr + (y) - (px), color, a1);
blendPixelPtr(ptr_tr + (x) - (py), color, a1);
blendPixelPtr(ptr_tl - (x) - (py), color, a1);
blendPixelPtr(ptr_tl - (y) - (px), color, a1);
blendPixelPtr(ptr_bl - (y) + (px), color, a1);
blendPixelPtr(ptr_bl - (x) + (py), color, a1);
- }
+ }
}
ptr_fill += p * r;
@@ -1520,7 +1520,7 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto
x = r - (sw - 1); y = 0; T = 0;
px = p * x; py = 0;
-
+
while (x > y++) {
__WU_ALGORITHM();
@@ -1529,7 +1529,7 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto
__WU_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, (x - 1), y, (px - p), py, a2);
__WU_DRAWCIRCLE(ptr_tr, ptr_tl, ptr_bl, ptr_br, x, y, px, py, a1);
- }
+ }
}
ptr_fill += p * r;
@@ -1537,11 +1537,11 @@ drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, Vecto
colorFill(ptr_fill, ptr_fill + Base::_strokeWidth, color);
colorFill(ptr_fill + w - Base::_strokeWidth + 1, ptr_fill + w + 1, color);
ptr_fill += p;
- }
+ }
} else {
x = r; y = 0; T = 0;
px = p * x; py = 0;
-
+
while (x > 1 + y++) {
__WU_ALGORITHM();
@@ -1607,12 +1607,12 @@ drawCircleAlg(int x1, int y1, int r, PixelType color, VectorRenderer::FillMode f
colorFill(ptr - x - py, ptr + x - py, color);
colorFill(ptr - y + px, ptr + y + px, color);
colorFill(ptr - y - px, ptr + y - px, color);
-
+
__WU_DRAWCIRCLE(ptr, ptr, ptr, ptr, x, y, px, py, a1);
- }
+ }
}
}
#endif
-
+
}
diff --git a/graphics/VectorRendererSpec.h b/graphics/VectorRendererSpec.h
index fdeb9f9989..f1bcd1854e 100644
--- a/graphics/VectorRendererSpec.h
+++ b/graphics/VectorRendererSpec.h
@@ -22,7 +22,7 @@
* $Id$
*
*/
-
+
#ifndef VECTOR_RENDERER_SPEC_H
#define VECTOR_RENDERER_SPEC_H
@@ -44,7 +44,7 @@ namespace Graphics {
*
* @param PixelFormat Defines the type of the PixelFormat struct which contains all
* the actual information of the pixels being used, as declared in "graphics/colormasks.h"
- *
+ *
* TODO: Expand documentation.
*
* @see VectorRenderer
@@ -57,7 +57,7 @@ public:
VectorRendererSpec() {
_bitmapAlphaColor = RGBToColor<PixelFormat>(255, 0, 255);
}
-
+
void drawLine(int x1, int y1, int x2, int y2);
void drawCircle(int x, int y, int r);
void drawSquare(int x, int y, int w, int h);
@@ -67,24 +67,24 @@ public:
void drawBeveledSquare(int x, int y, int w, int h, int bevel) {
drawBevelSquareAlg(x, y, w, h, bevel, _bevelColor, _fgColor, Base::_fillMode != kFillDisabled);
}
- void drawString(const Graphics::Font *font, const Common::String &text,
+ void drawString(const Graphics::Font *font, const Common::String &text,
const Common::Rect &area, Graphics::TextAlign alignH,
GUI::ThemeEngine::TextAlignVertical alignV, int deltax, bool elipsis);
void setFgColor(uint8 r, uint8 g, uint8 b) { _fgColor = RGBToColor<PixelFormat>(r, g, b); }
void setBgColor(uint8 r, uint8 g, uint8 b) { _bgColor = RGBToColor<PixelFormat>(r, g, b); }
void setBevelColor(uint8 r, uint8 g, uint8 b) { _bevelColor = RGBToColor<PixelFormat>(r, g, b); }
- void setGradientColors(uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2);
-
- void copyFrame(OSystem *sys, const Common::Rect &r);
- void copyWholeFrame(OSystem *sys) { copyFrame(sys, Common::Rect(0, 0, _activeSurface->w, _activeSurface->h)); }
-
- void fillSurface();
- void blitSurface(const Graphics::Surface *source, const Common::Rect &r);
- void blitSubSurface(const Graphics::Surface *source, const Common::Rect &r);
- void blitAlphaBitmap(const Graphics::Surface *source, const Common::Rect &r);
-
- void applyScreenShading(GUI::ThemeEngine::ShadingStyle shadingStyle);
+ void setGradientColors(uint8 r1, uint8 g1, uint8 b1, uint8 r2, uint8 g2, uint8 b2);
+
+ void copyFrame(OSystem *sys, const Common::Rect &r);
+ void copyWholeFrame(OSystem *sys) { copyFrame(sys, Common::Rect(0, 0, _activeSurface->w, _activeSurface->h)); }
+
+ void fillSurface();
+ void blitSurface(const Graphics::Surface *source, const Common::Rect &r);
+ void blitSubSurface(const Graphics::Surface *source, const Common::Rect &r);
+ void blitAlphaBitmap(const Graphics::Surface *source, const Common::Rect &r);
+
+ void applyScreenShading(GUI::ThemeEngine::ShadingStyle shadingStyle);
protected:
@@ -117,7 +117,7 @@ protected:
/**
* Blends a single pixel on the surface in the given pixel pointer, using supplied color
* and Alpha intensity.
- *
+ *
* This is implemented to prevent blendPixel() to calculate the surface pointer on each call.
* Optimized drawing algorithms should call this function when possible.
*
@@ -126,7 +126,7 @@ protected:
* @param color Color of the pixel
* @param alpha Alpha intensity of the pixel (0-255)
*/
- inline void blendPixelPtr(PixelType *ptr, PixelType color, uint8 alpha);
+ inline void blendPixelPtr(PixelType *ptr, PixelType color, uint8 alpha);
/**
* PRIMITIVE DRAWING ALGORITHMS
@@ -139,33 +139,33 @@ protected:
* @see VectorRendererAA::drawLineAlg
* @see VectorRendererAA::drawCircleAlg
*/
- virtual void drawLineAlg(int x1, int y1, int x2, int y2,
+ virtual void drawLineAlg(int x1, int y1, int x2, int y2,
int dx, int dy, PixelType color);
-
- virtual void drawCircleAlg(int x, int y, int r,
+
+ virtual void drawCircleAlg(int x, int y, int r,
PixelType color, FillMode fill_m);
-
- virtual void drawRoundedSquareAlg(int x1, int y1, int r, int w, int h,
+
+ virtual void drawRoundedSquareAlg(int x1, int y1, int r, int w, int h,
PixelType color, FillMode fill_m);
-
- virtual void drawSquareAlg(int x, int y, int w, int h,
+
+ virtual void drawSquareAlg(int x, int y, int w, int h,
PixelType color, FillMode fill_m);
-
- virtual void drawTriangleVertAlg(int x, int y, int w, int h,
+
+ virtual void drawTriangleVertAlg(int x, int y, int w, int h,
bool inverted, PixelType color, FillMode fill_m);
-
- virtual void drawTriangleFast(int x, int y, int size,
+
+ virtual void drawTriangleFast(int x, int y, int size,
bool inverted, PixelType color, FillMode fill_m);
-
- virtual void drawBevelSquareAlg(int x, int y, int w, int h,
+
+ virtual void drawBevelSquareAlg(int x, int y, int w, int h,
int bevel, PixelType top_color, PixelType bottom_color, bool fill);
-
- virtual void drawTabAlg(int x, int y, int w, int h, int r,
- PixelType color, VectorRenderer::FillMode fill_m,
+
+ virtual void drawTabAlg(int x, int y, int w, int h, int r,
+ PixelType color, VectorRenderer::FillMode fill_m,
int baseLeft = 0, int baseRight = 0);
-
- virtual void drawBevelTabAlg(int x, int y, int w, int h,
- int bevel, PixelType topColor, PixelType bottomColor,
+
+ virtual void drawBevelTabAlg(int x, int y, int w, int h,
+ int bevel, PixelType topColor, PixelType bottomColor,
int baseLeft = 0, int baseRight = 0);
/**
@@ -191,7 +191,7 @@ protected:
* @param max Maximum amount of the progress.
* @return Composite color of the gradient at the given "progress" amount.
*/
- inline PixelType calcGradient(uint32 pos, uint32 max);
+ inline PixelType calcGradient(uint32 pos, uint32 max);
/**
* Fills several pixels in a row with a given color and the specified alpha blending.
@@ -216,15 +216,15 @@ protected:
* for portable platforms with platform-specific assembly code.
*
* This fill operation is extensively used throughout the renderer, so this
- * counts as one of the main bottlenecks. Please replace it with assembly
+ * counts as one of the main bottlenecks. Please replace it with assembly
* when possible!
*
* @param first Pointer to the first pixel to fill.
* @param last Pointer to the last pixel to fill.
* @param color Color of the pixel
*/
- inline void colorFill(PixelType *first, PixelType *last, PixelType color);
-
+ inline void colorFill(PixelType *first, PixelType *last, PixelType color);
+
#ifndef DISABLE_FANCY_THEMES
void areaConvolution(const Common::Rect &area, const int filter[3][3], int filterDiv, int offset);
#endif
@@ -234,7 +234,7 @@ protected:
PixelType _gradientStart; /**< Start color for the fill gradient */
PixelType _gradientEnd; /**< End color for the fill gradient */
-
+
PixelType _bevelColor;
PixelType _bitmapAlphaColor;
};
@@ -247,7 +247,7 @@ protected:
* This templated class inherits all the functionality of the VectorRendererSpec
* class but uses better looking yet slightly slower AA algorithms for drawing
* most primitives. May be used in faster platforms.
- *
+ *
* TODO: Expand documentation.
*
* @see VectorRenderer
@@ -287,14 +287,14 @@ protected:
* @see VectorRenderer::drawRoundedAlg()
*/
virtual void drawRoundedSquareAlg(int x1, int y1, int r, int w, int h, PixelType color, VectorRenderer::FillMode fill_m);
-
+
virtual void drawRoundedSquareShadow(int x, int y, int r, int w, int h, int blur) {
Base::drawRoundedSquareShadow(x, y, r, w, h, blur);
-// VectorRenderer::applyConvolutionMatrix(VectorRenderer::kConvolutionHardBlur,
+// VectorRenderer::applyConvolutionMatrix(VectorRenderer::kConvolutionHardBlur,
// Common::Rect(x, y, x + w + blur * 2, y + h + blur * 2));
}
};
#endif
-
+
}
#endif
diff --git a/graphics/cursorman.h b/graphics/cursorman.h
index bf05ab762b..bc38466eda 100644
--- a/graphics/cursorman.h
+++ b/graphics/cursorman.h
@@ -81,7 +81,7 @@ public:
/**
* Pop all of the cursors and cursor palettes from their respective stacks.
- * The purpose is to ensure that all unecessary cursors are removed from the
+ * The purpose is to ensure that all unecessary cursors are removed from the
* stack when returning to the launcher from an engine.
*
*/
diff --git a/graphics/font.cpp b/graphics/font.cpp
index 34b1b13581..f896b3c94e 100644
--- a/graphics/font.cpp
+++ b/graphics/font.cpp
@@ -65,7 +65,7 @@ void drawCharIntern(byte *ptr, uint pitch, const bitmap_t *src, int h, int minX,
tmp++;
buffer <<= 1;
}
-
+
ptr += pitch;
}
}
diff --git a/graphics/imageman.cpp b/graphics/imageman.cpp
index 04c732028b..ab99ae256c 100644
--- a/graphics/imageman.cpp
+++ b/graphics/imageman.cpp
@@ -61,7 +61,7 @@ bool ImageManager::addArchive(const Common::String &name) {
#endif
} else {
Common::FSDirectory *dir = new Common::FSDirectory(node);
- if (!dir || !dir->getFSNode().isDirectory())
+ if (!dir || !dir->getFSNode().isDirectory())
return false;
arch = dir;
diff --git a/graphics/scaler.cpp b/graphics/scaler.cpp
index 9e8e58180d..e1f3775eac 100644
--- a/graphics/scaler.cpp
+++ b/graphics/scaler.cpp
@@ -127,11 +127,11 @@ void DestroyScalers(){
*/
void Normal1x(const uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
int width, int height) {
- // Spot the case when it can all be done in 1 hit
- if (((int)srcPitch == 2 * width) && ((int)dstPitch == 2 * width)) {
- width *= height;
- height = 1;
- }
+ // Spot the case when it can all be done in 1 hit
+ if (((int)srcPitch == 2 * width) && ((int)dstPitch == 2 * width)) {
+ width *= height;
+ height = 1;
+ }
while (height--) {
memcpy(dstPtr, srcPtr, 2 * width);
srcPtr += srcPitch;
diff --git a/graphics/surface.h b/graphics/surface.h
index 747bda9a26..2d168a10dd 100644
--- a/graphics/surface.h
+++ b/graphics/surface.h
@@ -35,10 +35,10 @@ namespace Graphics {
* operations, font rendering, etc.
*/
struct Surface {
- /**
- * ARM code relies on the layout of the first 3 of these fields. Do
- * not change them.
- */
+ /**
+ * ARM code relies on the layout of the first 3 of these fields. Do
+ * not change them.
+ */
uint16 w;
uint16 h;
uint16 pitch;
diff --git a/graphics/thumbnail.cpp b/graphics/thumbnail.cpp
index 709ba9ea54..1d88dc5147 100644
--- a/graphics/thumbnail.cpp
+++ b/graphics/thumbnail.cpp
@@ -75,7 +75,7 @@ bool checkThumbnailHeader(Common::SeekableReadStream &in) {
ThumbnailHeader header;
bool hasHeader = loadHeader(in, header, false);
-
+
in.seek(position, SEEK_SET);
return hasHeader;
diff --git a/graphics/video/smk_player.cpp b/graphics/video/smk_player.cpp
index 458a8c0d12..b0e79792d8 100644
--- a/graphics/video/smk_player.cpp
+++ b/graphics/video/smk_player.cpp
@@ -39,10 +39,10 @@
namespace Graphics {
enum SmkBlockTypes {
- SMK_BLOCK_MONO = 0,
- SMK_BLOCK_FULL = 1,
- SMK_BLOCK_SKIP = 2,
- SMK_BLOCK_FILL = 3
+ SMK_BLOCK_MONO = 0,
+ SMK_BLOCK_FULL = 1,
+ SMK_BLOCK_SKIP = 2,
+ SMK_BLOCK_FILL = 3
};
/*
@@ -446,7 +446,7 @@ bool SMKPlayer::loadFile(const char *fileName) {
// * bit 28 - 1 = stereo audio; 0 = mono audio
// * bits 27-26 - if both set to zero - use v2 sound decompression
// * bits 25-24 - unused
- // * bits 23-0 - audio sample rate
+ // * bits 23-0 - audio sample rate
audioInfo = _fileStream->readUint32LE();
_header.audioInfo[i].isCompressed = audioInfo & 0x80000000;
_header.audioInfo[i].hasAudio = audioInfo & 0x40000000;
@@ -570,7 +570,7 @@ bool SMKPlayer::decodeNextFrame() {
if (_header.audioInfo[i].hasAudio && chunkSize > 0 && i == 0) {
// If it's track 0, play the audio data
byte *soundBuffer = new byte[chunkSize];
-
+
_fileStream->read(soundBuffer, chunkSize);
if (_header.audioInfo[i].isCompressed) {