Agggh!!! Slow FPS drawing map [Solved]

Started by
10 comments, last by kiketom 18 years, 1 month ago
This is the implementation of my TileSet contructor
tileSet::tileSet(char file[], int Rows, int Columns){	Uint32 color;		this->m_image_tiles = IMG_Load(file);		if (!this->m_image_tiles)	{		printf ("IMG_Load: %s\n", IMG_GetError ());	}		color = SDL_MapRGB(this->m_image_tiles->format, 255, 0, 255);	SDL_SetColorKey(this->m_image_tiles, SDL_SRCCOLORKEY, color);		this->m_Rows = Rows;	this->m_Cols = Columns;}


How can i make it with the same pixel format that the screen if i create the surface with IMG_Load???

Thanks, ;)

-------------------------------------------------------

Asi tengo implementado la creacion del TileSet:

tileSet::tileSet(char file[], int Rows, int Columns){	Uint32 color;		this->m_image_tiles = IMG_Load(file);		if (!this->m_image_tiles)	{		printf ("IMG_Load: %s\n", IMG_GetError ());	}		color = SDL_MapRGB(this->m_image_tiles->format, 255, 0, 255);	SDL_SetColorKey(this->m_image_tiles, SDL_SRCCOLORKEY, color);		this->m_Rows = Rows;	this->m_Cols = Columns;}


¿Como puedo hacer para que sea del mismo formato que el screen si creo la surface con IMG_Load?

Gracias ;)
Tomy
Advertisement
Reducing the bitsperpixel in the screen to 16 instead of 24 i have won 8 more frames per second.

Now the map (20x20) with 3 layer have 70 FPS in windowed mode.
[totally]
Thanks ALL!!!

[Edited by - kiketom on March 16, 2006 8:10:52 AM]
Tomy

This topic is closed to new replies.

Advertisement