LightPtr LightManager::GetNextAffectingLight(LightPtr pLight, const ViewFrustum& frustum) { LightPtr pNode = GetNextLight(pLight); while(pNode) { if(pNode->IsAffecting(frustum)) { return pNode; } pNode = GetNextLight(pNode); } return pNode; }
void DoLonelyModeLoop() { static const unsigned int cycleTime = 100; static unsigned char lightMask = 0x08; static unsigned int lastChange = 0; if (millis() - lastChange > cycleTime) { lightMask = GetNextLight(lightMask); panel.WritePlayer1LEDs(lightMask); panel.WritePlayer2LEDs(lightMask); lastChange = millis(); } if (OnePlayerButtonPressed()) { LaunchOnePlayerGame(); } else if (TwoPlayerButtonPressed()) { LaunchTwoPlayerGame(); } }