|
|
|
@ -42,26 +42,26 @@ void Thing::setPosition(const Position& position)
|
|
|
|
|
|
|
|
|
|
void Thing::internalDraw(int x, int y, int layers, Otc::SpriteMask mask)
|
|
|
|
|
{
|
|
|
|
|
const ThingAttributes& attributes = getAttributes();
|
|
|
|
|
const ThingAttributes& type = getAttributes();
|
|
|
|
|
|
|
|
|
|
for(int yi = 0; yi < attributes.height; yi++) {
|
|
|
|
|
for(int xi = 0; xi < attributes.width; xi++) {
|
|
|
|
|
int sprIndex = xi +
|
|
|
|
|
yi * attributes.width +
|
|
|
|
|
layers * attributes.width * attributes.height +
|
|
|
|
|
m_xPattern * attributes.width * attributes.height * attributes.layers +
|
|
|
|
|
m_yPattern * attributes.width * attributes.height * attributes.layers * attributes.xPattern +
|
|
|
|
|
m_zPattern * attributes.width * attributes.height * attributes.layers * attributes.xPattern * attributes.yPattern +
|
|
|
|
|
m_animation * attributes.width * attributes.height * attributes.layers * attributes.xPattern * attributes.yPattern * attributes.zPattern;
|
|
|
|
|
for(int yi = 0; yi < type.height; yi++) {
|
|
|
|
|
for(int xi = 0; xi < type.width; xi++) {
|
|
|
|
|
int sprIndex = ((((((m_animation % type.animationPhases)
|
|
|
|
|
* type.zPattern + m_zPattern)
|
|
|
|
|
* type.yPattern + m_yPattern)
|
|
|
|
|
* type.xPattern + m_xPattern)
|
|
|
|
|
* type.layers + layers)
|
|
|
|
|
* type.height + yi)
|
|
|
|
|
* type.width + xi;
|
|
|
|
|
|
|
|
|
|
int spriteId = attributes.sprites[sprIndex];
|
|
|
|
|
int spriteId = type.sprites[sprIndex];
|
|
|
|
|
if(!spriteId)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
TexturePtr spriteTex = g_sprites.getSpriteTexture(spriteId, mask);
|
|
|
|
|
|
|
|
|
|
Rect drawRect((x - xi*32) - attributes.xDisplacment,
|
|
|
|
|
(y - yi*32) - attributes.yDisplacment,
|
|
|
|
|
Rect drawRect((x - xi*32) - type.xDisplacment,
|
|
|
|
|
(y - yi*32) - type.yDisplacment,
|
|
|
|
|
32, 32);
|
|
|
|
|
g_graphics.drawTexturedRect(drawRect, spriteTex);
|
|
|
|
|
}
|
|
|
|
|