| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
#include "skeletons.h" |
| 27 |
|
| 28 |
char *skeletonRootNames[] = |
| 29 |
{ |
| 30 |
"RAVEN_ROOT", |
| 31 |
"BOX_ROOT", |
| 32 |
"BEETLE_ROOT", |
| 33 |
"ELFLORD_ROOT", |
| 34 |
"PLAGUELF_ROOT", |
| 35 |
"ELF_BACKROOT", |
| 36 |
}; |
| 37 |
|
| 38 |
int skeletonRNameOffsets[] = |
| 39 |
{ |
| 40 |
0, |
| 41 |
1, |
| 42 |
2, |
| 43 |
3, |
| 44 |
4, |
| 45 |
5, |
| 46 |
}; |
| 47 |
|
| 48 |
char *skeletonJointNames[] = |
| 49 |
{ |
| 50 |
"RAVEN_LOWERBACK", |
| 51 |
"RAVEN_UPPERBACK", |
| 52 |
"RAVEN_NECK", |
| 53 |
"BOX_CENTER", |
| 54 |
"BEETLE_NECK", |
| 55 |
"BEETLE_HEAD", |
| 56 |
"PLAGUELF_BACKB", |
| 57 |
"PLAGUELF_BACKC", |
| 58 |
"PLAGUELF_NECK", |
| 59 |
"ELF_BACKB", |
| 60 |
"ELF_BACKC", |
| 61 |
"ELF_NECKB", |
| 62 |
}; |
| 63 |
|
| 64 |
int skeletonNameOffsets[] = |
| 65 |
{ |
| 66 |
0, |
| 67 |
3, |
| 68 |
4, |
| 69 |
-1, |
| 70 |
6, |
| 71 |
9, |
| 72 |
}; |
| 73 |
|
| 74 |
char *skeletonEffectorNames[] = |
| 75 |
{ |
| 76 |
"BEETLE_EYES", |
| 77 |
"CORVUS_EYES", |
| 78 |
}; |
| 79 |
|
| 80 |
int skeletonENameOffsets[] = |
| 81 |
{ |
| 82 |
-1, |
| 83 |
-1, |
| 84 |
0, |
| 85 |
-1, |
| 86 |
1, |
| 87 |
}; |
| 88 |
|
| 89 |
int numJointsInSkeleton[] = |
| 90 |
{ |
| 91 |
NUM_JOINTS_RAVEN, |
| 92 |
NUM_JOINTS_BOX, |
| 93 |
NUM_JOINTS_BEETLE, |
| 94 |
NUM_JOINTS_ELFLORD, |
| 95 |
NUM_JOINTS_PLAGUE_ELF, |
| 96 |
NUM_JOINTS_CORVUS, |
| 97 |
}; |
| 98 |
|
| 99 |
int numNodesInSkeleton[] = |
| 100 |
{ |
| 101 |
2, |
| 102 |
0, |
| 103 |
1, |
| 104 |
-1, |
| 105 |
2, |
| 106 |
2, |
| 107 |
}; |
| 108 |
|
| 109 |
void CreateRavenSkel( void *g_skeletalJoints, size_t jointSize, struct ArrayedListNode_s *g_jointNodes, int root ); |
| 110 |
void CreateBoxSkel( void *g_skeletalJoints, size_t jointSize, struct ArrayedListNode_s *g_jointNodes, int root ); |
| 111 |
void CreateBeetleSkel( void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex ); |
| 112 |
void CreateElfLordSkel( void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex ); |
| 113 |
void CreatePlagueElfSkel( void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex ); |
| 114 |
|
| 115 |
CreateSkeleton_t SkeletonCreators[NUM_SKELETONS] = |
| 116 |
{ |
| 117 |
CreateRavenSkel, |
| 118 |
CreateBoxSkel, |
| 119 |
CreateBeetleSkel, |
| 120 |
CreateElfLordSkel, |
| 121 |
CreatePlagueElfSkel, |
| 122 |
CreatePlagueElfSkel, |
| 123 |
}; |
| 124 |
|
| 125 |
void CreateRavenSkel( void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex ){ |
| 126 |
char *root; |
| 127 |
int *children; |
| 128 |
int nodeIndex; |
| 129 |
|
| 130 |
root = (char *)g_skeletalJoints + rootIndex * jointSize; |
| 131 |
|
| 132 |
children = (int *)( root + RAVEN_HEAD * jointSize ); |
| 133 |
*children = ARRAYEDLISTNODE_NULL; |
| 134 |
|
| 135 |
nodeIndex = GetFreeNode( g_jointNodes, MAX_ARRAYED_JOINT_NODES ); |
| 136 |
|
| 137 |
children = (int *)( root + RAVEN_UPPERBACK * jointSize ); |
| 138 |
*children = nodeIndex; |
| 139 |
|
| 140 |
g_jointNodes[nodeIndex].data = rootIndex + RAVEN_HEAD; |
| 141 |
g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL; |
| 142 |
|
| 143 |
nodeIndex = GetFreeNode( g_jointNodes, MAX_ARRAYED_JOINT_NODES ); |
| 144 |
|
| 145 |
children = (int *)( root + RAVEN_LOWERBACK * jointSize ); |
| 146 |
*children = nodeIndex; |
| 147 |
|
| 148 |
g_jointNodes[nodeIndex].data = rootIndex + RAVEN_UPPERBACK; |
| 149 |
g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL; |
| 150 |
} |
| 151 |
|
| 152 |
void CreateBoxSkel( void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex ){ |
| 153 |
char *root; |
| 154 |
int *children; |
| 155 |
|
| 156 |
root = (char *)g_skeletalJoints + rootIndex * jointSize; |
| 157 |
|
| 158 |
children = (int *)( root + RAVEN_HEAD * jointSize ); |
| 159 |
*children = ARRAYEDLISTNODE_NULL; |
| 160 |
} |
| 161 |
|
| 162 |
void CreateBeetleSkel( void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex ){ |
| 163 |
char *root; |
| 164 |
int *children; |
| 165 |
int nodeIndex; |
| 166 |
|
| 167 |
root = (char *)g_skeletalJoints + rootIndex * jointSize; |
| 168 |
|
| 169 |
children = (int *)( root + BEETLE_HEAD * jointSize ); |
| 170 |
*children = ARRAYEDLISTNODE_NULL; |
| 171 |
|
| 172 |
nodeIndex = GetFreeNode( g_jointNodes, MAX_ARRAYED_JOINT_NODES ); |
| 173 |
|
| 174 |
children = (int *)( root + BEETLE_NECK * jointSize ); |
| 175 |
*children = nodeIndex; |
| 176 |
|
| 177 |
g_jointNodes[nodeIndex].data = rootIndex + BEETLE_HEAD; |
| 178 |
g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL; |
| 179 |
} |
| 180 |
|
| 181 |
void CreateElfLordSkel( void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex ){ |
| 182 |
char *root; |
| 183 |
int *children; |
| 184 |
int nodeIndex; |
| 185 |
|
| 186 |
root = (char *)g_skeletalJoints + rootIndex * jointSize; |
| 187 |
|
| 188 |
children = (int *)( root + BEETLE_HEAD * jointSize ); |
| 189 |
*children = ARRAYEDLISTNODE_NULL; |
| 190 |
|
| 191 |
nodeIndex = GetFreeNode( g_jointNodes, MAX_ARRAYED_JOINT_NODES ); |
| 192 |
|
| 193 |
children = (int *)( root + BEETLE_NECK * jointSize ); |
| 194 |
*children = nodeIndex; |
| 195 |
|
| 196 |
g_jointNodes[nodeIndex].data = rootIndex + BEETLE_HEAD; |
| 197 |
g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL; |
| 198 |
} |
| 199 |
|
| 200 |
void CreatePlagueElfSkel( void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex ){ |
| 201 |
char *root; |
| 202 |
int *children; |
| 203 |
int nodeIndex; |
| 204 |
|
| 205 |
root = (char *)g_skeletalJoints + rootIndex * jointSize; |
| 206 |
|
| 207 |
children = (int *)( root + PLAGUE_ELF_HEAD * jointSize ); |
| 208 |
*children = ARRAYEDLISTNODE_NULL; |
| 209 |
|
| 210 |
nodeIndex = GetFreeNode( g_jointNodes, MAX_ARRAYED_JOINT_NODES ); |
| 211 |
|
| 212 |
children = (int *)( root + PLAGUE_ELF_UPPERBACK * jointSize ); |
| 213 |
*children = nodeIndex; |
| 214 |
|
| 215 |
g_jointNodes[nodeIndex].data = rootIndex + PLAGUE_ELF_HEAD; |
| 216 |
g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL; |
| 217 |
|
| 218 |
nodeIndex = GetFreeNode( g_jointNodes, MAX_ARRAYED_JOINT_NODES ); |
| 219 |
|
| 220 |
children = (int *)( root + PLAGUE_ELF_LOWERBACK * jointSize ); |
| 221 |
*children = nodeIndex; |
| 222 |
|
| 223 |
g_jointNodes[nodeIndex].data = rootIndex + PLAGUE_ELF_UPPERBACK; |
| 224 |
g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL; |
| 225 |
} |