comparison libvo/vo_svga.c @ 288:abe56b2561b1

bpp fix
author arpi_esp
date Thu, 05 Apr 2001 19:44:54 +0000
parents b2f3f2ab3787
children f40a55208b76
comparison
equal deleted inserted replaced
287:abc78352e35e 288:abe56b2561b1
53 53
54 static uint8_t vid_modes[VID_MODE_NUM]; 54 static uint8_t vid_modes[VID_MODE_NUM];
55 static uint8_t vid_mode; 55 static uint8_t vid_mode;
56 56
57 static uint32_t pformat; 57 static uint32_t pformat;
58 static uint8_t bpp;
59 58
60 static uint8_t checked = 0; 59 static uint8_t checked = 0;
61 60
62 static void checksupportedmodes() { 61 static void checksupportedmodes() {
63 int i; 62 int i;
73 } 72 }
74 73
75 static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, 74 static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width,
76 uint32_t d_height, uint32_t fullscreen, char *title, 75 uint32_t d_height, uint32_t fullscreen, char *title,
77 uint32_t format) { 76 uint32_t format) {
77 static uint8_t bpp;
78 if (!checked) { 78 if (!checked) {
79 checksupportedmodes(); // Looking for available video modes 79 checksupportedmodes(); // Looking for available video modes
80 } 80 }
81 pformat = format; 81 pformat = format;
82 if(format==IMGFMT_YV12) bpp=32; else bpp=format&255;
82 if (d_width > 800) 83 if (d_width > 800)
83 switch (bpp) { 84 switch (bpp) {
84 case 32: vid_mode = 36; break; 85 case 32: vid_mode = 36; break;
85 case 24: vid_mode = 25; break; 86 case 24: vid_mode = 25; break;
86 case 16: vid_mode = 24; break; 87 case 16: vid_mode = 24; break;
151 if (!checked) 152 if (!checked)
152 checksupportedmodes(); // Looking for available video modes 153 checksupportedmodes(); // Looking for available video modes
153 switch (format) { 154 switch (format) {
154 case IMGFMT_RGB32: 155 case IMGFMT_RGB32:
155 case IMGFMT_BGR|32: { 156 case IMGFMT_BGR|32: {
156 bpp = 32;
157 return (vid_modes[_640x480x16M32] | vid_modes[_800x600x16M32] | vid_modes[_1024x768x16M32]); 157 return (vid_modes[_640x480x16M32] | vid_modes[_800x600x16M32] | vid_modes[_1024x768x16M32]);
158 } 158 }
159 case IMGFMT_RGB24: 159 case IMGFMT_RGB24:
160 case IMGFMT_BGR|24: { 160 case IMGFMT_BGR|24: {
161 bpp = 24;
162 return (vid_modes[_640x480x16M] | vid_modes[_800x600x16M] | vid_modes[_1024x768x16M]); 161 return (vid_modes[_640x480x16M] | vid_modes[_800x600x16M] | vid_modes[_1024x768x16M]);
163 } 162 }
164 case IMGFMT_RGB16: 163 case IMGFMT_RGB16:
165 case IMGFMT_BGR|16: { 164 case IMGFMT_BGR|16: {
166 bpp = 16;
167 return (vid_modes[_640x480x64K] | vid_modes[_800x600x64K] | vid_modes[_1024x768x64K]); 165 return (vid_modes[_640x480x64K] | vid_modes[_800x600x64K] | vid_modes[_1024x768x64K]);
168 } 166 }
169 case IMGFMT_RGB15: 167 case IMGFMT_RGB15:
170 case IMGFMT_BGR|15: { 168 case IMGFMT_BGR|15: {
171 bpp = 15;
172 return (vid_modes[_640x480x32K] | vid_modes[_800x600x32K] | vid_modes[_1024x768x32K]); 169 return (vid_modes[_640x480x32K] | vid_modes[_800x600x32K] | vid_modes[_1024x768x32K]);
173 } 170 }
174 case IMGFMT_YV12: return (1); 171 case IMGFMT_YV12: return (1);
175 } 172 }
176 return (0); 173 return (0);