MCPcopy Create free account
hub / github.com/SimHacker/micropolis / FillRect

Method FillRect

MicropolisCore/src/CellEngine/src/cellengine.cpp:634–666  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

632
633
634void CellEngine::FillRect(
635 Byte c,
636 long xx,
637 long yy,
638 long ww,
639 long hh)
640{
641 Byte *image;
642 long x0, y0, x1, y1;
643
644 if (!OnScreen()) {
645 return;
646 }
647
648 if (xx < 0) x0 = 0; else x0 = xx;
649 if (yy < 0) y0 = 0; else y0 = yy;
650 if (xx + ww > width) x1 = width; else x1 = xx + ww;
651 if (yy + hh > height) y1 = height; else y1 = yy + ww;
652
653 if ((x0 < x1) && (y0 < y1)) {
654 image = frontMem;
655
656 for (yy = y0;
657 yy < y1;
658 yy++, image += screenRowBytes) {
659 for (xx = x0;
660 xx < x1;
661 xx++) {
662 image[xx] = c;
663 }
664 }
665 }
666}
667
668
669void CellEngine::ResetMask()

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected