ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/anim.C
(Generate patch)

Comparing deliantra/server/common/anim.C (file contents):
Revision 1.4 by root, Sun Sep 3 00:18:39 2006 UTC vs.
Revision 1.5 by root, Sun Sep 3 07:57:54 2006 UTC

1/* 1/*
2 * static char *rcsid_anim_c = 2 * static char *rcsid_anim_c =
3 * "$Id: anim.C,v 1.4 2006/09/03 00:18:39 root Exp $"; 3 * "$Id: anim.C,v 1.5 2006/09/03 07:57:54 root Exp $";
4 */ 4 */
5 5
6/* 6/*
7 CrossFire, A Multiplayer game for X-windows 7 CrossFire, A Multiplayer game for X-windows
8 8
81 LOG(llevError,"Didn't get a mina before %s\n", buf); 81 LOG(llevError,"Didn't get a mina before %s\n", buf);
82 num_frames=0; 82 num_frames=0;
83 } 83 }
84 num_animations++; 84 num_animations++;
85 85
86 animations.resize (num_animations + 1); 86 Animations &anim = animations.at (num_animations);
87 animations[num_animations].name = buf + 5; 87 anim.name = buf + 5;
88 animations[num_animations].num = num_animations; /* for bsearch */ 88 anim.num = num_animations; /* for bsearch */
89 animations[num_animations].facings = 1; 89 anim.facings = 1;
90 } 90 }
91 else if (!strncmp(buf,"mina",4)) { 91 else if (!strncmp(buf,"mina",4)) {
92 animations[num_animations].faces = (Fontindex *) malloc(sizeof(Fontindex)*num_frames); 92 animations[num_animations].faces = (Fontindex *) malloc(sizeof(Fontindex)*num_frames);
93 for (i=0; i<num_frames; i++) 93 for (i=0; i<num_frames; i++)
94 animations[num_animations].faces[i]=faces[i]; 94 animations[num_animations].faces[i]=faces[i];
127{ 127{
128 Animations search, *match; 128 Animations search, *match;
129 129
130 search.name = name; 130 search.name = name;
131 131
132 match = (Animations*)bsearch(&search, animations, (num_animations+1), 132 match = (Animations*)bsearch(&search, &animations [0], (num_animations+1),
133 sizeof(Animations), (int (*)(const void*, const void*))anim_compare); 133 sizeof(Animations), (int (*)(const void*, const void*))anim_compare);
134 134
135 135
136 if (match) return match->num; 136 if (match) return match->num;
137 LOG(llevError,"Unable to find animation %s\n", name); 137 LOG(llevError,"Unable to find animation %s\n", name);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines