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

Method GarbleRect

MicropolisCore/src/CellEngine/src/cellengine.cpp:577–608  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575
576
577void CellEngine::GarbleRect(
578 long xx,
579 long yy,
580 long ww,
581 long hh)
582{
583 Byte *image;
584 long x0, y0, x1, y1;
585
586 if (!OnScreen()) {
587 return;
588 }
589
590 if (xx < 0) x0 = 0; else x0 = xx;
591 if (yy < 0) y0 = 0; else y0 = yy;
592 if (xx + ww > width) x1 = width; else x1 = xx + ww;
593 if (yy + hh > height) y1 = height; else y1 = yy + ww;
594
595 if ((x0 < x1) && (y0 < y1)) {
596 image = frontMem;
597
598 for (yy = y0;
599 yy < y1;
600 yy++, image += screenRowBytes) {
601 for (xx = x0;
602 xx < x1;
603 xx++) {
604 image[xx] ^= (char)(Rand16() >> 4);
605 }
606 }
607 }
608}
609
610
611void CellEngine::Fill(

Callers

nothing calls this directly

Calls 1

Rand16Function · 0.70

Tested by

no test coverage detected