From 199a77d1eac8b6c9fedfd209bfbd6685957d091c Mon Sep 17 00:00:00 2001 From: darkvater Date: Tue, 11 Jan 2005 00:54:06 +0000 Subject: (svn r1479) -Added highscore chart (accessible from the difficulty window) with top5 companies for a given difficulty (select the difficulty in the menu) -Added endgame score on 1 jan 2051 where you are added to the highscore if sufficiently large points have been accumulated. Game is paused while -These values are saved in hs.dat; added read/write functions for it -Added code to delete all windows to show charts. There is one issue left: somehow a news-gui pops up in front of the the chart at the end of the game. --- ttd.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'ttd.c') diff --git a/ttd.c b/ttd.c index d7b9a2614..24eb645fa 100644 --- a/ttd.c +++ b/ttd.c @@ -648,6 +648,7 @@ int ttd_main(int argc, char* argv[]) #endif LoadFromConfig(); + LoadFromHighScore(); // override config? if (musicdriver[0]) ttd_strlcpy(_ini_musicdriver, musicdriver, sizeof(_ini_musicdriver)); @@ -748,6 +749,7 @@ int ttd_main(int argc, char* argv[]) _sound_driver->stop(); SaveToConfig(); + SaveToHighScore(); // uninitialize airport state machines UnInitializeAirports(); @@ -1176,9 +1178,11 @@ void BeforeSaveGame() { Window *w = FindWindowById(WC_MAIN_WINDOW, 0); - _saved_scrollpos_x = WP(w,vp_d).scrollpos_x; - _saved_scrollpos_y = WP(w,vp_d).scrollpos_y; - _saved_scrollpos_zoom = w->viewport->zoom; + if (w != NULL) { + _saved_scrollpos_x = WP(w,vp_d).scrollpos_x; + _saved_scrollpos_y = WP(w,vp_d).scrollpos_y; + _saved_scrollpos_zoom = w->viewport->zoom; + } } void ConvertTownOwner() -- cgit v1.2.3-54-g00ecf