Mercurial > mm7
comparison Engine/Tables/IconFrameTable.h @ 2575:a76d408c5132 tip
DrawTranslucent -> DrawTextureGrayShade
Removed old texture drawing stuff
author | a.parshin |
---|---|
date | Wed, 09 Mar 2016 01:39:52 +0200 |
parents | 68cdef6879a0 |
children |
comparison
equal
deleted
inserted
replaced
2574:dd36326a9994 | 2575:a76d408c5132 |
---|---|
1 #pragma once | 1 #pragma once |
2 #include <array> | 2 #include <array> |
3 | 3 |
4 | 4 |
5 class Icon | |
6 { | |
7 public: | |
8 inline void SetAnimationName(const char *name) { strcpy(this->anim_name, name); } | |
9 inline const char *GetAnimationName() const { return anim_name; } | |
5 | 10 |
11 inline void SetAnimLength(unsigned int anim_length) { this->anim_length = anim_length; } | |
12 inline unsigned int GetAnimLength() const { return this->anim_length; } | |
6 | 13 |
7 /* 44 */ | 14 inline void SetAnimTime(unsigned int anim_time) { this->anim_time = anim_time; } |
8 #pragma pack(push, 1) | 15 inline unsigned int GetAnimTime() const { return this->anim_time; } |
9 struct IconFrame | 16 |
10 { | 17 ///* 000 */ char pAnimationName[12]; |
11 char pAnimationName[12]; | 18 /* 00C */ char pTextureName[12]; |
12 char pTextureName[12]; | 19 ///* 018 */ __int16 uAnimTime; |
13 __int16 uAnimTime; | 20 ///* 01A */ __int16 uAnimLength; |
14 __int16 uAnimLength; | 21 /* 01C */ __int16 uFlags; |
15 __int16 uFlags; | 22 class Image *texture;///* 01E */ unsigned __int16 uTextureID; |
16 unsigned __int16 uTextureID; | 23 int id; |
24 | |
25 | |
26 protected: | |
27 char anim_name[64]; | |
28 //char texture_name[64]; | |
29 //unsigned int anim_time; | |
30 unsigned int anim_length; | |
31 unsigned int anim_time; | |
32 //unsigned int flags; | |
33 //unsigned int texture_id; | |
17 }; | 34 }; |
18 #pragma pack(pop) | |
19 | 35 |
20 /* 45 */ | 36 /* 45 */ |
21 #pragma pack(push, 1) | 37 #pragma pack(push, 1) |
22 struct IconFrameTable | 38 struct IconFrameTable |
23 { | 39 { |
24 inline IconFrameTable(): | 40 inline IconFrameTable(): |
25 uNumIcons(0), pIcons(nullptr) | 41 uNumIcons(0), pIcons(nullptr) |
26 {} | 42 {} |
27 | 43 |
44 Icon *GetIcon(unsigned int idx); | |
45 Icon *GetIcon(const char *pIconName); | |
28 unsigned int FindIcon(const char *pIconName); | 46 unsigned int FindIcon(const char *pIconName); |
29 IconFrame *GetFrame(unsigned int uIconID, unsigned int uFrameID); | 47 Icon *GetFrame(unsigned int uIconID, unsigned int frame_time); |
30 void InitializeAnimation(unsigned int uIconID); | 48 void InitializeAnimation(unsigned int uIconID); |
31 void ToFile(); | 49 void ToFile(); |
32 void FromFile(void *data_mm6, void *data_mm7, void *data_mm8); | 50 void FromFile(void *data_mm6, void *data_mm7, void *data_mm8); |
33 int FromFileTxt(const char *Args); | 51 int FromFileTxt(const char *Args); |
34 int GetIconAnimLength(unsigned int uIconID); | 52 //int GetIconAnimLength(unsigned int uIconID); |
35 | 53 |
36 unsigned int uNumIcons; | 54 unsigned int uNumIcons; |
37 struct IconFrame *pIcons; | 55 struct Icon *pIcons; |
38 }; | 56 }; |
39 #pragma pack(pop) | 57 #pragma pack(pop) |
40 | 58 |
41 | 59 |
42 | 60 |
47 | 65 |
48 | 66 |
49 | 67 |
50 | 68 |
51 | 69 |
52 /* 76 */ | 70 class UIAnimation |
53 #pragma pack(push, 1) | |
54 struct UIAnimation | |
55 { | 71 { |
56 unsigned __int16 uIconID; | 72 public: |
57 __int16 field_2; | 73 class Icon *icon; |
58 __int16 uAnimTime; | 74 |
59 __int16 uAnimLength; | 75 /* 002 */ __int16 field_2; |
60 __int16 x; | 76 /* 004 */ __int16 uAnimTime; |
61 __int16 y; | 77 /* 006 */ __int16 uAnimLength; |
62 char field_C; | 78 /* 008 */ __int16 x; |
79 /* 00A */ __int16 y; | |
80 /* 00C */ char field_C; | |
63 }; | 81 }; |
64 #pragma pack(pop) | |
65 | |
66 | 82 |
67 | 83 |
68 | 84 |
69 | 85 |
70 | 86 |
71 extern struct IconFrameTable *pIconsFrameTable; | 87 extern struct IconFrameTable *pIconsFrameTable; |
72 | 88 |
73 | 89 |
74 extern struct UIAnimation *pUIAnim_Food; | 90 extern class UIAnimation *pUIAnim_Food; |
75 extern struct UIAnimation *pUIAnim_Gold; | 91 extern class UIAnimation *pUIAnim_Gold; |
76 extern struct UIAnimation *pUIAnum_Torchlight; | 92 extern class UIAnimation *pUIAnum_Torchlight; |
77 extern struct UIAnimation *pUIAnim_WizardEye; | 93 extern class UIAnimation *pUIAnim_WizardEye; |
78 | 94 |
79 extern std::array<struct UIAnimation *, 4> pUIAnims; | 95 extern std::array<class UIAnimation *, 4> pUIAnims; |