Ejemplo n.º 1
0
void quit_target()
{
	spDeleteSprite( target_sprite );
	SDL_FreeSurface( target_scientist );
	SDL_FreeSurface( target_texture );
	SDL_FreeSurface( target_graph );
	SDL_FreeSurface( target_garfield );
}
Ejemplo n.º 2
0
PREFIX void spDeleteSpriteCollection(spSpriteCollectionPointer collection, int keepSprites)
{
	if (collection == NULL)
		return;
	spSpritePointer sprite = collection->firstSprite;
	while (sprite)
	{
		spSpritePointer next = sprite->next;
		if (keepSprites)
			sprite->collection = NULL;
		else
			spDeleteSprite(sprite);
		sprite = next;
	}
	free(collection);
}
Ejemplo n.º 3
0
int main( int argc, char **argv )
{
	//sparrow3D Init
	spSetDefaultWindowSize( 640, 480 ); //Creates a 640x480 window at PC instead of 320x240
	spInitCore();

	//Setup
	screen = spCreateDefaultWindow();
	spSelectRenderTarget(screen);

	//Tile map loading
	tile_map = spLoadSurface( "./data/science_guy_frames01.png" );

	//Creating an empty sprite
	sprite = spNewSprite();
	//Filling it with it subsprites.
	int i;
	for ( i = 0; i < 9; i++ )
		spNewSubSpriteWithTiling( sprite, tile_map, i * 24 + 1, 1, 22, 46, 100 );

	//We don't want to use the zBuffer in any way
	spSetZSet(0);
	spSetZTest(0);

	//All glory the main loop
	//every frame the draw_function is called
	//every frame the calc_function is called with the past time as argument
	//at least 10 ms have to be between to frames (max 100 fps)
	//if the window is resized, the resize feedback-function is called (again)
	spLoop( draw_function, calc_function, 10, NULL, NULL );

	//Winter Wrap up, Winter Wrap up
	spDeleteSprite( sprite );
	spDeleteSurface( tile_map );
	spQuitCore();
	return 0;
}
Ejemplo n.º 4
0
void quit_sprites()
{
	spDeleteSurface(sprites_garfield);
	spDeleteSurface(sprites_texture);
	spDeleteSprite(sprite);
}