From 91565a3d77438e21a0e54db2250cf505ca4cd5c9 Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 1 Aug 2010 17:37:38 +0000 Subject: vo_gl.c: Use early return instead of large if block git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31887 b3059339-0415-0410-9bf9-f77b7e298cf2 Reindent. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@31888 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/vo_gl.c | 52 ++++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'libvo/vo_gl.c') diff --git a/libvo/vo_gl.c b/libvo/vo_gl.c index f2c77b2456..2af082da71 100644 --- a/libvo/vo_gl.c +++ b/libvo/vo_gl.c @@ -778,35 +778,35 @@ static void create_osd_texture(int x0, int y0, int w, int h, static void do_render_osd(int type) { int draw_osd = (type & RENDER_OSD) && osdtexCnt > 0; int draw_eosd = (type & RENDER_EOSD) && eosdDispList; - if (draw_osd || draw_eosd) { - // set special rendering parameters - if (!scaled_osd) { - mpglMatrixMode(GL_PROJECTION); - mpglPushMatrix(); - mpglLoadIdentity(); - mpglOrtho(0, vo_dwidth, vo_dheight, 0, -1, 1); - } - mpglEnable(GL_BLEND); - if (draw_eosd) { - mpglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - mpglCallList(eosdDispList); - } - if (draw_osd) { - mpglColor4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff - (osd_color >> 24)); - // draw OSD + if (!draw_osd && !draw_eosd) + return; + // set special rendering parameters + if (!scaled_osd) { + mpglMatrixMode(GL_PROJECTION); + mpglPushMatrix(); + mpglLoadIdentity(); + mpglOrtho(0, vo_dwidth, vo_dheight, 0, -1, 1); + } + mpglEnable(GL_BLEND); + if (draw_eosd) { + mpglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + mpglCallList(eosdDispList); + } + if (draw_osd) { + mpglColor4ub((osd_color >> 16) & 0xff, (osd_color >> 8) & 0xff, osd_color & 0xff, 0xff - (osd_color >> 24)); + // draw OSD #ifndef FAST_OSD - mpglBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA); - mpglCallLists(osdtexCnt, GL_UNSIGNED_INT, osdaDispList); + mpglBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_ALPHA); + mpglCallLists(osdtexCnt, GL_UNSIGNED_INT, osdaDispList); #endif - mpglBlendFunc(GL_SRC_ALPHA, GL_ONE); - mpglCallLists(osdtexCnt, GL_UNSIGNED_INT, osdDispList); - } - // set rendering parameters back to defaults - mpglDisable(GL_BLEND); - if (!scaled_osd) - mpglPopMatrix(); - mpglBindTexture(gl_target, 0); + mpglBlendFunc(GL_SRC_ALPHA, GL_ONE); + mpglCallLists(osdtexCnt, GL_UNSIGNED_INT, osdDispList); } + // set rendering parameters back to defaults + mpglDisable(GL_BLEND); + if (!scaled_osd) + mpglPopMatrix(); + mpglBindTexture(gl_target, 0); } static void draw_osd(void) -- cgit v1.2.3