* Checks whether a key should be shown in the current filter mode. * * @param mapn Index of the key. * @param filter Current filter. * @param conflictTable A populated conflict table. * * @return Key should be shown (true) or not shown (false) **/
| 111 | * @return Key should be shown (true) or not shown (false) |
| 112 | **/ |
| 113 | bool ShouldDisplayMapping(int mapn, int filter, const int* conflictTable) |
| 114 | { |
| 115 | //mbg merge 7/17/06 changed to if..elseif |
| 116 | if(filter == 0) /* No filter */ |
| 117 | { |
| 118 | return true; |
| 119 | } |
| 120 | else if(filter <= EMUCMDTYPE_MAX) /* Filter by type */ |
| 121 | { |
| 122 | return FCEUI_CommandTable[mapn].type == filter - 1; |
| 123 | } |
| 124 | else if(filter == EMUCMDTYPE_MAX + 1) /* Assigned */ |
| 125 | { |
| 126 | return FCEUD_CommandMapping[FCEUI_CommandTable[mapn].cmd].NumC != 0; |
| 127 | } |
| 128 | else if(filter == EMUCMDTYPE_MAX + 2) /* Unassigned */ |
| 129 | { |
| 130 | return FCEUD_CommandMapping[FCEUI_CommandTable[mapn].cmd].NumC == 0; |
| 131 | } |
| 132 | else if(filter == EMUCMDTYPE_MAX + 3) /* Conflicts */ |
| 133 | { |
| 134 | return conflictTable[FCEUI_CommandTable[mapn].cmd] != 0; |
| 135 | } |
| 136 | else |
| 137 | { |
| 138 | return 0; |
| 139 | } |
| 140 | } |
| 141 | |
| 142 | /** |
| 143 | * Populates a conflict table. |
no outgoing calls
no test coverage detected