mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-24 01:39:47 +01:00
De-duplicate repeated size-type 2/8 tile drawing with a for-loop
For some reason, previously it looked like this was a for-loop that was manually unrolled (or never rolled up in the first place).
This commit is contained in:
parent
a6c1d13603
commit
2f180bb6df
1 changed files with 10 additions and 22 deletions
|
@ -1535,13 +1535,11 @@ void Graphics::drawentities()
|
||||||
drawRect = tiles_rect;
|
drawRect = tiles_rect;
|
||||||
drawRect.x += tpoint.x;
|
drawRect.x += tpoint.x;
|
||||||
drawRect.y += tpoint.y;
|
drawRect.y += tpoint.y;
|
||||||
|
for (int ii = 0; ii < 4; ii++)
|
||||||
|
{
|
||||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
||||||
drawRect.x += 8;
|
drawRect.x += 8;
|
||||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
}
|
||||||
drawRect.x += 8;
|
|
||||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
|
||||||
drawRect.x += 8;
|
|
||||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
|
||||||
}
|
}
|
||||||
else if (obj.entities[i].size == 3) // Big chunky pixels!
|
else if (obj.entities[i].size == 3) // Big chunky pixels!
|
||||||
{
|
{
|
||||||
|
@ -1589,21 +1587,11 @@ void Graphics::drawentities()
|
||||||
drawRect.x += tpoint.x;
|
drawRect.x += tpoint.x;
|
||||||
drawRect.y += tpoint.y;
|
drawRect.y += tpoint.y;
|
||||||
|
|
||||||
|
for (int ii = 0; ii < 8; ii++)
|
||||||
|
{
|
||||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
||||||
drawRect.x += 8;
|
drawRect.x += 8;
|
||||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
}
|
||||||
drawRect.x += 8;
|
|
||||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
|
||||||
drawRect.x += 8;
|
|
||||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
|
||||||
drawRect.x += 8;
|
|
||||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
|
||||||
drawRect.x += 8;
|
|
||||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
|
||||||
drawRect.x += 8;
|
|
||||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
|
||||||
drawRect.x += 8;
|
|
||||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
|
||||||
}
|
}
|
||||||
else if (obj.entities[i].size == 9) // Really Big Sprite! (2x2)
|
else if (obj.entities[i].size == 9) // Really Big Sprite! (2x2)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue