Table of Contents

include/AK/Wwise/PlatformID.h

Go to the documentation of this file.
00001 
00002 //
00003 // Copyright (c) 2006 Audiokinetic Inc. / All Rights Reserved
00004 //
00006 
00009 
00010 #ifndef AK_WWISE_PLATFORMID_H
00011 #define AK_WWISE_PLATFORMID_H
00012 
00013 #if defined( _MSC_VER )
00014     #define AK_ID_DECLARE extern const _declspec( selectany )
00015 #else
00016     #define AK_ID_DECLARE const
00017 #endif
00018 
00019 struct BasePlatformID
00020 {
00021     BasePlatformID():guid( GUID_NULL ){}
00022 
00023     // The Create function is a functionnal replacement for the BasePlatformID() constructor taking a GUID in parameters.
00024     // This is to avoid situations where someone would pass a GUID instead of a BasePlatformID in a function call while migrating, which would
00025     // compile but would lead the user into serious errors.
00026     static BasePlatformID Create( const GUID& in_BasePlatformID  )
00027     {
00028         BasePlatformID ret;
00029         ret.guid = in_BasePlatformID;
00030         return ret;
00031     }
00032 
00033     static BasePlatformID Empty()
00034     {
00035         return BasePlatformID::Create(GUID_NULL);
00036     }
00037 
00038     bool IsNull() const
00039     {
00040         return (guid == GUID_NULL) ? true : false;
00041     }
00042 
00043     bool operator == ( const BasePlatformID& in_rOther ) const
00044     {
00045         return (in_rOther.guid == guid)? true : false;
00046     }
00047     bool operator != ( const BasePlatformID& in_rOther ) const
00048     {
00049         return (in_rOther.guid != guid)? true : false;
00050     }
00051     GUID guid;
00052 
00053     struct GUIDLessNative
00054     {
00055         bool operator()( const BasePlatformID& in_rLeft, const BasePlatformID& in_rRight ) const
00056         {
00057             return ( ::memcmp( &in_rLeft, &in_rRight, sizeof BasePlatformID ) < 0 );
00058         }
00059     };
00060 };
00061 
00062 namespace PlatformID
00063 {
00064     // {6E0CB257-C6C8-4c5c-8366-2740DFC441EB}
00065     AK_ID_DECLARE GUID Windows_unsafeguid = { 0x6E0CB257, 0xC6C8, 0x4c5c, { 0x83, 0x66, 0x27, 0x40, 0xDF, 0xC4, 0x41, 0xEB } };
00066     AK_ID_DECLARE BasePlatformID Windows = BasePlatformID::Create( Windows_unsafeguid );
00067 
00068     // {E0C09284-6F61-43dc-9C9D-D8047E47AB3B}
00069     AK_ID_DECLARE GUID Xbox360_unsafeguid = { 0xE0C09284, 0x6F61, 0x43dc, { 0x9C, 0x9D, 0xD8, 0x04, 0x7E, 0x47, 0xAB, 0x3B } };
00070     AK_ID_DECLARE BasePlatformID Xbox360 = BasePlatformID::Create( Xbox360_unsafeguid );
00071 
00072     // {D85DACB3-8FDB-4aba-8C8A-1F46AFB35366}
00073     AK_ID_DECLARE GUID PS3_unsafeguid = { 0xD85DACB3, 0x8FDB, 0x4aba, { 0x8C, 0x8A, 0x1F, 0x46, 0xAF, 0xB3, 0x53, 0x66 } };
00074     AK_ID_DECLARE BasePlatformID PS3 = BasePlatformID::Create( PS3_unsafeguid );
00075 
00076     // {A11C9D5D-C4ED-42af-99E3-0376D0E11620}
00077     AK_ID_DECLARE GUID Wii_unsafeguid = { 0xa11c9d5d, 0xc4ed, 0x42af, { 0x99, 0xe3, 0x3, 0x76, 0xd0, 0xe1, 0x16, 0x20 } };
00078     AK_ID_DECLARE BasePlatformID Wii = BasePlatformID::Create( Wii_unsafeguid );
00079 
00080     // {9C6217D5-DD11-4795-87C1-6CE02853C540}
00081     AK_ID_DECLARE GUID Mac_unsafeguid = { 0x9c6217d5, 0xdd11, 0x4795, { 0x87, 0xc1, 0x6c, 0xe0, 0x28, 0x53, 0xc5, 0x40 } };
00082     AK_ID_DECLARE BasePlatformID Mac = BasePlatformID::Create( Mac_unsafeguid );
00083 
00084     // {2DB55050-4B70-4243-A22C-434D776A0753}
00085     AK_ID_DECLARE GUID VitaSW_unsafeguid = { 0x2db55050, 0x4b70, 0x4243, { 0xa2, 0x2c, 0x43, 0x4d, 0x77, 0x6a, 0x7, 0x53 } };
00086     AK_ID_DECLARE BasePlatformID VitaSW = BasePlatformID::Create( VitaSW_unsafeguid );
00087     
00088     // {091EBCFF-5E04-4260-B025-566206272EA6}
00089     AK_ID_DECLARE GUID VitaHW_unsafeguid = { 0x91ebcff, 0x5e04, 0x4260, { 0xb0, 0x25, 0x56, 0x62, 0x6, 0x27, 0x2e, 0xa6 } };
00090     AK_ID_DECLARE BasePlatformID VitaHW = BasePlatformID::Create( VitaHW_unsafeguid );
00091     
00092     // {3AF9B9B6-6EF1-47E9-B5FE-E30C9E602C77}
00093     AK_ID_DECLARE GUID PS4_unsafeguid = { 0x3af9b9b6, 0x6ef1, 0x47e9, { 0xb5, 0xfe, 0xe3, 0xc, 0x9e, 0x60, 0x2c, 0x77 } };
00094     AK_ID_DECLARE BasePlatformID PS4 = BasePlatformID::Create( PS4_unsafeguid );
00095 
00096     // {ECE03DB4-F948-462d-B2BB-A9173012B1F8}
00097     AK_ID_DECLARE GUID iOS_unsafeguid = { 0xece03db4, 0xf948, 0x462d, { 0xb2, 0xbb, 0xa9, 0x17, 0x30, 0x12, 0xb1, 0xf8 } };
00098     AK_ID_DECLARE BasePlatformID iOS = BasePlatformID::Create( iOS_unsafeguid );
00099 
00100     // {3B6B2F86-291B-4b95-90FD-6AD751FF6DCA}
00101     AK_ID_DECLARE GUID Nintendo3DS_unsafeguid = { 0x3b6b2f86, 0x291b, 0x4b95, { 0x90, 0xfd, 0x6a, 0xd7, 0x51, 0xff, 0x6d, 0xca } };
00102     AK_ID_DECLARE BasePlatformID Nintendo3DS = BasePlatformID::Create( Nintendo3DS_unsafeguid );
00103 
00104     // {7CB75869-58AD-4458-948A-1935CCB4AC66}
00105     AK_ID_DECLARE GUID WiiUSW_unsafeguid = { 0x7cb75869, 0x58ad, 0x4458, { 0x94, 0x8a, 0x19, 0x35, 0xcc, 0xb4, 0xac, 0x66 } };
00106     AK_ID_DECLARE BasePlatformID WiiUSW = BasePlatformID::Create( WiiUSW_unsafeguid );
00107 
00108     // {FF757AE1-FCE5-420d-9E8A-32139D436F74}
00109     AK_ID_DECLARE GUID WiiUHW_unsafeguid = { 0xff757ae1, 0xfce5, 0x420d, { 0x9e, 0x8a, 0x32, 0x13, 0x9d, 0x43, 0x6f, 0x74 } };
00110     AK_ID_DECLARE BasePlatformID WiiUHW = BasePlatformID::Create( WiiUHW_unsafeguid );
00111 
00112     // {a2d401de-b8b6-4feb-8142-137c34d507CA}
00113     AK_ID_DECLARE GUID Android_unsafeguid = { 0xa2d401de, 0xb8b6, 0x4feb, { 0x81, 0x42, 0x13, 0x7c, 0x34, 0xd5, 0x07, 0xCA } };
00114     AK_ID_DECLARE BasePlatformID Android = BasePlatformID::Create( Android_unsafeguid );
00115 
00116     // {B131584B-9961-4bb5-9C58-A3E9ABFFBBF6}
00117     AK_ID_DECLARE GUID XboxOne_unsafeguid = { 0xb131584b, 0x9961, 0x4bb5, { 0x9c, 0x58, 0xa3, 0xe9, 0xab, 0xff, 0xbb, 0xf6 } };
00118     AK_ID_DECLARE BasePlatformID XboxOne = BasePlatformID::Create( XboxOne_unsafeguid );
00119 
00120     // {BD0BDF13-3125-454f-8BFD-319537169F81}
00121     AK_ID_DECLARE GUID Linux_unsafeguid = { 0xbd0bdf13, 0x3125, 0x454f, { 0x8b, 0xfd, 0x31, 0x95, 0x37, 0x16, 0x9f, 0x81 } };
00122     AK_ID_DECLARE BasePlatformID Linux = BasePlatformID::Create( Linux_unsafeguid );
00123 
00124     // {869AD233-43F2-4c0f-9126-79F44C15E1D9}
00125     AK_ID_DECLARE GUID WindowsPhone_unsafeguid = { 0x869ad233, 0x43f2, 0x4c0f, { 0x91, 0x26, 0x79, 0xf4, 0x4c, 0x15, 0xe1, 0xd9 } };
00126     AK_ID_DECLARE BasePlatformID WindowsPhone = BasePlatformID::Create( WindowsPhone_unsafeguid );
00127 
00129     inline bool IsPlatformBigEndian( const BasePlatformID & in_guidPlatform )
00130     {
00131         return in_guidPlatform == PlatformID::Wii 
00132             || in_guidPlatform == PlatformID::WiiUSW
00133             || in_guidPlatform == PlatformID::WiiUHW
00134             || in_guidPlatform == PlatformID::PS3 
00135             || in_guidPlatform == PlatformID::Xbox360;
00136     }
00137 }
00138 
00139 #endif // AK_WWISE_PLATFORMID_H