Image* ImageMgr::GetImage() { unsigned int height = GetHeight(); unsigned int width = GetWidth(); Image *data = new Image(width, height); Sprite2D *spr = GetSprite2D(); for (unsigned int y = 0; y < height; y++) { for (unsigned int x = 0; x < width; x++) { data->SetPixel(x,y, spr->GetPixel(x,y)); } } core->GetVideoDriver()->FreeSprite(spr); return data; }
Bitmap* ImageMgr::GetBitmap() { unsigned int height = GetHeight(); unsigned int width = GetWidth(); Bitmap *data = new Bitmap(width, height); Log(ERROR, "ImageMgr", "Don't know how to handle 24bit bitmap from %s...", str->filename ); Sprite2D *spr = GetSprite2D(); for (unsigned int y = 0; y < height; y++) { for (unsigned int x = 0; x < width; x++) { data->SetAt(x,y, spr->GetPixel(x,y).r); } } core->GetVideoDriver()->FreeSprite(spr); return data; }