summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moreau <oreaus@gmail.com>2010-07-08 04:39:55 -0600
committerScott Moreau <oreaus@gmail.com>2010-07-08 04:39:55 -0600
commit0202f91bb4ff5c70d70a319929f4873211f65aa1 (patch)
tree395b2db563a587d9a14224d86a996722ca1ac6d0
parent8992f901cee262a39f91f5bb758a6b895aca87b1 (diff)
downloadphotowheel-0202f91bb4ff5c70d70a319929f4873211f65aa1.tar.gz
photowheel-0202f91bb4ff5c70d70a319929f4873211f65aa1.tar.bz2
Aftershock.
-rw-r--r--src/photowheel.cpp64
1 files changed, 26 insertions, 38 deletions
diff --git a/src/photowheel.cpp b/src/photowheel.cpp
index d70a1c0..dd823a9 100644
--- a/src/photowheel.cpp
+++ b/src/photowheel.cpp
@@ -58,12 +58,7 @@ PhotowheelScreen::capChange (CompOption *option,
int i;
unsigned short *top = optionGetTopColor ();
unsigned short *bot = optionGetBottomColor ();
-/*
- if (!firsttime)
- {
- glDeleteLists (dList, 1);
- }
-*/
+
dList = glGenLists (1);
glNewList (dList, GL_COMPILE);
glBegin (GL_POLYGON);
@@ -103,16 +98,7 @@ PhotowheelScreen::textureChange (CompOption *option,
CompOption::Value::Vector imgFiles = optionGetPhotoTextures ();
n = imgFiles.size ();
-/*
- if(!firsttime)
- {
- for (i = 0; i < n; i++)
- {
- photoTexture.at (i).tex.clear ();
- glDeleteLists (photoTexture.at (i).dList, 1);
- }
- }
-*/
+
if (imgFiles.empty () || !imgFiles.size ())
{
compLogMessage ("photowheel", CompLogLevelWarn,
@@ -303,7 +289,6 @@ PhotowheelScreen::PhotowheelScreen (CompScreen *screen) :
gScreen (GLScreen::get (screen)),
csScreen (CubeScreen::get (screen)),
damage(false),
- /* firsttime (true), */
angle(0.0)
{
ScreenInterface::setHandler (screen, true);
@@ -317,33 +302,36 @@ PhotowheelScreen::PhotowheelScreen (CompScreen *screen) :
zpos = optionGetZpos ();
transformOrder = optionGetOrder ();
+ ChangeNotify optionPc = boost::bind (&PhotowheelScreen::
+ paramChange, this, _1, _2);
+ ChangeNotify optionCc = boost::bind (&PhotowheelScreen::
+ capChange, this, _1, _2);
+
optionSetPhotoTexturesNotify (boost::bind (&PhotowheelScreen::
textureChange, this, _1, _2));
- optionSetHeightNotify (boost::bind (&PhotowheelScreen::
- paramChange, this, _1, _2));
- optionSetWidthNotify (boost::bind (&PhotowheelScreen::
- paramChange, this, _1, _2));
- optionSetSpeedNotify (boost::bind (&PhotowheelScreen::
- paramChange, this, _1, _2));
- optionSetXposNotify (boost::bind (&PhotowheelScreen::
- paramChange, this, _1, _2));
- optionSetYposNotify (boost::bind (&PhotowheelScreen::
- paramChange, this, _1, _2));
- optionSetZposNotify (boost::bind (&PhotowheelScreen::
- paramChange, this, _1, _2));
- optionSetOrderNotify (boost::bind (&PhotowheelScreen::
- paramChange, this, _1, _2));
-
- optionSetTopColorNotify (boost::bind (&PhotowheelScreen::
- capChange, this, _1, _2));
- optionSetBottomColorNotify (boost::bind (&PhotowheelScreen::
- capChange, this, _1, _2));
- optionSetCullNotify (boost::bind (&PhotowheelScreen::
- paramChange, this, _1, _2));
+ optionSetHeightNotify (optionPc);
+ optionSetWidthNotify (optionPc);
+ optionSetSpeedNotify (optionPc);
+ optionSetXposNotify (optionPc);
+ optionSetYposNotify (optionPc);
+ optionSetZposNotify (optionPc);
+ optionSetOrderNotify (optionPc);
+ optionSetCullNotify (optionPc);
+ optionSetTopColorNotify (optionCc);
+ optionSetBottomColorNotify (optionCc);
+
+ textureChange (0, (PhotowheelOptions::Options) NULL);
+ paramChange (0, (PhotowheelOptions::Options) NULL);
}
PhotowheelScreen::~PhotowheelScreen ()
{
+ for (int i = 0; i < n; i++)
+ {
+ photoTexture.at (i).tex.clear ();
+ glDeleteLists (photoTexture.at (i).dList, 1);
+ }
+ glDeleteLists (dList, 1);
}
bool