fixed a glitch in the prog8/vtui example (#117)

When the program starts, before the screen is modified, save_rec
is called to capture the cx16 logo.

The fix was to not do the second call to save_rec until after
vtui is used to draw the boxes on the screen.

Before the this fix, the initial replacement issue was of the
logo and not the portion of the screen originally modified by
vtui.
This commit is contained in:
OODLER 2023-12-20 16:49:47 -06:00 committed by GitHub
parent 66d939df0d
commit e7698686fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,13 +8,16 @@
main {
sub start() {
vtui.initialize()
store_logo()
store_logo() ; capture logo before boxes are drawn
txt.lowercase()
vtui.screen_set(0)
vtui.clr_scr('%', $50)
vtui.gotoxy(5,5)
vtui.fill_box(':', 70, 50, $c6)
store_where_logo_was() ; after vtui draws boxes, initialize replacement screen values as logo moves
vtui.gotoxy(10,10)
vtui.border(1, 40, 6, $47)
vtui.gotoxy(12,12)
@ -45,6 +48,9 @@ main {
sub store_logo() {
vtui.gotoxy(0, 0)
vtui.save_rect($80, 1, $0000, 7, 7)
}
sub store_where_logo_was() {
vtui.gotoxy(0, 0)
vtui.save_rect($80, 1, $0100, 7, 7)
}