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