Mercurial > hg > forks > yadex
comparison src/things.cc @ 85:dd99c66ed169
More cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 26 Sep 2011 18:19:59 +0300 |
parents | a68786b9c74b |
children | 20aa5a515896 |
comparison
equal
deleted
inserted
replaced
84:c518e08d5961 | 85:dd99c66ed169 |
---|---|
104 | 104 |
105 things_table[n].desc = CUR_THINGDEF->desc; | 105 things_table[n].desc = CUR_THINGDEF->desc; |
106 things_table[n].sprite = CUR_THINGDEF->sprite; | 106 things_table[n].sprite = CUR_THINGDEF->sprite; |
107 } | 107 } |
108 | 108 |
109 // Sort the table by increasing thing type | 109 // Sort the table by increasing thing type |
110 qsort(things_table, nthings, sizeof *things_table, things_table_cmp); | 110 qsort(things_table, nthings, sizeof *things_table, things_table_cmp); |
111 | 111 |
112 #if 0 | 112 #if 0 |
113 printf("Type Colour Radius Desc\n"); | 113 printf("Type Colour Radius Desc\n"); |
114 for (n = 0; n < nthings; n++) | 114 for (n = 0; n < nthings; n++) |
296 * GetAngleName | 296 * GetAngleName |
297 * Get the name of the angle | 297 * Get the name of the angle |
298 */ | 298 */ |
299 const char *GetAngleName(int angle) | 299 const char *GetAngleName(int angle) |
300 { | 300 { |
301 static char buf[30]; | 301 static char buf[32]; |
302 | 302 |
303 switch (angle) | 303 switch (angle) |
304 { | 304 { |
305 case 0: | 305 case 0: return "East"; |
306 return "East"; | 306 case 45: return "North-east"; |
307 case 45: | 307 case 90: return "North"; |
308 return "North-east"; | 308 case 135: return "North-west"; |
309 case 90: | 309 case 180: return "West"; |
310 return "North"; | 310 case 225: return "South-west"; |
311 case 135: | 311 case 270: return "South"; |
312 return "North-west"; | 312 case 315: return "South-east"; |
313 case 180: | 313 default: |
314 return "West"; | 314 sprintf(buf, "ILLEGAL (%d)", angle); |
315 case 225: | 315 return buf; |
316 return "South-west"; | 316 } |
317 case 270: | |
318 return "South"; | |
319 case 315: | |
320 return "South-east"; | |
321 } | |
322 sprintf(buf, "ILLEGAL (%d)", angle); | |
323 return buf; | |
324 } | 317 } |
325 | 318 |
326 | 319 |
327 /* | 320 /* |
328 * GetWhenName | 321 * GetWhenName |
329 * get string of when something will appear | 322 * get string of when something will appear |
330 */ | 323 */ |
331 const char *GetWhenName(int when) | 324 const char *GetWhenName(int when) |
332 { | 325 { |
333 static char buf[16 + 3 + 1]; | 326 static char buf[16 + 3 + 1]; |
334 // "N" is a Boom extension ("not in deathmatch") | 327 // "N" is a Boom extension ("not in deathmatch") |
335 // "C" is a Boom extension ("not in cooperative") | 328 // "C" is a Boom extension ("not in cooperative") |
336 // "F" is an MBF extension ("friendly") | 329 // "F" is an MBF extension ("friendly") |
337 const char *flag_chars = "????" "????" "FCNM" "D431"; | 330 const char *flag_chars = "????" "????" "FCNM" "D431"; |
338 int n; | 331 int n; |
339 | 332 |
340 char *b = buf; | 333 char *b = buf; |
341 for (n = 0; n < 16; n++) | 334 for (n = 0; n < 16; n++) |