summaryrefslogtreecommitdiffstats
path: root/libvo/vo_svga.c
diff options
context:
space:
mode:
authorse7encode <se7encode@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-06 10:25:47 +0000
committerse7encode <se7encode@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-04-06 10:25:47 +0000
commit7181a8dc582de190126f8c463d3aefa9e5c0f7f0 (patch)
treec765e6e608ad336550a284f52b4193bcb96ce4f4 /libvo/vo_svga.c
parentd9a5713e26f69230f3dc35a8d9136d2d583f7b7f (diff)
downloadmpv-7181a8dc582de190126f8c463d3aefa9e5c0f7f0.tar.bz2
mpv-7181a8dc582de190126f8c463d3aefa9e5c0f7f0.tar.xz
Some bugfix.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@293 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo/vo_svga.c')
-rw-r--r--libvo/vo_svga.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/libvo/vo_svga.c b/libvo/vo_svga.c
index bb518d86e1..fdf5b8db50 100644
--- a/libvo/vo_svga.c
+++ b/libvo/vo_svga.c
@@ -1,5 +1,5 @@
/*
- Video driver for SVGAlib - alpha version
+ Video driver for SVGAlib - alpha, slow
by Zoltan Mark Vician <se7en@sch.bme.hu>
Code started: Mon Apr 1 23:25:47 2000
*/
@@ -75,12 +75,14 @@ static void checksupportedmodes() {
static uint32_t init(uint32_t width, uint32_t height, uint32_t d_width,
uint32_t d_height, uint32_t fullscreen, char *title,
uint32_t format) {
-static uint8_t bpp;
+ static uint8_t bpp;
+
if (!checked) {
checksupportedmodes(); // Looking for available video modes
}
pformat = format;
- if(format==IMGFMT_YV12) bpp=32; else bpp=format&255;
+ if (format == IMGFMT_YV12) bpp = 32;
+ else bpp = format & 255;
if (d_width > 800)
switch (bpp) {
case 32: vid_mode = 36; break;
@@ -125,10 +127,17 @@ static uint8_t bpp;
orig_w = width;
orig_h = height;
if (fullscreen && (WIDTH != orig_w)) {
- maxw = WIDTH;
- scaling = maxw / (orig_w*1.0);
- maxh = (uint32_t) (orig_h * scaling);
- scalebuf = malloc(maxw * maxh * BYTESPERPIXEL);
+ if (((orig_w*1.0) / orig_h) < (4.0/3)) {
+ maxh = HEIGHT;
+ scaling = maxh / (orig_h * 1.0);
+ maxw = (uint32_t) (orig_w * scaling);
+ scalebuf = malloc(maxw * maxh * BYTESPERPIXEL);
+ } else {
+ maxw = WIDTH;
+ scaling = maxw / (orig_w * 1.0);
+ maxh = (uint32_t) (orig_h * scaling);
+ scalebuf = malloc(maxw * maxh * BYTESPERPIXEL);
+ }
} else {
maxw = orig_w;
maxh = orig_h;
@@ -142,8 +151,8 @@ static uint8_t bpp;
yuvbuf = malloc(maxw * maxh * BYTESPERPIXEL);
}
- printf("SVGAlib resolution: %dx%d %dbpp - ",WIDTH,HEIGHT,bpp);
- if (maxw != orig_w || maxh != orig_h) printf("Video scaled to: %dx%d\n",maxw,maxh);
+ printf("SVGAlib resolution: %dx%d %dbpp - ", WIDTH, HEIGHT, bpp);
+ if (maxw != orig_w || maxh != orig_h) printf("Video scaled to: %dx%d %f.2\n",maxw,maxh,scaling);
else printf("No video scaling\n");
return (0);
@@ -225,8 +234,13 @@ static uint32_t draw_slice(uint8_t *image[], int stride[],
static void flip_page(void) {
- gl_fillbox(0, 0, WIDTH, y_pos, 0);
- gl_fillbox(0, HEIGHT - y_pos, WIDTH, y_pos, 0);
+ if (y_pos) {
+ gl_fillbox(0, 0, WIDTH, y_pos, 0);
+ gl_fillbox(0, HEIGHT - y_pos, WIDTH, y_pos, 0);
+ } else {
+ gl_fillbox(0, 0, x_pos, HEIGHT, 0);
+ gl_fillbox(WIDTH - x_pos, 0, x_pos, HEIGHT, 0);
+ }
vo_draw_text(WIDTH, HEIGHT, draw_alpha);
gl_copyscreen(screen);
}