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

Updated comments

Added some new Type infos
Removed excess whitespace
Added some new files
Implemented missing methods
This commit is contained in:
Tom Lint 2013-08-13 20:04:25 +02:00
parent c56db35373
commit 3a960b5829
66 changed files with 1290 additions and 929 deletions

View File

@ -8,14 +8,20 @@
#define _XFX_AUDIO_AUDIOEMITTER_ #define _XFX_AUDIO_AUDIOEMITTER_
#include <System/Object.h> #include <System/Object.h>
#include <System/Type.h>
#include <Vector3.h> #include <Vector3.h>
using namespace System;
namespace XFX namespace XFX
{ {
namespace Audio namespace Audio
{ {
class AudioEmitter : public Object class AudioEmitter : public Object
{ {
private:
static const Type AudioEmitterTypeInfo;
public: public:
float DopplerScale; float DopplerScale;
Vector3 Forward; Vector3 Forward;
@ -25,8 +31,13 @@ namespace XFX
AudioEmitter() { } AudioEmitter() { }
inline int GetType() const { } const Type& GetType()
{
return AudioEmitterTypeInfo;
}
}; };
const Type AudioEmitter::AudioEmitterTypeInfo = Type("AudioEmitter", "XFX::Audio::AudioEmitter", TypeCode::Object);
} }
} }

View File

@ -27,12 +27,15 @@ namespace XFX
*/ */
class SoundEffect : public IDisposable, public Object class SoundEffect : public IDisposable, public Object
{ {
friend class SoundEffectInstance;
private: private:
static float distanceScale; static float distanceScale;
static float dopplerScale; static float dopplerScale;
TimeSpan duration; TimeSpan duration;
bool isDisposed; bool isDisposed;
static float masterVolume; static float masterVolume;
int referenceCount;
static float speedOfSound; static float speedOfSound;
float volume; float volume;

View File

@ -29,7 +29,7 @@ namespace XFX
SoundEffect* _parent; SoundEffect* _parent;
float _volume; float _volume;
SoundEffectInstance(SoundEffect* parent); SoundEffectInstance(SoundEffect * const parent);
virtual void Dispose(bool disposing); virtual void Dispose(bool disposing);

View File

@ -1,9 +1,9 @@
/******************************************************** /*****************************************************************************
* Enums.h * * Enums.h *
* * * *
* XFX enumeration definition file * * XFX enumeration definition file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
********************************************************/ *****************************************************************************/
#ifndef _XFX_ENUMS_ #ifndef _XFX_ENUMS_
#define _XFX_ENUMS_ #define _XFX_ENUMS_

View File

@ -20,15 +20,15 @@ namespace XFX
class GameServiceContainer : public IServiceProvider class GameServiceContainer : public IServiceProvider
{ {
private: private:
Dictionary<String, Object*> _services; Dictionary<Type, Object*> _services;
public: public:
GameServiceContainer(); GameServiceContainer();
virtual ~GameServiceContainer() {} virtual ~GameServiceContainer() {}
void AddService(const String& serviceType, Object* provider); void AddService(const Type& serviceType, Object* provider);
Object* GetService(const String& ServiceType); Object* GetService(const Type& ServiceType);
void RemoveService(const String& type); void RemoveService(const Type& type);
}; };
} }

View File

