Commit graph

131 commits

Author SHA1 Message Date
Leroy Hopson
14288352fd
fix(term): address clang warnings 2024-02-25 20:53:09 +13:00
Leroy Hopson
05b19c1336
feat(term): implement "key_pressed" signal
Also adds tests for write response as code relating to this was
modified.
2024-02-25 20:25:32 +13:00
Leroy Hopson
c36500615d
feat(pty): further pty development 2024-02-25 17:55:31 +13:00
Leroy Hopson
1514f42b54
feat(pty): add initial pty node 2024-02-25 11:48:47 +13:00
Leroy Hopson
4771a3c9a7
Fix rendering according to test 2024-02-18 20:31:08 +13:00
Leroy Hopson
6d112ca0f2
Add method get_cell_size() 2024-02-18 20:24:31 +13:00
Leroy Hopson
685884965e
Fix bell behaviour according to tests 2024-02-18 20:24:27 +13:00
Leroy Hopson
dc97c56b17
Use type Vector2i for get_cursor_pos()
Cursor position is always integer.
2024-02-18 14:06:30 +13:00
Leroy Hopson
0ccc539f36
Prevent creation of orphan Timer 2024-02-18 14:06:30 +13:00
Leroy Hopson
2b5ea392bf
Free fore_canvas_item
Frees fore_canvas_item in cleanup, preventing RID allocation leak.
2024-02-18 14:06:30 +13:00
Leroy Hopson
e234b14867
Only register/remove Terminal once 2024-02-18 12:50:21 +13:00
Leroy Hopson
3bed9e7b0f
Add scroll support 2024-02-15 18:54:20 +13:00
Leroy Hopson
d59a925ca1
Add selection support 2024-02-15 07:27:51 +13:00
Leroy Hopson
3fcaa79f6e
Add support for key input 2024-02-15 06:53:53 +13:00
Leroy Hopson
580760ffad
Move other constants to constants file 2024-02-14 20:00:13 +13:00
Leroy Hopson
0a1ba5abcd
Add KEY_MAP constant 2024-02-14 19:46:29 +13:00
Leroy Hopson
420c774a43
Re-enable native builds 2024-02-13 20:34:47 +13:00
Leroy Hopson
002e7aacc7
Auto-format files using new pre-commit config 2024-02-13 10:52:22 +13:00
Leroy Hopson
58f4f8f216
Initialize background image to background color 2024-02-10 22:51:11 +13:00
Leroy Hopson
b8431e4a93
Always erase previous cell
Even if we are not drawing a new character in the cell, we should erase
the old one.
2024-02-10 22:49:47 +13:00
Leroy Hopson
8e5fbe72cd
Support background and attributes for wide chars
Supports setting background color and attributes for wide characters
(i.e. more than 1 cell wide). Previously only the first cell had its
background and attribute set.
2024-02-10 22:49:10 +13:00
Leroy Hopson
fd2c33c486
Re-add bell support 2024-02-10 22:03:43 +13:00
Leroy Hopson
07687e2cd8
Return terminal responses from write method
Updates the `write()` method to return a String containing any responses
from the terminal. For example, these could be responses to a cursor
position request such as "\u001b[6n".
2024-02-10 21:10:54 +13:00
Leroy Hopson
9fde38045a
Support rendering of more than just ASCII characters 2024-02-10 21:08:34 +13:00
Leroy Hopson
3f24fa9bf0
Handle multiple font styles
Adds support for font styles other than normal, such as bold, italics,
and bold italics.
2024-02-10 17:15:44 +13:00
Leroy Hopson
fb3fb6855c
Make intentionality of switch fallthrough clear 2024-02-10 16:36:48 +13:00
Leroy Hopson
6b1c9d818a
Rename enum AttrFlags -> AttrFlag 2024-02-10 15:53:03 +13:00
Leroy Hopson
f4c80e6201
Use custom libtsm version sans problematic commit
Use updated custom version of libtsm without commit which causes strange
behavior when rezining the Terminal control node.
2024-02-10 00:51:15 +13:00
Leroy Hopson
575c3875b6
Implement get_cursor_pos() 2024-02-07 23:14:52 +13:00
Leroy Hopson
8c30bec861
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.
2024-02-07 23:03:11 +13:00
Leroy Hopson
930f3ef352
Expose blink_on_time and blink_off_time properties 2024-02-07 22:26:45 +13:00
Leroy Hopson
8b320622f9
Use shader include for fore/background shaders
The two shaders use a lot of common logic for co-ordinate and attribute
look up, so it makes sense to use a common include shader for both.

