source: golgotha/src/golg/objs/sfx_obj.hh @ 80

Last change on this file since 80 was 80, checked in by Sam Hocevar, 11 years ago
  • Adding the Golgotha source code. Not sure what's going to be interesting in there, but since it's all public domain, there's certainly stuff to pick up.
File size: 1.8 KB
Line 
1/********************************************************************** <BR>
2  This file is part of Crack dot Com's free source code release of
3  Golgotha. <a href="http://www.crack.com/golgotha_release"> <BR> for
4  information about compiling & licensing issues visit this URL</a>
5  <PRE> If that doesn't help, contact Jonathan Clark at
6  golgotha_source@usa.net (Subject should have "GOLG" in it)
7***********************************************************************/
8
9#ifndef G1_TAKEOVER_PAD_HH
10#define G1_TAKEOVER_PAD_HH
11
12
13#include "g1_object.hh"
14#include "objs/model_draw.hh"
15
16class i4_stream_wav_player;
17
18extern g1_object_type g1_sfx_obj_type;
19
20class g1_sfx_obj_class : public g1_object_class
21{
22  enum { DATA_VERSION=1 };
23public:
24  static g1_sfx_obj_class *cast(g1_object_class *obj)
25  {
26    if (!obj || obj->id != g1_sfx_obj_type)
27    {
28#ifdef I4_CAST_WARN
29      i4_warning("bad cast to sfx_obj!\n");
30#endif
31      return 0;
32    }
33   
34    return (g1_sfx_obj_class *)obj;
35  }
36
37  i4_stream_wav_player *stream;
38  i4_str *filename;
39  w16 max_volume;
40  w32 max_hearable_distance;
41  w32 restart_delay;
42  w32 random_restart_delay;   
43  w32 current_delay;         // time to count down until next sound is played
44  float dist_from_camera_sqrd;    // calculated by g1_sound_man
45
46  g1_sfx_obj_class *next_sfx;
47 
48  g1_sfx_obj_class(g1_object_type id, g1_loader_class *fp);
49  ~g1_sfx_obj_class();
50  virtual void save(g1_saver_class *fp);
51
52  i4_str *get_context_string(); 
53
54  void set_filename(const i4_const_str &fname);
55
56  // adds self to sound_manager
57  i4_bool occupy_location();
58
59  // remove self from sound_manager
60  void unoccupy_location();
61  virtual void draw(g1_draw_context_class *context);
62  virtual void think();
63};
64
65
66#endif
Note: See TracBrowser for help on using the repository browser.