From d411fd99f02806da4902007fcc849c37fc8d2bb3 Mon Sep 17 00:00:00 2001 From: Jason P Date: Tue, 24 Jun 2025 22:50:39 -0500 Subject: [PATCH] Update comments for Screen.cpp related to module load change --- src/graphics/Screen.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/graphics/Screen.cpp b/src/graphics/Screen.cpp index 09c40ae89..f381df854 100644 --- a/src/graphics/Screen.cpp +++ b/src/graphics/Screen.cpp @@ -849,15 +849,16 @@ void Screen::setFrames(FrameFocus focus) indicatorIcons.push_back(digital_icon_clock); #endif + // Beware of what changes you make in this code! + // We pass numfames into GetMeshModulesWithUIFrames() which is highly important! + // Inside of that callback, goes over to MeshModule.cpp and we run + // modulesWithUIFrames.resize(startIndex, nullptr), to insert nullptr + // entries until we're ready to start building the matching entries. + // We are doing our best to keep the normalFrames vector + // and the moduleFrames vector in lock step. moduleFrames = MeshModule::GetMeshModulesWithUIFrames(numframes); LOG_DEBUG("Show %d module frames", moduleFrames.size()); - // put all of the module frames first. - // this is a little bit of a dirty hack; since we're going to call - // the same drawModuleFrame handler here for all of these module frames - // and then we'll just assume that the state->currentFrame value - // is the same offset into the moduleFrames vector - // so that we can invoke the module's callback for (auto i = moduleFrames.begin(); i != moduleFrames.end(); ++i) { // Draw the module frame, using the hack described above if (*i != nullptr) {