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

Method n_jvn29

MicropolisCore/src/CellEngine/src/cellengine.cpp:5477–5683  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5475 */
5476
5477void CellEngine::n_jvn29()
5478{
5479 if (!jvnInitialized) {
5480 jvnInitialized = true;
5481
5482 int i;
5483 for (i = 0; i < 256; i++) {
5484 codeToName[i] = NULL;
5485 }
5486 for (i = 0; i < JVNSTATES; i++) {
5487 codeToName[states[i].code] = states[i].name;
5488 }
5489 }
5490
5491 Byte *front = frontMem;
5492 Byte *back = backMem +
5493 backBorder +
5494 (backBorder * backRowBytes);
5495 Byte *f = front, *b = back;
5496 long xx, yy;
5497
5498 Byte up, down, left, right, state;
5499 for (yy = 0;
5500 yy < height;
5501 f += screenRowBytes,
5502 b += backRowBytes,
5503 yy++) {
5504
5505 state = b[-1];
5506 right = b[0];
5507
5508 for (xx = 0;
5509 xx < width;
5510 xx++) {
5511
5512 up = b[xx + -backRowBytes];
5513 down = b[xx + backRowBytes];
5514 left = state;
5515 state = right;
5516 right = b[xx + 1];
5517
5518 Byte nextstate = state;
5519
5520 switch (state) {
5521
5522
5523 case U: // unexcited state
5524 {
5525 if ((right == U) && (up == U) && (left == U) && (down == U)) {
5526 // no change
5527 } else if (osp(right, up, left, down)) {
5528 nextstate = S;
5529 } else {
5530 // no change
5531 } // if
5532 break;
5533 } // case
5534

Callers

nothing calls this directly

Calls 9

ospFunction · 0.85
spFunction · 0.85
wceFunction · 0.85
wopFunction · 0.85
opFunction · 0.85
wspFunction · 0.85
cascadeFunction · 0.85
exciteFunction · 0.85
decayFunction · 0.85

Tested by

no test coverage detected