Crossfire Client, Trunk  R20330
parser.c
Go to the documentation of this file.
1 /*
2  * Crossfire -- cooperative multi-player graphical RPG and adventure game
3  *
4  * Copyright (c) 1999-2013 Mark Wedel and the Crossfire Development Team
5  * Copyright (c) 1992 Frank Tore Johansen
6  *
7  * Crossfire is free software and comes with ABSOLUTELY NO WARRANTY. You are
8  * welcome to redistribute it under certain conditions. For details, please
9  * see COPYING and LICENSE.
10  *
11  * The authors can be reached via e-mail at <crossfire@metalforge.org>.
12  */
13 
18 #include "client.h"
19 
20 #include <ctype.h>
21 
22 #include "common.h"
23 #include "sndproto.h"
24 
31 int sound_to_soundnum(const char *name, guint8 type) {
32  int i;
33 
34  for (i = 0; i < MAX_SOUNDS; i++) {
35  if (sounds[i].symbolic != NULL) {
36  if (strcmp(sounds[i].symbolic, name) == 0) {
37  return i;
38  }
39  }
40  }
41 
42  printf("Could not find matching sound for '%s'.\n", name);
43  return -1;
44 }
45 
52 int type_to_soundtype(guint8 type) {
53  guint8 new_type;
54 
55  if (type == 2) {
56  new_type = 1;
57  } else {
58  new_type = type;
59  }
60 
61  printf("Converted legacy sound type %d to %d.\n", type, new_type);
62  return new_type;
63 }
int sound_to_soundnum(const char *name, guint8 type)
Convert a sound name to a sound number to help with the transition of the sound server from sound sup...
Definition: parser.c:31
#define MAX_SOUNDS
Definition: common.h:8
Sound_Info sounds[MAX_SOUNDS]
Definition: init.c:29
Includes various dependencies header files needed by most everything.
char * name
Definition: image.c:39
int type_to_soundtype(guint8 type)
Convert a legacy sound type to the sound2 equivalent.
Definition: parser.c:52