Play-/Source/saves/Icon.h

70 lines
1.2 KiB
C
Raw Permalink Normal View History

2015-06-22 23:51:37 -04:00
#pragma once
#include "Types.h"
#include "Stream.h"
#include <memory>
2016-08-10 14:56:16 +01:00
class CIcon
{
public:
struct VERTEX
{
2018-04-30 21:01:23 +01:00
float nX;
float nY;
float nZ;
};
2018-04-30 21:01:23 +01:00
struct TEXCOORD
{
2018-04-30 21:01:23 +01:00
float nS;
float nT;
};
#pragma pack(push, 1)
struct KEY
{
2018-04-30 21:01:23 +01:00
float nTime;
float nAmplitude;
};
#pragma pack(pop)
struct FRAME
{
2018-04-30 21:01:23 +01:00
uint32 nShapeId;
uint32 nKeyCount;
KEY* pKeys;
};
2018-04-30 21:01:23 +01:00
CIcon(Framework::CStream&);
virtual ~CIcon();
2018-04-30 21:01:23 +01:00
const VERTEX* GetShape(unsigned int) const;
const TEXCOORD* GetTexCoords() const;
const FRAME* GetFrame(unsigned int) const;
const uint16* GetTexture() const;
unsigned int GetShapeCount() const;
unsigned int GetVertexCount() const;
unsigned int GetFrameCount() const;
private:
2018-04-30 21:01:23 +01:00
void ReadHeader(Framework::CStream&);
void ReadVertices(Framework::CStream&);
void ReadAnimations(Framework::CStream&);
void ReadTexture(Framework::CStream&);
void UncompressTexture(Framework::CStream&);
2023-05-02 08:56:25 -04:00
VERTEX** m_pShapes = nullptr;
TEXCOORD* m_pTexCoords = nullptr;
FRAME* m_pFrames = nullptr;
2018-04-30 21:01:23 +01:00
2023-05-02 08:56:25 -04:00
uint32 m_nShapeCount = 0;
uint32 m_nVertexCount = 0;
uint32 m_nFrameCount = 0;
uint32 m_nTextureType = 0;
uint16* m_pTexture = nullptr;
};
2015-06-22 23:51:37 -04:00
typedef std::shared_ptr<CIcon> IconPtr;