summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Bosveld <joel@JOEL-UBUNTU.(none)>2007-11-08 19:59:45 +0900
committerJoel Bosveld <joel@JOEL-UBUNTU.(none)>2007-11-08 19:59:45 +0900
commitc5f60bbbdf4786d642b809cd8637d407796add94 (patch)
treee9e5413a15163788a2d9ca03d17020593658c3bd
parent700f2b90ea5778f463c56b34e452b1223613ccb4 (diff)
downloadphotowheel-0.6.tar.gz
photowheel-0.6.tar.bz2
Should now be the same as git-master version (feature wise)0.6
-rw-r--r--photo.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/photo.c b/photo.c
index bba565e..82ae30a 100644
--- a/photo.c
+++ b/photo.c
@@ -45,22 +45,6 @@ Joel Bosveld (Joel.Bosveld@gmail.com)
#define PI 3.14159
-static const CompTransform identity =
-{
- {
- 1.0, 0.0, 0.0, 0.0,
- 0.0, 1.0, 0.0, 0.0,
- 0.0, 0.0, 1.0, 0.0,
- 0.0, 0.0, 0.0, 1.0
- }
-};
-
-#define MULTMV(m, v) { \
- float v0 = m[0]*v[0] + m[4]*v[1] + m[8]*v[2] + m[12]*v[3]; \
- float v1 = m[1]*v[0] + m[5]*v[1] + m[9]*v[2] + m[13]*v[3]; \
- float v2 = m[2]*v[0] + m[6]*v[1] + m[10]*v[2] + m[14]*v[3]; \
- float v3 = m[3]*v[0] + m[7]*v[1] + m[11]*v[2] + m[15]*v[3]; \
- v[0] = v0; v[1] = v1; v[2] = v2; v[3] = v3; }
static int displayPrivateIndex;
@@ -180,7 +164,7 @@ photoCapChange (CompScreen *s,
glNewList (gs->dList, GL_COMPILE);
glBegin(GL_POLYGON);
- glColor4us(top[0],top[1],bot[2],bot[3]);
+ glColor4us(top[0],top[1],top[2],top[3]);
for(i=gs->n-1;i>-1;i--)
{
@@ -236,11 +220,18 @@ photoTextureChange (CompScreen *s,
for(i=0;i<(gs->n);i++)
{
- readImageToTexture (s, &(gs->photoTexture[i]).tex, /*texture pointer*/
+ 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*/
-
+ &(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);
@@ -320,7 +311,7 @@ photoPaintInside (CompScreen *s,
glPushAttrib (GL_COLOR_BUFFER_BIT | GL_TEXTURE_BIT);
glEnable (GL_BLEND);
-
+ glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
enabled = glIsEnabled (GL_CULL_FACE);