From: <lyn...@us...> - 2009-06-18 21:30:34
|
Revision: 6519 http://gemrb.svn.sourceforge.net/gemrb/?rev=6519&view=rev Author: lynxlupodian Date: 2009-06-18 21:30:13 +0000 (Thu, 18 Jun 2009) Log Message: ----------- added IE_ANI_FOUR_FILES_2 to handle ettercap animations Modified Paths: -------------- gemrb/trunk/gemrb/override/bg2/avatars.2da gemrb/trunk/gemrb/plugins/Core/CharAnimations.cpp gemrb/trunk/gemrb/plugins/Core/CharAnimations.h Modified: gemrb/trunk/gemrb/override/bg2/avatars.2da =================================================================== --- gemrb/trunk/gemrb/override/bg2/avatars.2da 2009-06-18 20:55:08 UTC (rev 6518) +++ gemrb/trunk/gemrb/override/bg2/avatars.2da 2009-06-18 21:30:13 UTC (rev 6519) @@ -147,7 +147,7 @@ 0x7402 MDOG MDOG MDOG MDOG 3 2 MO * 0x7500 MDOP MDOP MDOP MDOP 2 2 1 * 0x7501 MDOP MDOP MDOP MDOP 2 2 GR * -0x7600 METT METT METT METT 2 2 1 * +0x7600 METT METT METT METT 14 2 1 * 0x7701 MGHL MGHL MGHL MGHL 2 2 1 * 0x7702 MGHL MGHL MGHL MGHL 2 2 RE * 0x7703 MGHL MGHL MGHL MGHL 2 2 GA * Modified: gemrb/trunk/gemrb/plugins/Core/CharAnimations.cpp =================================================================== --- gemrb/trunk/gemrb/plugins/Core/CharAnimations.cpp 2009-06-18 20:55:08 UTC (rev 6518) +++ gemrb/trunk/gemrb/plugins/Core/CharAnimations.cpp 2009-06-18 21:30:13 UTC (rev 6519) @@ -146,6 +146,7 @@ if (AvatarsRowNum==~0u) return -1; switch (AvatarTable[AvatarsRowNum].AnimationType) { case IE_ANI_FOUR_FILES: + case IE_ANI_FOUR_FILES_2: return GetActorPartCount() + 1; // only weapon case IE_ANI_CODE_MIRROR: return GetActorPartCount() + 3; // equipment @@ -553,6 +554,8 @@ IE_ANI_FOUR_FILES: The Animation is coded in Four Files. Probably it is an old Two File animation with additional frames added in a second time. +IE_ANI_FOUR_FILES_2: Like IE_ANI_FOUR_FILES but with only 16 cycles per frame. + IE_ANI_TWENTYTWO: This Animation Type stores the Animation in the following format [NAME][ACTIONCODE][/E] ACTIONCODE=A1-6, CA, SX, SA (sling is A1) @@ -919,6 +922,7 @@ case IE_ANI_TWO_FILES_2: case IE_ANI_TWO_FILES_3: case IE_ANI_FOUR_FILES: + case IE_ANI_FOUR_FILES_2: case IE_ANI_SIX_FILES_2: case IE_ANI_FRAGMENT: Orient&=~1; @@ -1021,6 +1025,10 @@ AddLRSuffix( NewResRef, StanceID, Cycle, Orient, EquipData ); break; + case IE_ANI_FOUR_FILES_2: + AddLRSuffix2( NewResRef, StanceID, Cycle, Orient, EquipData ); + break; + case IE_ANI_SIX_FILES_2: //MOGR (variant of FOUR_FILES) AddLR3Suffix( NewResRef, StanceID, Cycle, Orient ); break; @@ -1056,6 +1064,7 @@ { switch (GetAnimType()) { case IE_ANI_FOUR_FILES: + case IE_ANI_FOUR_FILES_2: GetLREquipmentRef( ResRef, Cycle, equipRef, offhand, equip ); break; case IE_ANI_CODE_MIRROR: @@ -1724,6 +1733,73 @@ } } +void CharAnimations::AddLRSuffix2( char* ResRef, unsigned char StanceID, + unsigned char& Cycle, unsigned char Orient, EquipResRefData *&EquipData) +{ + EquipData = new EquipResRefData; + EquipData->Suffix[0] = 0; + switch (StanceID) { + case IE_ANI_ATTACK: + case IE_ANI_ATTACK_BACKSLASH: + case IE_ANI_ATTACK_SLASH: + case IE_ANI_ATTACK_JAB: + strcat( ResRef, "g2" ); + strcpy( EquipData->Suffix, "g2" ); + Cycle = Orient / 2; + break; + case IE_ANI_CAST: + case IE_ANI_CONJURE: + case IE_ANI_SHOOT: + strcat( ResRef, "g2" ); + strcpy( EquipData->Suffix, "g2" ); + Cycle = 8 + Orient / 2; + break; + case IE_ANI_WALK: + strcat( ResRef, "g1" ); + strcpy( EquipData->Suffix, "g1" ); + Cycle = Orient / 2; + break; + case IE_ANI_READY: + strcat( ResRef, "g1" ); + strcpy( EquipData->Suffix, "g1" ); + Cycle = 8 + Orient / 2; + break; + case IE_ANI_HEAD_TURN: //could be wrong + case IE_ANI_AWAKE: + strcat( ResRef, "g1" ); + strcpy( EquipData->Suffix, "g1" ); + Cycle = 16 + Orient / 2; + break; + case IE_ANI_DAMAGE: + strcat( ResRef, "g1" ); + strcpy( EquipData->Suffix, "g1" ); + Cycle = 24 + Orient / 2; + break; + case IE_ANI_GET_UP: + case IE_ANI_EMERGE: + case IE_ANI_PST_START: + case IE_ANI_DIE: + strcat( ResRef, "g1" ); + strcpy( EquipData->Suffix, "g1" ); + Cycle = 32 + Orient / 2; + break; + case IE_ANI_TWITCH: + strcat( ResRef, "g1" ); + strcpy( EquipData->Suffix, "g1" ); + Cycle = 40 + Orient / 2; + break; + default: + printf("LRSuffix2 Animation: unhandled stance: %s %d\n", ResRef, StanceID); + abort(); + break; + } + if (Orient > 9) { + strcat( ResRef, "e" ); + strcat( EquipData->Suffix, "e"); + } + EquipData->Cycle = Cycle; +} + void CharAnimations::AddLRSuffix( char* ResRef, unsigned char StanceID, unsigned char& Cycle, unsigned char Orient, EquipResRefData *&EquipData) { Modified: gemrb/trunk/gemrb/plugins/Core/CharAnimations.h =================================================================== --- gemrb/trunk/gemrb/plugins/Core/CharAnimations.h 2009-06-18 20:55:08 UTC (rev 6518) +++ gemrb/trunk/gemrb/plugins/Core/CharAnimations.h 2009-06-18 21:30:13 UTC (rev 6519) @@ -87,6 +87,7 @@ #define IE_ANI_FOUR_FRAMES 11 //wyvern anims #define IE_ANI_NINE_FRAMES 12 //dragon anims #define IE_ANI_FRAGMENT 13 //fragment animation +#define IE_ANI_FOUR_FILES_2 14 //METT //PST animation types #define IE_ANI_PST_ANIMATION_1 16 //full animation @@ -206,6 +207,8 @@ unsigned char& Cycle, unsigned char Orient); void AddLRSuffix(char* ResRef, unsigned char AnimID, unsigned char& Cycle, unsigned char Orient, EquipResRefData*& equip); + void AddLRSuffix2( char* ResRef, unsigned char StanceID, + unsigned char& Cycle, unsigned char Orient, EquipResRefData *&EquipData); void GetLREquipmentRef(char* ResRef, unsigned char& Cycle, const char* equipRef, bool offhand, EquipResRefData* equip); void AddLR2Suffix(char* ResRef, unsigned char AnimID, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |