int plRTOmniLight::DrawConeAndLine( TimeValue t, INode* inode, GraphicsWindow *gw, int drawing ) { float atOneHalfDist; Matrix3 tm = inode->GetObjectTM( t ); gw->setTransform( tm ); gw->clearHitCode(); if( ( extDispFlags & EXT_DISP_ONLY_SELECTED ) ) { if( GetUseAtten() ) { // Draw hotspot as the point at which light is 1/2 intensity (just to help the visual) gw->setColor( LINE_COLOR, GetUIColor( COLOR_HOTSPOT ) ); if( fLightPB->GetInt( kAttenTypeRadio, t ) == 0 ) atOneHalfDist = GetAtten( t, ATTEN_END ) / ( fLightPB->GetFloat( kIntensity, t ) * plSillyLightKonstants::GetFarPowerKonst() - 1.f ); else atOneHalfDist = sqrt( GetAtten( t, ATTEN_END ) * GetAtten( t, ATTEN_END ) / ( fLightPB->GetFloat( kIntensity, t ) * plSillyLightKonstants::GetFarPowerKonst() - 1.f ) ); if( atOneHalfDist > 0.0f ) DrawCone( t, gw, atOneHalfDist ); gw->setColor( LINE_COLOR, GetUIColor( COLOR_FALLOFF ) ); DrawCone( t, gw, GetAtten( t, ATTEN_END ) ); } else DrawArrows( t, gw, 50 ); } return gw->checkHitCode(); }
// Draw test + parameter selection arrows and the specified string // at the bottom of the screen. void FullscreenUI::Draw(const std::string &footer) { if (m_enabled) { DrawArrows(); DrawFooterText(footer); } }
void C_mode_configuration::DrawItem(const S_config_item &ec, const S_rect &rc_item, dword text_color) const{ bool draw_arrow_l = false, draw_arrow_r = false; //draw additional item info int xx = rc_item.x, yy = rc_item.y + 1 + app.fdb.line_spacing; if(app.IsWideScreen()) xx += app.fdb.letter_size_x*5; else xx += app.fdb.letter_size_x; Cstr_w txt; if(GetConfigOptionText(ec, txt, draw_arrow_l, draw_arrow_r)){ app.DrawString(txt, rc_item.CenterX(), yy, app.UI_FONT_BIG, FF_CENTER, text_color); }else switch(ec.ctype){ case CFG_ITEM_TEXTBOX_CSTR: case CFG_ITEM_PASSWORD: //case CFG_ITEM_TEXT_NUMBER: { Cstr_w sw; switch(ec.is_wide){ case 0: { const Cstr_c &str = *(Cstr_c*)(cfg_base + ec.elem_offset); sw.Copy(str); } break; case 1: sw = *(Cstr_w*)(cfg_base + ec.elem_offset); break; case 2: { const Cstr_c &str = *(Cstr_c*)(cfg_base + ec.elem_offset); sw.FromUtf8(str); } break; default: assert(0); } if(ec.ctype==CFG_ITEM_PASSWORD) text_utils::MaskPassword(sw); app.DrawString(sw, xx, yy, app.UI_FONT_BIG, 0, text_color, -max_textbox_width); } break; case CFG_ITEM_NUMBER: case CFG_ITEM_SIGNED_NUMBER: { int n; if(ec.ctype==CFG_ITEM_NUMBER) n = *(word*)(cfg_base + ec.elem_offset); else n = *(short*)(cfg_base + ec.elem_offset); if(n){ Cstr_w s; s<<n; app.DrawString(s, xx, yy, app.UI_FONT_BIG, 0, text_color, -max_textbox_width); } } break; case CFG_ITEM_CHECKBOX: case CFG_ITEM_CHECKBOX_INV: { int x1, y1, size; CalcCheckboxPosition(rc_item, x1, y1, size); bool on; if(ec.param){ const dword &flags = *(dword*)(cfg_base + ec.elem_offset); on = (flags&ec.param); }else{ on = *(bool*)(cfg_base + ec.elem_offset); } if(ec.ctype==CFG_ITEM_CHECKBOX_INV) on = !on; app.DrawCheckbox(x1, yy, size, on); } break; } DrawArrows(rc_item, text_color, draw_arrow_l, draw_arrow_r); }