Skip to content

Commit

Permalink
ANDROID: Replace getPixelFormatName function with PixelFormat::toString
Browse files Browse the repository at this point in the history
  • Loading branch information
ccawley2011 authored and sev- committed Jul 29, 2018
1 parent 51a2685 commit d494d73
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
1 change: 0 additions & 1 deletion backends/platform/android/android.h
Expand Up @@ -157,7 +157,6 @@ class OSystem_Android : public EventsBaseBackend, public PaletteManager {
void initOverlay();

#ifdef USE_RGB_COLOR
Common::String getPixelFormatName(const Graphics::PixelFormat &format) const;
void initTexture(GLESBaseTexture **texture, uint width, uint height,
const Graphics::PixelFormat *format);
#endif
Expand Down
23 changes: 3 additions & 20 deletions backends/platform/android/gfx.cpp
Expand Up @@ -101,23 +101,6 @@ Common::List<Graphics::PixelFormat> OSystem_Android::getSupportedFormats() const
return res;
}

Common::String OSystem_Android::getPixelFormatName(const Graphics::PixelFormat &format) const {
if (format.bytesPerPixel == 1)
return "CLUT8";

if (format.aLoss == 8)
return Common::String::format("RGB%u%u%u",
8 - format.rLoss,
8 - format.gLoss,
8 - format.bLoss);

return Common::String::format("RGBA%u%u%u%u",
8 - format.rLoss,
8 - format.gLoss,
8 - format.bLoss,
8 - format.aLoss);
}

void OSystem_Android::initTexture(GLESBaseTexture **texture,
uint width, uint height,
const Graphics::PixelFormat *format) {
Expand All @@ -140,7 +123,7 @@ void OSystem_Android::initTexture(GLESBaseTexture **texture,
if (format_current != format_new) {
if (*texture)
LOGD("switching pixel format from: %s",
getPixelFormatName((*texture)->getPixelFormat()).c_str());
(*texture)->getPixelFormat().toString().c_str());

delete *texture;

Expand All @@ -156,13 +139,13 @@ void OSystem_Android::initTexture(GLESBaseTexture **texture,
// TODO what now?
if (format_new != format_clut8)
LOGE("unsupported pixel format: %s",
getPixelFormatName(format_new).c_str());
format_new.toString().c_str());

*texture = new GLESFakePalette565Texture;
}

LOGD("new pixel format: %s",
getPixelFormatName((*texture)->getPixelFormat()).c_str());
(*texture)->getPixelFormat().toString().c_str());
}

(*texture)->allocBuffer(width, height);
Expand Down

0 comments on commit d494d73

Please sign in to comment.