BWAPI
trunk/bwapi/BWAPI/Source/BW/Image.h
Go to the documentation of this file.
00001 #pragma once
00002 #include <windows.h>
00003 
00004 #include "Sprite.h"
00005 #include "Offsets.h"
00006 
00007 namespace BW { class Sprite; };
00008 
00009 #pragma pack(1)
00010 namespace BW
00011 {
00012   struct grpFrame
00013   {
00014     s8  left;
00015     s8  top;
00016     s8  right;
00017     s8  bottom;
00018     u32 dataOffset;
00019   };
00020   struct grpHead
00021   {
00022     s16       frameCount;
00023     s16       width;
00024     s16       height;
00025     grpFrame  frames[1];
00026   };
00027   class Image
00028   {
00029   public:
00030     void updateGraphicData();
00031     void drawImage();
00032 
00033     /* 0x00 */ Image        *prev;
00034     /* 0x04 */ Image        *next;
00035     /* 0x08 */ u16          imageID;
00036     /* 0x0A */ u8           paletteType;
00037     /* 0x0B */ u8           direction;
00038     /* 0x0C */ u16          flags;
00039                             /*  0x0001  - 
00040                                 0x0002  - 
00041                                 0x0004  - 
00042                                 0x0008  - 
00043                                 0x0010  - 
00044                                 0x0020  - 
00045                                 0x0040  - 
00046                                 0x0080  - 
00047                                 0x0100  - 
00048                                 0x0200  - 
00049                                 0x0400  - 
00050                                 0x0800  - 
00051                                 0x1000  - 
00052                                 0x2000  - 
00053                                 0x4000  - 
00054                                 0x8000  - 
00055                             */
00056     /* 0x0E */ s8           horizontalOffset;
00057     /* 0x0F */ s8           verticalOffset;
00058     /* 0x10 */ u16          iscriptHeader;
00059     /* 0x12 */ u16          iscriptOffset;
00060     /* 0x14 */ u16          unknown_14;
00061     /* 0x16 */ u8           anim;
00062     /* 0x17 */ u8           wait;
00063     /* 0x18 */ u16          frameSet;
00064     /* 0x1A */ u16          frameIndex;
00065     /* 0x1C */ POINTS       mapPosition;
00066     /* 0x20 */ POINTS       screenPosition;
00067     /* 0x24 */ rect         grpBounds;      // Bounds for GRP frame, only different from normal when part of graphic is out of bounds.
00068     /* 0x2C */ grpHead      *GRPFile;
00069     /* 0x30 */ void         *coloringData;
00070     // void __fastcall renderFunction(int screenX, int screenY, grpFrame *pFrame, RECT *grpRect, int colorData);
00071     /* 0x34 */ void (__fastcall *renderFunction)(int,int,grpFrame*,RECT*,int);
00072     /* 0x38 */ void (__fastcall *updateFunction)(Image*);
00073     /* 0x3C */ Sprite       *spriteOwner;
00074   };
00075 
00076   CTASSERT( sizeof(Image) == 64 );
00077 
00078   namespace Anims
00079   {
00080     enum Enum
00081     {
00082       Init          = 0x00,
00083       Death         = 0x01,
00084       GndAttkInit   = 0x02,
00085       AirAttkInit   = 0x03,
00086       Unused1       = 0x04,
00087       GndAttkRpt    = 0x05,
00088       AirAttkRpt    = 0x06,
00089       CastSpell     = 0x07,
00090       GndAttkToIdle = 0x08,
00091       AirAttkToIdle = 0x09,
00092       Unused2       = 0x0A,
00093       Walking       = 0x0B,
00094       WalkingToIdle = 0x0C,
00095       SpecialState1 = 0x0D,
00096       SpecialState2 = 0x0E,
00097       AlmostBuilt   = 0x0F,
00098       Built         = 0x10,
00099       Landing       = 0x11,
00100       LiftOff       = 0x12,
00101       IsWorking     = 0x13,
00102       WorkingToIdle = 0x14,
00103       WarpIn        = 0x15,
00104       Unused3       = 0x16,
00105       StarEditInit  = 0x17,
00106       Disable       = 0x18,
00107       Burrow        = 0x19,
00108       UnBurrow      = 0x1A,
00109       Enable        = 0x1B
00110     };
00111   };
00112 
00113 };
00114 #pragma pack()
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines