[Bf-committers] Bug (or strange code) in draw_marker()

Ton Roosendaal ton at blender.org
Tue Nov 29 22:25:49 CET 2005


Hi,

That's plainly a bug, it should get an int. The colorid defines what it  
should blend with, in this case that's TH_BACK.
For you the honour to commit it, thanks! :)

-Ton-


On 29 Nov, 2005, at 20:32, Ken Hughes wrote:

> While working on the 64-bit port, came across this code in  
> source/blender/src/drawtime.c:draw_marker():
>
>  float xpos, col[3];
>
> ....
>
>  if(marker->flag & SELECT)
>    BIF_draw_icon_blended(xpos-(5.0*(xspace/xpixels)),
>         12.0*yspace/ypixels, ICON_MARKER_HLT, (int)col, 0);
>  else
>    BIF_draw_icon_blended(xpos-(5.0*(xspace/xpixels)),
>         12.0*yspace/ypixels, ICON_MARKER, (int)col, 0);
>
> BIF_draw_icon_blended() calls BIF_ThemeGetColorPtr() with col (as an  
> int), which then uses col in a case statement.
>
> It seems highly unlikely that the stack address is going to match one  
> of the constants....
>
> Someone with knowledge of the code want to fix this?
>
> Ken
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
>
>
------------------------------------------------------------------------ 
--
Ton Roosendaal  Blender Foundation ton at blender.org  
http://www.blender.org



More information about the Bf-committers mailing list