From cc060261d49e82bcbc482616592d485bdd36c24e Mon Sep 17 00:00:00 2001 From: Christian Kroll Date: Wed, 27 Aug 2014 00:07:50 +0200 Subject: [PATCH] scrolltext3.c: small optimization --- src/scrolltext/scrolltext3.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/scrolltext/scrolltext3.c b/src/scrolltext/scrolltext3.c index f03237b..2f681dd 100644 --- a/src/scrolltext/scrolltext3.c +++ b/src/scrolltext/scrolltext3.c @@ -69,14 +69,9 @@ static void clear_text_pixmap(){ memset(text_pixmap, 0, NUM_ROWS * LINEBYTES); } -void update_pixmap(){ - unsigned char x, y, z; - for(x=NUMPLANE;x--;){ - for(y=NUM_ROWS;y--;){ - for(z=LINEBYTES;z--;){ - pixmap[x][y][z] = (*text_pixmap)[y][z]; - } - } +static void update_pixmap(){ + for(unsigned char p = NUMPLANE; p--;){ + memcpy(&pixmap[p][0][0], text_pixmap, NUM_ROWS * LINEBYTES); } }