From: Laszlo T. <ave...@us...> - 2005-04-08 22:28:35
|
Update of /cvsroot/gemrb/gemrb/gemrb/plugins/Core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10499/plugins/Core Modified Files: CharAnimations.cpp CharAnimations.h Map.cpp Log Message: fixed visibility a bit added more variability to character animations (random stretching) Index: Map.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/Map.cpp,v retrieving revision 1.151 retrieving revision 1.152 diff -C2 -d -r1.151 -r1.152 *** Map.cpp 8 Apr 2005 16:54:37 -0000 1.151 --- Map.cpp 8 Apr 2005 22:27:53 -0000 1.152 *************** *** 1541,1547 **** int p=Perimeter; while(p--) { ! int Pass=2; ! bool block=false; ! bool sidewall=false; for (int i=0;i<range;i++) { Tile.x = Pos.x+VisibilityMasks[i][p].x; --- 1541,1547 ---- int p=Perimeter; while(p--) { ! int Pass = 2; ! bool block = false; ! bool sidewall = false; for (int i=0;i<range;i++) { Tile.x = Pos.x+VisibilityMasks[i][p].x; Index: CharAnimations.cpp =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/CharAnimations.cpp,v retrieving revision 1.54 retrieving revision 1.55 diff -C2 -d -r1.54 -r1.55 *** CharAnimations.cpp 8 Apr 2005 20:45:47 -0000 1.54 --- CharAnimations.cpp 8 Apr 2005 22:27:53 -0000 1.55 *************** *** 281,284 **** --- 281,285 ---- The G1 file contains several animation states. See MHR Probably it could use A7-9 files too, bringing the file numbers to 28. + This is the original bg1 format. IE_ANI_SIX_FILES: The layout for these files is: *************** *** 468,471 **** --- 469,473 ---- case IE_ANI_TWO_FILES: case IE_ANI_TWENTYTWO: + case IE_ANI_TWO_FILES_2: case IE_ANI_TWO_FILES_3: case IE_ANI_FOUR_FILES: *************** *** 535,538 **** --- 537,544 ---- break; + case IE_ANI_TWO_FILES_2: //4+4 animations + AddLR2Suffix( ResRef, StanceID, Cycle, Orient ); + break; + case IE_ANI_TWO_FILES_3: //IWD style anims AddMMRSuffix( ResRef, StanceID, Cycle, Orient ); *************** *** 761,766 **** case IE_ANI_HEAD_TURN: ! strcat( ResRef, "G12" ); ! Cycle += 18; break; --- 767,777 ---- case IE_ANI_HEAD_TURN: ! if (rand()&1) { ! strcat( ResRef, "G12" ); ! Cycle += 18; ! } else { ! strcat( ResRef, "G18" ); ! Cycle += 72; ! } break; *************** *** 852,855 **** --- 863,915 ---- } + void CharAnimations::AddLR2Suffix(char* ResRef, unsigned char StanceID, + unsigned char& Cycle, unsigned char Orient) + { + Orient /= 2; + + switch (StanceID) { + //Attack is a special case... it cycles randomly + //through SLASH, BACKSLASH and JAB so we will choose + //which animation return randomly + case IE_ANI_READY: + case IE_ANI_CAST: + case IE_ANI_CONJURE: + case IE_ANI_HIDE: + case IE_ANI_WALK: + case IE_ANI_AWAKE: + Cycle = 0 + Orient; + break; + + case IE_ANI_SHOOT: + case IE_ANI_ATTACK: + case IE_ANI_ATTACK_SLASH: + case IE_ANI_ATTACK_BACKSLASH: + case IE_ANI_ATTACK_JAB: + case IE_ANI_HEAD_TURN: + Cycle = 8 + Orient; + break; + + case IE_ANI_DIE: + case IE_ANI_GET_UP: + case IE_ANI_EMERGE: + Cycle = 24 + Orient; + break; + + case IE_ANI_DAMAGE: + Cycle = 16 + Orient; + break; + + case IE_ANI_SLEEP: + case IE_ANI_TWITCH: + Cycle = 32 + Orient; + break; + } + if (Orient>=5) { + strcat( ResRef, "G1E" ); + } else { + strcat( ResRef, "G1" ); + } + } + void CharAnimations::AddMHRSuffix(char* ResRef, unsigned char StanceID, unsigned char& Cycle, unsigned char Orient) *************** *** 877,881 **** break; ! case IE_ANI_AWAKE: strcat( ResRef, "G1" ); Cycle = 8 + Orient; --- 937,941 ---- break; ! case IE_ANI_READY: strcat( ResRef, "G1" ); Cycle = 8 + Orient; *************** *** 919,923 **** break; ! case IE_ANI_READY: strcat( ResRef, "G1" ); Cycle = 24 + Orient; --- 979,983 ---- break; ! case IE_ANI_AWAKE: strcat( ResRef, "G1" ); Cycle = 24 + Orient; Index: CharAnimations.h =================================================================== RCS file: /cvsroot/gemrb/gemrb/gemrb/plugins/Core/CharAnimations.h,v retrieving revision 1.34 retrieving revision 1.35 diff -C2 -d -r1.34 -r1.35 *** CharAnimations.h 8 Apr 2005 20:45:48 -0000 1.34 --- CharAnimations.h 8 Apr 2005 22:27:53 -0000 1.35 *************** *** 83,86 **** --- 83,87 ---- #define IE_ANI_SIX_FILES 8 //MCAR/MWYV #define IE_ANI_TWO_FILES_3 9 //iwd animations + #define IE_ANI_TWO_FILES_2 10 //low res bg1 anim //PST animation types *************** *** 157,160 **** --- 158,163 ---- void AddLRSuffix(char* ResRef, unsigned char AnimID, unsigned char& Cycle, unsigned char Orient); + void AddLR2Suffix(char* ResRef, unsigned char AnimID, + unsigned char& Cycle, unsigned char Orient); void GetAnimResRef(unsigned char AnimID, unsigned char Orient, char* ResRef, unsigned char& Cycle); |