Skip to content

Commit

Permalink
Fixed lingering cursor in gradient point selector
Browse files Browse the repository at this point in the history
  • Loading branch information
kvance committed Jul 2, 2005
1 parent 70dfb51 commit 4573c7d
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 23 deletions.
11 changes: 5 additions & 6 deletions 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 0.5.1
----- -----
Windows installer defaults to running KevEdit in "My Documents" folder Windows installer defaults to running KevEdit in "My Documents" folder
Expand All @@ -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: 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: 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: 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 0.5.0
----- -----
Expand Down
4 changes: 0 additions & 4 deletions TODO
Expand Up @@ -9,9 +9,6 @@ Exploit ability of board to "link to self" using index FF
Add monitor & blink rays to terrain documentation Add monitor & blink rays to terrain documentation
Respond to exit event from SDL Respond to exit event from SDL
Option: shift+arrow draws like tab 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 Number boards in the board selector
Char dialog: Alpha keys select characters Char dialog: Alpha keys select characters
File dialog: Alpha keys move the cursor File dialog: Alpha keys move the cursor
Expand All @@ -27,7 +24,6 @@ For the 0.7 release:
-------------------- --------------------
Configurable keybindings Configurable keybindings
Configuration file Configuration file
UNIX, here we come!


If Ever: If Ever:
-------- --------
Expand Down
26 changes: 19 additions & 7 deletions src/display/display_sdl.c
@@ -1,5 +1,5 @@
/* display_sdl.c -- SDL Textmode Emulation display method for KevEdit /* 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 <exophase@earthlink.net> * Copyright (C) 2002 Gilead Kutnick <exophase@earthlink.net>
* Copyright (C) 2002 Kev Vance <kvance@kvance.com> * Copyright (C) 2002 Kev Vance <kvance@kvance.com>
* *
Expand Down Expand Up @@ -30,6 +30,14 @@
#include "display_sdl.h" #include "display_sdl.h"


int xstart, ystart; /* Where the viewport begins */ 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 *** *** BEGIN TEXTMODE EMULATION CODE ***
Expand Down Expand Up @@ -600,6 +608,14 @@ void display_gotoxy(video_info *vdest, Uint32 x, Uint32 y)
{ {
vdest->write_x = x; vdest->write_x = x;
vdest->write_y = y; 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) void display_redraw(video_info *vdest)
Expand Down Expand Up @@ -775,13 +791,9 @@ void display_update(video_info *vdest, int x, int y, int width, int height)
********************************/ ********************************/
video_info info; /* Display info */ video_info info; /* Display info */
static int shift; /* Shift state */ 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 */ static int fullscreen = 0; /* Initial fullscreen setting */


#define CURSOR_RATE 400

/* Nice timer update callback thing */ /* Nice timer update callback thing */
static Uint32 display_tick(Uint32 interval, void *blank) static Uint32 display_tick(Uint32 interval, void *blank)
{ {
Expand Down Expand Up @@ -1228,9 +1240,9 @@ int display_sdl_getch()


do { do {
/* Draw the cursor if necessary */ /* Draw the cursor if necessary */
if(timer) if(timer == 1)
display_update(&info, info.write_x, info.write_y, 1, 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); display_curse(info.write_x, info.write_y);


if (SDL_WaitEvent(NULL) == 0) if (SDL_WaitEvent(NULL) == 0)
Expand Down
4 changes: 2 additions & 2 deletions src/help/help.c
@@ -1,5 +1,5 @@
/* help.c -- hypertext help system /* 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 <bitman@users.sourceforge.net> * Copyright (C) 2001 Ryan Phillips <bitman@users.sourceforge.net>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -148,7 +148,7 @@ void help(displaymethod* d)


pushstring(&aboutdialog, str_dup("@About KevEdit")); pushstring(&aboutdialog, str_dup("@About KevEdit"));
pushstring(&aboutdialog, str_dup("$KevEdit Version " PACKAGE_VERSION)); 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")); pushstring(&aboutdialog, str_dup("Distribute under the terms of the GNU GPL"));
editbox("", &aboutdialog, 0, EDITBOX_ZOCMODE | EDITBOX_MOVEMENT, d); editbox("", &aboutdialog, 0, EDITBOX_ZOCMODE | EDITBOX_MOVEMENT, d);


Expand Down
13 changes: 9 additions & 4 deletions src/kevedit/misc.c
@@ -1,5 +1,5 @@
/* misc.c -- General routines for everyday KevEditing /* 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 <kvance@kvance.com> * Copyright (C) 2000 Kev Vance <kvance@kvance.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
Expand Down Expand Up @@ -841,8 +841,10 @@ int promptforselection(selection sel, gradline * grad, keveditor* myeditor)
mydisplay->cursorgo(myeditor->cursorx, myeditor->cursory); mydisplay->cursorgo(myeditor->cursorx, myeditor->cursory);
key = mydisplay->getch(); key = mydisplay->getch();


cursorspace(myeditor);
movebykeystroke(key, &(myeditor->cursorx), &(myeditor->cursory), movebykeystroke(key, &(myeditor->cursorx), &(myeditor->cursory),
0, 0, 59, 24, mydisplay); 0, 0, 59, 24, mydisplay);

if (key == DKEY_ESC) return 1; if (key == DKEY_ESC) return 1;
/* Check for flood selection */ /* Check for flood selection */
if (key == 'f' || key == 'F' || key == 'm') { if (key == 'f' || key == 'F' || key == 'm') {
Expand All @@ -855,14 +857,17 @@ int promptforselection(selection sel, gradline * grad, keveditor* myeditor)
} }
} while (key != DKEY_ENTER && key != ' '); } while (key != DKEY_ENTER && key != ' ');
grad->x1 = myeditor->cursorx; grad->y1 = myeditor->cursory; grad->x1 = myeditor->cursorx; grad->y1 = myeditor->cursory;
mydisplay->putch(myeditor->cursorx, myeditor->cursory, '+', 0x0F); mydisplay->putch(grad->x1, grad->y1, '+', 0x0F);


do { do {
mydisplay->cursorgo(myeditor->cursorx, myeditor->cursory); mydisplay->cursorgo(myeditor->cursorx, myeditor->cursory);
key = mydisplay->getch(); key = mydisplay->getch();


cursorspace(myeditor);
movebykeystroke(key, &(myeditor->cursorx), &(myeditor->cursory), 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; if (key == DKEY_ESC) return 1;
/* Check for flood selection */ /* Check for flood selection */
if (key == 'f' || key == 'F' || key == 'm') { if (key == 'f' || key == 'F' || key == 'm') {
Expand Down

0 comments on commit 4573c7d

Please sign in to comment.