From 4f927ef3e48d8543fcb0c1fc99798b20037d9170 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Thu, 12 Apr 2012 03:01:08 +0300 Subject: Fix fast fill rectangle function. --- src/graphics.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/graphics.cpp b/src/graphics.cpp index 3a6aef3bc..3b2ec1fd8 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -926,9 +926,9 @@ void Graphics::fillRectangle(const gcn::Rectangle& rectangle) #else if (!cR) { - cR = new unsigned int[0xff]; - cG = new unsigned int[0xff]; - cB = new unsigned int[0xff]; + cR = new unsigned int[0x100]; + cG = new unsigned int[0x100]; + cB = new unsigned int[0x100]; mOldPixel = 0; mOldAlpha = mColor.a; } @@ -943,7 +943,7 @@ void Graphics::fillRectangle(const gcn::Rectangle& rectangle) const unsigned int a2 = a1 * 0xff; const unsigned int a3 = a1 * 0xff00; - for (int f = 0; f < 0xff; f ++) + for (int f = 0; f <= 0xff; f ++) { cB[f] = ((pb + f * a1) >> 8) & 0xff; cG[f] = ((pg + f * a2) >> 8) & 0xff00; -- cgit v1.2.3-70-g09d2