Bugfix 2D without ledmap

index.js: remove showToast when ledmap not found

FX_2DFCN: Check on ledmapsize >0 for doing logical and physical mapping
This commit is contained in:
Ewoud
2023-02-14 21:47:25 +01:00
parent f62f94270d
commit def3cde8b8
4 changed files with 743 additions and 743 deletions

View File

@@ -80,7 +80,7 @@ void WS2812FX::setUpMatrix(bool reset) {
customMappingSize = Segment::maxWidth * Segment::maxHeight;
uint16_t *customMappingTableCombi = nullptr; //WLEDMM: Idea @Troy#2642
if (loadedLedmap >= 0) { //WLEDMM: @Troy#2642 : include ledmap = 0 as default ledmap
if (customMappingSizeLedmap > 0) { //WLEDMM: @Troy#2642 : include ledmap = 0 as default ledmap
customMappingTableCombi = new uint16_t[customMappingSize];
for (int i=0; i<customMappingSize;i++) customMappingTableCombi[i] = (uint16_t)0xFFFFU; //WLEDMM: init with no show
}
@@ -96,7 +96,7 @@ void WS2812FX::setUpMatrix(bool reset) {
x = (p.vertical?p.bottomStart:p.rightStart) ? h-i-1 : i;
x = p.serpentine && j%2 ? h-x-1 : x;
uint16_t index = (p.yOffset + (p.vertical?x:y)) * Segment::maxWidth + p.xOffset + (p.vertical?y:x);
if (loadedLedmap >= 0) { //WLEDMM: @Troy#2642 : include ledmap = 0 as default ledmap
if (customMappingSizeLedmap > 0) { //WLEDMM: @Troy#2642 : include ledmap = 0 as default ledmap
if (index < customMappingSizeLedmap && customMappingTable[index] < customMappingSize)
customMappingTableCombi[customMappingTable[index]] = pix; //WLEDMM: allow for 2 transitions if reset = false (ledmap and logical to physical)
}
@@ -106,7 +106,7 @@ void WS2812FX::setUpMatrix(bool reset) {
}
}
if (loadedLedmap >= 0) { //WLEDMM: @Troy#2642 : include ledmap = 0 as default ledmap
if (customMappingSizeLedmap > 0) { //WLEDMM: @Troy#2642 : include ledmap = 0 as default ledmap
for (size_t i = 0; i < customMappingSize; i++) {
customMappingTable[i] = customMappingTableCombi[i];
}