From 384b61a9fbf71eeee093fc47168650b1f4bee283 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 5 Oct 2016 10:47:56 +0300 Subject: CHEWY: Optimize font drawing Thanks to _sev for the suggestion --- engines/chewy/text.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/engines/chewy/text.cpp b/engines/chewy/text.cpp index e877b99f83..5a4a526eee 100644 --- a/engines/chewy/text.cpp +++ b/engines/chewy/text.cpp @@ -162,9 +162,10 @@ Font::Font(Common::String filename) { for (uint n = 0; n < _count; n++) { for (uint y = 0; y < _height; y++) { + p = (byte *)_fontSurface.getBasePtr(n * _width, y); + for (uint x = n * _width; x < n * _width + _width; x++) { - p = (byte *)_fontSurface.getBasePtr(x, y); - *p = (cur & (1 << bitIndex)) ? 0 : 0xFF; + *p++ = (cur & (1 << bitIndex)) ? 0 : 0xFF; bitIndex--; if (bitIndex < 0) { -- cgit v1.2.3