diff options
author | Simon Howard | 2008-11-28 22:54:33 +0000 |
---|---|---|
committer | Simon Howard | 2008-11-28 22:54:33 +0000 |
commit | f062903b4a2559ac530d477921b410cadf1488f7 (patch) | |
tree | dc58ff17571af9e2a2908add9025474ef1ed9e0d /src | |
parent | 38f09a6c92e918c91e57998ea59d8d21d4fd4404 (diff) | |
download | chocolate-doom-f062903b4a2559ac530d477921b410cadf1488f7.tar.gz chocolate-doom-f062903b4a2559ac530d477921b410cadf1488f7.tar.bz2 chocolate-doom-f062903b4a2559ac530d477921b410cadf1488f7.zip |
Add function to get the number of episodes.
Subversion-branch: /branches/raven-branch
Subversion-revision: 1392
Diffstat (limited to 'src')
-rw-r--r-- | src/d_mode.c | 23 | ||||
-rw-r--r-- | src/d_mode.h | 5 | ||||
-rw-r--r-- | src/setup-res.rc.in | 2 |
3 files changed, 25 insertions, 5 deletions
diff --git a/src/d_mode.c b/src/d_mode.c index 435ce8d5..70704438 100644 --- a/src/d_mode.c +++ b/src/d_mode.c @@ -18,9 +18,12 @@ // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA // 02111-1307, USA. // -// Common code shared between the client and server +//----------------------------------------------------------------------------- +// +// DESCRIPTION: +// Functions and definitions relating to the game type and operational +// mode. // - #include "doomtype.h" #include "d_mode.h" @@ -100,6 +103,22 @@ boolean D_ValidEpisodeMap(GameMission_t mission, GameMode_t mode, return false; } +// Get the number of valid episodes for the specified mission/mode. + +int D_GetNumEpisodes(GameMission_t mission, GameMode_t mode) +{ + int episode; + + episode = 1; + + while (D_ValidEpisodeMap(mission, mode, episode, 1)) + { + ++episode; + } + + return episode - 1; +} + // Table of valid versions static struct { diff --git a/src/d_mode.h b/src/d_mode.h index 360ac2c1..305d4dd6 100644 --- a/src/d_mode.h +++ b/src/d_mode.h @@ -20,8 +20,8 @@ // 02111-1307, USA. // // DESCRIPTION: -// Internally used data structures for virtually everything, -// lots of other stuff. +// Functions and definitions relating to the game type and operational +// mode. // //----------------------------------------------------------------------------- @@ -87,6 +87,7 @@ boolean D_ValidGameMode(GameMission_t mission, GameMode_t mode); boolean D_ValidGameVersion(GameMission_t mission, GameVersion_t version); boolean D_ValidEpisodeMap(GameMission_t mission, GameMode_t mode, int episode, int map); +int D_GetNumEpisodes(GameMission_t mission, GameMode_t mode); #endif /* #ifndef __D_MODE__ */ diff --git a/src/setup-res.rc.in b/src/setup-res.rc.in index dc25135a..0b714122 100644 --- a/src/setup-res.rc.in +++ b/src/setup-res.rc.in @@ -1,6 +1,6 @@ 1 ICON "../data/setup.ico" -CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "setup-manifest.xml" +CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "setup/setup-manifest.xml" 1 VERSIONINFO PRODUCTVERSION @WINDOWS_RC_VERSION@ |