void GuiRiverEditorCtrl::_drawRiverControlNodes( River *river, const ColorI &color ) { if ( !River::smShowSpline ) return; RectI bounds = getBounds(); GFXDrawUtil *drawer = GFX->getDrawUtil(); bool isSelected = ( river == mSelRiver ); bool isHighlighted = ( river == mHoverRiver ); for ( U32 i = 0; i < river->mNodes.size(); i++ ) { if ( false && isSelected && mSelNode == i ) continue; const Point3F &wpos = river->mNodes[i].point; Point3F spos; project( wpos, &spos ); if ( spos.z > 1.0f ) continue; Point2I posi; posi.x = spos.x; posi.y = spos.y; if ( !bounds.pointInRect( posi ) ) continue; ColorI theColor = color; Point2I nodeHalfSize = mNodeHalfSize; if ( isHighlighted && mHoverNode == i ) { //theColor = mHoverNodeColor; nodeHalfSize += Point2I(2,2); } if ( isSelected ) { if ( mSelNode == i ) { theColor.set(0,0,255); } else if ( i == 0 ) { theColor.set(0,255,0); } else if ( i == river->mNodes.size() - 1 ) { theColor.set(255,0,0); } } drawer->drawRectFill( posi - nodeHalfSize, posi + nodeHalfSize, theColor ); } }
bool default_scan(const String &data, ColorI & result) { if(StringUnit::getUnitCount(data," ") == 3) { S32 r,g,b; dSscanf(data.c_str(),"%i %i %i",&r,&g,&b); result.set(r,g,b); } else { S32 r,g,b,a; dSscanf(data.c_str(),"%i %i %i %i",&r,&g,&b,&a); result.set(r,g,b,a); } return true; }
void color4f( F32 red, F32 green, F32 blue, F32 alpha ) { mCurColor.set( U8( red * 255 ), U8( green * 255 ), U8( blue * 255 ), U8( alpha * 255 ) ); }
void color3f( F32 red, F32 green, F32 blue ) { mCurColor.set( U8( red * 255 ), U8( green * 255 ), U8( blue * 255 ) ); }
void color4i( U8 red, U8 green, U8 blue, U8 alpha ) { mCurColor.set( red, green, blue, alpha ); }
void color3i( U8 red, U8 green, U8 blue ) { mCurColor.set( red, green, blue ); }