Fixing 2D ledmap

FX_2Dfcn.cpp.setUpMatrix:
- move upstream code to reset==true
- temp table for ledmaps (Idea by By @Troy#2642)

FX_2Dfcn.cpp: init loadedLedmap
This commit is contained in:
Ewoud
2023-01-27 17:11:49 +01:00
parent 6437cc8c7e
commit 6235dc86cc
6 changed files with 221 additions and 207 deletions

View File

@@ -1898,6 +1898,7 @@ void WS2812FX::deserializeMap(uint8_t n) {
customMappingSize = 0;
delete[] customMappingTable;
customMappingTable = nullptr;
loadedLedmap = -1;
}
}
return;
@@ -1918,6 +1919,7 @@ void WS2812FX::deserializeMap(uint8_t n) {
customMappingSize = 0;
delete[] customMappingTable;
customMappingTable = nullptr;
loadedLedmap = -1;
}
JsonArray map = doc[F("map")];
@@ -1933,6 +1935,7 @@ void WS2812FX::deserializeMap(uint8_t n) {
for (uint16_t i=0; i<MIN(map.size(),customMappingSize); i++) {
customMappingTable[i] = (uint16_t) map[i];
}
loadedLedmap = n;
setUpMatrix(false); //WLEDMM: apply logical to physical mapping after the ledmap
}
else