Ejemplo n.º 1
0
PREFIX void spDrawSprite( Sint32 x, Sint32 y, Sint32 z, spSpritePointer sprite )
{
	if ( sprite->rotation == 0 &&
			sprite->zoomX == ( SP_ONE ) &&
			sprite->zoomY == ( SP_ONE ) )
	{
		if ( sprite->momSub->sx < 0 )
			spBlitSurface( x, y, z, sprite->momSub->surface );
		else
			spBlitSurfacePart( x, y, z, sprite->momSub->surface, sprite->momSub->sx, sprite->momSub->sy, sprite->momSub->sw, sprite->momSub->sh );
	}
	else
	{
		if ( sprite->momSub->sx < 0 )
			spRotozoomSurface( x, y, z, sprite->momSub->surface, sprite->zoomX, sprite->zoomY, sprite->rotation );
		else
			spRotozoomSurfacePart( x, y, z, sprite->momSub->surface, sprite->momSub->sx, sprite->momSub->sy, sprite->momSub->sw, sprite->momSub->sh, sprite->zoomX, sprite->zoomY, sprite->rotation );
	}
}
Ejemplo n.º 2
0
void Craft::RenderPiece( SDL_Surface* Image, int FrameNumber, Vector2f* Origin, Vector2f* UpgradeDelta, int UpgradeCurrent, int UpgradeDestination )
{
	Vector2f* o = new Vector2f( 0, 0 );

	o->x = Origin->x + (UpgradeDelta->x * UpgradeCurrent);
	o->y = Origin->y + (UpgradeDelta->y * UpgradeCurrent);
	if( State == CRAFT_STATE_MORPHING && UpgradeCurrent != UpgradeDestination )
	{
		float diff = ((UpgradeDelta->x * UpgradeDestination) - (UpgradeDelta->x * UpgradeCurrent));
		diff /= (abs(UpgradeDestination - SpreadUpgrade) * (float)CRAFT_ANIMATION_MORPH_FRAMES);
		diff *= (float)(AnimationIndex + 1);
		o->x = o->x + diff;

		diff = ((UpgradeDelta->y * UpgradeDestination) - (UpgradeDelta->y * UpgradeCurrent));
		diff /= (abs(UpgradeDestination - SpreadUpgrade) * (float)CRAFT_ANIMATION_MORPH_FRAMES);
		diff *= (float)(AnimationIndex + 1);
		o->y = o->y + diff;
	}

	RenderOffsetToPosition( o );
	spRotozoomSurfacePart(o->x, o->y, -1, Image, FrameNumber * Image->h, 0, Image->w, Image->h, SP_ONE * Scale, SP_ONE * Scale, Rotation );

	delete o;
}