summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authorreimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2010-08-01 17:37:38 +0000
committerUoti Urpala <uau@glyph.nonexistent.invalid>2010-11-02 04:15:01 +0200
commit91565a3d77438e21a0e54db2250cf505ca4cd5c9 (patch)
tree306da3512a3b0e233b57e4c67a13b00913ce9342 /libvo
parent0edb9e62d00e97f445a27b1715f06cfe1a81fcb3 (diff)
downloadmpv-91565a3d77438e21a0e54db2250cf505ca4cd5c9.tar.bz2
mpv-91565a3d77438e21a0e54db2250cf505ca4cd5c9.tar.xz
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
Diffstat (limited to 'libvo')
-rw-r--r--libvo/vo_gl.c52
1 files changed, 26 insertions, 26 deletions
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)