summaryrefslogtreecommitdiffstats
path: root/game/code/presentation/simpleanimationplayer.h
blob: eb39bd873f8e70cd73efea9c19f8910c58d969a8 (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
//=============================================================================
// Copyright (C) 2002 Radical Entertainment Ltd.  All rights reserved.
//
// File:        .h
//
// Description: Blahblahblah
//
// History:     29/05/2002 + Created -- NAME
//
//=============================================================================

#ifndef SIMPLEANIMATIONPLAYER_H
#define SIMPLEANIMATIONPLAYER_H

//========================================
// Nested Includes
//========================================
#include <p3d/anim/animate.hpp> // p3dCycleMode
#include <presentation/animplayer.h>

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

class tMultiController;
class tCamera;

//=============================================================================
//
// Synopsis:    Wraps up the P3D related crap involved with playing an 
//              animation.
//
//=============================================================================

class SimpleAnimationPlayer : public AnimationPlayer
{
    public:
        SimpleAnimationPlayer();
        virtual ~SimpleAnimationPlayer();

        virtual void Update( unsigned int elapsedTime );

        virtual void ClearData();

        void SetNameData( char* controller, char* camera, char* animation );

        void SetCycleMode( p3dCycleMode cycleMode ) { mCycleMode = cycleMode; }
        void SetIntroLoop(unsigned nFrames);
        void SetOutroLoop(unsigned nFrames);

        void Play(void);
        void DoneIntro(void);

        void Rewind();

    protected:

        // These set all the objects needs to play an animation
        void SetController(tMultiController* pController ) { mpMasterController = pController; }
        void SetCamera( tCamera* pCamera ) { mpCamera = pCamera; }

        virtual void DoLoaded();
        virtual void DoRender();

        const char* GetAnimationName() { return( &msAnimation[0] ); }

    private:

        //Prevent wasteful constructor creation.
        SimpleAnimationPlayer( const SimpleAnimationPlayer&  );
        SimpleAnimationPlayer& operator=( const SimpleAnimationPlayer& );

        char msController[32];
        char msCamera[32];
        char msAnimation[32];

        tMultiController* mpMasterController;
        p3dCycleMode mCycleMode;
        tCamera* mpCamera;
        tCamera* mpViewCamera;
        bool mbSetCamera;
        unsigned mIntroFrames;
        unsigned mOutroFrames;
        bool mInIntro;
        unsigned mNumFrames;
};


#endif // SIMPLEANIMATIONPLAYER_H