diff options
Diffstat (limited to 'src/XPM.cxx')
-rw-r--r-- | src/XPM.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/XPM.cxx b/src/XPM.cxx index 646981a80..0e5795cc5 100644 --- a/src/XPM.cxx +++ b/src/XPM.cxx @@ -117,24 +117,24 @@ void XPM::Init(const char *const *linesForm) { for (int y=0; y<height; y++) { const char *lform = linesForm[y+nColours+1]; - size_t len = MeasureLength(lform); + const size_t len = MeasureLength(lform); for (size_t x = 0; x<len; x++) pixels[y * width + x] = static_cast<unsigned char>(lform[x]); } } -void XPM::Draw(Surface *surface, PRectangle &rc) { +void XPM::Draw(Surface *surface, const PRectangle &rc) { if (pixels.empty()) { return; } // Centre the pixmap - int startY = static_cast<int>(rc.top + (rc.Height() - height) / 2); - int startX = static_cast<int>(rc.left + (rc.Width() - width) / 2); + const int startY = static_cast<int>(rc.top + (rc.Height() - height) / 2); + const int startX = static_cast<int>(rc.left + (rc.Width() - width) / 2); for (int y=0; y<height; y++) { int prevCode = 0; int xStartRun = 0; for (int x=0; x<width; x++) { - int code = pixels[y * width + x]; + const int code = pixels[y * width + x]; if (code != prevCode) { FillRun(surface, prevCode, startX + xStartRun, startY + y, startX + x); xStartRun = x; |