Renamed ENABLE_RGB_COLOR to USE_RGB_COLOR, and added it to config.h to guarantee a consistent build.
svn-id: r43604
This commit is contained in:
parent
c0d9543345
commit
007f68366f
21 changed files with 55 additions and 53 deletions
|
@ -26,7 +26,7 @@
|
|||
#include "backends/platform/sdl/sdl.h"
|
||||
#include "common/mutex.h"
|
||||
#include "common/util.h"
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
#include "common/list.h"
|
||||
#endif
|
||||
#include "graphics/font.h"
|
||||
|
@ -100,7 +100,7 @@ void OSystem_SDL::beginGFXTransaction(void) {
|
|||
_transactionDetails.needUpdatescreen = false;
|
||||
|
||||
_transactionDetails.normal1xScaler = false;
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
_transactionDetails.formatChanged = false;
|
||||
#endif
|
||||
|
||||
|
@ -126,7 +126,7 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
|
|||
|
||||
_videoMode.mode = _oldVideoMode.mode;
|
||||
_videoMode.scaleFactor = _oldVideoMode.scaleFactor;
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
} else if (_videoMode.format != _oldVideoMode.format) {
|
||||
errors |= kTransactionFormatNotSupported;
|
||||
|
||||
|
@ -156,7 +156,7 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
|
|||
}
|
||||
}
|
||||
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
if (_transactionDetails.sizeChanged || _transactionDetails.formatChanged) {
|
||||
#else
|
||||
if (_transactionDetails.sizeChanged) {
|
||||
|
@ -209,7 +209,7 @@ OSystem::TransactionError OSystem_SDL::endGFXTransaction(void) {
|
|||
return (TransactionError)errors;
|
||||
}
|
||||
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
const Graphics::PixelFormat RGBList[] = {
|
||||
#ifdef ENABLE_32BIT
|
||||
// RGBA8888, ARGB8888, RGB888
|
||||
|
@ -442,7 +442,7 @@ int OSystem_SDL::getGraphicsMode() const {
|
|||
void OSystem_SDL::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
|
||||
assert(_transactionMode == kTransactionActive);
|
||||
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
//avoid redundant format changes
|
||||
Graphics::PixelFormat newFormat;
|
||||
if (!format)
|
||||
|
@ -543,7 +543,7 @@ bool OSystem_SDL::loadGFXMode() {
|
|||
//
|
||||
// Create the surface that contains the 8 bit game data
|
||||
//
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, _videoMode.screenWidth, _videoMode.screenHeight,
|
||||
_screenFormat.bytesPerPixel << 3,
|
||||
((1 << _screenFormat.rBits()) - 1) << _screenFormat.rShift ,
|
||||
|
@ -1007,7 +1007,7 @@ void OSystem_SDL::copyRectToScreen(const byte *src, int pitch, int x, int y, int
|
|||
if (SDL_LockSurface(_screen) == -1)
|
||||
error("SDL_LockSurface failed: %s", SDL_GetError());
|
||||
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
byte *dst = (byte *)_screen->pixels + y * _videoMode.screenWidth * _screenFormat.bytesPerPixel + x * _screenFormat.bytesPerPixel;
|
||||
if (_videoMode.screenWidth == w && pitch == w * _screenFormat.bytesPerPixel) {
|
||||
memcpy(dst, src, h*w*_screenFormat.bytesPerPixel);
|
||||
|
@ -1053,7 +1053,7 @@ Graphics::Surface *OSystem_SDL::lockScreen() {
|
|||
_framebuffer.w = _screen->w;
|
||||
_framebuffer.h = _screen->h;
|
||||
_framebuffer.pitch = _screen->pitch;
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
_framebuffer.bytesPerPixel = _screenFormat.bytesPerPixel;
|
||||
#else
|
||||
_framebuffer.bytesPerPixel = 1;
|
||||
|
@ -1241,7 +1241,7 @@ int16 OSystem_SDL::getWidth() {
|
|||
void OSystem_SDL::setPalette(const byte *colors, uint start, uint num) {
|
||||
assert(colors);
|
||||
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
if (_screenFormat.bytesPerPixel > 1)
|
||||
return; //not using a paletted pixel format
|
||||
#endif
|
||||
|
@ -1508,7 +1508,7 @@ void OSystem_SDL::warpMouse(int x, int y) {
|
|||
}
|
||||
|
||||
void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x, int hotspot_y, uint32 keycolor, int cursorTargetScale, const Graphics::PixelFormat *format) {
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
if (!format)
|
||||
_cursorFormat = Graphics::PixelFormat::createFormatCLUT8();
|
||||
else if (format->bytesPerPixel <= _screenFormat.bytesPerPixel)
|
||||
|
@ -1551,7 +1551,7 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
|
|||
}
|
||||
|
||||
free(_mouseData);
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
_mouseData = (byte *)malloc(w * h * _cursorFormat.bytesPerPixel);
|
||||
memcpy(_mouseData, buf, w * h * _cursorFormat.bytesPerPixel);
|
||||
#else
|
||||
|
@ -1565,7 +1565,7 @@ void OSystem_SDL::setMouseCursor(const byte *buf, uint w, uint h, int hotspot_x,
|
|||
void OSystem_SDL::blitCursor() {
|
||||
byte *dstPtr;
|
||||
const byte *srcPtr = _mouseData;
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
uint32 color;
|
||||
uint32 colormask = (1 << (_cursorFormat.bytesPerPixel << 3)) - 1;
|
||||
#else
|
||||
|
@ -1604,7 +1604,7 @@ void OSystem_SDL::blitCursor() {
|
|||
|
||||
for (i = 0; i < h; i++) {
|
||||
for (j = 0; j < w; j++) {
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
if (_cursorFormat.bytesPerPixel > 1) {
|
||||
color = (*(uint32 *) srcPtr) & colormask;
|
||||
if (color != _mouseKeyColor) { // transparent, don't draw
|
||||
|
@ -1624,7 +1624,7 @@ void OSystem_SDL::blitCursor() {
|
|||
}
|
||||
dstPtr += 2;
|
||||
srcPtr++;
|
||||
#ifdef ENABLE_RGB_COLOR
|
||||
#ifdef USE_RGB_COLOR
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue