summaryrefslogtreecommitdiff
path: root/cubedbus.c
diff options
context:
space:
mode:
authorDavid Mikos <metastability@opencompositing.org>2008-01-29 00:29:28 +1030
committerJoel Bosveld <joel@joel-desktop.(none)>2008-01-31 22:31:14 +0900
commit76dd910e9cacd62899348ebc927b734ef7e061a9 (patch)
tree33190c72d4863ba648abb1388682bbd091935094 /cubedbus.c
parent841b94f322da17cadb94a54017fbb392692b887f (diff)
downloadcubedbus-76dd910e9cacd62899348ebc927b734ef7e061a9.tar.gz
cubedbus-76dd910e9cacd62899348ebc927b734ef7e061a9.tar.bz2
Patch for animated obj models.
Diffstat (limited to 'cubedbus.c')
-rw-r--r--cubedbus.c63
1 files changed, 19 insertions, 44 deletions
diff --git a/cubedbus.c b/cubedbus.c
index ba527e8..fc63b2c 100644
--- a/cubedbus.c
+++ b/cubedbus.c
@@ -215,50 +215,33 @@ cubedbusModifyObject (CompDisplay *d,
CompOption *option,
int nOption)
{
- //get gs pointer
CompScreen *s;
Window xid;
xid = getIntOptionNamed (option, nOption, "root", 0);
s = findScreenAtDisplay (d, xid);
- if(!s) return FALSE;
+ if(!s) return FALSE;
CUBEDBUS_SCREEN(s);
- CubedbusObject *head=gs->head;
- CubedbusObject *objptr=gs->head;
-
- CubedbusName *cubedbusName = malloc (sizeof(CubedbusName));
- int i;
-
- if(!cubedbusGetName( getStringOptionNamed(option,nOption,"name",""), cubedbusName )) return FALSE;
-
- /* sets the head pointer correctly */
+ CubedbusObject *objptr;
+ objptr=gs->head;
+ char name[16];
- for(i=0;i<cubedbusName->n -1 ;i++) /* stop 1 before the object to be created */
+ char *tempName=getStringOptionNamed (option,nOption,"name", "");
+
+ if(strlen(tempName) >= 16) /* should be array length */
{
- while(1)
- {
- if(objptr == NULL) return FALSE;
-
- if(!strcmp(objptr->name, cubedbusName->string[i]))
- {
- head=objptr;
- CubedbusObj *data=objptr->data;
- objptr=data->firstChild;
- break;
- }
- else objptr=objptr->next;
- }
+ compLogMessage (NULL,"cubedbus",CompLogLevelError, "name is too long");
+ return FALSE;
}
-
- while(1)
+ strcpy(name,tempName);
+
+ while(1)
{
- if(objptr==NULL) return false;
- if(!strcmp(objptr->name,cubedbusName->string[i]))
- {
- return (objptr->modfunc) (objptr, option, nOption);
- }
+ if(objptr==NULL) return FALSE;
+ if(!strcmp(objptr->name,name)) return (objptr->modfunc) (objptr, option, nOption);
objptr=objptr->next;
}
+
}
@@ -364,23 +347,13 @@ cubedbusPaintInside (CompScreen *s,
CUBEDBUS_SCREEN (s);
CUBE_SCREEN (s);
-
Bool enabled;
ScreenPaintAttrib sA = *sAttrib;
sA.yRotate += cs->invert * (360.0f / size) *
(cs->xRotations - (s->x * cs->nOutput)); /*?*/
-
- FILE *fp=fopen("/tmp/compiz.matrix","w");
- fprintf(fp,"%f\n",sA.xRotate);
- fprintf(fp,"%f\n",sA.yRotate);
- fprintf(fp,"%f\n",sA.vRotate);
- fprintf(fp,"%f\n",sA.xTranslate);
- fprintf(fp,"%f\n",sA.yTranslate);
- fprintf(fp,"%f\n",sA.zTranslate);
- fprintf(fp,"%f\n",sA.zCamera);
-fclose(fp);
+
CompTransform mT = *transform;
(*s->applyScreenTransform) (s, &sA, output, &mT);
@@ -455,6 +428,7 @@ cubedbusPreparePaintScreen (CompScreen *s,
{
CUBEDBUS_SCREEN (s);
+ timeSec += ms/1000.0f;
/* check for messages */
UNWRAP (gs, s, preparePaintScreen);
@@ -545,7 +519,8 @@ cubedbusInitScreen (CompPlugin *p,
s->base.privates[gd->screenPrivateIndex].ptr = gs; /* For the CUBEDBUS_SCREEN macro to work */
-
+ timeSec = 0;
+
/**/
gs->head= malloc (sizeof(CubedbusObject));
if(gs->head == NULL) return FALSE;