|
19 | 19 | *
|
20 | 20 | */
|
21 | 21 |
|
| 22 | +#include <algorithm> |
22 | 23 | #include <new>
|
23 | 24 |
|
24 | 25 | #include "lib/utils/utils.hpp"
|
@@ -87,7 +88,9 @@ LCDScreenPluginsManager::LCDScreenPluginsManager(const std::string & product)
|
87 | 88 | GKSysLog(LOG_WARNING, WARNING, "no LCD screen plugin initialized");
|
88 | 89 | _noPlugins = true;
|
89 | 90 | }
|
90 |
| - _LCDBuffer.fill(0x0); |
| 91 | + |
| 92 | + /* initialize LCD frame container */ |
| 93 | + _LCDBuffer.resize( DEFAULT_PBM_DATA_IN_BYTES + LCD_DATA_HEADER_OFFSET, 0 ); |
91 | 94 | }
|
92 | 95 |
|
93 | 96 | LCDScreenPluginsManager::~LCDScreenPluginsManager() {
|
@@ -224,15 +227,17 @@ LCDDataArray & LCDScreenPluginsManager::getNextLCDScreenBuffer(
|
224 | 227 | (*_itCurrentPlugin)->getNextPBMFrame(_pFonts, LCDKey, _currentPluginLocked)
|
225 | 228 | );
|
226 | 229 | }
|
227 |
| - else /* else blank screen */ |
228 |
| - _LCDBuffer.fill(0x0); |
| 230 | + else { |
| 231 | + /* blank screen */ |
| 232 | + std::fill(_LCDBuffer.begin(), _LCDBuffer.end(), 0x0); |
| 233 | + } |
229 | 234 | }
|
230 | 235 | catch (const GLogiKExcept & e) {
|
231 | 236 | LOG(ERROR) << e.what();
|
232 |
| - _LCDBuffer.fill(0x0); |
| 237 | + std::fill(_LCDBuffer.begin(), _LCDBuffer.end(), 0x0); |
233 | 238 | }
|
234 | 239 |
|
235 |
| - std::fill_n(_LCDBuffer.begin(), LCD_BUFFER_OFFSET, 0); |
| 240 | + std::fill_n(_LCDBuffer.begin(), LCD_DATA_HEADER_OFFSET, 0x0); |
236 | 241 | }
|
237 | 242 |
|
238 | 243 | /* the keyboard needs this magic byte */
|
@@ -323,7 +328,7 @@ void LCDScreenPluginsManager::dumpPBMDataIntoLCDBuffer(LCDDataArray & LCDBuffer,
|
323 | 328 | << " bit: " << bit << "\n";
|
324 | 329 | #endif
|
325 | 330 |
|
326 |
| - LCDBuffer[LCD_BUFFER_OFFSET + LCDCol + indexOffset] = |
| 331 | + LCDBuffer[LCD_DATA_HEADER_OFFSET + LCDCol + indexOffset] = |
327 | 332 | (((PBMData[PBMByte + (DEFAULT_PBM_WIDTH_IN_BYTES * 0) + indexOffset] >> bit) & 1) << 0 ) |
|
328 | 333 | (((PBMData[PBMByte + (DEFAULT_PBM_WIDTH_IN_BYTES * 1) + indexOffset] >> bit) & 1) << 1 ) |
|
329 | 334 | (((PBMData[PBMByte + (DEFAULT_PBM_WIDTH_IN_BYTES * 2) + indexOffset] >> bit) & 1) << 2 ) |
|
|
0 commit comments