2 Copyright (C) 1999-2006 Id Software, Inc. and contributors.
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
5 This file is part of GtkRadiant.
7 GtkRadiant is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version.
12 GtkRadiant is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GtkRadiant; if not, write to the Free Software
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
26 #include "skeletons.h"
28 char *skeletonRootNames[] =
38 int skeletonRNameOffsets[] =
48 char *skeletonJointNames[] =
50 "RAVEN_LOWERBACK", // 0
56 "PLAGUELF_BACKB", // 6
64 int skeletonNameOffsets[] =
74 char *skeletonEffectorNames[] =
80 int skeletonENameOffsets[] =
89 int numJointsInSkeleton[] =
95 NUM_JOINTS_PLAGUE_ELF,
99 int numNodesInSkeleton[] =
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);
115 CreateSkeleton_t SkeletonCreators[NUM_SKELETONS] =
122 CreatePlagueElfSkel, // Corvus has the same structure as the Plague Elf
125 void CreateRavenSkel(void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex)
131 root = (char *)g_skeletalJoints + rootIndex * jointSize;
133 children = (int *)(root + RAVEN_HEAD * jointSize);
134 *children = ARRAYEDLISTNODE_NULL;
136 nodeIndex = GetFreeNode(g_jointNodes, MAX_ARRAYED_JOINT_NODES);
138 children = (int *)(root + RAVEN_UPPERBACK * jointSize);
139 *children = nodeIndex;
141 g_jointNodes[nodeIndex].data = rootIndex + RAVEN_HEAD;
142 g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL;
144 nodeIndex = GetFreeNode(g_jointNodes, MAX_ARRAYED_JOINT_NODES);
146 children = (int *)(root + RAVEN_LOWERBACK * jointSize);
147 *children = nodeIndex;
149 g_jointNodes[nodeIndex].data = rootIndex + RAVEN_UPPERBACK;
150 g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL;
153 void CreateBoxSkel(void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex)
158 root = (char *)g_skeletalJoints + rootIndex * jointSize;
160 children = (int *)(root + RAVEN_HEAD * jointSize);
161 *children = ARRAYEDLISTNODE_NULL;
164 void CreateBeetleSkel(void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex)
170 root = (char *)g_skeletalJoints + rootIndex * jointSize;
172 children = (int *)(root + BEETLE_HEAD * jointSize);
173 *children = ARRAYEDLISTNODE_NULL;
175 nodeIndex = GetFreeNode(g_jointNodes, MAX_ARRAYED_JOINT_NODES);
177 children = (int *)(root + BEETLE_NECK * jointSize);
178 *children = nodeIndex;
180 g_jointNodes[nodeIndex].data = rootIndex + BEETLE_HEAD;
181 g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL;
184 void CreateElfLordSkel(void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex)
190 root = (char *)g_skeletalJoints + rootIndex * jointSize;
192 children = (int *)(root + BEETLE_HEAD * jointSize);
193 *children = ARRAYEDLISTNODE_NULL;
195 nodeIndex = GetFreeNode(g_jointNodes, MAX_ARRAYED_JOINT_NODES);
197 children = (int *)(root + BEETLE_NECK * jointSize);
198 *children = nodeIndex;
200 g_jointNodes[nodeIndex].data = rootIndex + BEETLE_HEAD;
201 g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL;
204 void CreatePlagueElfSkel(void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex)
210 root = (char *)g_skeletalJoints + rootIndex * jointSize;
212 children = (int *)(root + PLAGUE_ELF_HEAD * jointSize);
213 *children = ARRAYEDLISTNODE_NULL;
215 nodeIndex = GetFreeNode(g_jointNodes, MAX_ARRAYED_JOINT_NODES);
217 children = (int *)(root + PLAGUE_ELF_UPPERBACK * jointSize);
218 *children = nodeIndex;
220 g_jointNodes[nodeIndex].data = rootIndex + PLAGUE_ELF_HEAD;
221 g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL;
223 nodeIndex = GetFreeNode(g_jointNodes, MAX_ARRAYED_JOINT_NODES);
225 children = (int *)(root + PLAGUE_ELF_LOWERBACK * jointSize);
226 *children = nodeIndex;
228 g_jointNodes[nodeIndex].data = rootIndex + PLAGUE_ELF_UPPERBACK;
229 g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL;