… | |
… | |
112 | static int |
112 | static int |
113 | compar (const struct bmappair *a, const struct bmappair *b) |
113 | compar (const struct bmappair *a, const struct bmappair *b) |
114 | { |
114 | { |
115 | return strcmp (a->name, b->name); |
115 | return strcmp (a->name, b->name); |
116 | } |
116 | } |
|
|
117 | |
117 | static int |
118 | static int |
118 | compar_smooth (const struct smoothing *a, const struct smoothing *b) |
119 | compar_smooth (const struct smoothing *a, const struct smoothing *b) |
119 | { |
120 | { |
120 | if (a->id < b->id) |
121 | if (a->id < b->id) |
121 | return -1; |
122 | return -1; |
122 | if (b->id < a->id) |
123 | if (b->id < a->id) |
123 | return 1; |
124 | return 1; |
124 | return 0; |
125 | return 0; |
125 | } |
126 | } |
126 | |
127 | |
127 | |
|
|
128 | /* |
128 | /* |
129 | * Returns the matching color in the coloralias if found, |
129 | * Returns the matching color in the coloralias if found, |
130 | * 0 otherwise. Note that 0 will actually be black, so there is no |
130 | * 0 otherwise. Note that 0 will actually be black, so there is no |
131 | * way the calling function can tell if an error occurred or not |
131 | * way the calling function can tell if an error occurred or not |
132 | */ |
132 | */ |
133 | |
|
|
134 | static uint8 |
133 | static uint8 |
135 | find_color (const char *name) |
134 | find_color (const char *name) |
136 | { |
135 | { |
137 | uint8 i; |
136 | uint8 i; |
138 | |
137 | |
… | |
… | |
144 | } |
143 | } |
145 | |
144 | |
146 | /* This reads the lib/faces file, getting color and visibility information. |
145 | /* This reads the lib/faces file, getting color and visibility information. |
147 | * it is called by ReadBmapNames. |
146 | * it is called by ReadBmapNames. |
148 | */ |
147 | */ |
149 | |
|
|
150 | static void |
148 | static void |
151 | ReadFaceData (void) |
149 | ReadFaceData (void) |
152 | { |
150 | { |
153 | char buf[MAX_BUF], *cp; |
151 | char buf[MAX_BUF], *cp; |
154 | New_Face *on_face = NULL; |
152 | New_Face *on_face = NULL; |
… | |
… | |
217 | on_face->magicmap |= FACE_FLOOR; |
215 | on_face->magicmap |= FACE_FLOOR; |
218 | } |
216 | } |
219 | else |
217 | else |
220 | LOG (llevDebug, "Got unknown line in faces file: %s\n", buf); |
218 | LOG (llevDebug, "Got unknown line in faces file: %s\n", buf); |
221 | } |
219 | } |
|
|
220 | |
222 | LOG (llevDebug, "done\n"); |
221 | LOG (llevDebug, "done\n"); |
223 | fclose (fp); |
222 | fclose (fp); |
224 | } |
223 | } |
225 | |
224 | |
226 | /* This reads the bmaps file to get all the bitmap names and |
225 | /* This reads the bmaps file to get all the bitmap names and |
227 | * stuff. It only needs to be done once, because it is player |
226 | * stuff. It only needs to be done once, because it is player |
228 | * independent (ie, what display the person is on will not make a |
227 | * independent (ie, what display the person is on will not make a |
229 | * difference.) |
228 | * difference.) |
230 | */ |
229 | */ |
231 | |
|
|
232 | void |
230 | void |
233 | ReadBmapNames (void) |
231 | ReadBmapNames (void) |
234 | { |
232 | { |
235 | char buf[MAX_BUF], *p, *q; |
233 | char buf[MAX_BUF], *p, *q; |
236 | FILE *fp; |
234 | FILE *fp; |