diff options
author | rubidium <rubidium@openttd.org> | 2011-12-08 18:13:29 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-12-08 18:13:29 +0000 |
commit | 2ccbd2a6f5d0e3b9000122fe1845482241334f41 (patch) | |
tree | d8a346dc40e1f7f85376c413a0c12065e277ae49 /src/video/cocoa | |
parent | 9e8b76650a084bb26b32113317933217b1d99e42 (diff) | |
download | openttd-2ccbd2a6f5d0e3b9000122fe1845482241334f41.tar.xz |
(svn r23446) -Codechange: move _cur_palette and it's related first/count dirty variables into a single structure
Diffstat (limited to 'src/video/cocoa')
-rw-r--r-- | src/video/cocoa/cocoa_v.h | 2 | ||||
-rw-r--r-- | src/video/cocoa/event.mm | 8 | ||||
-rw-r--r-- | src/video/cocoa/fullscreen.mm | 6 | ||||
-rw-r--r-- | src/video/cocoa/wnd_quartz.mm | 6 | ||||
-rw-r--r-- | src/video/cocoa/wnd_quickdraw.mm | 12 |
5 files changed, 16 insertions, 18 deletions
diff --git a/src/video/cocoa/cocoa_v.h b/src/video/cocoa/cocoa_v.h index 157b285c8..a27b3c204 100644 --- a/src/video/cocoa/cocoa_v.h +++ b/src/video/cocoa/cocoa_v.h @@ -12,8 +12,6 @@ #ifndef VIDEO_COCOA_H #define VIDEO_COCOA_H -#include <AvailabilityMacros.h> - #include "../video_driver.hpp" class VideoDriver_Cocoa: public VideoDriver { diff --git a/src/video/cocoa/event.mm b/src/video/cocoa/event.mm index a0d79a529..3a9a62595 100644 --- a/src/video/cocoa/event.mm +++ b/src/video/cocoa/event.mm @@ -90,16 +90,16 @@ static void QZ_WarpCursor(int x, int y) static void QZ_CheckPaletteAnim() { - if (_pal_count_dirty != 0) { + if (_cur_palette.count_dirty != 0) { Blitter *blitter = BlitterFactoryBase::GetCurrentBlitter(); switch (blitter->UsePaletteAnimation()) { case Blitter::PALETTE_ANIMATION_VIDEO_BACKEND: - _cocoa_subdriver->UpdatePalette(_pal_first_dirty, _pal_count_dirty); + _cocoa_subdriver->UpdatePalette(_cur_palette.first_dirty, _cur_palette.count_dirty); break; case Blitter::PALETTE_ANIMATION_BLITTER: - blitter->PaletteAnimate(_pal_first_dirty, _pal_count_dirty); + blitter->PaletteAnimate(_cur_palette.first_dirty, _cur_palette.count_dirty); break; case Blitter::PALETTE_ANIMATION_NONE: @@ -108,7 +108,7 @@ static void QZ_CheckPaletteAnim() default: NOT_REACHED(); } - _pal_count_dirty = 0; + _cur_palette.count_dirty = 0; } } diff --git a/src/video/cocoa/fullscreen.mm b/src/video/cocoa/fullscreen.mm index db793a6b1..bd55852c3 100644 --- a/src/video/cocoa/fullscreen.mm +++ b/src/video/cocoa/fullscreen.mm @@ -494,9 +494,9 @@ public: for (uint32_t index = first_color; index < first_color + num_colors; index++) { /* Clamp colors between 0.0 and 1.0 */ CGDeviceColor color; - color.red = _cur_palette[index].r / 255.0; - color.blue = _cur_palette[index].b / 255.0; - color.green = _cur_palette[index].g / 255.0; + color.red = _cur_palette.palette[index].r / 255.0; + color.blue = _cur_palette.palette[index].b / 255.0; + color.green = _cur_palette.palette[index].g / 255.0; CGPaletteSetColorAtIndex(this->palette, color, index); } diff --git a/src/video/cocoa/wnd_quartz.mm b/src/video/cocoa/wnd_quartz.mm index 1fb85e011..5d45dcbab 100644 --- a/src/video/cocoa/wnd_quartz.mm +++ b/src/video/cocoa/wnd_quartz.mm @@ -468,9 +468,9 @@ void WindowQuartzSubdriver::UpdatePalette(uint first_color, uint num_colors) for (uint i = first_color; i < first_color + num_colors; i++) { uint32 clr = 0xff000000; - clr |= (uint32)_cur_palette[i].r << 16; - clr |= (uint32)_cur_palette[i].g << 8; - clr |= (uint32)_cur_palette[i].b; + clr |= (uint32)_cur_palette.palette[i].r << 16; + clr |= (uint32)_cur_palette.palette[i].g << 8; + clr |= (uint32)_cur_palette.palette[i].b; this->palette[i] = clr; } diff --git a/src/video/cocoa/wnd_quickdraw.mm b/src/video/cocoa/wnd_quickdraw.mm index b8eafc620..97dfac7d5 100644 --- a/src/video/cocoa/wnd_quickdraw.mm +++ b/src/video/cocoa/wnd_quickdraw.mm @@ -416,18 +416,18 @@ void WindowQuickdrawSubdriver::UpdatePalette(uint first_color, uint num_colors) case 32: for (uint i = first_color; i < first_color + num_colors; i++) { uint32 clr32 = 0xff000000; - clr32 |= (uint32)_cur_palette[i].r << 16; - clr32 |= (uint32)_cur_palette[i].g << 8; - clr32 |= (uint32)_cur_palette[i].b; + clr32 |= (uint32)_cur_palette.palette[i].r << 16; + clr32 |= (uint32)_cur_palette.palette[i].g << 8; + clr32 |= (uint32)_cur_palette.palette[i].b; this->palette[i] = clr32; } break; case 16: for (uint i = first_color; i < first_color + num_colors; i++) { uint16 clr16 = 0x0000; - clr16 |= (uint16)((_cur_palette[i].r >> 3) & 0x1f) << 10; - clr16 |= (uint16)((_cur_palette[i].g >> 3) & 0x1f) << 5; - clr16 |= (uint16)((_cur_palette[i].b >> 3) & 0x1f); + clr16 |= (uint16)((_cur_palette.palette[i].r >> 3) & 0x1f) << 10; + clr16 |= (uint16)((_cur_palette.palette[i].g >> 3) & 0x1f) << 5; + clr16 |= (uint16)((_cur_palette.palette[i].b >> 3) & 0x1f); this->palette[i] = clr16; } break; |