summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2012-04-12 03:01:08 +0300
committerAndrei Karas <akaras@inbox.ru>2012-04-12 03:01:08 +0300
commit4f927ef3e48d8543fcb0c1fc99798b20037d9170 (patch)
tree3adc8652bb7c9185839ec559a42daf3a651bba66
parent64e746127640a22e36d8ec98f33a64032a1dd1dc (diff)
downloadmanaverse-4f927ef3e48d8543fcb0c1fc99798b20037d9170.tar.gz
manaverse-4f927ef3e48d8543fcb0c1fc99798b20037d9170.tar.bz2
manaverse-4f927ef3e48d8543fcb0c1fc99798b20037d9170.tar.xz
manaverse-4f927ef3e48d8543fcb0c1fc99798b20037d9170.zip
Fix fast fill rectangle function.
-rw-r--r--src/graphics.cpp8
1 files changed, 4 insertions, 4 deletions
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;