From 888b292d7377b3192dfa9aea4dfe815ed60e0b7e Mon Sep 17 00:00:00 2001 From: Adam Honse Date: Sun, 30 Jul 2023 13:26:34 -0500 Subject: [PATCH] Fix Razer matrix map initialization for non-keyboard zones --- .../RazerController/RGBController_Razer.cpp | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/Controllers/RazerController/RGBController_Razer.cpp b/Controllers/RazerController/RGBController_Razer.cpp index 148a9d50..da04b94b 100644 --- a/Controllers/RazerController/RGBController_Razer.cpp +++ b/Controllers/RazerController/RGBController_Razer.cpp @@ -238,6 +238,26 @@ void RGBController_Razer::SetupZones() continue; } + else + { + /*---------------------------------------------------------*\ + | Handle all other matrix type zones by filling in all | + | entries | + \*---------------------------------------------------------*/ + matrix_map_type * new_map = new matrix_map_type; + new_zone.matrix_map = new_map; + new_map->height = device_list[device_index]->zones[zone_id]->rows; + new_map->width = device_list[device_index]->zones[zone_id]->cols; + new_map->map = new unsigned int[new_map->height * new_map->width]; + + for(unsigned int y = 0; y < new_map->height; y++) + { + for(unsigned int x = 0; x < new_map->width; x++) + { + new_map->map[(y * new_map->width) + x] = (y * new_map->width) + x; + } + } + } } else {