Mercurial > mplayer.hg
comparison libvo/vo_gl.c @ 19937:34796c9b8667
Cosmetics: move curtex++ out of for () into code body, needed for coming patch
author | reimar |
---|---|
date | Fri, 22 Sep 2006 20:19:51 +0000 |
parents | f810e12fce63 |
children | f862045246a9 |
comparison
equal
deleted
inserted
replaced
19936:f810e12fce63 | 19937:34796c9b8667 |
---|---|
255 return; | 255 return; |
256 for (i = img; i; i = i->next) | 256 for (i = img; i; i = i->next) |
257 eosdtexCnt++; | 257 eosdtexCnt++; |
258 eosdtex = calloc(eosdtexCnt, sizeof(GLuint)); | 258 eosdtex = calloc(eosdtexCnt, sizeof(GLuint)); |
259 glGenTextures(eosdtexCnt, eosdtex); | 259 glGenTextures(eosdtexCnt, eosdtex); |
260 for (i = img, curtex = eosdtex; i; i = i->next, curtex++) { | 260 for (i = img, curtex = eosdtex; i; i = i->next) { |
261 if (i->w <= 0 || i->h <= 0 || i->stride < i->w) { | 261 if (i->w <= 0 || i->h <= 0 || i->stride < i->w) { |
262 mp_msg(MSGT_VO, MSGL_V, "Invalid dimensions OSD for part!\n"); | 262 mp_msg(MSGT_VO, MSGL_V, "Invalid dimensions OSD for part!\n"); |
263 continue; | 263 continue; |
264 } | 264 } |
265 texSize(i->w, i->h, &sx, &sy); | 265 texSize(i->w, i->h, &sx, &sy); |
266 BindTexture(gl_target, *curtex); | 266 BindTexture(gl_target, *curtex++); |
267 glCreateClearTex(gl_target, GL_ALPHA, scale_type, sx, sy, 0); | 267 glCreateClearTex(gl_target, GL_ALPHA, scale_type, sx, sy, 0); |
268 glUploadTex(gl_target, GL_ALPHA, GL_UNSIGNED_BYTE, i->bitmap, i->stride, | 268 glUploadTex(gl_target, GL_ALPHA, GL_UNSIGNED_BYTE, i->bitmap, i->stride, |
269 0, 0, i->w, i->h, 0); | 269 0, 0, i->w, i->h, 0); |
270 } | 270 } |
271 eosdDispList = glGenLists(1); | 271 eosdDispList = glGenLists(1); |
272 glNewList(eosdDispList, GL_COMPILE); | 272 glNewList(eosdDispList, GL_COMPILE); |
273 for (i = img, curtex = eosdtex; i; i = i->next, curtex++) { | 273 for (i = img, curtex = eosdtex; i; i = i->next) { |
274 if (i->w <= 0 || i->h <= 0 || i->stride < i->w) | 274 if (i->w <= 0 || i->h <= 0 || i->stride < i->w) |
275 continue; | 275 continue; |
276 glColor4ub(i->color >> 24, (i->color >> 16) & 0xff, (i->color >> 8) & 0xff, 255 - (i->color & 0xff)); | 276 glColor4ub(i->color >> 24, (i->color >> 16) & 0xff, (i->color >> 8) & 0xff, 255 - (i->color & 0xff)); |
277 texSize(i->w, i->h, &sx, &sy); | 277 texSize(i->w, i->h, &sx, &sy); |
278 BindTexture(gl_target, *curtex); | 278 BindTexture(gl_target, *curtex++); |
279 glDrawTex(i->dst_x, i->dst_y, i->w, i->h, 0, 0, i->w, i->h, sx, sy, use_rectangle == 1, 0, 0); | 279 glDrawTex(i->dst_x, i->dst_y, i->w, i->h, 0, 0, i->w, i->h, sx, sy, use_rectangle == 1, 0, 0); |
280 } | 280 } |
281 glEndList(); | 281 glEndList(); |
282 BindTexture(gl_target, 0); | 282 BindTexture(gl_target, 0); |
283 } | 283 } |