1 | /* |
1 | /* |
2 | CrossFire, A Multiplayer game for X-windows |
2 | CrossFire, A Multiplayer game for X-windows |
3 | |
3 | |
|
|
4 | Copyright (C) 2005, 2006, 2007 Marc Lehmann & Crossfire+ Development Team |
4 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
5 | Copyright (C) 2002 Mark Wedel & Crossfire Development Team |
5 | Copyright (C) 1992 Frank Tore Johansen |
6 | Copyright (C) 1992 Frank Tore Johansen |
6 | |
7 | |
7 | This program is free software; you can redistribute it and/or modify |
8 | This program 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 | it under the terms of the GNU General Public License as published by |
… | |
… | |
111 | static int |
112 | static int |
112 | compar (const struct bmappair *a, const struct bmappair *b) |
113 | compar (const struct bmappair *a, const struct bmappair *b) |
113 | { |
114 | { |
114 | return strcmp (a->name, b->name); |
115 | return strcmp (a->name, b->name); |
115 | } |
116 | } |
|
|
117 | |
116 | static int |
118 | static int |
117 | compar_smooth (const struct smoothing *a, const struct smoothing *b) |
119 | compar_smooth (const struct smoothing *a, const struct smoothing *b) |
118 | { |
120 | { |
119 | if (a->id < b->id) |
121 | if (a->id < b->id) |
120 | return -1; |
122 | return -1; |
121 | if (b->id < a->id) |
123 | if (b->id < a->id) |
122 | return 1; |
124 | return 1; |
123 | return 0; |
125 | return 0; |
124 | } |
126 | } |
125 | |
127 | |
126 | |
|
|
127 | /* |
128 | /* |
128 | * Returns the matching color in the coloralias if found, |
129 | * Returns the matching color in the coloralias if found, |
129 | * 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 |
130 | * 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 |
131 | */ |
132 | */ |
132 | |
|
|
133 | static uint8 |
133 | static uint8 |
134 | find_color (const char *name) |
134 | find_color (const char *name) |
135 | { |
135 | { |
136 | uint8 i; |
136 | uint8 i; |
137 | |
137 | |
… | |
… | |
143 | } |
143 | } |
144 | |
144 | |
145 | /* This reads the lib/faces file, getting color and visibility information. |
145 | /* This reads the lib/faces file, getting color and visibility information. |
146 | * it is called by ReadBmapNames. |
146 | * it is called by ReadBmapNames. |
147 | */ |
147 | */ |
148 | |
|
|
149 | static void |
148 | static void |
150 | ReadFaceData (void) |
149 | ReadFaceData (void) |
151 | { |
150 | { |
152 | char buf[MAX_BUF], *cp; |
151 | char buf[MAX_BUF], *cp; |
153 | New_Face *on_face = NULL; |
152 | New_Face *on_face = NULL; |
… | |
… | |
216 | on_face->magicmap |= FACE_FLOOR; |
215 | on_face->magicmap |= FACE_FLOOR; |
217 | } |
216 | } |
218 | else |
217 | else |
219 | LOG (llevDebug, "Got unknown line in faces file: %s\n", buf); |
218 | LOG (llevDebug, "Got unknown line in faces file: %s\n", buf); |
220 | } |
219 | } |
|
|
220 | |
221 | LOG (llevDebug, "done\n"); |
221 | LOG (llevDebug, "done\n"); |
222 | fclose (fp); |
222 | fclose (fp); |
223 | } |
223 | } |
224 | |
224 | |
225 | /* 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 |
226 | * 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 |
227 | * 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 |
228 | * difference.) |
228 | * difference.) |
229 | */ |
229 | */ |
230 | |
|
|
231 | void |
230 | void |
232 | ReadBmapNames (void) |
231 | ReadBmapNames (void) |
233 | { |
232 | { |
234 | char buf[MAX_BUF], *p, *q; |
233 | char buf[MAX_BUF], *p, *q; |
235 | FILE *fp; |
234 | FILE *fp; |