summaryrefslogtreecommitdiffstats
path: root/game/code/main/xboxplatform.h
blob: 14657166743af7348a3d77e784734bcb4cd3a6b0 (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
//=============================================================================
// Copyright (C) 2002 Radical Entertainment Ltd.  All rights reserved.
//
// Component:   XboxPlatform   
//
// Description: Abstracts the differences for setting up and shutting down
//              the different platforms.
//
// History:     + Stolen and cleaned up from Svxy -- Darwin Chau
//
//=============================================================================

#ifndef XBOXPLATFORM_H
#define XBOXPLATFORM_H

//========================================
// Nested Includes
//========================================
#include "platform.h" // base class

//========================================
// Forward References
//========================================
struct IRadMemoryHeap;
class tPlatform;
class tContext;

//=============================================================================
//
// Synopsis:    Provides abstraction for setting up and closing down the XBox.
//
//=============================================================================
class XboxPlatform : public Platform
{
    public:
    
        // Static Methods for accessing this singleton.
        static XboxPlatform* CreateInstance();
        static XboxPlatform* GetInstance();
        static void DestroyInstance();

        // Had to workaround our nice clean design cause FTech must be init'ed
        // before anything else is done.
        static void InitializeFoundation();
        static void InitializeMemory();
        
        // Implement Platform interface.
        virtual void InitializePlatform();
        virtual void ShutdownPlatform();

        virtual void LaunchDashboard();
        virtual void ResetMachine();
        virtual void DisplaySplashScreen( SplashScreen screenID, 
                                          const char* overlayText = NULL, 
                                          float fontScale = 1.0f, 
                                          float textPosX = 0.0f,
                                          float textPosY = 0.0f,
                                          tColour textColour = tColour( 255,255,255 ),
                                          int fadeFrames = 3 );

        virtual void DisplaySplashScreen( const char* textureName,
                                          const char* overlayText = NULL, 
                                          float fontScale = 1.0f, 
                                          float textPosX = 0.0f,
                                          float textPosY = 0.0f,
                                          tColour textColour = tColour( 255,255,255 ),
                                          int fadeFrames = 3 );

        virtual bool OnDriveError( radFileError error, const char* pDriveName, void* pUserData );  
        virtual void OnControllerError(const char *msg);

	
    protected:

        virtual void InitializeFoundationDrive();
        virtual void ShutdownFoundation();
        
        virtual void InitializePure3D();
        virtual void ShutdownPure3D();
    
    private:
        
        // Constructors, Destructors, and Operators
        XboxPlatform();
        virtual ~XboxPlatform();

        // Unused Constructors, Destructors, and Operators
        XboxPlatform( const XboxPlatform& aPlatform );
        XboxPlatform& operator=( const XboxPlatform& aPlatform );

        // Pointer to the one and only instance of this singleton.
        static XboxPlatform* spInstance;

        // Pure 3D attributes
        tPlatform* mpPlatform; 
        tContext* mpContext;
};

#endif // XBOXPLATFORM_H