Open Hakaisha opened 3 years ago
interesting topic. and i see it should be easy to fix because in config.cpp line 9 the precision is set to static const int g_floatPrecision = 10;
I'm just wondering if there was or is a specific reason why the original devs felt the need for 10 digit floating point numbers. especially since adjust coverflow menu only changes things to the hundredths position.
I will change it in near future commit.
so i checked things a little today. seems g_floatPrecision includes the digits before the period and the ones after. which means we need to set it to 5 ie. 100.11. but this will also show 1.1111.
so now i need to decide if this is better and ok or if i need to create some mathematical formula to convert the number to the hundreths position before saving it in the ini.
I've used pow to truncate to x decimal places in C
https://www.geeksforgeeks.org/g-fact-41-setting-decimal-precision-in-c/
I tried fixing/changing this but didn't have much luck. i got weird results with my changes. maybe with more free time i could spend a few days changing this but not enough free time lately. so don't expect this to change any time soon or maybe at all. it seems fine the way it is and if it ain't broke don't fix it. it might save some memory space but i don't think a very significant amount.
Basic Explanation:
When a user modifies CoverFlow using Adjust CoverFlow, a simple 'X.XX' value selected in the interface is usually written as 'X.XXXXXXXXX' or 'X.XXXXXXXXXX' in the coverflow.ini file.
Examples:
'2.05' becomes '2.049999237' '3.65' becomes '3.649997711' '0.95' becomes '0.9500007033' '7.45' becomes '7.450580597e-09'
Detailed Explanation:
A simple 2-digit value becomes a much larger 9 or 10-digit value. The produced decimal number is usually rounded slightly below or above the desired value, with very much filler. Whole numbers are not affected by this issue, only numbers with decimal values.
Interestingly, you can manually clean these large numbers up in Notepad++ to only be 'X.XX', and WiiFlow will still correctly display the desired CoverFlow values with no issue.
Considering WiiFlow has no issue utilizing these modified shorter values, it occurs to me that it is unnecessary for Adjust CoverFlow to write these exagerrated decimal values to coverflow.ini.
The benefit of remedying this issue should ultimately result in a much lighter and optimized coverflow.ini file, by subtracting 7-8 digits from every decimal value.
Of course, it's not merely as simple as deleting the excess numbers. The decimal value has to be rounded up or down to the nearest 2-digit value. For example, '3.699997663' could not be shortened to '3.69', but should be rounded up to '3.70'.