summaryrefslogtreecommitdiff
path: root/gui/util.cc
blob: ee75e56d42d75fd9c241953afc9c316d2de1eebe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "util.h"

int cache_size_mapper(int total_levels, int level)
{
	const int y_min = 4;
	const int y_max = 12;
	double f, r;

	if (total_levels <= 1)
		return 8;

	f = level / total_levels;
	r = y_min + f * (y_max - y_min);

	return r;
}