]> git.mxchange.org Git - flightgear.git/blobdiff - src/ATCDCL/ATC.cxx
Fix a couple of 64-bit warnings identified by GCC.
[flightgear.git] / src / ATCDCL / ATC.cxx
index cf1e7c823692f0569bdce70f20bf712c95204a58..9e868017b19111ccefb25fba399bc1aad156e36e 100644 (file)
@@ -41,7 +41,6 @@ FGATC::FGATC() :
     range(0),
     _voice(true),
     _playing(false),
-    _vPtr(NULL),
     _sgr(NULL),
     _type(INVALID),
     _display(false)
@@ -81,6 +80,9 @@ FGATC::~FGATC() {
 // call this from their own Update(...).
 void FGATC::update(double dt) {
 
+    // TODO This doesn't really do anything specific to this instance.
+    // All FGATCs share the same "_sgr" sound group. So this really should
+    // only be done once for all FGATCs.
 #ifdef ENABLE_AUDIO_SUPPORT
     bool active = _atc_external->getBoolValue() ||
               _internal->getBoolValue();
@@ -164,10 +166,9 @@ void FGATC::Render(std::string& msg, const float volume,
             _currentMsg = msg;
             size_t len;
             void* buf = NULL;
-            if (!_vPtr)
-                _vPtr = GetVoicePointer();
-            if (_vPtr)
-                buf = _vPtr->WriteMessage((char*)msg.c_str(), &len);
+            FGATCVoice* vPtr = GetVoicePointer();
+            if (vPtr)
+                buf = vPtr->WriteMessage((char*)msg.c_str(), &len);
             NoRender(refname);
             if(buf) {
                 try {