diff options
Diffstat (limited to 'graphics')
-rw-r--r-- | graphics/cursorman.cpp | 2 | ||||
-rw-r--r-- | graphics/cursorman.h | 4 | ||||
-rw-r--r-- | graphics/pixelformat.h | 65 |
3 files changed, 5 insertions, 66 deletions
diff --git a/graphics/cursorman.cpp b/graphics/cursorman.cpp index b77aac37cf..3dd7c1d023 100644 --- a/graphics/cursorman.cpp +++ b/graphics/cursorman.cpp @@ -138,7 +138,7 @@ void CursorManager::replaceCursor(const byte *buf, uint w, uint h, int hotspotX, if (format) cur->_format = *format; else - cur->_format = Graphics::PixelFormat::createFormatCLUT8(); + cur->_format = Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0); #endif g_system->setMouseCursor(cur->_data, w, h, hotspotX, hotspotY, keycolor, targetScale, format); diff --git a/graphics/cursorman.h b/graphics/cursorman.h index ae7008f54c..b67241ab7b 100644 --- a/graphics/cursorman.h +++ b/graphics/cursorman.h @@ -181,13 +181,13 @@ private: Cursor(const byte *data, uint w, uint h, int hotspotX, int hotspotY, uint32 keycolor = 0xFFFFFFFF, int targetScale = 1, const Graphics::PixelFormat *format = NULL) { #ifdef ENABLE_RGB_COLOR if (!format) - _format = Graphics::PixelFormat::createFormatCLUT8(); + _format = Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0); else _format = *format; _size = w * h * _format.bytesPerPixel; _keycolor &= ((1 << (_format.bytesPerPixel << 3)) - 1); #else - _format = Graphics::PixelFormat::createFormatCLUT8(); + _format = Graphics::PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0); _size = w * h; _keycolor &= 0xFF; #endif diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h index bf18197f25..d7f5e851ad 100644 --- a/graphics/pixelformat.h +++ b/graphics/pixelformat.h @@ -65,67 +65,6 @@ struct PixelFormat { rShift = RShift, gShift = GShift, bShift = BShift, aShift = AShift; } - ///////////////////////////////////////////////////////// - // Convenience functions for creating standard formats // - ///////////////////////////////////////////////////////// - - // 256 color palette. - static inline PixelFormat createFormatCLUT8() { - return PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0); - } - // 2 Bytes-per-pixel modes - static inline PixelFormat createFormatRGB555() { - return PixelFormat(2, 3, 3, 3, 8, 10, 5, 0, 0); - } - static inline PixelFormat createFormatBGR555() { - return PixelFormat(2, 3, 3, 3, 8, 0, 5, 10, 0); - } - static inline PixelFormat createFormatXRGB1555() { - // Special case, alpha bit is always high in this mode. - return PixelFormat(2, 3, 3, 3, 7, 10, 5, 0, 15); - } - static inline PixelFormat createFormatXBGR1555() { - // Special case, alpha bit is always high in this mode. - return PixelFormat(2, 3, 3, 3, 7, 0, 5, 10, 15); - } - static inline PixelFormat createFormatRGB565() { - return PixelFormat(2, 3, 2, 3, 8, 11, 5, 0, 0); - } - static inline PixelFormat createFormatBGR565() { - return PixelFormat(2, 3, 2, 3, 8, 0, 5, 11, 0); - } - static inline PixelFormat createFormatRGBA4444() { - return PixelFormat(2, 4, 4, 4, 4, 12, 8, 4, 0); - } - static inline PixelFormat createFormatARGB4444() { - return PixelFormat(2, 4, 4, 4, 4, 8, 4, 0, 12); - } - static inline PixelFormat createFormatABGR4444() { - return PixelFormat(2, 4, 4, 4, 4, 0, 4, 8, 12); - } - static inline PixelFormat createFormatBGRA4444() { - return PixelFormat(2, 4, 4, 4, 4, 4, 8, 12, 0); - } - // 3 to 4 byte per pixel modes - static inline PixelFormat createFormatRGB888() { - return PixelFormat(3, 0, 0, 0, 8, 16, 8, 0, 0); - } - static inline PixelFormat createFormatBGR888() { - return PixelFormat(3, 0, 0, 0, 8, 0, 8, 16, 0); - } - static inline PixelFormat createFormatRGBA8888() { - return PixelFormat(4, 0, 0, 0, 0, 24, 16, 8, 0); - } - static inline PixelFormat createFormatARGB8888() { - return PixelFormat(4, 0, 0, 0, 0, 16 ,8, 0, 24); - } - static inline PixelFormat createFormatABGR8888() { - return PixelFormat(4, 0, 0, 0, 0, 0, 8, 16, 24); - } - static inline PixelFormat createFormatBGRA8888() { - return PixelFormat(4, 0, 0, 0, 0, 8, 16, 24, 0); - } - inline bool operator==(const PixelFormat &fmt) const { // TODO: If aLoss==8, then the value of aShift is irrelevant, and should be ignored. return 0 == memcmp(this, &fmt, sizeof(PixelFormat)); @@ -211,7 +150,7 @@ struct PixelFormat { * @param backend The higher priority list, meant to be a list of formats supported by the backend * @param frontend The lower priority list, meant to be a list of formats supported by the engine * @return The first item on the backend list that also occurs on the frontend list - * or PixelFormat::createFormatCLUT8() if no matching formats were found. + * or PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0) if no matching formats were found. */ inline PixelFormat findCompatibleFormat(Common::List<PixelFormat> backend, Common::List<PixelFormat> frontend) { #ifdef ENABLE_RGB_COLOR @@ -222,7 +161,7 @@ inline PixelFormat findCompatibleFormat(Common::List<PixelFormat> backend, Commo } } #endif - return PixelFormat::createFormatCLUT8(); + return PixelFormat(1, 8, 8, 8, 8, 0, 0, 0, 0); } } // end of namespace Graphics |