@ -1,9 +1,9 @@
/******************************************************** /*****************************************************************************
* Guide.h * * Guide.h *
* * * *
* XFX Guide definition file * * XFX::GamerServices::Guide class definition file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
********************************************************/ *****************************************************************************/
#ifndef _XFX_GAMERSERVICES_GUIDE_ #ifndef _XFX_GAMERSERVICES_GUIDE_
#define _XFX_GAMERSERVICES_GUIDE_ #define _XFX_GAMERSERVICES_GUIDE_
@ -23,7 +23,9 @@ namespace XFX
{ {
namespace GamerServices namespace GamerServices
{ {
// Provides access to the Guide user interface. /**
* Provides access to the Guide user interface.
*/
class Guide class Guide
{ {
private: private:

View File

@ -25,7 +25,7 @@ namespace XFX
class AlphaTestEffect : public Effect class AlphaTestEffect : public Effect
{ {
private: private:
byte effectCode[]; static byte effectCode[];
protected: protected:
AlphaTestEffect(AlphaTestEffect const * const cloneSource); AlphaTestEffect(AlphaTestEffect const * const cloneSource);
@ -50,7 +50,7 @@ namespace XFX
AlphaTestEffect(GraphicsDevice * const device); AlphaTestEffect(GraphicsDevice * const device);
Effect* Clone() const; Effect* Clone() const;
int GetType() const; static const Type& GetType();
}; };
} }
} }

View File

@ -21,7 +21,7 @@ namespace XFX
class BlendState : public GraphicsResource class BlendState : public GraphicsResource
{ {
private: private:
static const char * const isBoundErrorString; static const String isBoundErrorString;
BlendFunction_t alphaBlendFunction; BlendFunction_t alphaBlendFunction;
Blend_t alphaDestinationBlend; Blend_t alphaDestinationBlend;
Blend_t alphaSourceBlend; Blend_t alphaSourceBlend;

View File

@ -337,7 +337,9 @@ namespace XFX
}; };
}; };
// Defines the size of an element of an index buffer. /**
* Defines the size of an element of an index buffer.
*/
struct IndexElementSize struct IndexElementSize
{ {
enum type enum type
@ -347,7 +349,9 @@ namespace XFX
}; };
}; };
// Defines flags that describe the relationship between the adapter refresh rate and the rate at which GraphicsDevice.Present operations are completed. /**
* Defines flags that describe the relationship between the adapter refresh rate and the rate at which GraphicsDevice.Present operations are completed.
*/
struct PresentInterval struct PresentInterval
{ {
enum type enum type
@ -359,7 +363,9 @@ namespace XFX
}; };
}; };
// Defines how data in a vertex stream is interpreted during a draw call. /**
* Defines how data in a vertex stream is interpreted during a draw call.
*/
struct PrimitiveType struct PrimitiveType
{ {
enum type enum type
@ -372,7 +378,9 @@ namespace XFX
}; };
}; };
// Determines how render target data is used once a new render target is set. /**
* Determines how render target data is used once a new render target is set.
*/
struct RenderTargetUsage struct RenderTargetUsage
{ {
enum type enum type
@ -383,7 +391,9 @@ namespace XFX
}; };
}; };
// Describes whether existing buffer data will be overwritten or discarded during a SetData operation. /**
* Describes whether existing buffer data will be overwritten or discarded during a SetData operation.
*/
struct SetDataOptions struct SetDataOptions
{ {
enum type enum type
@ -394,18 +404,31 @@ namespace XFX
}; };
}; };
// Defines sprite rotation options. /**
* Defines sprite rotation options.
*/
struct SpriteEffects struct SpriteEffects
{ {
enum type enum type
{ {
FlipHorizontally = 1, //Rotate 180 degrees about the Y axis before rendering. /**
FlipVertically = 0x100, //Rotate 180 degrees about the X axis before rendering. * Rotate 180 degrees about the Y axis before rendering.
None = 0 //No rotations specified. */
FlipHorizontally = 1,
/**
* Rotate 180 degrees about the X axis before rendering.
*/
FlipVertically = 0x100,
/**
* No rotations specified.
*/
None = 0
}; };
}; };
// Defines sprite sort-rendering options. /**
* Defines sprite sort-rendering options.
*/
struct SpriteSortMode struct SpriteSortMode
{ {
enum type enum type
@ -418,7 +441,9 @@ namespace XFX
}; };
}; };
// Defines stencil buffer operations. /**
* Defines stencil buffer operations.
*/
struct StencilOperation struct StencilOperation
{ {
enum type enum type
@ -434,7 +459,9 @@ namespace XFX
}; };
}; };
// Defines various types of surface formats. /**
* Defines various types of surface formats.
*/
struct SurfaceFormat struct SurfaceFormat
{ {
enum type enum type
@ -464,7 +491,9 @@ namespace XFX
}; };
}; };
// Defines constants that describe supported texture-addressing modes. /**
* Defines constants that describe supported texture-addressing modes.
*/
struct TextureAddressMode struct TextureAddressMode
{ {
enum type enum type
@ -475,33 +504,55 @@ namespace XFX
}; };
}; };
// Defines how a texture will be filtered as it is minified for each mipmap level. /**
* Defines how a texture will be filtered as it is minified for each mipmap level.
*/
struct TextureFilter struct TextureFilter
{ {
enum type enum type
{ {
// Use linear filtering. /**
* Use linear filtering.
*/
Linear, Linear,
// Use point filtering. /**
* Use point filtering.
*/
Point, Point,
// Use anisotropic filtering. /**
* Use anisotropic filtering.
*/
Anisotropic, Anisotropic,
// Use linear filtering to shrink or expand, and point filtering between mipmap levels (mip). /**
* Use linear filtering to shrink or expand, and point filtering between mipmap levels (mip).
*/
LinearMipPoint, LinearMipPoint,
// Use point filtering to shrink (minify) or expand (magnify), and linear filtering between mipmap levels. /**
* Use point filtering to shrink (minify) or expand (magnify), and linear filtering between mipmap levels.
*/
PointMipLinear, PointMipLinear,
// Use linear filtering to shrink, point filtering to expand, and linear filtering between mipmap levels. /**
* Use linear filtering to shrink, point filtering to expand, and linear filtering between mipmap levels.
*/
MinLinearMagPointMipLinear, MinLinearMagPointMipLinear,
// Use linear filtering to shrink, point filtering to expand, and point filtering between mipmap levels. /**
* Use linear filtering to shrink, point filtering to expand, and point filtering between mipmap levels.
*/
MinLinearMagPointMipPoint, MinLinearMagPointMipPoint,
// Use point filtering to shrink, linear filtering to expand, and linear filtering between mipmap levels. /**
* Use point filtering to shrink, linear filtering to expand, and linear filtering between mipmap levels.
*/
MinPointMagLinearMipLinear, MinPointMagLinearMipLinear,
// Use point filtering to shrink, linear filtering to expand, and point filtering between mipmap levels. /**
* Use point filtering to shrink, linear filtering to expand, and point filtering between mipmap levels.
*/
MinPointMagLinearMipPoint MinPointMagLinearMipPoint
}; };
}; };
// Defines vertex element formats. /**
* Defines vertex element formats.
*/
struct VertexElementFormat struct VertexElementFormat
{ {
enum type enum type
@ -521,7 +572,9 @@ namespace XFX
}; };
}; };
// Defines usage for vertex elements. /**
* Defines usage for vertex elements.
*/
struct VertexElementUsage struct VertexElementUsage
{ {
enum type enum type

View File

@ -14,6 +14,11 @@ namespace XFX
{ {
struct Matrix; struct Matrix;
namespace Content
{
class ModelReader;
}
namespace Graphics namespace Graphics
{ {
/** /**

View File

@ -16,6 +16,11 @@ using namespace System::Collections::Generic;
namespace XFX namespace XFX
{ {
namespace Content
{
class ModelReader;
}
namespace Graphics namespace Graphics
{ {
class ModelBoneCollection; class ModelBoneCollection;

View File

@ -4,8 +4,8 @@
* XFX GraphicsDeviceInformation class definition file * * XFX GraphicsDeviceInformation class definition file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
*****************************************************************************/ *****************************************************************************/
#ifndef _GRAPHICSDEVICEINFORMATION_ #ifndef _XFX_GRAPHICSDEVICEINFORMATION_
#define _GRAPHICSDEVICEINFORMATION_ #define _XFX_GRAPHICSDEVICEINFORMATION_
#include <Graphics/Enums.h> #include <Graphics/Enums.h>
#include <Graphics/PresentationParameters.h> #include <Graphics/PresentationParameters.h>
@ -32,4 +32,4 @@ namespace XFX
}; };
} }
#endif //_GRAPHICSDEVICEINFORMATION_ #endif //_XFX_GRAPHICSDEVICEINFORMATION_

View File

@ -1,9 +1,9 @@
/******************************************************** /*****************************************************************************
* Input.h * * Input.h *
* * * *
* XFX::Input namespace include file * * XFX::Input namespace include file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
********************************************************/ *****************************************************************************/
#ifndef _XFX_INPUT_ #ifndef _XFX_INPUT_
#define _XFX_INPUT_ #define _XFX_INPUT_

View File

@ -1,9 +1,9 @@
/******************************************************** /*****************************************************************************
* Enums.h * * Enums.h *
* * * *
* XFX::Input enumeration definition file * * XFX::Input enumeration definition file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
********************************************************/ *****************************************************************************/
#ifndef _XFX_INPUT_ENUMS_ #ifndef _XFX_INPUT_ENUMS_
#define _XFX_INPUT_ENUMS_ #define _XFX_INPUT_ENUMS_
@ -11,7 +11,9 @@ namespace XFX
{ {
namespace Input namespace Input
{ {
// Enumerates input device buttons. /**
* Enumerates input device buttons.
*/
struct Buttons struct Buttons
{ {
enum type enum type

View File

@ -1,9 +1,9 @@
/******************************************************** /*****************************************************************************
* GamePad.h * * GamePad.h *
* * * *
* XFX GamePad definition file * * XFX::Input::GamePad class definition file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
********************************************************/ *****************************************************************************/
#ifndef _XFX_INPUT_GAMEPAD_ #ifndef _XFX_INPUT_GAMEPAD_
#define _XFX_INPUT_GAMEPAD_ #define _XFX_INPUT_GAMEPAD_
@ -15,8 +15,10 @@ namespace XFX
{ {
namespace Input namespace Input
{ {
// Allows retrieval of user interaction with an XBOX Controller /**
// and setting of controller vibration motors. * Allows retrieval of user interaction with an XBOX Controller
* and setting of controller vibration motors.
*/
class GamePad class GamePad
{ {
private: private:

View File

@ -8,6 +8,9 @@
#define _XFX_INPUT_GAMEPADSTATE_ #define _XFX_INPUT_GAMEPADSTATE_
#include "GamePadButtons.h" #include "GamePadButtons.h"
#include "GamePadDPad.h"
#include "GamePadThumbSticks.h"
#include "GamePadTriggers.h"
namespace XFX namespace XFX
{ {

View File

@ -8,7 +8,6 @@
#define _XFX_INPUT_GAMEPADTHUMBSTICKS_ #define _XFX_INPUT_GAMEPADTHUMBSTICKS_
#include "Enums.h" #include "Enums.h"
#include <System/Object.h>
#include <Vector2.h> #include <Vector2.h>
using namespace System; using namespace System;

View File

@ -1,9 +1,9 @@
/******************************************************** /*****************************************************************************
* Keyboard.h * * Keyboard.h *
* * * *
* XFX Keyboard definition file * * XFX::Input::Keyboard class definition file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
********************************************************/ *****************************************************************************/
#ifndef _XFX_INPUT_KEYBOARD_ #ifndef _XFX_INPUT_KEYBOARD_
#define _XFX_INPUT_KEYBOARD_ #define _XFX_INPUT_KEYBOARD_
@ -13,7 +13,9 @@ namespace XFX
{ {
namespace Input namespace Input
{ {
// Represents a state of keystrokes recorded by a keyboard input device. /**
* Represents a state of keystrokes recorded by a keyboard input device.
*/
struct KeyboardState struct KeyboardState
{ {
KeyboardState(); KeyboardState();
@ -36,7 +38,9 @@ namespace XFX
Keys_t* pressedKeys; Keys_t* pressedKeys;
}; };
// Allows retrieval of keystrokes from a keyboard input device. /**
* Allows retrieval of keystrokes from a keyboard input device.
*/
class Keyboard class Keyboard
{ {
private: private:

View File

@ -1,9 +1,9 @@
/******************************************************** /*****************************************************************************
* Mouse.h * * Mouse.h *
* * * *
* XFX Mouse definition file * * XFX::Input::Mouse class definition file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
********************************************************/ *****************************************************************************/
#ifndef _XFX_INPUT_MOUSE_ #ifndef _XFX_INPUT_MOUSE_
#define _XFX_INPUT_MOUSE_ #define _XFX_INPUT_MOUSE_
@ -16,7 +16,9 @@ namespace XFX
{ {
namespace Input namespace Input
{ {
// Represents the state of a mouse input device, including mouse cursor position and buttons pressed. /**
* Represents the state of a mouse input device, including mouse cursor position and buttons pressed.
*/
struct MouseState struct MouseState
{ {
ButtonState_t LeftButton; ButtonState_t LeftButton;
@ -31,7 +33,9 @@ namespace XFX
bool operator==(const MouseState& other) const; bool operator==(const MouseState& other) const;
}; };
// Allows retrieval of position and button clicks from a mouse input device. /**
* Allows retrieval of position and button clicks from a mouse input device.
*/
class Mouse class Mouse
{ {
private: private:

View File

@ -1,15 +1,17 @@
/******************************************************** /*****************************************************************************
* MathHelper.h * * MathHelper.h *
* * * *
* XFX MathHelper definition file * * XFX::MathHelper class definition file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
********************************************************/ *****************************************************************************/
#ifndef _XFX_MATHHELPER_ #ifndef _XFX_MATHHELPER_
#define _XFX_MATHHELPER_ #define _XFX_MATHHELPER_
namespace XFX namespace XFX
{ {
// Contains commonly used precalculated values. /**
* Contains commonly used precalculated values.
*/
class MathHelper class MathHelper
{ {
private: private:

View File

@ -7,10 +7,11 @@
#ifndef _XFX_MEDIA_VIDEO_H_ #ifndef _XFX_MEDIA_VIDEO_H_
#define _XFX_MEDIA_VIDEO_H_ #define _XFX_MEDIA_VIDEO_H_
#include <System/Types.h> #include <System/TimeSpan.h>
#include <System/Object.h>
#include "Enums.h" #include "Enums.h"
using namespace System;
namespace XFX namespace XFX
{ {
namespace Media namespace Media

View File

@ -8,8 +8,8 @@
#define _XFX_MEDIA_VIDEOPLAYER_ #define _XFX_MEDIA_VIDEOPLAYER_
#include "Enums.h" #include "Enums.h"
#include <Graphics/Texture2D.h>
#include <System/TimeSpan.h> #include <System/TimeSpan.h>
#include "../Graphics/Texture2D.h"
using namespace System; using namespace System;
using namespace XFX::Graphics; using namespace XFX::Graphics;
@ -20,11 +20,15 @@ namespace XFX
{ {
class Video; class Video;
// Provides methods and properties to playback, pause, resume, and stop video. VideoPlayer also exposes repeat, volume, and play position information. /**
* Provides methods and properties to playback, pause, resume, and stop video. VideoPlayer also exposes repeat, volume, and play position information.
*/
class VideoPlayer class VideoPlayer
{ {
private: private:
bool isDisposed; bool isDisposed;
Video* playingVideo;
void Dispose(bool disposing); void Dispose(bool disposing);
protected: protected:

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
* Plane.h * * Plane.h *
* * * *
* XFX Plane definition file * * XFX::Plane structure definition file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
*****************************************************************************/ *****************************************************************************/
#ifndef _XFX_PLANE_ #ifndef _XFX_PLANE_
@ -21,7 +21,9 @@ namespace XFX
struct Quaternion; struct Quaternion;
struct Vector4; struct Vector4;
// Defines a plane. /**
* Defines a plane.
*/
struct Plane : IEquatable<Plane>, Object struct Plane : IEquatable<Plane>, Object
{ {
float D; float D;
@ -43,7 +45,7 @@ namespace XFX
bool Equals(Object const * const obj) const; bool Equals(Object const * const obj) const;
bool Equals(const Plane obj) const; bool Equals(const Plane obj) const;
int GetHashCode() const; int GetHashCode() const;
int GetType() const; static const Type& GetType();
PlaneIntersectionType_t Intersects(const BoundingBox boundingbox) const; PlaneIntersectionType_t Intersects(const BoundingBox boundingbox) const;
void Intersects(const BoundingBox boundingbox, out PlaneIntersectionType_t& result) const; void Intersects(const BoundingBox boundingbox, out PlaneIntersectionType_t& result) const;
PlaneIntersectionType_t Intersects(const BoundingSphere sphere) const; PlaneIntersectionType_t Intersects(const BoundingSphere sphere) const;

View File

@ -1,9 +1,9 @@
/******************************************************** /*****************************************************************************
* Storage.h * * Storage.h *
* * * *
* XFX::Storage namespace include file * * XFX::Storage namespace include file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
********************************************************/ *****************************************************************************/
#ifndef _XFX_STORAGE_ #ifndef _XFX_STORAGE_
#define _XFX_STORAGE_ #define _XFX_STORAGE_

View File

@ -1,9 +1,9 @@
/******************************************************** /*****************************************************************************
* StorageContainer.h * * StorageContainer.h *
* * * *
* XFX StorageContainer definition file * * XFX::Storage::StorageContainer class definition file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
********************************************************/ *****************************************************************************/
#ifndef _XFX_STORAGE_STORAGECONTAINER_ #ifndef _XFX_STORAGE_STORAGECONTAINER_
#define _XFX_STORAGE_STORAGECONTAINER_ #define _XFX_STORAGE_STORAGECONTAINER_
@ -21,8 +21,10 @@ namespace XFX
{ {
class StorageDevice; class StorageDevice;
// Represents a logical collection of storage files. /**
class StorageContainer : public IDisposable, public virtual Object * Represents a logical collection of storage files.
*/
class StorageContainer : public IDisposable, public Object
{ {
friend class StorageDevice; friend class StorageDevice;
@ -31,7 +33,7 @@ namespace XFX
DirectoryInfo containerFolder; DirectoryInfo containerFolder;
StorageDevice* device; StorageDevice* device;
PlayerIndex_t playerIndex; PlayerIndex_t playerIndex;
char* titleName; String titleName;
void Dispose(bool disposing); void Dispose(bool disposing);
virtual ~StorageContainer(); virtual ~StorageContainer();
@ -39,11 +41,11 @@ namespace XFX
public: public:
EventHandler Disposing; EventHandler Disposing;
bool IsDisposed(); bool IsDisposed() const;
const char* Path() const; const String Path() const;
StorageDevice* getStorageDevice() const; StorageDevice* getStorageDevice() const;
static const char* TitleLocation(); static const String TitleLocation();
const char* TitleName() const; const String TitleName() const;
void Delete(); void Delete();
void Dispose(); void Dispose();

View File

@ -15,13 +15,15 @@ namespace XFX
{ {
namespace Storage namespace Storage
{ {
// The exception that is thrown when the requested StorageDevice is not connected /**
* The exception that is thrown when the requested StorageDevice is not connected
*/
class StorageDeviceNotConnectedException : public ExternalException class StorageDeviceNotConnectedException : public ExternalException
{ {
public: public:
StorageDeviceNotConnectedException(); StorageDeviceNotConnectedException();
StorageDeviceNotConnectedException(char* message); StorageDeviceNotConnectedException(const String& message);
StorageDeviceNotConnectedException(char* message, Exception* innerException); StorageDeviceNotConnectedException(const String& message, Exception * const innerException);
}; };
} }
} }

View File

@ -19,6 +19,9 @@ using namespace System::Collections::Generic;
namespace System namespace System
{ {
/**
*
*/
template <typename T> template <typename T>
class Array : public ICollection<T>, public IEnumerable<T> class Array : public ICollection<T>, public IEnumerable<T>
{ {

View File

@ -1,9 +1,9 @@
/******************************************************** /*****************************************************************************
* Interfaces.h * * Interfaces.h *
* * * *
* XFX Generic Interfaces definition file * * XFX Generic Interfaces definition file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
********************************************************/ *****************************************************************************/
#ifndef _SYSTEM_COLLECTIONS_GENERIC_INTERFACES_ #ifndef _SYSTEM_COLLECTIONS_GENERIC_INTERFACES_
#define _SYSTEM_COLLECTIONS_GENERIC_INTERFACES_ #define _SYSTEM_COLLECTIONS_GENERIC_INTERFACES_
@ -16,7 +16,9 @@ namespace System
{ {
namespace Generic namespace Generic
{ {
// Defines methods to manipulate generic collections. /**
* Defines methods to manipulate generic collections.
*/
template <class T> template <class T>
interface ICollection interface ICollection
{ {
@ -33,7 +35,9 @@ namespace System
virtual ~ICollection() { } virtual ~ICollection() { }
}; };
// Defines a method that a type implements to compare two objects. /**
* Defines a method that a type implements to compare two objects.
*/
template <class T> template <class T>
interface IComparer interface IComparer
{ {
@ -43,7 +47,9 @@ namespace System
virtual ~IComparer() { } virtual ~IComparer() { }
}; };
// Represents a generic collection of key/value pairs. /**
* Represents a generic collection of key/value pairs.
*/
template <class TKey, class TValue> template <class TKey, class TValue>
interface IDictionary interface IDictionary
{ {
@ -59,7 +65,9 @@ namespace System
virtual ~IDictionary() { } virtual ~IDictionary() { }
}; };
// Supports a simple iteration over a generic collection. /**
* Supports a simple iteration over a generic collection.
*/
template <class T> template <class T>
interface IEnumerator interface IEnumerator
{ {
@ -71,7 +79,9 @@ namespace System
virtual ~IEnumerator() { } virtual ~IEnumerator() { }
}; };
// Exposes the enumerator, which supports a simple iteration over a collection of a specified type. /**
* Exposes the enumerator, which supports a simple iteration over a collection of a specified type.
*/
template <class T> template <class T>
interface IEnumerable interface IEnumerable
{ {
@ -81,7 +91,9 @@ namespace System
virtual ~IEnumerable() { } virtual ~IEnumerable() { }
}; };
// Defines methods to support the comparison of objects for equality. /**
* Defines methods to support the comparison of objects for equality.
*/
template <class T> template <class T>
interface IEqualityComparer interface IEqualityComparer
{ {
@ -92,7 +104,9 @@ namespace System
virtual ~IEqualityComparer() { } virtual ~IEqualityComparer() { }
}; };
// Represents a collection of objects that can be individually accessed by index. /**
* Represents a collection of objects that can be individually accessed by index.
*/
template <class T> template <class T>
interface IList : public ICollection<T> interface IList : public ICollection<T>
{ {

View File

@ -179,7 +179,7 @@ namespace System
{ {
sassert(array != null, String::Format("array; %s", FrameworkResources::ArgumentNull_Generic)); sassert(array != null, String::Format("array; %s", FrameworkResources::ArgumentNull_Generic));
memcpy(&array[arrayIndex], _items, _size * sizeof(T)) memcpy(&array[arrayIndex], _items, _size * sizeof(T));
} }
static const Type& GetType() static const Type& GetType()
@ -320,7 +320,7 @@ namespace System
{ {
sassert(comparer != null, String::Format("comparer; %s", FrameworkResources::ArgumentNull_Generic)); sassert(comparer != null, String::Format("comparer; %s", FrameworkResources::ArgumentNull_Generic));
Sort(0, _actualSize, comparer); Sort(0, _size, comparer);
} }
T* ToArray() const T* ToArray() const
@ -353,6 +353,11 @@ namespace System
const List<T>& operator =(const List<T>& other) const List<T>& operator =(const List<T>& other)
{ {
if (other == *this)
{
return *this;
}
delete[] _items; delete[] _items;
_actualSize = other._actualSize; _actualSize = other._actualSize;
_size = other._size; _size = other._size;

View File

@ -1,24 +1,27 @@
/******************************************************** /*****************************************************************************
* StreamAsyncResult.h * * StreamAsyncResult.h *
* * * *
* XFX StreamAsyncResult definition file * * System::IO::StreamAsyncResult class definition file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
********************************************************/ *****************************************************************************/
#ifndef _SYSTEM_IO_STREAMASYNCRESULT_ #ifndef _SYSTEM_IO_STREAMASYNCRESULT_
#define _SYSTEM_IO_STREAMASYNCRESULT_ #define _SYSTEM_IO_STREAMASYNCRESULT_
#include "../Interfaces.h" #include <System/Interfaces.h>
#include "../Object.h" #include <System/Object.h>
#include "../Types.h" #include <System/Types.h>
#include "../Threading/WaitHandle.h" #include <System/Threading/WaitHandle.h>
namespace System namespace System
{ {
namespace IO namespace IO
{ {
// /**
class StreamAsyncResult : public IAsyncResult, public virtual Object *
*/
class StreamAsyncResult : public IAsyncResult, public Object
{ {
private:
Object* _state; Object* _state;
bool completed; bool completed;
bool done; bool done;
@ -34,8 +37,26 @@ namespace System
int NBytes(); int NBytes();
bool Done; bool Done;
/**
*
*
* @param state
*
*/
StreamAsyncResult(Object* state); StreamAsyncResult(Object* state);
/**
*
*
* @param obj
*
*/
StreamAsyncResult(const IAsyncResult &obj); StreamAsyncResult(const IAsyncResult &obj);
/**
*
*
* @param obj
*
*/
StreamAsyncResult(const StreamAsyncResult &obj); StreamAsyncResult(const StreamAsyncResult &obj);
//void SetComplete(Exception* e); //void SetComplete(Exception* e);

View File

@ -81,7 +81,7 @@ namespace System
interface IServiceProvider interface IServiceProvider
{ {
public: public:
virtual Object* GetService(const String& serviceType)=0; virtual Object* GetService(const Type& serviceType)=0;
virtual ~IServiceProvider() { } virtual ~IServiceProvider() { }
}; };

View File

@ -49,7 +49,7 @@ namespace XFX
bool Equals(Object const * const obj) const; bool Equals(Object const * const obj) const;
bool Equals(const Vector2 other) const; bool Equals(const Vector2 other) const;
int GetHashCode() const; int GetHashCode() const;
static int GetType(); static const Type& GetType();
static Vector2 Hermite(const Vector2 value1, const Vector2 tangent1, const Vector2 value2, const Vector2 tangent2, const float amount); static Vector2 Hermite(const Vector2 value1, const Vector2 tangent1, const Vector2 value2, const Vector2 tangent2, const float amount);
static void Hermite(const Vector2& value1, const Vector2& tangent1, const Vector2& value2, const Vector2& tangent2, const float amount, out Vector2& result); static void Hermite(const Vector2& value1, const Vector2& tangent1, const Vector2& value2, const Vector2& tangent2, const float amount, out Vector2& result);
float Length() const; float Length() const;

View File

@ -1,7 +1,7 @@
/***************************************************************************** /*****************************************************************************
* Vector3.h * * Vector3.h *
* * * *
* XFX::Vector3 definition file * * XFX::Vector3 structure definition file *
* Copyright (c) XFX Team. All Rights Reserved * * Copyright (c) XFX Team. All Rights Reserved *
*****************************************************************************/ *****************************************************************************/
#ifndef _XFX_VECTOR3_ #ifndef _XFX_VECTOR3_

View File

@ -29,6 +29,8 @@
namespace XFX namespace XFX
{ {
const Type GameComponentTypeInfo("GameComponent", "XFX::GameComponent", TypeCode::Object);
bool GameComponent::getEnabled() const bool GameComponent::getEnabled() const
{ {
return _enabled; return _enabled;
@ -87,6 +89,11 @@ namespace XFX
Dispose(false); Dispose(false);
} }
const Type& GameComponent::GetType()
{
return GameComponentTypeInfo;
}
void GameComponent::Initialize() void GameComponent::Initialize()
{ {
} }

View File

@ -27,11 +27,18 @@
#include <Graphics/AlphaTestEffect.h> #include <Graphics/AlphaTestEffect.h>
#include <Graphics/Texture2D.h> #include <Graphics/Texture2D.h>
#include <System/Type.h>
namespace XFX namespace XFX
{ {
namespace Graphics namespace Graphics
{ {
const Type AlphaTestEffectTypeInfo("AlphaTestEffect", "XFX::Graphics::AlphaTestEffect", TypeCode::Object);
byte AlphaTestEffect::effectCode[] =
{
};
AlphaTestEffect::AlphaTestEffect(AlphaTestEffect const * const cloneSource) AlphaTestEffect::AlphaTestEffect(AlphaTestEffect const * const cloneSource)
: Effect(cloneSource), : Effect(cloneSource),
Alpha(cloneSource->Alpha), AlphaFunction(cloneSource->AlphaFunction), Alpha(cloneSource->Alpha), AlphaFunction(cloneSource->AlphaFunction),
@ -43,12 +50,12 @@ namespace XFX
{ {
} }
void AlphaTestEffect::OnApply() AlphaTestEffect::AlphaTestEffect(GraphicsDevice * const device)
: Effect(device, effectCode)
{ {
} }
AlphaTestEffect::AlphaTestEffect(GraphicsDevice * const device) void AlphaTestEffect::OnApply()
: Effect(device, effectCode)
{ {
} }
@ -57,8 +64,9 @@ namespace XFX
return new AlphaTestEffect(this); return new AlphaTestEffect(this);
} }
int AlphaTestEffect::GetType() const const Type& AlphaTestEffect::GetType()
{ {
return AlphaTestEffectTypeInfo;
} }
} }
} }

View File

@ -29,11 +29,14 @@
#include <Vector3.h> #include <Vector3.h>
#include <Graphics/BasicEffect.h> #include <Graphics/BasicEffect.h>
#include <Graphics/DirectionalLight.h> #include <Graphics/DirectionalLight.h>
#include <System/Type.h>
namespace XFX namespace XFX
{ {
namespace Graphics namespace Graphics
{ {
const Type BasicEffectTypeInfo("BasicEffect", "XFX::Graphics::BasicEffect", TypeCode::Object);
DirectionalLight* BasicEffect::getDirectionalLight0() const DirectionalLight* BasicEffect::getDirectionalLight0() const
{ {
} }
@ -82,9 +85,9 @@ namespace XFX
LightingEnabled = true; LightingEnabled = true;
} }
int BasicEffect::GetType() const Type& BasicEffect::GetType()
{ {
// TODO: implement return BasicEffectTypeInfo;
} }
void BasicEffect::OnApply() void BasicEffect::OnApply()

View File

@ -26,6 +26,7 @@
// POSSIBILITY OF SUCH DAMAGE. // POSSIBILITY OF SUCH DAMAGE.
#include <Graphics/BlendState.h> #include <Graphics/BlendState.h>
#include <System/Type.h>
#include <sassert.h> #include <sassert.h>
@ -33,7 +34,8 @@ namespace XFX
{ {
namespace Graphics namespace Graphics
{ {
const char * const BlendState::isBoundErrorString = ""; const String BlendState::isBoundErrorString = "";
const Type BlendStateTypeInfo("BlendState", "XFX::Graphics::BlendState", TypeCode::Object);
BlendState::BlendState() BlendState::BlendState()
{ {
@ -74,9 +76,9 @@ namespace XFX
{ {
} }
int BlendState::GetType() const Type& BlendState::GetType()
{ {
// TODO: implement return BlendStateTypeInfo;
} }
} }
} }

View File

@ -94,7 +94,7 @@ namespace XFX
Dispose(true); Dispose(true);
} }
int ContentManager::GetType() const Type& ContentManager::GetType()
{ {
} }
@ -102,6 +102,13 @@ namespace XFX
T ContentManager::Load(const String& assetName) T ContentManager::Load(const String& assetName)
{ {
T dummyVal; T dummyVal;
Object* obj2;
sassert(!disposed, "" + GetType().ToString());
sassert(!String::IsNullOrEmpty(assetName), String::Format("assetName; %s", FrameworkResources::ArgumentNull_Generic));
assetName = GetCleanPath(assetName);
/* TODO: port the C# code below to C++ /* TODO: port the C# code below to C++
object obj2; object obj2;
@ -135,8 +142,8 @@ namespace XFX
return (T)obj2; return (T)obj2;
}*/ }*/
T local = this->ReadAsset<T>(assetName); T local = ReadAsset<T>(assetName);
//this->loadedAssets.Add(assetName, local); loadedAssets.Add(assetName, local);
return local; return local;
} }

View File

@ -36,9 +36,9 @@ namespace XFX
{ {
namespace Content namespace Content
{ {
const short ContentReader::XnbVersion = 2; const short ContentReader::XnbVersion = 5;
String ContentReader::getAssetName() const const String ContentReader::getAssetName() const
{ {
return _assetName; return _assetName;
} }

View File

@ -26,11 +26,14 @@
// POSSIBILITY OF SUCH DAMAGE. // POSSIBILITY OF SUCH DAMAGE.
#include <Graphics/Effect.h> #include <Graphics/Effect.h>
#include <System/Type.h>
namespace XFX namespace XFX
{ {
namespace Graphics namespace Graphics
{ {
const Type EffectTypeInfo("Effect", "XFX::Graphics::Effect", TypeCode::Object);
Effect::Effect(Effect const * const cloneSource) Effect::Effect(Effect const * const cloneSource)
: _parameters(cloneSource->_parameters), : _parameters(cloneSource->_parameters),
_techniques(cloneSource->_techniques), _techniques(cloneSource->_techniques),
@ -50,8 +53,9 @@ namespace XFX
return new Effect(this); return new Effect(this);
} }
int Effect::GetType() const Type& Effect::GetType()
{ {
return EffectTypeInfo;
} }
} }
} }

View File

@ -85,7 +85,6 @@ namespace XFX
bool GraphicsAdapter::QueryBackBufferFormat(SurfaceFormat_t format, DepthFormat_t depthFormat, int multiSampleCount, out SurfaceFormat_t selectedFormat, out DepthFormat_t selectedDepthFormat, out int selectedMultiSampleCount) const bool GraphicsAdapter::QueryBackBufferFormat(SurfaceFormat_t format, DepthFormat_t depthFormat, int multiSampleCount, out SurfaceFormat_t selectedFormat, out DepthFormat_t selectedDepthFormat, out int selectedMultiSampleCount) const
{ {
} }
bool GraphicsAdapter::QueryRenderTargetFormat(SurfaceFormat_t format, DepthFormat_t depthFormat, int multiSampleCount, out SurfaceFormat_t selectedFormat, out DepthFormat_t selectedDepthFormat, out int selectedMultiSampleCount) const bool GraphicsAdapter::QueryRenderTargetFormat(SurfaceFormat_t format, DepthFormat_t depthFormat, int multiSampleCount, out SurfaceFormat_t selectedFormat, out DepthFormat_t selectedDepthFormat, out int selectedMultiSampleCount) const

View File

@ -26,11 +26,14 @@
// POSSIBILITY OF SUCH DAMAGE. // POSSIBILITY OF SUCH DAMAGE.
#include <Graphics/GraphicsResource.h> #include <Graphics/GraphicsResource.h>
#include <System/Type.h>
namespace XFX namespace XFX
{ {
namespace Graphics namespace Graphics
{ {
const Type GraphicsResourceTypeInfo("GraphicsResource", "XFX::Graphics::GraphicsResource", TypeCode::Object);
GraphicsDevice* GraphicsResource::getGraphicsDevice() GraphicsDevice* GraphicsResource::getGraphicsDevice()
{ {
return graphicsDevice; return graphicsDevice;
@ -66,9 +69,9 @@ namespace XFX
Disposing(this, const_cast<EventArgs*>(EventArgs::Empty)); Disposing(this, const_cast<EventArgs*>(EventArgs::Empty));
} }
int GraphicsResource::GetType() const Type& GraphicsResource::GetType()
{ {
// TODO: implement return GraphicsResourceTypeInfo;
} }
} }
} }

View File

@ -64,9 +64,43 @@ namespace XFX
} }
for (uint i = 0; i < boneCount; i++) for (uint i = 0; i < boneCount; i++)
{
ReadBoneReference(reader, boneCount);
// Read the child bone references.
uint childCount = reader->ReadUInt32();
if (childCount)
{
for (uint j = 0; j < childCount; j++)
{
ReadBoneReference(reader, boneCount);
}
}
}
// Read the mesh data.
uint meshCount = reader->ReadUInt32();
for (uint i = 0; i < meshCount; i++)
{ {
} }
} }
void ModelReader::ReadBoneReference(ContentReader * const reader, uint boneCount)
{
uint boneId;
// Read the bone ID, which may be encoded as either an 8 or 32 bit value.
if (boneCount < 255)
{
boneId = reader->ReadByte();
}
else
{
boneId = reader->ReadUInt32();
}
}
} }
} }

View File

@ -18,6 +18,9 @@ namespace XFX
{ {
class ModelReader : public ContentTypeReader<Model> class ModelReader : public ContentTypeReader<Model>
{ {
private:
void ReadBoneReference(ContentReader * const input, uint boneCount);
public: public:
Model* Read(ContentReader * const input, Model* existingInstance); Model* Read(ContentReader * const input, Model* existingInstance);
}; };

View File

@ -34,11 +34,14 @@
#include <Vector4.h> #include <Vector4.h>
#include <System/Math.h> #include <System/Math.h>
#include <System/String.h> #include <System/String.h>
#include <System/Type.h>
using namespace System; using namespace System;
namespace XFX namespace XFX
{ {
const Type PlaneTypeInfo("Plane", "XFX::Plane", TypeCode::Object);
Plane::Plane(const float a, const float b, const float c, const float d) Plane::Plane(const float a, const float b, const float c, const float d)
: D(d), Normal(a, b, c) : D(d), Normal(a, b, c)
{ {
@ -128,9 +131,9 @@ namespace XFX
return Normal.GetHashCode() ^ (int)D; return Normal.GetHashCode() ^ (int)D;
} }
int Plane::GetType() const Type& Plane::GetType()
{ {
// TODO: implement return PlaneTypeInfo;
} }
PlaneIntersectionType_t Plane::Intersects(const BoundingBox boundingbox) const PlaneIntersectionType_t Plane::Intersects(const BoundingBox boundingbox) const

View File

@ -27,10 +27,12 @@
#include "Point.h" #include "Point.h"
#include <System/String.h> #include <System/String.h>
#include <System/Type.h>
namespace XFX namespace XFX
{ {
const Point Point::Zero = Point(); const Point Point::Zero = Point();
const Type PointTypeInfo("Point", "XFX::Point", TypeCode::Object);
Point::Point(int x, int y) Point::Point(int x, int y)
: X(x), Y(y) : X(x), Y(y)
@ -62,9 +64,9 @@ namespace XFX
return (X + Y); return (X + Y);
} }
int Point::GetType() const Type& Point::GetType()
{ {
// TODO: implement return PointTypeInfo;
} }
const String Point::ToString() const const String Point::ToString() const

View File

@ -27,15 +27,17 @@
#include <Rectangle.h> #include <Rectangle.h>
#include <Graphics/PresentationParameters.h> #include <Graphics/PresentationParameters.h>
#include <System/Type.h>
namespace XFX namespace XFX
{ {
namespace Graphics namespace Graphics
{ {
const Type PresentationParametersTypeInfo("PresentationParameters", "XFX::Graphics::PresentationParameters", TypeCode::Object);
PresentationParameters::PresentationParameters() PresentationParameters::PresentationParameters()
: BackBufferFormat(SurfaceFormat::Color), : BackBufferFormat(SurfaceFormat::Color), BackBufferHeight(0),
BackBufferHeight(0), BackBufferWidth(0), BackBufferWidth(0), IsFullScreen(true), MultiSampleCount(0),
IsFullScreen(true), MultiSampleCount(0),
PresentationInterval(PresentInterval::Default), PresentationInterval(PresentInterval::Default),
RenderTargetUsage(RenderTargetUsage::DiscardContents) RenderTargetUsage(RenderTargetUsage::DiscardContents)
{ {
@ -65,9 +67,9 @@ namespace XFX
return is(this, obj) ? (*this == *(PresentationParameters*)obj) : false; return is(this, obj) ? (*this == *(PresentationParameters*)obj) : false;
} }
int PresentationParameters::GetType() const Type& PresentationParameters::GetType()
{ {
// TODO: implement return PresentationParametersTypeInfo;
} }
bool PresentationParameters::operator!=(const PresentationParameters& other) const bool PresentationParameters::operator!=(const PresentationParameters& other) const

View File

@ -25,17 +25,19 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE. // POSSIBILITY OF SUCH DAMAGE.
#include <System/Math.h>
#include <MathHelper.h> #include <MathHelper.h>
#include <Matrix.h> #include <Matrix.h>
#include <Quaternion.h> #include <Quaternion.h>
#include <System/Type.h>
#include <Vector3.h> #include <Vector3.h>
#include <System/Math.h>
using namespace System; using namespace System;
namespace XFX namespace XFX
{ {
const Quaternion Quaternion::Identity = Quaternion(0, 0, 0, 1); const Quaternion Quaternion::Identity = Quaternion(0, 0, 0, 1);
const Type QuaternionTypeInfo("Quaternion", "XFX::Quaternion", TypeCode::Object);
Quaternion::Quaternion(float x, float y, float z, float w) Quaternion::Quaternion(float x, float y, float z, float w)
: W(w), X(x), Y(y), Z(z) : W(w), X(x), Y(y), Z(z)
@ -364,9 +366,9 @@ namespace XFX
return ((((int)X + (int)Y) + (int)Z) + (int)W); return ((((int)X + (int)Y) + (int)Z) + (int)W);
} }
int Quaternion::GetType() const Type& Quaternion::GetType()
{ {
// TODO: implement return QuaternionTypeInfo;
} }
Quaternion Quaternion::Inverse(Quaternion quaternion) Quaternion Quaternion::Inverse(Quaternion quaternion)

View File

@ -32,12 +32,15 @@
#include <System/Math.h> #include <System/Math.h>
#include <System/Single.h> #include <System/Single.h>
#include <System/String.h> #include <System/String.h>
#include <System/Type.h>
#include <Vector3.h> #include <Vector3.h>
using namespace System; using namespace System;
namespace XFX namespace XFX
{ {
const Type RayTypeInfo("Ray", "XFX::Ray", TypeCode::Object);
Ray::Ray(Vector3 direction, Vector3 position) Ray::Ray(Vector3 direction, Vector3 position)
: Direction(direction), Position(position) : Direction(direction), Position(position)
{ {
@ -68,9 +71,9 @@ namespace XFX
return (Direction.GetHashCode() ^ Position.GetHashCode()); return (Direction.GetHashCode() ^ Position.GetHashCode());
} }
int Ray::GetType() const Type& Ray::GetType()
{ {
// TODO: implement return RayTypeInfo;
} }
float Ray::Intersects(BoundingBox boundingbox) const float Ray::Intersects(BoundingBox boundingbox) const

View File

@ -27,10 +27,12 @@
#include <Point.h> #include <Point.h>
#include <Rectangle.h> #include <Rectangle.h>
#include <System/Type.h>
namespace XFX namespace XFX
{ {
const Rectangle Rectangle::Empty = Rectangle(0, 0, 0, 0); const Rectangle Rectangle::Empty = Rectangle(0, 0, 0, 0);
const Type RectangleTypeInfo("Rectangle", "XFX::Rectangle", TypeCode::Object);
Rectangle::Rectangle(const int x, const int y, const int width, const int height) Rectangle::Rectangle(const int x, const int y, const int width, const int height)
: Height(height), Width(width), X(x), Y(y) : Height(height), Width(width), X(x), Y(y)
@ -107,9 +109,9 @@ namespace XFX
return X ^ Y ^ Width ^ Height; return X ^ Y ^ Width ^ Height;
} }
int Rectangle::GetType() const Type& Rectangle::GetType()
{ {
// TODO: implement return RectangleTypeInfo;
} }
void Rectangle::Inflate(int horizontalAmount, int verticalAmount) void Rectangle::Inflate(int horizontalAmount, int verticalAmount)

View File

@ -34,6 +34,8 @@ namespace XFX
{ {
namespace Audio namespace Audio
{ {
const Type SoundEffectInstanceTypeInfo("SoundEffectInstance", "XFX::Audio::SoundEffectInstance", TypeCode::Object);
bool SoundEffectInstance::IsDisposed() const bool SoundEffectInstance::IsDisposed() const
{ {
} }
@ -75,7 +77,7 @@ namespace XFX
{ {
} }
SoundEffectInstance::SoundEffectInstance(SoundEffect* parent) SoundEffectInstance::SoundEffectInstance(SoundEffect * const parent)
: _parent(parent), _volume(parent->volume) : _parent(parent), _volume(parent->volume)
{ {
_parent->referenceCount++; _parent->referenceCount++;
@ -83,6 +85,7 @@ namespace XFX
SoundEffectInstance::~SoundEffectInstance() SoundEffectInstance::~SoundEffectInstance()
{ {
_parent->referenceCount--;
} }
void SoundEffectInstance::Apply3D(AudioListener listener, AudioEmitter emitter) void SoundEffectInstance::Apply3D(AudioListener listener, AudioEmitter emitter)
@ -106,8 +109,9 @@ namespace XFX
} }
} }
int SoundEffectInstance::GetType() const Type& SoundEffectInstance::GetType()
{ {
return SoundEffectInstanceTypeInfo;
} }
void SoundEffectInstance::Pause() void SoundEffectInstance::Pause()
@ -124,6 +128,7 @@ namespace XFX
void SoundEffectInstance::Stop() void SoundEffectInstance::Stop()
{ {
Stop(true);
} }
void SoundEffectInstance::Stop(bool immediate) void SoundEffectInstance::Stop(bool immediate)

View File

@ -0,0 +1,34 @@
/*****************************************************************************
* StorageDeviceAsyncResult.h *
* *
* XFX::Storage::StorageDeviceAsyncResult class definition file *
* Copyright (c) XFX Team. All Rights Reserved *
*****************************************************************************/
#ifndef _XFX_STORAGE_STORAGEDEVICEASYNCRESULT_
#define _XFX_STORAGE_STORAGEDEVICEASYNCRESULT_
#include <System/Interfaces.h>
using namespace System;
namespace XFX
{
namespace Storage
{
class StorageDeviceAsyncResult : public IAsyncResult
{
private:
Object* _state;
public:
StorageDeviceAsyncResult(Object* state);
Object* AsyncState();
Threading::WaitHandle* AsyncWaitHandle();
bool CompletedSynchronously() const;
bool IsCompleted() const;
};
}
}
#endif //_XFX_STORAGE_STORAGEDEVICEASYNCRESULT_

View File

@ -32,7 +32,7 @@ namespace XFX
{ {
namespace Graphics namespace Graphics
{ {
const VertexElement vertexArray[] = const VertexElement VertexPositionColor::vertexArray[] =
{ {
VertexElement(0, VertexElementFormat::Vector3, VertexElementUsage::Position, 0), VertexElement(0, VertexElementFormat::Vector3, VertexElementUsage::Position, 0),
VertexElement(12, VertexElementFormat::Color, VertexElementUsage::Color, 0) VertexElement(12, VertexElementFormat::Color, VertexElementUsage::Color, 0)

View File

@ -26,6 +26,7 @@
// POSSIBILITY OF SUCH DAMAGE. // POSSIBILITY OF SUCH DAMAGE.
#include <System/String.h> #include <System/String.h>
#include <System/Type.h>
#include <Vector2.h> #include <Vector2.h>
#include <Vector3.h> #include <Vector3.h>
#include <Graphics/VertexPositionTexture.h> #include <Graphics/VertexPositionTexture.h>
@ -34,6 +35,8 @@ namespace XFX
{ {
namespace Graphics namespace Graphics
{ {
const Type VertexPositionTextureTypeInfo("VertexPositionTexture", "XFX::Graphics::VertexPositionTexture", TypeCode::Object);
const VertexElement VertexPositionTexture::vertexArray[] = const VertexElement VertexPositionTexture::vertexArray[] =
{ {
VertexElement(0, VertexElementFormat::Vector3, VertexElementUsage::Position, 0), VertexElement(0, VertexElementFormat::Vector3, VertexElementUsage::Position, 0),
@ -65,9 +68,9 @@ namespace XFX
return Position.GetHashCode() ^ TextureCoordinate.GetHashCode(); return Position.GetHashCode() ^ TextureCoordinate.GetHashCode();
} }
int VertexPositionTexture::GetType() const Type& VertexPositionTexture::GetType()
{ {
// TODO: implement return VertexPositionTextureTypeInfo;
} }
const String VertexPositionTexture::ToString() const const String VertexPositionTexture::ToString() const

62
src/libXFX/Video.cpp Normal file
View File

@ -0,0 +1,62 @@
// Copyright (C) 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 <System/Type.h>
#include <Media/Video.h>
namespace XFX
{
namespace Media
{
const Type VideoTypeInfo("Video", "XFX::Media::Video", TypeCode::Object);
TimeSpan Video::getDuration()
{
}
float Video::getFramesPerSecond()
{
}
int Video::getHeight()
{
}
VideoSoundtrackType_t Video::getVideoSoundtrackType()
{
}
int Video::getWidth()
{
}
const Type& Video::GetType()
{
return VideoTypeInfo;
}
}
}

View File

@ -47,6 +47,7 @@ namespace XFX
Video* VideoPlayer::getVideo() Video* VideoPlayer::getVideo()
{ {
return playingVideo;
} }
VideoPlayer::VideoPlayer() VideoPlayer::VideoPlayer()
@ -64,6 +65,7 @@ namespace XFX
Texture2D* VideoPlayer::GetTexture() Texture2D* VideoPlayer::GetTexture()
{ {
// TODO: return current video frame
} }
void VideoPlayer::Pause() void VideoPlayer::Pause()
@ -72,6 +74,7 @@ namespace XFX
void VideoPlayer::Play(Video * const video) void VideoPlayer::Play(Video * const video)
{ {
sassert(video != null, String::Format("value; %s", FrameworkResources::ArgumentNull_Generic));
} }
void VideoPlayer::Resume() void VideoPlayer::Resume()

View File

@ -25,16 +25,19 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE. // POSSIBILITY OF SUCH DAMAGE.
#include <Graphics/Viewport.h>
#include <System/String.h>
#include <Matrix.h> #include <Matrix.h>
#include <Rectangle.h> #include <Rectangle.h>
#include <System/String.h>
#include <System/Type.h>
#include <Vector3.h> #include <Vector3.h>
#include <Graphics/Viewport.h>
namespace XFX namespace XFX
{ {
namespace Graphics namespace Graphics
{ {
const Type ViewportTypeInfo("Viewport", "XFX::Graphics::Viewport", TypeCode::Object);
float Viewport::getAspectRatio() const float Viewport::getAspectRatio() const
{ {
if ((Height != 0) && (Width != 0)) if ((Height != 0) && (Width != 0))
@ -99,8 +102,9 @@ namespace XFX
return ((int)getAspectRatio() + Height + (int)MaxDepth + (int)MinDepth + Width + X + Y); return ((int)getAspectRatio() + Height + (int)MaxDepth + (int)MinDepth + Width + X + Y);
} }
int Viewport::GetType() const Type& Viewport::GetType()
{ {
return ViewportTypeInfo;
} }
Vector3 Viewport::Project(const Vector3 source, const Matrix projection, const Matrix view, const Matrix world) const Vector3 Viewport::Project(const Vector3 source, const Matrix projection, const Matrix view, const Matrix world) const

View File

@ -1,3 +1,9 @@
/*****************************************************************************
* XNBFile.h *
* *
* XNA Binary Resource file header definition *
* Copyright (c) XFX Team. All rights reserved *
*****************************************************************************/
#ifndef _XNBFILE_ #ifndef _XNBFILE_
#define _XNBFILE_ #define _XNBFILE_
@ -9,6 +15,9 @@ namespace XFX
{ {
namespace Content namespace Content
{ {
/**
* Represents the header of an *.xnb file
*/
struct XNBFile struct XNBFile
{ {
byte FormatID1; byte FormatID1;

View File

@ -119,6 +119,7 @@
<ClCompile Include="VertexPositionColor.cpp" /> <ClCompile Include="VertexPositionColor.cpp" />
<ClCompile Include="VertexPositionNormalTexture.cpp" /> <ClCompile Include="VertexPositionNormalTexture.cpp" />
<ClCompile Include="VertexPositionTexture.cpp" /> <ClCompile Include="VertexPositionTexture.cpp" />
<ClCompile Include="Video.cpp" />
<ClCompile Include="Viewport.cpp" /> <ClCompile Include="Viewport.cpp" />
<ClCompile Include="GamePad.cpp" /> <ClCompile Include="GamePad.cpp" />
<ClCompile Include="Keyboard.cpp" /> <ClCompile Include="Keyboard.cpp" />
@ -242,6 +243,7 @@
<ClInclude Include="BlendState.cpp" /> <ClInclude Include="BlendState.cpp" />
<ClInclude Include="Enums.h" /> <ClInclude Include="Enums.h" />
<ClInclude Include="ModelReader.h" /> <ClInclude Include="ModelReader.h" />
<ClInclude Include="StorageDeviceAsyncResult.h" />
<ClInclude Include="Texture2DReader.h" /> <ClInclude Include="Texture2DReader.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -206,9 +206,6 @@
<ClCompile Include="Guide.cpp"> <ClCompile Include="Guide.cpp">
<Filter>Source Files\GamerServices</Filter> <Filter>Source Files\GamerServices</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="StorageDeviceAsyncResult.cpp">
<Filter>Source Files\GamerServices</Filter>
</ClCompile>
<ClCompile Include="PacketReader.cpp"> <ClCompile Include="PacketReader.cpp">
<Filter>Source Files\Net</Filter> <Filter>Source Files\Net</Filter>
</ClCompile> </ClCompile>
@ -236,6 +233,12 @@
<ClCompile Include="Model.cpp"> <ClCompile Include="Model.cpp">
<Filter>Source Files\Graphics</Filter> <Filter>Source Files\Graphics</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="Video.cpp">
<Filter>Source Files\Media</Filter>
</ClCompile>
<ClCompile Include="StorageDeviceAsyncResult.cpp">
<Filter>Source Files\Storage</Filter>
</ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="..\..\include\BoundingBox.h"> <ClInclude Include="..\..\include\BoundingBox.h">
@ -568,6 +571,9 @@
<ClInclude Include="..\..\include\Graphics\ModelMeshPartCollection.h"> <ClInclude Include="..\..\include\Graphics\ModelMeshPartCollection.h">
<Filter>Header Files\Graphics</Filter> <Filter>Header Files\Graphics</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="StorageDeviceAsyncResult.h">
<Filter>Source Files\Storage</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="makefile" /> <None Include="makefile" />