summaryrefslogtreecommitdiffstats
path: root/game/code/main/xboxplatform.h
diff options
context:
space:
mode:
authorSvxy <aidan61605@gmail.com>2023-05-31 23:31:32 +0200
committerSvxy <aidan61605@gmail.com>2023-05-31 23:31:32 +0200
commiteb4b3404aa00220d659e532151dab13d642c17a3 (patch)
tree7e1107c4995489a26c4007e41b53ea8d00ab2134 /game/code/main/xboxplatform.h
downloadThe-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.gz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.bz2
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.lz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.xz
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.tar.zst
The-Simpsons-Hit-and-Run-eb4b3404aa00220d659e532151dab13d642c17a3.zip
Diffstat (limited to 'game/code/main/xboxplatform.h')
-rw-r--r--game/code/main/xboxplatform.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/game/code/main/xboxplatform.h b/game/code/main/xboxplatform.h
new file mode 100644
index 0000000..1465716
--- /dev/null
+++ b/game/code/main/xboxplatform.h
@@ -0,0 +1,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