mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-23 17:29:46 +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.x += tpoint.x;
|
||||
drawRect.y += tpoint.y;
|
||||
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);
|
||||
for (int ii = 0; ii < 4; ii++)
|
||||
{
|
||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
||||
drawRect.x += 8;
|
||||
}
|
||||
}
|
||||
else if (obj.entities[i].size == 3) // Big chunky pixels!
|
||||
{
|
||||
|
@ -1589,21 +1587,11 @@ void Graphics::drawentities()
|
|||
drawRect.x += tpoint.x;
|
||||
drawRect.y += tpoint.y;
|
||||
|
||||
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);
|
||||
drawRect.x += 8;
|
||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
||||
for (int ii = 0; ii < 8; ii++)
|
||||
{
|
||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
||||
drawRect.x += 8;
|
||||
}
|
||||
}
|
||||
else if (obj.entities[i].size == 9) // Really Big Sprite! (2x2)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue