Applied Paul's patch so the number of laps per track per grand prix can be specified in the *.cup files.

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/trunk/supertuxkart@1322 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
cosmosninja 2007-12-06 20:57:42 +00:00
parent 2c3e551ce6
commit 2cddd16d40
8 changed files with 17 additions and 4 deletions

View File

@ -3,6 +3,8 @@
(supertuxkart-cup
(name "All tracks")
(description "All 13 tracks included in SuperTuxKart")
(tracks "beach" "startrack" "lighthouse" "volcano" "gownsbow" "islandtrack" "bsodcastle" "geekopeak" "littlevolcano" "olivermath" "race" "subseatrack" "tuxtrack"))
(tracks "beach" "startrack" "lighthouse" "volcano" "gownsbow" "islandtrack" "bsodcastle" "geekopeak" "littlevolcano" "olivermath" "race" "subseatrack" "tuxtrack")
(laps 2 3 4 3 2 2 3 3 3 4 5 3 2)
)
;; EOF ;;

View File

@ -5,6 +5,7 @@
(description "All seven tracks done by the Game of the month team")
(herring "new")
(tracks "beach" "lighthouse" "startrack" "volcano" "littlevolcano" "race" "subseatrack" )
(laps 2 4 3 3 3 5 3)
)
;; EOF ;;

View File

@ -3,6 +3,8 @@
(supertuxkart-cup
(name "All Island Tracks")
(description "All three tracks on Islands")
(tracks "beach" "lighthouse" "islandtrack" ))
(tracks "beach" "lighthouse" "islandtrack" )
(laps 2 4 2)
)
;; EOF ;;

View File

@ -5,6 +5,7 @@
(description "The original five tracks included in TuxKart")
(herring "old")
(tracks "olivermath" "gownsbow" "bsodcastle" "geekopeak" "tuxtrack")
(laps 4 2 3 3 2)
)
;; EOF ;;

View File

@ -3,6 +3,8 @@
(supertuxkart-cup
(name "Volcano Tracks")
(description "All four tracks with Volcanos")
(tracks "volcano" "bsodcastle" "geekopeak" "littlevolcano" ))
(tracks "volcano" "bsodcastle" "geekopeak" "littlevolcano" )
(laps 3 3 3 3)
)
;; EOF ;;

View File

@ -44,6 +44,7 @@ CupData::CupData(const std::string filename_)
lisp->get ("description", m_description );
lisp->get ("herring", m_herring_style);
lisp->getVector("tracks", m_tracks );
lisp->getVector("laps", m_laps );
}
catch(std::exception& err)
{

View File

@ -39,6 +39,9 @@ class CupData
means the filename of the .track file without .track extension
(ie. 'volcano') */
std::vector<std::string> m_tracks;
/** The number of laps that each track should be raced, in the right
* order*/
std::vector<int> m_laps;
public:
@ -51,6 +54,7 @@ public:
const std::string& getFilename () const { return m_filename; }
const std::string& getTrack(size_t track_index) const { assert(track_index < m_tracks.size()); return m_tracks[track_index]; }
size_t getTrackCount() const { return m_tracks.size(); }
const int& getLaps(size_t lap_index) const { assert(lap_index < m_tracks.size()); return m_laps[lap_index]; }
}
; // CupData

View File

@ -96,7 +96,7 @@ GrandPrixMode::start_race(int n)
RaceSetup raceSetup;
raceSetup.m_mode = RaceSetup::RM_GRAND_PRIX;
raceSetup.m_difficulty = m_difficulty;
raceSetup.m_num_laps = 2;
raceSetup.m_num_laps = m_cup.getLaps(n);
raceSetup.m_track = m_cup.getTrack(n);
raceSetup.m_karts.resize(m_karts.size());
raceSetup.m_players.resize(m_players.size());