00001
00002
00003
00004 #include <OVGA.H>
00005 #include <OVGALOCK.H>
00006 #include <ODATE.H>
00007 #include <OSTR.H>
00008 #include <OSYS.H>
00009 #include <OFONT.H>
00010 #include <OMOUSE.H>
00011 #include <OIMGRES.H>
00012 #include <OGAME.H>
00013 #include <OGFILE.H>
00014
00015
00018
00019 void GameFileArray::disp_hall_of_fame()
00020 {
00021 vga.disp_image_file("HALLFAME");
00022
00023
00024
00025 int i;
00026 int x=120, y=116;
00027
00028 for( i=0 ; i<HALL_FAME_NUM ; i++, y+=76 )
00029 {
00030 hall_fame_array[i].disp_info( x, y, i+1 );
00031 }
00032
00033 mouse.wait_press(60);
00034
00035 vga.finish_disp_image_file();
00036 }
00037 */
00038
00039
00040
00047
00048 if( !start_year )
00049 return;
00050
00051
00052
00053
00054
00055
00056
00057
00058 Font* fontPtr;
00059
00060 #if( defined(GERMAN) || defined(FRENCH) || defined(SPANISH) )
00061 fontPtr = &font_hall;
00062 #else
00063 fontPtr = &font_std;
00064 #endif
00065
00066 String str;
00067 int y2 = y+17;
00068
00069
00070
00071 str = pos;
00072 str += ".";
00073
00074 fontPtr->put( x, y, str );
00075
00076 x += 16;
00077
00078
00079
00080 str = translate.process("King ");
00081 str += player_first_name;
00082 str += player_last_name;
00083
00084 fontPtr->put( x, y, str );
00085
00086
00087
00088 str = translate.process("Score : ");
00089 str += score;
00090
00091 fontPtr->put( x, y2, str );
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102 #if( defined(GERMAN) || defined(FRENCH) || defined(SPANISH) )
00103 x-=10;
00104 #endif
00105
00106 str = translate.process("Period : ");
00107 str += m.num_to_str(start_year);
00108 str += "-";
00109 str += m.num_to_str(end_year);
00110
00111 fontPtr->put( x+260, y2, str );
00112
00113
00114
00115
00116
00117
00118 fontPtr->put( x+420, y2, str );
00119 }
00120
00121
00122
00123
00127
00128
00129 strncpy( school_name, player_school.school_name, PlayerSchool::SCHOOL_NAME_LEN);
00130 school_name[PlayerSchool::SCHOOL_NAME_LEN] = NULL;
00131
00132 strncpy( player_first_name, player_school.player_first_name, PlayerSchool::FIRST_NAME_LEN );
00133 player_first_name[PlayerSchool::FIRST_NAME_LEN] = NULL;
00134
00135 strncpy( player_last_name, player_school.player_last_name, PlayerSchool::LAST_NAME_LEN );
00136 player_last_name[PlayerSchool::LAST_NAME_LEN] = NULL;
00137
00138 start_year = date.year(info.game_start_date);
00139 end_year = info.game_year;
00140
00141 score = totalScore;
00142 trust_score = (int) player_school.cur_game_score;
00143
00144 scenario_id = player_school.scenario_id;
00145 }
00146
00147
00148
00149
00160
00161
00162
00163 if (totalScore <=0)
00164 return 0;
00165
00166
00167 if( !has_read_hall_of_fame ) {
00168 read_hall_of_fame();
00169 has_read_hall_of_fame = 1;
00170 }
00171
00172 int i;
00173
00174 for( i=0 ; i<HALL_FAME_NUM ; i++ ) {
00175 if( totalScore > hall_fame_array[i].score ) {
00176
00177
00178 if( i < HALL_FAME_NUM-1 ) {
00179 memmove( hall_fame_array+i+1, hall_fame_array+i,
00180 sizeof(HallFame) * (HALL_FAME_NUM-i-1) );
00181 }
00182
00183
00184
00185 hall_fame_array[i].record_data(totalScore);
00186
00187
00188
00189 write_hall_of_fame();
00190
00191 err_when(hall_fame_array[i].scenario_id != player_school.scenario_id );
00192 game.hall_of_fame();
00193 return 1;
00194 }
00195 }
00196
00197 return 0;
00198 }
00199
00200