summaryrefslogtreecommitdiff
path: root/beryl-plugins/src/cube.c
diff options
context:
space:
mode:
authorracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-31 17:32:20 +0000
committerracarr <racarr@d7aaf104-2d23-0410-ae22-9d23157bf5a3>2007-01-31 17:32:20 +0000
commitec58f7a227597b8692f83de0f12725a2298ad2d1 (patch)
treefd16ff00a89d992edf7b4bd6a72a15e637656d61 /beryl-plugins/src/cube.c
parent84d9b2082e69962b08a47ff171e584d90b3ed20f (diff)
downloadmarex-dev-ec58f7a227597b8692f83de0f12725a2298ad2d1.tar.gz
marex-dev-ec58f7a227597b8692f83de0f12725a2298ad2d1.tar.bz2
Cube quad for hsize > 4
git-svn-id: file:///beryl/trunk@3487 d7aaf104-2d23-0410-ae22-9d23157bf5a3
Diffstat (limited to 'beryl-plugins/src/cube.c')
-rw-r--r--beryl-plugins/src/cube.c32
1 files changed, 29 insertions, 3 deletions
diff --git a/beryl-plugins/src/cube.c b/beryl-plugins/src/cube.c
index f54a37e..d9b795b 100644
--- a/beryl-plugins/src/cube.c
+++ b/beryl-plugins/src/cube.c
@@ -1940,18 +1940,19 @@ cubeDrawCubeCap(CompScreen * s, int hsize, int arrayOffset,
CubeCapInfo * capOutside, CubeCapInfo * capInside,
unsigned short opacity)
{
+
CubeCapInfo *cubeCap;
CUBE_SCREEN(s);
- if (hsize == 4 && cs->invert == 1)
+ if ( cs->invert == 1)
cubeCap = capOutside;
- else if (hsize == 4 && cs->invert != 1)
+ else if ( cs->invert != 1)
cubeCap = capInside;
else
cubeCap = NULL;
- if (cubeCap && cubeCap->texture.name)
+ if (cubeCap && cubeCap->texture.name && s->hsize == 4)
{
if (opacity != OPAQUE)
{
@@ -1967,6 +1968,31 @@ cubeDrawCubeCap(CompScreen * s, int hsize, int arrayOffset,
glDisableClientState(GL_TEXTURE_COORD_ARRAY);
disableTexture(s, &cubeCap->texture);
screenTexEnvMode(s, GL_REPLACE);
+
+ }
+ else if (cubeCap && cubeCap->texture.name && s->hsize > 4)
+ {
+ //screenTexEnvMode(s, GL_REPLACE);
+ enableTexture(s, &cubeCap->texture, COMP_TEXTURE_FILTER_GOOD);
+
+ glBegin(GL_QUADS);
+ int centerx = *cs->vertices;
+ int centery = *(cs->vertices+1);
+ int centerz = *(cs->vertices+2);
+
+ glColor4f(1.0,1.0,1.0,1.0);
+ if (opacity != OPAQUE)
+ {
+ glColor4us(0xffff, 0xffff, 0xffff, opacity);
+ }
+ glVertex3f(centerx-0.35,centery+0.5,centerz+0.35);
+ glVertex3f(centerx-0.35,centery+0.5,centerz-0.35);
+ glVertex3f(centerx+0.35, centery+0.5, centerz-0.35);
+ glVertex3f(centerx+0.35,centery+0.5,centerz+0.35);
+
+ glEnd();
+ disableTexture(s, &cubeCap->texture);
+
}
else
{