mirror of
https://github.com/KabKebab/GS13.git
synced 2026-03-31 00:21:02 +01:00
16 lines
1.1 KiB
Plaintext
16 lines
1.1 KiB
Plaintext
//The minimum for glide_size to be clamped to.
|
|
#define MIN_GLIDE_SIZE 1
|
|
//The maximum for glide_size to be clamped to.
|
|
//This shouldn't be higher than the icon size, and generally you shouldn't be changing this, but it's here just in case.
|
|
#define MAX_GLIDE_SIZE 32
|
|
|
|
// Originally a really stupid /tg/ var that sucked and was really bad and caused it to look horrible. Now it's a way of compensating for time dilation
|
|
GLOBAL_VAR_INIT(glide_size_multiplier, 1.0)
|
|
|
|
///Broken down, here's what this does:
|
|
/// divides the world icon_size (32) by delay divided by ticklag to get the number of pixels something should be moving each tick.
|
|
/// The division result is given a min value of 1 to prevent obscenely slow glide sizes from being set
|
|
/// Then that's multiplied by the global glide size multiplier. 1.25 by default feels pretty close to spot on. This is just to try to get byond to behave.
|
|
/// The whole result is then clamped to within the range above.
|
|
/// Not very readable but it works
|
|
#define DELAY_TO_GLIDE_SIZE(delay) (CLAMP(((32 / max((delay) / world.tick_lag, 1)) * GLOB.glide_size_multiplier), MIN_GLIDE_SIZE, MAX_GLIDE_SIZE)) |