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