#include "game_types.h"

/* Level_GetIndexFromValue @ 0x08004574 (real 38B) -- maps a score to a level index 0-12 via threshold table. Mirrors src/matched/Level_GetIndexFromValue.c. */
/* Walks the 12-entry threshold table at 0x08027ED8; returns the first index
   whose threshold exceeds v, or 12 when v passes them all. */
int Level_GetIndexFromValue(int v)
{
    int *tab = (int *)0x08027ED8;
    int i = 0;
    while (i <= 11) {
        if (v < tab[i])
            return i;
        i++;
    }
    return 12;
}
