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

Comparing deliantra/server/common/image.C (file contents):
Revision 1.37 by root, Sat Apr 23 04:56:45 2011 UTC vs.
Revision 1.38 by root, Tue Jan 3 11:23:41 2012 UTC

28 28
29faceidx blank_face, empty_face, magicmouth_face; 29faceidx blank_face, empty_face, magicmouth_face;
30 30
31facehash_t facehash; 31facehash_t facehash;
32std::vector<faceinfo> faces; 32std::vector<faceinfo> faces;
33
34static std::vector<faceidx> faces_free;
35
36faceidx face_alloc ()
37{
38 faceidx idx;
39
40 if (faces_freelist.empty ())
41 {
42 idx = faces_free.back ();
43 faces_free.pop_back ();
44 }
45 else
46 {
47 idx = faces.size ();
48
49 if (!idx) // skip index 0
50 idx = 1;
51
52 faces.resize (idx + 1);
53 }
54
55 return idx;
56}
57
58faceinfo::unref ()
59{
60 if (--refcnt)
61 return;
62
63 refcnt = 1;
64
65}
33 66
34faceidx 67faceidx
35face_find (const char *name, faceidx defidx) 68face_find (const char *name, faceidx defidx)
36{ 69{
37 if (!name) 70 if (!name)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines