125 |
|
|
126 |
|
|
127 |
|
/* |
128 |
+ |
* Find palette size for given color depth |
129 |
+ |
*/ |
130 |
+ |
|
131 |
+ |
static int palette_size(video_depth depth) |
132 |
+ |
{ |
133 |
+ |
switch (depth) { |
134 |
+ |
case VDEPTH_1BIT: return 2; |
135 |
+ |
case VDEPTH_2BIT: return 4; |
136 |
+ |
case VDEPTH_4BIT: return 16; |
137 |
+ |
case VDEPTH_8BIT: return 256; |
138 |
+ |
case VDEPTH_16BIT: return 32; |
139 |
+ |
case VDEPTH_32BIT: return 256; |
140 |
+ |
default: return 0; |
141 |
+ |
} |
142 |
+ |
} |
143 |
+ |
|
144 |
+ |
|
145 |
+ |
/* |
146 |
|
* Set palette to 50% gray |
147 |
|
*/ |
148 |
|
|
153 |
|
VidLocal.palette[i * 3 + 1] = 127; |
154 |
|
VidLocal.palette[i * 3 + 2] = 127; |
155 |
|
} |
156 |
< |
video_set_palette(VidLocal.palette); |
156 |
> |
video_set_palette(VidLocal.palette, 256); |
157 |
|
} |
158 |
|
|
159 |
|
|
196 |
|
*p++ = blue; |
197 |
|
} |
198 |
|
|
199 |
< |
video_set_palette(VidLocal.palette); |
199 |
> |
video_set_palette(VidLocal.palette, num); |
200 |
|
} |
201 |
|
|
202 |
|
|
501 |
|
s_pal += 8; |
502 |
|
} |
503 |
|
} |
504 |
< |
video_set_palette(VidLocal.palette); |
504 |
> |
video_set_palette(VidLocal.palette, palette_size(VidLocal.desc->mode.depth)); |
505 |
|
return noErr; |
506 |
|
} |
507 |
|
|