summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Bieber <robby@bieberphoto.com>2010-07-07 07:38:38 +0000
committerRobert Bieber <robby@bieberphoto.com>2010-07-07 07:38:38 +0000
commite03d37395766cec8daf1605d0fc514818a13c8a1 (patch)
treee86357511093619a01517c4e089b02c514e52441
parent60d8cff4f635b2d218def94ce4dd1c149bd5481c (diff)
downloadrockbox-e03d37395766cec8daf1605d0fc514818a13c8a1.tar.gz
rockbox-e03d37395766cec8daf1605d0fc514818a13c8a1.zip
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
-rw-r--r--utils/themeeditor/graphics/rbfont.cpp21
1 files changed, 6 insertions, 15 deletions
diff --git a/utils/themeeditor/graphics/rbfont.cpp b/utils/themeeditor/graphics/rbfont.cpp
index e8bff40e13..07308fac7e 100644
--- a/utils/themeeditor/graphics/rbfont.cpp
+++ b/utils/themeeditor/graphics/rbfont.cpp
@@ -109,11 +109,8 @@ RBFont::RBFont(QString file)
109 109
110 /* Loading the image data */ 110 /* Loading the image data */
111 imageData = new quint8[header.value("nbits").toInt()]; 111 imageData = new quint8[header.value("nbits").toInt()];
112 for(int i = 0; i < header.value("nbits").toInt(); i++) 112 data.readRawData(reinterpret_cast<char*>(imageData),
113 { 113 header.value("nbits").toInt());
114 data >> byte;
115 imageData[i] = byte;
116 }
117 114
118 /* Aligning on 16-bit boundary */ 115 /* Aligning on 16-bit boundary */
119 if(header.value("nbits").toInt() % 2 == 1) 116 if(header.value("nbits").toInt() % 2 == 1)
@@ -123,22 +120,16 @@ RBFont::RBFont(QString file)
123 if(header.value("noffset").toInt() > 0) 120 if(header.value("noffset").toInt() > 0)
124 { 121 {
125 offsetData = new quint16[header.value("noffset").toInt()]; 122 offsetData = new quint16[header.value("noffset").toInt()];
126 for(int i = 0; i < header.value("noffset").toInt(); i++) 123 data.readRawData(reinterpret_cast<char*>(offsetData),
127 { 124 header.value("noffset").toInt() * 2);
128 data >> word;
129 offsetData[i] = word;
130 }
131 } 125 }
132 126
133 /* Loading the width table if necessary */ 127 /* Loading the width table if necessary */
134 if(header.value("nwidth").toInt() > 0) 128 if(header.value("nwidth").toInt() > 0)
135 { 129 {
136 widthData = new quint8[header.value("nwidth").toInt()]; 130 widthData = new quint8[header.value("nwidth").toInt()];
137 for(int i = 0; i < header.value("nwidth").toInt(); i++) 131 data.readRawData(reinterpret_cast<char*>(widthData),
138 { 132 header.value("nwidth").toInt());
139 data >> byte;
140 widthData[i] = byte;
141 }
142 } 133 }
143 134
144 fin.close(); 135 fin.close();