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:
altsysrq
2025-12-30 21:25:33 -06:00
parent 9db4ef6f4b
commit 1f2380be56
8 changed files with 291 additions and 3 deletions

View File

@@ -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;
}