mirror of
https://github.com/Halofreak1990/XFXFramework
synced 2024-12-26 13:49:34 +01:00
WARNING!!! This revision cannot compile correctly. It is updated to reflect the many changes within the XFX project.
75 lines
2.0 KiB
C++
75 lines
2.0 KiB
C++
/********************************************************
|
|
* ContentReader.h *
|
|
* *
|
|
* XFX ContentReader class definition file *
|
|
* Copyright © XFX Team. All Rights Reserved *
|
|
********************************************************/
|
|
#ifndef _CONTENT_CONTENTREADER_
|
|
#define _CONTENT_CONTENTREADER_
|
|
|
|
#include <System/IO/BinaryReader.h>
|
|
#include <Content/ContentManager.h>
|
|
#include <Graphics/GraphicsDevice.h>
|
|
|
|
using namespace System::IO;
|
|
using namespace XFX::Graphics;
|
|
|
|
namespace XFX
|
|
{
|
|
struct Matrix;
|
|
struct Quaternion;
|
|
struct Vector2;
|
|
struct Vector3;
|
|
struct Vector4;
|
|
|
|
namespace Content
|
|
{
|
|
class ContentTypeReader;
|
|
|
|
/// <summary>
|
|
/// A worker object that implements most of ContentManager.Load. A new
|
|
/// ContentReader is constructed for each asset loaded.
|
|
/// </summary>
|
|
class ContentReader : public BinaryReader
|
|
{
|
|
private:
|
|
ContentManager contentManager;
|
|
GraphicsDevice _graphicsDevice;
|
|
char* _assetName;
|
|
static const short XnbVersion;
|
|
|
|
static Stream PrepareStream(Stream stream, char* assetName);
|
|
|
|
public:
|
|
ContentReader(ContentManager manager, Stream stream, GraphicsDevice graphicsDevice);
|
|
ContentReader(ContentManager manager, Stream input, char* assetName);
|
|
|
|
template <class T>
|
|
T ReadExternalReference();
|
|
Matrix ReadMatrix();
|
|
template <class T>
|
|
T ReadObject();
|
|
template <class T>
|
|
T ReadObject(T existingInstance);
|
|
template <class T>
|
|
T ReadObject(ContentTypeReader typeReader);
|
|
template <class T>
|
|
T ReadObject(ContentTypeReader typeReader, T existingInstance);
|
|
Quaternion ReadQuaternion();
|
|
template <class T>
|
|
T ReadRawObject();
|
|
template <class T>
|
|
T ReadRawObject(ContentTypeReader typeReader);
|
|
template <class T>
|
|
T ReadRawObject(T existingInstance);
|
|
template <class T>
|
|
T ReadRawObject(ContentTypeReader typeReader, T existingInstance);
|
|
Vector2 ReadVector2();
|
|
Vector3 ReadVector3();
|
|
Vector4 ReadVector4();
|
|
};
|
|
}
|
|
}
|
|
|
|
#endif //_CONTENTREADER_
|