summaryrefslogtreecommitdiffstats
path: root/game/code/ai/vehicle/vehicleairender.h
blob: 4a00b509c0591a3fb96400f65d33b59b30a242d0 (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
//=============================================================================
// Copyright (C) 2002 Radical Entertainment Ltd.  All rights reserved.
//
// File:        vehicleairender.h
//
// Description: Blahblahblah
//
// History:     04/02/2003 + Created -- Dusit Eakkachaichanvet
//
//=============================================================================

#ifndef VEHICLEAIRENDER_H
#define VEHICLEAIRENDER_H

#include <roads/geometry.h>

#include <p3d/drawable.hpp>

class VehicleAIRender
{
public:
    static VehicleAIRender* GetVehicleAIRender();
    static void Destroy();

    enum 
    {
        TYPE_VEHICLE_AI,
        TYPE_TRAFFIC_AI,
        NUM_TYPES
    };

    void Display();
    int RegisterAI( void* ai, int type=TYPE_VEHICLE_AI );
    void UnregisterAI( int handle );

private:
    static VehicleAIRender* spInstance;
    static const int MAX_REGISTRATIONS = 20;

    struct RegisteredAI
    {
        void* ai;
        int index;
        int type;
        bool show;  //not a bitfield because of watcher
    };
    RegisteredAI mAIs[MAX_REGISTRATIONS];
    DListArray mFreeSlots;
    DListArray mRegistered;

    tShader* mAIShader;

    static void DropPathPoint(void*);

    // Singletons don't expose these...
    VehicleAIRender();
    virtual ~VehicleAIRender();

    //Prevent wasteful constructor creation.
    VehicleAIRender( const VehicleAIRender& render );
    VehicleAIRender& operator=( const VehicleAIRender& render );
};

#endif //VEHICLEAIRENDER_H