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

Method n_driven

MicropolisCore/src/CellEngine/src/cellengine.cpp:3752–3955  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3750
3751
3752void CellEngine::n_driven()
3753{
3754 Byte *front = frontMem;
3755 Byte *back = backMem +
3756 backBorder +
3757 (backBorder * backRowBytes);
3758 Byte *f = front, *b = back;
3759 long xx, yy;
3760 long heat = 0;
3761 Byte nw, n, ne;
3762 Byte ww, w, c, e, ee;
3763 Byte sw, s, se;
3764
3765 for (yy = 0;
3766 yy < height;
3767 f += screenRowBytes,
3768 b += backRowBytes,
3769 yy++) {
3770
3771 // .. __ .. .. ..
3772 // __ n ne .. ..
3773 // w c e ee ..
3774 // __ s se .. ..
3775 // .. __ .. .. ..
3776
3777 n = b[-1 + -backRowBytes];
3778 ne = b[-backRowBytes];
3779 w = b[-2];
3780 c = b[-1];
3781 e = b[0];
3782 ee = b[1];
3783 s = b[-1 + backRowBytes];
3784 se = b[backRowBytes];
3785
3786 for (xx = 0;
3787 xx < width;
3788 xx++) {
3789 // .. .. NN .. ..
3790 // .. nw n NE ..
3791 // ww w c e EE
3792 // .. sw s SE ..
3793 // .. .. SS .. ..
3794
3795 nw = n;
3796 n = ne;
3797 ne = b[xx + 1 + -backRowBytes];
3798 ww = w;
3799 w = c;
3800 c = e;
3801 e = ee;
3802 ee = b[xx + 2];
3803 sw = s;
3804 s = se;
3805 se = b[xx + 1 + backRowBytes];
3806
3807 if (ISEMPTY(c)) {
3808
3809 switch (((ISABCD(n) && (DIR(n) == DIR_S)) ? 1 : 0) +

Callers

nothing calls this directly

Calls 2

RandDirFunction · 0.85
Rand8Function · 0.70

Tested by

no test coverage detected