1
0
mirror of https://github.com/Halofreak1990/XFXFramework synced 2024-12-26 13:49:34 +01:00

Added missing TypeInfos to XFX::Input namespace

Updated function incorrect signatures in libXFX
This commit is contained in:
Tom Lint 2013-10-03 14:40:24 +02:00
parent 7c5bc83237
commit 95bf1d7ebc
16 changed files with 155 additions and 74 deletions

View File

@ -10,6 +10,7 @@
#include <System/Collections/Generic/Interfaces.h>
#include <System/Delegates.h>
#include <System/Interfaces.h>
#include <System/Nullable.h>
#include <System/TimeSpan.h>
#include <System/Types.h>
#include <Storage/StorageDevice.h>
@ -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<int> EndShowMessageBox(IAsyncResult* result);
static StorageDevice EndShowStorageDeviceSelector(IAsyncResult* result);
};
}

View File

@ -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_

View File

@ -9,6 +9,7 @@
#include <System/Runtime/InteropServices/ExternalException.h>
using namespace System;
using namespace System::Runtime::InteropServices;
namespace XFX

View File

@ -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
{
/// <summary>
/// The base exception type for all COM interop exceptions and structured exception handling (SEH) exceptions.
/// </summary>
/**
* 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);
};
}
}

View File

@ -60,10 +60,12 @@ namespace XFX
ContentReader::~ContentReader()
{
// TODO: implement
}
Stream* ContentReader::PrepareStream(Stream * const, const String& assetName)
{
// TODO: implement
}
Matrix ContentReader::ReadMatrix()

View File

@ -34,6 +34,7 @@ extern "C"
#include <Input/GamePad.h>
#include <System/Array.h>
#include <System/String.h>
#include <System/Type.h>
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

View File

@ -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<String>* 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<int> 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)

View File

@ -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;
}

View File

@ -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
}
}
}

View File

@ -127,7 +127,7 @@ namespace XFX
SoundEffect* SoundEffect::FromStream(Stream * const stream)
{
// TODO: implement
}
const Type& SoundEffect::GetType()

View File

@ -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
}
}
}

View File

@ -125,7 +125,9 @@ namespace XFX
isDisposed = true;
if (disposing)
{
Disposing(this, EventArgs::Empty);
}
}
}

View File

@ -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);
}
}

View File

@ -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
}
}
}

View File

@ -26,6 +26,7 @@
// POSSIBILITY OF SUCH DAMAGE.
#include <Storage/StorageDeviceNotConnectedException.h>
#include <System/String.h>
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)
{
}

View File

@ -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()