aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/kvirc/kernel/kvi_app.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/kvirc/kernel/kvi_app.cpp b/src/kvirc/kernel/kvi_app.cpp
index 0ae2e5b13..95170fe87 100644
--- a/src/kvirc/kernel/kvi_app.cpp
+++ b/src/kvirc/kernel/kvi_app.cpp
@@ -1138,7 +1138,8 @@ QImage & kimageeffect_fade(QImage &img,float val,const QColor &color)
if (img.depth() <= 8)
{
// pseudo color
- for(int i=0; i<img.numColors(); i++)
+ int c = img.numColors();
+ for(int i=0; i<c; i++)
{
col = img.color(i);
cr = qRed(col); cg = qGreen(col); cb = qBlue(col);
@@ -1152,10 +1153,12 @@ QImage & kimageeffect_fade(QImage &img,float val,const QColor &color)
}
} else {
// truecolor
- for(int y=0; y<img.height(); y++)
+ int h = img.height();
+ int w = img.width();
+ for(int y=0; y<h; y++)
{
QRgb *data = (QRgb *) img.scanLine(y);
- for (int x=0; x<img.width(); x++)
+ for (int x=0; x<w; x++)
{
col = *data;
cr = qRed(col); cg = qGreen(col); cb = qBlue(col);