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

Function PopulateConflictTable

src/drivers/win/mapinput.cpp:147–178  ·  view source on GitHub ↗

* Populates a conflict table. * * @param conflictTable The conflict table to populate. **/

Source from the content-addressed store, hash-verified

145* @param conflictTable The conflict table to populate.
146**/
147void PopulateConflictTable(int* conflictTable)
148{
149 // Check whether there are conflicts between the
150 // selected hotkeys.
151 for(unsigned i = 0; i < EMUCMD_MAX - 1; ++i)
152 {
153 for(unsigned int j = i + 1; j < EMUCMD_MAX; ++j)
154 {
155 bool hasConflicsts = false;
156 for (unsigned int x = 0; x < FCEUD_CommandMapping[i].NumC; ++x)
157 {
158 for (unsigned int y = 0; y < FCEUD_CommandMapping[j].NumC; ++y)
159 {
160 if ((FCEUI_CommandTable[i].flags & EMUCMDFLAG_TASEDITOR) == (FCEUI_CommandTable[j].flags & EMUCMDFLAG_TASEDITOR)
161 && FCEUD_CommandMapping[i].ButtType[x] == FCEUD_CommandMapping[j].ButtType[y]
162 && FCEUD_CommandMapping[i].DeviceNum[x] == FCEUD_CommandMapping[j].DeviceNum[y]
163 && FCEUD_CommandMapping[i].ButtonNum[x] == FCEUD_CommandMapping[j].ButtonNum[y])
164 {
165 hasConflicsts = true;
166 break;
167 }
168 }
169 if (hasConflicsts) break;
170 }
171 if (hasConflicsts)
172 {
173 conflictTable[i] = 1;
174 conflictTable[j] = 1;
175 }
176 }
177 }
178}
179
180/**
181* Populates the hotkey ListView according to the rules set

Callers 1

PopulateMappingDisplayFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected