Make credits less jumpy

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@320 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2000-11-25 18:21:37 +00:00
parent 25f4e58ff4
commit 8b4ca4a30b
1 changed files with 16 additions and 13 deletions

29
winio.c
View File

@ -1333,7 +1333,7 @@ void fix_editbot(void)
#define CREDIT_LEN 43 #define CREDIT_LEN 43
void do_credits(void) void do_credits(void)
{ {
int i, j = 0, place = 0, start_x; int i, j = 0, k, place = 0, start_x;
char *what; char *what;
char *nanotext = _("The nano text editor"); char *nanotext = _("The nano text editor");
@ -1388,29 +1388,32 @@ void do_credits(void)
nodelay(edit, TRUE); nodelay(edit, TRUE);
blank_bottombars(); blank_bottombars();
mvwaddstr(topwin, 0, 0, hblank); mvwaddstr(topwin, 0, 0, hblank);
blank_edit();
wrefresh(edit);
wrefresh(bottomwin); wrefresh(bottomwin);
wrefresh(topwin); wrefresh(topwin);
while (wgetch(edit) == ERR) { while (wgetch(edit) == ERR) {
blank_edit(); for (k = 0; k <= 1; k++) {
for (i = editwinrows / 2 - 1; i >= (editwinrows / 2 - 1 - j); i--) { blank_edit();
mvwaddstr(edit, i * 2, 0, hblank); for (i = editwinrows / 2 - 1; i >= (editwinrows / 2 - 1 - j); i--) {
mvwaddstr(edit, i * 2 - k, 0, hblank);
if (place - (editwinrows / 2 - 1 - i) < CREDIT_LEN) if (place - (editwinrows / 2 - 1 - i) < CREDIT_LEN)
what = credits[place - (editwinrows / 2 - 1 - i)]; what = credits[place - (editwinrows / 2 - 1 - i)];
else else
what = ""; what = "";
start_x = center_x - strlen(what) / 2 - 1; start_x = center_x - strlen(what) / 2 - 1;
mvwaddstr(edit, i * 2, start_x, what); mvwaddstr(edit, i * 2 - k, start_x, what);
}
usleep(700000);
wrefresh(edit);
} }
if (j < editwinrows / 2 - 1) if (j < editwinrows / 2 - 1)
j++; j++;
place++; place++;
wrefresh(edit);
sleep(1);
if (place >= CREDIT_LEN + editwinrows / 2) if (place >= CREDIT_LEN + editwinrows / 2)
break; break;