Skip to content

Commit 74261ba

Browse files
WIP: added todo
1 parent 0dcaffd commit 74261ba

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/axisfilter/response_curve_axis_filter.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/*
22
** Xbox360 USB Gamepad Userspace Driver
33
** Copyright (C) 2011 Ingo Ruhnke <grumbel@gmail.com>
4+
** Copyright (C) 2026 LunarEclipse <luna@lunareclipse.zone>
45
**
56
** This program is free software: you can redistribute it and/or modify
67
** it under the terms of the GNU General Public License as published by
@@ -49,6 +50,9 @@ int ResponseCurveAxisFilter::filter(int value, int min, int max) {
4950
int value_norm = (value - min);
5051
int max_norm = (max - min);
5152

53+
54+
// TODO: handle situation where following assumption is not upheld:
55+
// (max - min) <= (m_samples.size() - 1) <=> max_norm <= bucket_count
5256
int bucket_size = max_norm / bucket_count;
5357
int bucket_index = std::min(value_norm / bucket_size, bucket_count - 1);
5458
int bucket_start = bucket_index * bucket_size;

0 commit comments

Comments
 (0)