fix(pty): use double, not float, for blink times

Changes blink_on_time and blink_off_time to use double rather than
float. When float was used, the default blink_off_time of 0.3 was being
converted to 0.30000001192093 in GDScript.
This commit is contained in:
Leroy Hopson 2024-03-03 13:53:55 +13:00
parent 481a1cb04a
commit cb86cc95d7
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
2 changed files with 11 additions and 11 deletions

View file

@ -84,7 +84,7 @@ Terminal::Terminal()
blink_off_time = 0.3;
bell_muted = false;
bell_cooldown = 0;
bell_cooldown = 0.1;
bell_timer = memnew(Timer);
bell_timer->set_one_shot(true);
add_child(bell_timer, false, INTERNAL_MODE_FRONT);
@ -607,24 +607,24 @@ double Terminal::get_bell_cooldown() const {
return bell_cooldown;
}
void Terminal::set_blink_on_time(const float time)
void Terminal::set_blink_on_time(const double time)
{
blink_on_time = time;
fore_material->set_shader_parameter("blink_on_time", blink_on_time);
}
float Terminal::get_blink_on_time() const
double Terminal::get_blink_on_time() const
{
return blink_on_time;
}
void Terminal::set_blink_off_time(const float time)
void Terminal::set_blink_off_time(const double time)
{
blink_off_time = time;
fore_material->set_shader_parameter("blink_off_time", blink_off_time);
}
float Terminal::get_blink_off_time() const
double Terminal::get_blink_off_time() const
{
return blink_off_time;
}

View file

@ -65,11 +65,11 @@ namespace godot
void set_bell_cooldown(const double p_bell_cooldown);
double get_bell_cooldown() const;
void set_blink_on_time(const float p_blink_on_time);
float get_blink_on_time() const;
void set_blink_on_time(const double p_blink_on_time);
double get_blink_on_time() const;
void set_blink_off_time(const float p_blink_off_time);
float get_blink_off_time() const;
void set_blink_off_time(const double p_blink_off_time);
double get_blink_off_time() const;
void set_inverse_mode(const int mode);
int get_inverse_mode() const;
@ -86,8 +86,8 @@ namespace godot
unsigned int cols;
unsigned int rows;
float blink_on_time;
float blink_off_time;
double blink_on_time;
double blink_off_time;
InverseMode inverse_mode;