summaryrefslogtreecommitdiffstats
path: root/game/code/supersprint/supersprintdata.h
blob: dc7e25b3f50da3f9b151371088af239d8d8bd5d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
//=============================================================================
// Copyright (C) 2002 Radical Entertainment Ltd.  All rights reserved.
//
// File:        supersprintdata.h
//
// Description: Blahblahblah
//
// History:     2/8/2003 + Created -- Cary Brisebois
//
//=============================================================================

#ifndef SUPERSPRINTDATA_H
#define SUPERSPRINTDATA_H

//========================================
// Nested Includes
//========================================
#include <constants/maxplayers.h>

#include <p3d/p3dtypes.hpp>

//========================================
// Forward References
//========================================

class Vehicle;
class WaypointAI;

//=============================================================================
//
// Synopsis:    Blahblahblah
//
//=============================================================================

namespace SuperSprintData
{
    enum 
    {
#ifdef RAD_PS2
        NUM_PLAYERS = 4,
#else
        NUM_PLAYERS = 4,
#endif
        DEFAULT_TURBO_NUM = 3,
        DEFAULT_NUM_LAPS = 3,
        MIN_NUM_LAPS = 1,
        MAX_NUM_LAPS = 5,
        FLAG_TIMEOUT = 4000,
        MAX_CHARACTER_NAME_LEN = 32
    };

    struct CarData
    {
        enum State
        {
            WAITING,
            SELECTING,
            SELECTED
        };

        CarData() : 
            mVehicle( NULL ), 
            mVehicleAI( NULL ), 
            mState( WAITING ),
            mActiveListIndex( -1 ),
            mIsHuman(false)
        {
            mCarName[ 0 ] = '\0';
        };

        Vehicle*        mVehicle;
        WaypointAI*      mVehicleAI;
        State           mState;
        char            mCarName[ 16 ];
        int             mActiveListIndex;
        bool            mIsHuman;
    };

    struct PlayerData
    {
        PlayerData() : 
            mLapTime( 0 ), 
            mBestLap( 0xffffffff ), 
            mRaceTime( 0 ), 
            mNumLaps( 0 ), 
            mPosition( 0 ),
            mPoints( 0 ),
            mWins( 0 ),
            mNextCheckPoint( 0 ), 
            mBestTimeEntry( -1 ),
            mBestLapEntry( -1 ),
            mRacing( false ),
            mCheated( false ),
            mCharacterIndex( -1 ),
            mDistToCheckpoint( 10000000.0f ) { mCharacterName[0] = '\0'; };

        unsigned int mLapTime;
        unsigned int mBestLap;
        unsigned int mRaceTime;
        unsigned char mNumLaps;
        unsigned char mPosition;
        unsigned char mPoints;
        unsigned char mWins;
        char mNextCheckPoint;
        int mBestTimeEntry;
        int mBestLapEntry;
        bool mRacing;
        bool mCheated;
        char mCharacterName[MAX_CHARACTER_NAME_LEN];
        int mCharacterIndex;
        float mDistToCheckpoint;
    };

    struct DisplayNames
    {
        const char* name;
        const char* text;
    };

    extern const DisplayNames VEHICLE_NAMES[];
    extern const unsigned int NUM_NAMES;

    extern const char* CHARACTER_NAMES[];
    extern const unsigned int NUM_CHARACTER_NAMES;

    const tColour PLAYER_COLOURS[] = 
    {
        tColour( 213, 74, 33 ),
        tColour( 36, 232, 255 ),
        tColour( 246, 255, 5 ),
        tColour( 35, 209, 14 ),

        tColour( 0, 0, 0 ) // dummy terminator
    };

    struct HighScore
    {
        char name[4];
        unsigned int carNum;
        unsigned int score;
        enum { NUM_HIGH_SCORE = 10 };
    };
};

//*****************************************************************************
//
//Inline Public Member Functions
//
//*****************************************************************************

#endif //SUPERSPRINTDATA_H