MCPcopy Create free account
hub / github.com/TASEmulators/fceux / ShowResults

Function ShowResults

src/drivers/win/cheat.cpp:203–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203int ShowResults(HWND hwndDlg, bool supressUpdate = false)
204{
205
206 if (possiList.size() > 64)
207 possiList.clear();
208
209 int count = FCEUI_CheatSearchGetCount();
210
211 if (count != possiTotalCount)
212 {
213 char str[20];
214 sprintf(str, "%d Possibilit%s", count, count == 1 ? "y" : "ies");
215 SetDlgItemText(hwndDlg, IDC_CHEAT_BOX_POSSIBILITIES, str);
216 SendDlgItemMessage(hwndDlg, IDC_CHEAT_LIST_POSSIBILITIES, LVM_SETITEMCOUNT, count, 0);
217 possiTotalCount = count;
218 }
219
220 if (count)
221 {
222 int first = SendDlgItemMessage(hwndDlg, IDC_CHEAT_LIST_POSSIBILITIES, LVM_GETTOPINDEX, 0, 0);
223 if (first < 0)
224 first = 0;
225 int last = first + possiItemCount + 1;
226 if (last > count)
227 last = count;
228
229 int tmpPossiItemCount = possiItemCount;
230 possiItemCount = first;
231 FCEUI_CheatSearchGetRange(first, last, ShowResultsCallB);
232 possiItemCount = tmpPossiItemCount;
233 if (possibleUpdate && !supressUpdate)
234 {
235 int start = -1, end = -1;
236 for (int i = first; i < last; ++i)
237 if (possiList[i - first].update)
238 {
239 if (start == -1)
240 start = i;
241 end = i;
242 }
243
244 SendDlgItemMessage(hwndDlg, IDC_CHEAT_LIST_POSSIBILITIES, LVM_REDRAWITEMS, start, end);
245 }
246 possibleUpdate = false;
247 possiStart = first;
248 }
249
250 return 1;
251}
252
253void EnableCheatButtons(HWND hwndDlg, int enable)
254{

Callers 2

CheatConsoleCallBFunction · 0.85
UpdateCheatListFunction · 0.85

Calls 4

sizeMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected