diff --git a/include/GamerServices/Guide.h b/include/GamerServices/Guide.h index b7839b3..e9da49c 100644 --- a/include/GamerServices/Guide.h +++ b/include/GamerServices/Guide.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -47,7 +48,7 @@ namespace XFX static IAsyncResult* BeginShowStorageDeviceSelector(const PlayerIndex_t player, AsyncCallback callback, Object* state); static void DelayNotifications(const TimeSpan timespan); static String EndShowKeyboardInput(IAsyncResult* result); - static int EndShowMessageBox(IAsyncResult* result); + static Nullable EndShowMessageBox(IAsyncResult* result); static StorageDevice EndShowStorageDeviceSelector(IAsyncResult* result); }; } diff --git a/include/Input/Keyboard.h b/include/Input/Keyboard.h index 0979257..5dbdbc5 100644 --- a/include/Input/Keyboard.h +++ b/include/Input/Keyboard.h @@ -1,8 +1,8 @@ /***************************************************************************** * Keyboard.h * * * - * XFX::Input::Keyboard class definition file * - * Copyright (c) XFX Team. All Rights Reserved * + * XFX::Input::Keyboard class definition file. * + * Copyright (c) XFX Team. All Rights Reserved. * *****************************************************************************/ #ifndef _XFX_INPUT_KEYBOARD_ #define _XFX_INPUT_KEYBOARD_ diff --git a/include/Storage/StorageDeviceNotConnectedException.h b/include/Storage/StorageDeviceNotConnectedException.h index 13dca21..3578209 100644 --- a/include/Storage/StorageDeviceNotConnectedException.h +++ b/include/Storage/StorageDeviceNotConnectedException.h @@ -9,6 +9,7 @@ #include +using namespace System; using namespace System::Runtime::InteropServices; namespace XFX diff --git a/include/System/Runtime/InteropServices/ExternalException.h b/include/System/Runtime/InteropServices/ExternalException.h index d726349..f709adc 100644 --- a/include/System/Runtime/InteropServices/ExternalException.h +++ b/include/System/Runtime/InteropServices/ExternalException.h @@ -1,9 +1,9 @@ -/******************************************************** - * ExternalException.h * - * * - * XFX ExternalException definition * - * Copyright © XFX Team. All Rights Reserved * - ********************************************************/ +/***************************************************************************** + * ExternalException.h * + * * + * System::Runtime::InteropServices::ExternalException definition file. * + * Copyright (c) XFX Team. All Rights Reserved * + *****************************************************************************/ #ifndef _SYSTEM_RUNTIME_INTEROPSERVICES_ExternalException_ #define _SYSTEM_RUNTIME_INTEROPSERVICES_ExternalException_ @@ -15,15 +15,15 @@ namespace System { namespace InteropServices { - /// - /// The base exception type for all COM interop exceptions and structured exception handling (SEH) exceptions. - /// + /** + * The base exception type for all COM interop exceptions and structured exception handling (SEH) exceptions. + */ class ExternalException : public SystemException { public: ExternalException(); - ExternalException(char* message); - ExternalException(char* message, Exception* inner); + ExternalException(const String& message); + ExternalException(const String& message, Exception * const inner); }; } } diff --git a/src/libXFX/ContentReader.cpp b/src/libXFX/ContentReader.cpp index 586ec6f..e2fb36d 100644 --- a/src/libXFX/ContentReader.cpp +++ b/src/libXFX/ContentReader.cpp @@ -60,10 +60,12 @@ namespace XFX ContentReader::~ContentReader() { + // TODO: implement } Stream* ContentReader::PrepareStream(Stream * const, const String& assetName) { + // TODO: implement } Matrix ContentReader::ReadMatrix() diff --git a/src/libXFX/GamePad.cpp b/src/libXFX/GamePad.cpp index d0e5ed0..998f8e0 100644 --- a/src/libXFX/GamePad.cpp +++ b/src/libXFX/GamePad.cpp @@ -34,6 +34,7 @@ extern "C" #include #include #include +#include using namespace System; @@ -50,7 +51,12 @@ namespace XFX { namespace Input { - GamePadState g_State; + static GamePadState g_State; + const Type GamePadDPadTypeInfo("GamePadDPad", "XFX::Input::GamePadDPad", TypeCode::Object); + const Type GamePadButtonsTypeInfo("GamePadButtons", "XFX::Input::GamePadButtons", TypeCode::Object); + const Type GamePadStateTypeInfo("GamePadState", "XFX::Input::GamePadState", TypeCode::Object); + const Type GamePadThumbSticksTypeInfo("GamePadThumbSticks", "XFX::Input::GamePadThumbSticks", TypeCode::Object); + const Type GamePadTriggersTypeInfo("GamePadTriggers", "XFX::Input::GamePadTriggers", TypeCode::Object); GamePadState GamePad::GetState(const PlayerIndex_t playerIndex) { @@ -73,7 +79,7 @@ namespace XFX ((g_Pads[playerIndex].PressedButtons.ucAnalogButtons[XPAD_Y]) ? Buttons::Y : 0)); g_State.Triggers = GamePadTriggers(g_Pads[playerIndex].PressedButtons.ucAnalogButtons[XPAD_LEFT_TRIGGER], - g_Pads[playerIndex].PressedButtons.ucAnalogButtons[XPAD_RIGHT_TRIGGER]); + g_Pads[playerIndex].PressedButtons.ucAnalogButtons[XPAD_RIGHT_TRIGGER]); //Update DPad g_State.DPad = GamePadDPad( @@ -136,9 +142,9 @@ namespace XFX return (((Buttons.GetHashCode() + DPad.GetHashCode()) ^ ThumbSticks.GetHashCode()) ^ Triggers.GetHashCode()); } - int GamePadState::GetType() + const Type& GamePadState::GetType() { - // TODO: implement + return GamePadStateTypeInfo; } bool GamePadState::IsButtonDown(const Buttons_t button) const @@ -194,6 +200,7 @@ namespace XFX case Buttons::Y: return Buttons.Y == ButtonState::Pressed; } + return false; } @@ -221,31 +228,31 @@ namespace XFX GamePadButtons::GamePadButtons(const uint /* Buttons_t */ buttons) : A((((buttons & Buttons::A) != 0) ? ButtonState::Pressed : ButtonState::Released)), - B((((buttons & Buttons::B) != 0) ? ButtonState::Pressed : ButtonState::Released)), - Back((((buttons & Buttons::Back) != 0) ? ButtonState::Pressed : ButtonState::Released)), - Black((((buttons & Buttons::Black) != 0) ? ButtonState::Pressed : ButtonState::Released)), - LeftStick((((buttons & Buttons::LeftStick) != 0) ? ButtonState::Pressed : ButtonState::Released)), - RightStick((((buttons & Buttons::RightStick) != 0) ? ButtonState::Pressed : ButtonState::Released)), - Start((((buttons & Buttons::Start) != 0) ? ButtonState::Pressed : ButtonState::Released)), - White((((buttons & Buttons::White) != 0) ? ButtonState::Pressed : ButtonState::Released)), - X((((buttons & Buttons::X) != 0) ? ButtonState::Pressed : ButtonState::Released)), - Y((((buttons & Buttons::Y) != 0) ? ButtonState::Pressed : ButtonState::Released)) + B((((buttons & Buttons::B) != 0) ? ButtonState::Pressed : ButtonState::Released)), + Back((((buttons & Buttons::Back) != 0) ? ButtonState::Pressed : ButtonState::Released)), + Black((((buttons & Buttons::Black) != 0) ? ButtonState::Pressed : ButtonState::Released)), + LeftStick((((buttons & Buttons::LeftStick) != 0) ? ButtonState::Pressed : ButtonState::Released)), + RightStick((((buttons & Buttons::RightStick) != 0) ? ButtonState::Pressed : ButtonState::Released)), + Start((((buttons & Buttons::Start) != 0) ? ButtonState::Pressed : ButtonState::Released)), + White((((buttons & Buttons::White) != 0) ? ButtonState::Pressed : ButtonState::Released)), + X((((buttons & Buttons::X) != 0) ? ButtonState::Pressed : ButtonState::Released)), + Y((((buttons & Buttons::Y) != 0) ? ButtonState::Pressed : ButtonState::Released)) { } GamePadButtons::GamePadButtons() : A(ButtonState::Released), B(ButtonState::Released), - Back(ButtonState::Released), Black(ButtonState::Released), - LeftStick(ButtonState::Released), RightStick(ButtonState::Released), - Start(ButtonState::Released), White(ButtonState::Released), - X(ButtonState::Released), Y(ButtonState::Released) + Back(ButtonState::Released), Black(ButtonState::Released), + LeftStick(ButtonState::Released), RightStick(ButtonState::Released), + Start(ButtonState::Released), White(ButtonState::Released), + X(ButtonState::Released), Y(ButtonState::Released) { } GamePadButtons::GamePadButtons(const GamePadButtons &obj) : A(obj.A), B(obj.B), Back(obj.Back), Black(obj.Black), - LeftStick(obj.LeftStick), RightStick(obj.RightStick), - Start(obj.Start), White(obj.White), X(obj.X), Y(obj.Y) + LeftStick(obj.LeftStick), RightStick(obj.RightStick), + Start(obj.Start), White(obj.White), X(obj.X), Y(obj.Y) { } @@ -265,9 +272,9 @@ namespace XFX Start + White + X + Y); } - int GamePadButtons::GetType() + const Type& GamePadButtons::GetType() { - // TODO: implement + return GamePadButtonsTypeInfo; } const String GamePadButtons::ToString() const @@ -324,17 +331,17 @@ namespace XFX bool GamePadButtons::operator!=(const GamePadButtons& other) const { return ((A != other.A) || (B != other.B) || (Back != other.Back) || - (Black != other.Black) || (LeftStick != other.LeftStick) || - (RightStick != other.RightStick) || (Start != other.Start) || - (White != other.White) || (X != other.X) || (Y != other.Y)); + (Black != other.Black) || (LeftStick != other.LeftStick) || + (RightStick != other.RightStick) || (Start != other.Start) || + (White != other.White) || (X != other.X) || (Y != other.Y)); } bool GamePadButtons::operator==(const GamePadButtons& other) const { return ((A == other.A) && (B == other.B) && (Back == other.Back) && - (Black == other.Black) && (LeftStick == other.LeftStick) && - (RightStick == other.RightStick) && (Start == other.Start) && - (White == other.White) && (X == other.X) && (Y == other.Y)); + (Black == other.Black) && (LeftStick == other.LeftStick) && + (RightStick == other.RightStick) && (Start == other.Start) && + (White == other.White) && (X == other.X) && (Y == other.Y)); } GamePadDPad::GamePadDPad() @@ -367,9 +374,9 @@ namespace XFX return Down + Left + Right + Up; } - int GamePadDPad::GetType() + const Type& GamePadDPad::GetType() { - // TODO: implement + return GamePadDPadTypeInfo; } const String GamePadDPad::ToString() const @@ -441,9 +448,9 @@ namespace XFX return Left.GetHashCode() ^ Right.GetHashCode(); } - int GamePadThumbSticks::GetType() + const Type& GamePadThumbSticks::GetType() { - // TODO: implement + return GamePadThumbSticksTypeInfo; } const String GamePadThumbSticks::ToString() const @@ -491,9 +498,9 @@ namespace XFX return (int)Left ^ (int)Right; } - int GamePadTriggers::GetType() + const Type& GamePadTriggers::GetType() { - // TODO: implement + return GamePadTriggersTypeInfo; } const String GamePadTriggers::ToString() const diff --git a/src/libXFX/Guide.cpp b/src/libXFX/Guide.cpp index bf52ab2..9ba29f8 100644 --- a/src/libXFX/Guide.cpp +++ b/src/libXFX/Guide.cpp @@ -45,14 +45,21 @@ namespace XFX IAsyncResult* Guide::BeginShowKeyboardInput(const PlayerIndex_t player, String& title, String& description, String& defaultText, AsyncCallback callback, Object* state) { if (String::IsNullOrEmpty(title)) + { title = String::Empty; + } if (String::IsNullOrEmpty(description)) + { description = String::Empty; + } if (String::IsNullOrEmpty(defaultText)) + { defaultText = String::Empty; + } + // TODO: implement // just return null to stop warning until this thing's coded return null; } @@ -60,48 +67,56 @@ namespace XFX IAsyncResult* Guide::BeginShowMessageBox(const PlayerIndex_t player, String& title, String& text, IEnumerable* buttons, const int focusButton, const MessageBoxIcon_t icon, AsyncCallback callback, Object* state) { if (String::IsNullOrEmpty(title)) + { title = String::Empty; + } sassert(buttons != NULL, String::Format("buttons: %s", FrameworkResources::ArgumentNull_Generic)); + // TODO: implement // just return null to stop warning until this thing's coded return null; } IAsyncResult* Guide::BeginShowStorageDeviceSelector(const int sizeInBytes, const int directoryCount, AsyncCallback callback, Object* state) { + // TODO: implement // just return null to stop warning until this thing's coded return null; } IAsyncResult* Guide::BeginShowStorageDeviceSelector(AsyncCallback callback, Object* state) { + // TODO: implement // just return null to stop warning until this thing's coded return null; } IAsyncResult* Guide::BeginShowStorageDeviceSelector(const PlayerIndex_t player, const int sizeInBytes, const int directoryCount, AsyncCallback callback, Object* state) { + // TODO: implement // just return null to stop warning until this thing's coded return null; } IAsyncResult* Guide::BeginShowStorageDeviceSelector(const PlayerIndex_t player, AsyncCallback callback, Object* state) { + // TODO: implement // just return null to stop warning until this thing's coded return null; } - const char* Guide::EndShowKeyboardInput(IAsyncResult* result) + String Guide::EndShowKeyboardInput(IAsyncResult* result) { + // TODO: implement // just return an empty string to stop warning until this thing's coded return ""; } - int Guide::EndShowMessageBox(IAsyncResult* result) + Nullable Guide::EndShowMessageBox(IAsyncResult* result) { - // Since C++ doesn't have a nullable type, we return -1, since it represents an invalid value anyways. - return -1; + // TODO: implement + return NULL; } StorageDevice Guide::EndShowStorageDeviceSelector(IAsyncResult* asyncResult) diff --git a/src/libXFX/Keyboard.cpp b/src/libXFX/Keyboard.cpp index ced16a1..d0cc6dd 100644 --- a/src/libXFX/Keyboard.cpp +++ b/src/libXFX/Keyboard.cpp @@ -47,27 +47,24 @@ namespace XFX // Initializes the KeyboardState class KeyboardState::KeyboardState() + : pressedKeys(NULL) { - KeyboardState(null); } // Initializes the KeyboardState class with the specified keys pressed KeyboardState::KeyboardState(Keys_t keys[]) + : pressedKeys(keys) { - if (keys == null) - pressedKeys = 0; - else - pressedKeys = keys; } KeyboardState::KeyboardState(const KeyboardState &obj) + : pressedKeys(obj.pressedKeys) { - pressedKeys = obj.pressedKeys; } Keys_t* KeyboardState::GetPressedKeys() { - return (Keys_t*)pressedKeys; + return pressedKeys; } // Returns whether the specified key is currently pressed @@ -78,9 +75,11 @@ namespace XFX if((Stroke.ucFlags & (byte)key) == 0) { return true; - } - return false; + } + + return false; } + //The keyboard was not connected...bail out. return -1; } @@ -93,9 +92,11 @@ namespace XFX if((Stroke.ucFlags & (byte)key) != 0) { return true; - } - return false; + } + + return false; } + // The keyboard was not connected...bail out. return -1; } diff --git a/src/libXFX/Mouse.cpp b/src/libXFX/Mouse.cpp index a483402..dfd6438 100644 --- a/src/libXFX/Mouse.cpp +++ b/src/libXFX/Mouse.cpp @@ -39,8 +39,8 @@ namespace XFX extern struct xmouse_data XMOUSE_current; } - //It's a waste of memory to create a new MouseState each time the input states are updated. - //Therefore, we create a static one and update it each time an update is requested. + // It's a waste of memory to create a new MouseState each time the input states are updated. + // Therefore, we create a static one and update it each time an update is requested. static MouseState result; /* MouseState Operators */ @@ -67,25 +67,49 @@ namespace XFX XMOUSE_current.y = 0; if((XMOUSE_current.buttons & XMOUSE_BUTTON_1)) + { result.LeftButton = ButtonState::Pressed; + } else + { result.LeftButton = ButtonState::Released; + } + if((XMOUSE_current.buttons & XMOUSE_BUTTON_3)) + { result.MiddleButton = ButtonState::Pressed; + } else + { result.MiddleButton = ButtonState::Released; + } + if((XMOUSE_current.buttons & XMOUSE_BUTTON_2)) + { result.RightButton = ButtonState::Pressed; + } else + { result.RightButton = ButtonState::Released; + } + if((XMOUSE_current.buttons & XMOUSE_BUTTON_4)) + { result.XButton1 = ButtonState::Pressed; + } else + { result.XButton1 = ButtonState::Released; + } + if((XMOUSE_current.buttons & XMOUSE_BUTTON_5)) + { result.XButton2 = ButtonState::Pressed; + } else + { result.XButton2 = ButtonState::Released; + } return result; } @@ -94,6 +118,8 @@ namespace XFX { result.X = x; result.Y = y; + + // TODO: update 'hardware' cursor } } } diff --git a/src/libXFX/SoundEffect.cpp b/src/libXFX/SoundEffect.cpp index 2dfbe20..e35b974 100644 --- a/src/libXFX/SoundEffect.cpp +++ b/src/libXFX/SoundEffect.cpp @@ -127,7 +127,7 @@ namespace XFX SoundEffect* SoundEffect::FromStream(Stream * const stream) { - + // TODO: implement } const Type& SoundEffect::GetType() diff --git a/src/libXFX/SoundEffectInstance.cpp b/src/libXFX/SoundEffectInstance.cpp index 8b137de..7c3296f 100644 --- a/src/libXFX/SoundEffectInstance.cpp +++ b/src/libXFX/SoundEffectInstance.cpp @@ -38,34 +38,42 @@ namespace XFX bool SoundEffectInstance::IsDisposed() const { + // TODO: implement } bool SoundEffectInstance::IsLooped() const { + // TODO: implement } void SoundEffectInstance::IsLooped(bool value) { + // TODO: implement } float SoundEffectInstance::getPan() const { + // TODO: implement } void SoundEffectInstance::setPan(float value) { + // TODO: implement } float SoundEffectInstance::getPitch() const { + // TODO: implement } void SoundEffectInstance::setPitch(float value) { + // TODO: implement } SoundState_t SoundEffectInstance::getState() const { + // TODO: implement } float SoundEffectInstance::getVolume() const @@ -75,6 +83,7 @@ namespace XFX void SoundEffectInstance::setVolume(float value) { + // TODO: implement } SoundEffectInstance::SoundEffectInstance(SoundEffect * const parent, bool fireAndForget) @@ -90,10 +99,12 @@ namespace XFX void SoundEffectInstance::Apply3D(AudioListener listener, AudioEmitter emitter) { + // TODO: implement } void SoundEffectInstance::Apply3D(AudioListener listeners[], AudioEmitter emitter) { + // TODO: implement } void SoundEffectInstance::Dispose() @@ -116,14 +127,17 @@ namespace XFX void SoundEffectInstance::Pause() { + // TODO: implement } void SoundEffectInstance::Play() { + // TODO: implement } void SoundEffectInstance::Resume() { + // TODO: implement } void SoundEffectInstance::Stop() @@ -133,6 +147,7 @@ namespace XFX void SoundEffectInstance::Stop(bool immediate) { + // TODO: implement } } } diff --git a/src/libXFX/StorageContainer.cpp b/src/libXFX/StorageContainer.cpp index e863950..774a536 100644 --- a/src/libXFX/StorageContainer.cpp +++ b/src/libXFX/StorageContainer.cpp @@ -125,7 +125,9 @@ namespace XFX isDisposed = true; if (disposing) + { Disposing(this, EventArgs::Empty); + } } } diff --git a/src/libXFX/StorageDevice.cpp b/src/libXFX/StorageDevice.cpp index 1408ea9..a047e7a 100644 --- a/src/libXFX/StorageDevice.cpp +++ b/src/libXFX/StorageDevice.cpp @@ -38,14 +38,17 @@ namespace XFX { long long StorageDevice::FreeSpace() const { + // TODO: implement } bool StorageDevice::IsConnected() const { + // TODO: implement } long long StorageDevice::TotalSpace() const { + // TODO: implement } StorageDevice::StorageDevice(uint deviceIndex, PlayerIndex_t playerIndex) @@ -58,6 +61,7 @@ namespace XFX { sassert(!String::IsNullOrEmpty(titleName), "titleName cannot be null."); + // TODO: implement //return new StorageContainer(this, titleName, _deviceIndex, _playerIndex); } } diff --git a/src/libXFX/StorageDeviceAsyncResult.cpp b/src/libXFX/StorageDeviceAsyncResult.cpp index 05665a0..582f353 100644 --- a/src/libXFX/StorageDeviceAsyncResult.cpp +++ b/src/libXFX/StorageDeviceAsyncResult.cpp @@ -12,10 +12,11 @@ namespace XFX bool StorageDeviceAsyncResult::CompletedSynchronously() { + // TODO: implement return true; } - StorageDeviceAsyncResult::StorageDeviceAsyncResult(Object* stateObject, int player) + StorageDeviceAsyncResult::StorageDeviceAsyncResult(Object * const stateObject, int player) { syncObject = stateObject; playerIndex = player; @@ -29,7 +30,7 @@ namespace XFX StorageDeviceAsyncResult::StorageDeviceAsyncResult(IAsyncResult* &obj) { - + // TODO: implement } } } diff --git a/src/libXFX/StorageDeviceNotConnectedException.cpp b/src/libXFX/StorageDeviceNotConnectedException.cpp index 5f29bab..2c4a7d6 100644 --- a/src/libXFX/StorageDeviceNotConnectedException.cpp +++ b/src/libXFX/StorageDeviceNotConnectedException.cpp @@ -26,6 +26,7 @@ // POSSIBILITY OF SUCH DAMAGE. #include +#include namespace XFX { @@ -36,12 +37,12 @@ namespace XFX { } - StorageDeviceNotConnectedException::StorageDeviceNotConnectedException(char* message) + StorageDeviceNotConnectedException::StorageDeviceNotConnectedException(const String& message) : ExternalException(message) { } - StorageDeviceNotConnectedException::StorageDeviceNotConnectedException(char* message, Exception* innerException) + StorageDeviceNotConnectedException::StorageDeviceNotConnectedException(const String& message, Exception * const innerException) : ExternalException(message, innerException) { } diff --git a/src/libXFX/Video.cpp b/src/libXFX/Video.cpp index 050ed3c..96b974e 100644 --- a/src/libXFX/Video.cpp +++ b/src/libXFX/Video.cpp @@ -34,24 +34,29 @@ namespace XFX { const Type VideoTypeInfo("Video", "XFX::Media::Video", TypeCode::Object); - TimeSpan Video::getDuration() + TimeSpan Video::getDuration() const { + // TODO: implement } - float Video::getFramesPerSecond() + float Video::getFramesPerSecond() const { + // TODO: implement } - int Video::getHeight() + int Video::getHeight() const { + // TODO: implement } - VideoSoundtrackType_t Video::getVideoSoundtrackType() + VideoSoundtrackType_t Video::getVideoSoundtrackType() const { + // TODO: implement } - int Video::getWidth() + int Video::getWidth() const { + // TODO: implement } const Type& Video::GetType()