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

Fixed TextureCollection issues caused by circular dependencies.

Added RenderTarget and RenderTarget2D classes to the XFX::Graphics namespace
Added Internal StorageDeviceAsyncResult class to the XFX::Storage namespace to aid in the implementation of the Guide.
Added Guide::BeginShowMessageBox and Guide::EndShowMessageBox methods
Began fixing comments to properly show up in IntelliSense
This commit is contained in:
Halofreak1990 2011-06-09 12:57:16 +00:00
parent 22893b5c47
commit ec0c1820dd
34 changed files with 758 additions and 263 deletions

View File

@ -11,9 +11,6 @@ namespace XFX
{ {
namespace Audio namespace Audio
{ {
/// <summary>
/// Controls how Cue objects should stop when Cue.Stop is called.
/// </summary>
struct AudioStopOptions struct AudioStopOptions
{ {
enum type enum type
@ -23,8 +20,8 @@ namespace XFX
}; };
}; };
typedef AudioStopOptions::type AudioStopOptions_t; typedef AudioStopOptions::type AudioStopOptions_t; // Controls how Cue objects should stop when Cue::Stop is called.
} }
} }
#endif //XFRAMEWORK_AUDIOSTOPOPTIONS_H #endif //_XFX_AUDIO_ENUMS_

View File

@ -5,9 +5,6 @@ namespace XFX
{ {
namespace GamerServices namespace GamerServices
{ {
/// <summary>
/// Indicates how sensitive this gamer prefers controller input to be.
/// </summary>
struct ControllerSensitivity struct ControllerSensitivity
{ {
enum type enum type
@ -18,9 +15,6 @@ namespace XFX
}; };
}; };
/// <summary>
/// Indicates how difficult this gamer likes things to be.
/// </summary>
struct GameDifficulty struct GameDifficulty
{ {
enum type enum type
@ -31,9 +25,6 @@ namespace XFX
}; };
}; };
/// <summary>
/// This style of social gaming preferred by this Xbox Live member.
/// </summary>
struct GamerZone struct GamerZone
{ {
enum type enum type
@ -46,9 +37,6 @@ namespace XFX
}; };
}; };
/// <summary>
/// Defines the different icons for a message box.
/// </summary>
struct MessageBoxIcon struct MessageBoxIcon
{ {
enum type enum type
@ -60,9 +48,6 @@ namespace XFX
}; };
}; };
/// <summary>
/// Determines where notifications appear on the screen.
/// </summary>
struct NotificationPosition struct NotificationPosition
{ {
enum type enum type
@ -79,9 +64,6 @@ namespace XFX
}; };
}; };
/// <summary>
/// Indicates which camera angle this gamer prefers to use in racing games.
/// </summary>
struct RacingCameraAngle struct RacingCameraAngle
{ {
enum type enum type
@ -92,12 +74,12 @@ namespace XFX
}; };
}; };
typedef ControllerSensitivity::type ControllerSensitivity_t; typedef ControllerSensitivity::type ControllerSensitivity_t; // Indicates how sensitive this gamer prefers controller input to be.
typedef GameDifficulty::type GameDifficulty_t; typedef GameDifficulty::type GameDifficulty_t; // Indicates how difficult this gamer likes things to be.
typedef GamerZone::type GamerZone_t; typedef GamerZone::type GamerZone_t; // This style of social gaming preferred by this Xbox Live member.
typedef MessageBoxIcon::type MessageBoxIcon_t; typedef MessageBoxIcon::type MessageBoxIcon_t; // Defines the different icons for a message box.
typedef NotificationPosition::type NotificationPosition_t; typedef NotificationPosition::type NotificationPosition_t; // Determines where notifications appear on the screen.
typedef RacingCameraAngle::type RacingCameraAngle_t; typedef RacingCameraAngle::type RacingCameraAngle_t; // Indicates which camera angle this gamer prefers to use in racing games.
} }
} }

View File

@ -7,13 +7,16 @@
#ifndef _XFX_GAMERSERVICES_GUIDE_ #ifndef _XFX_GAMERSERVICES_GUIDE_
#define _XFX_GAMERSERVICES_GUIDE_ #define _XFX_GAMERSERVICES_GUIDE_
#include <System/Collections/Generic/Interfaces.h>
#include <System/Delegates.h> #include <System/Delegates.h>
#include <System/Interfaces.h> #include <System/Interfaces.h>
#include <System/TimeSpan.h>
#include <System/Types.h> #include <System/Types.h>
#include <Storage/StorageDevice.h> #include <Storage/StorageDevice.h>
#include "Enums.h" #include "Enums.h"
using namespace System; using namespace System;
using namespace System::Collections::Generic;
using namespace XFX::Storage; using namespace XFX::Storage;
namespace XFX namespace XFX
@ -32,16 +35,19 @@ namespace XFX
Guide(); Guide();
public: public:
static bool IsScreenSaverEnabled(); static bool IsScreenSaverEnabled;
static bool IsVisible(); static bool IsVisible();
static NotificationPosition_t notificationPosition; static NotificationPosition_t NotificationPosition;
static IAsyncResult* BeginShowKeyboardInput(PlayerIndex_t player, char* title, char* description, char* defaultText, AsyncCallback callback, Object* state); static IAsyncResult* BeginShowKeyboardInput(PlayerIndex_t player, char* title, char* description, char* defaultText, AsyncCallback callback, Object* state);
static IAsyncResult* BeginShowMessageBox(PlayerIndex_t player, char* title, char* text, IEnumerable<char*>* buttons, int focusButton, MessageBoxIcon_t icon, AsyncCallback callback, Object* state);
static IAsyncResult* BeginShowStorageDeviceSelector(int sizeInBytes, int directoryCount, AsyncCallback callback, Object* state); static IAsyncResult* BeginShowStorageDeviceSelector(int sizeInBytes, int directoryCount, AsyncCallback callback, Object* state);
static IAsyncResult* BeginShowStorageDeviceSelector(AsyncCallback callback, Object* state); static IAsyncResult* BeginShowStorageDeviceSelector(AsyncCallback callback, Object* state);
static IAsyncResult* BeginShowStorageDeviceSelector(PlayerIndex_t player, int sizeInBytes, int directoryCount, AsyncCallback callback, Object* state); static IAsyncResult* BeginShowStorageDeviceSelector(PlayerIndex_t player, int sizeInBytes, int directoryCount, AsyncCallback callback, Object* state);
static IAsyncResult* BeginShowStorageDeviceSelector(PlayerIndex_t player, AsyncCallback callback, Object* state); static IAsyncResult* BeginShowStorageDeviceSelector(PlayerIndex_t player, AsyncCallback callback, Object* state);
static void DelayNotifications(TimeSpan timespan);
static char* EndShowKeyboardInput(IAsyncResult* result); static char* EndShowKeyboardInput(IAsyncResult* result);
static int EndShowMessageBox(IAsyncResult* result);
static StorageDevice EndShowStorageDeviceSelector(IAsyncResult* result); static StorageDevice EndShowStorageDeviceSelector(IAsyncResult* result);
}; };
} }

View File

@ -0,0 +1,33 @@
#include <System/Interfaces.h>
#include <System/Threading/WaitHandle.h>
using namespace System;
using namespace System::Threading;
namespace XFX
{
namespace GamerServices
{
class Guide;
class StorageDeviceAsyncResult : public IAsyncResult
{
friend class Guide;
private:
Object* syncObject;
int playerIndex;
StorageDeviceAsyncResult(Object* stateObject, int player);
StorageDeviceAsyncResult(const StorageDeviceAsyncResult &obj);
StorageDeviceAsyncResult(IAsyncResult* &obj);
public:
Object* AsyncState();
bool CompletedSynchronously();
bool IsCompleted();
WaitHandle* AsyncWaitHandle();
};
}
}

View File

@ -15,6 +15,7 @@
#include "GraphicsDeviceCapabilities.h" #include "GraphicsDeviceCapabilities.h"
#include "GraphicsDeviceCreationParameters.h" #include "GraphicsDeviceCreationParameters.h"
#include "PresentationParameters.h" #include "PresentationParameters.h"
#include "RenderTarget2D.h"
#include "TextureCollection.h" #include "TextureCollection.h"
#include "Viewport.h" #include "Viewport.h"
@ -34,10 +35,10 @@ namespace XFX
/// Performs primitive-based rendering, creates resources, handles system-level /// Performs primitive-based rendering, creates resources, handles system-level
/// variables, adjusts gamma ramp levels, and creates shaders. /// variables, adjusts gamma ramp levels, and creates shaders.
/// </summary> /// </summary>
class GraphicsDevice : public IDisposable class GraphicsDevice : public IDisposable, virtual Object
{ {
private: private:
GraphicsAdapter _adapter; GraphicsAdapter* _adapter;
DepthStencilBuffer _depthStencilBuffer; DepthStencilBuffer _depthStencilBuffer;
DeviceType_t _deviceType; DeviceType_t _deviceType;
GraphicsDeviceCapabilities graphicsDeviceCapabilities; GraphicsDeviceCapabilities graphicsDeviceCapabilities;
@ -45,19 +46,31 @@ namespace XFX
TextureCollection textures; TextureCollection textures;
Color clearColor; Color clearColor;
Viewport viewport; Viewport viewport;
void setPresentationParameters(PresentationParameters* presentationParameters);
protected: protected:
virtual void Dispose(bool disposing); virtual void Dispose(bool disposing);
virtual void raise_DeviceLost(Object* sender, EventArgs e);
virtual void raise_DeviceReset(Object* sender, EventArgs e);
virtual void raise_DeviceResetting(Object* sender, EventArgs e);
virtual void raise_Disposing(Object* sender, EventArgs e);
public: public:
EventHandler DeviceLost;
EventHandler DeviceReset;
EventHandler DeviceResetting;
EventHandler Disposing;
GraphicsDeviceCreationParameters CreationParameters(); GraphicsDeviceCreationParameters CreationParameters();
DepthStencilBuffer GetDepthStencilBuffer(); DepthStencilBuffer getDepthStencilBuffer();
void SetDepthStencilBuffer(DepthStencilBuffer buffer); void setDepthStencilBuffer(DepthStencilBuffer buffer);
PresentationParameters* getPresentationParameters();
TextureCollection Textures(); TextureCollection Textures();
Viewport Viewport_(); Viewport getViewport();
void Viewport_(Viewport newValue); void setViewport(Viewport value);
GraphicsDevice(GraphicsAdapter adapter, DeviceType_t deviceType, PresentationParameters presentationParameters); GraphicsDevice(GraphicsAdapter* adapter, DeviceType_t deviceType, PresentationParameters* presentationParameters);
GraphicsDevice(); GraphicsDevice();
virtual ~GraphicsDevice(); virtual ~GraphicsDevice();
@ -76,7 +89,7 @@ namespace XFX
template <class T> template <class T>
void DrawUserPrimitives(PrimitiveType_t primitiveType, T vertexData[], int vertexOffset, int primitiveCount); void DrawUserPrimitives(PrimitiveType_t primitiveType, T vertexData[], int vertexOffset, int primitiveCount);
void EvictManagedResources(); void EvictManagedResources();
GammaRamp GetGammaRamp(); GammaRamp* GetGammaRamp();
int* GetPixelShaderBooleanConstant(int startRegister, int constantCount); int* GetPixelShaderBooleanConstant(int startRegister, int constantCount);
int* GetPixelShaderInt32Constant(int startRegister, int constantCount); int* GetPixelShaderInt32Constant(int startRegister, int constantCount);
Matrix* GetPixelShaderMatrixArrayConstant(int startRegister, int constantCount); Matrix* GetPixelShaderMatrixArrayConstant(int startRegister, int constantCount);
@ -86,6 +99,11 @@ namespace XFX
float* GetPixelShaderSingleConstant(int startRegister, int constantCount); float* GetPixelShaderSingleConstant(int startRegister, int constantCount);
Vector2* GetPixelShaderVector2ArrayConstant(int startRegister, int constantCount); Vector2* GetPixelShaderVector2ArrayConstant(int startRegister, int constantCount);
Vector2 GetPixelShaderVector2Constant(int startRegister); Vector2 GetPixelShaderVector2Constant(int startRegister);
void Present();
void Reset();
void Reset(PresentationParameters* presentationParameters);
void SetGammaRamp(bool calibrate, GammaRamp* ramp);
void SetRenderTarget(int renderTargetIndex, RenderTarget2D* renderTarget);
void SetVertexShaderConstant(int startRegister, Matrix constantData); void SetVertexShaderConstant(int startRegister, Matrix constantData);
void SetVertexShaderConstant(int startRegister, Vector4 constantData); void SetVertexShaderConstant(int startRegister, Vector4 constantData);
}; };

View File

@ -0,0 +1,62 @@
/********************************************************
* RenderTarget.h *
* *
* XFX RenderTarget definition file *
* Copyright © XFX Team. All Rights Reserved *
********************************************************/
#ifndef _XFX_GRAPHICS_RENDERTARGET_
#define _XFX_GRAPHICS_RENDERTARGET_
#include <System/Interfaces.h>
#include <System/Types.h>
#include "Enums.h"
using namespace System;
namespace XFX
{
namespace Graphics
{
class RenderTarget : public IDisposable, virtual Object
{
private:
bool isContentLost;
bool isDisposed;
protected:
GraphicsDevice* graphicsDevice;
SurfaceFormat_t format;
int width;
int height;
int multiSampleQuality;
MultiSampleType_t multiSampleType;
RenderTargetUsage_t renderTargetUsage;
int numLevels;
virtual void Dispose(bool disposing);
virtual void raise_ContentLost(Object* sender, EventArgs e);
void raise_Disposing(Object* sender, EventArgs e);
public:
SurfaceFormat_t getFormat();
GraphicsDevice* getGraphicsDevice();
int Height();
bool IsContentLost();
bool IsDisposed();
int MultiSampleQuality();
MultiSampleType_t getMultiSampleType();
char* Name;
Object* Tag;
int Width();
EventHandler ContentLost;
EventHandler Disposing;
virtual ~RenderTarget();
void Dispose();
};
}
}
#endif //_XFX_GRAPHICS_RENDERTARGET_

View File

@ -0,0 +1,43 @@
/********************************************************
* RenderTarget2D.h *
* *
* XFX RenderTarget2D definition file *
* Copyright © XFX Team. All Rights Reserved *
********************************************************/
#ifndef _XFX_GRAPHICS_RENDERTARGET2D_
#define _XFX_GRAPHICS_RENDERTARGET2D_
#include <System/Types.h>
#include "RenderTarget.h"
//#include "Texture2D.h"
using namespace System;
namespace XFX
{
namespace Graphics
{
class GraphicsDevice;
class Texture2D;
class RenderTarget2D : public RenderTarget, virtual Object
{
private:
Texture2D* texture;
int renderBufferIdentifier;
protected:
void Dispose(bool disposing);
public:
RenderTarget2D(GraphicsDevice* graphicsDevice, int width, int height, int numberLevels, SurfaceFormat_t format);
RenderTarget2D(GraphicsDevice* graphicsDevice, int width, int height, int numberLevels, SurfaceFormat_t format, MultiSampleType_t multiSampleType, int multiSampleQuality);
RenderTarget2D(GraphicsDevice* graphicsDevice, int width, int height, int numberLevels, SurfaceFormat_t format, RenderTargetUsage_t usage);
RenderTarget2D(GraphicsDevice* graphicsDevice, int width, int height, int numberLevels, SurfaceFormat_t format, MultiSampleType_t multiSampleType, int multiSampleQuality, RenderTargetUsage_t usage);
Texture2D* GetTexture();
};
}
}
#endif //_XFX_GRAPHICS_RENDERTARGET2D_

View File

@ -9,6 +9,7 @@
#include "Texture.h" #include "Texture.h"
#include <System/IO/Stream.h> #include <System/IO/Stream.h>
#include <System/Types.h>
using namespace System; using namespace System;
using namespace System::IO; using namespace System::IO;
@ -47,7 +48,7 @@ namespace XFX
Texture2D(); Texture2D();
Texture2D(GraphicsDevice* graphicsDevice, int width, int height); Texture2D(GraphicsDevice* graphicsDevice, int width, int height);
Texture2D(GraphicsDevice* graphicsDevice, int width, int height, int numberLevels, TextureUsage_t usage, SurfaceFormat_t format); Texture2D(GraphicsDevice* graphicsDevice, int width, int height, int numberLevels, TextureUsage_t usage, SurfaceFormat_t format);
Texture2D(const Texture2D &obj); Texture2D(const Texture2D &obj); // Copy constructor
static Texture2D* FromFile(GraphicsDevice* graphicsDevice, Stream* textureStream); static Texture2D* FromFile(GraphicsDevice* graphicsDevice, Stream* textureStream);
static Texture2D* FromFile(GraphicsDevice* graphicsDevice, Stream* textureStream, TextureCreationParameters creationParameters); static Texture2D* FromFile(GraphicsDevice* graphicsDevice, Stream* textureStream, TextureCreationParameters creationParameters);

View File

@ -8,16 +8,15 @@
#define _XFX_GRAPHICS_TEXTURECOLLECTION_ #define _XFX_GRAPHICS_TEXTURECOLLECTION_
#include <System/Collections/Generic/List.h> #include <System/Collections/Generic/List.h>
#include "Texture.h"
using namespace System::Collections::Generic; using namespace System::Collections::Generic;
namespace XFX namespace XFX
{ {
class Texture;
namespace Graphics namespace Graphics
{ {
class Texture;
/// <summary> /// <summary>
/// Represents a collection of Texture objects. /// Represents a collection of Texture objects.
/// </summary> /// </summary>
@ -26,13 +25,14 @@ namespace XFX
private: private:
bool disposed; bool disposed;
List<Texture*> textures; List<Texture*> textures;
void Dispose();
void Dispose(bool disposing); void Dispose(bool disposing);
public: public:
TextureCollection(); TextureCollection();
~TextureCollection(); ~TextureCollection();
void Dispose();
Texture* operator[](int index); Texture* operator[](int index);
}; };
} }

View File

@ -31,8 +31,13 @@ namespace XFX
int X; int X;
int Y; int Y;
bool Equals(Viewport obj);
int GetHashCode();
Vector3 Project(Vector3 source, Matrix projection, Matrix view, Matrix world); Vector3 Project(Vector3 source, Matrix projection, Matrix view, Matrix world);
Vector3 Unproject(Vector3 source, Matrix projection, Matrix view, Matrix world); Vector3 Unproject(Vector3 source, Matrix projection, Matrix view, Matrix world);
bool operator !=(Viewport right);
bool operator ==(Viewport right);
}; };
} }
} }

View File

@ -11,9 +11,6 @@ namespace XFX
{ {
namespace Net namespace Net
{ {
/// <summary>
/// Defines the reason a session ended.
/// </summary>
struct NetworkSessionEndReason struct NetworkSessionEndReason
{ {
enum type enum type
@ -24,9 +21,7 @@ namespace XFX
Disconnected Disconnected
}; };
}; };
/// <summary>
/// Contains additional data about a NetworkSessionJoinException.
/// </summary>
struct NetworkSessionJoinError struct NetworkSessionJoinError
{ {
enum type enum type
@ -36,9 +31,7 @@ namespace XFX
SessionFull SessionFull
}; };
}; };
/// <summary>
/// Defines the different states of a multiplayer session.
/// </summary>
struct NetworkSessionState struct NetworkSessionState
{ {
enum type enum type
@ -48,9 +41,7 @@ namespace XFX
Ended Ended
}; };
}; };
/// <summary>
/// Defines the different types of a multiplayer session.
/// </summary>
struct NetworkSessionType struct NetworkSessionType
{ {
enum type enum type
@ -62,9 +53,6 @@ namespace XFX
}; };
}; };
/// <summary>
/// Defines options for network packet transmission.
/// </summary>
struct SendDataOptions struct SendDataOptions
{ {
enum type enum type
@ -76,11 +64,11 @@ namespace XFX
}; };
}; };
typedef NetworkSessionEndReason::type NetworkSessionEndReason_t; typedef NetworkSessionEndReason::type NetworkSessionEndReason_t; // Defines the reason a session ended.
typedef NetworkSessionJoinError::type NetworkSessionJoinError_t; typedef NetworkSessionJoinError::type NetworkSessionJoinError_t; // Contains additional data about a NetworkSessionJoinException.
typedef NetworkSessionState::type NetworkSessionState_t; typedef NetworkSessionState::type NetworkSessionState_t; // Defines the different states of a multiplayer session.
typedef NetworkSessionType::type NetworkSessionType_t; typedef NetworkSessionType::type NetworkSessionType_t; // Defines the different types of a multiplayer session.
typedef SendDataOptions::type SendDataOptions_t; typedef SendDataOptions::type SendDataOptions_t; // Defines options for network packet transmission.
} }
} }

View File

@ -15,10 +15,8 @@ namespace XFX
namespace Net namespace Net
{ {
/// <summary> // Provides common functionality for efficiently reading incoming network packets.
/// Provides common functionality for efficiently reading incoming network packets. class PacketReader : public BinaryReader, virtual Object
/// </summary>
class PacketReader : public BinaryReader
{ {
public: public:
int Length(); int Length();

View File

@ -26,11 +26,12 @@ namespace XFX
/// </summary> /// </summary>
class StorageContainer : public IDisposable, virtual Object class StorageContainer : public IDisposable, virtual Object
{ {
friend class StorageDevice;
private: private:
bool isDisposed; bool isDisposed;
DirectoryInfo containerFolder; DirectoryInfo containerFolder;
StorageDevice* device; StorageDevice* device;
EventHandler Disposing;
PlayerIndex_t playerIndex; PlayerIndex_t playerIndex;
char* titleName; char* titleName;
@ -38,9 +39,11 @@ namespace XFX
~StorageContainer(); ~StorageContainer();
public: public:
EventHandler Disposing;
bool IsDisposed(); bool IsDisposed();
char* Path(); char* Path();
StorageDevice StorageDevice_(); StorageDevice* StorageDevice_();
static char* TitleLocation(); static char* TitleLocation();
char* TitleName(); char* TitleName();

View File

@ -8,10 +8,18 @@
#define _XFX_STORAGE_STORAGEDEVICE_ #define _XFX_STORAGE_STORAGEDEVICE_
#include <System/Types.h> #include <System/Types.h>
#include <System/Object.h>
#include "../Enums.h" #include "../Enums.h"
using namespace System;
namespace XFX namespace XFX
{ {
namespace GamerServices
{
class Guide;
}
namespace Storage namespace Storage
{ {
class StorageContainer; class StorageContainer;
@ -19,13 +27,15 @@ namespace XFX
/// <summary> /// <summary>
/// Represents a storage device for user data, such as a memory unit or hard drive. /// Represents a storage device for user data, such as a memory unit or hard drive.
/// </summary> /// </summary>
class StorageDevice class StorageDevice : virtual Object
{ {
friend class XFX::GamerServices::Guide;
private: private:
PlayerIndex_t _playerIndex; PlayerIndex_t _playerIndex;
bool _playerSpecified; uint _deviceIndex;
StorageDevice(PlayerIndex_t playerIndex, bool playerSpecified); StorageDevice(uint deviceIndex, PlayerIndex_t playerIndex);
public: public:
long long FreeSpace(); long long FreeSpace();

View File

@ -9,9 +9,7 @@
#include <System/Array.h> #include <System/Array.h>
#include <System/Exception.h> #include <System/Exception.h>
#include <System/Collections/Generic/Dictionary.h> #include "EqualityComparer.h"
#include <System/Collections/Generic/EqualityComparer.h>
#include "HashHelpers.h"
#include "Interfaces.h" #include "Interfaces.h"
#include "KeyValuePair.h" #include "KeyValuePair.h"
@ -70,66 +68,16 @@ namespace System
Dictionary<TKey, TValue>* _dictionary; Dictionary<TKey, TValue>* _dictionary;
public: public:
int Count() int Count();
{
return _dictionary.Count();
}
KeyCollection(Dictionary<TKey, TValue> dictionary) KeyCollection(Dictionary<TKey, TValue> dictionary);
{ KeyCollection(const KeyCollection<UKey, UValue> &obj);
_dictionary = &dictionary;
}
KeyCollection(const KeyCollection<UKey, UValue> &obj) void Add(UKey item);
{ void Clear();
_dictionary = &obj._dictionary; bool Contains(UKey item);
} void CopyTo(UKey array[], int index);
bool Remove(UKey item);
void Add(UKey item)
{
throw NotSupportedException("Adding keys directly to the Dictionary::Keycollection is not supported.");
}
void Clear()
{
throw NotSupportedException("Directly clearing the Dictionary::KeyCollection is not supported.");
}
bool Contains(UKey item)
{
return _dictionary.ContainsKey(item);
}
void CopyTo(UKey array[], int index)
{
if(array == null)
{
throw ArgumentNullException("array");
}
if((index < 0) ||(index > Array::Length(array)))
{
throw ArgumentOutOfRangeException("index", "Non-negative array index required.");
}
if((Array::Length(array) - index) < _dictionary.Count())
{
throw ArgumentException("Array plus offset too small.");
}
int count = _dictionary.Count();
Entry<UKey, UValue> entries[] = _dictionary.entries;
for(int i = 0; i < count; i++)
{
if(entries[i].hashCode >= 0)
{
array[index++] = entries[i].key;
}
}
}
bool Remove(UKey item)
{
throw NotSupportedException("Removing keys directly from the Dictionary::KeyCollection is not supported.");
return false;
}
}; };
/// <summary> /// <summary>
@ -174,82 +122,171 @@ namespace System
}*/ }*/
} }
Dictionary(int capacity); Dictionary(int capacity);
~Dictionary() ~Dictionary();
{
delete[] buckets;
delete[] entries;
}
void Add(TKey key, TValue value) void Add(TKey key, TValue value)
{ {
Insert(key, value, true); Insert(key, value, true);
} }
void Clear() void Clear();
{
if(count > 0)
{
for(int i = 0; i < Array::Length(buckets); i++)
{
buckets[i] = -1;
}
Array::Clear(entries, 0, count);
freeList = -1;
count = 0;
freeCount = 0;
version++;
}
}
bool ContainsKey(TKey key); bool ContainsKey(TKey key);
bool ContainsValue(TValue value); bool ContainsValue(TValue value);
bool Remove(TKey key) bool Remove(TKey key);
{ bool TryGetValue(TKey key, out TValue value);
if(buckets) };
{
int num = comparer->GetHashCode(key) & 0x7fffffff;
int index = num % Array::Length(buckets);
int num3 = -1;
for(int i = buckets[index]; i >= 0; i = entries[i].next)
{
if((entries[i].hashCode == num) && comparer->Equals(entries[i].key, key))
{
if(num3 < 0)
{
buckets[index] = entries[i].next;
}
else
{
entries[num3].next = entries[i].next;
}
entries[i].hashCode = -1;
entries[i].next = freeList;
entries[i].key = TKey();
entries[i].value = TValue();
freeList = i;
freeCount++;
version++;
return true;
}
num3 = i;
}
}
return false;
}
bool TryGetValue(TKey key, out TValue value) //////////////////////////////////////////////////////////////////////
template <class TKey, class TValue>
template <class UKey, class UValue>
int Dictionary<TKey, TValue>::KeyCollection<UKey, UValue>::Count()
{
return _dictionary->Count();
}
template <class TKey, class TValue>
template <class UKey, class UValue>
Dictionary<TKey, TValue>::KeyCollection<UKey, UValue>::KeyCollection(Dictionary<TKey, TValue> dictionary)
{
_dictionary = &dictionary;
}
template <class TKey, class TValue>
template <class UKey, class UValue>
Dictionary<TKey, TValue>::KeyCollection<UKey, UValue>::KeyCollection(const KeyCollection<UKey, UValue> &obj)
{
_dictionary = obj._dictionary;
}
template <class TKey, class TValue>
template <class UKey, class UValue>
void Dictionary<TKey, TValue>::KeyCollection<UKey, UValue>::Add(UKey item)
{
throw NotSupportedException("Adding keys directly to the Dictionary::Keycollection is not supported.");
}
template <class TKey, class TValue>
template <class UKey, class UValue>
void Dictionary<TKey, TValue>::KeyCollection<UKey, UValue>::Clear()
{
throw NotSupportedException("Directly clearing the Dictionary::KeyCollection is not supported.");
}
template <class TKey, class TValue>
template <class UKey, class UValue>
bool Dictionary<TKey, TValue>::KeyCollection<UKey, UValue>::Contains(UKey item)
{
return _dictionary.ContainsKey(item);
}
template <class TKey, class TValue>
template <class UKey, class UValue>
void Dictionary<TKey, TValue>::KeyCollection<UKey, UValue>::CopyTo(UKey array[], int index)
{
if(array == null)
{ {
int index = FindEntry(key); throw ArgumentNullException("array");
if(index >= 0)
{
value = entries[index].value;
return true;
}
value = TValue();
return false;
} }
}; if((index < 0) ||(index > Array::Length(array)))
{
throw ArgumentOutOfRangeException("index", "Non-negative array index required.");
}
if((Array::Length(array) - index) < _dictionary.Count())
{
throw ArgumentException("Array plus offset too small.");
}
int count = _dictionary.Count();
Entry<UKey, UValue> entries[] = _dictionary.entries;
for(int i = 0; i < count; i++)
{
if(entries[i].hashCode >= 0)
{
array[index++] = entries[i].key;
}
}
}
template <class TKey, class TValue>
template <class UKey, class UValue>
bool Dictionary<TKey, TValue>::KeyCollection<UKey, UValue>::Remove(UKey item)
{
throw NotSupportedException("Removing keys directly from the Dictionary::KeyCollection is not supported.");
return false;
}
template <class TKey, class TValue>
Dictionary<TKey, TValue>::~Dictionary()
{
delete[] buckets;
delete[] entries;
}
template <class TKey, class TValue>
void Dictionary<TKey, TValue>::Clear()
{
if(count > 0)
{
for(int i = 0; i < Array::Length(buckets); i++)
{
buckets[i] = -1;
}
Array::Clear(entries, 0, count);
freeList = -1;
count = 0;
freeCount = 0;
version++;
}
}
template <class TKey, class TValue>
bool Dictionary<TKey, TValue>::Remove(TKey key)
{
if(buckets)
{
int num = comparer->GetHashCode(key) & 0x7fffffff;
int index = num % Array::Length(buckets);
int num3 = -1;
for(int i = buckets[index]; i >= 0; i = entries[i].next)
{
if((entries[i].hashCode == num) && comparer->Equals(entries[i].key, key))
{
if(num3 < 0)
{
buckets[index] = entries[i].next;
}
else
{
entries[num3].next = entries[i].next;
}
entries[i].hashCode = -1;
entries[i].next = freeList;
entries[i].key = TKey();
entries[i].value = TValue();
freeList = i;
freeCount++;
version++;
return true;
}
num3 = i;
}
}
return false;
}
template <class TKey, class TValue>
bool Dictionary<TKey, TValue>::TryGetValue(TKey key, out TValue value)
{
int index = FindEntry(key);
if(index >= 0)
{
value = entries[index].value;
return true;
}
value = TValue();
return false;
}
} }
} }
} }

View File

@ -54,8 +54,8 @@ namespace System
virtual bool Remove(TKey key)=0; virtual bool Remove(TKey key)=0;
virtual bool TryGetValue(TKey key, out TValue value)=0; virtual bool TryGetValue(TKey key, out TValue value)=0;
virtual ICollection<TKey> Keys()=0; virtual ICollection<TKey>& Keys()=0;
virtual ICollection<TValue> Values()=0; virtual ICollection<TValue>& Values()=0;
}; };
/// <summary> /// <summary>
@ -75,7 +75,7 @@ namespace System
interface IEnumerable interface IEnumerable
{ {
public: public:
virtual IEnumerator<T> GetEnumerator()=0; virtual IEnumerator<T>& GetEnumerator()=0;
}; };
/// <summary> /// <summary>

View File

@ -334,7 +334,7 @@ namespace System
if (other._size == 0) // is other array is empty -- clear this array if (other._size == 0) // is other array is empty -- clear this array
Clear(); Clear();
Capacity(other._size); // set size setCapacity(other._size); // set size
memcpy(_items, other._items, sizeof(T) * other._size); memcpy(_items, other._items, sizeof(T) * other._size);

View File

@ -9,6 +9,7 @@
#include "../Exception.h" #include "../Exception.h"
#include "../Interfaces.h" #include "../Interfaces.h"
#include "../Object.h"
#include "../Types.h" #include "../Types.h"
#include "../Threading/WaitHandle.h" #include "../Threading/WaitHandle.h"
@ -19,7 +20,7 @@ namespace System
/// <summary> /// <summary>
/// ///
/// </summary> /// </summary>
class StreamAsyncResult : public IAsyncResult class StreamAsyncResult : public IAsyncResult, virtual Object
{ {
Object* _state; Object* _state;
bool completed; bool completed;
@ -29,7 +30,7 @@ namespace System
public: public:
Object* ASyncState(); Object* ASyncState();
Threading::WaitHandle AsyncWaitHandle(); Threading::WaitHandle* AsyncWaitHandle();
virtual bool CompletedSynchronously(); virtual bool CompletedSynchronously();
bool IsCompleted(); bool IsCompleted();
Exception* Exception_(); Exception* Exception_();

View File

@ -19,8 +19,8 @@ namespace System
interface IAsyncResult interface IAsyncResult
{ {
public: public:
virtual Object* ASyncState()=0; virtual Object* AsyncState()=0;
virtual Threading::WaitHandle AsyncWaitHandle()=0; virtual Threading::WaitHandle* AsyncWaitHandle()=0;
virtual bool CompletedSynchronously()=0; virtual bool CompletedSynchronously()=0;
virtual bool IsCompleted()=0; virtual bool IsCompleted()=0;
}; };

View File

@ -129,6 +129,10 @@
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}" UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
> >
</Filter> </Filter>
<File
RelativePath=".\makefile"
>
</File>
</Files> </Files>
<Globals> <Globals>
</Globals> </Globals>

49
src/libSystem/makefile Normal file
View File

@ -0,0 +1,49 @@
#
# update this variable to wherever you installed the OpenXDK libraries
#
#########################################################################
PREFIX = /usr/local/openxdk
CC = gcc
CCAS = gcc
CPP = g++
AR = ar rcu
RANLIB = ranlib
CXBE = $(PREFIX)/bin/cxbe
SDLFLAGS = -DENABLE_XBOX -DDEBUG
CC_FLAGS = -c -g -std=gnu99 -ffreestanding -nostdlib -fno-builtin -fno-exceptions -mno-cygwin -march=i386 -mmmx -msse -mfpmath=sse $(SDLFLAGS)
CCAS_FLAGS = --32 -march=pentiumiii, mmx, sse -mtune=pentiumiii -msse-check=error
CPP_FLAGS = -c -O2 -Wall -nostdlib -fno-builtin -mno-cygwin -march=i386 -mmmx -msse -mfpmath=sse $(SDLFLAGS)
INCLUDE = -I$(PREFIX)/i386-pc-xbox/include -I$(PREFIX)/include -I$(PREFIX)/include/SDL -I../../include
CLINK = -nostdlib
ALIGN = -Wl,--file-alignment,0x20 -Wl,--section-alignment,0x20
SHARED = -shared
ENTRYPOINT = -Wl,--entry,_WinMainCRTStartup
STRIP = -Wl,--strip-all
LD_FLAGS = $(CLINK) $(ALIGN) $(SHARED) $(ENTRYPOINT) $(STRIP)
LD_DIRS = -L$(PREFIX)/i386-pc-xbox/lib -L$(PREFIX)/lib
LD_LIBS = $(LD_DIRS) -lm -lopenxdk -lhal -lc -lusb -lc -lxboxkrnl -lc -lhal -lxboxkrnl -lhal -lopenxdk -lc -lstdc++ -lgcc
OBJS =
all: libSystem.a
rebuild: clean libSystem.a
libSystem.a: $(OBJS)
$(AR) $@ $(OBJS)
$(RANLIB) $@
.c.o:
$(CC) -c $< $(CC_FLAGS) $(INCLUDE)
.cpp.o:
$(CPP) -c $< $(CPP_FLAGS) $(INCLUDE)
.s.o:
$(CCAS) -c $< $(CCAS_FLAGS)
clean:
rm -f *.o *.exe *.dll *.xbe *.cxbe *.lib *.a

View File

@ -44,13 +44,54 @@ namespace XFX
{ {
namespace Graphics namespace Graphics
{ {
GraphicsDeviceCreationParameters GraphicsDevice::CreationParameters()
{
}
DepthStencilBuffer GraphicsDevice::getDepthStencilBuffer()
{
return _depthStencilBuffer;
}
void GraphicsDevice::setDepthStencilBuffer(DepthStencilBuffer buffer)
{
_depthStencilBuffer = buffer;
}
void GraphicsDevice::setPresentationParameters(PresentationParameters* presentationParameters)
{
viewport.X = 0;
viewport.Y = 0;
viewport.Width = presentationParameters->BackBufferWidth;
viewport.Height = presentationParameters->BackBufferHeight;
}
Viewport GraphicsDevice::getViewport()
{
return viewport;
}
void GraphicsDevice::setViewport(Viewport value)
{
if (viewport != value)
{
}
}
TextureCollection GraphicsDevice::Textures() TextureCollection GraphicsDevice::Textures()
{ {
return textures; return textures;
} }
GraphicsDevice::GraphicsDevice(GraphicsAdapter adapter, DeviceType_t deviceType, PresentationParameters presentationParameters) GraphicsDevice::GraphicsDevice(GraphicsAdapter* adapter, DeviceType_t deviceType, PresentationParameters* presentationParameters)
{ {
if (adapter == null || presentationParameters == null)
throw new ArgumentNullException("adapter or presentationParameters is null.");
_adapter = adapter; _adapter = adapter;
if(deviceType != DeviceType::Hardware) if(deviceType != DeviceType::Hardware)
throw DeviceNotSupportedException("Only DeviceType::Hardware is supported."); throw DeviceNotSupportedException("Only DeviceType::Hardware is supported.");
@ -110,29 +151,6 @@ namespace XFX
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
glLoadIdentity();*/ glLoadIdentity();*/
} }
void GraphicsDevice::Clear(ClearOptions_t options, Color color, float depth, int stencil)
{
if(isDisposed)
throw ObjectDisposedException("GraphicsDevice");
switch(options)
{
case ClearOptions::Depth:
{
}
case ClearOptions::Stencil:
{
}
case ClearOptions::Target:
{
}
}
}
void GraphicsDevice::Dispose() void GraphicsDevice::Dispose()
{ {
@ -141,15 +159,51 @@ namespace XFX
void GraphicsDevice::Dispose(bool disposing) void GraphicsDevice::Dispose(bool disposing)
{ {
if(disposing) if (!isDisposed)
{ {
if(disposing)
{
textures.Dispose();
isDisposed = true;
}
} }
} }
void GraphicsDevice::SetVertexShaderConstant(int startRegister, Vector4 constantData) void GraphicsDevice::raise_DeviceLost(Object* sender, EventArgs e)
{ {
if (DeviceLost != null)
DeviceLost(sender, e);
}
void GraphicsDevice::raise_DeviceReset(Object* sender, EventArgs e)
{
if (DeviceReset != null)
DeviceReset(sender, e);
}
void GraphicsDevice::raise_DeviceResetting(Object* sender, EventArgs e)
{
if (DeviceResetting != null)
DeviceResetting(sender, e);
}
void GraphicsDevice::raise_Disposing(Object* sender, EventArgs e)
{
if (Disposing != null)
Disposing(sender, e);
}
void GraphicsDevice::Reset()
{
Reset(getPresentationParameters());
}
void GraphicsDevice::Reset(PresentationParameters* presentationParameters)
{
raise_DeviceResetting(this, EventArgs::Empty);
setPresentationParameters(presentationParameters);
raise_DeviceReset(this, EventArgs::Empty);
} }
} }
} }

View File

@ -26,6 +26,8 @@
// POSSIBILITY OF SUCH DAMAGE. // POSSIBILITY OF SUCH DAMAGE.
#include <GamerServices/Guide.h> #include <GamerServices/Guide.h>
#include <GamerServices/StorageDeviceAsyncResult.h>
#include <System/Exception.h>
#include <System/TimeSpan.h> #include <System/TimeSpan.h>
namespace XFX namespace XFX
@ -52,6 +54,12 @@ namespace XFX
return null; return null;
} }
IAsyncResult* Guide::BeginShowMessageBox(PlayerIndex_t player, char* title, char* text, IEnumerable<char*>* buttons, int focusButton, MessageBoxIcon_t icon, AsyncCallback callback, Object* state)
{
// just return null to stop warning until this thing's coded
return null;
}
IAsyncResult* Guide::BeginShowStorageDeviceSelector(int sizeInBytes, int directoryCount, AsyncCallback callback, Object* state) IAsyncResult* Guide::BeginShowStorageDeviceSelector(int sizeInBytes, int directoryCount, AsyncCallback callback, Object* state)
{ {
// just return null to stop warning until this thing's coded // just return null to stop warning until this thing's coded
@ -82,8 +90,20 @@ namespace XFX
return ""; return "";
} }
StorageDevice Guide::EndShowStorageDeviceSelector(IAsyncResult* result) 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;
}
StorageDevice Guide::EndShowStorageDeviceSelector(IAsyncResult* asyncResult)
{
StorageDeviceAsyncResult* result = (StorageDeviceAsyncResult*)asyncResult;
if (!result)
{
throw ArgumentNullException("result");
}
return StorageDevice(0, (PlayerIndex_t)result->playerIndex);
} }
} }
} }

View File

@ -903,34 +903,35 @@ namespace XFX
int Matrix::Decompose(Vector3 scale, Quaternion rotation, Vector3 translation) int Matrix::Decompose(Vector3 scale, Quaternion rotation, Vector3 translation)
{ {
//Get the translation.
translation.X = M41; translation.X = M41;
translation.Y = M42; translation.Y = M42;
translation.Z = M43; translation.Z = M43;
//Scaling is the length of the rows. float xs, ys, zs;
scale.X = (float)Math::Sqrt((M11 * M11) + (M12 * M12) + (M13 * M13)); if (Math::Sign(M11 * M12 * M13 * M14) < 0)
scale.Y = (float)Math::Sqrt((M21 * M21) + (M22 * M22) + (M23 * M23)); xs = -1.0f;
scale.Z = (float)Math::Sqrt((M31 * M31) + (M32 * M32) + (M33 * M33)); else
//If any of the scaling factors are zero, than the rotation matrix can not exist. xs = 1.0f;
if (Math::Abs(scale.X) < 1e-6f || if (Math::Sign(M21 * M22 * M23 * M24) < 0)
Math::Abs(scale.Y) < 1e-6f || ys = -1.0f;
Math::Abs(scale.Z) < 1e-6f) else
ys = 1.0f;
if (Math::Sign(M31 * M32 * M33 * M34) < 0)
zs = -1.0f;
else
zs = 1.0f;
scale.X = xs * (float)Math::Sqrt(M11 * M11 + M12 * M12 + M13 * M13);
scale.Y = ys * (float)Math::Sqrt(M21 * M21 + M22 * M22 + M23 * M23);
scale.Z = zs * (float)Math::Sqrt(M31 * M31 + M32 * M32 + M33 * M33);
if (scale.X == 0.0 || scale.Y == 0.0 || scale.Z == 0.0)
{ {
rotation = Quaternion::Identity; rotation = Quaternion::Identity;
return false; return false;
} //The rotation is the left over matrix after dividing out the scaling. }
Matrix rotationmatrix = Matrix(); Matrix m1 = Matrix(M11/scale.X, M12/scale.X, M13/scale.X, 0,
rotationmatrix.M11 = M11 / scale.X; M21/scale.Y, M22/scale.Y, M23/scale.Y, 0,
rotationmatrix.M12 = M12 / scale.X; M31/scale.Z, M32/scale.Z, M33/scale.Z, 0,
rotationmatrix.M13 = M13 / scale.X; 0, 0, 0, 1);
rotationmatrix.M21 = M21 / scale.Y; rotation = Quaternion::CreateFromRotationMatrix(m1);
rotationmatrix.M22 = M22 / scale.Y;
rotationmatrix.M23 = M23 / scale.Y;
rotationmatrix.M31 = M31 / scale.Z;
rotationmatrix.M32 = M32 / scale.Z;
rotationmatrix.M33 = M33 / scale.Z;
rotationmatrix.M44 = 1.0f;
Quaternion::CreateFromRotationMatrix(rotationmatrix, rotation);
return true; return true;
} }

View File

@ -38,17 +38,17 @@ namespace XFX
{ {
int PacketReader::Length() int PacketReader::Length()
{ {
return (int)BaseStream().Length(); return (int)BaseStream()->Length();
} }
int PacketReader::Position() int PacketReader::Position()
{ {
return (int)BaseStream().Position; return (int)BaseStream()->Position;
} }
int PacketReader::Position(int newValue) int PacketReader::Position(int newValue)
{ {
BaseStream().Position = newValue; BaseStream()->Position = newValue;
} }
PacketReader::PacketReader() PacketReader::PacketReader()

View File

@ -0,0 +1,56 @@
// Copyright (C) 2010-2012, XFX Team
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the copyright holder nor the names of any
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#include <Graphics/RenderTarget.h>
namespace XFX
{
namespace Graphics
{
RenderTarget::~RenderTarget()
{
Dispose(false);
}
void RenderTarget::Dispose()
{
Dispose(true);
}
void RenderTarget::Dispose(bool disposing)
{
if (!isDisposed)
{
if (disposing)
{
}
isDisposed = true;
}
}
}
}

View File

@ -0,0 +1,35 @@
// Copyright (C) 2010-2012, XFX Team
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above copyright
// notice, this list of conditions and the following disclaimer in the
// documentation and/or other materials provided with the distribution.
// * Neither the name of the copyright holder nor the names of any
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
// LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
// CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#include <Graphics/RenderTarget2D.h>
namespace XFX
{
namespace Graphics
{
}
}

View File

@ -47,12 +47,18 @@ namespace XFX
{ {
} }
StorageDevice::StorageDevice(uint deviceIndex, PlayerIndex_t playerIndex)
{
_playerIndex = playerIndex;
_deviceIndex = deviceIndex;
}
StorageContainer StorageDevice::OpenContainer(char* titleName) StorageContainer StorageDevice::OpenContainer(char* titleName)
{ {
if(titleName == null || titleName == "") if(!titleName || titleName == "")
throw ArgumentNullException("Non-null title name required."); throw ArgumentNullException("Non-null title name required.");
//return StorageContainer(*this, titleName, _playerSpecified, _playerIndex); return StorageContainer(*this, titleName, _deviceIndex, _playerIndex);
} }
} }
} }

View File

@ -0,0 +1,35 @@
#include <GamerServices/StorageDeviceAsyncResult.h>
namespace XFX
{
namespace GamerServices
{
Object* StorageDeviceAsyncResult::AsyncState()
{
return syncObject;
}
bool StorageDeviceAsyncResult::CompletedSynchronously()
{
return true;
}
StorageDeviceAsyncResult::StorageDeviceAsyncResult(Object* stateObject, int player)
{
syncObject = stateObject;
playerIndex = player;
}
StorageDeviceAsyncResult::StorageDeviceAsyncResult(const StorageDeviceAsyncResult &obj)
{
syncObject = obj.syncObject;
playerIndex = obj.playerIndex;
}
StorageDeviceAsyncResult::StorageDeviceAsyncResult(IAsyncResult* &obj)
{
}
}
}

View File

@ -48,6 +48,18 @@ namespace XFX
return ((-1.401298E-45f <= num) && (num <= 1.401298E-45f)); return ((-1.401298E-45f <= num) && (num <= 1.401298E-45f));
} }
bool Viewport::Equals(Viewport obj)
{
return ((AspectRatio() == obj.AspectRatio()) && (Height == obj.Height) &&
(MaxDepth == obj.MaxDepth) && (MinDepth == obj.MinDepth) &&
(Width == obj.Width) && (X == obj.X) && (Y == obj.Y));
}
int Viewport::GetHashCode()
{
return ((int)AspectRatio() + Height + MaxDepth + MinDepth + Width + X + Y);
}
Vector3 Viewport::Project(Vector3 source, Matrix projection, Matrix view, Matrix world) Vector3 Viewport::Project(Vector3 source, Matrix projection, Matrix view, Matrix world)
{ {
Matrix matrix = Matrix::Multiply(Matrix::Multiply(world, view), projection); Matrix matrix = Matrix::Multiply(Matrix::Multiply(world, view), projection);
@ -78,5 +90,15 @@ namespace XFX
} }
return position; return position;
} }
bool Viewport::operator !=(Viewport right)
{
return !Equals(right);
}
bool Viewport::operator ==(Viewport right)
{
return Equals(right);
}
} }
} }

View File

@ -223,6 +223,14 @@
RelativePath=".\PresentationParameters.cpp" RelativePath=".\PresentationParameters.cpp"
> >
</File> </File>
<File
RelativePath=".\RenderTarget.cpp"
>
</File>
<File
RelativePath=".\RenderTarget2D.cpp"
>
</File>
<File <File
RelativePath=".\Sprite.cpp" RelativePath=".\Sprite.cpp"
> >
@ -327,6 +335,10 @@
RelativePath=".\Guide.cpp" RelativePath=".\Guide.cpp"
> >
</File> </File>
<File
RelativePath=".\StorageDeviceAsyncResult.cpp"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="Net" Name="Net"
@ -493,6 +505,14 @@
RelativePath="..\..\include\Graphics\PresentationParameters.h" RelativePath="..\..\include\Graphics\PresentationParameters.h"
> >
</File> </File>
<File
RelativePath="..\..\include\Graphics\RenderTarget.h"
>
</File>
<File
RelativePath="..\..\include\Graphics\RenderTarget2D.h"
>
</File>
<File <File
RelativePath="..\..\include\Graphics\Sprite.h" RelativePath="..\..\include\Graphics\Sprite.h"
> >
@ -645,6 +665,10 @@
RelativePath="..\..\include\GamerServices\Guide.h" RelativePath="..\..\include\GamerServices\Guide.h"
> >
</File> </File>
<File
RelativePath="..\..\include\GamerServices\StorageDeviceAsyncResult.h"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="Net" Name="Net"

View File

@ -34,7 +34,7 @@ LD_LIBS = $(LD_DIRS) -lmscorlib -lm -lopenxdk -lhal -lc -lusb -lc -lxboxkrnl -l
OBJS = BoundingBox.o BoundingFrustrum.o BoundingSphere.o MathHelper.o Matrix.o Plane.o Point.o Quaternion.o Ray.o Rectangle.o Vector2.o Vector3.o Vector4.o OBJS = BoundingBox.o BoundingFrustrum.o BoundingSphere.o MathHelper.o Matrix.o Plane.o Point.o Quaternion.o Ray.o Rectangle.o Vector2.o Vector3.o Vector4.o
AUDIO_OBJS = AUDIO_OBJS =
CONTENT_OBJS = ContentManager.o ContentReader.o CONTENT_OBJS = ContentManager.o ContentReader.o
GAMERSERVICES_OBJS = Guide.o GAMERSERVICES_OBJS = Guide.o StorageDeviceAsyncResult.o
GRAPHICS_OBJS = Color.o DepthStencilBuffer.o DisplayMode.o DisplayModeCollection.o GraphicsAdapter.o GraphicsDevice.o pbKit.o Sprite.o SpriteBatch.o SpriteFont.o Texture.o Texture2D.o TextureCollection.o TextureCreationParameters.o VertexElement.o VertexPositionColor.o VertexPositionNormalTexture.o VertexPositionTexture.o Viewport.o GRAPHICS_OBJS = Color.o DepthStencilBuffer.o DisplayMode.o DisplayModeCollection.o GraphicsAdapter.o GraphicsDevice.o pbKit.o Sprite.o SpriteBatch.o SpriteFont.o Texture.o Texture2D.o TextureCollection.o TextureCreationParameters.o VertexElement.o VertexPositionColor.o VertexPositionNormalTexture.o VertexPositionTexture.o Viewport.o
INPUT_OBJS = GamePad.o Keyboard.o Mouse.o INPUT_OBJS = GamePad.o Keyboard.o Mouse.o
MEDIA_OBJS = VideoPlayer.o MEDIA_OBJS = VideoPlayer.o

View File

@ -73,6 +73,11 @@ namespace System
return _nbytes; return _nbytes;
} }
Threading::WaitHandle* StreamAsyncResult::AsyncWaitHandle()
{
}
void StreamAsyncResult::SetComplete(Exception* e) void StreamAsyncResult::SetComplete(Exception* e)
{ {
exc = e; exc = e;

View File

@ -24,7 +24,7 @@ ENTRYPOINT = -Wl,--entry,_WinMainCRTStartup
STRIP = -Wl,--strip-all STRIP = -Wl,--strip-all
LD_FLAGS = $(CLINK) $(ALIGN) $(SHARED) $(ENTRYPOINT) $(STRIP) LD_FLAGS = $(CLINK) $(ALIGN) $(SHARED) $(ENTRYPOINT) $(STRIP)
LD_DIRS = -L$(PREFIX)/i386-pc-xbox/lib -L$(PREFIX)/lib LD_DIRS = -L$(PREFIX)/i386-pc-xbox/lib -L$(PREFIX)/lib
LD_LIBS = $(LD_DIRS) -lm -lopenxdk -lhal -lc -lusb -lc -lxboxkrnl -lc -lhal -lxboxkrnl -lhal -lopenxdk -lc -lstdc++ -lgcc LD_LIBS = $(LD_DIRS) -lmscorlib -lm -lopenxdk -lhal -lc -lusb -lc -lxboxkrnl -lc -lhal -lxboxkrnl -lhal -lopenxdk -lc -lstdc++ -lgcc
OBJS = Array.o BinaryReader.o BinaryWriter.o BitConverter.o Boolean.o Buffer.o Byte.o Calendar.o Comparer.o DateTime.o Decoder.o Directory.o Encoder.o Environment.o Exception.o File.o FileStream.o HashHelpers.o KeyNotFoundException.o KeyValuePair.o Math.o MemoryStream.o Path.o Stack.o Stream.o StreamAsyncResult.o StreamReader.o StreamWriter.o Thread.o TimeSpan.o Version.o OBJS = Array.o BinaryReader.o BinaryWriter.o BitConverter.o Boolean.o Buffer.o Byte.o Calendar.o Comparer.o DateTime.o Decoder.o Directory.o Encoder.o Environment.o Exception.o File.o FileStream.o HashHelpers.o KeyNotFoundException.o KeyValuePair.o Math.o MemoryStream.o Path.o Stack.o Stream.o StreamAsyncResult.o StreamReader.o StreamWriter.o Thread.o TimeSpan.o Version.o