void CtfHatActionRenderer::FillRenderableSprites( const Actor& actor, IRenderableComponent const& renderableC, RenderableSprites_t& renderableSprites ) { SpriteCollection const& Sprites = mRenderableRepo( actor.GetId() ); Sprite const& Spr = Sprites( mCtfHatId ); if( Spr.IsValid() ) { // Opt<PlayerControllerComponent> playerCC=actor.Get<IControllerComponent>(); // if (playerCC.IsValid()) // { // Opt< ::ctf::ClientData> ctfClientData(::ctf::ProgramState::Get().FindClientDataByClientId(playerCC->mControllerId)); // if (ctfClientData.IsValid()) // { Opt<ITeamComponent> teamC( actor.Get<ITeamComponent>() ); if ( teamC.IsValid() ) { SpritePhase const& Phase = Spr( ( int32_t )GetState() ); glm::vec4 col = ColorRepo::Get()( teamC->GetTeam() ); col.a = GetCloakColor( actor ).a; col = col * GetColor( actor ); renderableSprites.push_back( RenderableSprite( &actor, &renderableC, mCtfHatId, &Spr, &Phase, col ) ); } // } // // } } }
void CGUIHorizontalScrollBar::Init(GUI_PARAMS* params, GUI_COLORS* colors, GUI_SPRITES* bar, GUI_BUTTON_SPRITES* left, GUI_BUTTON_SPRITES* right){ GUI_PARAMS Params; Params.pos=m_pos; Params.width=m_height; Params.height=m_height; Params.GUIEvent=OnGUIEvent; Params.enabled=m_bEnabled; Params.visible=m_bVisible; GUI_SPRITES Spr(left, NULL, NULL); m_pLeft = new CGUIButton(&Params, NULL, &Spr, EVENT_SCROLLLEFT, this, L"", true); Params.pos=m_pos+Vector2(m_width-m_height, 0); Spr.Button=right; m_pRight = new CGUIButton(&Params, NULL, &Spr, EVENT_SCROLLRIGHT, this, L"", true); m_minValue=0; m_minBarWidth=20; m_barPos=Vector2(m_height, 0); m_maxBarWidth=m_width-(m_height*2); m_value=0; m_maxValue=100; ResizeBar(m_maxBarWidth-(m_maxValue-m_minValue)); if(!m_pSprites) m_pSprites=new GUI_SPRITES(); m_pSprites->Button=bar->Button; }
// Describes how to run the CLBlast routine static StatusCode RunRoutine(const Arguments<T> &args, Buffers<T> &buffers, Queue &queue) { #ifdef OPENCL_API auto queue_plain = queue(); auto event = cl_event{}; auto status = Spr(args.layout, args.triangle, args.n, args.alpha, buffers.x_vec(), args.x_offset, args.x_inc, buffers.ap_mat(), args.ap_offset, &queue_plain, &event); if (status == StatusCode::kSuccess) { clWaitForEvents(1, &event); clReleaseEvent(event); } #elif CUDA_API auto status = Spr(args.layout, args.triangle, args.n, args.alpha, buffers.x_vec(), args.x_offset, args.x_inc, buffers.ap_mat(), args.ap_offset, queue.GetContext()(), queue.GetDevice()()); cuStreamSynchronize(queue()); #endif return status; }
void HatActionRenderer::FillRenderableSprites( const Actor& actor, IRenderableComponent const& renderableC, RenderableSprites_t& renderableSprites ) { SpriteCollection const& Sprites = mRenderableRepo( actor.GetId() ); Sprite const& Spr = Sprites( mHatId ); if( Spr.IsValid() ) { SpritePhase const& Phase = Spr( ( int32_t )GetState() ); Opt<PlayerControllerComponent> playerCC = actor.Get<PlayerControllerComponent>(); glm::vec4 col = playerCC.IsValid() ? ColorRepo::Get()( playerCC->mControllerId ) : glm::vec4( 1, 1, 1, 1 ); col.a = GetCloakColor( actor ).a; renderableSprites.push_back( RenderableSprite( &actor, &renderableC, mHatId, &Spr, &Phase, col ) ); } }