From: Laszlo T. <ave...@us...> - 2005-05-28 09:32:38
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14055/Core Modified Files: CharAnimations.cpp CharAnimations.h Log Message: Implemented new animation type for MOGR animations Index: CharAnimations.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/CharAnimations.cpp,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** CharAnimations.cpp 19 Apr 2005 16:00:12 -0000 1.59 --- CharAnimations.cpp 28 May 2005 09:32:24 -0000 1.60 *************** *** 290,293 **** --- 290,295 ---- G3 contains 3 attacks. + IE_ANI_SIX_FILES_2: Similar to SIX_FILES, but the orientation numbers are reduced like in FOUR_FILES. Only one animation uses it: MOGR + IE_ANI_TWO_FILES_2: Animations using this type are stored using the following template: [NAME]G1[/E] *************** *** 492,495 **** --- 494,498 ---- case IE_ANI_TWO_FILES_3: case IE_ANI_FOUR_FILES: + case IE_ANI_SIX_FILES_2: Orient&=~1; Anims[StanceID][Orient] = a; *************** *** 573,576 **** --- 576,583 ---- break; + case IE_ANI_SIX_FILES_2: //MOGR (variant of FOUR_FILES) + AddLR3Suffix( ResRef, StanceID, Cycle, Orient ); + break; + case IE_ANI_CODE_MIRROR_2: //9 orientations AddVHR2Suffix( ResRef, StanceID, Cycle, Orient ); *************** *** 1091,1094 **** --- 1098,1102 ---- Cycle = 8 + Orient / 2; break; + case IE_ANI_HEAD_TURN: //could be wrong case IE_ANI_AWAKE: strcat( ResRef, "G1" ); *************** *** 1113,1116 **** --- 1121,1183 ---- } + //Only for the ogre animation (MOGR) + void CharAnimations::AddLR3Suffix( char* ResRef, unsigned char StanceID, + unsigned char& Cycle, unsigned char Orient) + { + switch (StanceID) { + case IE_ANI_ATTACK: + case IE_ANI_ATTACK_BACKSLASH: + strcat( ResRef, "G2" ); + Cycle = Orient / 2; + break; + case IE_ANI_ATTACK_SLASH: + strcat( ResRef, "G2" ); + Cycle = 8 + Orient / 2; + break; + case IE_ANI_ATTACK_JAB: + strcat( ResRef, "G2" ); + Cycle = 16 + Orient / 2; + break; + case IE_ANI_CAST: + case IE_ANI_CONJURE: + case IE_ANI_SHOOT: + strcat( ResRef, "G3" ); + Cycle = Orient / 2; + break; + case IE_ANI_WALK: + strcat( ResRef, "G1" ); + Cycle = 16 + Orient / 2; + break; + case IE_ANI_READY: + strcat( ResRef, "G1" ); + Cycle = 8 + Orient / 2; + break; + case IE_ANI_HEAD_TURN: //could be wrong + case IE_ANI_AWAKE: + strcat( ResRef, "G1" ); + Cycle = Orient / 2; + break; + case IE_ANI_DAMAGE: + strcat( ResRef, "G3" ); + Cycle = 8 + Orient / 2; + break; + case IE_ANI_DIE: + strcat( ResRef, "G3" ); + Cycle = 16 + Orient / 2; + break; + case IE_ANI_TWITCH: + strcat( ResRef, "G3" ); + Cycle = 24 + Orient / 2; + break; + default: + printf("Unhandled stance: %s %d\n", ResRef, StanceID); + abort(); + break; + } + if (Orient > 9) { + strcat( ResRef, "E" ); + } + } + void CharAnimations::AddMMRSuffix(char* ResRef, unsigned char StanceID, unsigned char& Cycle, unsigned char Orient) Index: CharAnimations.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/CharAnimations.h,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** CharAnimations.h 8 Apr 2005 22:27:53 -0000 1.35 --- CharAnimations.h 28 May 2005 09:32:24 -0000 1.36 *************** *** 78,82 **** #define IE_ANI_TWO_FILES 3 #define IE_ANI_CODE_MIRROR_2 4 ! #define IE_ANI_ONE_FILE_2 5 #define IE_ANI_TWENTYTWO 6 #define IE_ANI_CODE_MIRROR_3 7 --- 78,82 ---- #define IE_ANI_TWO_FILES 3 #define IE_ANI_CODE_MIRROR_2 4 ! #define IE_ANI_SIX_FILES_2 5 //MOGR #define IE_ANI_TWENTYTWO 6 #define IE_ANI_CODE_MIRROR_3 7 *************** *** 160,163 **** --- 160,165 ---- void AddLR2Suffix(char* ResRef, unsigned char AnimID, unsigned char& Cycle, unsigned char Orient); + void AddLR3Suffix(char* ResRef, unsigned char AnimID, + unsigned char& Cycle, unsigned char Orient); void GetAnimResRef(unsigned char AnimID, unsigned char Orient, char* ResRef, unsigned char& Cycle); |