mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2025-01-08 18:09:45 +01:00
Invert entity invis check to reduce indentation level
Instead of doing if (!obj.entities[i].invis) { ... } It's better to do if (obj.entities[i].invis) { continue; } ... It reduces the indentation by one level, which is always a good thing.
This commit is contained in:
parent
3f46a0a2e9
commit
276daa11bb
1 changed files with 224 additions and 222 deletions
|
@ -1422,261 +1422,263 @@ void Graphics::drawentities()
|
||||||
|
|
||||||
for (int i = obj.entities.size() - 1; i >= 0; i--)
|
for (int i = obj.entities.size() - 1; i >= 0; i--)
|
||||||
{
|
{
|
||||||
if (!obj.entities[i].invis)
|
if (obj.entities[i].invis)
|
||||||
{
|
{
|
||||||
if (obj.entities[i].size == 0)
|
continue;
|
||||||
{
|
}
|
||||||
// Sprites
|
|
||||||
tpoint.x = obj.entities[i].xp;
|
|
||||||
tpoint.y = obj.entities[i].yp;
|
|
||||||
setcol(obj.entities[i].colour);
|
|
||||||
|
|
||||||
drawRect = sprites_rect;
|
if (obj.entities[i].size == 0)
|
||||||
drawRect.x += tpoint.x;
|
{
|
||||||
drawRect.y += tpoint.y;
|
// Sprites
|
||||||
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
tpoint.x = obj.entities[i].xp;
|
||||||
if (map.warpx)
|
tpoint.y = obj.entities[i].yp;
|
||||||
|
setcol(obj.entities[i].colour);
|
||||||
|
|
||||||
|
drawRect = sprites_rect;
|
||||||
|
drawRect.x += tpoint.x;
|
||||||
|
drawRect.y += tpoint.y;
|
||||||
|
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
||||||
|
if (map.warpx)
|
||||||
|
{
|
||||||
|
//screenwrapping!
|
||||||
|
if (tpoint.x < 0)
|
||||||
{
|
{
|
||||||
//screenwrapping!
|
tpoint.x += 320;
|
||||||
if (tpoint.x < 0)
|
drawRect = sprites_rect;
|
||||||
{
|
drawRect.x += tpoint.x;
|
||||||
tpoint.x += 320;
|
drawRect.y += tpoint.y;
|
||||||
drawRect = sprites_rect;
|
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
||||||
drawRect.x += tpoint.x;
|
|
||||||
drawRect.y += tpoint.y;
|
|
||||||
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
|
||||||
}
|
|
||||||
if (tpoint.x > 300)
|
|
||||||
{
|
|
||||||
tpoint.x -= 320;
|
|
||||||
drawRect = sprites_rect;
|
|
||||||
drawRect.x += tpoint.x;
|
|
||||||
drawRect.y += tpoint.y;
|
|
||||||
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else if (map.warpy)
|
if (tpoint.x > 300)
|
||||||
{
|
{
|
||||||
if (tpoint.y < 0)
|
tpoint.x -= 320;
|
||||||
{
|
drawRect = sprites_rect;
|
||||||
tpoint.y += 230;
|
drawRect.x += tpoint.x;
|
||||||
drawRect = sprites_rect;
|
drawRect.y += tpoint.y;
|
||||||
drawRect.x += tpoint.x;
|
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
||||||
drawRect.y += tpoint.y;
|
|
||||||
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
|
||||||
}
|
|
||||||
if (tpoint.y > 210)
|
|
||||||
{
|
|
||||||
tpoint.y -= 230;
|
|
||||||
drawRect = sprites_rect;
|
|
||||||
drawRect.x += tpoint.x;
|
|
||||||
drawRect.y += tpoint.y;
|
|
||||||
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (obj.entities[i].size == 1)
|
else if (map.warpy)
|
||||||
|
{
|
||||||
|
if (tpoint.y < 0)
|
||||||
|
{
|
||||||
|
tpoint.y += 230;
|
||||||
|
drawRect = sprites_rect;
|
||||||
|
drawRect.x += tpoint.x;
|
||||||
|
drawRect.y += tpoint.y;
|
||||||
|
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
||||||
|
}
|
||||||
|
if (tpoint.y > 210)
|
||||||
|
{
|
||||||
|
tpoint.y -= 230;
|
||||||
|
drawRect = sprites_rect;
|
||||||
|
drawRect.x += tpoint.x;
|
||||||
|
drawRect.y += tpoint.y;
|
||||||
|
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (obj.entities[i].size == 1)
|
||||||
|
{
|
||||||
|
// Tiles
|
||||||
|
tpoint.x = obj.entities[i].xp;
|
||||||
|
tpoint.y = obj.entities[i].yp;
|
||||||
|
drawRect = tiles_rect;
|
||||||
|
drawRect.x += tpoint.x;
|
||||||
|
drawRect.y += tpoint.y;
|
||||||
|
BlitSurfaceStandard(tiles[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
||||||
|
}
|
||||||
|
else if (obj.entities[i].size == 2 || obj.entities[i].size == 8)
|
||||||
|
{
|
||||||
|
// Special: Moving platform, 4 tiles or 8 tiles
|
||||||
|
tpoint.x = obj.entities[i].xp;
|
||||||
|
tpoint.y = obj.entities[i].yp;
|
||||||
|
int thiswidth = 4;
|
||||||
|
if (obj.entities[i].size == 8)
|
||||||
|
{
|
||||||
|
thiswidth = 8;
|
||||||
|
}
|
||||||
|
for (int ii = 0; ii < thiswidth; ii++)
|
||||||
{
|
{
|
||||||
// Tiles
|
|
||||||
tpoint.x = obj.entities[i].xp;
|
|
||||||
tpoint.y = obj.entities[i].yp;
|
|
||||||
drawRect = tiles_rect;
|
drawRect = tiles_rect;
|
||||||
drawRect.x += tpoint.x;
|
drawRect.x += tpoint.x;
|
||||||
drawRect.y += tpoint.y;
|
drawRect.y += tpoint.y;
|
||||||
BlitSurfaceStandard(tiles[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
drawRect.x += 8 * ii;
|
||||||
|
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
||||||
}
|
}
|
||||||
else if (obj.entities[i].size == 2 || obj.entities[i].size == 8)
|
}
|
||||||
|
else if (obj.entities[i].size == 3) // Big chunky pixels!
|
||||||
|
{
|
||||||
|
prect.x = obj.entities[i].xp;
|
||||||
|
prect.y = obj.entities[i].yp;
|
||||||
|
//A seperate index of colours, for simplicity
|
||||||
|
if(obj.entities[i].colour==1)
|
||||||
{
|
{
|
||||||
// Special: Moving platform, 4 tiles or 8 tiles
|
FillRect(backBuffer, prect, (fRandom() * 64), 10, 10);
|
||||||
tpoint.x = obj.entities[i].xp;
|
}
|
||||||
tpoint.y = obj.entities[i].yp;
|
else if (obj.entities[i].colour == 2)
|
||||||
int thiswidth = 4;
|
{
|
||||||
if (obj.entities[i].size == 8)
|
FillRect(backBuffer,prect, int(160- help.glow/2 - (fRandom()*20)), 200- help.glow/2, 220 - help.glow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (obj.entities[i].size == 4) // Small pickups
|
||||||
|
{
|
||||||
|
drawhuetile(obj.entities[i].xp, obj.entities[i].yp, obj.entities[i].tile, obj.entities[i].colour);
|
||||||
|
}
|
||||||
|
else if (obj.entities[i].size == 5) //Horizontal Line
|
||||||
|
{
|
||||||
|
line_rect.x = obj.entities[i].xp;
|
||||||
|
line_rect.y = obj.entities[i].yp;
|
||||||
|
line_rect.w = obj.entities[i].w;
|
||||||
|
line_rect.h = 1;
|
||||||
|
drawgravityline(i);
|
||||||
|
}
|
||||||
|
else if (obj.entities[i].size == 6) //Vertical Line
|
||||||
|
{
|
||||||
|
line_rect.x = obj.entities[i].xp;
|
||||||
|
line_rect.y = obj.entities[i].yp;
|
||||||
|
line_rect.w = 1;
|
||||||
|
line_rect.h = obj.entities[i].h;
|
||||||
|
drawgravityline(i);
|
||||||
|
}
|
||||||
|
else if (obj.entities[i].size == 7) //Teleporter
|
||||||
|
{
|
||||||
|
drawtele(obj.entities[i].xp, obj.entities[i].yp, obj.entities[i].drawframe, obj.entities[i].colour);
|
||||||
|
}
|
||||||
|
else if (obj.entities[i].size == 8) // Special: Moving platform, 8 tiles
|
||||||
|
{
|
||||||
|
// Note: This code is in the 4-tile code
|
||||||
|
}
|
||||||
|
else if (obj.entities[i].size == 9) // Really Big Sprite! (2x2)
|
||||||
|
{
|
||||||
|
setcol(obj.entities[i].colour);
|
||||||
|
|
||||||
|
tpoint.x = obj.entities[i].xp;
|
||||||
|
tpoint.y = obj.entities[i].yp;
|
||||||
|
|
||||||
|
drawRect = sprites_rect;
|
||||||
|
drawRect.x += tpoint.x;
|
||||||
|
drawRect.y += tpoint.y;
|
||||||
|
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
||||||
|
|
||||||
|
tpoint.x = obj.entities[i].xp+32;
|
||||||
|
tpoint.y = obj.entities[i].yp;
|
||||||
|
//
|
||||||
|
drawRect = sprites_rect;
|
||||||
|
drawRect.x += tpoint.x;
|
||||||
|
drawRect.y += tpoint.y;
|
||||||
|
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe+1],NULL, backBuffer, &drawRect, ct);
|
||||||
|
|
||||||
|
tpoint.x = obj.entities[i].xp;
|
||||||
|
tpoint.y = obj.entities[i].yp+32;
|
||||||
|
//
|
||||||
|
drawRect = sprites_rect;
|
||||||
|
drawRect.x += tpoint.x;
|
||||||
|
drawRect.y += tpoint.y;
|
||||||
|
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe+12],NULL, backBuffer, &drawRect, ct);
|
||||||
|
|
||||||
|
tpoint.x = obj.entities[i].xp+32;
|
||||||
|
tpoint.y = obj.entities[i].yp+32;
|
||||||
|
//
|
||||||
|
drawRect = sprites_rect;
|
||||||
|
drawRect.x += tpoint.x;
|
||||||
|
drawRect.y += tpoint.y;
|
||||||
|
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe + 13],NULL, backBuffer, &drawRect, ct);
|
||||||
|
}
|
||||||
|
else if (obj.entities[i].size == 10) // 2x1 Sprite
|
||||||
|
{
|
||||||
|
setcol(obj.entities[i].colour);
|
||||||
|
|
||||||
|
tpoint.x = obj.entities[i].xp;
|
||||||
|
tpoint.y = obj.entities[i].yp;
|
||||||
|
//
|
||||||
|
drawRect = sprites_rect;
|
||||||
|
drawRect.x += tpoint.x;
|
||||||
|
drawRect.y += tpoint.y;
|
||||||
|
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
||||||
|
|
||||||
|
tpoint.x = obj.entities[i].xp+32;
|
||||||
|
tpoint.y = obj.entities[i].yp;
|
||||||
|
//
|
||||||
|
drawRect = sprites_rect;
|
||||||
|
drawRect.x += tpoint.x;
|
||||||
|
drawRect.y += tpoint.y;
|
||||||
|
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe+1],NULL, backBuffer, &drawRect, ct);
|
||||||
|
}
|
||||||
|
else if (obj.entities[i].size == 11) //The fucking elephant
|
||||||
|
{
|
||||||
|
setcol(obj.entities[i].colour);
|
||||||
|
drawimagecol(3, obj.entities[i].xp, obj.entities[i].yp);
|
||||||
|
}
|
||||||
|
else if (obj.entities[i].size == 12) // Regular sprites that don't wrap
|
||||||
|
{
|
||||||
|
tpoint.x = obj.entities[i].xp;
|
||||||
|
tpoint.y = obj.entities[i].yp;
|
||||||
|
setcol(obj.entities[i].colour);
|
||||||
|
//
|
||||||
|
drawRect = sprites_rect;
|
||||||
|
drawRect.x += tpoint.x;
|
||||||
|
drawRect.y += tpoint.y;
|
||||||
|
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
||||||
|
|
||||||
|
|
||||||
|
//if we're outside the screen, we need to draw indicators
|
||||||
|
|
||||||
|
if (obj.entities[i].xp < -20 && obj.entities[i].vx > 0)
|
||||||
|
{
|
||||||
|
if (obj.entities[i].xp < -100)
|
||||||
{
|
{
|
||||||
thiswidth = 8;
|
tpoint.x = -5 + (int(( -obj.entities[i].xp) / 10));
|
||||||
}
|
}
|
||||||
for (int ii = 0; ii < thiswidth; ii++)
|
else
|
||||||
{
|
{
|
||||||
drawRect = tiles_rect;
|
tpoint.x = 5;
|
||||||
drawRect.x += tpoint.x;
|
|
||||||
drawRect.y += tpoint.y;
|
|
||||||
drawRect.x += 8 * ii;
|
|
||||||
BlitSurfaceStandard((*tilesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tpoint.y = tpoint.y+4;
|
||||||
|
setcol(23);
|
||||||
|
|
||||||
|
|
||||||
|
drawRect = tiles_rect;
|
||||||
|
drawRect.x += tpoint.x;
|
||||||
|
drawRect.y += tpoint.y;
|
||||||
|
BlitSurfaceColoured(tiles[1167],NULL, backBuffer, &drawRect, ct);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (obj.entities[i].size == 3) // Big chunky pixels!
|
else if (obj.entities[i].xp > 340 && obj.entities[i].vx < 0)
|
||||||
{
|
{
|
||||||
prect.x = obj.entities[i].xp;
|
if (obj.entities[i].xp > 420)
|
||||||
prect.y = obj.entities[i].yp;
|
|
||||||
//A seperate index of colours, for simplicity
|
|
||||||
if(obj.entities[i].colour==1)
|
|
||||||
{
|
{
|
||||||
FillRect(backBuffer, prect, (fRandom() * 64), 10, 10);
|
tpoint.x = 320 - (int(( obj.entities[i].xp-320) / 10));
|
||||||
}
|
}
|
||||||
else if (obj.entities[i].colour == 2)
|
else
|
||||||
{
|
{
|
||||||
FillRect(backBuffer,prect, int(160- help.glow/2 - (fRandom()*20)), 200- help.glow/2, 220 - help.glow);
|
tpoint.x = 310;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else if (obj.entities[i].size == 4) // Small pickups
|
|
||||||
{
|
|
||||||
drawhuetile(obj.entities[i].xp, obj.entities[i].yp, obj.entities[i].tile, obj.entities[i].colour);
|
|
||||||
}
|
|
||||||
else if (obj.entities[i].size == 5) //Horizontal Line
|
|
||||||
{
|
|
||||||
line_rect.x = obj.entities[i].xp;
|
|
||||||
line_rect.y = obj.entities[i].yp;
|
|
||||||
line_rect.w = obj.entities[i].w;
|
|
||||||
line_rect.h = 1;
|
|
||||||
drawgravityline(i);
|
|
||||||
}
|
|
||||||
else if (obj.entities[i].size == 6) //Vertical Line
|
|
||||||
{
|
|
||||||
line_rect.x = obj.entities[i].xp;
|
|
||||||
line_rect.y = obj.entities[i].yp;
|
|
||||||
line_rect.w = 1;
|
|
||||||
line_rect.h = obj.entities[i].h;
|
|
||||||
drawgravityline(i);
|
|
||||||
}
|
|
||||||
else if (obj.entities[i].size == 7) //Teleporter
|
|
||||||
{
|
|
||||||
drawtele(obj.entities[i].xp, obj.entities[i].yp, obj.entities[i].drawframe, obj.entities[i].colour);
|
|
||||||
}
|
|
||||||
else if (obj.entities[i].size == 8) // Special: Moving platform, 8 tiles
|
|
||||||
{
|
|
||||||
// Note: This code is in the 4-tile code
|
|
||||||
}
|
|
||||||
else if (obj.entities[i].size == 9) // Really Big Sprite! (2x2)
|
|
||||||
{
|
|
||||||
setcol(obj.entities[i].colour);
|
|
||||||
|
|
||||||
tpoint.x = obj.entities[i].xp;
|
tpoint.y = tpoint.y+4;
|
||||||
tpoint.y = obj.entities[i].yp;
|
setcol(23);
|
||||||
|
|
||||||
drawRect = sprites_rect;
|
|
||||||
drawRect.x += tpoint.x;
|
|
||||||
drawRect.y += tpoint.y;
|
|
||||||
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
|
||||||
|
|
||||||
tpoint.x = obj.entities[i].xp+32;
|
|
||||||
tpoint.y = obj.entities[i].yp;
|
|
||||||
//
|
//
|
||||||
drawRect = sprites_rect;
|
|
||||||
drawRect.x += tpoint.x;
|
|
||||||
drawRect.y += tpoint.y;
|
|
||||||
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe+1],NULL, backBuffer, &drawRect, ct);
|
|
||||||
|
|
||||||
tpoint.x = obj.entities[i].xp;
|
drawRect = tiles_rect;
|
||||||
tpoint.y = obj.entities[i].yp+32;
|
|
||||||
//
|
|
||||||
drawRect = sprites_rect;
|
|
||||||
drawRect.x += tpoint.x;
|
drawRect.x += tpoint.x;
|
||||||
drawRect.y += tpoint.y;
|
drawRect.y += tpoint.y;
|
||||||
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe+12],NULL, backBuffer, &drawRect, ct);
|
BlitSurfaceColoured(tiles[1166],NULL, backBuffer, &drawRect, ct);
|
||||||
|
|
||||||
tpoint.x = obj.entities[i].xp+32;
|
|
||||||
tpoint.y = obj.entities[i].yp+32;
|
|
||||||
//
|
|
||||||
drawRect = sprites_rect;
|
|
||||||
drawRect.x += tpoint.x;
|
|
||||||
drawRect.y += tpoint.y;
|
|
||||||
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe + 13],NULL, backBuffer, &drawRect, ct);
|
|
||||||
}
|
}
|
||||||
else if (obj.entities[i].size == 10) // 2x1 Sprite
|
}
|
||||||
{
|
else if (obj.entities[i].size == 13)
|
||||||
setcol(obj.entities[i].colour);
|
{
|
||||||
|
//Special for epilogue: huge hero!
|
||||||
|
|
||||||
tpoint.x = obj.entities[i].xp;
|
tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp;
|
||||||
tpoint.y = obj.entities[i].yp;
|
setcol(obj.entities[i].colour);
|
||||||
//
|
SDL_Rect drawRect = {Sint16(obj.entities[i].xp ), Sint16(obj.entities[i].yp), Sint16(sprites_rect.x * 6), Sint16(sprites_rect.y * 6 ) };
|
||||||
drawRect = sprites_rect;
|
SDL_Surface* TempSurface = ScaleSurface( (*spritesvec)[obj.entities[i].drawframe], 6 * sprites_rect.w,6* sprites_rect.h );
|
||||||
drawRect.x += tpoint.x;
|
BlitSurfaceColoured(TempSurface, NULL , backBuffer, &drawRect, ct );
|
||||||
drawRect.y += tpoint.y;
|
SDL_FreeSurface(TempSurface);
|
||||||
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
|
||||||
|
|
||||||
tpoint.x = obj.entities[i].xp+32;
|
|
||||||
tpoint.y = obj.entities[i].yp;
|
|
||||||
//
|
|
||||||
drawRect = sprites_rect;
|
|
||||||
drawRect.x += tpoint.x;
|
|
||||||
drawRect.y += tpoint.y;
|
|
||||||
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe+1],NULL, backBuffer, &drawRect, ct);
|
|
||||||
}
|
|
||||||
else if (obj.entities[i].size == 11) //The fucking elephant
|
|
||||||
{
|
|
||||||
setcol(obj.entities[i].colour);
|
|
||||||
drawimagecol(3, obj.entities[i].xp, obj.entities[i].yp);
|
|
||||||
}
|
|
||||||
else if (obj.entities[i].size == 12) // Regular sprites that don't wrap
|
|
||||||
{
|
|
||||||
tpoint.x = obj.entities[i].xp;
|
|
||||||
tpoint.y = obj.entities[i].yp;
|
|
||||||
setcol(obj.entities[i].colour);
|
|
||||||
//
|
|
||||||
drawRect = sprites_rect;
|
|
||||||
drawRect.x += tpoint.x;
|
|
||||||
drawRect.y += tpoint.y;
|
|
||||||
BlitSurfaceColoured((*spritesvec)[obj.entities[i].drawframe],NULL, backBuffer, &drawRect, ct);
|
|
||||||
|
|
||||||
|
|
||||||
//if we're outside the screen, we need to draw indicators
|
|
||||||
|
|
||||||
if (obj.entities[i].xp < -20 && obj.entities[i].vx > 0)
|
|
||||||
{
|
|
||||||
if (obj.entities[i].xp < -100)
|
|
||||||
{
|
|
||||||
tpoint.x = -5 + (int(( -obj.entities[i].xp) / 10));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tpoint.x = 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
tpoint.y = tpoint.y+4;
|
|
||||||
setcol(23);
|
|
||||||
|
|
||||||
|
|
||||||
drawRect = tiles_rect;
|
|
||||||
drawRect.x += tpoint.x;
|
|
||||||
drawRect.y += tpoint.y;
|
|
||||||
BlitSurfaceColoured(tiles[1167],NULL, backBuffer, &drawRect, ct);
|
|
||||||
|
|
||||||
}
|
|
||||||
else if (obj.entities[i].xp > 340 && obj.entities[i].vx < 0)
|
|
||||||
{
|
|
||||||
if (obj.entities[i].xp > 420)
|
|
||||||
{
|
|
||||||
tpoint.x = 320 - (int(( obj.entities[i].xp-320) / 10));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
tpoint.x = 310;
|
|
||||||
}
|
|
||||||
|
|
||||||
tpoint.y = tpoint.y+4;
|
|
||||||
setcol(23);
|
|
||||||
//
|
|
||||||
|
|
||||||
drawRect = tiles_rect;
|
|
||||||
drawRect.x += tpoint.x;
|
|
||||||
drawRect.y += tpoint.y;
|
|
||||||
BlitSurfaceColoured(tiles[1166],NULL, backBuffer, &drawRect, ct);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (obj.entities[i].size == 13)
|
|
||||||
{
|
|
||||||
//Special for epilogue: huge hero!
|
|
||||||
|
|
||||||
tpoint.x = obj.entities[i].xp; tpoint.y = obj.entities[i].yp;
|
|
||||||
setcol(obj.entities[i].colour);
|
|
||||||
SDL_Rect drawRect = {Sint16(obj.entities[i].xp ), Sint16(obj.entities[i].yp), Sint16(sprites_rect.x * 6), Sint16(sprites_rect.y * 6 ) };
|
|
||||||
SDL_Surface* TempSurface = ScaleSurface( (*spritesvec)[obj.entities[i].drawframe], 6 * sprites_rect.w,6* sprites_rect.h );
|
|
||||||
BlitSurfaceColoured(TempSurface, NULL , backBuffer, &drawRect, ct );
|
|
||||||
SDL_FreeSurface(TempSurface);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue