summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/cube.c
diff options
context:
space:
mode:
authoronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-22 21:34:47 +0000
committeronestone <onestone@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-22 21:34:47 +0000
commit35abbe1f0032e8a5ee93fd49ebd5d438be5b9b54 (patch)
tree4ce6b962194d61e3a4a732ab200bfae4e1fe6e77 /beryl-plugins/src/cube.c
parent91f0a40dcd3e943505b18eb8f30f5c3a87027de5 (diff)
downloadmarex-dev-35abbe1f0032e8a5ee93fd49ebd5d438be5b9b54.tar.gz
marex-dev-35abbe1f0032e8a5ee93fd49ebd5d438be5b9b54.tar.bz2
beryl-plugins: cube: fixed cap rotation modes in inside cube mode
git-svn-id: file:///beryl/trunk@3014 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/cube.c')
-rw-r--r--beryl-plugins/src/cube.c45
1 files changed, 15 insertions, 30 deletions
diff --git a/beryl-plugins/src/cube.c b/beryl-plugins/src/cube.c
index 726adb2..3a2949b 100644
--- a/beryl-plugins/src/cube.c
+++ b/beryl-plugins/src/cube.c
@@ -1948,8 +1948,6 @@ cubePaintTransformedScreen(CompScreen * s,
sa.xTranslate = sAttrib->xTranslate;
sa.yTranslate = sAttrib->yTranslate;
- float oldRotate = sa.xRotate;
-
if (cs->grabIndex)
{
sa.vRotate = 0.0f;
@@ -2027,6 +2025,9 @@ cubePaintTransformedScreen(CompScreen * s,
}
}
+ ScreenPaintAttrib soa = sa;
+ int rotations = cs->xrotations;
+
CubeFacePaint *faces = malloc(sizeof(CubeFacePaint) * MAX(hsize, 3));
int fc = 0;
@@ -2211,14 +2212,14 @@ cubePaintTransformedScreen(CompScreen * s,
if (sAttrib->xRotate > 0.0f)
{
sa.yRotate += 360.0f / size;
- (s->applyScreenTransform) (s, &sa, output);
+ (s->applyScreenTransform) (s, &soa, output);
glTranslatef(cs->outputXOffset, -cs->outputYOffset, 0.0f);
glScalef(cs->outputXScale, cs->outputYScale, 1.0f);
sa.yRotate -= 360.0f / size;
}
else
{
- (s->applyScreenTransform) (s, &sa, output);
+ (s->applyScreenTransform) (s, &soa, output);
glTranslatef(cs->outputXOffset, -cs->outputYOffset, 0.0f);
glScalef(cs->outputXScale, cs->outputYScale, 1.0f);
}
@@ -2230,37 +2231,16 @@ cubePaintTransformedScreen(CompScreen * s,
if (hsize == 4)
{
- // change to stop the old, buggy rotation
- int alpha = ((int)(4 * oldRotate) / 360);
-
- if (cs->invert != 1)
- {
- if (oldRotate == 0.0f)
- alpha = -alpha;
- else if (oldRotate > 0.0f)
- alpha = -alpha - 1;
- else
- alpha = -alpha + 1;
- }
- glRotatef(90.0f * alpha, 0.0f, 1.0f, 0.0f);
+ glRotatef(90.0f, 0.0f, 1.0f, 0.0f);
- // change to enable correct rotation behaviour
if (cs->rotateImages)
{
- int alpha2;
-
- if (oldRotate > 0.0f)
- alpha2 = ((int)(4 * (oldRotate + 45.0f)) / 360);
- else
- alpha2 = ((int)(4 * (oldRotate - 45.0f)) / 360);
- if (cs->invert == 1)
- glRotatef(-90.0f * alpha2, 0.0f, 1.0f, 0.0f);
- else
- glRotatef(90.0f * alpha2, 0.0f, 1.0f, 0.0f);
+ if (soa.xRotate > 45)
+ glRotatef(-90.0f, 0.0f, 1.0f, 0.0f);
}
-
- if (cs->neverRotateImages)
+ else if (cs->neverRotateImages)
{
+ glRotatef(rotations * 90.0f, 0.0f, 1.0f, 0.0f);
float previousRotation = IPCS_GetFloat(IPCS_OBJECT(s),
cs->
previousRotationAtom);
@@ -2268,6 +2248,11 @@ cubePaintTransformedScreen(CompScreen * s,
previousRotation = -previousRotation;
glRotatef(previousRotation * 90.0f, 0.0f, 1.0f, 0.0f);
}
+ else
+ {
+ glRotatef(rotations * 90.0f, 0.0f, 1.0f, 0.0f);
+ }
+
}
if (glIsEnabled(GL_CULL_FACE)