536 |
|
* Set palette |
537 |
|
*/ |
538 |
|
|
539 |
< |
void video_set_palette(uint8 *pal) |
539 |
> |
void video_set_palette(uint8 *pal, in num) |
540 |
|
{ |
541 |
|
if ((display_type == DISPLAY_SCREEN_P96 || display_type == DISPLAY_SCREEN_CGFX) |
542 |
|
&& !IsDirectMode(VideoMonitor.mode)) { |
543 |
|
|
544 |
|
// Convert palette to 32 bits |
545 |
|
ULONG table[2 + 256 * 3]; |
546 |
< |
table[0] = 256 << 16; |
547 |
< |
table[256 * 3 + 1] = 0; |
548 |
< |
for (int i=0; i<256; i++) { |
546 |
> |
table[0] = num << 16; |
547 |
> |
table[num * 3 + 1] = 0; |
548 |
> |
for (int i=0; i<num; i++) { |
549 |
|
table[i*3+1] = pal[i*3] * 0x01010101; |
550 |
|
table[i*3+2] = pal[i*3+1] * 0x01010101; |
551 |
|
table[i*3+3] = pal[i*3+2] * 0x01010101; |