MCPcopy Create free account
hub / github.com/HertzDevil/0CC-FamiTracker / Draw

Method Draw

Source/VisualizerScope.cpp:111–152  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

109}
110
111void CVisualizerScope::Draw()
112{
113#ifdef _DEBUG
114 int min_ = 0; // // //
115 int max_ = 0;
116#endif
117
118 const int TIME_SCALING = 7;
119
120 static int LastPos = 0;
121 static int Accum = 0;
122
123 for (auto sample : m_pSamples) { // // //
124#ifdef _DEBUG
125 if (min_ > sample)
126 min_ = sample;
127 if (max_ < sample)
128 max_ = sample;
129#endif
130
131 int Pos = m_iWindowBufPtr++ / TIME_SCALING;
132
133 Accum += sample;
134
135 if (Pos != LastPos) {
136 m_pWindowBuf[LastPos] = Accum / TIME_SCALING;
137 Accum = 0;
138 }
139
140 LastPos = Pos;
141
142 if (Pos == m_iWidth) {
143 m_iWindowBufPtr = 0;
144 LastPos = 0;
145 RenderBuffer();
146 }
147 }
148
149#ifdef _DEBUG
150 m_iPeak = max_ - min_; // // //
151#endif
152}
153
154void CVisualizerScope::Display(CDC *pDC, bool bPaintMsg)
155{

Callers 2

DrawRegistersMethod · 0.45
ThreadProcMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected