00001 00025 #ifndef ACTOR_H 00026 #define ACTOR_H 00027 00029 #define NUM_SPRITES 200 00030 00032 unsigned char* spriteTable[NUM_SPRITES]; 00034 unsigned int spriteSizeTable[NUM_SPRITES]; 00035 00036 00037 typedef struct TimeStruct 00038 { 00039 short int from; 00040 short int to; 00041 short int numOfStep; 00042 int timeOfChange; 00043 } TimeStruct; 00044 00045 // zone volumic point 00046 typedef struct ZVPoint 00047 { 00048 short int bottomLeft; 00049 short int topRight; 00050 } ZVPoint; 00051 00052 // zone volumic box 00053 typedef struct ZVBox 00054 { 00055 ZVPoint X; 00056 ZVPoint Y; 00057 ZVPoint Z; 00058 } ZVBox; 00059 00060 typedef struct AnimTimerDataStruct 00061 { 00062 char* ptr; 00063 int time; 00064 } AnimTimerDataStruct; 00065 00066 typedef struct StaticFlagsStruct 00067 { 00068 unsigned short int bComputeCollisionWithObj : 1; // 0x0001 00069 unsigned short int bComputeCollisionWithBricks : 1; // 0x0002 00070 unsigned short int bIsZonable : 1; // 0x0004 00071 unsigned short int bUsesClipping : 1; // 0x0008 00072 unsigned short int bCanBePushed : 1; // 0x0010 00073 unsigned short int bComputeLowCollision : 1; // 0x0020 00074 unsigned short int bCanDrown : 1; // 0x0040 00075 unsigned short int bUnk80 : 1; // 0x0080 00076 unsigned short int bUnk0100 : 1; // 0x0100 00077 unsigned short int bIsHidden : 1; // 0x0200 00078 unsigned short int bIsSpriteActor : 1; // 0x0400 00079 unsigned short int bCanFall : 1; // 0x0800 00080 unsigned short int bDoesntCastShadow : 1; // 0x1000 00081 unsigned short int bIsBackgrounded : 1; // 0x2000 00082 unsigned short int bIsCarrierActor : 1; // 0x4000 00083 unsigned short int bUseMiniZv : 1; // 0x8000 00084 } StaticFlagsStruct; 00085 00086 typedef struct DynamicFlagsStruct 00087 { 00088 unsigned short int bUnk0001 : 1; // 0x0001 00089 unsigned short int bUnk0002 : 1; // 0x0002 00090 unsigned short int bUnk0004 : 1; // 0x0004 00091 unsigned short int bUnk0008 : 1; // 0x0008 00092 unsigned short int bIsVisible : 1; // 0x0010 00093 unsigned short int bUnk0020 : 1; // 0x0020 00094 unsigned short int bIsMoving : 1; // 0x0040 00095 unsigned short int bUnk0080 : 1; // 0x0080 00096 unsigned short int bUnk0100 : 1; // 0x0100 00097 unsigned short int bUnk0200 : 1; // 0x0200 00098 unsigned short int bUnk0400 : 1; // 0x0400 00099 unsigned short int bUnk0800 : 1; // 0x0800 00100 unsigned short int bUnk1000 : 1; // 0x1000 00101 unsigned short int bUnk2000 : 1; // 0x2000 00102 unsigned short int bUnk4000 : 1; // 0x4000 00103 unsigned short int bUnk8000 : 1; // 0x8000 00104 } DynamicFlagsStruct; 00105 00106 00107 typedef struct ActorStruct 00108 { 00109 StaticFlagsStruct staticFlags; 00110 DynamicFlagsStruct dinamicFlags; 00111 00112 int entity; // costumeIndex 00113 int body; 00114 int anim; 00115 int animExtra; //field_2 00116 int field_3; 00117 unsigned char *animExtraData; 00118 int sprite; // field_8 00119 unsigned char *entityDataPtr; 00120 00121 int X; // field_20 00122 int Y; // field_22 00123 int Z; // field_24 00124 int strengthOfHit; // field_66 00125 int hitBy; 00126 int bonusParameter; // field_10 00127 int angle; 00128 int speed; 00129 int comportement; 00130 int info0; // cropLeft 00131 int info1; // cropTop 00132 int info2; // cropRight 00133 int info3; // cropBottom 00134 int followedActor; // same as info3 00135 int bonusAmount; // field_12 00136 int talkColor; 00137 int armor; // field_14 00138 int life; 00139 00140 int positionInMoveScript; 00141 unsigned char *moveScript; 00142 00143 int positionInActorScript; 00144 unsigned char *lifeScript; 00145 00146 int labelIdx; // script label index 00147 int currentLabelPtr; // pointer to LABEL offset 00148 int pausedTrackPtr; 00149 00150 //int costumeIndex; 00151 int collision; 00152 int standPosition; 00153 int standOn; 00154 int zone; 00155 00156 int lastRotationSpeed; 00157 int lastX; 00158 int lastZ; 00159 int lastY; 00160 int previousAnimIdx; 00161 int doorStatus; 00162 int animPosition; 00163 int field_78; 00164 00165 ZVBox boudingBox; 00166 TimeStruct time; 00167 AnimTimerDataStruct animTimerData; 00168 } ActorStruct; 00169 00170 short int processActorX; 00171 short int processActorY; 00172 short int processActorZ; 00173 00174 void preload_sprites(); 00175 00176 void init_actor(short int actorIdx); 00177 00178 void set_actor_angle_safe(short int startAngle, short int endAngle, short int stepAngle, TimeStruct * timePtr); 00179 void clear_real_angle(ActorStruct * ptr); 00180 void set_actor_angle(short int startAngle, short int endAngle, short int stepAngle, TimeStruct * timePtr); 00181 int get_real_angle(TimeStruct * angleData); 00182 int get_real_value(TimeStruct * angleData); 00183 00184 #endif
1.5.5