aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorJohannes Schickel2012-09-26 04:17:31 +0200
committerJohannes Schickel2012-09-26 04:17:55 +0200
commit89abab97e3124fa25eb4c7d3e8b38501747a8d17 (patch)
treed60a833c9ed352fbe44c0b9a6b8ff43fcbc29419 /graphics
parenta6c6c74350bb673c178d9756a1625ca128d24f21 (diff)
downloadscummvm-rg350-89abab97e3124fa25eb4c7d3e8b38501747a8d17.tar.gz
scummvm-rg350-89abab97e3124fa25eb4c7d3e8b38501747a8d17.tar.bz2
scummvm-rg350-89abab97e3124fa25eb4c7d3e8b38501747a8d17.zip
JANITORIAL: Remove trailing whitespaces.
Powered by: git ls-files "*.cpp" "*.h" "*.m" "*.mm" | xargs sed -i -e 's/[ \t]*$//'
Diffstat (limited to 'graphics')
-rw-r--r--graphics/VectorRenderer.cpp2
-rw-r--r--graphics/VectorRenderer.h2
-rw-r--r--graphics/VectorRendererSpec.cpp64
-rw-r--r--graphics/decoders/bmp.cpp6
-rw-r--r--graphics/decoders/jpeg.cpp2
-rw-r--r--graphics/decoders/pcx.cpp34
-rw-r--r--graphics/decoders/pcx.h2
-rw-r--r--graphics/decoders/pict.cpp2
-rw-r--r--graphics/fonts/consolefont.cpp2
-rw-r--r--graphics/fonts/newfont.cpp2
-rw-r--r--graphics/fonts/newfont_big.cpp2
-rw-r--r--graphics/sjis.h2
-rw-r--r--graphics/yuv_to_rgb.h2
13 files changed, 62 insertions, 62 deletions
diff --git a/graphics/VectorRenderer.cpp b/graphics/VectorRenderer.cpp
index 30ef9eeeeb..f426dd8c41 100644
--- a/graphics/VectorRenderer.cpp
+++ b/graphics/VectorRenderer.cpp
@@ -80,7 +80,7 @@ void VectorRenderer::stepGetPositions(const DrawStep &step, const Common::Rect &
case Graphics::DrawStep::kVectorAlignManual:
if (step.x >= 0)
in_x = area.left + step.x + step.padding.left;
- else
+ else
in_x = area.left + area.width() + step.x + step.padding.left; // value relative to the opposite corner.
break;
diff --git a/graphics/VectorRenderer.h b/graphics/VectorRenderer.h
index e98f4aa761..0467cac946 100644
--- a/graphics/VectorRenderer.h
+++ b/graphics/VectorRenderer.h
@@ -55,7 +55,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 */
-
+
Common::Rect padding;
enum VectorAlignment {
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index 1ed5a3308a..6a3ee306a5 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -369,12 +369,12 @@ gradientFill(PixelType *ptr, int width, int x, int y) {
int grad = (((y - _gradIndexes[curGrad]) % stripSize) << 2) / stripSize;
// Dithering:
- // +--+ +--+ +--+ +--+
- // | | | | | *| | *|
- // | | | *| |* | |**|
- // +--+ +--+ +--+ +--+
+ // +--+ +--+ +--+ +--+
+ // | | | | | *| | *|
+ // | | | *| |* | |**|
+ // +--+ +--+ +--+ +--+
// 0 1 2 3
- if (grad == 0 ||
+ if (grad == 0 ||
_gradCache[curGrad] == _gradCache[curGrad + 1] || // no color change
stripSize < 2) { // the stip is small
colorFill<PixelType>(ptr, ptr + width, _gradCache[curGrad]);
@@ -873,7 +873,7 @@ drawTriangle(int x, int y, int w, int h, TriangleOrientation orient) {
case kTriangleDown:
drawTriangleVertAlg(x, y, newW, newH, (orient == kTriangleDown), color, Base::_fillMode);
break;
-
+
case kTriangleLeft:
case kTriangleRight:
case kTriangleAuto:
@@ -1206,14 +1206,14 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
pitch = -pitch;
y1 += h;
}
-
+
PixelType *ptr_right = (PixelType *)_activeSurface->getBasePtr(x1, y1);
PixelType *floor = ptr_right - 1;
PixelType *ptr_left = (PixelType *)_activeSurface->getBasePtr(x1 + w, y1);
int x2 = x1 + w / 2;
int y2 = y1 + h;
-
+
#if FIXED_POINT
int dx = (x2 - x1) << 8;
int dy = (y2 - y1) << 8;
@@ -1227,7 +1227,7 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
#endif
while (floor++ != ptr_left)
blendPixelPtr(floor, color, 50);
-
+
#if FIXED_POINT
int gradient = (dy << 8) / dx;
int intery = (y1 << 8) + gradient;
@@ -1250,7 +1250,7 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
ptr_right += pitch;
intery += gradient;
-
+
switch (fill_m) {
case kFillDisabled:
*ptr_left = *ptr_right = color;
@@ -1262,16 +1262,16 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
blendPixelPtr(ptr_left, color, rfpart(intery));
break;
case kFillGradient:
- colorFill<PixelType>(ptr_right, ptr_left, calcGradient(gradient_h++, h));
+ colorFill<PixelType>(ptr_right, ptr_left, calcGradient(gradient_h++, h));
blendPixelPtr(ptr_right, color, rfpart(intery));
blendPixelPtr(ptr_left, color, rfpart(intery));
break;
}
}
-
+
return;
}
-
+
#if FIXED_POINT
if (abs(dx) < abs(dy)) {
#else
@@ -1280,7 +1280,7 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
ptr_left--;
while (floor++ != ptr_left)
blendPixelPtr(floor, color, 50);
-
+
#if FIXED_POINT
int gradient = (dx << 8) / (dy + 0x100);
int interx = (x1 << 8) + gradient;
@@ -1303,7 +1303,7 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
ptr_right += pitch;
interx += gradient;
-
+
switch (fill_m) {
case kFillDisabled:
*ptr_left = *ptr_right = color;
@@ -1315,18 +1315,18 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
blendPixelPtr(ptr_left, color, rfpart(interx));
break;
case kFillGradient:
- colorFill<PixelType>(ptr_right, ptr_left, calcGradient(gradient_h++, h));
+ colorFill<PixelType>(ptr_right, ptr_left, calcGradient(gradient_h++, h));
blendPixelPtr(ptr_right, color, rfpart(interx));
blendPixelPtr(ptr_left, color, rfpart(interx));
break;
}
}
-
+
return;
}
-
+
ptr_left--;
-
+
while (floor++ != ptr_left)
blendPixelPtr(floor, color, 50);
@@ -1341,12 +1341,12 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
for (int y = y1 + 1; y < y2; y++) {
ptr_right++;
ptr_left--;
-
+
ptr_left += pitch;
ptr_right += pitch;
interx += gradient;
-
+
switch (fill_m) {
case kFillDisabled:
*ptr_left = *ptr_right = color;
@@ -1358,13 +1358,13 @@ drawTriangleVertAlg(int x1, int y1, int w, int h, bool inverted, PixelType color
blendPixelPtr(ptr_left, color, rfpart(interx));
break;
case kFillGradient:
- colorFill<PixelType>(ptr_right, ptr_left, calcGradient(gradient_h++, h));
+ colorFill<PixelType>(ptr_right, ptr_left, calcGradient(gradient_h++, h));
blendPixelPtr(ptr_right, color, rfpart(interx));
blendPixelPtr(ptr_left, color, rfpart(interx));
break;
}
}
-
+
}
/** VERTICAL TRIANGLE DRAWING - FAST VERSION FOR SQUARED TRIANGLES */
@@ -1372,12 +1372,12 @@ template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawTriangleFast(int x1, int y1, int size, bool inverted, PixelType color, VectorRenderer::FillMode fill_m) {
int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
-
+
if (!inverted) {
pitch = -pitch;
y1 += size;
}
-
+
int gradient_h = 0;
PixelType *ptr_right = (PixelType *)_activeSurface->getBasePtr(x1, y1);
PixelType *ptr_left = (PixelType *)_activeSurface->getBasePtr(x1 + size, y1);
@@ -1388,9 +1388,9 @@ drawTriangleFast(int x1, int y1, int size, bool inverted, PixelType color, Vecto
int signX = x1 < x2 ? 1 : -1;
int signY = y1 < y2 ? 1 : -1;
int error = deltaX - deltaY;
-
+
colorFill<PixelType>(ptr_right, ptr_left, color);
-
+
while (1) {
switch (fill_m) {
case kFillDisabled:
@@ -1401,22 +1401,22 @@ drawTriangleFast(int x1, int y1, int size, bool inverted, PixelType color, Vecto
colorFill<PixelType>(ptr_right, ptr_left, color);
break;
case kFillGradient:
- colorFill<PixelType>(ptr_right, ptr_left, calcGradient(gradient_h++, size));
+ colorFill<PixelType>(ptr_right, ptr_left, calcGradient(gradient_h++, size));
break;
}
-
+
if (x1 == x2 && y1 == y2)
break;
-
+
int error2 = error * 2;
-
+
if (error2 > -deltaY) {
error -= deltaY;
x1 += signX;
ptr_right += signX;
ptr_left += -signX;
}
-
+
if (error2 < deltaX) {
error += deltaX;
y1 += signY;
diff --git a/graphics/decoders/bmp.cpp b/graphics/decoders/bmp.cpp
index 0d2165643d..bcfd0abbda 100644
--- a/graphics/decoders/bmp.cpp
+++ b/graphics/decoders/bmp.cpp
@@ -155,7 +155,7 @@ bool BitmapDecoder::loadStream(Common::SeekableReadStream &stream) {
}
} else { // 32 bpp
byte *dst = (byte *)_surface->pixels + (height - 1) * _surface->pitch;
-
+
for (int32 i = 0; i < height; i++) {
for (uint32 j = 0; j < width; j++) {
byte b = stream.readByte();
@@ -166,11 +166,11 @@ bool BitmapDecoder::loadStream(Common::SeekableReadStream &stream) {
// ref: http://msdn.microsoft.com/en-us/library/windows/desktop/dd183376%28v=vs.85%29.aspx
stream.readByte();
uint32 color = format.RGBToColor(r, g, b);
-
+
*((uint32 *)dst) = color;
dst += format.bytesPerPixel;
}
-
+
stream.skip(extraDataLength);
dst -= _surface->pitch * 2;
}
diff --git a/graphics/decoders/jpeg.cpp b/graphics/decoders/jpeg.cpp
index 748275b84b..08bc1f7a3d 100644
--- a/graphics/decoders/jpeg.cpp
+++ b/graphics/decoders/jpeg.cpp
@@ -452,7 +452,7 @@ bool JPEGDecoder::readSOS() {
_bitsNumber = 0;
for (byte i = 0; i < _numScanComp; i++)
- _scanComp[i]->DCpredictor = 0;
+ _scanComp[i]->DCpredictor = 0;
}
}
}
diff --git a/graphics/decoders/pcx.cpp b/graphics/decoders/pcx.cpp
index f5c1c24bb0..1250398c73 100644
--- a/graphics/decoders/pcx.cpp
+++ b/graphics/decoders/pcx.cpp
@@ -59,33 +59,33 @@ void PCXDecoder::destroy() {
bool PCXDecoder::loadStream(Common::SeekableReadStream &stream) {
destroy();
-
+
if (stream.readByte() != 0x0a) // ZSoft PCX
return false;
-
+
byte version = stream.readByte(); // 0 - 5
if (version > 5)
return false;
-
+
bool compressed = stream.readByte(); // encoding, 1 = run length encoding
byte bitsPerPixel = stream.readByte(); // 1, 2, 4 or 8
-
+
// Window
uint16 xMin = stream.readUint16LE();
uint16 yMin = stream.readUint16LE();
uint16 xMax = stream.readUint16LE();
uint16 yMax = stream.readUint16LE();
-
+
uint16 width = xMax - xMin + 1;
uint16 height = yMax - yMin + 1;
-
+
if (xMax < xMin || yMax < yMin) {
warning("Invalid PCX image dimensions");
return false;
}
-
+
stream.skip(4); // HDpi, VDpi
-
+
// Read the EGA palette (colormap)
_palette = new byte[16 * 3];
for (uint16 i = 0; i < 16; i++) {
@@ -96,24 +96,24 @@ bool PCXDecoder::loadStream(Common::SeekableReadStream &stream) {
if (stream.readByte() != 0) // reserved, should be set to 0
return false;
-
+
byte nPlanes = stream.readByte();
uint16 bytesPerLine = stream.readUint16LE();
uint16 bytesPerscanLine = nPlanes * bytesPerLine;
-
+
if (bytesPerscanLine < width * bitsPerPixel * nPlanes / 8) {
warning("PCX data is corrupted");
return false;
}
-
+
stream.skip(60); // PaletteInfo, HscreenSize, VscreenSize, Filler
-
+
_surface = new Graphics::Surface();
-
+
byte *scanLine = new byte[bytesPerscanLine];
byte *dst;
int x, y;
-
+
if (nPlanes == 3 && bitsPerPixel == 8) { // 24bpp
Graphics::PixelFormat format = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
_surface->create(width, height, format);
@@ -142,14 +142,14 @@ bool PCXDecoder::loadStream(Common::SeekableReadStream &stream) {
decodeRLE(stream, scanLine, bytesPerscanLine, compressed);
memcpy(dst, scanLine, width);
}
-
+
if (version == 5) {
if (stream.readByte() != 12) {
warning("Expected a palette after the PCX image data");
delete[] scanLine;
return false;
}
-
+
// Read the VGA palette
delete[] _palette;
_palette = new byte[256 * 3];
@@ -186,7 +186,7 @@ bool PCXDecoder::loadStream(Common::SeekableReadStream &stream) {
}
delete[] scanLine;
-
+
return true;
}
diff --git a/graphics/decoders/pcx.h b/graphics/decoders/pcx.h
index bcff754a2d..b25166b3d9 100644
--- a/graphics/decoders/pcx.h
+++ b/graphics/decoders/pcx.h
@@ -57,7 +57,7 @@ public:
private:
void decodeRLE(Common::SeekableReadStream &stream, byte *dst, uint32 bytesPerScanline, bool compressed);
-
+
Surface *_surface;
byte *_palette;
uint16 _paletteColorCount;
diff --git a/graphics/decoders/pict.cpp b/graphics/decoders/pict.cpp
index 9e619df208..d35e5c3064 100644
--- a/graphics/decoders/pict.cpp
+++ b/graphics/decoders/pict.cpp
@@ -543,7 +543,7 @@ void PICTDecoder::decodeCompressedQuickTime(Common::SeekableReadStream &stream)
// Skip the matte and mask
stream.skip(matteSize + maskSize);
-
+
// Now we've reached the image descriptor, so read the relevant data from that
uint32 idStart = stream.pos();
uint32 idSize = stream.readUint32BE();
diff --git a/graphics/fonts/consolefont.cpp b/graphics/fonts/consolefont.cpp
index 8244d75fc2..748aa08a5c 100644
--- a/graphics/fonts/consolefont.cpp
+++ b/graphics/fonts/consolefont.cpp
@@ -1,7 +1,7 @@
// Generated by convbdf on Fri Jan 6 14:32:21 2012
#include "graphics/fonts/bdf.h"
-// Font information:
+// Font information:
// Name: -Misc-Fixed-Medium-R-Normal--8-80-75-75-C-50-ISO8859-1
// Size: 5x8
// Box: 5 8 0 -1
diff --git a/graphics/fonts/newfont.cpp b/graphics/fonts/newfont.cpp
index 10af1efb0c..4922e24676 100644
--- a/graphics/fonts/newfont.cpp
+++ b/graphics/fonts/newfont.cpp
@@ -1,7 +1,7 @@
// Generated by convbdf on Fri Jan 6 14:33:07 2012
#include "graphics/fonts/bdf.h"
-// Font information:
+// Font information:
// Name: -Schumacher-Clean-Medium-R-Normal--12-120-75-75-C-60-ISO8859-1
// Size: 6x12
// Box: 6 12 0 -3
diff --git a/graphics/fonts/newfont_big.cpp b/graphics/fonts/newfont_big.cpp
index 0e61068ade..550d6dbfa9 100644
--- a/graphics/fonts/newfont_big.cpp
+++ b/graphics/fonts/newfont_big.cpp
@@ -1,7 +1,7 @@
// Generated by convbdf on Fri Jan 6 14:33:14 2012
#include "graphics/fonts/bdf.h"
-// Font information:
+// Font information:
// Name: -Adobe-Helvetica-Bold-R-Normal--12-120-75-75-P-70-ISO8859-1
// Size: 13x14
// Box: 13 15 -1 -3
diff --git a/graphics/sjis.h b/graphics/sjis.h
index 2d05005fc3..928332f712 100644
--- a/graphics/sjis.h
+++ b/graphics/sjis.h
@@ -169,7 +169,7 @@ protected:
bool _flippedMode;
int _fontWidth, _fontHeight;
uint8 _bitPosNewLineMask;
-
+
bool isASCII(uint16 ch) const;
virtual const uint8 *getCharData(uint16 c) const = 0;
diff --git a/graphics/yuv_to_rgb.h b/graphics/yuv_to_rgb.h
index 0e832be0ec..f785422c5a 100644
--- a/graphics/yuv_to_rgb.h
+++ b/graphics/yuv_to_rgb.h
@@ -78,7 +78,7 @@ public:
void convert420(Graphics::Surface *dst, LuminanceScale scale, const byte *ySrc, const byte *uSrc, const byte *vSrc, int yWidth, int yHeight, int yPitch, int uvPitch);
/**
- * Convert a YUV410 image to an RGB surface
+ * Convert a YUV410 image to an RGB surface
*
* Since the chroma has a very low resolution in 410, we perform bilinear scaling
* on the two chroma planes to produce the image. The chroma planes must have