comparison libvo/vo_gl2.c @ 10604:a70a6c12bce5

1000l
author alex
date Thu, 14 Aug 2003 01:15:41 +0000
parents fd3cbeb388f0
children 3aea64e0d6d9
comparison
equal deleted inserted replaced
10603:9f04be042081 10604:a70a6c12bce5
105 if(*px>1.0) *px=1.0; 105 if(*px>1.0) *px=1.0;
106 *py=(float)y*texpercy; 106 *py=(float)y*texpercy;
107 if(*py>1.0) *py=1.0; 107 if(*py>1.0) *py=1.0;
108 } 108 }
109 109
110 static void initTextures() 110 static int initTextures()
111 { 111 {
112 unsigned char *line_1=0, *line_2=0, *mem_start=0; 112 unsigned char *line_1=0, *line_2=0, *mem_start=0;
113 struct TexSquare *tsq=0; 113 struct TexSquare *tsq=0;
114 int e_x, e_y, s, i=0; 114 int e_x, e_y, s, i=0;
115 int x=0, y=0; 115 int x=0, y=0;
162 fprintf (stderr, "[%dx%d] !\n", texture_height, texture_width); 162 fprintf (stderr, "[%dx%d] !\n", texture_height, texture_width);
163 163
164 if(texture_width < 64 || texture_height < 64) 164 if(texture_width < 64 || texture_height < 64)
165 { 165 {
166 fprintf (stderr, "GLERROR: Give up .. usable texture size not avaiable, or texture config error !\n"); 166 fprintf (stderr, "GLERROR: Give up .. usable texture size not avaiable, or texture config error !\n");
167 exit(1); 167 return -1;
168 } 168 }
169 } 169 }
170 } 170 }
171 while (format != gl_internal_format && texture_width > 1 && texture_height > 1); 171 while (format != gl_internal_format && texture_width > 1 && texture_height > 1);
172 172
279 279
280 glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); 280 glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
281 281
282 } /* for all texnumx */ 282 } /* for all texnumx */
283 } /* for all texnumy */ 283 } /* for all texnumy */
284
285 return 0;
284 } 286 }
285 287
286 static void resetTexturePointers(unsigned char *imageSource) 288 static void resetTexturePointers(unsigned char *imageSource)
287 { 289 {
288 unsigned char *line_1=0, *line_2=0, *mem_start=0; 290 unsigned char *line_1=0, *line_2=0, *mem_start=0;
892 894
893 ImageData=ImageDataLocal; 895 ImageData=ImageDataLocal;
894 896
895 texture_width=image_width; 897 texture_width=image_width;
896 texture_height=image_height; 898 texture_height=image_height;
897 initTextures(); 899 if (initTextures() < 0)
900 return -1;
898 901
899 glDisable(GL_BLEND); 902 glDisable(GL_BLEND);
900 glDisable(GL_DEPTH_TEST); 903 glDisable(GL_DEPTH_TEST);
901 glDepthMask(GL_FALSE); 904 glDepthMask(GL_FALSE);
902 glDisable(GL_CULL_FACE); 905 glDisable(GL_CULL_FACE);