mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
Implemented OSystem_Dreamcast::grabPalette().
svn-id: r18472
This commit is contained in:
parent
9e13459338
commit
e2d1b7afa4
@ -64,6 +64,7 @@ class OSystem_Dreamcast : public OSystem {
|
||||
|
||||
// Set colors of the palette
|
||||
void setPalette(const byte *colors, uint start, uint num);
|
||||
void grabPalette(byte *colors, uint start, uint num);
|
||||
|
||||
// Set the size of the video bitmap.
|
||||
// Typically, 320x200
|
||||
|
@ -142,6 +142,20 @@ void OSystem_Dreamcast::setPalette(const byte *colors, uint start, uint num)
|
||||
_screen_dirty = true;
|
||||
}
|
||||
|
||||
void OSystem_Dreamcast::grabPalette(byte *colors, uint start, uint num)
|
||||
{
|
||||
const unsigned short *src = palette + start;
|
||||
if(num>0)
|
||||
while( num-- ) {
|
||||
unsigned short p = *src++;
|
||||
colors[0] = ((p&0x7c00)>>7)|((p&0x7000)>>12);
|
||||
colors[1] = ((p&0x03e0)>>2)|((p&0x0380)>>7);
|
||||
colors[2] = ((p&0x001f)<<3)|((p&0x001c)>>2);
|
||||
colors[3] = 0xff;
|
||||
colors += 4;
|
||||
}
|
||||
}
|
||||
|
||||
void OSystem_Dreamcast::setScaling()
|
||||
{
|
||||
if(_screen_w > 400) {
|
||||
|
Loading…
Reference in New Issue
Block a user