view Sprites.h @ 0:8b8875f5b359

Initial commit
author Nomad
date Fri, 05 Oct 2012 16:07:14 +0200
parents
children ac0fb48cd27a
line wrap: on
line source

#pragma once


/*   18 */
#pragma pack(push, 1)
struct Sprite
{
  void Release();

  const char *pName;
  int uPaletteID;
  struct IDirectDrawSurface *pTextureSurface;
  struct IDirect3DTexture2 *pTexture;
  int uAreaX;
  int uAreaY;
  int uBufferWidth;
  int uBufferHeight;
  int uAreaWidth;
  int uAreaHeight;
};
#pragma pack(pop)


/*   42 */
#pragma pack(push, 1)
struct SpriteFrame
{
  char pIconName[12];
  char pTextureName[12];
  __int16 pHwSpriteIDs[8];
  int scale;
  int uFlags;
  __int16 uGlowRadius;
  __int16 uPaletteID;
  __int16 uPaletteIndex;
  __int16 uAnimTime;
  __int16 uAnimLength;
  __int16 _pad;
};
#pragma pack(pop)

/*   43 */
#pragma pack(push, 1)
struct SpriteFrameTable
{
  //----- (0044D4BA) --------------------------------------------------------
  inline SpriteFrameTable()
  {
    uNumSpriteFrames = 0;
    pSpriteSFrames = nullptr;
    pSpritePFrames = nullptr;
    pSpriteEFrames = nullptr;
  }
  void ToFile();
  void FromFile(void *pSerialized);
  bool FromFileTxt(const char *Args);
  void ReleaseSFrames();
  void ResetSomeSpriteFlags();
  void InitializeSprite(unsigned int uSpriteID);
  unsigned int FastFindSprite(char *pSpriteName);
  void BinarySearch(int a2, int a3, const char *pSpriteName);
  SpriteFrame *GetFrame(unsigned int uSpriteID, unsigned int uFrameID);
  SpriteFrame *GetFrameBy_x(unsigned int uSpriteID, signed int a3);

  unsigned int uNumSpriteFrames;
  unsigned int uNumEFrames;//field_4;
  int field_8;
  struct SpriteFrame *pSpriteSFrames;
  struct SpriteFrame **pSpritePFrames;
  __int16 *pSpriteEFrames;
};
#pragma pack(pop)






extern struct SpriteFrameTable *pSpriteFrameTable;