diff options
| author | Robert Bieber <robby@bieberphoto.com> | 2010-07-07 07:38:38 +0000 |
|---|---|---|
| committer | Robert Bieber <robby@bieberphoto.com> | 2010-07-07 07:38:38 +0000 |
| commit | e03d37395766cec8daf1605d0fc514818a13c8a1 (patch) | |
| tree | e86357511093619a01517c4e089b02c514e52441 /utils | |
| parent | 60d8cff4f635b2d218def94ce4dd1c149bd5481c (diff) | |
| download | rockbox-e03d37395766cec8daf1605d0fc514818a13c8a1.zip rockbox-e03d37395766cec8daf1605d0fc514818a13c8a1.tar.gz rockbox-e03d37395766cec8daf1605d0fc514818a13c8a1.tar.bz2 rockbox-e03d37395766cec8daf1605d0fc514818a13c8a1.tar.xz | |
Theme Editor: WorkingWorking on speeding up the renderer, replaced for-loops with faster method call
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27329 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'utils')
| -rw-r--r-- | utils/themeeditor/graphics/rbfont.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/utils/themeeditor/graphics/rbfont.cpp b/utils/themeeditor/graphics/rbfont.cpp index e8bff40..07308fa 100644 --- a/utils/themeeditor/graphics/rbfont.cpp +++ b/utils/themeeditor/graphics/rbfont.cpp @@ -109,11 +109,8 @@ RBFont::RBFont(QString file) /* Loading the image data */ imageData = new quint8[header.value("nbits").toInt()]; - for(int i = 0; i < header.value("nbits").toInt(); i++) - { - data >> byte; - imageData[i] = byte; - } + data.readRawData(reinterpret_cast<char*>(imageData), + header.value("nbits").toInt()); /* Aligning on 16-bit boundary */ if(header.value("nbits").toInt() % 2 == 1) @@ -123,22 +120,16 @@ RBFont::RBFont(QString file) if(header.value("noffset").toInt() > 0) { offsetData = new quint16[header.value("noffset").toInt()]; - for(int i = 0; i < header.value("noffset").toInt(); i++) - { - data >> word; - offsetData[i] = word; - } + data.readRawData(reinterpret_cast<char*>(offsetData), + header.value("noffset").toInt() * 2); } /* Loading the width table if necessary */ if(header.value("nwidth").toInt() > 0) { widthData = new quint8[header.value("nwidth").toInt()]; - for(int i = 0; i < header.value("nwidth").toInt(); i++) - { - data >> byte; - widthData[i] = byte; - } + data.readRawData(reinterpret_cast<char*>(widthData), + header.value("nwidth").toInt()); } fin.close(); |