1
0
mirror of https://git.zap.org.au/git/trader.git synced 2024-07-21 16:14:14 -04:00

Move the initialisation of the game title into its own function

This commit is contained in:
John Zaitseff 2011-08-09 13:11:22 +10:00
parent 8a2bc51f28
commit 5f995f1d36

View File

@ -96,6 +96,17 @@ txwin_t *firstwin = NULL; // First (bottom-most) txwin structure
* Module-specific function prototypes *
************************************************************************/
/*
Function: init_title - Draw the main window title
Parameters: (none)
Returns: (nothing)
This function draws the main window game title, "Star Traders", and
clears the rest of the screen.
*/
static void init_title (void);
/*
Function: sigterm_handler - Handle program termination signals
Parameters: sig - Signal number
@ -254,18 +265,7 @@ void init_screen (void)
attr_error_waitforkey = A_REVERSE;
}
bkgd(attr_root_window);
clear();
move(0, 0);
for (int i = 0; i < COLS; i++) {
addch(attr_game_title | ' ');
}
center(stdscr, 0, attr_game_title, "Star Traders");
attrset(attr_root_window);
refresh();
init_title();
}
@ -287,6 +287,26 @@ void end_screen (void)
}
/***********************************************************************/
// init_title: Draw the main window title
void init_title (void)
{
bkgd(attr_root_window);
clear();
move(0, 0);
for (int i = 0; i < COLS; i++) {
addch(attr_game_title | ' ');
}
center(stdscr, 0, attr_game_title, "Star Traders");
attrset(attr_root_window);
refresh();
}
/***********************************************************************/
// sigterm_handler: Handle program termination signals