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_
#include <System/Object.h>
#include <System/Type.h>
#include <Vector3.h>
using namespace System;
namespace XFX
{
namespace Audio
{
class AudioEmitter : public Object
{
private:
static const Type AudioEmitterTypeInfo;
public:
float DopplerScale;
Vector3 Forward;
@ -25,8 +31,13 @@ namespace XFX
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
{
friend class SoundEffectInstance;
private:
static float distanceScale;
static float dopplerScale;
TimeSpan duration;
bool isDisposed;
static float masterVolume;
int referenceCount;
static float speedOfSound;
float volume;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -21,7 +21,7 @@ namespace XFX
class BlendState : public GraphicsResource
{
private:
static const char * const isBoundErrorString;
static const String isBoundErrorString;
BlendFunction_t alphaBlendFunction;
Blend_t alphaDestinationBlend;
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
{
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
{
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
{
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
{
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
{
enum type
@ -394,18 +404,31 @@ namespace XFX
};
};
// Defines sprite rotation options.
/**
* Defines sprite rotation options.
*/
struct SpriteEffects
{
enum type
{
FlipHorizontally = 1, //Rotate 180 degrees about the Y axis before rendering.
FlipVertically = 0x100, //Rotate 180 degrees about the X axis before rendering.
None = 0 //No rotations specified.
/**
* Rotate 180 degrees about the Y axis before rendering.
*/
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
{
enum type
@ -418,7 +441,9 @@ namespace XFX
};
};
// Defines stencil buffer operations.
/**
* Defines stencil buffer operations.
*/
struct StencilOperation
{
enum type
@ -434,7 +459,9 @@ namespace XFX
};
};
// Defines various types of surface formats.
/**
* Defines various types of surface formats.
*/
struct SurfaceFormat
{
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
{
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
{
enum type
{
// Use linear filtering.
/**
* Use linear filtering.
*/
Linear,
// Use point filtering.
/**
* Use point filtering.
*/
Point,
// Use anisotropic filtering.
/**
* Use anisotropic filtering.
*/
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,
// 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,
// 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,
// 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,
// 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,
// 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
};
};
// Defines vertex element formats.
/**
* Defines vertex element formats.
*/
struct VertexElementFormat
{
enum type
@ -521,7 +572,9 @@ namespace XFX
};
};
// Defines usage for vertex elements.
/**
* Defines usage for vertex elements.
*/
struct VertexElementUsage
{
enum type

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,9 +1,9 @@
/********************************************************
/*****************************************************************************
* GamePad.h *
* *
* XFX GamePad definition file *
* XFX::Input::GamePad class definition file *
* Copyright (c) XFX Team. All Rights Reserved *
********************************************************/
*****************************************************************************/
#ifndef _XFX_INPUT_GAMEPAD_
#define _XFX_INPUT_GAMEPAD_
@ -15,8 +15,10 @@ namespace XFX
{
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
{
private:

View File

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

View File

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

View File

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

View File

@ -1,9 +1,9 @@
/********************************************************
/*****************************************************************************
* Mouse.h *
* *
* XFX Mouse definition file *
* XFX::Input::Mouse class definition file *
* Copyright (c) XFX Team. All Rights Reserved *
********************************************************/
*****************************************************************************/
#ifndef _XFX_INPUT_MOUSE_
#define _XFX_INPUT_MOUSE_
@ -16,7 +16,9 @@ namespace XFX
{
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
{
ButtonState_t LeftButton;
@ -31,7 +33,9 @@ namespace XFX
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
{
private:

View File

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

View File

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

View File

@ -8,8 +8,8 @@
#define _XFX_MEDIA_VIDEOPLAYER_
#include "Enums.h"
#include <Graphics/Texture2D.h>
#include <System/TimeSpan.h>
#include "../Graphics/Texture2D.h"
using namespace System;
using namespace XFX::Graphics;
@ -20,11 +20,15 @@ namespace XFX
{
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
{
private:
bool isDisposed;
Video* playingVideo;
void Dispose(bool disposing);
protected:

View File

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

View File

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

View File

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

View File

@ -15,13 +15,15 @@ namespace XFX
{
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
{
public:
StorageDeviceNotConnectedException();
StorageDeviceNotConnectedException(char* message);
StorageDeviceNotConnectedException(char* message, Exception* innerException);
StorageDeviceNotConnectedException(const String& message);
StorageDeviceNotConnectedException(const String& message, Exception * const innerException);
};
}
}

View File

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

View File

@ -1,9 +1,9 @@
/********************************************************
/*****************************************************************************
* Interfaces.h *
* *
* XFX Generic Interfaces definition file *
* Copyright (c) XFX Team. All Rights Reserved *
********************************************************/
*****************************************************************************/
#ifndef _SYSTEM_COLLECTIONS_GENERIC_INTERFACES_
#define _SYSTEM_COLLECTIONS_GENERIC_INTERFACES_
@ -16,7 +16,9 @@ namespace System
{
namespace Generic
{
// Defines methods to manipulate generic collections.
/**
* Defines methods to manipulate generic collections.
*/
template <class T>
interface ICollection
{
@ -33,7 +35,9 @@ namespace System
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>
interface IComparer
{
@ -43,7 +47,9 @@ namespace System
virtual ~IComparer() { }
};
// Represents a generic collection of key/value pairs.
/**
* Represents a generic collection of key/value pairs.
*/
template <class TKey, class TValue>
interface IDictionary
{
@ -59,7 +65,9 @@ namespace System
virtual ~IDictionary() { }
};
// Supports a simple iteration over a generic collection.
/**
* Supports a simple iteration over a generic collection.
*/
template <class T>
interface IEnumerator
{
@ -71,7 +79,9 @@ namespace System
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>
interface IEnumerable
{
@ -81,7 +91,9 @@ namespace System
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>
interface IEqualityComparer
{
@ -92,7 +104,9 @@ namespace System
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>
interface IList : public ICollection<T>
{

View File

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

View File

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

View File

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

View File

@ -49,7 +49,7 @@ namespace XFX
bool Equals(Object const * const obj) const;
bool Equals(const Vector2 other) 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 void Hermite(const Vector2& value1, const Vector2& tangent1, const Vector2& value2, const Vector2& tangent2, const float amount, out Vector2& result);
float Length() const;

View File

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

View File

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

View File

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

View File

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

View File

@ -26,6 +26,7 @@
// POSSIBILITY OF SUCH DAMAGE.
#include <Graphics/BlendState.h>
#include <System/Type.h>
#include <sassert.h>
@ -33,7 +34,8 @@ namespace XFX
{
namespace Graphics
{
const char * const BlendState::isBoundErrorString = "";
const String BlendState::isBoundErrorString = "";
const Type BlendStateTypeInfo("BlendState", "XFX::Graphics::BlendState", TypeCode::Object);
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);
}
int ContentManager::GetType()
const Type& ContentManager::GetType()
{
}
@ -102,6 +102,13 @@ namespace XFX
T ContentManager::Load(const String& assetName)
{
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++
object obj2;
@ -135,8 +142,8 @@ namespace XFX
return (T)obj2;
}*/
T local = this->ReadAsset<T>(assetName);
//this->loadedAssets.Add(assetName, local);
T local = ReadAsset<T>(assetName);
loadedAssets.Add(assetName, local);
return local;
}

View File

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

View File

@ -26,11 +26,14 @@
// POSSIBILITY OF SUCH DAMAGE.
#include <Graphics/Effect.h>
#include <System/Type.h>
namespace XFX
{
namespace Graphics
{
const Type EffectTypeInfo("Effect", "XFX::Graphics::Effect", TypeCode::Object);
Effect::Effect(Effect const * const cloneSource)
: _parameters(cloneSource->_parameters),
_techniques(cloneSource->_techniques),
@ -50,8 +53,9 @@ namespace XFX
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::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.
#include <Graphics/GraphicsResource.h>
#include <System/Type.h>
namespace XFX
{
namespace Graphics
{
const Type GraphicsResourceTypeInfo("GraphicsResource", "XFX::Graphics::GraphicsResource", TypeCode::Object);
GraphicsDevice* GraphicsResource::getGraphicsDevice()
{
return graphicsDevice;
@ -66,9 +69,9 @@ namespace XFX
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++)
{
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>
{
private:
void ReadBoneReference(ContentReader * const input, uint boneCount);
public:
Model* Read(ContentReader * const input, Model* existingInstance);
};

View File

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

View File

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

View File

@ -27,15 +27,17 @@
#include <Rectangle.h>
#include <Graphics/PresentationParameters.h>
#include <System/Type.h>
namespace XFX
{
namespace Graphics
{
const Type PresentationParametersTypeInfo("PresentationParameters", "XFX::Graphics::PresentationParameters", TypeCode::Object);
PresentationParameters::PresentationParameters()
: BackBufferFormat(SurfaceFormat::Color),
BackBufferHeight(0), BackBufferWidth(0),
IsFullScreen(true), MultiSampleCount(0),
: BackBufferFormat(SurfaceFormat::Color), BackBufferHeight(0),
BackBufferWidth(0), IsFullScreen(true), MultiSampleCount(0),
PresentationInterval(PresentInterval::Default),
RenderTargetUsage(RenderTargetUsage::DiscardContents)
{
@ -65,9 +67,9 @@ namespace XFX
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

View File

@ -25,17 +25,19 @@
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
#include <System/Math.h>
#include <MathHelper.h>
#include <Matrix.h>
#include <Quaternion.h>
#include <System/Type.h>
#include <Vector3.h>
#include <System/Math.h>
using namespace System;
namespace XFX
{
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)
: W(w), X(x), Y(y), Z(z)
@ -364,9 +366,9 @@ namespace XFX
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)

View File

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

View File

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

View File

@ -34,6 +34,8 @@ namespace XFX
{
namespace Audio
{
const Type SoundEffectInstanceTypeInfo("SoundEffectInstance", "XFX::Audio::SoundEffectInstance", TypeCode::Object);
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->referenceCount++;
@ -83,6 +85,7 @@ namespace XFX
SoundEffectInstance::~SoundEffectInstance()
{
_parent->referenceCount--;
}
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()
@ -124,6 +128,7 @@ namespace XFX
void SoundEffectInstance::Stop()
{
Stop(true);
}
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
{
const VertexElement vertexArray[] =
const VertexElement VertexPositionColor::vertexArray[] =
{
VertexElement(0, VertexElementFormat::Vector3, VertexElementUsage::Position, 0),
VertexElement(12, VertexElementFormat::Color, VertexElementUsage::Color, 0)

View File

@ -26,6 +26,7 @@
// POSSIBILITY OF SUCH DAMAGE.
#include <System/String.h>
#include <System/Type.h>
#include <Vector2.h>
#include <Vector3.h>
#include <Graphics/VertexPositionTexture.h>
@ -34,6 +35,8 @@ namespace XFX
{
namespace Graphics
{
const Type VertexPositionTextureTypeInfo("VertexPositionTexture", "XFX::Graphics::VertexPositionTexture", TypeCode::Object);
const VertexElement VertexPositionTexture::vertexArray[] =
{
VertexElement(0, VertexElementFormat::Vector3, VertexElementUsage::Position, 0),
@ -65,9 +68,9 @@ namespace XFX
return Position.GetHashCode() ^ TextureCoordinate.GetHashCode();
}
int VertexPositionTexture::GetType()
const Type& VertexPositionTexture::GetType()
{
// TODO: implement
return VertexPositionTextureTypeInfo;
}
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()
{
return playingVideo;
}
VideoPlayer::VideoPlayer()
@ -64,6 +65,7 @@ namespace XFX
Texture2D* VideoPlayer::GetTexture()
{
// TODO: return current video frame
}
void VideoPlayer::Pause()
@ -72,6 +74,7 @@ namespace XFX
void VideoPlayer::Play(Video * const video)
{
sassert(video != null, String::Format("value; %s", FrameworkResources::ArgumentNull_Generic));
}
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
// POSSIBILITY OF SUCH DAMAGE.
#include <Graphics/Viewport.h>
#include <System/String.h>
#include <Matrix.h>
#include <Rectangle.h>
#include <System/String.h>
#include <System/Type.h>
#include <Vector3.h>
#include <Graphics/Viewport.h>
namespace XFX
{
namespace Graphics
{
const Type ViewportTypeInfo("Viewport", "XFX::Graphics::Viewport", TypeCode::Object);
float Viewport::getAspectRatio() const
{
if ((Height != 0) && (Width != 0))
@ -99,8 +102,9 @@ namespace XFX
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

View File

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

View File

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

View File

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