本文整理汇总了C++中Entity::GetSize方法的典型用法代码示例。如果您正苦于以下问题:C++ Entity::GetSize方法的具体用法?C++ Entity::GetSize怎么用?C++ Entity::GetSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Entity
的用法示例。
在下文中一共展示了Entity::GetSize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AddStructMember
uint32_t Materializer::AddStructMember(Entity &entity) {
uint32_t size = entity.GetSize();
uint32_t alignment = entity.GetAlignment();
uint32_t ret;
if (m_current_offset == 0)
m_struct_alignment = alignment;
if (m_current_offset % alignment)
m_current_offset += (alignment - (m_current_offset % alignment));
ret = m_current_offset;
m_current_offset += size;
return ret;
}
示例2: Update
void Map::Update()
{
for (std::vector<Entity*>::iterator it = entities.begin(); it != entities.end();)
{
if ((*it)->active)
++it;
else {
delete *it;
it = entities.erase(it);
}
}
HandleCollision();
HandleEvents();
Entity* entity;
for (std::vector<Entity*>::iterator it = entities.begin(); it != entities.end(); ++it)
{
entity = (*it);
if (entity->OnScreen == false)
continue;
if (entity->GetLight() > 0 && ((int) entity->shape->GetCenterX() != (int) (entity->prevPos.x + entity->GetSize().x / 2.0) || (int) entity->shape->GetCenterY() != (int) (entity->prevPos.y + entity->GetSize().y / 2.0)))
lightDirty = true;
}
skyManager->Update();
}