Fix: Overlay: Compilation error on OpenGL
Caused by reserved `active` keyword in GLSL.
This commit is contained in:
@@ -216,7 +216,7 @@ class EditText : Overlay {
|
||||
for (const int i : IndexRange(cu.totbox)) {
|
||||
const TextBox &tb = cu.tb[i];
|
||||
const bool is_active = (i == (cu.actbox - 1));
|
||||
const float4 &color = is_active ? res.theme.colors.active : res.theme.colors.wire;
|
||||
const float4 &color = is_active ? res.theme.colors.active_object : res.theme.colors.wire;
|
||||
|
||||
if ((tb.w != 0.0f) || (tb.h != 0.0f)) {
|
||||
const float3 top_left = float3(cu.xof + tb.x, cu.yof + tb.y + cu.fsize_realtime, 0.001);
|
||||
|
||||
@@ -243,7 +243,7 @@ void Resources::update_theme_settings(const DRWContext *ctx, const State &state)
|
||||
|
||||
UI_GetThemeColor4fv(TH_WIRE, gb.colors.wire);
|
||||
UI_GetThemeColor4fv(TH_WIRE_EDIT, gb.colors.wire_edit);
|
||||
UI_GetThemeColor4fv(TH_ACTIVE, gb.colors.active);
|
||||
UI_GetThemeColor4fv(TH_ACTIVE, gb.colors.active_object);
|
||||
UI_GetThemeColor4fv(TH_SELECT, gb.colors.select);
|
||||
gb.colors.library_select = rgba_uchar_to_float(0x88, 0xFF, 0xFF, 155);
|
||||
gb.colors.library = rgba_uchar_to_float(0x55, 0xCC, 0xCC, 155);
|
||||
|
||||
@@ -58,7 +58,7 @@ class Origins : Overlay {
|
||||
|
||||
if (ob == BKE_view_layer_active_object_get(state.view_layer)) {
|
||||
select_buf_.select_append(res.select_id(ob_ref));
|
||||
point_buf_.append(VertexData{location, res.theme.colors.active});
|
||||
point_buf_.append(VertexData{location, res.theme.colors.active_object});
|
||||
}
|
||||
else if (ob->base_flag & BASE_SELECTED) {
|
||||
select_buf_.select_append(res.select_id(ob_ref));
|
||||
|
||||
@@ -870,7 +870,7 @@ struct Resources : public select::SelectMap {
|
||||
case TH_WIRE_EDIT:
|
||||
return theme.colors.wire_edit;
|
||||
case TH_ACTIVE:
|
||||
return theme.colors.active;
|
||||
return theme.colors.active_object;
|
||||
case TH_SELECT:
|
||||
return theme.colors.select;
|
||||
case TH_TRANSFORM:
|
||||
|
||||
@@ -173,7 +173,7 @@ struct ThemeColors {
|
||||
/* UBOs data needs to be 16 byte aligned (size of float4) */
|
||||
float4 wire;
|
||||
float4 wire_edit;
|
||||
float4 active;
|
||||
float4 active_object; /* "active" is reserved keyword in GLSL. */
|
||||
float4 select;
|
||||
float4 library_select;
|
||||
float4 library;
|
||||
|
||||
@@ -18,7 +18,7 @@ float4 color_from_id(float color_id)
|
||||
return theme.colors.transform;
|
||||
}
|
||||
else if (color_id == 1.0f) {
|
||||
return theme.colors.active;
|
||||
return theme.colors.active_object;
|
||||
}
|
||||
else /* 2.0f */ {
|
||||
return theme.colors.select;
|
||||
|
||||
@@ -239,7 +239,7 @@ void main()
|
||||
frag_color = theme.colors.select;
|
||||
}
|
||||
else if (color_id == 3u) {
|
||||
frag_color = theme.colors.active;
|
||||
frag_color = theme.colors.active_object;
|
||||
}
|
||||
else {
|
||||
frag_color = theme.colors.transform;
|
||||
|
||||
@@ -37,7 +37,7 @@ void wire_color_get(out float3 rim_col, out float3 wire_col)
|
||||
rim_col = theme.colors.transform.rgb;
|
||||
}
|
||||
else if (is_active) {
|
||||
rim_col = theme.colors.active.rgb;
|
||||
rim_col = theme.colors.active_object.rgb;
|
||||
}
|
||||
else {
|
||||
rim_col = theme.colors.select.rgb;
|
||||
|
||||
@@ -38,7 +38,7 @@ void wire_color_get(out float3 rim_col, out float3 wire_col)
|
||||
rim_col = theme.colors.transform.rgb;
|
||||
}
|
||||
else if (is_active) {
|
||||
rim_col = theme.colors.active.rgb;
|
||||
rim_col = theme.colors.active_object.rgb;
|
||||
}
|
||||
else {
|
||||
rim_col = theme.colors.select.rgb;
|
||||
|
||||
Reference in New Issue
Block a user