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

Method n_glassbonds

MicropolisCore/src/CellEngine/src/cellengine.cpp:4291–4369  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4289
4290
4291void CellEngine::n_glassbonds()
4292{
4293
4294 // 0 1 2 3
4295 // c cw ccw opp
4296 // 0x1 0x2 0x4 0x8
4297
4298#define MARG \
4299 (phase \
4300 ? (((xx + x) & 1) \
4301 ? (((yy + y) & 1) \
4302 ? ( /* p1 x1 y1 = c e s se */ \
4303 ((c & 0x80) >> 7) | \
4304 ((e & 0x80) >> 6) | \
4305 ((s & 0x80) >> 5) | \
4306 ((se & 0x80) >> 4) \
4307 ) \
4308 : ( /* p1 x1 y0 = c n e ne */ \
4309 ((c & 0x80) >> 7) | \
4310 ((n & 0x80) >> 6) | \
4311 ((e & 0x80)>> 5) | \
4312 ((ne & 0x80) >> 4) \
4313 ) \
4314 ) \
4315 : (((yy + y) & 1) \
4316 ? ( /* p1 x0 y1 = c s w sw */ \
4317 ((c & 0x80) >> 7) | \
4318 ((s & 0x80) >> 6) | \
4319 ((w & 0x80) >> 5) | \
4320 ((sw & 0x80) >> 4) \
4321 ) \
4322 : ( /* p1 x0 y0 = c w n nw */ \
4323 ((c & 0x80) >> 7) | \
4324 ((w & 0x80) >> 6) | \
4325 ((n & 0x80) >> 5) | \
4326 ((nw & 0x80) >> 4) \
4327 ) \
4328 ) \
4329 ) \
4330 : (((xx + x) & 1) \
4331 ? (((yy + y) & 1) \
4332 ? ( /* p0 x1 y1 = c w n nw */ \
4333 ((c & 0x80) >> 7) | \
4334 ((w & 0x80) >> 6) | \
4335 ((n & 0x80) >> 5) | \
4336 ((nw & 0x80) >> 4) \
4337 ) \
4338 : ( /* p0 x1 y0 = c s w sw */ \
4339 ((c & 0x80) >> 7) | \
4340 ((s & 0x80) >> 6) | \
4341 ((w & 0x80) >> 5) | \
4342 ((sw & 0x80) >> 4) \
4343 ) \
4344 ) \
4345 : (((yy + y) & 1) \
4346 ? ( /* p0 x0 y1 = c n e ne */ \
4347 ((c & 0x80) >> 7) | \
4348 ((n & 0x80) >> 6) | \

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected