annotate Sprites.h @ 0:8b8875f5b359

Initial commit
author Nomad
date Fri, 05 Oct 2012 16:07:14 +0200
parents
children ac0fb48cd27a
rev   line source
0
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
1 #pragma once
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
2
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
3
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
4 /* 18 */
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
5 #pragma pack(push, 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
6 struct Sprite
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
7 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
8 void Release();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
9
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
10 const char *pName;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
11 int uPaletteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
12 struct IDirectDrawSurface *pTextureSurface;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
13 struct IDirect3DTexture2 *pTexture;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
14 int uAreaX;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
15 int uAreaY;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
16 int uBufferWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
17 int uBufferHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
18 int uAreaWidth;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
19 int uAreaHeight;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
20 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
21 #pragma pack(pop)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
22
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
23
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
24 /* 42 */
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
25 #pragma pack(push, 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
26 struct SpriteFrame
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
27 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
28 char pIconName[12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
29 char pTextureName[12];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
30 __int16 pHwSpriteIDs[8];
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
31 int scale;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
32 int uFlags;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
33 __int16 uGlowRadius;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
34 __int16 uPaletteID;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
35 __int16 uPaletteIndex;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
36 __int16 uAnimTime;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
37 __int16 uAnimLength;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
38 __int16 _pad;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
39 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
40 #pragma pack(pop)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
41
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
42 /* 43 */
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
43 #pragma pack(push, 1)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
44 struct SpriteFrameTable
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
45 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
46 //----- (0044D4BA) --------------------------------------------------------
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
47 inline SpriteFrameTable()
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
48 {
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
49 uNumSpriteFrames = 0;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
50 pSpriteSFrames = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
51 pSpritePFrames = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
52 pSpriteEFrames = nullptr;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
53 }
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
54 void ToFile();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
55 void FromFile(void *pSerialized);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
56 bool FromFileTxt(const char *Args);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
57 void ReleaseSFrames();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
58 void ResetSomeSpriteFlags();
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
59 void InitializeSprite(unsigned int uSpriteID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
60 unsigned int FastFindSprite(char *pSpriteName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
61 void BinarySearch(int a2, int a3, const char *pSpriteName);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
62 SpriteFrame *GetFrame(unsigned int uSpriteID, unsigned int uFrameID);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
63 SpriteFrame *GetFrameBy_x(unsigned int uSpriteID, signed int a3);
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
64
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
65 unsigned int uNumSpriteFrames;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
66 unsigned int uNumEFrames;//field_4;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
67 int field_8;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
68 struct SpriteFrame *pSpriteSFrames;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
69 struct SpriteFrame **pSpritePFrames;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
70 __int16 *pSpriteEFrames;
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
71 };
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
72 #pragma pack(pop)
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
73
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
74
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
75
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
76
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
77
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
78
8b8875f5b359 Initial commit
Nomad
parents:
diff changeset
79 extern struct SpriteFrameTable *pSpriteFrameTable;