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

Ken Hughes khughes at pacific.edu
Tue Nov 29 20:32:21 CET 2005


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


More information about the Bf-committers mailing list