Пример #1
0
void ItemSlowmo::generateIdleImage()
{
	idle = spCreateSurface( ITEM_SLOWMO_RADIUS * 2, ITEM_SLOWMO_RADIUS * 2 );
	SDL_FillRect( idle, NULL, SP_ALPHA_COLOR );
	spSelectRenderTarget( idle );
	Uint16 col = spGetRGB( 0, 192, 0 );
	spEllipse( ITEM_SLOWMO_RADIUS, ITEM_SLOWMO_RADIUS, -1, ITEM_SLOWMO_RADIUS, ITEM_SLOWMO_RADIUS, -1);
	spEllipse( ITEM_SLOWMO_RADIUS, ITEM_SLOWMO_RADIUS, -1, ITEM_SLOWMO_RADIUS * 0.9, ITEM_SLOWMO_RADIUS * 0.9, col );
	spEllipse( ITEM_SLOWMO_RADIUS, ITEM_SLOWMO_RADIUS, -1, ITEM_SLOWMO_RADIUS * 0.65, ITEM_SLOWMO_RADIUS * 0.65, -1);
	spEllipse( ITEM_SLOWMO_RADIUS, ITEM_SLOWMO_RADIUS, -1, ITEM_SLOWMO_RADIUS * 0.55, ITEM_SLOWMO_RADIUS * 0.55, col );
	spRectangle( ITEM_SLOWMO_RADIUS, ITEM_SLOWMO_RADIUS * 0.8, -1, ITEM_SLOWMO_RADIUS * 0.1, ITEM_SLOWMO_RADIUS * 0.4, -1 );
	spRectangle( ITEM_SLOWMO_RADIUS * 1.2, ITEM_SLOWMO_RADIUS, -1, ITEM_SLOWMO_RADIUS * 0.4, ITEM_SLOWMO_RADIUS * 0.1, -1 );
	spSelectRenderTarget( spGetWindowSurface() );
}
Пример #2
0
void draw_primitives(int rotation)
{
	spSetZTest( primitives_z );
	spSetZSet( primitives_z );
	spSetBlending( primitives_blending?spFloatToFixed(0.5):SP_ONE );
	SDL_Surface* screen = spGetWindowSurface();
	srand( 0 );
	int i;
	for ( i = 0; i < 8; i++ )
		spEllipseBorder( rand() % screen->w, rand() % screen->h, 0, rand() % screen->w / 4, rand() % screen->h / 4, 10, 20, rand() % 65536 );
	for ( i = 0; i < 8; i++ )
		spEllipse( rand() % screen->w, rand() % screen->h, 0, rand() % screen->w / 4, rand() % screen->h / 4, rand() % 65536 );
	for ( i = 0; i < 8; i++ )
		spRectangleBorder( rand() % screen->w, rand() % screen->h, 0,
							 rand() % screen->w / 2, rand() % screen->h / 2, 12, 6, rand() % 65536 );
	for ( i = 0; i < 8; i++ )
		spRectangle( rand() % screen->w, rand() % screen->h, 0,
					 rand() % screen->w / 2, rand() % screen->h / 2, rand() % 65536 );
	for ( i = 0; i < 64; i++ )
	{
		spSetLineWidth(rand()%8+1);
		spLine( rand() % screen->w, rand() % screen->h, 0,
		        rand() % screen->w, rand() % screen->h, 0, rand() % 65536 );
	}
	/*spSetLineWidth(5);
	spLine(292,113,0,29,192,0,12345);*/
	spSetLineWidth(1);
	spSetZTest( 1 );
	spSetZSet( 1 );
	spSetBlending( SP_ONE );
}
Пример #3
0
void UnitLaser::generateIdleImage()
{
	idle = spCreateSurface( LASER_RADIUS * 2, LASER_RADIUS * 2 );
	SDL_FillRect( idle, NULL, SP_ALPHA_COLOR );
	spSelectRenderTarget( idle );
	spEllipse( LASER_RADIUS, LASER_RADIUS, -1, LASER_RADIUS, LASER_RADIUS, 0 );
	spSelectRenderTarget( spGetWindowSurface() );
}
Пример #4
0
void UnitBomb::generateFlashingImage()
{
    flashing = spCreateSurface( BOMB_RADIUS * 2, BOMB_RADIUS * 2 );
    SDL_FillRect( flashing, NULL, SP_ALPHA_COLOR );
    spSelectRenderTarget( flashing );
    spEllipse( BOMB_RADIUS ,BOMB_RADIUS, -1, BOMB_RADIUS, BOMB_RADIUS, spGetFastRGB( 255, 255, 255 ) );
    spSelectRenderTarget( spGetWindowSurface() );
}
Пример #5
0
void UnitBomb::render( SDL_Surface *const target )
{
#ifdef _DEBUG
    debugString += Utility::numToStr( pressure ) + "\n" + Utility::numToStr( status ) + "\n";
#endif
    if ( !bombTimer.isStopped() )
    {
        spEllipse( *x, *y, -1, shape.radius, shape.radius, spGetFastRGB( 255, 0, 0 ) );
    }
    UnitBase::render( target );
}
Пример #6
0
void UnitLaser::render( SDL_Surface *const target )
{
#ifdef _DEBUG
	debugString += Utility::numToStr( angle ) + "\n" + Utility::numToStr( angleVel );
#endif
	UnitBase::render( target );

	Vector2d<float> eyePos( *x + cos( angle ) * LASER_EYE_DISTANCE, *y + sin( angle ) * LASER_EYE_DISTANCE );

	if ( hasCharged )
	{
		float factor = (float)charge.getTime() / (float)LASER_CHARGE_TIME;
		spEllipse( eyePos.x, eyePos.y, -1, 8, 8, spGetRGB( 255, 255 * factor, 255 * factor ) );
		spEllipse( eyePos.x, eyePos.y, -1, 4, 4, spGetRGB( 255.0f * (1.0f - factor), 0, 255.0f * factor ) );
	}
	else
	{
		spEllipse( eyePos.x, eyePos.y, -1, 8, 8, -1 );
		spEllipse( eyePos.x, eyePos.y, -1, 4, 4, spGetFastRGB( 0, 0, 255 ) );
	}
}
Пример #7
0
void ItemVortex::generateIdleImage()
{
	idle = spCreateSurface( ITEM_VORTEX_RADIUS * 2, ITEM_VORTEX_RADIUS * 2 );
	SDL_FillRect( idle, NULL, SP_ALPHA_COLOR );
	spSelectRenderTarget( idle );
	Uint16 col = spGetRGB( 0, 192, 0 );
	spEllipse( ITEM_VORTEX_RADIUS, ITEM_VORTEX_RADIUS, -1, ITEM_VORTEX_RADIUS, ITEM_VORTEX_RADIUS, -1 );
	spEllipse( ITEM_VORTEX_RADIUS, ITEM_VORTEX_RADIUS, -1, ITEM_VORTEX_RADIUS * 0.9, ITEM_VORTEX_RADIUS * 0.9, col );
	spEllipse( ITEM_VORTEX_RADIUS, ITEM_VORTEX_RADIUS, -1, ITEM_VORTEX_RADIUS * 0.65, ITEM_VORTEX_RADIUS * 0.65, -1 );
	spEllipse( ITEM_VORTEX_RADIUS, ITEM_VORTEX_RADIUS, -1, ITEM_VORTEX_RADIUS * 0.55, ITEM_VORTEX_RADIUS * 0.55, col );
	spEllipse( ITEM_VORTEX_RADIUS, ITEM_VORTEX_RADIUS, -1, ITEM_VORTEX_RADIUS * 0.45, ITEM_VORTEX_RADIUS * 0.45, -1 );
	spEllipse( ITEM_VORTEX_RADIUS, ITEM_VORTEX_RADIUS, -1, ITEM_VORTEX_RADIUS * 0.35, ITEM_VORTEX_RADIUS * 0.35, col );
	spEllipse( ITEM_VORTEX_RADIUS, ITEM_VORTEX_RADIUS, -1, ITEM_VORTEX_RADIUS * 0.25, ITEM_VORTEX_RADIUS * 0.25, -1 );
	spEllipse( ITEM_VORTEX_RADIUS, ITEM_VORTEX_RADIUS, -1, ITEM_VORTEX_RADIUS * 0.15, ITEM_VORTEX_RADIUS * 0.15, col );
	spSelectRenderTarget( spGetWindowSurface() );
}
Пример #8
0
void Ball::Render()
{
	spEllipse( ballPosition->X, ballPosition->Y, -1, ballRadius * 2, ballRadius * 2, spGetFastRGB( 255, 255, 255 ) );
}