diff options
-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 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(); |