void Creature::render(Sint32 posX, Sint32 posY)
{
if (!m_thingType || m_thingType->m_category == ThingCategory_Effect)
return;
auto& renderer = g_engine.getRender();
update();
posX += getOffsetX();
posY += getOffsetY();
Uint8 zPattern = 0;
// fix walk creatura lookTypeEx is stackable.
Uint8 xPattern = m_direction;
if (m_thingType->hasFlag(ThingAttribute_Stackable)) xPattern = 0;
if (m_thingType->m_category != ThingCategory_Creature)
....
if (m_thingType->m_frameGroup[m_currentFrame].m_layers > 1)
{
for (Uint8 y = 0; y < m_thingType->m_frameGroup[m_currentFrame].m_height; ++y)
{
Sint32 posXc = posX;
for (Uint8 x = 0; x < m_thingType->m_frameGroup[m_currentFrame].m_width; ++x)
{
Uint32 sprite = m_thingType->getSprite(SDL_static_cast(ThingFrameGroup, m_currentFrame), x, y, 0, xPattern, 0, zPattern, m_outfitAnim);
Uint32 spriteMask = m_thingType->getSprite(SDL_static_cast(ThingFrameGroup, m_currentFrame), x, y, 1, xPattern, 0, zPattern, m_outfitAnim);
....
for (Uint8 y = 0; y < m_thingType->m_frameGroup[m_currentFrame].m_height; ++y)
{
Sint32 posXc = posX;
for (Uint8 x = 0; x < m_thingType->m_frameGroup[m_currentFrame].m_width; ++x)
{
Uint32 sprite = m_thingType->getSprite(SDL_static_cast(ThingFrameGroup, m_currentFrame), x, y, 0, xPattern, 0, zPattern, m_outfitAnim);
if (sprite != 0)
renderer->drawSprite(sprite, posXc, posY);
if (m_thingType->m_frameGroup[m_currentFrame].m_patternY > 1)
{
if (m_lookAddons & 1)//First addon
....
}