summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moreau <oreaus@gmail.com>2010-09-30 05:47:10 -0600
committerScott Moreau <oreaus@gmail.com>2010-09-30 05:47:10 -0600
commita1484ebbcefa57fbcd268463bb3fe5d6f49383b6 (patch)
tree432036d8d2c201c0e74113cbc6c4eebccb901fb5
parent9d37d00eaabbd001cde9261113f416482ec221c8 (diff)
downloadcubeaddon-a1484ebbcefa57fbcd268463bb3fe5d6f49383b6.tar.gz
cubeaddon-a1484ebbcefa57fbcd268463bb3fe5d6f49383b6.tar.bz2
Move cap color settings to cube.
-rw-r--r--cubeaddon.xml.in27
-rw-r--r--src/cubeaddon.cpp21
-rw-r--r--src/cubeaddon.h5
3 files changed, 18 insertions, 35 deletions
diff --git a/cubeaddon.xml.in b/cubeaddon.xml.in
index 6505380..0bed082 100644
--- a/cubeaddon.xml.in
+++ b/cubeaddon.xml.in
@@ -249,27 +249,9 @@
</option>
</subgroup>
<subgroup>
- <_short>Appearance</_short>
- <option name="top_color" type="color">
- <_short>Cube Top Color</_short>
- <_long>Color of top face of the cube</_long>
- <default>
- <red>0xffff</red>
- <green>0xffff</green>
- <blue>0xffff</blue>
- </default>
- </option>
- <option name="bottom_color" type="color">
- <_short>Cube Bottom Color</_short>
- <_long>Color of bottom face of the cube</_long>
- <default>
- <red>0xffff</red>
- <green>0xffff</green>
- <blue>0xffff</blue>
- </default>
- </option>
+ <_short>Top</_short>
<option name="top_images" type="list">
- <_short>Top image files</_short>
+ <_short>Image files</_short>
<_long>List of PNG and SVG files that should be rendered on top face of cube</_long>
<type>string</type>
<hints>file;image;</hints>
@@ -278,8 +260,11 @@
</default>
<hints>file;image;</hints>
</option>
+ </subgroup>
+ <subgroup>
+ <_short>Bottom</_short>
<option name="bottom_images" type="list">
- <_short>Bottom image files</_short>
+ <_short>Image files</_short>
<_long>List of PNG and SVG files that should be rendered on bottom face of cube</_long>
<type>string</type>
<hints>file;image;</hints>
diff --git a/src/cubeaddon.cpp b/src/cubeaddon.cpp
index b806c6f..97a00c3 100644
--- a/src/cubeaddon.cpp
+++ b/src/cubeaddon.cpp
@@ -378,8 +378,7 @@ CubeaddonScreen::paintCap (const GLScreenPaintAttrib &sAttrib,
CompOutput *output,
int size,
bool top,
- bool adjust,
- unsigned short *color)
+ bool adjust)
{
GLScreenPaintAttrib sa;
GLMatrix sTransform;
@@ -389,9 +388,14 @@ CubeaddonScreen::paintCap (const GLScreenPaintAttrib &sAttrib,
float cInv = (top) ? 1.0: -1.0;
CubeCap *cap;
bool cScale, cAspect;
+ unsigned short *color;
glGetIntegerv (GL_CULL_FACE_MODE, &cullNorm);
cullInv = (cullNorm == GL_BACK)? GL_FRONT : GL_BACK;
+ if (top)
+ color = cubeScreen->topColor ();
+ else
+ color = cubeScreen->bottomColor ();
opacity = cubeScreen->desktopOpacity () * color[3] / 0xffff;
@@ -572,13 +576,10 @@ CubeaddonScreen::cubePaintTop (const GLScreenPaintAttrib &sAttrib,
if (!optionGetDrawTop ())
return;
- paintCap (sAttrib, transform, output, size, true,
- optionGetAdjustTop (), optionGetTopColor());
+ paintCap (sAttrib, transform, output, size,
+ true, optionGetAdjustTop ());
}
-/*
- * Paint bottom cube face
- */
void
CubeaddonScreen::cubePaintBottom (const GLScreenPaintAttrib &sAttrib,
const GLMatrix &transform,
@@ -594,8 +595,8 @@ CubeaddonScreen::cubePaintBottom (const GLScreenPaintAttrib &sAttrib,
if (!optionGetDrawBottom ())
return;
- paintCap (sAttrib, transform, output, size, false,
- optionGetAdjustBottom (), optionGetBottomColor());
+ paintCap (sAttrib, transform, output, size,
+ false, optionGetAdjustBottom ());
}
void
@@ -936,8 +937,6 @@ CubeaddonScreen::cubeShouldPaintAllViewports ()
bool status = cubeScreen->cubeShouldPaintAllViewports ();
return (!optionGetDrawTop () ||
!optionGetDrawBottom () ||
- (optionGetTopColorAlpha () != OPAQUE) ||
- (optionGetBottomColorAlpha () != OPAQUE) ||
(mDeform > 0.0) ||
status);
}
diff --git a/src/cubeaddon.h b/src/cubeaddon.h
index 45933a0..c6aa5c7 100644
--- a/src/cubeaddon.h
+++ b/src/cubeaddon.h
@@ -118,8 +118,7 @@ class CubeaddonScreen :
CompOutput *output,
int size,
bool top,
- bool adjust,
- unsigned short *color);
+ bool adjust);
private:
@@ -185,4 +184,4 @@ class CubeaddonPluginVTable :
{
public:
bool init ();
-}; \ No newline at end of file
+};