diff --git a/MUNGA_L4/L4VB16.cpp b/MUNGA_L4/L4VB16.cpp index cbf0f3f..9f4c268 100644 --- a/MUNGA_L4/L4VB16.cpp +++ b/MUNGA_L4/L4VB16.cpp @@ -5202,6 +5202,43 @@ Logical SVGA16::Update(Logical forceAll) int src_w = pixelBuffer.Data.Size.x; int src_h = pixelBuffer.Data.Size.y; + // + // RP412CAMLOG. A camera's map showed content at mission + // start and then went black, which is three different + // faults wearing one symptom: the copy stopping, the + // SOURCE canvas going blank, or the pane not repainting. + // Counting non-zero source pixels as we pass tells them + // apart - a live canvas with a black pane is the third, + // a blank canvas is the second, and no line at all is the + // first. Every five seconds; the count is a sample of one + // row in sixteen, which is plenty to tell blank from not. + // + if (RPCameraLog()) + { + static Scalar next_copy_say = 0.0f; + if ((Scalar) Now() >= next_copy_say) + { + next_copy_say = ((Scalar) Now()) + 5.0f; + + long lit = 0; + for (int sy = 0; sy < src_h; sy += 16) + { + Word *row = source_base + sy * src_w; + for (int sx = 0; sx < src_w; ++sx) + { + if (row[sx] != 0) + { + ++lit; + } + } + } + DEBUG_STREAM << "CamLog: map copy running, source " + << src_w << "x" << src_h << ", " << lit + << " lit pixels sampled, mask 0x" << std::hex + << secMask << std::dec << "\n" << std::flush; + } + } + if (Application::IsCameraStation()) { //