1 /* 2 * Copyright (c) 1997 - 2002 by Volker Meyer & Hansj�rg Malthaner 3 * 4 * This file is part of the Simutrans project under the artistic licence. 5 */ 6 7 #ifndef __SOUND_DESC_H 8 #define __SOUND_DESC_H 9 10 #include "obj_base_desc.h" 11 #include "../simtypes.h" 12 13 #define NO_SOUND (sint16)(0xFFFFu) 14 #define LOAD_SOUND (sint8)(0xFFFEu) 15 16 #define AMBIENT_SOUND_INTERVALL (13000) 17 18 /* 19 * Author: 20 * prissi 21 * 22 * Description: 23 * Sounds in the game; name is the file name 24 * ingame, sounds are referred to by their number 25 * 26 * Child nodes: 27 * 0 Name 28 * 1 Copyright 29 */ 30 31 #define SFX_CASH sound_desc_t::get_compatible_sound_id(15) 32 #define SFX_REMOVER sound_desc_t::get_compatible_sound_id(14) 33 #define SFX_DOCK sound_desc_t::get_compatible_sound_id(13) 34 #define SFX_GAVEL sound_desc_t::get_compatible_sound_id(12) 35 #define SFX_JACKHAMMER sound_desc_t::get_compatible_sound_id(11) 36 #define SFX_FAILURE sound_desc_t::get_compatible_sound_id(10) 37 #define SFX_SELECT sound_desc_t::get_compatible_sound_id(9) 38 39 #define MAX_OLD_SOUNDS (16) 40 41 42 class sound_desc_t : public obj_named_desc_t { 43 friend class sound_reader_t; 44 45 private: 46 static sint16 compatible_sound_id[MAX_OLD_SOUNDS]; 47 48 sint16 sound_id; 49 sint16 nr; // for old sounds/system sounds etc. 50 51 public: 52 // sounds for ambient 53 static sint16 beach_sound; 54 static sint16 forest_sound; 55 static sint16 climate_sounds[MAX_CLIMATES]; 56 57 static sint16 get_sound_id(const char *name); 58 59 static bool register_desc(sound_desc_t *desc); 60 61 static void init(); 62 63 /* return old sound id from index */ get_compatible_sound_id(const sint8 nr)64 static sint16 get_compatible_sound_id(const sint8 nr) { return compatible_sound_id[nr&(15)]; } 65 }; 66 67 68 #endif 69