Adds support for the inverse and blink attributes to the foreground shader.
2024-02-07 21:59:01 +13:00
Leroy Hopson
a849423096
Rewrite terminal.cpp
Rewrites the Terminal class as a GDExtension to be used directly in
Godot without a terminal.gd proxy.

Breaks a lot of things in its current state (e.g. signals and other
functions have not be implemented yet), but does add support for
transparent colors and true color inversion. It also seems to
be about 4x faster (FPS-wise) than the old version with some basic
stress testing.

Old source code has been moved to a different directory to be copied
over and/or rewritten piece by piece.
2024-02-07 00:14:33 +13:00
Leroy Hopson
7d2e22530e
Update libtsm 2024-02-06 23:56:21 +13:00
Leroy Hopson
f694544834
Remove unused code 2024-01-07 11:07:20 +13:00
Leroy Hopson
33ca5b3af7
Change build options
- Removes --disable-pty build option.
- Sets debug_symbols="yes" when build target is debug.
2024-01-07 11:06:26 +13:00
Leroy Hopson
b18726eac9
Pin nixpkgs version 2024-01-06 23:22:39 +13:00
Leroy Hopson
fac6361898
Upgrade min compatible Godot version to 4.2.1 2024-01-06 23:22:34 +13:00
Leroy Hopson
11ed797005
Update godot-cpp to match Godot v4.0-rc1 API
Usage of VARIANT_ENUM_CAST has changed.
2023-02-12 10:53:34 +13:00
Leroy Hopson
f36f1db315
Allow SCONS_CACHE env var in pure nix environment 2023-02-12 10:53:34 +13:00
Leroy Hopson
2ba480b4da
Update build files and GitHub Actions workflow 2023-01-26 08:21:43 +13:00
Leroy Hopson
9f269aec8c
Make update_modue a dropdown in editor inspector
Closes #61.
2023-01-21 11:03:22 +13:00
Leroy Hopson
9c7c5e1c17
Reorder methods 2023-01-21 10:37:26 +13:00
Leroy Hopson
754a20b1c3
Remove unused include 2023-01-21 10:18:26 +13:00
Leroy Hopson
dee6d537c0
Update godot-cpp for Godot v4.0-beta12 2023-01-14 22:38:17 +13:00
Leroy Hopson
8d56b5659a
Re-enable building of godot-cpp dependency 2023-01-14 22:35:30 +13:00
Leroy Hopson
ad7f97e493
Further progress towards Godot 4.0 support
- Primary example scenes (menu, terminal, and asciicast) working but
  still a lot of warning/error messages and some regressions.
- Editor integrated terminal works, but still a lot of warning/error
  messages and some regressions.
- Added support for "blink" display attribute.
- Removed GDScript terminal code. Terminal node is now purely a
  GDExtension. So is LibuvUtils.
- GUT tests not working yet.
- Still a lot of things to fix.
- So far, only built for and manually tested on Linux x86_64.
2023-01-08 22:45:18 +13:00
Leroy Hopson
44f7e3801c
Convert from GDNative to GDExtension
Work in progress.
2022-12-29 22:54:38 +13:00
Leroy Hopson
9435502c8d
Statically link libstdc++
Otherwise binaries build on GitHub Actions fail to load on NixOS as
dynamically linked libstdc++ cannot be found.
2022-08-27 20:45:41 +12:00
Leroy Hopson
10b9764fb3
Use default export templates for HTML5
Changes Emscripten SDK version to match that used to compile the default export
templates used by Godot 3.5 (in this case 3.1.14 as can be seen here:
https://github.com/godotengine/build-containers/blob/3.5/Dockerfile.javascript).

This means we no longer need to compile custom export templates when
exporting HTML5 for Godot 3.5. Exports from other Godot versions may
requiring compiling the GDNative library with a different version of the
Emscripten SDK.

- Changes renderer from GLES3 -> GLES2 and reduces MSAA level to better
  support HTML5 export.
- Updates GitHub Action to export HTML5 and upload as a build artifact.
- Adds Cypress test to smoke test HTML5 export.
2022-08-27 10:32:22 +12:00