Lines Matching refs:qp

96     qixstruct  *qp = &qixs[screen];
98 qp->startTime = seconds();
99 qp->nlines = (batchcount + 1) * 2;
100 if (!qp->lineq) {
101 qp->lineq = (point *) malloc(qp->nlines * sizeof(point));
102 memset(qp->lineq, '\0', qp->nlines * sizeof(point));
106 qp->width = xgwa.width;
107 qp->height = xgwa.height;
108 qp->delta = 16;
110 if (qp->width < 100) { /* icon window */
111 qp->nlines /= 4;
112 qp->delta /= 4;
114 qp->offset = qp->delta / 3;
115 qp->last = 0;
116 qp->pix = 0;
117 qp->dx1 = random() % qp->delta + qp->offset;
118 qp->dy1 = random() % qp->delta + qp->offset;
119 qp->dx2 = random() % qp->delta + qp->offset;
120 qp->dy2 = random() % qp->delta + qp->offset;
121 qp->x1 = random() % qp->width;
122 qp->y1 = random() % qp->height;
123 qp->x2 = random() % qp->width;
124 qp->y2 = random() % qp->height;
126 XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, qp->width, qp->height);
129 #define check_bounds(qp, val, del, max) \
132 *(del) = (random() % (qp)->delta) + (qp)->offset; \
134 *(del) = -(random() % (qp)->delta) - (qp)->offset; \
142 qixstruct *qp = &qixs[screen];
144 qp->first = (qp->last + 2) % qp->nlines;
146 qp->x1 += qp->dx1;
147 qp->y1 += qp->dy1;
148 qp->x2 += qp->dx2;
149 qp->y2 += qp->dy2;
150 check_bounds(qp, qp->x1, &qp->dx1, qp->width);
151 check_bounds(qp, qp->y1, &qp->dy1, qp->height);
152 check_bounds(qp, qp->x2, &qp->dx2, qp->width);
153 check_bounds(qp, qp->y2, &qp->dy2, qp->height);
156 qp->lineq[qp->first].x, qp->lineq[qp->first].y,
157 qp->lineq[qp->first + 1].x, qp->lineq[qp->first + 1].y);
159 XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[qp->pix]);
160 if (++qp->pix >= Scr[screen].npixels)
161 qp->pix = 0;
165 XDrawLine(dsp, win, Scr[screen].gc, qp->x1, qp->y1, qp->x2, qp->y2);
167 qp->lineq[qp->last].x = qp->x1;
168 qp->lineq[qp->last].y = qp->y1;
169 qp->last++;
170 if (qp->last >= qp->nlines)
171 qp->last = 0;
173 qp->lineq[qp->last].x = qp->x2;
174 qp->lineq[qp->last].y = qp->y2;
175 qp->last++;
176 if (qp->last >= qp->nlines)
177 qp->last = 0;