]> git.mxchange.org Git - flightgear.git/blobdiff - src/Sound/beacon.cxx
Update 'magic' for more consistant cross platform padding.
[flightgear.git] / src / Sound / beacon.cxx
index 24424c14a033ce8e4ad68addbaa1f96bcdfd3539..ddc8750b0f828e60b17a6a068f916e71e5fbe444 100644 (file)
@@ -2,7 +2,7 @@
 //
 // Written by Curtis Olson, started March 2001.
 //
-// Copyright (C) 2001  Curtis L. Olson - curt@flightgear.org
+// Copyright (C) 2001  Curtis L. Olson - http://www.flightgear.org/~curt
 //
 // This program is free software; you can redistribute it and/or
 // modify it under the terms of the GNU General Public License as
 
 
 // constructor
-FGBeacon::FGBeacon() {
+FGBeacon::FGBeacon() :
+    inner(NULL),
+    middle(NULL),
+    outer(NULL)
+{
 }
 
 // destructor
 FGBeacon::~FGBeacon() {
+    delete inner;
+    delete middle;
+    delete outer;
 }
 
 
@@ -39,6 +46,10 @@ bool FGBeacon::init() {
     int len;
     unsigned char *ptr;
 
+    unsigned char inner_buf[ INNER_SIZE ] ;
+    unsigned char middle_buf[ MIDDLE_SIZE ] ;
+    unsigned char outer_buf[ OUTER_SIZE ] ;
+
     // Make inner marker beacon sound
     len= (int)(INNER_DIT_LEN / 2.0 );
     unsigned char inner_dit[INNER_DIT_LEN];
@@ -86,7 +97,7 @@ bool FGBeacon::init() {
     ptr += OUTER_DAH_LEN;
     memcpy( ptr, outer_dah, OUTER_DAH_LEN );
 
-    outer = new SGSoundSample( outer_buf, OUTER_SIZE, BYTES_PER_SECOND );
+    outer = new SGSoundSample( outer_buf, OUTER_SIZE, BYTES_PER_SECOND);
     outer->set_reference_dist( 10.0 );
     outer->set_max_dist( 20.0 );