@@ -1859,7 +1859,7 @@ bool MCObject::GetPixel(MCExecContext& ctxt, Properties which, bool effective, u
18591859
18601860 if (GetColor (ctxt, t_which, effective, t_color))
18611861 {
1862- r_pixel = t_color.color . pixel & 0x00FFFFFF ;
1862+ r_pixel = MCColorGetPixel ( t_color.color ) & 0x00FFFFFF ;
18631863
18641864 MCInterfaceNamedColorFree (ctxt, t_color);
18651865 return true ;
@@ -1874,8 +1874,7 @@ void MCObject::SetPixel(MCExecContext& ctxt, Properties which, uinteger_t pixel)
18741874 if (!getcindex (which - P_FORE_PIXEL, i))
18751875 i = createcindex (which - P_FORE_PIXEL);
18761876
1877- colors[i] . pixel = pixel;
1878- MCscreen -> querycolor (colors[i]);
1877+ MCColorSetPixel (colors[i], pixel);
18791878 if (colornames[i] != nil)
18801879 {
18811880 MCValueRelease (colornames[i]);
@@ -2072,8 +2071,6 @@ void MCObject::SetColor(MCExecContext& ctxt, int index, const MCInterfaceNamedCo
20722071 {
20732072 i = createcindex (index);
20742073 colors[i].red = colors[i].green = colors[i].blue = 0 ;
2075- if (opened)
2076- MCscreen->alloccolor (colors[i]);
20772074 }
20782075 set_interface_color (colors[i], colornames[i], p_color);
20792076
@@ -2084,8 +2081,6 @@ void MCObject::SetColor(MCExecContext& ctxt, int index, const MCInterfaceNamedCo
20842081 MCpatternlist->freepat (patterns[j].pattern );
20852082 destroypindex (index, j);
20862083 }
2087- if (opened)
2088- MCscreen->alloccolor (colors[i]);
20892084 }
20902085}
20912086
@@ -2096,12 +2091,7 @@ bool MCObject::GetColor(MCExecContext& ctxt, Properties which, bool effective, M
20962091 {
20972092 get_interface_color (colors[i], colornames[i], r_color);
20982093
2099- // AL-2015-05-20: [[ Bug 15378 ]] Reinstate fix for bug 9419:
2100- // If the object isn't already open, then alloc the color first.
2101- if (!opened)
2102- MCscreen -> alloccolor (r_color . color);
2103-
2104- return true ;
2094+ return true ;
21052095 }
21062096 else if (effective)
21072097 {
@@ -2125,7 +2115,6 @@ bool MCObject::GetColor(MCExecContext& ctxt, Properties which, bool effective, M
21252115 if (MCPlatformGetControlThemePropColor (t_control_type, t_control_part, t_control_state, t_control_prop, t_color))
21262116 {
21272117 t_found = true ;
2128- MCscreen->alloccolor (t_color);
21292118 r_color.color = t_color;
21302119 r_color.name = nil;
21312120 }
@@ -2387,8 +2376,6 @@ void MCObject::SetColors(MCExecContext& ctxt, MCStringRef p_input)
23872376 {
23882377 i = createcindex (index);
23892378 colors[i] = t_color . color;
2390- if (opened)
2391- MCscreen->alloccolor (colors[i]);
23922379 colornames[i] = t_color . name == nil ? nil : MCValueRetain (t_color . name);
23932380 }
23942381 else
@@ -2401,7 +2388,6 @@ void MCObject::SetColors(MCExecContext& ctxt, MCStringRef p_input)
24012388 if (opened)
24022389 {
24032390 colors[i] = t_color . color;
2404- MCscreen->alloccolor (colors[i]);
24052391 }
24062392 colornames[i] = t_color . name == nil ? nil : MCValueRetain (t_color . name);
24072393 }
0 commit comments