220 |
|
static void load_ramp_palette(void) |
221 |
|
{ |
222 |
|
// Find tables for gamma correction |
223 |
< |
uint8 *red_gamma, *green_gamma, *blue_gamma; |
223 |
> |
uint8 *red_gamma = NULL, *green_gamma = NULL, *blue_gamma = NULL; |
224 |
|
bool have_gamma = false; |
225 |
|
int data_width = 0; |
226 |
|
if (VidLocal.gamma_table) { |
511 |
|
return paramErr; |
512 |
|
|
513 |
|
// Find tables for gamma correction |
514 |
< |
uint8 *red_gamma, *green_gamma, *blue_gamma; |
514 |
> |
uint8 *red_gamma = NULL, *green_gamma = NULL, *blue_gamma = NULL; |
515 |
|
bool have_gamma = false; |
516 |
|
int data_width = 0; |
517 |
|
if (VidLocal.gamma_table) { |
862 |
|
WriteMacInt32(vp + vpVRes, 0x00480000); |
863 |
|
uint32 pix_type, pix_size, cmp_count, cmp_size, dev_type; |
864 |
|
switch (i->depth) { |
865 |
– |
case VDEPTH_1BIT: |
866 |
– |
pix_type = 0; pix_size = 1; |
867 |
– |
cmp_count = 1; cmp_size = 1; |
868 |
– |
dev_type = 0; // CLUT |
869 |
– |
break; |
870 |
– |
case VDEPTH_2BIT: |
871 |
– |
pix_type = 0; pix_size = 2; |
872 |
– |
cmp_count = 1; cmp_size = 2; |
873 |
– |
dev_type = 0; // CLUT |
874 |
– |
break; |
875 |
– |
case VDEPTH_4BIT: |
876 |
– |
pix_type = 0; pix_size = 4; |
877 |
– |
cmp_count = 1; cmp_size = 4; |
878 |
– |
dev_type = 0; // CLUT |
879 |
– |
break; |
880 |
– |
case VDEPTH_8BIT: |
881 |
– |
pix_type = 0; pix_size = 8; |
882 |
– |
cmp_count = 1; cmp_size = 8; |
883 |
– |
dev_type = 0; // CLUT |
884 |
– |
break; |
865 |
|
case VDEPTH_16BIT: |
866 |
|
pix_type = 0x10; pix_size = 16; |
867 |
|
cmp_count = 3; cmp_size = 5; |
872 |
|
cmp_count = 3; cmp_size = 8; |
873 |
|
dev_type = 2; // direct |
874 |
|
break; |
875 |
+ |
default: |
876 |
+ |
pix_type = 0; pix_size = 1 << i->depth; |
877 |
+ |
cmp_count = 1; cmp_size = 1 << i->depth; |
878 |
+ |
dev_type = 0; // CLUT |
879 |
+ |
break; |
880 |
|
} |
881 |
|
WriteMacInt16(vp + vpPixelType, pix_type); |
882 |
|
WriteMacInt16(vp + vpPixelSize, pix_size); |