2 Copyright (C) 1999-2007 id Software, Inc. and contributors.
\r
3 For a list of contributors, see the accompanying CONTRIBUTORS file.
\r
5 This file is part of GtkRadiant.
\r
7 GtkRadiant is free software; you can redistribute it and/or modify
\r
8 it under the terms of the GNU General Public License as published by
\r
9 the Free Software Foundation; either version 2 of the License, or
\r
10 (at your option) any later version.
\r
12 GtkRadiant is distributed in the hope that it will be useful,
\r
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
15 GNU General Public License for more details.
\r
17 You should have received a copy of the GNU General Public License
\r
18 along with GtkRadiant; if not, write to the Free Software
\r
19 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\r
23 #include "reference.h"
\r
24 #include "arrayedlist.h"
\r
25 #include "resourcemanager.h"
\r
26 #include "skeletons.h"
\r
28 char *referenceRootNames[] =
\r
57 int referenceRootNameOffsets[NUM_REFERENCED] =
\r
61 12, // HIGH PRIESTESS
\r
65 int numReferences[NUM_REFERENCED] =
\r
67 NUM_REFERENCES_CORVUS,
\r
68 NUM_REFERENCES_INSECT,
\r
69 NUM_REFERENCES_PRIESTESS,
\r
70 NUM_REFERENCES_MORK,
\r
73 int corvusJointIDs[NUM_REFERENCES_CORVUS] =
\r
84 int *jointIDs[NUM_REFERENCED] =
\r
89 static ResourceManager_t ReferenceMngr;
\r
91 void InitReferenceMngr()
\r
93 #define REFERENCE_BLOCK_SIZE 8
\r
94 char *dummystr = NULL;
\r
96 ResMngr_Con(&ReferenceMngr, sizeof(LERPedReferences_t), REFERENCE_BLOCK_SIZE, dummystr);
\r
99 void ReleaseReferenceMngr()
\r
101 ResMngr_Des(&ReferenceMngr);
\r
104 LERPedReferences_t *LERPedReferences_new(int init_refType)
\r
106 LERPedReferences_t *newRefs;
\r
108 newRefs = ResMngr_AllocateResource(&ReferenceMngr, sizeof(*newRefs));
\r
109 newRefs->refType = init_refType;
\r
110 newRefs->jointIDs = jointIDs[init_refType];
\r
111 newRefs->lastUpdate = -(REF_MINCULLTIME*2.0);
\r
113 memset(newRefs->references, 0, MAX_REFPOINTS*sizeof(Reference_t));
\r
114 memset(newRefs->oldReferences, 0, MAX_REFPOINTS*sizeof(Reference_t));
\r
119 void LERPedReferences_delete(LERPedReferences_t *toDelete)
\r
121 ResMngr_DeallocateResource(&ReferenceMngr, toDelete, sizeof(*toDelete));
\r