2 Copyright (C) 1999-2007 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 ){
130 root = (char *)g_skeletalJoints + rootIndex * jointSize;
132 children = (int *)( root + RAVEN_HEAD * jointSize );
133 *children = ARRAYEDLISTNODE_NULL;
135 nodeIndex = GetFreeNode( g_jointNodes, MAX_ARRAYED_JOINT_NODES );
137 children = (int *)( root + RAVEN_UPPERBACK * jointSize );
138 *children = nodeIndex;
140 g_jointNodes[nodeIndex].data = rootIndex + RAVEN_HEAD;
141 g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL;
143 nodeIndex = GetFreeNode( g_jointNodes, MAX_ARRAYED_JOINT_NODES );
145 children = (int *)( root + RAVEN_LOWERBACK * jointSize );
146 *children = nodeIndex;
148 g_jointNodes[nodeIndex].data = rootIndex + RAVEN_UPPERBACK;
149 g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL;
152 void CreateBoxSkel( void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex ){
156 root = (char *)g_skeletalJoints + rootIndex * jointSize;
158 children = (int *)( root + RAVEN_HEAD * jointSize );
159 *children = ARRAYEDLISTNODE_NULL;
162 void CreateBeetleSkel( void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex ){
167 root = (char *)g_skeletalJoints + rootIndex * jointSize;
169 children = (int *)( root + BEETLE_HEAD * jointSize );
170 *children = ARRAYEDLISTNODE_NULL;
172 nodeIndex = GetFreeNode( g_jointNodes, MAX_ARRAYED_JOINT_NODES );
174 children = (int *)( root + BEETLE_NECK * jointSize );
175 *children = nodeIndex;
177 g_jointNodes[nodeIndex].data = rootIndex + BEETLE_HEAD;
178 g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL;
181 void CreateElfLordSkel( void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex ){
186 root = (char *)g_skeletalJoints + rootIndex * jointSize;
188 children = (int *)( root + BEETLE_HEAD * jointSize );
189 *children = ARRAYEDLISTNODE_NULL;
191 nodeIndex = GetFreeNode( g_jointNodes, MAX_ARRAYED_JOINT_NODES );
193 children = (int *)( root + BEETLE_NECK * jointSize );
194 *children = nodeIndex;
196 g_jointNodes[nodeIndex].data = rootIndex + BEETLE_HEAD;
197 g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL;
200 void CreatePlagueElfSkel( void *g_skeletalJoints, size_t jointSize, ArrayedListNode_t *g_jointNodes, int rootIndex ){
205 root = (char *)g_skeletalJoints + rootIndex * jointSize;
207 children = (int *)( root + PLAGUE_ELF_HEAD * jointSize );
208 *children = ARRAYEDLISTNODE_NULL;
210 nodeIndex = GetFreeNode( g_jointNodes, MAX_ARRAYED_JOINT_NODES );
212 children = (int *)( root + PLAGUE_ELF_UPPERBACK * jointSize );
213 *children = nodeIndex;
215 g_jointNodes[nodeIndex].data = rootIndex + PLAGUE_ELF_HEAD;
216 g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL;
218 nodeIndex = GetFreeNode( g_jointNodes, MAX_ARRAYED_JOINT_NODES );
220 children = (int *)( root + PLAGUE_ELF_LOWERBACK * jointSize );
221 *children = nodeIndex;
223 g_jointNodes[nodeIndex].data = rootIndex + PLAGUE_ELF_UPPERBACK;
224 g_jointNodes[nodeIndex].next = ARRAYEDLISTNODE_NULL;