Reverting prior change to map_loose_match
This commit is contained in:
parent
f1d6ac0e53
commit
3f1c591196
|
@ -210,17 +210,16 @@ map_strict_match(Input_Modifier_Set *binding_mod_set, Input_Modifier_Set *event_
|
||||||
return(result);
|
return(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
function i32
|
function b32
|
||||||
map_loose_match(Input_Modifier_Set *binding_mod_set, Input_Modifier_Set *event_mod_set){
|
map_loose_match(Input_Modifier_Set *binding_mod_set, Input_Modifier_Set *event_mod_set){
|
||||||
i32 result = 0;
|
b32 result = true;
|
||||||
i32 binding_mod_count = binding_mod_set->count;
|
i32 binding_mod_count = binding_mod_set->count;
|
||||||
Key_Code *binding_mods = binding_mod_set->mods;
|
Key_Code *binding_mods = binding_mod_set->mods;
|
||||||
for (i32 i = 0; i < binding_mod_count; i += 1){
|
for (i32 i = 0; i < binding_mod_count; i += 1){
|
||||||
if (!has_modifier(event_mod_set, binding_mods[i])){
|
if (!has_modifier(event_mod_set, binding_mods[i])){
|
||||||
result = 0;
|
result = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
result += 1;
|
|
||||||
}
|
}
|
||||||
return(result);
|
return(result);
|
||||||
}
|
}
|
||||||
|
@ -299,22 +298,16 @@ map_get_binding_non_recursive(Command_Map *map, Input_Event *event, Binding_Matc
|
||||||
}break;
|
}break;
|
||||||
case BindingMatchRule_Loose:
|
case BindingMatchRule_Loose:
|
||||||
{
|
{
|
||||||
i32 best_match = 0;
|
|
||||||
for (SNode *node = list->first;
|
for (SNode *node = list->first;
|
||||||
node != 0;
|
node != 0;
|
||||||
node = node->next){
|
node = node->next){
|
||||||
Command_Modified_Binding *mod_binding = CastFromMember(Command_Modified_Binding, order_node, node);
|
Command_Modified_Binding *mod_binding = CastFromMember(Command_Modified_Binding, order_node, node);
|
||||||
Input_Modifier_Set *binding_mod_set = &mod_binding->mods;
|
Input_Modifier_Set *binding_mod_set = &mod_binding->mods;
|
||||||
i32 match = map_loose_match(binding_mod_set, breakdown.mod_set);
|
if (map_loose_match(binding_mod_set, breakdown.mod_set)){
|
||||||
if (match && match > best_match) {
|
|
||||||
printf("Upgrading Best Match\n");
|
|
||||||
best_match = match;
|
|
||||||
result = mod_binding->binding;
|
result = mod_binding->binding;
|
||||||
|
goto done;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (best_match != 0) {
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
}break;
|
}break;
|
||||||
}
|
}
|
||||||
done:;
|
done:;
|
||||||
|
|
Loading…
Reference in New Issue