Refactor image rendering and add Bluetooth setting
- Added logic to render images only in BW mode in Page.cpp. - Implemented getRenderMode() in GfxRenderer.h. - Increased SETTINGS_COUNT and added bluetoothEnabled field in CrossPointSettings. - Updated saveToFile and loadFromFile methods to handle the new Bluetooth setting. - Added Bluetooth toggle in SettingsActivity.
This commit is contained in:
@@ -29,8 +29,13 @@ std::unique_ptr<PageLine> PageLine::deserialize(FsFile& file) {
|
||||
}
|
||||
|
||||
void PageImage::render(GfxRenderer& renderer, const int fontId, const int xOffset, const int yOffset) {
|
||||
// Only render images in BW mode, skip grayscale passes to keep images sharp
|
||||
if (renderer.getRenderMode() != GfxRenderer::BW) {
|
||||
return;
|
||||
}
|
||||
|
||||
FsFile imageFile;
|
||||
if (!SdMan.openFileForRead("PGI", cachePath, imageFile)) {
|
||||
if (!SdMan.openFileForRead("PGI", cachePath.c_str(), imageFile)) {
|
||||
Serial.printf("[%lu] [PGI] Failed to open image: %s\n", millis(), cachePath.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user