void CEGALatch::loadTilemap(GsTilemap &Tilemap, CPlanes &Planes, const int episode, const std::string &path)
{
	Tilemap.CreateSurface( gGraphics.Palette.m_Palette, SDL_SWSURFACE, m_num16tiles, 4, 13 );
	SDL_Surface *sfc = Tilemap.getSDLSurface();
	SDL_FillRect(sfc,NULL, 0);
	
	if(SDL_MUSTLOCK(sfc))	SDL_LockSurface(sfc);
	Uint8 *u_pixel = (Uint8*) sfc->pixels;

	for(int p=0;p<4;p++)
		Planes.readPlaneofTiles(p, u_pixel, 13, 16, m_num16tiles);

	if(SDL_MUSTLOCK(sfc))	SDL_UnlockSurface(sfc);

	// Load Hi-Colour, VGA, SVGA Tiles into the tilemap	
    if(Tilemap.loadHiresTile("gfx/ck" + itoa(episode) + "tiles", path))
	{
	  gLogging.textOut(GREEN, "Additional VGA Bitmap for the Tileset has been loaded successfully!");
    }

	// Adapt the tilemap to the display, so they are faster blit
    //Tilemap.optimizeSurface();
}