Skip to content

Commit

Permalink
Remove a call to GetModel (which involves a mutex) for each frame of …
Browse files Browse the repository at this point in the history
…each effect being rendered.
  • Loading branch information
dkulp committed Dec 29, 2023
1 parent f25642b commit 9f8bc53
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion macOS
14 changes: 8 additions & 6 deletions xLights/RenderBuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1529,14 +1529,16 @@ void RenderBuffer::SetState(int period, bool ResetState, const std::string& mode
needToInit = true;
}
curPeriod = period;
cur_model = model_name;
curPeriod = period;
palette.UpdateForProgress(GetEffectTimeIntervalPosition());
dmx_buffer = false;
Model* m = GetModel();
if (m != nullptr) {
if (m->GetDisplayAs().rfind("Dmx", 0) == 0) {
dmx_buffer = true;
if (cur_model != model_name) {
cur_model = model_name;
dmx_buffer = false;
Model* m = GetModel();
if (m != nullptr) {
if (m->GetDisplayAs().rfind("Dmx", 0) == 0) {
dmx_buffer = true;
}
}
}
}
Expand Down

0 comments on commit 9f8bc53

Please sign in to comment.