diff --git a/3d.c b/3d.c index 8ed754b..3198f94 100644 --- a/3d.c +++ b/3d.c @@ -71,10 +71,6 @@ typedef struct _tdScreen { int windowPrivateIndex; - Bool tdWindowExists; - Bool active; - Bool wasActive; - PreparePaintScreenProc preparePaintScreen; PaintOutputProc paintOutput; CubePostPaintViewportProc postPaintViewport; @@ -140,16 +136,16 @@ tdPreparePaintScreen (CompScreen *s, { CompWindow *w; float amount; + Bool active; TD_SCREEN (s); CUBE_SCREEN (s); - tds->active = (cs->rotationState != RotationNone) && - !(tdGetManualOnly(s) && - (cs->rotationState != RotationManual)); + active = (cs->rotationState != RotationNone) && + !(tdGetManualOnly(s) && (cs->rotationState != RotationManual)); amount = ((float)msSinceLastPaint * tdGetSpeed (s) / 1000.0); - if (tds->active) + if (active) { float maxDiv = (float) tdGetMaxWindowSpace (s) / 100; float minScale = (float) tdGetMinCubeSize (s) / 100; @@ -167,7 +163,6 @@ tdPreparePaintScreen (CompScreen *s, tdw->is3D = TRUE; tds->maxDepth++; tdw->depth = tds->maxDepth; - tds->tdWindowExists = TRUE; } minScale = MAX (minScale, 1.0 - (tds->maxDepth * maxDiv)); @@ -188,7 +183,7 @@ tdPreparePaintScreen (CompScreen *s, (*s->preparePaintScreen) (s, msSinceLastPaint); WRAP (tds, s, preparePaintScreen, tdPreparePaintScreen); - cs->paintAllViewports |= tds->active | tds->tdWindowExists; + cs->paintAllViewports |= (tds->basicScale != 1.0f); } /* forward declaration */ @@ -427,7 +422,7 @@ tdPaintWindow (CompWindow *w, TD_SCREEN (s); TD_WINDOW (w); - if (tdw->depth != 0.0f && !tds->painting3D && tds->basicScale != 1.0) + if (tdw->depth != 0.0f && !tds->painting3D && tds->basicScale != 1.0f) mask |= PAINT_WINDOW_NO_CORE_INSTANCE_MASK; if (tds->painting3D) @@ -509,7 +504,7 @@ tdPostPaintViewport (CompScreen *s, (*cs->postPaintViewport) (s, sAttrib, transform, output, region); WRAP (tds, cs, postPaintViewport, tdPostPaintViewport); - if (tds->active || tds->tdWindowExists) + if (tds->basicScale != 1.0f) { CompTransform sTransform = *transform; CompWindow *firstFTB = NULL; @@ -653,7 +648,7 @@ tdPaintOutput (CompScreen *s, TD_SCREEN (s); - if (tds->basicScale != 1.0) + if (tds->basicScale != 1.0f) { mask |= PAINT_SCREEN_TRANSFORMED_MASK | PAINT_SCREEN_WITH_TRANSFORMED_WINDOWS_MASK; @@ -718,8 +713,7 @@ tdInitWindowWalker (CompScreen *s, (*s->initWindowWalker) (s, walker); WRAP (tds, s, initWindowWalker, tdInitWindowWalker); - if ((tds->active || tds->tdWindowExists) && - cs->paintOrder == BTF && tds->painting3D) + if ((tds->basicScale != 1.0f) && cs->paintOrder == BTF && tds->painting3D) { walker->first = tdWalkFirst; walker->last = tdWalkLast; @@ -790,11 +784,8 @@ tdInitScreen (CompPlugin *p, return FALSE; } - tds->active = tds->wasActive = FALSE; - - tds->basicScale = 1.0; - tds->currentScale = 1.0; - tds->tdWindowExists = FALSE; + tds->basicScale = 1.0f; + tds->currentScale = 1.0f; tds->painting3D = FALSE; tds->first = NULL;