Add support for two different inverse modes

- Inverse mode invert (default) will invert the color in shader.
- Inverse mode swap will simply swap the foreground and background
  colors. This is the default behavior of libtsm and GodotXterm v3.
This commit is contained in:
Leroy Hopson 2024-02-07 23:03:11 +13:00
parent 930f3ef352
commit 8c30bec861
No known key found for this signature in database
GPG key ID: D2747312A6DB51AA
3 changed files with 41 additions and 1 deletions

View file

@ -34,6 +34,11 @@ namespace godot
BLINK = 1 << 1,
};
enum InverseMode {
INVERSE_MODE_INVERT,
INVERSE_MODE_SWAP,
};
Terminal();
~Terminal();
@ -52,6 +57,9 @@ namespace godot
void set_blink_off_time(const float p_blink_off_time);
float get_blink_off_time() const;
void set_inverse_mode(const int mode);
int get_inverse_mode() const;
void write(Variant data);
protected:
@ -66,6 +74,8 @@ namespace godot
float blink_on_time;
float blink_off_time;
InverseMode inverse_mode;
RenderingServer *rs;
tsm_screen *screen;
@ -118,3 +128,5 @@ namespace godot
};
} // namespace godot
VARIANT_ENUM_CAST(Terminal::InverseMode);