From: Ricardo Cruz Date: Sun, 25 Apr 2004 15:21:06 +0000 (+0000) Subject: Turned the display_credits() function more flexible by getting the file to open. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=a9fd82bb29698d0d24563e846e1c4fe0e78bfba4;p=supertux.git Turned the display_credits() function more flexible by getting the file to open. Ingo, what do you think if we used this for the intro text? SVN-Revision: 707 --- diff --git a/src/title.cpp b/src/title.cpp index 878f12210..c4195948f 100644 --- a/src/title.cpp +++ b/src/title.cpp @@ -62,7 +62,7 @@ static int frame; static unsigned int last_update_time; static unsigned int update_time; -void display_credits(); +void display_text_file(char *filename); std::vector contrib_subsets; std::string current_contrib_subset; @@ -311,7 +311,7 @@ void title(void) Menu::set_current(main_menu); break; case MNID_CREDITS: - display_credits(); + display_text_file("CREDITS"); Menu::set_current(main_menu); break; case MNID_QUITMAINMENU: @@ -367,7 +367,7 @@ void title(void) #define SCROLL 60 #define ITEMS_SPACE 4 -void display_credits() +void display_text_file(char *file) { int done; int scroll, speed; @@ -379,7 +379,7 @@ void display_credits() string_list_type names; char filename[1024]; string_list_init(&names); - sprintf(filename,"%s/CREDITS", datadir.c_str()); + sprintf(filename,"%s/%s", datadir.c_str(), file); if((fi = fopen(filename,"r")) != NULL) { while(fgets(temp, sizeof(temp), fi) != NULL)