

CRenderTools::CalcScreenParams the correct function, and WMax/32 and HMax32 are the amounts of tiles horizontally/vertically?Amount supposed to be and what is f with that weird calculation

CRenderTools::CalcScreenParams the correct function, and WMax/32 and HMax32 are the amounts of tiles horizontally/vertically? Amount at the very last step, even if it breaks math.
But we want to transform into a different resolution anyway.. in the resolution of Amount:
x * y = x * y | / y
(x * y) / y = x | * x
(x * y) * (x / y) = x^2 | sqrt
sqrt(x * y) * sqrt(x / y) = x
At this point it's clear where our journey ends xd
x / y is the Aspect ratio.. The function takes the Aspect ratio as parameter
so our new x is:
x = sqrt(Amount) * sqrt(AspectRatio)
and y is
y = sqrt(Amount) / sqrt(AspectRatio)
now look at the original formular
float f = sqrtf(Amount) / sqrtf(Aspect);
*w = f * Aspect;
*h = f;
its the exact same. f is basically = y
and we go from y to x by multipling AspectRatio
And AspectRatio / sqrt(AspectRatio) = sqrt(AspectRatio)
You can think about this geometrically too, but I cannot explain it.
Draw it on your paper or watch some videos about geometrical mean of sqrt.
About WMax and HMax. Basically disallow zooming.
And yes / 32 is to get the tile count at normal zoom

Ratio
It is the Ratio between the two sides






















class instead of struct (https://github.com/ddnet/ddnet/issues/5297#issuecomment-1144250491).
nullptr instead of 0.
nullptr to GetItem when output value is unused.
map_diff tool.























struct and class are identical except for the default visibility.
Should we use structs specifically to identify POD types and classes for everything else? Or just use classes for everything?
In any case, we agree that struct/class names will use the prefixes S/C.
@Chairn in https://github.com/ddnet/ddnet/issues/5337#issuecomment-1146625826
@heinrich5991 in https://github.com/ddnet/ddnet/issues/5297#...


c++
std::atomic<uint64_t> *m_pTextureMemoryUsage; (edited)c++
std::atomic<uint64_t*> m_pTextureMemoryUsage; (edited)







c++
std::atomic<ILogger *> m_pLogger;

std::atomic variables







1505fbe Move/rename variable declarations in map_optimize tool - Robyt3
3003608 Move/rename variable declarations in map_resave tool - Robyt3
de3bb1c Move/rename variable declarations in map_replace_image tool - Robyt3
d984872 Move/rename variable declarations in map_diff tool, add checks - Robyt3
4bc1aee Move/rename variable declarations in map_convert_07 tool - Robyt3
fbfbc78 Move/rename variable declarations in map_extract tool - Robyt3
1f51e6e Fix variable name in dummy_map tool, add storage check - Robyt3
081881e Move variable declaration in dilate tool - Robyt3
e8bd268 Move/rename variable declarations in config_retrieve - Robyt3
8258eff Move/rename variable declarations in config_store - Robyt3
7fa3bb0 Rename variables and use class in config_common.h - Robyt3
fda98a3 Rename variables and use class in crapnet tool - Robyt3
5435932 Merge #5337 - bors[bot]

