MCPcopy Create free account
hub / github.com/BespokeSynth/BespokeSynth / GetGridColor

Method GetGridColor

Source/StepSequencer.cpp:213–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

211}
212
213GridColor StepSequencer::GetGridColor(int x, int y)
214{
215 Vec2i gridPos = ControllerToGrid(Vec2i(x, y));
216 bool cellOn = mGrid->GetVal(gridPos.x, gridPos.y) > 0;
217 bool cellBright = mGrid->GetVal(gridPos.x, gridPos.y) > kMidwayVelocity;
218 bool colOn = (mGrid->GetHighlightCol(gTime) == gridPos.x) && mEnabled;
219
220 GridColor color;
221 if (colOn)
222 {
223 if (cellBright)
224 color = kGridColor3Bright;
225 else if (cellOn)
226 color = kGridColor3Dim;
227 else
228 color = kGridColor2Dim;
229 }
230 else
231 {
232 if (cellBright)
233 color = kGridColor1Bright;
234 else if (cellOn)
235 color = kGridColor1Dim;
236 else
237 color = kGridColorOff;
238 }
239
240 return color;
241}
242
243void StepSequencer::UpdateVelocityLights()
244{

Callers

nothing calls this directly

Calls 3

Vec2iClass · 0.85
GetValMethod · 0.80
GetHighlightColMethod · 0.45

Tested by

no test coverage detected