mirror of
https://github.com/CalcProgrammer1/OpenRGB.git
synced 2026-09-12 21:28:30 -04:00
Fix missing handling of new zone types and fall back to legacy types for older protocols
This commit is contained in:
1 parent
e6ea038ac8
commit
0ff7f0fcd6
3 files changed
+57
-7
No files matched your search
@@ -3094,9 +3094,31 @@ unsigned char * RGBController::GetZoneDescriptionData(unsigned char* data_ptr, z
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Copy in zone type |
|
||||
| For protocols below 6, convert the new zone types |
|
||||
\*-----------------------------------------------------*/
|
||||
memcpy(data_ptr, &zone.type, sizeof(zone.type));
|
||||
data_ptr += sizeof(zone.type);
|
||||
zone_type type = zone.type;
|
||||
|
||||
if(protocol_version < 6)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case ZONE_TYPE_LINEAR_LOOP:
|
||||
type = ZONE_TYPE_LINEAR;
|
||||
break;
|
||||
|
||||
case ZONE_TYPE_MATRIX_LOOP_X:
|
||||
case ZONE_TYPE_MATRIX_LOOP_Y:
|
||||
type = ZONE_TYPE_MATRIX;
|
||||
break;
|
||||
|
||||
case ZONE_TYPE_SEGMENTED:
|
||||
type = ZONE_TYPE_LINEAR;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
memcpy(data_ptr, &type, sizeof(type));
|
||||
data_ptr += sizeof(type);
|
||||
|
||||
/*-----------------------------------------------------*\
|
||||
| Check for resizable effects-only zone. For protocol |
|
||||
|
||||
+12
-4
@@ -1146,7 +1146,9 @@ void DeviceView::InitDeviceView()
|
||||
/*-------------------------------------------------*\
|
||||
| For matrix zones, use matrix height from the map |
|
||||
\*-------------------------------------------------*/
|
||||
if(controller->GetZoneType(zone_idx) == ZONE_TYPE_MATRIX)
|
||||
if((controller->GetZoneType(zone_idx) == ZONE_TYPE_MATRIX)
|
||||
|| (controller->GetZoneType(zone_idx) == ZONE_TYPE_MATRIX_LOOP_X)
|
||||
|| (controller->GetZoneType(zone_idx) == ZONE_TYPE_MATRIX_LOOP_Y))
|
||||
{
|
||||
total_height += controller->GetZoneMatrixMapHeight(zone_idx);
|
||||
zone_pos[zone_idx].matrix_w = controller->GetZoneMatrixMapWidth(zone_idx);
|
||||
@@ -1159,7 +1161,9 @@ void DeviceView::InitDeviceView()
|
||||
{
|
||||
for(unsigned int segment_idx = 0; segment_idx < controller->GetZoneSegmentCount(zone_idx); segment_idx++)
|
||||
{
|
||||
if(controller->GetZoneSegmentType(zone_idx, segment_idx) == ZONE_TYPE_MATRIX)
|
||||
if((controller->GetZoneSegmentType(zone_idx, segment_idx) == ZONE_TYPE_MATRIX)
|
||||
|| (controller->GetZoneSegmentType(zone_idx, segment_idx) == ZONE_TYPE_MATRIX_LOOP_X)
|
||||
|| (controller->GetZoneSegmentType(zone_idx, segment_idx) == ZONE_TYPE_MATRIX_LOOP_Y))
|
||||
{
|
||||
total_height += controller->GetZoneSegmentMatrixMapHeight(zone_idx, segment_idx);
|
||||
zone_pos[zone_idx].matrix_w = controller->GetZoneSegmentMatrixMapWidth(zone_idx, segment_idx);
|
||||
@@ -1218,7 +1222,9 @@ void DeviceView::InitDeviceView()
|
||||
/*-------------------------------------------------*\
|
||||
| Calculate LEDs position and size for zone |
|
||||
\*-------------------------------------------------*/
|
||||
if(controller->GetZoneType(zone_idx) == ZONE_TYPE_MATRIX)
|
||||
if((controller->GetZoneType(zone_idx) == ZONE_TYPE_MATRIX)
|
||||
|| (controller->GetZoneType(zone_idx) == ZONE_TYPE_MATRIX_LOOP_X)
|
||||
|| (controller->GetZoneType(zone_idx) == ZONE_TYPE_MATRIX_LOOP_Y))
|
||||
{
|
||||
for(unsigned int led_x = 0; led_x < controller->GetZoneMatrixMapWidth(zone_idx); led_x++)
|
||||
{
|
||||
@@ -1323,7 +1329,9 @@ void DeviceView::InitDeviceView()
|
||||
|
||||
segment_count++;
|
||||
|
||||
if(controller->GetZoneSegmentType(zone_idx, segment_idx) == ZONE_TYPE_MATRIX)
|
||||
if((controller->GetZoneSegmentType(zone_idx, segment_idx) == ZONE_TYPE_MATRIX)
|
||||
|| (controller->GetZoneSegmentType(zone_idx, segment_idx) == ZONE_TYPE_MATRIX_LOOP_X)
|
||||
|| (controller->GetZoneSegmentType(zone_idx, segment_idx) == ZONE_TYPE_MATRIX_LOOP_Y))
|
||||
{
|
||||
for(unsigned int led_x = 0; led_x < controller->GetZoneSegmentMatrixMapWidth(zone_idx, segment_idx); led_x++)
|
||||
{
|
||||
|
||||
@@ -267,15 +267,35 @@ void OpenRGBClientInfoPage::UpdateInfo()
|
||||
{
|
||||
case ZONE_TYPE_SINGLE:
|
||||
zone_str.append("Single");
|
||||
break;
|
||||
break;
|
||||
|
||||
case ZONE_TYPE_LINEAR:
|
||||
zone_str.append("Linear");
|
||||
break;
|
||||
|
||||
case ZONE_TYPE_LINEAR_LOOP:
|
||||
zone_str.append("Linear Loop");
|
||||
break;
|
||||
|
||||
case ZONE_TYPE_MATRIX:
|
||||
zone_str.append("Matrix");
|
||||
break;
|
||||
|
||||
case ZONE_TYPE_MATRIX_LOOP_X:
|
||||
zone_str.append("Matrix Loop X");
|
||||
break;
|
||||
|
||||
case ZONE_TYPE_MATRIX_LOOP_Y:
|
||||
zone_str.append("Matrix Loop Y");
|
||||
break;
|
||||
|
||||
case ZONE_TYPE_SEGMENTED:
|
||||
zone_str.append("Segmented");
|
||||
break;
|
||||
|
||||
default:
|
||||
zone_str.append("Unknown");
|
||||
break;
|
||||
}
|
||||
|
||||
new_child->setText(0, QString::fromStdString(zone_str));
|
||||
|
||||
Reference in new issue
Block a user