Ejemplo n.º 1
0
void cleanup()
{
	/* Free the sprites */
	
	freeSprites();
	
	/* Free the sounds */
	
	freeSounds();
	
	/* Close the font */
	
	closeFont(game.font);
	
	/* Close the mixer */
	
	Mix_CloseAudio();
	
	/* Close SDL_TTF */
	
	TTF_Quit();
	
	/* Shut down SDL */
	
	SDL_Quit();
}
Ejemplo n.º 2
0
GsGraphics::~GsGraphics()
{
//	freeCursor();
	freeBitmaps(maskedBitmap);
	freeBitmaps(Bitmap);
	freeSprites();
	freeFonts();
	freeTilemap();
}
Ejemplo n.º 3
0
CGfxEngine::~CGfxEngine()
{
	freeCursor();
	freeBitmaps(maskedBitmap);
	freeBitmaps(Bitmap);
	freeSprites();
	freeFonts();
	freeTilemap();
}
Ejemplo n.º 4
0
void GsGraphics::createEmptySprites(const int numVar, const int num_sprites)
{
	freeSprites();
    GsSprite sprite;

    std::vector<GsSprite> spriteVec;

    spriteVec.assign(num_sprites, sprite);

    Sprite.assign(numVar, spriteVec);
}
Ejemplo n.º 5
0
void freeLevelResources()
{
	/* Free the entities */

	freeEntities();

	/* Free the decorations */

	freeDecorations();

	/* Free the animations */

	freeAnimations();

	/* Free the sounds */

	freeSounds();

	if (game.overrideMusic == FALSE)
	{
		/* Free music */

		freeMusic();
	}

	/* Free the map data */

	freeMap();

	/* Free the sprites */

	freeSprites();

	/* Free the triggers */

	freeTriggers();

	/* Free the properties */

	freeProperties();

	/* Free the targets */

	freeTargets();

	/* Free the message queue */

	freeMessageQueue();

	/* Free the scripts */

	freeScript();
}
Ejemplo n.º 6
0
void BenchCairo::prepareSprites(int size)
{
  BenchModule::prepareSprites(size);

  size_t i, length = sprites.getLength();
  for (i = 0; i < length; i++)
  {
    cairo_surface_t* sprite = cairo_image_surface_create_for_data(
    (unsigned char*)sprites[i].getFirst(), CAIRO_FORMAT_ARGB32,
    sprites[i].getWidth(), sprites[i].getHeight(), (int)sprites[i].getStride());

    if (sprite == NULL)
    {
      freeSprites();
      return;
    }

    spritesCairo.append(sprite);
  }
}
Ejemplo n.º 7
0
void CGfxEngine::createEmptySprites(Uint16 num_sprites)
{
	freeSprites();
	CSprite sprite;
	Sprite.assign(num_sprites, sprite);
}
Ejemplo n.º 8
0
void BenchCairo::bench(BenchOutput& output, const BenchParams& params)
{
  if (screen.create(params.screenSize, params.format) != Fog::ERR_OK)
    return;

  switch (params.type)
  {
    case BENCH_TYPE_BLIT_IMAGE_I:
    case BENCH_TYPE_BLIT_IMAGE_F:
    case BENCH_TYPE_BLIT_IMAGE_ROTATE:
      prepareSprites(params.shapeSize);
      break;
  }

  screenCairo = cairo_image_surface_create_for_data(
    (unsigned char*)screen.getFirstX(),
    BenchCairo_getCairoFormat(params.format),
    screen.getWidth(),
    screen.getHeight(),
    (int)screen.getStride());

  if (screenCairo == NULL)
    return;

  screen.clear(Fog::Color(Fog::Argb32(0x00000000)));
  Fog::Time start(Fog::Time::now());

  switch (params.type)
  {
    case BENCH_TYPE_CREATE_DESTROY:
      runCreateDestroy(output, params);
      break;

    case BENCH_TYPE_FILL_RECT_I:
      runFillRectI(output, params);
      break;

    case BENCH_TYPE_FILL_RECT_F:
      runFillRectF(output, params);
      break;

    case BENCH_TYPE_FILL_RECT_ROTATE:
      runFillRectRotate(output, params);
      break;

    case BENCH_TYPE_FILL_ROUND:
      runFillRound(output, params);
      break;

    case BENCH_TYPE_FILL_POLYGON:
      runFillPolygon(output, params, 10);
      break;

    case BENCH_TYPE_FILL_COMPLEX:
      runFillPolygon(output, params, 100);
      break;

    case BENCH_TYPE_BLIT_IMAGE_I:
      runBlitImageI(output, params);
      break;

    case BENCH_TYPE_BLIT_IMAGE_F:
      runBlitImageF(output, params);
      break;

    case BENCH_TYPE_BLIT_IMAGE_ROTATE:
      runBlitImageRotate(output, params);
      break;
  }

  output.time = Fog::Time::now() - start;

  cairo_surface_destroy(screenCairo);
  screenCairo = NULL;

  freeSprites();
}