Lines Matching defs:qp
92 qixstruct *qp = &qixs[screen];
94 qp->startTime = seconds();
97 qp->nlines = (batchcount + 1) * 2;
98 if (!qp->lineq) {
99 qp->lineq = calloc(qp->nlines, sizeof(point));
100 if (qp->lineq == NULL)
105 qp->width = xgwa.width;
106 qp->height = xgwa.height;
107 qp->delta = 16;
109 if (qp->width < 100) { /* icon window */
110 qp->nlines /= 4;
111 qp->delta /= 4;
113 qp->offset = qp->delta / 3;
114 qp->last = 0;
115 qp->pix = 0;
116 qp->dx1 = (int) random() % qp->delta + qp->offset;
117 qp->dy1 = (int) random() % qp->delta + qp->offset;
118 qp->dx2 = (int) random() % qp->delta + qp->offset;
119 qp->dy2 = (int) random() % qp->delta + qp->offset;
120 qp->x1 = (int) random() % qp->width;
121 qp->y1 = (int) random() % qp->height;
122 qp->x2 = (int) random() % qp->width;
123 qp->y2 = (int) random() % qp->height;
125 XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, qp->width, qp->height);
128 #define check_bounds(qp, val, del, max) \
131 *(del) = ((int)random() % (qp)->delta) + (qp)->offset; \
133 *(del) = -((int)random() % (qp)->delta) - (qp)->offset; \
140 qixstruct *qp = &qixs[screen];
142 qp->first = (qp->last + 2) % qp->nlines;
144 qp->x1 += qp->dx1;
145 qp->y1 += qp->dy1;
146 qp->x2 += qp->dx2;
147 qp->y2 += qp->dy2;
148 check_bounds(qp, qp->x1, &qp->dx1, qp->width);
149 check_bounds(qp, qp->y1, &qp->dy1, qp->height);
150 check_bounds(qp, qp->x2, &qp->dx2, qp->width);
151 check_bounds(qp, qp->y2, &qp->dy2, qp->height);
154 qp->lineq[qp->first].x, qp->lineq[qp->first].y,
155 qp->lineq[qp->first + 1].x, qp->lineq[qp->first + 1].y);
157 XSetForeground(dsp, Scr[screen].gc, Scr[screen].pixels[qp->pix]);
158 if (++qp->pix >= Scr[screen].npixels)
159 qp->pix = 0;
163 XDrawLine(dsp, win, Scr[screen].gc, qp->x1, qp->y1, qp->x2, qp->y2);
165 qp->lineq[qp->last].x = qp->x1;
166 qp->lineq[qp->last].y = qp->y1;
167 qp->last++;
168 if (qp->last >= qp->nlines)
169 qp->last = 0;
171 qp->lineq[qp->last].x = qp->x2;
172 qp->lineq[qp->last].y = qp->y2;
173 qp->last++;
174 if (qp->last >= qp->nlines)
175 qp->last = 0;