jpg images crashes loading twice December 05, 2011 09:34AM | Registered: 13 years ago Posts: 87 |
void leeimagen(int i){ if (tex_foto!=NULL) GRRLIB_FreeTexture(tex_foto); nombre[0]=0; strcat(nombre,DirActivo); strcat(nombre,lista); tex_foto = GRRLIB_LoadTextureFromFile(nombre); GRRLIB_SetMidHandle(tex_foto,true); }and the code in main to show the image is:
if (tipos[archivo_actual]==TIPO_IMAGEN){ if(!leido) { angulo = 0; cursoractivo = 1; leeimagen(archivo_actual); leido = true; } if (tex_foto != NULL){ GRRLIB_SetMidHandle(tex_foto, true); if ((angulo % 180) == 0){ sfx = 480.0/tex_foto->w; sfy = 365.0/tex_foto->h; } else { sfy = 480.0/tex_foto->h; sfx = 365.0/tex_foto->w; } } if (tex_foto != NULL) GRRLIB_DrawImg(320-stx,(210-sty)*sy,tex_foto,angulo,sfx*zoom,sy*sfy*zoom,GRRLIB_WHITE); else GRRLIB_DrawImg(320,210*sy,tex_error,0,1,sy*1.0,GRRLIB_WHITE); }
Re: jpg images crashes loading twice December 06, 2011 08:41PM | Registered: 13 years ago Posts: 99 |
Re: jpg images crashes loading twice December 06, 2011 11:14PM | Registered: 13 years ago Posts: 87 |
Re: jpg images crashes loading twice December 07, 2011 10:14PM | Registered: 13 years ago Posts: 99 |
Re: jpg images crashes loading twice December 08, 2011 12:37AM | Registered: 13 years ago Posts: 87 |