For B_CMAP8 modes, the system palette is now set after the mode switch.
8 bit modes should now work fine under Haiku. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17340 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -20,6 +20,7 @@
|
|||||||
#include "ServerConfig.h"
|
#include "ServerConfig.h"
|
||||||
#include "ServerCursor.h"
|
#include "ServerCursor.h"
|
||||||
#include "ServerProtocol.h"
|
#include "ServerProtocol.h"
|
||||||
|
#include "SystemPalette.h"
|
||||||
|
|
||||||
#include <Accelerant.h>
|
#include <Accelerant.h>
|
||||||
#include <Cursor.h>
|
#include <Cursor.h>
|
||||||
@@ -423,8 +424,8 @@ AccelerantHWInterface::SetMode(const display_mode &mode)
|
|||||||
// -> fall back to double buffer for fDisplayMode.space != B_RGB32
|
// -> fall back to double buffer for fDisplayMode.space != B_RGB32
|
||||||
// as intermediate solution...
|
// as intermediate solution...
|
||||||
bool doubleBuffered = HWInterface::IsDoubleBuffered();
|
bool doubleBuffered = HWInterface::IsDoubleBuffered();
|
||||||
if ((color_space)fDisplayMode.space != B_RGB32 &&
|
if ((color_space)fDisplayMode.space != B_RGB32
|
||||||
(color_space)fDisplayMode.space != B_RGBA32)
|
&& (color_space)fDisplayMode.space != B_RGBA32)
|
||||||
doubleBuffered = true;
|
doubleBuffered = true;
|
||||||
|
|
||||||
if (doubleBuffered) {
|
if (doubleBuffered) {
|
||||||
@@ -442,6 +443,9 @@ AccelerantHWInterface::SetMode(const display_mode &mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (fDisplayMode.space == B_CMAP8)
|
||||||
|
_SetSystemPalette();
|
||||||
|
|
||||||
// update acceleration hooks
|
// update acceleration hooks
|
||||||
fAccFillRect = (fill_rectangle)fAccelerantHook(B_FILL_RECTANGLE, (void *)&fDisplayMode);
|
fAccFillRect = (fill_rectangle)fAccelerantHook(B_FILL_RECTANGLE, (void *)&fDisplayMode);
|
||||||
fAccInvertRect = (invert_rectangle)fAccelerantHook(B_INVERT_RECTANGLE,
|
fAccInvertRect = (invert_rectangle)fAccelerantHook(B_INVERT_RECTANGLE,
|
||||||
@@ -1050,3 +1054,26 @@ AccelerantHWInterface::_NativeColor(const RGBColor& color) const
|
|||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
AccelerantHWInterface::_SetSystemPalette()
|
||||||
|
{
|
||||||
|
set_indexed_colors setIndexedColors = (set_indexed_colors)fAccelerantHook(
|
||||||
|
B_SET_INDEXED_COLORS, NULL);
|
||||||
|
if (setIndexedColors == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
|
const rgb_color* palette = SystemPalette();
|
||||||
|
uint8 colors[3 * 256];
|
||||||
|
// the color table is an array with 3 bytes per color
|
||||||
|
uint32 j = 0;
|
||||||
|
|
||||||
|
for (int32 i = 0; i < 256; i++) {
|
||||||
|
colors[j++] = palette[i].red;
|
||||||
|
colors[j++] = palette[i].green;
|
||||||
|
colors[j++] = palette[i].blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
setIndexedColors(256, 0, colors, 0);
|
||||||
|
}
|
||||||
|
|||||||
@@ -103,6 +103,7 @@ private:
|
|||||||
void _RegionToRectParams(/*const*/ BRegion* region,
|
void _RegionToRectParams(/*const*/ BRegion* region,
|
||||||
uint32* count) const;
|
uint32* count) const;
|
||||||
uint32 _NativeColor(const RGBColor& color) const;
|
uint32 _NativeColor(const RGBColor& color) const;
|
||||||
|
void _SetSystemPalette();
|
||||||
|
|
||||||
int fCardFD;
|
int fCardFD;
|
||||||
image_id fAccelerantImage;
|
image_id fAccelerantImage;
|
||||||
|
|||||||
Reference in New Issue
Block a user