Lines Matching refs:lp

350     lifestruct *lp = &lifes[screen];
354 unsigned char *loc = lp->buffer + ((row + 1) * (lp->ncols + 2)) + col + 1;
355 unsigned char *ageptr = lp->agebuf + (loc - lp->buffer);
365 if (lp->pixelmode)
367 lp->xb + lp->xs * col, lp->yb + lp->ys * row, lp->xs, lp->ys);
370 0, 0, lp->xb + lp->xs * col, lp->yb + lp->ys * row,
380 lifestruct *lp = &lifes[screen];
383 lp->xb + lp->xs * col, lp->yb + lp->ys * row, lp->xs, lp->ys);
391 lifestruct *lp = &lifes[screen];
396 lastrow = (lp->nrows) * (lp->ncols + 2);
397 off = loc - lp->buffer;
398 col = off % (lp->ncols + 2);
399 row = (off - col) / (lp->ncols + 2);
400 ulloc = loc - lp->ncols - 3;
401 ucloc = loc - lp->ncols - 2;
402 urloc = loc - lp->ncols - 1;
406 llloc = loc + lp->ncols + 1;
407 lcloc = loc + lp->ncols + 2;
408 lrloc = loc + lp->ncols + 3;
414 if (row == lp->nrows) {
420 ulloc += lp->ncols;
421 clloc += lp->ncols;
422 llloc += lp->ncols;
424 if (col == lp->ncols) {
425 urloc -= lp->ncols;
426 crloc -= lp->ncols;
427 lrloc -= lp->ncols;
439 *(lp->agebuf + (loc - lp->buffer)) = 0;
447 lifestruct *lp = &lifes[screen];
453 lastrow = (lp->nrows) * (lp->ncols + 2);
454 off = loc - lp->buffer;
455 row = off / (lp->ncols + 2);
456 col = off % (lp->ncols + 2);
457 row = (off - col) / (lp->ncols + 2);
458 ulloc = loc - lp->ncols - 3;
459 ucloc = loc - lp->ncols - 2;
460 urloc = loc - lp->ncols - 1;
464 llloc = loc + lp->ncols + 1;
465 lcloc = loc + lp->ncols + 2;
466 lrloc = loc + lp->ncols + 3;
472 if (row == lp->nrows) {
478 ulloc += lp->ncols;
479 clloc += lp->ncols;
480 llloc += lp->ncols;
482 if (col == lp->ncols) {
483 urloc -= lp->ncols;
484 crloc -= lp->ncols;
485 lrloc -= lp->ncols;
505 lifestruct *lp = &lifes[screen];
508 loc = lp->buffer + ((row + 1) * (lp->ncols + 2)) + col + 1;
540 lifestruct *lp = &lifes[screen];
542 lp->generation = 0;
543 lp->shooterTime = seconds();
556 lp->width = xgwa.width;
557 lp->height = xgwa.height;
558 lp->pixelmode = (lp->width < 4 * icon_width);
559 if (lp->pixelmode) {
560 lp->ncols = 32;
561 lp->nrows = 32;
563 lp->ncols = min(lp->width / icon_width, MAXCOLS);
564 lp->nrows = min(lp->height / icon_height, MAXROWS);
566 lp->xs = lp->width / lp->ncols;
567 lp->ys = lp->height / lp->nrows;
568 lp->xb = (lp->width - lp->xs * lp->ncols) / 2;
569 lp->yb = (lp->height - lp->ys * lp->nrows) / 2;
572 XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, lp->width, lp->height);
574 bzero(lp->buffer, sizeof(lp->buffer));
578 col += lp->ncols / 2;
579 row += lp->nrows / 2;
592 lifestruct *lp = &lifes[screen];
594 loc = lp->buffer + lp->ncols + 2 + 1;
595 temploc = lp->tempbuf;
597 bcopy(loc, temploc, lp->ncols);
598 bcopy(loc + lp->ncols + 2, temploc + lp->ncols, lp->ncols);
600 lastloc = lp->lastbuf;
602 bcopy(loc + ((lp->nrows - 1) * (lp->ncols + 2)), lastloc, lp->ncols);
604 for (row = 0; row < lp->nrows; ++row) {
605 for (col = 0; col < lp->ncols; ++col) {
607 *temploc = (row == (lp->nrows - 3)) ?
609 *(loc + (lp->ncols + 2) * 2);
632 if (temploc >= lp->tempbuf + lp->ncols * 2)
633 temploc = lp->tempbuf;
636 if (++lp->generation > batchcount)
644 if (seconds() - lp->shooterTime > TIMEOUT) {
645 int hsp = random() % (lp->ncols - 5) + 3;
646 int vsp = random() % (lp->nrows - 5) + 3;
649 if (vsp > lp->nrows / 2)
651 if (hsp > lp->ncols / 2)
658 lp->shooterTime = seconds();