From 4573c7d32732179643fe1a30fa26b31f1b0a55be Mon Sep 17 00:00:00 2001 From: kvance Date: Sat, 2 Jul 2005 21:31:23 +0000 Subject: [PATCH] Fixed lingering cursor in gradient point selector --- ChangeLog | 11 +++++------ TODO | 4 ---- src/display/display_sdl.c | 26 +++++++++++++++++++------- src/help/help.c | 4 ++-- src/kevedit/misc.c | 13 +++++++++---- 5 files changed, 35 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index fe88bea..5680c80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,3 @@ -0.6.x ------ -Bug fixed: "#if flag !msg;text" is now parsed correctly. -Bug fixed: Messages and hypermessages now parsed correctly. -New text editor implementation with minor usage changes. - 0.5.1 ----- Windows installer defaults to running KevEdit in "My Documents" folder @@ -16,6 +10,11 @@ Bug fixed: params created for items on F3 menu Bug fixed: Stats editor panel updated after editing object code or passage dest Bug fixed: Reenter coordinates don't decrease every time a board is saved Bug fixed: Horizonal and vertical blink walls were reversed in F3 menu +Bug fixed: "#if flag !msg;text" is now parsed correctly. +Bug fixed: Messages and hypermessages now parsed correctly. +New text editor implementation with minor usage changes. +Usability issue: Cursor flicked on when it moves, and has a faster blink rate +Bug fixed: SDL cursor no longer "lingers" in gradient point selection 0.5.0 ----- diff --git a/TODO b/TODO index 8c38586..6adb662 100644 --- a/TODO +++ b/TODO @@ -9,9 +9,6 @@ Exploit ability of board to "link to self" using index FF Add monitor & blink rays to terrain documentation Respond to exit event from SDL Option: shift+arrow draws like tab -BUG: Inserting char 0 in the ZZT-OOP editor destroys the line. Bad! -BUG: syntax highlighting: "#if flag !msg;text" displays incorrectly - Number boards in the board selector Char dialog: Alpha keys select characters File dialog: Alpha keys move the cursor @@ -27,7 +24,6 @@ For the 0.7 release: -------------------- Configurable keybindings Configuration file -UNIX, here we come! If Ever: -------- diff --git a/src/display/display_sdl.c b/src/display/display_sdl.c index 92d6a4c..b761e8c 100644 --- a/src/display/display_sdl.c +++ b/src/display/display_sdl.c @@ -1,5 +1,5 @@ /* display_sdl.c -- SDL Textmode Emulation display method for KevEdit - * $Id: display_sdl.c,v 1.4 2005/06/29 03:20:34 kvance Exp $ + * $Id: display_sdl.c,v 1.5 2005/07/02 21:31:30 kvance Exp $ * Copyright (C) 2002 Gilead Kutnick * Copyright (C) 2002 Kev Vance * @@ -30,6 +30,14 @@ #include "display_sdl.h" int xstart, ystart; /* Where the viewport begins */ +static SDL_TimerID timerId; /* Timer ID */ +static int timer, csoc; /* Timer for cursor, current state of cursor */ + +/* Forward defines :( */ +static Uint32 display_tick(Uint32 interval, void *blank); +void display_curse(int x, int y); + +#define CURSOR_RATE 200 /************************************* *** BEGIN TEXTMODE EMULATION CODE *** @@ -600,6 +608,14 @@ void display_gotoxy(video_info *vdest, Uint32 x, Uint32 y) { vdest->write_x = x; vdest->write_y = y; + + /* Here's a nice usability fix. When we reposition the cursor, make + * it visible and reset the timer. */ + SDL_RemoveTimer(timerId); + timerId = SDL_AddTimer(CURSOR_RATE, display_tick, NULL); + if(timer != 2) + timer = 0; + display_curse(x, y); } void display_redraw(video_info *vdest) @@ -775,13 +791,9 @@ void display_update(video_info *vdest, int x, int y, int width, int height) ********************************/ video_info info; /* Display info */ static int shift; /* Shift state */ -static int timer, csoc; /* Timer for cursor, current state of cursor */ -static SDL_TimerID timerId; /* Timer ID */ static int fullscreen = 0; /* Initial fullscreen setting */ -#define CURSOR_RATE 400 - /* Nice timer update callback thing */ static Uint32 display_tick(Uint32 interval, void *blank) { @@ -1228,9 +1240,9 @@ int display_sdl_getch() do { /* Draw the cursor if necessary */ - if(timer) + if(timer == 1) display_update(&info, info.write_x, info.write_y, 1, 1); - else + else if(timer == 0) display_curse(info.write_x, info.write_y); if (SDL_WaitEvent(NULL) == 0) diff --git a/src/help/help.c b/src/help/help.c index ac6e3b2..f0a5a7f 100644 --- a/src/help/help.c +++ b/src/help/help.c @@ -1,5 +1,5 @@ /* help.c -- hypertext help system - * $Id: help.c,v 1.2 2005/05/28 03:17:45 bitman Exp $ + * $Id: help.c,v 1.3 2005/07/02 21:31:30 kvance Exp $ * Copyright (C) 2001 Ryan Phillips * * This program is free software; you can redistribute it and/or modify @@ -148,7 +148,7 @@ void help(displaymethod* d) pushstring(&aboutdialog, str_dup("@About KevEdit")); pushstring(&aboutdialog, str_dup("$KevEdit Version " PACKAGE_VERSION)); - pushstring(&aboutdialog, str_dup("Copyright (C) 2000-2001 Kev Vance, et al.")); + pushstring(&aboutdialog, str_dup("Copyright (C) 2000-2005 Kev Vance, et al.")); pushstring(&aboutdialog, str_dup("Distribute under the terms of the GNU GPL")); editbox("", &aboutdialog, 0, EDITBOX_ZOCMODE | EDITBOX_MOVEMENT, d); diff --git a/src/kevedit/misc.c b/src/kevedit/misc.c index d036110..d01f0b8 100644 --- a/src/kevedit/misc.c +++ b/src/kevedit/misc.c @@ -1,5 +1,5 @@ /* misc.c -- General routines for everyday KevEditing - * $Id: misc.c,v 1.5 2005/06/29 03:20:34 kvance Exp $ + * $Id: misc.c,v 1.6 2005/07/02 21:31:30 kvance Exp $ * Copyright (C) 2000 Kev Vance * * This program is free software; you can redistribute it and/or modify @@ -841,8 +841,10 @@ int promptforselection(selection sel, gradline * grad, keveditor* myeditor) mydisplay->cursorgo(myeditor->cursorx, myeditor->cursory); key = mydisplay->getch(); + cursorspace(myeditor); movebykeystroke(key, &(myeditor->cursorx), &(myeditor->cursory), - 0, 0, 59, 24, mydisplay); + 0, 0, 59, 24, mydisplay); + if (key == DKEY_ESC) return 1; /* Check for flood selection */ if (key == 'f' || key == 'F' || key == 'm') { @@ -855,14 +857,17 @@ int promptforselection(selection sel, gradline * grad, keveditor* myeditor) } } while (key != DKEY_ENTER && key != ' '); grad->x1 = myeditor->cursorx; grad->y1 = myeditor->cursory; - mydisplay->putch(myeditor->cursorx, myeditor->cursory, '+', 0x0F); + mydisplay->putch(grad->x1, grad->y1, '+', 0x0F); do { mydisplay->cursorgo(myeditor->cursorx, myeditor->cursory); key = mydisplay->getch(); + cursorspace(myeditor); movebykeystroke(key, &(myeditor->cursorx), &(myeditor->cursory), - 0, 0, 59, 24, mydisplay); + 0, 0, 59, 24, mydisplay); + mydisplay->putch(grad->x1, grad->y1, '+', 0x0F); + if (key == DKEY_ESC) return 1; /* Check for flood selection */ if (key == 'f' || key == 'F' || key == 'm') {