summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Bosveld <joel@JOEL-UBUNTU.(none)>2007-11-06 16:34:32 +0900
committerJoel Bosveld <joel@JOEL-UBUNTU.(none)>2007-11-06 16:34:32 +0900
commit153d371120e3b9db319459b8e541c53a21455065 (patch)
tree7841574a205dc603e3be81d752aeea4019f189d5
parent32b96b008694eed7710c4306b99160504b28837e (diff)
downloadphotowheel-153d371120e3b9db319459b8e541c53a21455065.tar.gz
photowheel-153d371120e3b9db319459b8e541c53a21455065.tar.bz2
Caps now update when number of textures is changed
-rw-r--r--photo.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/photo.c b/photo.c
index 469be26..1d41f1b 100644
--- a/photo.c
+++ b/photo.c
@@ -203,16 +203,24 @@ photoTextureChange (CompScreen *s,
gs->photoTexFiles = photoGetPhotoTextures (s);
- gs->n=gs->photoTexFiles->nValue; /*these two lines are the problem */
+ gs->n=gs->photoTexFiles->nValue;
gs->photoTexture=malloc(sizeof (PhotoTexture) * gs-> n);
for(i=0;i<(gs->n);i++)
{
- readImageToTexture (s, &(gs->photoTexture[i]).tex, /*texture pointer*/
- gs->photoTexFiles->value[i].s, /*file*/
- &(gs->photoTexture[i]).width, /*pointer for width*/
- &(gs->photoTexture[i]).height); /*pointer for height*/
+ if(!(readImageToTexture (s, &(gs->photoTexture[i]).tex, /*texture pointer*/
+ gs->photoTexFiles->value[i].s, /*file*/
+ &(gs->photoTexture[i]).width, /*pointer for width*/
+ &(gs->photoTexture[i]).height))) /*pointer for height*/
+ {
+ compLogMessage (s->display, "photo", CompLogLevelWarn,
+ "Failed to load image: %s",
+ gs->photoTexFiles->value[i].s);
+
+ finiTexture(s, &(gs->photoTexture[i].tex));
+ initTexture(s, &(gs->photoTexture[i].tex));
+ }
mat = &gs->photoTexture[i].tex.matrix;
gs->photoTexture[i].dList = glGenLists (1);
@@ -243,7 +251,8 @@ photoTextureChange (CompScreen *s,
glEndList ();
}
-
+ photoCapChange (s, NULL, 0);
+
}
static void