MCPcopy Create free account
hub / github.com/9chu/LuaSTGPlus / SetImgState

Method SetImgState

LuaSTGPlus/GameObjectPool.cpp:863–889  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

861}
862
863bool GameObjectPool::SetImgState(size_t id, BlendMode m, fcyColor c)LNOEXCEPT
864{
865 GameObject* p = m_ObjectPool.Data(id);
866 if (!p)
867 return false;
868 if (p->res)
869 {
870 switch (p->res->GetType())
871 {
872 case ResourceType::Sprite:
873 static_cast<ResSprite*>(p->res)->SetBlendMode(m);
874 static_cast<ResSprite*>(p->res)->GetSprite()->SetColor(c);
875 break;
876 case ResourceType::Animation:
877 do {
878 ResAnimation* ani = static_cast<ResAnimation*>(p->res);
879 ani->SetBlendMode(m);
880 for (size_t i = 0; i < ani->GetCount(); ++i)
881 ani->GetSprite(i)->SetColor(c);
882 } while (false);
883 break;
884 default:
885 break;
886 }
887 }
888 return true;
889}
890
891bool GameObjectPool::BoxCheck(size_t id, double left, double right, double top, double bottom, bool& ret)LNOEXCEPT
892{

Callers

nothing calls this directly

Calls 5

DataMethod · 0.80
GetTypeMethod · 0.80
GetCountMethod · 0.80
SetBlendModeMethod · 0.45
GetSpriteMethod · 0.45

Tested by

no test coverage detected