Lines Matching defs:lp
340 lifestruct *lp = &lifes[screen];
344 int off = ((row + 1) * (lp->ncols + 2)) + col + 1;
345 unsigned char *ageptr = lp->agebuf + off;
355 if (lp->pixelmode)
357 lp->xb + lp->xs * col, lp->yb + lp->ys * row, lp->xs, lp->ys);
360 0, 0, lp->xb + lp->xs * col, lp->yb + lp->ys * row,
372 lifestruct *lp = &lifes[screen];
375 lp->xb + lp->xs * col, lp->yb + lp->ys * row, lp->xs, lp->ys);
382 lifestruct *lp = &lifes[screen];
387 lastrow = (lp->nrows) * (lp->ncols + 2);
388 off = (int) (loc - lp->buffer);
389 col = off % (lp->ncols + 2);
390 row = (off - col) / (lp->ncols + 2);
391 ulloc = loc - lp->ncols - 3;
392 ucloc = loc - lp->ncols - 2;
393 urloc = loc - lp->ncols - 1;
397 llloc = loc + lp->ncols + 1;
398 lcloc = loc + lp->ncols + 2;
399 lrloc = loc + lp->ncols + 3;
405 if (row == lp->nrows) {
411 ulloc += lp->ncols;
412 clloc += lp->ncols;
413 llloc += lp->ncols;
415 if (col == lp->ncols) {
416 urloc -= lp->ncols;
417 crloc -= lp->ncols;
418 lrloc -= lp->ncols;
430 *(lp->agebuf + (loc - lp->buffer)) = 0;
437 lifestruct *lp = &lifes[screen];
443 lastrow = (lp->nrows) * (lp->ncols + 2);
444 off = (int) (loc - lp->buffer);
445 row = off / (lp->ncols + 2);
446 col = off % (lp->ncols + 2);
447 row = (off - col) / (lp->ncols + 2);
448 ulloc = loc - lp->ncols - 3;
449 ucloc = loc - lp->ncols - 2;
450 urloc = loc - lp->ncols - 1;
454 llloc = loc + lp->ncols + 1;
455 lcloc = loc + lp->ncols + 2;
456 lrloc = loc + lp->ncols + 3;
462 if (row == lp->nrows) {
468 ulloc += lp->ncols;
469 clloc += lp->ncols;
470 llloc += lp->ncols;
472 if (col == lp->ncols) {
473 urloc -= lp->ncols;
474 crloc -= lp->ncols;
475 lrloc -= lp->ncols;
496 lifestruct *lp = &lifes[screen];
499 loc = lp->buffer + ((row + 1) * (lp->ncols + 2)) + col + 1;
530 lifestruct *lp = &lifes[screen];
532 lp->generation = 0;
533 lp->shooterTime = seconds();
546 lp->width = xgwa.width;
547 lp->height = xgwa.height;
548 lp->pixelmode = (lp->width < 4 * icon_width);
549 if (lp->pixelmode) {
550 lp->ncols = 32;
551 lp->nrows = 32;
553 lp->ncols = min(lp->width / icon_width, MAXCOLS);
554 lp->nrows = min(lp->height / icon_height, MAXROWS);
556 lp->xs = lp->width / lp->ncols;
557 lp->ys = lp->height / lp->nrows;
558 lp->xb = (lp->width - lp->xs * lp->ncols) / 2;
559 lp->yb = (lp->height - lp->ys * lp->nrows) / 2;
562 XFillRectangle(dsp, win, Scr[screen].gc, 0, 0, lp->width, lp->height);
564 bzero(lp->buffer, sizeof(lp->buffer));
568 col += lp->ncols / 2;
569 row += lp->nrows / 2;
581 lifestruct *lp = &lifes[screen];
583 loc = lp->buffer + lp->ncols + 2 + 1;
584 temploc = lp->tempbuf;
586 bcopy(loc, temploc, lp->ncols);
587 bcopy(loc + lp->ncols + 2, temploc + lp->ncols, lp->ncols);
589 lastloc = lp->lastbuf;
591 bcopy(loc + ((lp->nrows - 1) * (lp->ncols + 2)), lastloc, lp->ncols);
593 for (row = 0; row < lp->nrows; ++row) {
594 for (col = 0; col < lp->ncols; ++col) {
596 *temploc = (row == (lp->nrows - 3)) ?
598 *(loc + (lp->ncols + 2) * 2);
621 if (temploc >= lp->tempbuf + lp->ncols * 2)
622 temploc = lp->tempbuf;
625 if (++lp->generation > batchcount)
633 if (seconds() - lp->shooterTime > TIMEOUT) {
634 int hsp = (int) random() % (lp->ncols - 5) + 3;
635 int vsp = (int) random() % (lp->nrows - 5) + 3;
638 if (vsp > lp->nrows / 2)
640 if (hsp > lp->ncols / 2)
647 lp->shooterTime = seconds();