Mercurial > mplayer.hg
annotate libvo/vo_svga.c @ 989:1be1647ebd7d
flip_page gl_fillbox fix.
author | se7encode |
---|---|
date | Mon, 04 Jun 2001 11:27:42 +0000 |
parents | 90408bd383a5 |
children | bf2c01c5e9dc |
rev | line source |
---|---|
285 | 1 /* |
292 | 2 Video driver for SVGAlib - alpha, slow |
285 | 3 by Zoltan Mark Vician <se7en@sch.bme.hu> |
381 | 4 Code started: Mon Apr 1 23:25:47 2001 |
407 | 5 |
6 Uses HW acceleration if your card is supported by SVGAlib. | |
285 | 7 */ |
8 | |
9 #include <stdio.h> | |
10 #include <stdlib.h> | |
11 | |
12 #include <vga.h> | |
13 #include <vgagl.h> | |
14 | |
485 | 15 #include <limits.h> |
16 | |
285 | 17 #include "config.h" |
18 #include "video_out.h" | |
19 #include "video_out_internal.h" | |
20 | |
21 #include "yuv2rgb.h" | |
377 | 22 #include "mmx.h" |
285 | 23 |
616 | 24 #include "sub.h" |
25 | |
407 | 26 extern void rgb15to16_mmx(char* s0,char* d0,int count); |
485 | 27 extern int vo_dbpp; |
504 | 28 extern int verbose; |
407 | 29 |
285 | 30 LIBVO_EXTERN(svga) |
31 | |
32 static vo_info_t vo_info = { | |
33 "SVGAlib", | |
34 "svga", | |
35 "Zoltan Mark Vician <se7en@sch.bme.hu>", | |
36 "" | |
37 }; | |
38 | |
39 // SVGAlib definitions | |
40 | |
41 GraphicsContext *screen; | |
42 GraphicsContext *virt; | |
43 | |
407 | 44 static uint8_t *scalebuf = NULL, *yuvbuf = NULL, *bppbuf = NULL; |
285 | 45 |
46 static uint32_t orig_w, orig_h, maxw, maxh; // Width, height | |
377 | 47 static float scaling = 1.0; |
285 | 48 static uint32_t x_pos, y_pos; // Position |
49 | |
483 | 50 // SVGAlib - list of detected modes |
51 typedef struct vga_modelist_s { | |
52 uint16_t modenum; | |
53 vga_modeinfo modeinfo; | |
54 struct vga_modelist_s *next; | |
55 } vga_modelist_t; | |
447 | 56 |
483 | 57 vga_modelist_t *modelist = NULL; |
58 | |
327 | 59 static uint8_t bpp; |
483 | 60 static uint8_t bpp_conv = 0; |
448
198b46b739d8
qrva eletbe nem kene cvs-t elbaszni inkabb ne nyuljatok hozza baz+
arpi_esp
parents:
447
diff
changeset
|
61 static uint32_t pformat; |
447 | 62 |
483 | 63 #define BPP_15 1 |
64 #define BPP_16 2 | |
65 #define BPP_24 4 | |
66 #define BPP_32 8 | |
67 static uint8_t bpp_avail = 0; | |
68 | |
285 | 69 static uint8_t checked = 0; |
483 | 70 |
485 | 71 static uint32_t add_mode(uint16_t mode, vga_modeinfo minfo) { |
483 | 72 vga_modelist_t *list; |
285 | 73 |
483 | 74 if (modelist == NULL) { |
485 | 75 modelist = (vga_modelist_t *) malloc(sizeof(vga_modelist_t)); |
483 | 76 if (modelist == NULL) { |
77 printf("vo_svga: add_mode() failed. Not enough memory for modelist."); | |
78 return(1); // error | |
79 } | |
485 | 80 modelist->modenum = mode; |
81 modelist->modeinfo = minfo; | |
82 modelist->next = NULL; | |
483 | 83 } else { |
84 list = modelist; | |
85 while (list->next != NULL) | |
86 list = list->next; | |
485 | 87 list->next = (vga_modelist_t *) malloc(sizeof(vga_modelist_t)); |
483 | 88 if (list->next == NULL) { |
89 printf("vo_svga: add_mode() failed. Not enough memory for modelist."); | |
90 return(1); // error | |
91 } | |
92 list = list->next; | |
93 list->modenum = mode; | |
94 list->modeinfo = minfo; | |
95 list->next = NULL; | |
96 } | |
485 | 97 return (0); |
483 | 98 } |
99 | |
100 static int checksupportedmodes() { | |
485 | 101 uint16_t i, max; |
483 | 102 vga_modeinfo *minfo; |
285 | 103 |
104 checked = 1; | |
105 vga_init(); | |
106 vga_disabledriverreport(); | |
485 | 107 max = vga_lastmodenumber(); |
108 for (i = 1; i < max; i++) | |
483 | 109 if (vga_hasmode(i) > 0) { |
110 minfo = vga_getmodeinfo(i); | |
111 switch (minfo->colors) { | |
112 case 32768: bpp_avail |= BPP_15; break; | |
113 case 65536: bpp_avail |= BPP_16; break; | |
114 } | |
115 switch (minfo->bytesperpixel) { | |
116 case 3: bpp_avail |= BPP_24; break; | |
117 case 4: bpp_avail |= BPP_32; break; | |
118 } | |
504 | 119 if (verbose >= 2) |
120 printf("vo_svga: Mode found: %s\n",vga_getmodename(i)); | |
483 | 121 if (add_mode(i, *minfo)) |
122 return(1); | |
123 } | |
485 | 124 return(0); |
285 | 125 } |
126 | |
127 static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width, | |
128 uint32_t d_height, uint32_t fullscreen, char *title, | |
129 uint32_t format) { | |
483 | 130 uint32_t req_w = (d_width > 0 ? d_width : width); |
131 uint32_t req_h = (d_height > 0 ? d_height : height); | |
132 uint16_t vid_mode = 0; | |
976 | 133 uint8_t res_widescr, vid_widescr = (((req_w*1.0)/req_h) > (4.0/3)) ? 1 : 0; |
485 | 134 uint16_t buf_w = USHRT_MAX, buf_h = USHRT_MAX; |
483 | 135 vga_modelist_t *list = modelist; |
387 | 136 |
285 | 137 if (!checked) { |
485 | 138 if (checksupportedmodes()) // Looking for available video modes |
483 | 139 return(1); |
285 | 140 } |
407 | 141 |
483 | 142 bpp_avail = 0; |
143 while (list != NULL) { | |
144 if ((list->modeinfo.width >= req_w) && (list->modeinfo.height >= req_h)) { | |
145 switch (list->modeinfo.colors) { | |
146 case 32768: bpp_avail |= BPP_15; break; | |
147 case 65536: bpp_avail |= BPP_16; break; | |
148 } | |
149 switch (list->modeinfo.bytesperpixel) { | |
150 case 3: bpp_avail |= BPP_24; break; | |
151 case 4: bpp_avail |= BPP_32; break; | |
152 } | |
153 } | |
154 list = list->next; | |
155 } | |
156 | |
285 | 157 pformat = format; |
411 | 158 |
483 | 159 // bpp check |
160 bpp_conv = 0; | |
411 | 161 if (!vo_dbpp) { |
162 if (format == IMGFMT_YV12) bpp = 32; | |
163 else bpp = format & 255; | |
504 | 164 if (verbose) |
165 printf("vo_svga: vo_dbpp == 0, bpp: %d\n",bpp); | |
483 | 166 switch (bpp) { |
167 case 32: if (!(bpp_avail & BPP_32)) { | |
168 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
485 | 169 printf("vo_svga: Maybe you should try -bpp\n"); |
483 | 170 return(1); |
171 } | |
172 break; | |
619 | 173 case 24: if (!(bpp_avail & BPP_24)) { |
483 | 174 if (!(bpp_avail & BPP_32)) { |
175 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
485 | 176 printf("vo_svga: Maybe you should try -bpp\n"); |
483 | 177 return(1); |
178 } else { | |
179 bpp = 32; | |
180 bpp_conv = 1; | |
617 | 181 printf("vo_svga: BPP conversion 24->32\n"); |
619 | 182 } |
183 } | |
483 | 184 break; |
185 case 16: if (!(bpp_avail & BPP_16)) { | |
186 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
187 printf("vo_svga: Maybe you should try -bpp\n"); | |
188 return(1); | |
189 } | |
190 break; | |
619 | 191 case 15: if (!(bpp_avail & BPP_15)) { |
483 | 192 if (!(bpp_avail & BPP_16)) { |
193 printf("vo_svga: Haven't found video mode which fit to: %dx%d %dbpp\n",req_w,req_h,bpp); | |
194 printf("vo_svga: Maybe you should try -bpp\n"); | |
195 return(1); | |
196 } else { | |
197 bpp = 16; | |
198 bpp_conv = 1; | |
617 | 199 printf("vo_svga: BPP conversion 15->16\n"); |
483 | 200 } |
619 | 201 } |
483 | 202 break; |
203 } | |
411 | 204 } else { |
205 bpp = vo_dbpp; | |
504 | 206 if (verbose) |
207 printf("vo_svga: vo_dbpp == %d\n",bpp); | |
411 | 208 switch (bpp) { |
483 | 209 case 32: if (!(bpp_avail & BPP_32)) { |
485 | 210 printf("vo_svga: %dbpp not supported in %dx%d (or larger resoltuion) by HW or SVGAlib\n",bpp,req_w,req_h); |
411 | 211 return(1); |
212 } | |
485 | 213 break; |
483 | 214 case 24: if (!(bpp_avail & BPP_24)) { |
485 | 215 printf("vo_svga: %dbpp not supported in %dx%d (or larger resoltuion) by HW or SVGAlib\n",bpp,req_w,req_h); |
411 | 216 return(1); |
217 } | |
485 | 218 break; |
483 | 219 case 16: if (!(bpp_avail & BPP_16)) { |
485 | 220 printf("vo_svga: %dbpp not supported in %dx%d (or larger resoltuion) by HW or SVGAlib\n",bpp,req_w,req_h); |
411 | 221 return(1); |
222 } | |
485 | 223 break; |
483 | 224 case 15: if (!(bpp_avail & BPP_15)) { |
485 | 225 printf("vo_svga: %dbpp not supported in %dx%d (or larger resoltuion) by HW or SVGAlib\n",bpp,req_w,req_h); |
411 | 226 return(1); |
227 } | |
485 | 228 break; |
411 | 229 } |
230 } | |
483 | 231 |
232 list = modelist; | |
504 | 233 if (verbose) { |
234 printf("vo_svga: Looking for the best resolution...\n"); | |
235 printf("vo_svga: req_w: %d, req_h: %d, bpp: %d\n",req_w,req_h,bpp); | |
236 } | |
485 | 237 while (list != NULL) { |
483 | 238 if ((list->modeinfo.width >= req_w) && (list->modeinfo.height >= req_h)) { |
504 | 239 if (verbose) { |
240 switch (list->modeinfo.colors) { | |
241 case 32768: printf("vo_svga: vid_mode: %d, %dx%d 15bpp\n",list->modenum,list->modeinfo.width,list->modeinfo.height); | |
242 break; | |
243 case 65536: printf("vo_svga: vid_mode: %d, %dx%d 16bpp\n",list->modenum,list->modeinfo.width,list->modeinfo.height); | |
244 break; | |
245 } | |
246 switch (list->modeinfo.bytesperpixel) { | |
247 case 3: printf("vo_svga: vid_mode: %d, %dx%d 24bpp\n",list->modenum,list->modeinfo.width,list->modeinfo.height); | |
248 break; | |
249 case 4: printf("vo_svga: vid_mode: %d, %dx%d 32bpp\n",list->modenum,list->modeinfo.width,list->modeinfo.height); | |
250 break; | |
251 } | |
252 } | |
285 | 253 switch (bpp) { |
483 | 254 case 32: if (list->modeinfo.bytesperpixel == 4) |
485 | 255 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { |
256 vid_mode = list->modenum; | |
257 buf_w = list->modeinfo.width; | |
258 buf_h = list->modeinfo.height; | |
976 | 259 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0; |
485 | 260 } |
261 break; | |
483 | 262 case 24: if (list->modeinfo.bytesperpixel == 3) |
485 | 263 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { |
264 vid_mode = list->modenum; | |
265 buf_w = list->modeinfo.width; | |
266 buf_h = list->modeinfo.height; | |
976 | 267 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0; |
485 | 268 } |
269 break; | |
483 | 270 case 16: if (list->modeinfo.colors == 65536) |
485 | 271 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { |
272 vid_mode = list->modenum; | |
273 buf_w = list->modeinfo.width; | |
274 buf_h = list->modeinfo.height; | |
976 | 275 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0; |
485 | 276 } |
277 break; | |
483 | 278 case 15: if (list->modeinfo.colors == 32768) |
485 | 279 if ((list->modeinfo.width < buf_w) || (list->modeinfo.height < buf_h)) { |
280 vid_mode = list->modenum; | |
281 buf_w = list->modeinfo.width; | |
282 buf_h = list->modeinfo.height; | |
976 | 283 res_widescr = (((buf_w*1.0)/buf_h) > (4.0/3)) ? 1 : 0; |
485 | 284 } |
285 break; | |
285 | 286 } |
483 | 287 } |
288 list = list->next; | |
407 | 289 } |
485 | 290 |
504 | 291 if (verbose) |
292 printf("vo_svga: vid_mode: %d\n",vid_mode); | |
407 | 293 vga_setlinearaddressing(); |
485 | 294 if (vga_setmode(vid_mode) == -1) { |
286 | 295 printf("vo_svga: vga_setmode(%d) failed.\n",vid_mode); |
483 | 296 uninit(); |
285 | 297 return(1); // error |
485 | 298 } |
299 if (gl_setcontextvga(vid_mode)) { | |
286 | 300 printf("vo_svga: gl_setcontextvga(%d) failed.\n",vid_mode); |
483 | 301 uninit(); |
285 | 302 return(1); // error |
286 | 303 } |
285 | 304 screen = gl_allocatecontext(); |
305 gl_getcontext(screen); | |
485 | 306 if (gl_setcontextvgavirtual(vid_mode)) { |
286 | 307 printf("vo_svga: gl_setcontextvgavirtual(%d) failed.\n",vid_mode); |
483 | 308 uninit(); |
285 | 309 return(1); // error |
286 | 310 } |
285 | 311 virt = gl_allocatecontext(); |
312 gl_getcontext(virt); | |
313 gl_setcontext(virt); | |
314 gl_clearscreen(0); | |
315 | |
485 | 316 if (bpp_conv) { |
483 | 317 bppbuf = malloc(maxw * maxh * BYTESPERPIXEL); |
485 | 318 if (bppbuf == NULL) { |
319 printf("vo_svga: bppbuf -> Not enough memory for buffering!\n"); | |
320 uninit(); | |
321 return (1); | |
322 } | |
483 | 323 } |
324 | |
285 | 325 orig_w = width; |
326 orig_h = height; | |
976 | 327 if ((fullscreen & 0x04) && (WIDTH != orig_w) && (HEIGHT != orig_h)) { |
328 if (!vid_widescr || !res_widescr) { | |
292 | 329 maxh = HEIGHT; |
330 scaling = maxh / (orig_h * 1.0); | |
331 maxw = (uint32_t) (orig_w * scaling); | |
332 scalebuf = malloc(maxw * maxh * BYTESPERPIXEL); | |
483 | 333 if (scalebuf == NULL) { |
485 | 334 printf("vo_svga: scalebuf -> Not enough memory for buffering!\n"); |
407 | 335 uninit(); |
336 return (1); | |
337 } | |
292 | 338 } else { |
339 maxw = WIDTH; | |
340 scaling = maxw / (orig_w * 1.0); | |
341 maxh = (uint32_t) (orig_h * scaling); | |
342 scalebuf = malloc(maxw * maxh * BYTESPERPIXEL); | |
483 | 343 if (scalebuf == NULL) { |
485 | 344 printf("vo_svga: scalebuf -> Not enough memory for buffering!\n"); |
407 | 345 uninit(); |
346 return (1); | |
347 } | |
292 | 348 } |
285 | 349 } else { |
350 maxw = orig_w; | |
351 maxh = orig_h; | |
352 } | |
353 x_pos = (WIDTH - maxw) / 2; | |
354 y_pos = (HEIGHT - maxh) / 2; | |
355 | |
356 if (pformat == IMGFMT_YV12) { | |
357 yuv2rgb_init(bpp, MODE_RGB); | |
358 yuvbuf = malloc(maxw * maxh * BYTESPERPIXEL); | |
483 | 359 if (yuvbuf == NULL) { |
485 | 360 printf("vo_svga: yuvbuf -> Not enough memory for buffering!\n"); |
407 | 361 uninit(); |
362 return (1); | |
363 } | |
285 | 364 } |
377 | 365 |
504 | 366 printf("vo_svga: SVGAlib resolution: %dx%d %dbpp - ", WIDTH, HEIGHT, bpp); |
293 | 367 if (maxw != orig_w || maxh != orig_h) printf("Video scaled to: %dx%d\n",maxw,maxh); |
285 | 368 else printf("No video scaling\n"); |
369 | |
370 return (0); | |
371 } | |
372 | |
373 static uint32_t query_format(uint32_t format) { | |
485 | 374 uint32_t res = 0; |
407 | 375 |
483 | 376 if (!checked) { |
377 if (checksupportedmodes()) // Looking for available video modes | |
378 return(0); | |
379 } | |
485 | 380 |
381 // if (vo_dbpp) => There is NO conversion!!! | |
382 if (vo_dbpp) { | |
712 | 383 if (format == IMGFMT_YV12) return (1); |
485 | 384 switch (vo_dbpp) { |
488 | 385 case 32: if ((format == IMGFMT_RGB32) || (format == IMGFMT_BGR32)) |
485 | 386 return ((bpp_avail & BPP_32) ? 1 : 0); |
387 break; | |
488 | 388 case 24: if ((format == IMGFMT_RGB24) || (format == IMGFMT_BGR24)) |
485 | 389 return ((bpp_avail & BPP_24) ? 1 : 0); |
390 break; | |
488 | 391 case 16: if ((format == IMGFMT_RGB16) || (format == IMGFMT_BGR16)) |
485 | 392 return ((bpp_avail & BPP_16) ? 1 : 0); |
393 break; | |
488 | 394 case 15: if ((format == IMGFMT_RGB15) || (format == IMGFMT_BGR15)) |
485 | 395 return ((bpp_avail & BPP_15) ? 1 : 0); |
396 break; | |
407 | 397 } |
488 | 398 } else { |
485 | 399 switch (format) { |
400 case IMGFMT_RGB32: | |
488 | 401 case IMGFMT_BGR32: return ((bpp_avail & BPP_32) ? 1 : 0); break; |
485 | 402 case IMGFMT_RGB24: |
488 | 403 case IMGFMT_BGR24: { |
485 | 404 res = (bpp_avail & BPP_24) ? 1 : 0; |
405 if (!res) | |
406 res = (bpp_avail & BPP_32) ? 1 : 0; | |
407 return (res); | |
408 } break; | |
409 case IMGFMT_RGB16: | |
488 | 410 case IMGFMT_BGR16: return ((bpp_avail & BPP_16) ? 1 : 0); break; |
485 | 411 case IMGFMT_RGB15: |
488 | 412 case IMGFMT_BGR15: { |
485 | 413 res = (bpp_avail & BPP_15) ? 1 : 0; |
414 if (!res) | |
415 res = (bpp_avail & BPP_16) ? 1 : 0; | |
416 return (res); | |
417 } break; | |
418 case IMGFMT_YV12: return (1); break; | |
285 | 419 } |
488 | 420 } |
285 | 421 return (0); |
422 } | |
423 | |
424 static const vo_info_t* get_info(void) { | |
425 return (&vo_info); | |
426 } | |
427 | |
428 static void draw_alpha(int x0, int y0, int w, int h, unsigned char *src, | |
429 unsigned char *srca, int stride) { | |
327 | 430 switch (bpp) { |
431 case 32: | |
432 vo_draw_alpha_rgb32(w, h, src, srca, stride, virt->vbuf+4*(y0*WIDTH+x0), 4*WIDTH); | |
433 break; | |
434 case 24: | |
435 vo_draw_alpha_rgb24(w, h, src, srca, stride, virt->vbuf+3*(y0*WIDTH+x0), 3*WIDTH); | |
436 break; | |
437 case 16: | |
438 vo_draw_alpha_rgb16(w, h, src, srca, stride, virt->vbuf+2*(y0*WIDTH+x0), 2*WIDTH); | |
439 break; | |
440 case 15: | |
441 vo_draw_alpha_rgb15(w, h, src, srca, stride, virt->vbuf+2*(y0*WIDTH+x0), 2*WIDTH); | |
442 break; | |
443 } | |
285 | 444 } |
445 | |
446 static uint32_t draw_frame(uint8_t *src[]) { | |
447 if (pformat == IMGFMT_YV12) { | |
448 yuv2rgb(yuvbuf, src[0], src[1], src[2], orig_w, orig_h, orig_w * BYTESPERPIXEL, orig_w, orig_w / 2); | |
449 src[0] = yuvbuf; | |
450 } | |
483 | 451 if (scalebuf != NULL) { |
285 | 452 gl_scalebox(orig_w, orig_h, src[0], maxw, maxh, scalebuf); |
453 src[0] = scalebuf; | |
454 } | |
407 | 455 if (bpp_conv) { |
456 switch(bpp) { | |
485 | 457 case 32: { |
620 | 458 uint8_t *source = src[0]; |
459 uint8_t *dest = bppbuf; | |
460 register uint32_t i = 0; | |
502 | 461 |
620 | 462 while (i < (maxw * maxh * 4)) { |
463 dest[i] = source[i]; | |
464 dest[i+1] = source[i+1]; | |
465 dest[i+2] = source[i+2]; | |
466 dest[i+3] = 0; | |
467 i += 4; | |
407 | 468 } |
485 | 469 } break; |
470 case 16: { | |
407 | 471 #ifdef HAVE_MMX |
472 rgb15to16_mmx(src[0],bppbuf,maxw * maxh * 2); | |
473 #else | |
502 | 474 uint16_t *source = (uint16_t *) src[0]; |
475 uint16_t *dest = (uint16_t *) bppbuf; | |
620 | 476 register uint32_t i = 0; |
407 | 477 register uint16_t srcdata; |
478 | |
620 | 479 while (i < (maxw * maxh)) { |
480 srcdata = source[i]; | |
481 dest[i++] = (srcdata & 0x1f) | ((srcdata & 0x7fe0) << 1); | |
407 | 482 } |
483 #endif | |
485 | 484 } break; |
407 | 485 } |
486 src[0] = bppbuf; | |
487 } | |
285 | 488 gl_putbox(x_pos, y_pos, maxw, maxh, src[0]); |
617 | 489 |
490 return (0); | |
285 | 491 } |
492 | |
493 static uint32_t draw_slice(uint8_t *image[], int stride[], | |
494 int w, int h, int x, int y) { | |
495 uint8_t *src = yuvbuf; | |
377 | 496 uint32_t sw, sh; |
497 | |
875 | 498 yuv2rgb(yuvbuf, image[0], image[1], image[2], w, h, orig_w * BYTESPERPIXEL, stride[0], stride[1]); |
377 | 499 sw = (uint32_t) (w * scaling); |
500 sh = (uint32_t) (h * scaling); | |
483 | 501 if (scalebuf != NULL) { |
377 | 502 gl_scalebox(w, h, yuvbuf, sw, sh, scalebuf); |
285 | 503 src = scalebuf; |
504 } | |
377 | 505 gl_putbox((int)(x * scaling) + x_pos, (int)(y * scaling) + y_pos, sw, sh, src); |
617 | 506 |
507 return (0); | |
285 | 508 } |
509 | |
510 static void flip_page(void) { | |
292 | 511 if (y_pos) { |
512 gl_fillbox(0, 0, WIDTH, y_pos, 0); | |
513 gl_fillbox(0, HEIGHT - y_pos, WIDTH, y_pos, 0); | |
989 | 514 } |
515 if (x_pos) { | |
516 gl_fillbox(0, 0, x_pos, HEIGHT, 0); | |
517 gl_fillbox(WIDTH - x_pos, 0, x_pos, HEIGHT, 0); | |
518 } | |
519 | |
486 | 520 vo_draw_text(WIDTH, HEIGHT, draw_alpha); |
285 | 521 gl_copyscreen(screen); |
522 } | |
523 | |
524 static void check_events(void) { | |
525 } | |
526 | |
527 static void uninit(void) { | |
483 | 528 vga_modelist_t *list = modelist; |
529 | |
285 | 530 gl_freecontext(screen); |
531 gl_freecontext(virt); | |
532 vga_setmode(TEXT); | |
483 | 533 if (bppbuf != NULL) |
407 | 534 free(bppbuf); |
483 | 535 if (scalebuf != NULL) |
285 | 536 free(scalebuf); |
483 | 537 if (yuvbuf != NULL) |
285 | 538 free(yuvbuf); |
483 | 539 if (modelist != NULL) { |
540 while (modelist->next != NULL) { | |
541 list = modelist; | |
542 while (list->next != NULL) | |
543 list = list->next; | |
544 free(list); | |
545 } | |
546 free(modelist); | |
547 } | |
285 | 548 } |
617 | 549 |