Sfoglia il codice sorgente

switch cat->is_debug to cat.is_debug

cxgeorge 24 anni fa
parent
commit
765d469e85

+ 22 - 22
panda/src/audio/audio_manager.cxx

@@ -43,7 +43,7 @@ AudioManager::~AudioManager(void) {
 void AudioManager::set_update_func(AudioManager::UpdateFunc* func) {
 void AudioManager::set_update_func(AudioManager::UpdateFunc* func) {
   if (_update_func != (AudioManager::UpdateFunc*)0L)
   if (_update_func != (AudioManager::UpdateFunc*)0L)
     audio_cat->error() << "There maybe be more then one audio driver installed"
     audio_cat->error() << "There maybe be more then one audio driver installed"
-		       << endl;
+               << endl;
   _update_func = func;
   _update_func = func;
 }
 }
 
 
@@ -71,19 +71,19 @@ void AudioManager::ns_update(void) {
     for (LoopSet::iterator i=_loopcopy->begin(); i!=_loopcopy->end(); ++i) {
     for (LoopSet::iterator i=_loopcopy->begin(); i!=_loopcopy->end(); ++i) {
       AudioSound* sound = *i;
       AudioSound* sound = *i;
       if (sound->status() == AudioSound::READY) {
       if (sound->status() == AudioSound::READY) {
-	if (audio_cat->is_debug())
-	  audio_cat->debug() << "AudioManager::ns_update looping '"
-			     << sound->get_name() << "'" << endl;
-	AudioManager::play(sound);
-	AudioManager::set_loop(sound, true);
+    if (audio_cat.is_debug())
+      audio_cat->debug() << "AudioManager::ns_update looping '"
+                 << sound->get_name() << "'" << endl;
+    AudioManager::play(sound);
+    AudioManager::set_loop(sound, true);
       } else if (AudioManager::_master_volume_change)
       } else if (AudioManager::_master_volume_change)
-	if (sound->get_player()->adjust_volume(sound->get_state())) {
-	  if (audio_cat->is_debug())
-	    audio_cat->debug() << "AudioManager::ns_update sound is turned "
-			       << "off, stopping '" << sound->get_name()
-			       << "'" << endl;
-	  AudioManager::stop(sound);
-	}
+    if (sound->get_player()->adjust_volume(sound->get_state())) {
+      if (audio_cat.is_debug())
+        audio_cat->debug() << "AudioManager::ns_update sound is turned "
+                   << "off, stopping '" << sound->get_name()
+                   << "'" << endl;
+      AudioManager::stop(sound);
+    }
     }
     }
   AudioManager::_master_volume_change = false;
   AudioManager::_master_volume_change = false;
 }
 }
@@ -97,7 +97,7 @@ void AudioManager::ns_update(void) {
 void AudioManager::set_shutdown_func(AudioManager::ShutdownFunc* func) {
 void AudioManager::set_shutdown_func(AudioManager::ShutdownFunc* func) {
   if (_shutdown_func != (AudioManager::ShutdownFunc*)0L)
   if (_shutdown_func != (AudioManager::ShutdownFunc*)0L)
     audio_cat->error() << "There maybe be more then one audio driver installed"
     audio_cat->error() << "There maybe be more then one audio driver installed"
-		       << endl;
+               << endl;
   _shutdown_func = func;
   _shutdown_func = func;
   if (_quit == (bool*)0L)
   if (_quit == (bool*)0L)
     _quit = new bool(false);
     _quit = new bool(false);
@@ -121,13 +121,13 @@ AudioManager* AudioManager::get_ptr(void) {
 //  Description: get the player off the sound, and start it playing
 //  Description: get the player off the sound, and start it playing
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void AudioManager::ns_play(AudioSound* sound, float start_time) {
 void AudioManager::ns_play(AudioSound* sound, float start_time) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "AudioManager: playing sound 0x" << (void*)sound
     audio_cat->debug() << "AudioManager: playing sound 0x" << (void*)sound
-		       << " (" << sound->get_name() << ")" << endl;
+               << " (" << sound->get_name() << ")" << endl;
   if (sound->status() == AudioSound::PLAYING)
   if (sound->status() == AudioSound::PLAYING)
     this->ns_stop(sound);
     this->ns_stop(sound);
   sound->get_player()->play_sound(sound->get_sound(), sound->get_state(),
   sound->get_player()->play_sound(sound->get_sound(), sound->get_state(),
-				  start_time);
+                  start_time);
   sound->get_player()->adjust_volume(sound->get_state());
   sound->get_player()->adjust_volume(sound->get_state());
 }
 }
 
 
@@ -137,9 +137,9 @@ void AudioManager::ns_play(AudioSound* sound, float start_time) {
 //  Description: get the player off the sound, and stop it playing
 //  Description: get the player off the sound, and stop it playing
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void AudioManager::ns_stop(AudioSound* sound) {
 void AudioManager::ns_stop(AudioSound* sound) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "AudioManager: stopping sound 0x" << (void*)sound
     audio_cat->debug() << "AudioManager: stopping sound 0x" << (void*)sound
-		       << " (" << sound->get_name() << ")" << endl;
+               << " (" << sound->get_name() << ")" << endl;
   this->ns_set_loop(sound, false);
   this->ns_set_loop(sound, false);
   if (sound->status() == AudioSound::PLAYING)
   if (sound->status() == AudioSound::PLAYING)
     sound->get_player()->stop_sound(sound->get_sound(), sound->get_state());
     sound->get_player()->stop_sound(sound->get_sound(), sound->get_state());
@@ -185,7 +185,7 @@ void* AudioManager::spawned_update(void* data) {
     ipc_traits::sleep(0, audio_auto_update_delay);
     ipc_traits::sleep(0, audio_auto_update_delay);
   }
   }
   *flag = false;
   *flag = false;
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "exiting update thread" << endl;
     audio_cat->debug() << "exiting update thread" << endl;
   return (void*)0L;
   return (void*)0L;
 }
 }
@@ -222,7 +222,7 @@ void AudioManager::ns_spawn_update(void) {
       break;
       break;
     default:
     default:
       audio_cat->error() << "audio-thread-priority set to something other "
       audio_cat->error() << "audio-thread-priority set to something other "
-			 << "then low, normal, or high" << endl;
+             << "then low, normal, or high" << endl;
       audio_thread_priority = 1;
       audio_thread_priority = 1;
       pri = thread::PRIORITY_NORMAL;
       pri = thread::PRIORITY_NORMAL;
     }
     }
@@ -244,7 +244,7 @@ void AudioManager::ns_shutdown(void) {
     (*_shutdown_func)();
     (*_shutdown_func)();
   if (_spawned != (thread*)0L)
   if (_spawned != (thread*)0L)
     while (*_quit);
     while (*_quit);
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "update thread has shutdown" << endl;
     audio_cat->debug() << "update thread has shutdown" << endl;
   delete _quit;
   delete _quit;
 }
 }

+ 67 - 67
panda/src/audio/audio_midi.cxx

@@ -45,7 +45,7 @@ inline static unsigned LONG read32(istream& is, istream& supp) {
 }
 }
 
 
 inline static void scroll8(unsigned LONG& prev, unsigned LONG& curr,
 inline static void scroll8(unsigned LONG& prev, unsigned LONG& curr,
-			   istream& is, istream& supp) {
+               istream& is, istream& supp) {
   unsigned char b1 = ((curr >> 24) & 0xff);
   unsigned char b1 = ((curr >> 24) & 0xff);
   prev = ((prev << 8) & 0xffffff00) | (b1);
   prev = ((prev << 8) & 0xffffff00) | (b1);
   b1 = read8(is, supp);
   b1 = read8(is, supp);
@@ -69,12 +69,12 @@ AudioMidi::AudioMidi(Filename filename, int header_idx) {
     if (curr == MThd) {
     if (curr == MThd) {
       ++count;
       ++count;
       if (count == header_idx)
       if (count == header_idx)
-	done = true;
+    done = true;
       else {
       else {
-	scroll8(prev, curr, in, dummy);
-	scroll8(prev, curr, in, dummy);
-	scroll8(prev, curr, in, dummy);
-	scroll8(prev, curr, in, dummy);
+    scroll8(prev, curr, in, dummy);
+    scroll8(prev, curr, in, dummy);
+    scroll8(prev, curr, in, dummy);
+    scroll8(prev, curr, in, dummy);
       }
       }
     } else {
     } else {
       scroll8(prev, curr, in, dummy);
       scroll8(prev, curr, in, dummy);
@@ -84,11 +84,11 @@ AudioMidi::AudioMidi(Filename filename, int header_idx) {
   } while (!done);
   } while (!done);
   if (in.eof()) {
   if (in.eof()) {
     cerr << "fewer then " << header_idx << " headers in file (" << count
     cerr << "fewer then " << header_idx << " headers in file (" << count
-	 << ")" << endl;
+     << ")" << endl;
     return;
     return;
   }
   }
   if (prev == RIFF) {
   if (prev == RIFF) {
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "it's a RIFF file" << endl;
       audio_cat->debug() << "it's a RIFF file" << endl;
     curr = read32(in, dummy);
     curr = read32(in, dummy);
     curr = read32(in, dummy);
     curr = read32(in, dummy);
@@ -100,7 +100,7 @@ AudioMidi::AudioMidi(Filename filename, int header_idx) {
   unsigned SHORT numtracks;
   unsigned SHORT numtracks;
   unsigned SHORT division;
   unsigned SHORT division;
   if (curr == MThd) {
   if (curr == MThd) {
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "easy header" << endl;
       audio_cat->debug() << "easy header" << endl;
     tracklen = read32(in, dummy);
     tracklen = read32(in, dummy);
     format = read16(in, dummy);
     format = read16(in, dummy);
@@ -111,16 +111,16 @@ AudioMidi::AudioMidi(Filename filename, int header_idx) {
     cerr << "don't support Creative Labs CMF files yet" << endl;
     cerr << "don't support Creative Labs CMF files yet" << endl;
     return;
     return;
   } else {
   } else {
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "hard header" << endl;
       audio_cat->debug() << "hard header" << endl;
     done = false;
     done = false;
     do {
     do {
       if (curr == MThd)
       if (curr == MThd)
-	done = true;
+    done = true;
       else
       else
-	scroll8(prev, curr, in, dummy);
+    scroll8(prev, curr, in, dummy);
       if (in.eof())
       if (in.eof())
-	done = true;
+    done = true;
     } while (!done);
     } while (!done);
     if (in.eof()) {
     if (in.eof()) {
       cerr << "truncated file!" << endl;
       cerr << "truncated file!" << endl;
@@ -131,57 +131,57 @@ AudioMidi::AudioMidi(Filename filename, int header_idx) {
     numtracks = read16(in, dummy);
     numtracks = read16(in, dummy);
     division = read16(in, dummy);
     division = read16(in, dummy);
   }
   }
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "Read header.  tracklen = " << tracklen
     audio_cat->debug() << "Read header.  tracklen = " << tracklen
-		       << "  format = " << format << "  numtracks = "
-		       << numtracks << "  division = " << division << endl;
+               << "  format = " << format << "  numtracks = "
+               << numtracks << "  division = " << division << endl;
   for (int currtrack = 0; currtrack < numtracks; ++currtrack) {
   for (int currtrack = 0; currtrack < numtracks; ++currtrack) {
     string fudge;
     string fudge;
     curr = read32(in, dummy);
     curr = read32(in, dummy);
     if (curr != MTrk) {
     if (curr != MTrk) {
-      if (audio_cat->is_debug())
-	audio_cat->debug() << "having to seach for track #" << currtrack
-			   << endl;
+      if (audio_cat.is_debug())
+    audio_cat->debug() << "having to seach for track #" << currtrack
+               << endl;
       if (curr == MThd) {
       if (curr == MThd) {
-	if (audio_cat->is_debug())
-	  audio_cat->debug() << "hit a header instead, skipping track" << endl;
-	continue;
+    if (audio_cat.is_debug())
+      audio_cat->debug() << "hit a header instead, skipping track" << endl;
+    continue;
       } else {
       } else {
-	done = false;
-	if (currtrack > 0) {
-	  string stmp = (*(_seq.rbegin()));
-	  int i = stmp.rfind("MTrk");
-	  if (i != string::npos) {
-	    fudge = stmp.substr(i+4, string::npos);
-	    unsigned char b;
-	    b = ((curr >> 24) & 0xff);
-	    fudge += b;
-	    b = ((curr >> 16) & 0xff);
-	    fudge += b;
-	    b = ((curr >> 8) & 0xff);
-	    fudge += b;
-	    b = (curr & 0xff);
-	    fudge += b;
-	    done = true;
-	  }
-	}
-	if (!done) {
-	  do {
-	    if (curr == MTrk)
-	      done = true;
-	    else
-	      scroll8(prev, curr, in, dummy);
-	    if (in.eof())
-	      done = true;
-	  } while (!done);
-	  if (in.eof()) {
-	    cerr << "truncated file" << endl;
-	    return;
-	  }
-	}
+    done = false;
+    if (currtrack > 0) {
+      string stmp = (*(_seq.rbegin()));
+      int i = stmp.rfind("MTrk");
+      if (i != string::npos) {
+        fudge = stmp.substr(i+4, string::npos);
+        unsigned char b;
+        b = ((curr >> 24) & 0xff);
+        fudge += b;
+        b = ((curr >> 16) & 0xff);
+        fudge += b;
+        b = ((curr >> 8) & 0xff);
+        fudge += b;
+        b = (curr & 0xff);
+        fudge += b;
+        done = true;
+      }
+    }
+    if (!done) {
+      do {
+        if (curr == MTrk)
+          done = true;
+        else
+          scroll8(prev, curr, in, dummy);
+        if (in.eof())
+          done = true;
+      } while (!done);
+      if (in.eof()) {
+        cerr << "truncated file" << endl;
+        return;
+      }
+    }
       }
       }
     }
     }
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "fudge = '" << fudge << "'" << endl;
       audio_cat->debug() << "fudge = '" << fudge << "'" << endl;
     istringstream fudges(fudge);
     istringstream fudges(fudge);
     if (fudge.empty()) {
     if (fudge.empty()) {
@@ -190,30 +190,30 @@ AudioMidi::AudioMidi(Filename filename, int header_idx) {
       fudges >> b;
       fudges >> b;
     }
     }
     unsigned LONG thislen = read32(in, fudges);
     unsigned LONG thislen = read32(in, fudges);
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "found track #" << currtrack << " with length = "
       audio_cat->debug() << "found track #" << currtrack << " with length = "
-			 << thislen << endl;
+             << thislen << endl;
     {
     {
       ostringstream os;
       ostringstream os;
       int i;
       int i;
       for (i=0; i<thislen; ++i) {
       for (i=0; i<thislen; ++i) {
-	unsigned char b;
-	b = read8(in, fudges);
-	os << b;
-	if (in.eof() && ((i+1) < thislen))
-	  break;
+    unsigned char b;
+    b = read8(in, fudges);
+    os << b;
+    if (in.eof() && ((i+1) < thislen))
+      break;
       }
       }
       if (in.eof() && (i != thislen)) {
       if (in.eof() && (i != thislen)) {
-	cerr << "truncated file" << endl;
+    cerr << "truncated file" << endl;
       }
       }
       string s = os.str();
       string s = os.str();
       _seq.push_back(s);
       _seq.push_back(s);
-      if (audio_cat->is_debug())
-	audio_cat->debug() << "track data (" << s.length() << "): '" << s
-			   << "'" << endl;
+      if (audio_cat.is_debug())
+    audio_cat->debug() << "track data (" << s.length() << "): '" << s
+               << "'" << endl;
     }
     }
   }
   }
-  if ((_seq.size() != numtracks) && audio_cat->is_debug())
+  if ((_seq.size() != numtracks) && audio_cat.is_debug())
     audio_cat->debug()
     audio_cat->debug()
       << "actual number of tracks read does not match header. ("
       << "actual number of tracks read does not match header. ("
       << _seq.size() << " != " << numtracks << ")" << endl;
       << _seq.size() << " != " << numtracks << ")" << endl;

+ 57 - 57
panda/src/audio/audio_mikmod_traits.cxx

@@ -37,74 +37,74 @@ static void initialize(void) {
     opts = buster();
     opts = buster();
     for (StrList::iterator i=opts.begin(); i!=opts.end(); ++i) {
     for (StrList::iterator i=opts.begin(); i!=opts.end(); ++i) {
       if ((*i) == "DMODE_INTERP") {
       if ((*i) == "DMODE_INTERP") {
-	md_mode |= DMODE_INTERP;
+    md_mode |= DMODE_INTERP;
       } else if ((*i) == "DMODE_REVERSE") {
       } else if ((*i) == "DMODE_REVERSE") {
-	md_mode |= DMODE_REVERSE;
+    md_mode |= DMODE_REVERSE;
       } else if ((*i) == "DMODE_SURROUND") {
       } else if ((*i) == "DMODE_SURROUND") {
-	md_mode |= DMODE_SURROUND;
+    md_mode |= DMODE_SURROUND;
       } else if ((*i) == "DMODE_16BITS") {
       } else if ((*i) == "DMODE_16BITS") {
-	md_mode |= DMODE_16BITS;
+    md_mode |= DMODE_16BITS;
       } else if ((*i) == "DMODE_HQMIXER") {
       } else if ((*i) == "DMODE_HQMIXER") {
-	md_mode |= DMODE_HQMIXER;
+    md_mode |= DMODE_HQMIXER;
       } else if ((*i) == "DMODE_SOFT_MUSIC") {
       } else if ((*i) == "DMODE_SOFT_MUSIC") {
-	md_mode |= DMODE_SOFT_MUSIC;
+    md_mode |= DMODE_SOFT_MUSIC;
       } else if ((*i) == "DMODE_SOFT_SNDFX") {
       } else if ((*i) == "DMODE_SOFT_SNDFX") {
-	md_mode |= DMODE_SOFT_SNDFX;
+    md_mode |= DMODE_SOFT_SNDFX;
       } else if ((*i) == "DMODE_STEREO") {
       } else if ((*i) == "DMODE_STEREO") {
-	md_mode |= DMODE_STEREO;
+    md_mode |= DMODE_STEREO;
       } else {
       } else {
-	audio_cat->error() << "unknown audio driver flag '" << *i << "'"
-			   << endl;
+    audio_cat->error() << "unknown audio driver flag '" << *i << "'"
+               << endl;
       }
       }
     }
     }
-    if (audio_cat->is_debug()) {
+    if (audio_cat.is_debug()) {
       audio_cat->debug() << "final driver mode is (";
       audio_cat->debug() << "final driver mode is (";
       bool any_out = false;
       bool any_out = false;
       if (md_mode & DMODE_INTERP) {
       if (md_mode & DMODE_INTERP) {
-	audio_cat->debug(false) << "DMODE_INTERP";
-	any_out = true;
+    audio_cat->debug(false) << "DMODE_INTERP";
+    any_out = true;
       }
       }
       if (md_mode & DMODE_REVERSE) {
       if (md_mode & DMODE_REVERSE) {
-	if (any_out)
-	  audio_cat->debug(false) << ", ";
-	audio_cat->debug(false) << "DMODE_REVERSE";
-	any_out = true;
+    if (any_out)
+      audio_cat->debug(false) << ", ";
+    audio_cat->debug(false) << "DMODE_REVERSE";
+    any_out = true;
       }
       }
       if (md_mode & DMODE_SURROUND) {
       if (md_mode & DMODE_SURROUND) {
-	if (any_out)
-	  audio_cat->debug(false) << ", ";
-	audio_cat->debug(false) << "DMODE_SURROUND";
-	any_out = true;
+    if (any_out)
+      audio_cat->debug(false) << ", ";
+    audio_cat->debug(false) << "DMODE_SURROUND";
+    any_out = true;
       }
       }
       if (md_mode & DMODE_16BITS) {
       if (md_mode & DMODE_16BITS) {
-	if (any_out)
-	  audio_cat->debug(false) << ", ";
-	audio_cat->debug(false) << "DMODE_16BITS";
-	any_out = true;
+    if (any_out)
+      audio_cat->debug(false) << ", ";
+    audio_cat->debug(false) << "DMODE_16BITS";
+    any_out = true;
       }
       }
       if (md_mode & DMODE_HQMIXER) {
       if (md_mode & DMODE_HQMIXER) {
-	if (any_out)
-	  audio_cat->debug(false) << ", ";
-	audio_cat->debug(false) << "DMODE_HQMIXER";
-	any_out = true;
+    if (any_out)
+      audio_cat->debug(false) << ", ";
+    audio_cat->debug(false) << "DMODE_HQMIXER";
+    any_out = true;
       }
       }
       if (md_mode & DMODE_SOFT_MUSIC) {
       if (md_mode & DMODE_SOFT_MUSIC) {
-	if (any_out)
-	  audio_cat->debug(false) << ", ";
-	audio_cat->debug(false) << "DMODE_SOFT_MUSIC";
-	any_out = true;
+    if (any_out)
+      audio_cat->debug(false) << ", ";
+    audio_cat->debug(false) << "DMODE_SOFT_MUSIC";
+    any_out = true;
       }
       }
       if (md_mode & DMODE_SOFT_SNDFX) {
       if (md_mode & DMODE_SOFT_SNDFX) {
-	if (any_out)
-	  audio_cat->debug(false) << ", ";
-	audio_cat->debug(false) << "DMODE_SOFT_SNDFX";
-	any_out = true;
+    if (any_out)
+      audio_cat->debug(false) << ", ";
+    audio_cat->debug(false) << "DMODE_SOFT_SNDFX";
+    any_out = true;
       }
       }
       if (md_mode & DMODE_STEREO) {
       if (md_mode & DMODE_STEREO) {
-	if (any_out)
-	  audio_cat->debug(false) << ", ";
-	audio_cat->debug(false) << "DMODE_STEREO";
-	any_out = true;
+    if (any_out)
+      audio_cat->debug(false) << ", ";
+    audio_cat->debug(false) << "DMODE_STEREO";
+    any_out = true;
       }
       }
       audio_cat->debug(false) << ")" << endl;
       audio_cat->debug(false) << ")" << endl;
     }
     }
@@ -112,11 +112,11 @@ static void initialize(void) {
   md_device = audio_driver_select;
   md_device = audio_driver_select;
   if (MikMod_Init((char*)(audio_driver_params->c_str()))) {
   if (MikMod_Init((char*)(audio_driver_params->c_str()))) {
     audio_cat->error() << "Could not initialize the audio drivers.  '"
     audio_cat->error() << "Could not initialize the audio drivers.  '"
-		       << MikMod_strerror(MikMod_errno) << "'" << endl;
+               << MikMod_strerror(MikMod_errno) << "'" << endl;
     initialization_error = true;
     initialization_error = true;
     return;
     return;
   }
   }
-  if (audio_cat->is_debug()) {
+  if (audio_cat.is_debug()) {
     audio_cat->debug() << "driver info" << endl << MikMod_InfoDriver() << endl;
     audio_cat->debug() << "driver info" << endl << MikMod_InfoDriver() << endl;
   }
   }
   MikMod_SetNumVoices(-1, audio_sample_voices);
   MikMod_SetNumVoices(-1, audio_sample_voices);
@@ -154,7 +154,7 @@ MikModSample* MikModSample::load_wav(Filename filename) {
   SAMPLE* sample = Sample_Load((char*)(filename.c_str()));
   SAMPLE* sample = Sample_Load((char*)(filename.c_str()));
   if (sample == (SAMPLE*)0L) {
   if (sample == (SAMPLE*)0L) {
     audio_cat->error() << "error loading sample '" << filename << "' because '"
     audio_cat->error() << "error loading sample '" << filename << "' because '"
-		       << MikMod_strerror(MikMod_errno) << "'" << endl;
+               << MikMod_strerror(MikMod_errno) << "'" << endl;
     return (MikModSample*)0L;
     return (MikModSample*)0L;
   }
   }
   return new MikModSample(sample);
   return new MikModSample(sample);
@@ -280,14 +280,14 @@ MikModSamplePlayer::~MikModSamplePlayer(void) {
 }
 }
 
 
 void MikModSamplePlayer::play_sound(AudioTraits::SoundClass* sample,
 void MikModSamplePlayer::play_sound(AudioTraits::SoundClass* sample,
-				    AudioTraits::PlayingClass* playing,
-				    float) {
+                    AudioTraits::PlayingClass* playing,
+                    float) {
   if (!have_initialized)
   if (!have_initialized)
     initialize();
     initialize();
   if (!MikMod_Active()) {
   if (!MikMod_Active()) {
     if (MikMod_EnableOutput()) {
     if (MikMod_EnableOutput()) {
       audio_cat->error() << "could not enable sample output '"
       audio_cat->error() << "could not enable sample output '"
-			 << MikMod_strerror(MikMod_errno) << "'" << endl;
+             << MikMod_strerror(MikMod_errno) << "'" << endl;
     }
     }
   }
   }
   // cast to the correct type
   // cast to the correct type
@@ -304,20 +304,20 @@ void MikModSamplePlayer::play_sound(AudioTraits::SoundClass* sample,
 }
 }
 
 
 void MikModSamplePlayer::stop_sound(AudioTraits::SoundClass* sample,
 void MikModSamplePlayer::stop_sound(AudioTraits::SoundClass* sample,
-				    AudioTraits::PlayingClass* playing) {
+                    AudioTraits::PlayingClass* playing) {
   if (!have_initialized)
   if (!have_initialized)
     initialize();
     initialize();
   // stop it
   // stop it
 }
 }
 
 
 void MikModSamplePlayer::set_volume(AudioTraits::PlayingClass* state,
 void MikModSamplePlayer::set_volume(AudioTraits::PlayingClass* state,
-				    float v) {
+                    float v) {
   initialize();
   initialize();
   MikModSamplePlaying* mplay = (MikModSamplePlaying*)state;
   MikModSamplePlaying* mplay = (MikModSamplePlaying*)state;
   if (!AudioManager::get_sfx_active())
   if (!AudioManager::get_sfx_active())
     return;
     return;
   Voice_SetVolume(mplay->get_voice(),
   Voice_SetVolume(mplay->get_voice(),
-		  v * AudioManager::get_master_sfx_volume());
+          v * AudioManager::get_master_sfx_volume());
   state->set_volume(v);
   state->set_volume(v);
 }
 }
 
 
@@ -327,7 +327,7 @@ bool MikModSamplePlayer::adjust_volume(AudioTraits::PlayingClass* state) {
   if (!AudioManager::get_sfx_active())
   if (!AudioManager::get_sfx_active())
     return true;
     return true;
   Voice_SetVolume(mplay->get_voice(),
   Voice_SetVolume(mplay->get_voice(),
-		  state->get_volume() * AudioManager::get_master_sfx_volume());
+          state->get_volume() * AudioManager::get_master_sfx_volume());
   return false;
   return false;
 }
 }
 
 
@@ -347,13 +347,13 @@ MikModFmsynthPlayer::~MikModFmsynthPlayer(void) {
 }
 }
 
 
 void MikModFmsynthPlayer::play_sound(AudioTraits::SoundClass*,
 void MikModFmsynthPlayer::play_sound(AudioTraits::SoundClass*,
-				     AudioTraits::PlayingClass*, float) {
+                     AudioTraits::PlayingClass*, float) {
   audio_cat->error() << "trying to play a sample with a MikModFmsynthPlayer"
   audio_cat->error() << "trying to play a sample with a MikModFmsynthPlayer"
-		     << endl;
+             << endl;
 }
 }
 
 
 void MikModFmsynthPlayer::stop_sound(AudioTraits::SoundClass*,
 void MikModFmsynthPlayer::stop_sound(AudioTraits::SoundClass*,
-				     AudioTraits::PlayingClass*) {
+                     AudioTraits::PlayingClass*) {
 }
 }
 
 
 void MikModFmsynthPlayer::set_volume(AudioTraits::PlayingClass* p, float v) {
 void MikModFmsynthPlayer::set_volume(AudioTraits::PlayingClass* p, float v) {
@@ -384,13 +384,13 @@ MikModMidiPlayer::~MikModMidiPlayer(void) {
 }
 }
 
 
 void MikModMidiPlayer::play_sound(AudioTraits::SoundClass*,
 void MikModMidiPlayer::play_sound(AudioTraits::SoundClass*,
-				  AudioTraits::PlayingClass*, float) {
+                  AudioTraits::PlayingClass*, float) {
   audio_cat->error() << "trying to play a sample with a MikModMidiPlayer"
   audio_cat->error() << "trying to play a sample with a MikModMidiPlayer"
-		     << endl;
+             << endl;
 }
 }
 
 
 void MikModMidiPlayer::stop_sound(AudioTraits::SoundClass*,
 void MikModMidiPlayer::stop_sound(AudioTraits::SoundClass*,
-				  AudioTraits::PlayingClass*) {
+                  AudioTraits::PlayingClass*) {
 }
 }
 
 
 void MikModMidiPlayer::set_volume(AudioTraits::PlayingClass* p, float v) {
 void MikModMidiPlayer::set_volume(AudioTraits::PlayingClass* p, float v) {

+ 9 - 9
panda/src/audio/audio_null_traits.cxx

@@ -13,7 +13,7 @@
 static bool have_initialized = false;
 static bool have_initialized = false;
 
 
 static void update_null(void) {
 static void update_null(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "Update in Null audio driver" << endl;
     audio_cat->debug() << "Update in Null audio driver" << endl;
 }
 }
 
 
@@ -28,7 +28,7 @@ NullSound::~NullSound(void) {
 }
 }
 
 
 float NullSound::length(void) const {
 float NullSound::length(void) const {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in sample length in Null audio driver" << endl;
     audio_cat->debug() << "in sample length in Null audio driver" << endl;
   return -1.;
   return -1.;
 }
 }
@@ -50,7 +50,7 @@ NullPlaying::~NullPlaying(void) {
 }
 }
 
 
 AudioTraits::PlayingClass::PlayingStatus NullPlaying::status(void) {
 AudioTraits::PlayingClass::PlayingStatus NullPlaying::status(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in playing status in Null audio driver" << endl;
     audio_cat->debug() << "in playing status in Null audio driver" << endl;
   return BAD;
   return BAD;
 }
 }
@@ -63,25 +63,25 @@ NullPlayer::~NullPlayer(void) {
 }
 }
 
 
 void NullPlayer::play_sound(AudioTraits::SoundClass*,
 void NullPlayer::play_sound(AudioTraits::SoundClass*,
-			    AudioTraits::PlayingClass*, float) {
-  if (audio_cat->is_debug())
+                AudioTraits::PlayingClass*, float) {
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in play sound in Null audio driver" << endl;
     audio_cat->debug() << "in play sound in Null audio driver" << endl;
 }
 }
 
 
 void NullPlayer::stop_sound(AudioTraits::SoundClass*,
 void NullPlayer::stop_sound(AudioTraits::SoundClass*,
-			    AudioTraits::PlayingClass*) {
-  if (audio_cat->is_debug())
+                AudioTraits::PlayingClass*) {
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in stop sound in Null audio driver" << endl;
     audio_cat->debug() << "in stop sound in Null audio driver" << endl;
 }
 }
 
 
 void NullPlayer::set_volume(AudioTraits::PlayingClass* p, float v) {
 void NullPlayer::set_volume(AudioTraits::PlayingClass* p, float v) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in set volume in Null audio driver" << endl;
     audio_cat->debug() << "in set volume in Null audio driver" << endl;
   p->set_volume(v);
   p->set_volume(v);
 }
 }
 
 
 bool NullPlayer::adjust_volume(AudioTraits::PlayingClass*) {
 bool NullPlayer::adjust_volume(AudioTraits::PlayingClass*) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in adjust volume in Null audio driver" << endl;
     audio_cat->debug() << "in adjust volume in Null audio driver" << endl;
   return false;
   return false;
 }
 }

+ 16 - 16
panda/src/audio/audio_pool.cxx

@@ -57,10 +57,10 @@ bool AudioPool::ns_has_sound(Filename filename) {
 //  Description: The nonstatic implementation of load_sound().
 //  Description: The nonstatic implementation of load_sound().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 AudioSound* AudioPool::ns_load_sound(Filename filename) {
 AudioSound* AudioPool::ns_load_sound(Filename filename) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in AudioPool::ns_load_sound" << endl;
     audio_cat->debug() << "in AudioPool::ns_load_sound" << endl;
   filename.resolve_filename(get_sound_path());
   filename.resolve_filename(get_sound_path());
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "resolved filename is '" << filename << "'" << endl;
     audio_cat->debug() << "resolved filename is '" << filename << "'" << endl;
 
 
   SoundMap::const_iterator si;
   SoundMap::const_iterator si;
@@ -68,12 +68,12 @@ AudioSound* AudioPool::ns_load_sound(Filename filename) {
   if (si != _sounds.end()) {
   if (si != _sounds.end()) {
     // this sound was previously loaded
     // this sound was previously loaded
     PT(AudioTraits::SoundClass) sc = (*si).second;
     PT(AudioTraits::SoundClass) sc = (*si).second;
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "sound is already loaded (0x" << (void*)sc
       audio_cat->debug() << "sound is already loaded (0x" << (void*)sc
-			 << ")" << endl;
+             << ")" << endl;
     AudioSound* ret = new AudioSound(sc, sc->get_state(), sc->get_player(),
     AudioSound* ret = new AudioSound(sc, sc->get_state(), sc->get_player(),
-				     sc->get_delstate(), filename);
-    if (audio_cat->is_debug())
+                     sc->get_delstate(), filename);
+    if (audio_cat.is_debug())
       audio_cat->debug() << "AudioPool: returning 0x" << (void*)ret << endl;
       audio_cat->debug() << "AudioPool: returning 0x" << (void*)ret << endl;
     return ret;
     return ret;
   }
   }
@@ -88,7 +88,7 @@ AudioSound* AudioPool::ns_load_sound(Filename filename) {
   sli = _sound_loaders->find(ext);
   sli = _sound_loaders->find(ext);
   if (sli == _sound_loaders->end()) {
   if (sli == _sound_loaders->end()) {
     audio_cat->error() << "no loader available for audio type '" << ext
     audio_cat->error() << "no loader available for audio type '" << ext
-		       << "'" << endl;
+               << "'" << endl;
     return (AudioSound*)0L;
     return (AudioSound*)0L;
   }
   }
   PT(AudioTraits::SoundClass) sound = (*((*sli).second))(filename);
   PT(AudioTraits::SoundClass) sound = (*((*sli).second))(filename);
@@ -97,11 +97,11 @@ AudioSound* AudioPool::ns_load_sound(Filename filename) {
     return (AudioSound*)0L;
     return (AudioSound*)0L;
   }
   }
   AudioSound* the_sound = new AudioSound(sound, sound->get_state(),
   AudioSound* the_sound = new AudioSound(sound, sound->get_state(),
-					 sound->get_player(),
-					 sound->get_delstate(), filename);
-  if (audio_cat->is_debug())
+                     sound->get_player(),
+                     sound->get_delstate(), filename);
+  if (audio_cat.is_debug())
     audio_cat->debug() << "AudioPool: returning 0x" << (void*)the_sound
     audio_cat->debug() << "AudioPool: returning 0x" << (void*)the_sound
-		       << endl;
+               << endl;
   _sounds[filename] = sound;
   _sounds[filename] = sound;
   return the_sound;
   return the_sound;
 }
 }
@@ -112,9 +112,9 @@ AudioSound* AudioPool::ns_load_sound(Filename filename) {
 //  Description: The nonstatic implementation of release_sound().
 //  Description: The nonstatic implementation of release_sound().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void AudioPool::ns_release_sound(AudioSound* sound) {
 void AudioPool::ns_release_sound(AudioSound* sound) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "AudioPool: releasing sound 0x" << (void*)sound
     audio_cat->debug() << "AudioPool: releasing sound 0x" << (void*)sound
-		       << endl;
+               << endl;
   string filename = sound->get_name();
   string filename = sound->get_name();
   SoundMap::iterator si;
   SoundMap::iterator si;
   si = _sounds.find(filename);
   si = _sounds.find(filename);
@@ -128,7 +128,7 @@ void AudioPool::ns_release_sound(AudioSound* sound) {
 //  Description: The nonstatic implementation of release_all_sounds().
 //  Description: The nonstatic implementation of release_all_sounds().
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void AudioPool::ns_release_all_sounds(void) {
 void AudioPool::ns_release_all_sounds(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "AudioPool: releasing all sounds" << endl;
     audio_cat->debug() << "AudioPool: releasing all sounds" << endl;
   _sounds.clear();
   _sounds.clear();
 }
 }
@@ -140,13 +140,13 @@ void AudioPool::ns_release_all_sounds(void) {
 //               audio sounds.
 //               audio sounds.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void AudioPool::register_sound_loader(const string& ext,
 void AudioPool::register_sound_loader(const string& ext,
-				       AudioPool::SoundLoadFunc* func) {
+                       AudioPool::SoundLoadFunc* func) {
   SoundLoaders::const_iterator sli;
   SoundLoaders::const_iterator sli;
   check_sound_loaders();
   check_sound_loaders();
   sli = _sound_loaders->find(ext);
   sli = _sound_loaders->find(ext);
   if (sli != _sound_loaders->end()) {
   if (sli != _sound_loaders->end()) {
     audio_cat->warning() << "attempted to register a loader for audio type '"
     audio_cat->warning() << "attempted to register a loader for audio type '"
-			 << ext << "' more then once." << endl;
+             << ext << "' more then once." << endl;
     return;
     return;
   }
   }
   (*_sound_loaders)[ext] = func;
   (*_sound_loaders)[ext] = func;

+ 2 - 2
panda/src/audio/audio_sound.cxx

@@ -16,9 +16,9 @@ TypeHandle AudioSound::_type_handle;
 //               destroy this structure
 //               destroy this structure
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 AudioSound::~AudioSound(void) {
 AudioSound::~AudioSound(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "AudioSound destructor (" << get_name() << ")"
     audio_cat->debug() << "AudioSound destructor (" << get_name() << ")"
-		       << endl;
+               << endl;
   AudioManager::stop(this);
   AudioManager::stop(this);
   (*_delstate)(_state);
   (*_delstate)(_state);
 }
 }

+ 108 - 108
panda/src/audio/audio_win_traits.cxx

@@ -61,7 +61,7 @@ static void initialize(void) {
   if (!audio_is_active)
   if (!audio_is_active)
     return;
     return;
 
 
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in winAudio initialize" << endl;
     audio_cat->debug() << "in winAudio initialize" << endl;
 
 
   // rumor has it this will work, if it doesn't we need to create an invisible
   // rumor has it this will work, if it doesn't we need to create an invisible
@@ -84,7 +84,7 @@ static void initialize(void) {
   result = soundDirectSound->SetCooperativeLevel(global_hwnd, DSSCL_PRIORITY);
   result = soundDirectSound->SetCooperativeLevel(global_hwnd, DSSCL_PRIORITY);
   if (FAILED(result)) {
   if (FAILED(result)) {
     audio_cat->warning() << "could not set Direct Sound co-op level to "
     audio_cat->warning() << "could not set Direct Sound co-op level to "
-			 << "DSSCL_PRIORITY, trying DSSCL_NORMAL" << endl;
+             << "DSSCL_PRIORITY, trying DSSCL_NORMAL" << endl;
     result = soundDirectSound->SetCooperativeLevel(global_hwnd, DSSCL_NORMAL);
     result = soundDirectSound->SetCooperativeLevel(global_hwnd, DSSCL_NORMAL);
     CHECK_RESULT_SFX(result, "failed setting to DSSCL_NORMAL");
     CHECK_RESULT_SFX(result, "failed setting to DSSCL_NORMAL");
   }
   }
@@ -99,7 +99,7 @@ static void initialize(void) {
   dsbd.dwSize  =  sizeof(DSBUFFERDESC);
   dsbd.dwSize  =  sizeof(DSBUFFERDESC);
   dsbd.dwFlags = DSBCAPS_PRIMARYBUFFER;
   dsbd.dwFlags = DSBCAPS_PRIMARYBUFFER;
   result = soundDirectSound->CreateSoundBuffer(&dsbd, &soundPrimaryBuffer,
   result = soundDirectSound->CreateSoundBuffer(&dsbd, &soundPrimaryBuffer,
-					       NULL);
+                           NULL);
   CHECK_RESULT_SFX(result, "could not create primary buffer");
   CHECK_RESULT_SFX(result, "could not create primary buffer");
 
 
   // set primary buffer format to 22kHz and 16-bit output
   // set primary buffer format to 22kHz and 16-bit output
@@ -116,7 +116,7 @@ static void initialize(void) {
   // SetFormat requires at least DSSCL_PRIORITY, which we may not have
   // SetFormat requires at least DSSCL_PRIORITY, which we may not have
   if (result == DSERR_PRIOLEVELNEEDED)
   if (result == DSERR_PRIOLEVELNEEDED)
     audio_cat->warning() << "could not set format of Primary Buffer because "
     audio_cat->warning() << "could not set format of Primary Buffer because "
-			 << "we didn't get DSSCL_PRIORITY" << endl;
+             << "we didn't get DSSCL_PRIORITY" << endl;
 
 
 /*
 /*
   //
   //
@@ -126,20 +126,20 @@ static void initialize(void) {
   // create the direct sound object
   // create the direct sound object
   result = DirectSoundCreate(NULL, &musicDirectSound, NULL);
   result = DirectSoundCreate(NULL, &musicDirectSound, NULL);
   CHECK_RESULT(result,
   CHECK_RESULT(result,
-	       "could not create a second Direct Sound (tm) object (c)");
+           "could not create a second Direct Sound (tm) object (c)");
 
 
   // set the cooperative level
   // set the cooperative level
   result = musicDirectSound->SetCooperativeLevel(global_hwnd, DSSCL_PRIORITY);
   result = musicDirectSound->SetCooperativeLevel(global_hwnd, DSSCL_PRIORITY);
   if (FAILED(result)) {
   if (FAILED(result)) {
     audio_cat->warning() << "could not set Direct Sound (2) co-op level to "
     audio_cat->warning() << "could not set Direct Sound (2) co-op level to "
-			 << "DSSCL_PRIORITY, trying DSSCL_NORMAL" << endl;
+             << "DSSCL_PRIORITY, trying DSSCL_NORMAL" << endl;
     result = musicDirectSound->SetCooperativeLevel(global_hwnd, DSSCL_NORMAL);
     result = musicDirectSound->SetCooperativeLevel(global_hwnd, DSSCL_NORMAL);
     CHECK_RESULT(result, "failed setting to DSSCL_NORMAL");
     CHECK_RESULT(result, "failed setting to DSSCL_NORMAL");
   }
   }
 
 
   // create the direct music object
   // create the direct music object
   result = CoCreateInstance(CLSID_DirectMusic, NULL, CLSCTX_INPROC,
   result = CoCreateInstance(CLSID_DirectMusic, NULL, CLSCTX_INPROC,
-			    IID_IDirectMusic, (void**)&musicDirectMusic);
+                IID_IDirectMusic, (void**)&musicDirectMusic);
   CHECK_RESULT(result, "could not create Direct Music (tm) object (c)");
   CHECK_RESULT(result, "could not create Direct Music (tm) object (c)");
 
 
   // set direct sound for direct music
   // set direct sound for direct music
@@ -154,12 +154,12 @@ static void initialize(void) {
   AudioManager::set_update_func(update_win);
   AudioManager::set_update_func(update_win);
   have_initialized = true;
   have_initialized = true;
 
 
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "out of winAudio initialize" << endl;
     audio_cat->debug() << "out of winAudio initialize" << endl;
 }
 }
 
 
 static void shutdown(void) {
 static void shutdown(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in winaudio shutdown" << endl;
     audio_cat->debug() << "in winaudio shutdown" << endl;
 
 
   // release the primary sound buffer
   // release the primary sound buffer
@@ -188,42 +188,42 @@ static void shutdown(void) {
   // shutdown COM
   // shutdown COM
   CoUninitialize();
   CoUninitialize();
 
 
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "out of winaudio shutdown" << endl;
     audio_cat->debug() << "out of winaudio shutdown" << endl;
 }
 }
 
 
 WinSample::~WinSample(void) {
 WinSample::~WinSample(void) {
   // we may or may not be leaking the _data
   // we may or may not be leaking the _data
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winsample destructor called" << endl;
     audio_cat->debug() << "winsample destructor called" << endl;
 }
 }
 
 
 float WinSample::length(void) const {
 float WinSample::length(void) const {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winsample length called" << endl;
     audio_cat->debug() << "winsample length called" << endl;
   return _len / (audio_mix_freq * 2. * 2.);
   return _len / (audio_mix_freq * 2. * 2.);
 }
 }
 
 
 AudioTraits::PlayingClass* WinSample::get_state(void) const {
 AudioTraits::PlayingClass* WinSample::get_state(void) const {
   WinSamplePlaying* ret = new WinSamplePlaying((WinSample*)this);
   WinSamplePlaying* ret = new WinSamplePlaying((WinSample*)this);
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winsample get_state returning 0x" << (void*)ret
     audio_cat->debug() << "winsample get_state returning 0x" << (void*)ret
-		       << endl;
+               << endl;
   return ret;
   return ret;
 }
 }
 
 
 AudioTraits::PlayerClass* WinSample::get_player(void) const {
 AudioTraits::PlayerClass* WinSample::get_player(void) const {
   AudioTraits::PlayerClass* ret = WinSamplePlayer::get_instance();
   AudioTraits::PlayerClass* ret = WinSamplePlayer::get_instance();
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winsample get_player returning 0x" << (void*)ret
     audio_cat->debug() << "winsample get_player returning 0x" << (void*)ret
-		       << endl;
+               << endl;
   return ret;
   return ret;
 }
 }
 
 
 AudioTraits::DeletePlayingFunc* WinSample::get_delstate(void) const {
 AudioTraits::DeletePlayingFunc* WinSample::get_delstate(void) const {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winsample get_delstate returning 0x"
     audio_cat->debug() << "winsample get_delstate returning 0x"
-		       << (void*)(WinSamplePlaying::destroy) << endl;
+               << (void*)(WinSamplePlaying::destroy) << endl;
   return WinSamplePlaying::destroy;
   return WinSamplePlaying::destroy;
 }
 }
 
 
@@ -266,7 +266,7 @@ HRESULT readMMIO(HMMIO hmmio, MMCKINFO* pckInRIFF, WAVEFORMATEX** ppwfxInfo) {
     memcpy(*ppwfxInfo, &pcmWaveFormat, sizeof(pcmWaveFormat));
     memcpy(*ppwfxInfo, &pcmWaveFormat, sizeof(pcmWaveFormat));
     (*ppwfxInfo)->cbSize = cbExtraBytes;
     (*ppwfxInfo)->cbSize = cbExtraBytes;
     if (mmioRead(hmmio, (CHAR*)(((BYTE*)&((*ppwfxInfo)->cbSize))+sizeof(WORD)),
     if (mmioRead(hmmio, (CHAR*)(((BYTE*)&((*ppwfxInfo)->cbSize))+sizeof(WORD)),
-		 cbExtraBytes) != cbExtraBytes) {
+         cbExtraBytes) != cbExtraBytes) {
       delete *ppwfxInfo;
       delete *ppwfxInfo;
       *ppwfxInfo = NULL;
       *ppwfxInfo = NULL;
       return E_FAIL;
       return E_FAIL;
@@ -281,10 +281,10 @@ HRESULT readMMIO(HMMIO hmmio, MMCKINFO* pckInRIFF, WAVEFORMATEX** ppwfxInfo) {
 }
 }
 
 
 HRESULT wave_open_file(const CHAR* strFileName, HMMIO* phmmioIn,
 HRESULT wave_open_file(const CHAR* strFileName, HMMIO* phmmioIn,
-		       WAVEFORMATEX** ppwfxInfo, MMCKINFO* pckInRIFF) {
+               WAVEFORMATEX** ppwfxInfo, MMCKINFO* pckInRIFF) {
   HMMIO hmmio = NULL;
   HMMIO hmmio = NULL;
   if ((hmmio = mmioOpen(const_cast<CHAR*>(strFileName), NULL,
   if ((hmmio = mmioOpen(const_cast<CHAR*>(strFileName), NULL,
-			MMIO_ALLOCBUF | MMIO_READ)) == NULL)
+            MMIO_ALLOCBUF | MMIO_READ)) == NULL)
     return E_FAIL;
     return E_FAIL;
   HRESULT hr;
   HRESULT hr;
   if (FAILED(hr = readMMIO(hmmio, pckInRIFF, ppwfxInfo))) {
   if (FAILED(hr = readMMIO(hmmio, pckInRIFF, ppwfxInfo))) {
@@ -296,10 +296,10 @@ HRESULT wave_open_file(const CHAR* strFileName, HMMIO* phmmioIn,
 }
 }
 
 
 HRESULT wave_start_data_read(HMMIO* phmmioIn, MMCKINFO* pckIn,
 HRESULT wave_start_data_read(HMMIO* phmmioIn, MMCKINFO* pckIn,
-			     MMCKINFO* pckInRIFF) {
+                 MMCKINFO* pckInRIFF) {
   // seek to the data
   // seek to the data
   if (mmioSeek(*phmmioIn, pckInRIFF->dwDataOffset + sizeof(FOURCC),
   if (mmioSeek(*phmmioIn, pckInRIFF->dwDataOffset + sizeof(FOURCC),
-	       SEEK_SET) == -1)
+           SEEK_SET) == -1)
     return E_FAIL;
     return E_FAIL;
   //search the input file for the 'data' chunk
   //search the input file for the 'data' chunk
   pckIn->ckid = mmioFOURCC('d', 'a', 't', 'a');
   pckIn->ckid = mmioFOURCC('d', 'a', 't', 'a');
@@ -309,7 +309,7 @@ HRESULT wave_start_data_read(HMMIO* phmmioIn, MMCKINFO* pckIn,
 }
 }
 
 
 HRESULT wave_read_file(HMMIO hmmio, UINT cbRead, BYTE* pbDest, MMCKINFO* pckIn,
 HRESULT wave_read_file(HMMIO hmmio, UINT cbRead, BYTE* pbDest, MMCKINFO* pckIn,
-		       UINT* cbActualRead) {
+               UINT* cbActualRead) {
   MMIOINFO mmioinfoIn;
   MMIOINFO mmioinfoIn;
   *cbActualRead = 0;
   *cbActualRead = 0;
   if (mmioGetInfo(hmmio, &mmioinfoIn, 0) != 0)
   if (mmioGetInfo(hmmio, &mmioinfoIn, 0) != 0)
@@ -321,9 +321,9 @@ HRESULT wave_read_file(HMMIO hmmio, UINT cbRead, BYTE* pbDest, MMCKINFO* pckIn,
     // copy bytes from the io to the buffer
     // copy bytes from the io to the buffer
     if (mmioinfoIn.pchNext == mmioinfoIn.pchEndRead) {
     if (mmioinfoIn.pchNext == mmioinfoIn.pchEndRead) {
       if (mmioAdvance(hmmio, &mmioinfoIn, MMIO_READ) != 0)
       if (mmioAdvance(hmmio, &mmioinfoIn, MMIO_READ) != 0)
-	return E_FAIL;
+    return E_FAIL;
       if (mmioinfoIn.pchNext == mmioinfoIn.pchEndRead)
       if (mmioinfoIn.pchNext == mmioinfoIn.pchEndRead)
-	return E_FAIL;
+    return E_FAIL;
     }
     }
     // actual copy
     // actual copy
     *((BYTE*)pbDest+cT) = *((BYTE*)mmioinfoIn.pchNext);
     *((BYTE*)pbDest+cT) = *((BYTE*)mmioinfoIn.pchNext);
@@ -336,7 +336,7 @@ HRESULT wave_read_file(HMMIO hmmio, UINT cbRead, BYTE* pbDest, MMCKINFO* pckIn,
 }
 }
 
 
 HRESULT wave_load_internal(const CHAR* filename, WAVEFORMATEX& wavInfo,
 HRESULT wave_load_internal(const CHAR* filename, WAVEFORMATEX& wavInfo,
-			   BYTE*& wavData, UINT& wavSize) {
+               BYTE*& wavData, UINT& wavSize) {
   wavData = NULL;
   wavData = NULL;
   wavSize = 0;
   wavSize = 0;
   HRESULT result = wave_open_file(filename, &hmmioIn, &pwfx, &ckInRiff);
   HRESULT result = wave_open_file(filename, &hmmioIn, &pwfx, &ckInRiff);
@@ -354,7 +354,7 @@ HRESULT wave_load_internal(const CHAR* filename, WAVEFORMATEX& wavInfo,
 }
 }
 
 
 HRESULT wave_load(const CHAR* filename, WAVEFORMATEX& wavInfo, BYTE*& wavData,
 HRESULT wave_load(const CHAR* filename, WAVEFORMATEX& wavInfo, BYTE*& wavData,
-		  UINT& wavSize) {
+          UINT& wavSize) {
   pwfx = NULL;
   pwfx = NULL;
   HRESULT result = wave_load_internal(filename, wavInfo, wavData, wavSize);
   HRESULT result = wave_load_internal(filename, wavInfo, wavData, wavSize);
   if (pwfx) {
   if (pwfx) {
@@ -365,7 +365,7 @@ HRESULT wave_load(const CHAR* filename, WAVEFORMATEX& wavInfo, BYTE*& wavData,
 }
 }
 
 
 WinSample* WinSample::load_wav(Filename filename) {
 WinSample* WinSample::load_wav(Filename filename) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in winsample load_wav" << endl;
     audio_cat->debug() << "in winsample load_wav" << endl;
   WinSample* ret = (WinSample*)0L;
   WinSample* ret = (WinSample*)0L;
 
 
@@ -383,7 +383,7 @@ WinSample* WinSample::load_wav(Filename filename) {
   if (FAILED(result)) {
   if (FAILED(result)) {
     if (wavData)
     if (wavData)
       delete [] wavData;
       delete [] wavData;
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "wave_load failed, returning NULL" << endl;
       audio_cat->debug() << "wave_load failed, returning NULL" << endl;
     return ret;
     return ret;
   }
   }
@@ -393,13 +393,13 @@ WinSample* WinSample::load_wav(Filename filename) {
   ret->_data = wavData;
   ret->_data = wavData;
   ret->_len = wavSize;
   ret->_len = wavSize;
 
 
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "returning 0x" << (void*)ret << endl;
     audio_cat->debug() << "returning 0x" << (void*)ret << endl;
   return ret;
   return ret;
 }
 }
 
 
 WinSample* WinSample::load_raw(unsigned char* data, unsigned long size) {
 WinSample* WinSample::load_raw(unsigned char* data, unsigned long size) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in winsample load_raw" << endl;
     audio_cat->debug() << "in winsample load_raw" << endl;
   WinSample* ret = (WinSample*)0L;
   WinSample* ret = (WinSample*)0L;
 
 
@@ -419,7 +419,7 @@ WinSample* WinSample::load_raw(unsigned char* data, unsigned long size) {
   wavInfo.nAvgBytesPerSec = wavInfo.nSamplesPerSec * wavInfo.nBlockAlign;
   wavInfo.nAvgBytesPerSec = wavInfo.nSamplesPerSec * wavInfo.nBlockAlign;
 
 
   if (data == (unsigned char*)0L) {
   if (data == (unsigned char*)0L) {
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "data is null, returning same" << endl;
       audio_cat->debug() << "data is null, returning same" << endl;
     return ret;
     return ret;
   }
   }
@@ -429,15 +429,15 @@ WinSample* WinSample::load_raw(unsigned char* data, unsigned long size) {
   memcpy(&(ret->_info), &wavInfo, sizeof(WAVEFORMATEX));
   memcpy(&(ret->_info), &wavInfo, sizeof(WAVEFORMATEX));
   ret->_data = data;
   ret->_data = data;
   ret->_len = size;
   ret->_len = size;
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "WinSample::load_raw returning 0x" << (void*)ret
     audio_cat->debug() << "WinSample::load_raw returning 0x" << (void*)ret
-		       << endl;
+               << endl;
   return ret;
   return ret;
 }
 }
 
 
 WinMusic::~WinMusic(void) {
 WinMusic::~WinMusic(void) {
   // AudioManager::stop(this);
   // AudioManager::stop(this);
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in WinMusic::~WinMusic()" << endl;
     audio_cat->debug() << "in WinMusic::~WinMusic()" << endl;
 
 
   if (_music) {
   if (_music) {
@@ -461,20 +461,20 @@ WinMusic::~WinMusic(void) {
     _buffer = NULL;
     _buffer = NULL;
   }
   }
 
 
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "out of WinMusic::~WinMusic()" << endl;
     audio_cat->debug() << "out of WinMusic::~WinMusic()" << endl;
 }
 }
 
 
 void WinMusic::init(void) {
 void WinMusic::init(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in WinMusic::init()" << endl;
     audio_cat->debug() << "in WinMusic::init()" << endl;
 
 
   initialize();
   initialize();
   // create the direct sound performance object
   // create the direct sound performance object
   HRESULT result = CoCreateInstance(CLSID_DirectMusicPerformance, NULL,
   HRESULT result = CoCreateInstance(CLSID_DirectMusicPerformance, NULL,
-				    CLSCTX_INPROC,
-				    IID_IDirectMusicPerformance2,
-				    (void**)&_performance);
+                    CLSCTX_INPROC,
+                    IID_IDirectMusicPerformance2,
+                    (void**)&_performance);
   if (FAILED(result)) {
   if (FAILED(result)) {
     audio_cat->error() << "could not create performance object" << endl;
     audio_cat->error() << "could not create performance object" << endl;
     _performance = NULL;
     _performance = NULL;
@@ -543,7 +543,7 @@ void WinMusic::init(void) {
   CHECK_RESULT(result, "failed to assign performance channels");
   CHECK_RESULT(result, "failed to assign performance channels");
 */
 */
 
 
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "out of WinMusic::init()  _performance = "
     audio_cat->debug() << "out of WinMusic::init()  _performance = "
                        << (void*)_performance << "  _synth = "
                        << (void*)_performance << "  _synth = "
                        << (void*)_synth << "  _buffer = " << (void*)_buffer
                        << (void*)_synth << "  _buffer = " << (void*)_buffer
@@ -552,36 +552,36 @@ void WinMusic::init(void) {
 
 
 float WinMusic::length(void) const {
 float WinMusic::length(void) const {
   // DO THIS
   // DO THIS
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winmusic length" << endl;
     audio_cat->debug() << "winmusic length" << endl;
   return -1.;
   return -1.;
 }
 }
 
 
 AudioTraits::PlayingClass* WinMusic::get_state(void) const {
 AudioTraits::PlayingClass* WinMusic::get_state(void) const {
   WinMusicPlaying* ret = new WinMusicPlaying((WinMusic*)this);
   WinMusicPlaying* ret = new WinMusicPlaying((WinMusic*)this);
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winmusic get_state returning 0x"
     audio_cat->debug() << "winmusic get_state returning 0x"
-		       << (void*)ret << endl;
+               << (void*)ret << endl;
   return ret;
   return ret;
 }
 }
 
 
 AudioTraits::PlayerClass* WinMusic::get_player(void) const {
 AudioTraits::PlayerClass* WinMusic::get_player(void) const {
   AudioTraits::PlayerClass* ret = WinMusicPlayer::get_instance();
   AudioTraits::PlayerClass* ret = WinMusicPlayer::get_instance();
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winmusic get_player returning 0x" << (void*)ret
     audio_cat->debug() << "winmusic get_player returning 0x" << (void*)ret
-		       << endl;
+               << endl;
   return ret;
   return ret;
 }
 }
 
 
 AudioTraits::DeletePlayingFunc* WinMusic::get_delstate(void) const {
 AudioTraits::DeletePlayingFunc* WinMusic::get_delstate(void) const {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winmusic get_delstate returning 0x"
     audio_cat->debug() << "winmusic get_delstate returning 0x"
-		       << (void*)(WinMusicPlaying::destroy) << endl;
+               << (void*)(WinMusicPlaying::destroy) << endl;
   return WinMusicPlaying::destroy;
   return WinMusicPlaying::destroy;
 }
 }
 
 
 WinMusic* WinMusic::load_midi(Filename filename) {
 WinMusic* WinMusic::load_midi(Filename filename) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in WinMusic::load_midi()" << endl;
     audio_cat->debug() << "in WinMusic::load_midi()" << endl;
   initialize();
   initialize();
 
 
@@ -591,15 +591,15 @@ WinMusic* WinMusic::load_midi(Filename filename) {
   // WinMusic* ret = (WinMusic*)0L;
   // WinMusic* ret = (WinMusic*)0L;
   WinMusic* ret = new WinMusic();
   WinMusic* ret = new WinMusic();
   if (ret->_performance && ret->_music) {
   if (ret->_performance && ret->_music) {
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "for some reason, have to stop" << endl;
       audio_cat->debug() << "for some reason, have to stop" << endl;
     ret->_performance->Stop(NULL, NULL, 0, 0);
     ret->_performance->Stop(NULL, NULL, 0, 0);
   }
   }
   ret->_music = NULL;
   ret->_music = NULL;
   IDirectMusicLoader* loader;
   IDirectMusicLoader* loader;
   HRESULT result = CoCreateInstance(CLSID_DirectMusicLoader, NULL,
   HRESULT result = CoCreateInstance(CLSID_DirectMusicLoader, NULL,
-				    CLSCTX_INPROC, IID_IDirectMusicLoader,
-				    (void**)&loader);
+                    CLSCTX_INPROC, IID_IDirectMusicLoader,
+                    (void**)&loader);
   if (FAILED(result)) {
   if (FAILED(result)) {
     audio_cat->error() << "could not create music loader" << endl;
     audio_cat->error() << "could not create music loader" << endl;
     delete ret;
     delete ret;
@@ -633,7 +633,7 @@ WinMusic* WinMusic::load_midi(Filename filename) {
 /*
 /*
   if (!(filename.resolve_filename(get_sound_path()))) {
   if (!(filename.resolve_filename(get_sound_path()))) {
     audio_cat->error() << "could not find '" << filename << "' on sound path"
     audio_cat->error() << "could not find '" << filename << "' on sound path"
-		       << endl;
+               << endl;
     loader->Release();
     loader->Release();
     delete ret;
     delete ret;
     ret = (WinMusic*)0L;
     ret = (WinMusic*)0L;
@@ -642,17 +642,17 @@ WinMusic* WinMusic::load_midi(Filename filename) {
 */
 */
   string stmp = filename.to_os_specific();
   string stmp = filename.to_os_specific();
   MULTI_TO_WIDE(fdesc.wszFileName, stmp.c_str());
   MULTI_TO_WIDE(fdesc.wszFileName, stmp.c_str());
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "os_specific name '" << stmp << "'" << endl;
     audio_cat->debug() << "os_specific name '" << stmp << "'" << endl;
   if (filename.is_local()) {
   if (filename.is_local()) {
     fdesc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_FILENAME;
     fdesc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_FILENAME;
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "is local" << endl;
       audio_cat->debug() << "is local" << endl;
     char szDir[2] = ".";
     char szDir[2] = ".";
     WCHAR wszDir[2];
     WCHAR wszDir[2];
     MULTI_TO_WIDE(wszDir, szDir);
     MULTI_TO_WIDE(wszDir, szDir);
     result = loader->SetSearchDirectory(GUID_DirectMusicAllTypes, wszDir,
     result = loader->SetSearchDirectory(GUID_DirectMusicAllTypes, wszDir,
-					FALSE);
+                    FALSE);
     if (FAILED(result)) {
     if (FAILED(result)) {
       audio_cat->error() << "could not set search directory to '.'" << endl;
       audio_cat->error() << "could not set search directory to '.'" << endl;
       loader->Release();
       loader->Release();
@@ -662,11 +662,11 @@ WinMusic* WinMusic::load_midi(Filename filename) {
     }
     }
   } else {
   } else {
     fdesc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH;
     fdesc.dwValidData = DMUS_OBJ_CLASS | DMUS_OBJ_FILENAME | DMUS_OBJ_FULLPATH;
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "is not local" << endl;
       audio_cat->debug() << "is not local" << endl;
   }
   }
   result = loader->GetObject(&fdesc, IID_IDirectMusicSegment2,
   result = loader->GetObject(&fdesc, IID_IDirectMusicSegment2,
-			     (void**)&(ret->_music));
+                 (void**)&(ret->_music));
   if (FAILED(result)) {
   if (FAILED(result)) {
     audio_cat->error() << "failed to load file" << endl;
     audio_cat->error() << "failed to load file" << endl;
     loader->Release();
     loader->Release();
@@ -675,9 +675,9 @@ WinMusic* WinMusic::load_midi(Filename filename) {
     return ret;
     return ret;
   }
   }
   ret->_music->SetParam(GUID_StandardMIDIFile, -1, 0, 0,
   ret->_music->SetParam(GUID_StandardMIDIFile, -1, 0, 0,
-			(void*)(ret->_performance));
+            (void*)(ret->_performance));
   ret->_music->SetParam(GUID_Download, -1, 0, 0, (void*)(ret->_performance));
   ret->_music->SetParam(GUID_Download, -1, 0, 0, (void*)(ret->_performance));
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "out of WinMusic::load_midi()  _music = "
     audio_cat->debug() << "out of WinMusic::load_midi()  _music = "
                        << (void*)ret->_music << endl;
                        << (void*)ret->_music << endl;
   return ret;
   return ret;
@@ -685,7 +685,7 @@ WinMusic* WinMusic::load_midi(Filename filename) {
 
 
 WinSamplePlaying::WinSamplePlaying(AudioTraits::SoundClass* s)
 WinSamplePlaying::WinSamplePlaying(AudioTraits::SoundClass* s)
   : AudioTraits::PlayingClass(s) {
   : AudioTraits::PlayingClass(s) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in WinSamplePlaying constructor" << endl;
     audio_cat->debug() << "in WinSamplePlaying constructor" << endl;
 
 
   initialize();
   initialize();
@@ -696,13 +696,13 @@ WinSamplePlaying::WinSamplePlaying(AudioTraits::SoundClass* s)
   WinSample* ws = (WinSample*)s;
   WinSample* ws = (WinSample*)s;
 
 
   if (ws == (WinSample*)0L) {
   if (ws == (WinSample*)0L) {
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "the sample we were handed is NULL, returning"
       audio_cat->debug() << "the sample we were handed is NULL, returning"
-			 << endl;
+             << endl;
     return;
     return;
   }
   }
   if (ws->_data == (unsigned char*)0L) {
   if (ws->_data == (unsigned char*)0L) {
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "the sample has null data, returning" << endl;
       audio_cat->debug() << "the sample has null data, returning" << endl;
     return;
     return;
   }
   }
@@ -719,16 +719,16 @@ WinSamplePlaying::WinSamplePlaying(AudioTraits::SoundClass* s)
 
 
   if (FAILED(result)) {
   if (FAILED(result)) {
     _channel = NULL;
     _channel = NULL;
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "failed to create a channel" << endl;
       audio_cat->debug() << "failed to create a channel" << endl;
     return;
     return;
   }
   }
   BYTE* dst = NULL;
   BYTE* dst = NULL;
   dst = this->lock();
   dst = this->lock();
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "WinSamplePlaying::WinSamplePlaying _data = 0x"
     audio_cat->debug() << "WinSamplePlaying::WinSamplePlaying _data = 0x"
-		       << (void*)(ws->_data) << "  dst = 0x"
-		       << (void*)dst << endl;
+               << (void*)(ws->_data) << "  dst = 0x"
+               << (void*)dst << endl;
 
 
   // The Intel compiler dumps core if we attempt to protect this in a
   // The Intel compiler dumps core if we attempt to protect this in a
   // try .. catch block.  We probably shouldn't be using exception
   // try .. catch block.  We probably shouldn't be using exception
@@ -739,24 +739,24 @@ WinSamplePlaying::WinSamplePlaying(AudioTraits::SoundClass* s)
   //  }
   //  }
   //  catch (...) {
   //  catch (...) {
   //    _channel = NULL;
   //    _channel = NULL;
-  //    if (audio_cat->is_debug())
+  //    if (audio_cat.is_debug())
   //      audio_cat->debug() << "memcpy failed.  dst = 0x" << (void*)dst
   //      audio_cat->debug() << "memcpy failed.  dst = 0x" << (void*)dst
-  //			 << "  data = 0x" << (void*)(ws->_data)
-  //			 << "   len = " << ws->_len << endl;
+  //             << "  data = 0x" << (void*)(ws->_data)
+  //             << "   len = " << ws->_len << endl;
   //    return;
   //    return;
   //  }
   //  }
   this->unlock();
   this->unlock();
 }
 }
 
 
 WinSamplePlaying::~WinSamplePlaying(void) {
 WinSamplePlaying::~WinSamplePlaying(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winsampleplaying destructor" << endl;
     audio_cat->debug() << "winsampleplaying destructor" << endl;
 }
 }
 
 
 void WinSamplePlaying::destroy(AudioTraits::PlayingClass* play) {
 void WinSamplePlaying::destroy(AudioTraits::PlayingClass* play) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winsampleplaying destroy got 0x" << (void*)play
     audio_cat->debug() << "winsampleplaying destroy got 0x" << (void*)play
-		       << endl;
+               << endl;
   delete play;
   delete play;
 }
 }
 
 
@@ -772,48 +772,48 @@ AudioTraits::PlayingClass::PlayingStatus WinSamplePlaying::status(void) {
 }
 }
 
 
 BYTE* WinSamplePlaying::lock(void) {
 BYTE* WinSamplePlaying::lock(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in winsampleplaying lock" << endl;
     audio_cat->debug() << "in winsampleplaying lock" << endl;
   WinSample* s = (WinSample*)(_sound);
   WinSample* s = (WinSample*)(_sound);
   HRESULT result = _channel->Lock(0, 0, (void**)&_data, &(s->_len), NULL,
   HRESULT result = _channel->Lock(0, 0, (void**)&_data, &(s->_len), NULL,
-				  0, DSBLOCK_ENTIREBUFFER);
+                  0, DSBLOCK_ENTIREBUFFER);
   if (FAILED(result)) {
   if (FAILED(result)) {
     audio_cat->error() << "failed to lock buffer" << endl;
     audio_cat->error() << "failed to lock buffer" << endl;
     return NULL;
     return NULL;
   }
   }
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "returning 0x" << (void*)_data << endl;
     audio_cat->debug() << "returning 0x" << (void*)_data << endl;
   return _data;
   return _data;
 }
 }
 
 
 void WinSamplePlaying::unlock(void) {
 void WinSamplePlaying::unlock(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in winsampleplaying unlock" << endl;
     audio_cat->debug() << "in winsampleplaying unlock" << endl;
   WinSample* s = (WinSample*)(_sound);
   WinSample* s = (WinSample*)(_sound);
   HRESULT result = _channel->Unlock(_data, s->_len, NULL, 0);
   HRESULT result = _channel->Unlock(_data, s->_len, NULL, 0);
   CHECK_RESULT(result, "failed to unlock buffer");
   CHECK_RESULT(result, "failed to unlock buffer");
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "out of winsampleplaying unlock" << endl;
     audio_cat->debug() << "out of winsampleplaying unlock" << endl;
 }
 }
 
 
 WinMusicPlaying::WinMusicPlaying(AudioTraits::SoundClass* s)
 WinMusicPlaying::WinMusicPlaying(AudioTraits::SoundClass* s)
   : AudioTraits::PlayingClass(s) {
   : AudioTraits::PlayingClass(s) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in winmusicplaying constructor" << endl;
     audio_cat->debug() << "in winmusicplaying constructor" << endl;
   initialize();
   initialize();
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "out of winmusicplaying constructor" << endl;
     audio_cat->debug() << "out of winmusicplaying constructor" << endl;
 }
 }
 
 
 WinMusicPlaying::~WinMusicPlaying(void) {
 WinMusicPlaying::~WinMusicPlaying(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winmusicplaying destructor" << endl;
     audio_cat->debug() << "winmusicplaying destructor" << endl;
 }
 }
 
 
 void WinMusicPlaying::destroy(AudioTraits::PlayingClass* play) {
 void WinMusicPlaying::destroy(AudioTraits::PlayingClass* play) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winmusicplaying destroy got 0x" << (void*)play
     audio_cat->debug() << "winmusicplaying destroy got 0x" << (void*)play
-		       << endl;
+               << endl;
   delete play;
   delete play;
 }
 }
 
 
@@ -831,13 +831,13 @@ AudioTraits::PlayingClass::PlayingStatus WinMusicPlaying::status(void) {
 WinSamplePlayer* WinSamplePlayer::_global_instance = (WinSamplePlayer*)0L;
 WinSamplePlayer* WinSamplePlayer::_global_instance = (WinSamplePlayer*)0L;
 
 
 WinSamplePlayer::~WinSamplePlayer(void) {
 WinSamplePlayer::~WinSamplePlayer(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in winsampleplayer destructor" << endl;
     audio_cat->debug() << "in winsampleplayer destructor" << endl;
 }
 }
 
 
 void WinSamplePlayer::play_sound(AudioTraits::SoundClass* sample,
 void WinSamplePlayer::play_sound(AudioTraits::SoundClass* sample,
-			   AudioTraits::PlayingClass* play, float start_time) {
-  if (audio_cat->is_debug())
+               AudioTraits::PlayingClass* play, float start_time) {
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in winsampleplayer play_sound" << endl;
     audio_cat->debug() << "in winsampleplayer play_sound" << endl;
   initialize();
   initialize();
   if (!audio_is_active)
   if (!audio_is_active)
@@ -862,12 +862,12 @@ void WinSamplePlayer::play_sound(AudioTraits::SoundClass* sample,
     if (FAILED(result))
     if (FAILED(result))
       audio_cat->error() << "sample play failed" << endl;
       audio_cat->error() << "sample play failed" << endl;
   }
   }
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "out of winsampleplayer play_sound" << endl;
     audio_cat->debug() << "out of winsampleplayer play_sound" << endl;
 }
 }
 
 
 void WinSamplePlayer::stop_sound(AudioTraits::SoundClass*,
 void WinSamplePlayer::stop_sound(AudioTraits::SoundClass*,
-			   AudioTraits::PlayingClass* play) {
+               AudioTraits::PlayingClass* play) {
   initialize();
   initialize();
   if (!audio_is_active)
   if (!audio_is_active)
     return;
     return;
@@ -880,7 +880,7 @@ void WinSamplePlayer::stop_sound(AudioTraits::SoundClass*,
 }
 }
 
 
 void WinSamplePlayer::set_volume(AudioTraits::PlayingClass* play, float v) {
 void WinSamplePlayer::set_volume(AudioTraits::PlayingClass* play, float v) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winsampleplayer set_volume" << endl;
     audio_cat->debug() << "winsampleplayer set_volume" << endl;
   initialize();
   initialize();
   if (!audio_is_active)
   if (!audio_is_active)
@@ -898,7 +898,7 @@ void WinSamplePlayer::set_volume(AudioTraits::PlayingClass* play, float v) {
 }
 }
 
 
 bool WinSamplePlayer::adjust_volume(AudioTraits::PlayingClass* play) {
 bool WinSamplePlayer::adjust_volume(AudioTraits::PlayingClass* play) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winsampleplayer adjust_volume" << endl;
     audio_cat->debug() << "winsampleplayer adjust_volume" << endl;
   initialize();
   initialize();
   if (!audio_is_active)
   if (!audio_is_active)
@@ -916,26 +916,26 @@ bool WinSamplePlayer::adjust_volume(AudioTraits::PlayingClass* play) {
 }
 }
 
 
 WinSamplePlayer* WinSamplePlayer::get_instance(void) {
 WinSamplePlayer* WinSamplePlayer::get_instance(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in winsampleplayer get_instance" << endl;
     audio_cat->debug() << "in winsampleplayer get_instance" << endl;
   if (_global_instance == (WinSamplePlayer*)0L)
   if (_global_instance == (WinSamplePlayer*)0L)
     _global_instance = new WinSamplePlayer();
     _global_instance = new WinSamplePlayer();
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "winsampleplayer returning 0x"
     audio_cat->debug() << "winsampleplayer returning 0x"
-		       << (void*)_global_instance << endl;
+               << (void*)_global_instance << endl;
   return _global_instance;
   return _global_instance;
 }
 }
 
 
 WinMusicPlayer* WinMusicPlayer::_global_instance = (WinMusicPlayer*)0L;
 WinMusicPlayer* WinMusicPlayer::_global_instance = (WinMusicPlayer*)0L;
 
 
 WinMusicPlayer::~WinMusicPlayer(void) {
 WinMusicPlayer::~WinMusicPlayer(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in winmusicplayer destructor" << endl;
     audio_cat->debug() << "in winmusicplayer destructor" << endl;
 }
 }
 
 
 void WinMusicPlayer::play_sound(AudioTraits::SoundClass* music,
 void WinMusicPlayer::play_sound(AudioTraits::SoundClass* music,
-				AudioTraits::PlayingClass*, float) {
-  if (audio_cat->is_debug())
+                AudioTraits::PlayingClass*, float) {
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in WinMusicPlayer::play_sound()" << endl;
     audio_cat->debug() << "in WinMusicPlayer::play_sound()" << endl;
   initialize();
   initialize();
   if (!audio_is_active)
   if (!audio_is_active)
@@ -945,11 +945,11 @@ void WinMusicPlayer::play_sound(AudioTraits::SoundClass* music,
   WinMusic* wmusic = (WinMusic*)music;
   WinMusic* wmusic = (WinMusic*)music;
   IDirectMusicPerformance* _perf = wmusic->get_performance();
   IDirectMusicPerformance* _perf = wmusic->get_performance();
   IDirectMusicSegment* _msc = wmusic->get_music();
   IDirectMusicSegment* _msc = wmusic->get_music();
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "about to jump in: _perf = " << (void*)_perf
     audio_cat->debug() << "about to jump in: _perf = " << (void*)_perf
                        << "  _msc = " << (void*)_msc << endl;
                        << "  _msc = " << (void*)_msc << endl;
   if (_perf && _msc) {
   if (_perf && _msc) {
-    if (audio_cat->is_debug())
+    if (audio_cat.is_debug())
       audio_cat->debug() << "made it inside" << endl;
       audio_cat->debug() << "made it inside" << endl;
     // _msc->SetRepeats(0);
     // _msc->SetRepeats(0);
     IDirectMusicSegmentState* segState;
     IDirectMusicSegmentState* segState;
@@ -971,12 +971,12 @@ void WinMusicPlayer::play_sound(AudioTraits::SoundClass* music,
       };
       };
     }
     }
   }
   }
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "out of WinMusicPlayer::play_sound()" << endl;
     audio_cat->debug() << "out of WinMusicPlayer::play_sound()" << endl;
 }
 }
 
 
 void WinMusicPlayer::stop_sound(AudioTraits::SoundClass* music,
 void WinMusicPlayer::stop_sound(AudioTraits::SoundClass* music,
-				AudioTraits::PlayingClass*) {
+                AudioTraits::PlayingClass*) {
   WinMusic* wmusic = (WinMusic*)music;
   WinMusic* wmusic = (WinMusic*)music;
   IDirectMusicPerformance* _perf = wmusic->get_performance();
   IDirectMusicPerformance* _perf = wmusic->get_performance();
   IDirectMusicSegment* _msc = wmusic->get_music();
   IDirectMusicSegment* _msc = wmusic->get_music();
@@ -987,13 +987,13 @@ void WinMusicPlayer::stop_sound(AudioTraits::SoundClass* music,
     HRESULT result = _perf->Stop(_msc, 0, 0, 0);
     HRESULT result = _perf->Stop(_msc, 0, 0, 0);
     if (result != S_OK)
     if (result != S_OK)
       audio_cat->error() << "music stop failed" << endl;
       audio_cat->error() << "music stop failed" << endl;
-    else if (audio_cat->is_debug())
+    else if (audio_cat.is_debug())
       audio_cat->debug() << "music stop succeeded" << endl;
       audio_cat->debug() << "music stop succeeded" << endl;
   }
   }
 }
 }
 
 
 void WinMusicPlayer::set_volume(AudioTraits::PlayingClass* play, float v) {
 void WinMusicPlayer::set_volume(AudioTraits::PlayingClass* play, float v) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "WinMusicPlayer::set_volume()" << endl;
     audio_cat->debug() << "WinMusicPlayer::set_volume()" << endl;
   WinMusicPlaying* wplay = (WinMusicPlaying*)play;
   WinMusicPlaying* wplay = (WinMusicPlaying*)play;
   IDirectMusicPerformance* perf = wplay->get_performance();
   IDirectMusicPerformance* perf = wplay->get_performance();
@@ -1008,7 +1008,7 @@ void WinMusicPlayer::set_volume(AudioTraits::PlayingClass* play, float v) {
 }
 }
 
 
 bool WinMusicPlayer::adjust_volume(AudioTraits::PlayingClass* play) {
 bool WinMusicPlayer::adjust_volume(AudioTraits::PlayingClass* play) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "WinMusicPlayer::adjust_volume()" << endl;
     audio_cat->debug() << "WinMusicPlayer::adjust_volume()" << endl;
   WinMusicPlaying* wplay = (WinMusicPlaying*)play;
   WinMusicPlaying* wplay = (WinMusicPlaying*)play;
   IDirectMusicPerformance* perf = wplay->get_performance();
   IDirectMusicPerformance* perf = wplay->get_performance();
@@ -1023,13 +1023,13 @@ bool WinMusicPlayer::adjust_volume(AudioTraits::PlayingClass* play) {
 }
 }
 
 
 WinMusicPlayer* WinMusicPlayer::get_instance(void) {
 WinMusicPlayer* WinMusicPlayer::get_instance(void) {
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "in WinMusicPlayer::get_instance" << endl;
     audio_cat->debug() << "in WinMusicPlayer::get_instance" << endl;
   if (_global_instance == (WinMusicPlayer*)0L)
   if (_global_instance == (WinMusicPlayer*)0L)
     _global_instance = new WinMusicPlayer();
     _global_instance = new WinMusicPlayer();
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "WinMusicPlayer::get_instance returning 0x"
     audio_cat->debug() << "WinMusicPlayer::get_instance returning 0x"
-		       << (void*)_global_instance << endl;
+               << (void*)_global_instance << endl;
   return _global_instance;
   return _global_instance;
 }
 }
 
 

+ 66 - 66
panda/src/audiotraits/audio_load_mp3.cxx

@@ -81,21 +81,21 @@ static void set_synth_functions(struct frame* fr) {
   };
   };
   static func_mono funcs_mono[2][2][4] = {
   static func_mono funcs_mono[2][2][4] = {
     { { synth_1to1_mono2stereo,
     { { synth_1to1_mono2stereo,
-	synth_2to1_mono2stereo,
-	synth_4to1_mono2stereo,
-	synth_ntom_mono2stereo } ,
+    synth_2to1_mono2stereo,
+    synth_4to1_mono2stereo,
+    synth_ntom_mono2stereo } ,
       { synth_1to1_8bit_mono2stereo,
       { synth_1to1_8bit_mono2stereo,
-	synth_2to1_8bit_mono2stereo,
-	synth_4to1_8bit_mono2stereo,
-	synth_ntom_8bit_mono2stereo } } ,
+    synth_2to1_8bit_mono2stereo,
+    synth_4to1_8bit_mono2stereo,
+    synth_ntom_8bit_mono2stereo } } ,
     { { synth_1to1_mono,
     { { synth_1to1_mono,
-	synth_2to1_mono,
-	synth_4to1_mono,
-	synth_ntom_mono } ,
+    synth_2to1_mono,
+    synth_4to1_mono,
+    synth_ntom_mono } ,
       { synth_1to1_8bit_mono,
       { synth_1to1_8bit_mono,
-	synth_2to1_8bit_mono,
-	synth_4to1_8bit_mono,
-	synth_ntom_8bit_mono } } ,
+    synth_2to1_8bit_mono,
+    synth_4to1_8bit_mono,
+    synth_ntom_8bit_mono } } ,
   };
   };
 
 
   if ((ai.format & AUDIO_FORMAT_MASK) == AUDIO_FORMAT_8)
   if ((ai.format & AUDIO_FORMAT_MASK) == AUDIO_FORMAT_8)
@@ -152,7 +152,7 @@ public:
   void output(unsigned char* b) {
   void output(unsigned char* b) {
     for (Buffers::const_iterator i=_bufs.begin(); i!=_bufs.end(); ++i)
     for (Buffers::const_iterator i=_bufs.begin(); i!=_bufs.end(); ++i)
       for (Buffer::const_iterator j=(*i).begin(); j!=(*i).end(); ++j)
       for (Buffer::const_iterator j=(*i).begin(); j!=(*i).end(); ++j)
-	*(b++) = (*j);
+    *(b++) = (*j);
   }
   }
 };
 };
 
 
@@ -166,7 +166,7 @@ private:
   BufferPart* _next;
   BufferPart* _next;
 
 
   BufferPart(void) : _ptr((unsigned char*)0L), _len(0), _next((BufferPart*)0L)
   BufferPart(void) : _ptr((unsigned char*)0L), _len(0), _next((BufferPart*)0L)
-	 {}
+     {}
 public:
 public:
   BufferPart(unsigned char* b, unsigned long l) : _next((BufferPart*)0L),
   BufferPart(unsigned char* b, unsigned long l) : _next((BufferPart*)0L),
                                                   _len(l) {
                                                   _len(l) {
@@ -190,7 +190,7 @@ public:
   void output(unsigned char* b) {
   void output(unsigned char* b) {
      memcpy(b, _ptr, _len);
      memcpy(b, _ptr, _len);
      if (_next != (BufferPart*)0L)
      if (_next != (BufferPart*)0L)
-	_next->output(b+_len);
+    _next->output(b+_len);
   }
   }
 };
 };
 
 
@@ -232,7 +232,7 @@ int audio_set_rate(struct audio_info_struct* ai) {
 int audio_set_channels(struct audio_info_struct* ai) {
 int audio_set_channels(struct audio_info_struct* ai) {
   if (ai->channels != 2)
   if (ai->channels != 2)
     audio_cat->warning() << "trying to decode mp3 to non-stereo ("
     audio_cat->warning() << "trying to decode mp3 to non-stereo ("
-			 << ai->channels << " != 2)" << endl;
+             << ai->channels << " != 2)" << endl;
   return 0;
   return 0;
 }
 }
 
 
@@ -248,7 +248,7 @@ int audio_get_formats(struct audio_info_struct* ai) {
 }
 }
 
 
 int audio_play_samples(struct audio_info_struct* ai, unsigned char* buf,
 int audio_play_samples(struct audio_info_struct* ai, unsigned char* buf,
-		       int len) {
+               int len) {
   /*
   /*
   if (my_buf_head == (BufferPart*)0L) {
   if (my_buf_head == (BufferPart*)0L) {
     my_buf_head = my_buf_curr = new BufferPart(buf, len);
     my_buf_head = my_buf_curr = new BufferPart(buf, len);
@@ -344,56 +344,56 @@ int play_frame(struct mpstr* mp, int init, struct frame* fr) {
       audio_fit_capabilities(&ai, fr->stereo, newrate);
       audio_fit_capabilities(&ai, fr->stereo, newrate);
       // check whether the fitter set our proposed rate
       // check whether the fitter set our proposed rate
       if (ai.rate != newrate) {
       if (ai.rate != newrate) {
-	if (ai.rate == (newrate >> 1))
-	  fr->down_sample++;
-	else if (ai.rate == (newrate >> 2))
-	  fr->down_sample += 2;
-	else {
-	  fr->down_sample = 3;
-	  audio_cat->warning() << "flexable rate not heavily tested!" << endl;
-	}
-	if (fr->down_sample > 3)
-	  fr->down_sample = 3;
+    if (ai.rate == (newrate >> 1))
+      fr->down_sample++;
+    else if (ai.rate == (newrate >> 2))
+      fr->down_sample += 2;
+    else {
+      fr->down_sample = 3;
+      audio_cat->warning() << "flexable rate not heavily tested!" << endl;
+    }
+    if (fr->down_sample > 3)
+      fr->down_sample = 3;
       }
       }
       switch (fr->down_sample) {
       switch (fr->down_sample) {
       case 0:
       case 0:
       case 1:
       case 1:
       case 2:
       case 2:
-	fr->down_sample_sblimit = SBLIMIT >> (fr->down_sample);
-	break;
+    fr->down_sample_sblimit = SBLIMIT >> (fr->down_sample);
+    break;
       case 3:
       case 3:
-	{
-	  long n = freqs[fr->sampling_frequency];
-	  long m = ai.rate;
-	  synth_ntom_set_step(n, m);
-	  if (n>m) {
-	    fr->down_sample_sblimit = SBLIMIT * m;
-	    fr->down_sample_sblimit /= n;
-	  } else
-	    fr->down_sample_sblimit = SBLIMIT;
-	}
-	break;
+    {
+      long n = freqs[fr->sampling_frequency];
+      long m = ai.rate;
+      synth_ntom_set_step(n, m);
+      if (n>m) {
+        fr->down_sample_sblimit = SBLIMIT * m;
+        fr->down_sample_sblimit /= n;
+      } else
+        fr->down_sample_sblimit = SBLIMIT;
+    }
+    break;
       }
       }
       set_synth_functions(fr);
       set_synth_functions(fr);
       init_output();
       init_output();
       if (ai.rate != old_rate || ai.channels != old_channels ||
       if (ai.rate != old_rate || ai.channels != old_channels ||
-	  ai.format != old_format || param.force_reopen) {
-	if (param.force_mono < 0) {
-	  if (ai.channels == 1)
-	    fr->single = 3;
-	  else
-	    fr->single = -1;
-	} else
-	  fr->single = param.force_mono;
-	param.force_stereo &= ~0x2;
-	if (fr->single >= 0 && ai.channels == 2)
-	  param.force_stereo |= 0x2;
-	set_synth_functions(fr);
-	init_layer3(fr->down_sample_sblimit);
-	reset_audio();
+      ai.format != old_format || param.force_reopen) {
+    if (param.force_mono < 0) {
+      if (ai.channels == 1)
+        fr->single = 3;
+      else
+        fr->single = -1;
+    } else
+      fr->single = param.force_mono;
+    param.force_stereo &= ~0x2;
+    if (fr->single >= 0 && ai.channels == 2)
+      param.force_stereo |= 0x2;
+    set_synth_functions(fr);
+    init_layer3(fr->down_sample_sblimit);
+    reset_audio();
       }
       }
       if (intflag)
       if (intflag)
-	return !0;
+    return !0;
     }
     }
   }
   }
   if (fr->error_protection)
   if (fr->error_protection)
@@ -421,7 +421,7 @@ int play_frame(struct mpstr* mp, int init, struct frame* fr) {
 }
 }
 
 
 static void read_file(Filename filename, unsigned char** buf,
 static void read_file(Filename filename, unsigned char** buf,
-		      unsigned long& slen) {
+              unsigned long& slen) {
   int init;
   int init;
   unsigned long frameNum = 0;
   unsigned long frameNum = 0;
 
 
@@ -438,19 +438,19 @@ static void read_file(Filename filename, unsigned char** buf,
     leftFrames = numframes;
     leftFrames = numframes;
     for (frameNum=0; read_frame(&fr) && leftFrames && !intflag; ++frameNum) {
     for (frameNum=0; read_frame(&fr) && leftFrames && !intflag; ++frameNum) {
       if ((frameNum % 100) == 0)
       if ((frameNum % 100) == 0)
-        if (audio_cat->is_debug())
+        if (audio_cat.is_debug())
           audio_cat->debug(false) << ".";
           audio_cat->debug(false) << ".";
       if (frameNum < param.startFrame || (param.doublespeed &&
       if (frameNum < param.startFrame || (param.doublespeed &&
-					  (frameNum % param.doublespeed))) {
-	if (fr.lay == 3)
-	  set_pointer(512);
-	continue;
+                      (frameNum % param.doublespeed))) {
+    if (fr.lay == 3)
+      set_pointer(512);
+    continue;
       }
       }
       if (leftFrames > 0)
       if (leftFrames > 0)
-	--leftFrames;
+    --leftFrames;
       if (!play_frame(&mp, init, &fr)) {
       if (!play_frame(&mp, init, &fr)) {
-	audio_cat->error() << "Error in frame #" << frameNum << endl;
-	break;
+    audio_cat->error() << "Error in frame #" << frameNum << endl;
+    break;
       }
       }
       init = 0;
       init = 0;
     }
     }
@@ -459,7 +459,7 @@ static void read_file(Filename filename, unsigned char** buf,
       intflag = FALSE;
       intflag = FALSE;
     }
     }
   }
   }
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug(false) << endl;
     audio_cat->debug(false) << endl;
   audio_flush(param.outmode, &ai);
   audio_flush(param.outmode, &ai);
   switch (param.outmode) {
   switch (param.outmode) {
@@ -513,7 +513,7 @@ static void read_file(Filename filename, unsigned char** buf,
 
 
 AudioTraits::SoundClass* AudioLoadMp3(Filename) {
 AudioTraits::SoundClass* AudioLoadMp3(Filename) {
   audio_cat->warning() << "Mikmod doesn't support reading mp3 data yet"
   audio_cat->warning() << "Mikmod doesn't support reading mp3 data yet"
-		       << endl;
+               << endl;
   return (AudioTraits::SoundClass*)0L;
   return (AudioTraits::SoundClass*)0L;
 }
 }
 
 

+ 35 - 35
panda/src/audiotraits/audio_load_st.cxx

@@ -153,7 +153,7 @@ static int flow_effect(int e) {
     odone = BUFSIZ;
     odone = BUFSIZ;
     eflow = (effFlowFunc*)(efftab[e].h->flow);
     eflow = (effFlowFunc*)(efftab[e].h->flow);
     (*eflow)(&efftab[e], &efftab[e-1].obuf[efftab[e-1].odone], efftab[e].obuf,
     (*eflow)(&efftab[e], &efftab[e-1].obuf[efftab[e-1].odone], efftab[e].obuf,
-	     &idone, &odone);
+         &idone, &odone);
     efftab[e-1].odone += idone;
     efftab[e-1].odone += idone;
     efftab[e].odone = 0;
     efftab[e].odone = 0;
     efftab[e].olen = odone;
     efftab[e].olen = odone;
@@ -263,17 +263,17 @@ static void read_file(Filename filename, byte** buf, unsigned long& slen) {
     return;
     return;
   }
   }
   CHECKFORMAT(&iformat);
   CHECKFORMAT(&iformat);
-  if (audio_cat->is_debug())
+  if (audio_cat.is_debug())
     audio_cat->debug() << "Input file '" << iformat.filename
     audio_cat->debug() << "Input file '" << iformat.filename
-		       << "': sample rate = " << iformat.info.rate
-		       << "  size = " << SIZES[iformat.info.size]
-		       << "  encoding = " << ENCODING[iformat.info.ENCODEFIELD]
-		       << "  " << iformat.info.channels
-		       << ((iformat.info.channels > 1)?"channels":"channel")
-		       << endl;
-  if (audio_cat->is_debug())
+               << "': sample rate = " << iformat.info.rate
+               << "  size = " << SIZES[iformat.info.size]
+               << "  encoding = " << ENCODING[iformat.info.ENCODEFIELD]
+               << "  " << iformat.info.channels
+               << ((iformat.info.channels > 1)?"channels":"channel")
+               << endl;
+  if (audio_cat.is_debug())
     audio_cat->debug() << "Input file comment: '" << iformat.comment << "'"
     audio_cat->debug() << "Input file comment: '" << iformat.comment << "'"
-		       << endl;
+               << endl;
   COPYFORMAT(&iformat, &oformat);
   COPYFORMAT(&iformat, &oformat);
   check_effects();
   check_effects();
   // start all effects
   // start all effects
@@ -305,25 +305,25 @@ static void read_file(Filename filename, byte** buf, unsigned long& slen) {
       // run entire chain backwards: pull, don't push
       // run entire chain backwards: pull, don't push
       // this is because buffering system isn't a nice queueing system
       // this is because buffering system isn't a nice queueing system
       for (e=neffects-1; e>0; --e)
       for (e=neffects-1; e>0; --e)
-	if (flow_effect(e))
-	  break;
+    if (flow_effect(e))
+      break;
       // add to output data
       // add to output data
       if (efftab[neffects-1].olen>efftab[neffects-1].odone) {
       if (efftab[neffects-1].olen>efftab[neffects-1].odone) {
-	for (LONG i=0; i<efftab[neffects-1].olen; ++i) {
-	  LONG foo = efftab[neffects-1].obuf[i];
-	  signed short bar = (foo >> 16);
-	  unsigned char *b = (unsigned char*)&bar;
-	  out << *b << *(++b);
-	}
-	efftab[neffects-1].odone = efftab[neffects-1].olen;
+    for (LONG i=0; i<efftab[neffects-1].olen; ++i) {
+      LONG foo = efftab[neffects-1].obuf[i];
+      signed short bar = (foo >> 16);
+      unsigned char *b = (unsigned char*)&bar;
+      out << *b << *(++b);
+    }
+    efftab[neffects-1].odone = efftab[neffects-1].olen;
       }
       }
       // if there is still stuff in the pipeline, setup to flow effects again
       // if there is still stuff in the pipeline, setup to flow effects again
       havedata = 0;
       havedata = 0;
       for (e=0; e<neffects-1; ++e)
       for (e=0; e<neffects-1; ++e)
-	if (efftab[e].odone < efftab[e].olen) {
-	  havedata = 1;
-	  break;
-	}
+    if (efftab[e].odone < efftab[e].olen) {
+      havedata = 1;
+      break;
+    }
     } while (havedata);
     } while (havedata);
     // read another chunk
     // read another chunk
     rfunc = (formatReadFunc*)(iformat.h->read);
     rfunc = (formatReadFunc*)(iformat.h->read);
@@ -335,17 +335,17 @@ static void read_file(Filename filename, byte** buf, unsigned long& slen) {
   for (e=1; e<neffects; ++e)
   for (e=1; e<neffects; ++e)
     while (1) {
     while (1) {
       if (drain_effect(e) == 0)
       if (drain_effect(e) == 0)
-	break;  // get out of while loop
+    break;  // get out of while loop
       if (efftab[neffects-1].olen > 0) {
       if (efftab[neffects-1].olen > 0) {
-	for (LONG i=0; i<efftab[neffects-1].olen; ++i) {
-	  LONG foo = efftab[neffects-1].obuf[i];
-	  signed short bar = (foo >> 16);
-	  unsigned char *b = (unsigned char*)&bar;
-	  out << *b << *(++b);
-	}
+    for (LONG i=0; i<efftab[neffects-1].olen; ++i) {
+      LONG foo = efftab[neffects-1].obuf[i];
+      signed short bar = (foo >> 16);
+      unsigned char *b = (unsigned char*)&bar;
+      out << *b << *(++b);
+    }
       }
       }
       if (efftab[e].olen != BUFSIZ)
       if (efftab[e].olen != BUFSIZ)
-	break;
+    break;
     }
     }
   // stop all effects.  In so doing, some may generate more data
   // stop all effects.  In so doing, some may generate more data
   for (e=1; e<neffects; ++e) {
   for (e=1; e<neffects; ++e) {
@@ -383,7 +383,7 @@ void cleanup(void) {
 
 
 AudioTraits::SoundClass* AudioLoadSt(Filename) {
 AudioTraits::SoundClass* AudioLoadSt(Filename) {
   audio_cat->warning() << "MikMod doesn't support reading raw data yet"
   audio_cat->warning() << "MikMod doesn't support reading raw data yet"
-		       << endl;
+               << endl;
   return (AudioTraits::SoundClass*)0L;
   return (AudioTraits::SoundClass*)0L;
 }
 }
 
 
@@ -438,9 +438,9 @@ ConfigureFn(audio_load_st) {
 #ifdef HAVE_SOXST
 #ifdef HAVE_SOXST
   for (int i=0; FORMATS[i].names != (char**)0L; ++i)
   for (int i=0; FORMATS[i].names != (char**)0L; ++i)
     for (int j=0; FORMATS[i].names[j] != (char*)0L; ++j) {
     for (int j=0; FORMATS[i].names[j] != (char*)0L; ++j) {
-      if (audio_cat->is_debug())
-	audio_cat->debug() << "adding reader for '." << FORMATS[i].names[j]
-			   << "'" << endl;
+      if (audio_cat.is_debug())
+    audio_cat->debug() << "adding reader for '." << FORMATS[i].names[j]
+               << "'" << endl;
       AudioPool::register_sound_loader(FORMATS[i].names[j], AudioLoadSt);
       AudioPool::register_sound_loader(FORMATS[i].names[j], AudioLoadSt);
     }
     }
 #else /* HAVE_SOXST */
 #else /* HAVE_SOXST */

+ 112 - 112
panda/src/chancfg/chancfg.cxx

@@ -46,7 +46,7 @@ static void ReadChanConfigData(void) {
   } else {
   } else {
     ifstream ifs;
     ifstream ifs;
     if (layoutfname.open_read(ifs)) {
     if (layoutfname.open_read(ifs)) {
-      if (chancfg_cat->is_debug())
+      if (chancfg_cat.is_debug())
         chancfg_cat->debug()
         chancfg_cat->debug()
           << "Reading layout database " << layoutfname << endl;
           << "Reading layout database " << layoutfname << endl;
       ParseLayout(ifs);
       ParseLayout(ifs);
@@ -63,7 +63,7 @@ static void ReadChanConfigData(void) {
   } else {
   } else {
     ifstream ifs;
     ifstream ifs;
     if (setupfname.open_read(ifs)) {
     if (setupfname.open_read(ifs)) {
-      if (chancfg_cat->is_debug())
+      if (chancfg_cat.is_debug())
         chancfg_cat->debug()
         chancfg_cat->debug()
           << "Reading setup database " << setupfname << endl;
           << "Reading setup database " << setupfname << endl;
       ParseSetup(ifs);
       ParseSetup(ifs);
@@ -80,7 +80,7 @@ static void ReadChanConfigData(void) {
   } else {
   } else {
     ifstream ifs;
     ifstream ifs;
     if (windowfname.open_read(ifs)) {
     if (windowfname.open_read(ifs)) {
-      if (chancfg_cat->is_debug())
+      if (chancfg_cat.is_debug())
         chancfg_cat->debug()
         chancfg_cat->debug()
           << "Reading window database " << windowfname << endl;
           << "Reading window database " << windowfname << endl;
       ParseWindow(ifs);
       ParseWindow(ifs);
@@ -135,23 +135,23 @@ bool ChanCheckSetups(SetupSyms& S) {
     if (((*SetupDB)[*i]).getRecurse()) {
     if (((*SetupDB)[*i]).getRecurse()) {
       SetupSyms a = ((*SetupDB)[*i]).getLayouts();
       SetupSyms a = ((*SetupDB)[*i]).getLayouts();
       if (!ChanCheckLayouts(a))
       if (!ChanCheckLayouts(a))
-	return false;
+    return false;
       a = ((*SetupDB)[*i]).getSetups();
       a = ((*SetupDB)[*i]).getSetups();
       if (!ChanCheckSetups(a))
       if (!ChanCheckSetups(a))
-	return false;
+    return false;
     }
     }
   }
   }
   return true;
   return true;
 }
 }
 
 
 INLINE ChanViewport ChanScaleViewport(const ChanViewport& parent,
 INLINE ChanViewport ChanScaleViewport(const ChanViewport& parent,
-				      const ChanViewport& child) {
+                      const ChanViewport& child) {
   float dx = (parent.right() - parent.left());
   float dx = (parent.right() - parent.left());
   float dy = (parent.top() - parent.bottom());
   float dy = (parent.top() - parent.bottom());
   ChanViewport v(parent.left() + (dx * child.left()),
   ChanViewport v(parent.left() + (dx * child.left()),
-		 parent.left() + (dx * child.right()),
-		 parent.bottom() + (dy * child.bottom()),
-		 parent.bottom() + (dy * child.top()));
+         parent.left() + (dx * child.right()),
+         parent.bottom() + (dy * child.bottom()),
+         parent.bottom() + (dy * child.top()));
   return v;
   return v;
 }
 }
 
 
@@ -171,22 +171,22 @@ SetupFOV ChanResolveFOV(SetupFOV& fov, float sizeX, float sizeY) {
   switch (fov.getType()) {
   switch (fov.getType()) {
   case SetupFOV::Horizontal:
   case SetupFOV::Horizontal:
     horiz = fov.getHoriz();
     horiz = fov.getHoriz();
-    if (chancfg_cat->is_debug())
+    if (chancfg_cat.is_debug())
       chancfg_cat->debug() << "ChanResolveFOV:: setting default horiz = "
       chancfg_cat->debug() << "ChanResolveFOV:: setting default horiz = "
-			   << horiz << endl;
+               << horiz << endl;
   case SetupFOV::Default:
   case SetupFOV::Default:
     horiz = chanconfig.GetFloat("fov", horiz);
     horiz = chanconfig.GetFloat("fov", horiz);
     vert = 2.*rad_2_deg(atan((sizeY/sizeX)*tan(0.5*deg_2_rad(horiz))));
     vert = 2.*rad_2_deg(atan((sizeY/sizeX)*tan(0.5*deg_2_rad(horiz))));
-    if (chancfg_cat->is_debug())
+    if (chancfg_cat.is_debug())
       chancfg_cat->debug() << "ChanResolveFOV:: setting horiz = " << horiz
       chancfg_cat->debug() << "ChanResolveFOV:: setting horiz = " << horiz
-			   << " and vert = " << vert << endl;
+               << " and vert = " << vert << endl;
     break;
     break;
   case SetupFOV::Both:
   case SetupFOV::Both:
     horiz = fov.getHoriz();
     horiz = fov.getHoriz();
     vert = fov.getVert();
     vert = fov.getVert();
-    if (chancfg_cat->is_debug())
+    if (chancfg_cat.is_debug())
       chancfg_cat->debug() << "ChanResolveFOV:: setting horiz = " << horiz
       chancfg_cat->debug() << "ChanResolveFOV:: setting horiz = " << horiz
-			   << " and vert = " << vert << endl;
+               << " and vert = " << vert << endl;
     break;
     break;
 
 
   default:
   default:
@@ -198,8 +198,8 @@ SetupFOV ChanResolveFOV(SetupFOV& fov, float sizeX, float sizeY) {
 }
 }
 
 
 void ChanEval(GraphicsWindow* win, WindowItem& W, LayoutItem& L, SVec& S,
 void ChanEval(GraphicsWindow* win, WindowItem& W, LayoutItem& L, SVec& S,
-	      ChanViewport& V, int hw_offset, int xsize, int ysize,
-	      Node *camera_node, Node *render, bool want_cameras) {
+          ChanViewport& V, int hw_offset, int xsize, int ysize,
+          Node *camera_node, Node *render, bool want_cameras) {
   int i = min(L.GetNumRegions(), int(S.size()));
   int i = min(L.GetNumRegions(), int(S.size()));
   int j;
   int j;
   SVec::iterator k;
   SVec::iterator k;
@@ -211,72 +211,72 @@ void ChanEval(GraphicsWindow* win, WindowItem& W, LayoutItem& L, SVec& S,
       LayoutItem subL = (*LayoutDB)[l[0]];
       LayoutItem subL = (*LayoutDB)[l[0]];
       SVec subS;
       SVec subS;
       for (SetupSyms::iterator m=s.begin(); m!=s.end(); ++m)
       for (SetupSyms::iterator m=s.begin(); m!=s.end(); ++m)
-	subS.push_back((*SetupDB)[*m]);
+    subS.push_back((*SetupDB)[*m]);
       int xs = int(xsize*(v.right()-v.left()));
       int xs = int(xsize*(v.right()-v.left()));
       int ys = int(ysize*(v.top()-v.bottom()));
       int ys = int(ysize*(v.top()-v.bottom()));
       ChanEval(win, W, subL, subS, v, hw_offset, xs, ys, camera_node, render, want_cameras);
       ChanEval(win, W, subL, subS, v, hw_offset, xs, ys, camera_node, render, want_cameras);
     } else {
     } else {
       PT(GraphicsChannel) chan;
       PT(GraphicsChannel) chan;
       if ((*k).getHWChan() && W.getHWChans()) {
       if ((*k).getHWChan() && W.getHWChans()) {
-	if ((*k).getChan() == -1) {
-	  chan = win->get_channel(hw_offset);
-	} else
-	  chan = win->get_channel((*k).getChan());
-	// HW channels always start with the full area of the channel
-	v = ChanViewport(0., 1., 0., 1.);
+    if ((*k).getChan() == -1) {
+      chan = win->get_channel(hw_offset);
+    } else
+      chan = win->get_channel((*k).getChan());
+    // HW channels always start with the full area of the channel
+    v = ChanViewport(0., 1., 0., 1.);
       } else {
       } else {
-	chan = win->get_channel(0);
+    chan = win->get_channel(0);
       }
       }
       ChanViewport v2(ChanScaleViewport(v, (*k).getViewport()));
       ChanViewport v2(ChanScaleViewport(v, (*k).getViewport()));
       PT(GraphicsLayer) layer = chan->make_layer();
       PT(GraphicsLayer) layer = chan->make_layer();
       PT(DisplayRegion) dr = 
       PT(DisplayRegion) dr = 
-	layer->make_display_region(v2.left(), v2.right(),
-				   v2.bottom(), v2.top());
+    layer->make_display_region(v2.left(), v2.right(),
+                   v2.bottom(), v2.top());
       if (want_cameras && camera_node != (Node *)NULL) {
       if (want_cameras && camera_node != (Node *)NULL) {
-	// now make a camera for it
-	PT(Camera) cam = new Camera;
-	dr->set_camera(cam);
-	SetupFOV fov = (*k).getFOV();
-	fov = ChanResolveFOV(fov, xsize*(v2.right()-v2.left()),
-			     ysize*(v2.top()-v2.bottom()));
-	if (chancfg_cat->is_debug()) {
-	  chancfg_cat->debug() << "ChanEval:: about to compute frustum."
-			       << endl;
-	  chancfg_cat->debug() << "ChanEval:: FOVhoriz = " << fov.getHoriz()
-			       << "  FOVvert = " << fov.getVert() << endl;
-	  chancfg_cat->debug() << "ChanEval:: xsize = " << xsize
-			       << "  ysize = " << ysize << endl;
-	}
-	Frustumf frust;
-	frust.make_perspective(fov.getHoriz(), fov.getVert(), 1., 10000.);
-	cam->set_projection(PerspectiveProjection(frust));
-	if (chancfg_cat->is_debug())
-	  chancfg_cat->debug() << "ChanEval:: camera hfov = "
-			       << cam->get_hfov() << "  vfov = "
-			       << cam->get_vfov() << endl;
-	cam->set_scene(render);
-
-	// take care of the orientation
-	PT(TransformTransition) orient;
+    // now make a camera for it
+    PT(Camera) cam = new Camera;
+    dr->set_camera(cam);
+    SetupFOV fov = (*k).getFOV();
+    fov = ChanResolveFOV(fov, xsize*(v2.right()-v2.left()),
+                 ysize*(v2.top()-v2.bottom()));
+    if (chancfg_cat.is_debug()) {
+      chancfg_cat->debug() << "ChanEval:: about to compute frustum."
+                   << endl;
+      chancfg_cat->debug() << "ChanEval:: FOVhoriz = " << fov.getHoriz()
+                   << "  FOVvert = " << fov.getVert() << endl;
+      chancfg_cat->debug() << "ChanEval:: xsize = " << xsize
+                   << "  ysize = " << ysize << endl;
+    }
+    Frustumf frust;
+    frust.make_perspective(fov.getHoriz(), fov.getVert(), 1., 10000.);
+    cam->set_projection(PerspectiveProjection(frust));
+    if (chancfg_cat.is_debug())
+      chancfg_cat->debug() << "ChanEval:: camera hfov = "
+                   << cam->get_hfov() << "  vfov = "
+                   << cam->get_vfov() << endl;
+    cam->set_scene(render);
+
+    // take care of the orientation
+    PT(TransformTransition) orient;
       
       
-	switch ((*k).getOrientation()) {
-	case SetupItem::Up:
-	  break;
-	case SetupItem::Down:
-	  orient = new TransformTransition(LMatrix4f::rotate_mat_normaxis(180., LVector3f::forward()));
-	  break;
-	case SetupItem::Left:
-	  orient = new TransformTransition(LMatrix4f::rotate_mat_normaxis(90., LVector3f::forward()));
-	  break;
-	case SetupItem::Right:
-	  orient = new TransformTransition(LMatrix4f::rotate_mat_normaxis(-90., LVector3f::forward()));
-	  break;
-	}
-
-	RenderRelation *tocam = new RenderRelation(camera_node, cam);
-	if (orient != (TransformTransition *)NULL) {
-	  tocam->set_transition(orient);
-	}
+    switch ((*k).getOrientation()) {
+    case SetupItem::Up:
+      break;
+    case SetupItem::Down:
+      orient = new TransformTransition(LMatrix4f::rotate_mat_normaxis(180., LVector3f::forward()));
+      break;
+    case SetupItem::Left:
+      orient = new TransformTransition(LMatrix4f::rotate_mat_normaxis(90., LVector3f::forward()));
+      break;
+    case SetupItem::Right:
+      orient = new TransformTransition(LMatrix4f::rotate_mat_normaxis(-90., LVector3f::forward()));
+      break;
+    }
+
+    RenderRelation *tocam = new RenderRelation(camera_node, cam);
+    if (orient != (TransformTransition *)NULL) {
+      tocam->set_transition(orient);
+    }
       }
       }
     }
     }
   }
   }
@@ -284,8 +284,8 @@ void ChanEval(GraphicsWindow* win, WindowItem& W, LayoutItem& L, SVec& S,
 }
 }
 
 
 PT(GraphicsWindow) ChanConfig(GraphicsPipe* pipe, std::string cfg,
 PT(GraphicsWindow) ChanConfig(GraphicsPipe* pipe, std::string cfg,
-			      Node *camera_node, Node *render,
-			      ChanCfgOverrides& overrides) {
+                  Node *camera_node, Node *render,
+                  ChanCfgOverrides& overrides) {
   ReadChanConfigData();
   ReadChanConfigData();
   // check to make sure we know everything we need to
   // check to make sure we know everything we need to
   if (!ConfigDefined(cfg)) {
   if (!ConfigDefined(cfg)) {
@@ -380,56 +380,56 @@ PT(GraphicsWindow) ChanConfig(GraphicsPipe* pipe, std::string cfg,
   // make channels and display regions
   // make channels and display regions
   ChanViewport V(0., 1., 0., 1.);
   ChanViewport V(0., 1., 0., 1.);
   ChanEval(win, W, L, S, V, W.getChanOffset()+1, sizeX, sizeY, 
   ChanEval(win, W, L, S, V, W.getChanOffset()+1, sizeX, sizeY, 
-	   camera_node, render, want_cameras);
+       camera_node, render, want_cameras);
 
 
   // sanity check
   // sanity check
   if (config_sanity_check) {
   if (config_sanity_check) {
     nout << "ChanConfig Sanity check:" << endl;
     nout << "ChanConfig Sanity check:" << endl;
     nout << "window - " << (void*)win << endl;
     nout << "window - " << (void*)win << endl;
     nout << "  width = " << win->get_width() << "  height = "
     nout << "  width = " << win->get_width() << "  height = "
-	 << win->get_height() << endl;
+     << win->get_height() << endl;
     nout << "  xorig = " << win->get_xorg() << "  yorig = " << win->get_yorg()
     nout << "  xorig = " << win->get_xorg() << "  yorig = " << win->get_yorg()
-	 << endl;
+     << endl;
     {
     {
       int max_channel_index = win->get_max_channel_index();
       int max_channel_index = win->get_max_channel_index();
       for (int c = 0; c < max_channel_index; c++) {
       for (int c = 0; c < max_channel_index; c++) {
-	if (win->is_channel_defined(c)) {
-	  GraphicsChannel *chan = win->get_channel(c);
-	  nout << "  Chan - " << (void*)chan << endl;
-	  nout << "    window = " << (void*)(chan->get_window()) << endl;
-	  nout << "    active = " << chan->is_active() << endl;;
-
-	  int num_layers = chan->get_num_layers();
-	  for (int l = 0; l < num_layers; l++) {
-	    GraphicsLayer *layer = chan->get_layer(l);
-	    nout << "    Layer - " << (void*)layer << endl;
-	    nout << "      channel = " << (void*)(layer->get_channel()) << endl;
-	    nout << "      active = " << layer->is_active() << endl;;
-
-	    int num_drs = layer->get_num_drs();
-	    for (int d = 0; d < num_drs; d++) {
-	      DisplayRegion *dr = layer->get_dr(d);
-	      nout << "      DR - " << (void*)dr << endl;
-	      nout << "        layer = " << (void*)(dr->get_layer()) << endl;
-	      float ll, rr, bb, tt;
-	      dr->get_dimensions(ll, rr, bb, tt);
-	      nout << "        (" << ll << " " << rr << " " << bb << " " << tt << ")"
-		   << endl;
-	      nout << "        camera = " << (void*)(dr->get_camera()) << endl;
-	      {
-		Camera* cmm = dr->get_camera();
-		if (cmm != (Camera*)0L) {
-		  nout << "          active = " << cmm->is_active() << endl;;
-		  int num_cam_drs = cmm->get_num_drs();
-		  for (int cd = 0; cd < num_cam_drs; cd++) {
-		    nout << "          dr = " << (void*)cmm->get_dr(cd) << endl;
-		  }
-		}
-	      }
-	      nout << "      active = " << dr->is_active() << endl;
-	    }
-	  }
-	}
+    if (win->is_channel_defined(c)) {
+      GraphicsChannel *chan = win->get_channel(c);
+      nout << "  Chan - " << (void*)chan << endl;
+      nout << "    window = " << (void*)(chan->get_window()) << endl;
+      nout << "    active = " << chan->is_active() << endl;;
+
+      int num_layers = chan->get_num_layers();
+      for (int l = 0; l < num_layers; l++) {
+        GraphicsLayer *layer = chan->get_layer(l);
+        nout << "    Layer - " << (void*)layer << endl;
+        nout << "      channel = " << (void*)(layer->get_channel()) << endl;
+        nout << "      active = " << layer->is_active() << endl;;
+
+        int num_drs = layer->get_num_drs();
+        for (int d = 0; d < num_drs; d++) {
+          DisplayRegion *dr = layer->get_dr(d);
+          nout << "      DR - " << (void*)dr << endl;
+          nout << "        layer = " << (void*)(dr->get_layer()) << endl;
+          float ll, rr, bb, tt;
+          dr->get_dimensions(ll, rr, bb, tt);
+          nout << "        (" << ll << " " << rr << " " << bb << " " << tt << ")"
+           << endl;
+          nout << "        camera = " << (void*)(dr->get_camera()) << endl;
+          {
+        Camera* cmm = dr->get_camera();
+        if (cmm != (Camera*)0L) {
+          nout << "          active = " << cmm->is_active() << endl;;
+          int num_cam_drs = cmm->get_num_drs();
+          for (int cd = 0; cd < num_cam_drs; cd++) {
+            nout << "          dr = " << (void*)cmm->get_dr(cd) << endl;
+          }
+        }
+          }
+          nout << "      active = " << dr->is_active() << endl;
+        }
+      }
+    }
       }
       }
     }
     }
   }
   }

+ 8 - 8
panda/src/chancfg/chanlayout.cxx

@@ -66,16 +66,16 @@ void LayoutParseFunctor::operator()(std::string S) {
 
 
     for (int j=y; j<y+n; ++j)
     for (int j=y; j<y+n; ++j)
       for (int k=x; k<x+m; ++k)
       for (int k=x; k<x+m; ++k)
-	if (mask[(j*X)+k])
-	  ok = false;
-	else
-	  mask[(j*X)+k] = true;
+    if (mask[(j*X)+k])
+      ok = false;
+    else
+      mask[(j*X)+k] = true;
     if (ok) {
     if (ok) {
       ChanViewport l((x*xfrac), ((x+m)*xfrac), (y*yfrac), ((y+n)*yfrac));
       ChanViewport l((x*xfrac), ((x+m)*xfrac), (y*yfrac), ((y+n)*yfrac));
       L.AddRegion(l);
       L.AddRegion(l);
     } else {
     } else {
       nout << "error, region (" << m << " " << n << " " << start
       nout << "error, region (" << m << " " << n << " " << start
-	   << ") overlaps another.  It is being skipped." << endl;
+       << ") overlaps another.  It is being skipped." << endl;
     }
     }
   }
   }
   for (i=0; i<(X*Y); ++i)
   for (i=0; i<(X*Y); ++i)
@@ -87,14 +87,14 @@ void LayoutParseFunctor::operator()(std::string S) {
       L.AddRegion(l);
       L.AddRegion(l);
     }
     }
 
 
-  if (chancfg_cat->is_debug()) {
+  if (chancfg_cat.is_debug()) {
     chancfg_cat->debug() << "parsed a layout called '" << sym << "':" << endl;
     chancfg_cat->debug() << "parsed a layout called '" << sym << "':" << endl;
     chancfg_cat->debug() << "  " << L.GetNumRegions() << " regions" << endl;
     chancfg_cat->debug() << "  " << L.GetNumRegions() << " regions" << endl;
     for (int q=0; q<L.GetNumRegions(); ++q) {
     for (int q=0; q<L.GetNumRegions(); ++q) {
       const ChanViewport& v = L[q];
       const ChanViewport& v = L[q];
       chancfg_cat->debug() << "  region #" << q << ": (" << v.left() << ", "
       chancfg_cat->debug() << "  region #" << q << ": (" << v.left() << ", "
-			   << v.right() << ", " << v.bottom() << ", "
-			   << v.top() << ")" << endl;
+               << v.right() << ", " << v.bottom() << ", "
+               << v.top() << ")" << endl;
     }
     }
   }
   }
   (*LayoutDB)[sym] = L;
   (*LayoutDB)[sym] = L;

+ 48 - 48
panda/src/chancfg/chansetup.cxx

@@ -47,7 +47,7 @@ void SetupParseFunctor::operator()(std::string S) {
     if (!S.empty()) {
     if (!S.empty()) {
       // error, there shouldn't be any more here
       // error, there shouldn't be any more here
       nout << "error, trailing data in recursive definition '" << S << "'"
       nout << "error, trailing data in recursive definition '" << S << "'"
-	   << endl;
+       << endl;
       S.erase(0, std::string::npos);
       S.erase(0, std::string::npos);
     }
     }
     std::string a, b;
     std::string a, b;
@@ -66,7 +66,7 @@ void SetupParseFunctor::operator()(std::string S) {
     S.erase(0, i+1);
     S.erase(0, i+1);
     ChanEatFrontWhite(S);
     ChanEatFrontWhite(S);
     ChanViewport v(ChanReadNextFloat(stmp), ChanReadNextFloat(stmp),
     ChanViewport v(ChanReadNextFloat(stmp), ChanReadNextFloat(stmp),
-		   ChanReadNextFloat(stmp), ChanReadNextFloat(stmp));
+           ChanReadNextFloat(stmp), ChanReadNextFloat(stmp));
     if (!stmp.empty()) {
     if (!stmp.empty()) {
       // error, there shouldn't be anything left after eating the viewport
       // error, there shouldn't be anything left after eating the viewport
       nout << "error, tailing text in viewport spec '" << stmp << "'" << endl;
       nout << "error, tailing text in viewport spec '" << stmp << "'" << endl;
@@ -76,9 +76,9 @@ void SetupParseFunctor::operator()(std::string S) {
     if (S[0] == '#') {
     if (S[0] == '#') {
       bool b = ChanReadNextBool(S);
       bool b = ChanReadNextBool(S);
       if (b) {
       if (b) {
-	// error, #t is not allowed here
-	nout << "error, cannot have #t for FOV spec" << endl;
-	b = false;
+    // error, #t is not allowed here
+    nout << "error, cannot have #t for FOV spec" << endl;
+    b = false;
       }
       }
       fov.setFOV();
       fov.setFOV();
     } else if (S[0] == '(') {
     } else if (S[0] == '(') {
@@ -88,9 +88,9 @@ void SetupParseFunctor::operator()(std::string S) {
       ChanEatFrontWhite(S);
       ChanEatFrontWhite(S);
       fov.setFOV(ChanReadNextFloat(stmp), ChanReadNextFloat(stmp));
       fov.setFOV(ChanReadNextFloat(stmp), ChanReadNextFloat(stmp));
       if (!stmp.empty()) {
       if (!stmp.empty()) {
-	// error, there shouldn't be anything left after eating the fov
-	nout << "error, trailing text after fov spec '" << stmp << "'" << endl;
-	stmp.erase(0, std::string::npos);
+    // error, there shouldn't be anything left after eating the fov
+    nout << "error, trailing text after fov spec '" << stmp << "'" << endl;
+    stmp.erase(0, std::string::npos);
       }
       }
     } else {
     } else {
       fov.setFOV(ChanReadNextFloat(S));
       fov.setFOV(ChanReadNextFloat(S));
@@ -99,18 +99,18 @@ void SetupParseFunctor::operator()(std::string S) {
     if (!S.empty()) {
     if (!S.empty()) {
       stmp = ChanReadNextWord(S);
       stmp = ChanReadNextWord(S);
       if (stmp == "up") {
       if (stmp == "up") {
-	// nothing really to do
-	orie = SetupItem::Up;
+    // nothing really to do
+    orie = SetupItem::Up;
       } else if (stmp == "down") {
       } else if (stmp == "down") {
-	orie = SetupItem::Down;
+    orie = SetupItem::Down;
       } else if (stmp == "left") {
       } else if (stmp == "left") {
-	orie = SetupItem::Left;
+    orie = SetupItem::Left;
       } else if (stmp == "right") {
       } else if (stmp == "right") {
-	orie = SetupItem::Right;
+    orie = SetupItem::Right;
       } else {
       } else {
-	// error, not a recognized orientation
-	nout << "error, invalid orientation '" << stmp << "'" << endl;
-	stmp.erase(0, std::string::npos);
+    // error, not a recognized orientation
+    nout << "error, invalid orientation '" << stmp << "'" << endl;
+    stmp.erase(0, std::string::npos);
       }
       }
     }
     }
     if (!S.empty()) {
     if (!S.empty()) {
@@ -121,7 +121,7 @@ void SetupParseFunctor::operator()(std::string S) {
     s.setState(stereo, hw_chan, chan_num, v, fov, orie);
     s.setState(stereo, hw_chan, chan_num, v, fov, orie);
   }
   }
 
 
-  if (chancfg_cat->is_debug()) {
+  if (chancfg_cat.is_debug()) {
     chancfg_cat->debug() << "parsed a setup called '" << sym << "':" << endl;
     chancfg_cat->debug() << "parsed a setup called '" << sym << "':" << endl;
     if (s.getRecurse()) {
     if (s.getRecurse()) {
       chancfg_cat->debug() << "  is a recursive setup" << endl;
       chancfg_cat->debug() << "  is a recursive setup" << endl;
@@ -129,61 +129,61 @@ void SetupParseFunctor::operator()(std::string S) {
       chancfg_cat->debug() << "  has " << q.size() << " sub-layouts" << endl;
       chancfg_cat->debug() << "  has " << q.size() << " sub-layouts" << endl;
       SetupSyms::iterator r;
       SetupSyms::iterator r;
       for (r=q.begin(); r!=q.end(); ++r)
       for (r=q.begin(); r!=q.end(); ++r)
-	chancfg_cat->debug() << "    sub-layout #" << (r-q.begin()) << ": '"
-			     << *r << "'" << endl;
+    chancfg_cat->debug() << "    sub-layout #" << (r-q.begin()) << ": '"
+                 << *r << "'" << endl;
       q = s.getSetups();
       q = s.getSetups();
       chancfg_cat->debug() << "  has " << q.size() << " sub-setups" << endl;
       chancfg_cat->debug() << "  has " << q.size() << " sub-setups" << endl;
       for (r=q.begin(); r!=q.end(); ++r)
       for (r=q.begin(); r!=q.end(); ++r)
-	chancfg_cat->debug() << "    sub-setups #" << (r-q.begin()) << ": '"
-			     << *r << "'" << endl;
+    chancfg_cat->debug() << "    sub-setups #" << (r-q.begin()) << ": '"
+                 << *r << "'" << endl;
     } else {
     } else {
       chancfg_cat->debug() << "  is not a recursive setup" << endl;
       chancfg_cat->debug() << "  is not a recursive setup" << endl;
       chancfg_cat->debug() << "  is" << (s.getStereo()?" ":" not ")
       chancfg_cat->debug() << "  is" << (s.getStereo()?" ":" not ")
-			   << "a stereo setup" << endl;
+               << "a stereo setup" << endl;
       chancfg_cat->debug() <<"   is" << (s.getHWChan()?" ":" not ")
       chancfg_cat->debug() <<"   is" << (s.getHWChan()?" ":" not ")
-			   << "a HW channel setup" << endl;
+               << "a HW channel setup" << endl;
       chancfg_cat->debug() << "  prefered HW channel number: " << s.getChan()
       chancfg_cat->debug() << "  prefered HW channel number: " << s.getChan()
-			   << endl;
+               << endl;
       ChanViewport qv(s.getViewport());
       ChanViewport qv(s.getViewport());
       chancfg_cat->debug() << "  sub viewport: (" << qv.left() << ", "
       chancfg_cat->debug() << "  sub viewport: (" << qv.left() << ", "
-			   << qv.right() << ", " << qv.bottom() << ", "
-			   << qv.top() << ")" << endl;
+               << qv.right() << ", " << qv.bottom() << ", "
+               << qv.top() << ")" << endl;
       SetupFOV qf(s.getFOV());
       SetupFOV qf(s.getFOV());
       switch (qf.getType()) {
       switch (qf.getType()) {
       case SetupFOV::Invalid:
       case SetupFOV::Invalid:
-	chancfg_cat->debug() << "  FOV is invalid" << endl;
-	break;
+    chancfg_cat->debug() << "  FOV is invalid" << endl;
+    break;
       case SetupFOV::Default:
       case SetupFOV::Default:
-	chancfg_cat->debug() << "  FOV takes defaults" << endl;
-	break;
+    chancfg_cat->debug() << "  FOV takes defaults" << endl;
+    break;
       case SetupFOV::Horizontal:
       case SetupFOV::Horizontal:
-	chancfg_cat->debug() << "  FOV specifies only horizontal: "
-			     << qf.getHoriz() << endl;
-	break;
+    chancfg_cat->debug() << "  FOV specifies only horizontal: "
+                 << qf.getHoriz() << endl;
+    break;
       case SetupFOV::Both:
       case SetupFOV::Both:
-	chancfg_cat->debug() << "  FOV: " << qf.getHoriz() << " x "
-			     << qf.getVert() << endl;
-	break;
+    chancfg_cat->debug() << "  FOV: " << qf.getHoriz() << " x "
+                 << qf.getVert() << endl;
+    break;
       default:
       default:
-	chancfg_cat->debug() << "  FOV is of an unknown type (" << qf.getType()
-			     << ")" << endl;
+    chancfg_cat->debug() << "  FOV is of an unknown type (" << qf.getType()
+                 << ")" << endl;
       }
       }
       switch (s.getOrientation()) {
       switch (s.getOrientation()) {
       case SetupItem::Up:
       case SetupItem::Up:
-	chancfg_cat->debug() << "  setup is oriented Up" << endl;
-	break;
+    chancfg_cat->debug() << "  setup is oriented Up" << endl;
+    break;
       case SetupItem::Down:
       case SetupItem::Down:
-	chancfg_cat->debug() << "  setup is oriented Down" << endl;
-	break;
+    chancfg_cat->debug() << "  setup is oriented Down" << endl;
+    break;
       case SetupItem::Left:
       case SetupItem::Left:
-	chancfg_cat->debug() << "  setup is oriented Left" << endl;
-	break;
+    chancfg_cat->debug() << "  setup is oriented Left" << endl;
+    break;
       case SetupItem::Right:
       case SetupItem::Right:
-	chancfg_cat->debug() << "  setup is oriented Right" << endl;
-	break;
+    chancfg_cat->debug() << "  setup is oriented Right" << endl;
+    break;
       default:
       default:
-	chancfg_cat->debug() << "  setup has an unknown orientation ("
-			     << s.getOrientation() << ")" << endl;
+    chancfg_cat->debug() << "  setup has an unknown orientation ("
+                 << s.getOrientation() << ")" << endl;
       }
       }
     }
     }
   }
   }

+ 8 - 8
panda/src/chancfg/chanwindow.cxx

@@ -67,22 +67,22 @@ void WindowParseFunctor::operator()(std::string S) {
   }
   }
 
 
   WindowItem W(hw_chans, dvr, hw_chan_offset, layout, sv, X, Y, border,
   WindowItem W(hw_chans, dvr, hw_chan_offset, layout, sv, X, Y, border,
-	       cursor);
+           cursor);
 
 
-  if (chancfg_cat->is_debug()) {
+  if (chancfg_cat.is_debug()) {
     chancfg_cat->debug() << "parsed a window called '" << sym << "':" << endl;
     chancfg_cat->debug() << "parsed a window called '" << sym << "':" << endl;
     chancfg_cat->debug() << "  do" << (W.getHWChans()?" ":" not ")
     chancfg_cat->debug() << "  do" << (W.getHWChans()?" ":" not ")
-			 << "use HW channels" << endl;
+             << "use HW channels" << endl;
     chancfg_cat->debug() << "  do" << (W.getDVR()?" ":" not ") << "use DVR"
     chancfg_cat->debug() << "  do" << (W.getDVR()?" ":" not ") << "use DVR"
-			 << endl;
+             << endl;
     chancfg_cat->debug() << "  do" << (W.getBorder()?" ":" not ")
     chancfg_cat->debug() << "  do" << (W.getBorder()?" ":" not ")
-			 << "have a border" << endl;
+             << "have a border" << endl;
     chancfg_cat->debug() << "  do" << (W.getCursor()?" ":" not ")
     chancfg_cat->debug() << "  do" << (W.getCursor()?" ":" not ")
-			 << "have a cursor" << endl;
+             << "have a cursor" << endl;
     chancfg_cat->debug() << "  HW channel offset: " << W.getChanOffset()
     chancfg_cat->debug() << "  HW channel offset: " << W.getChanOffset()
-			 << endl;
+             << endl;
     chancfg_cat->debug() << "  prefered window size: (" << W.getSizeX()
     chancfg_cat->debug() << "  prefered window size: (" << W.getSizeX()
-			 << ", " << W.getSizeY() << ")" << endl;
+             << ", " << W.getSizeY() << ")" << endl;
     chancfg_cat->debug() << "  layout: '" << W.getLayout() << "'" << endl;
     chancfg_cat->debug() << "  layout: '" << W.getLayout() << "'" << endl;
     chancfg_cat->debug() << "  setups:" << endl;
     chancfg_cat->debug() << "  setups:" << endl;
     SetupSyms q(W.getSetups());
     SetupSyms q(W.getSetups());

+ 9 - 9
panda/src/event/eventHandler.cxx

@@ -53,10 +53,10 @@ dispatch_event(const CPT_Event &event) {
 
 
     Functions::const_iterator fi;
     Functions::const_iterator fi;
     for (fi = copy_functions.begin(); fi != copy_functions.end(); ++fi) {
     for (fi = copy_functions.begin(); fi != copy_functions.end(); ++fi) {
-      if (event_cat->is_spam())
-	event_cat->spam() << "calling callback 0x" << (void*)(*fi)
-			  << " for event '" << event->get_name() << "'"
-			  << endl;
+      if (event_cat.is_spam())
+    event_cat->spam() << "calling callback 0x" << (void*)(*fi)
+              << " for event '" << event->get_name() << "'"
+              << endl;
       (*fi)(event);
       (*fi)(event);
     }
     }
   }
   }
@@ -131,9 +131,9 @@ write(ostream &out) const {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool EventHandler::
 bool EventHandler::
 add_hook(const string &event_name, EventFunction *function) {
 add_hook(const string &event_name, EventFunction *function) {
-  if (event_cat->is_debug())
-    event_cat->debug() << "adding hook for event '" << event_name
-		       << "' with function 0x" << (void*)function << endl;
+  if (event_cat.is_debug())
+    event_cat.debug() << "adding hook for event '" << event_name
+               << "' with function 0x" << (void*)function << endl;
   return _hooks[event_name].insert(function).second;
   return _hooks[event_name].insert(function).second;
 }
 }
 
 
@@ -150,7 +150,7 @@ add_hook(const string &event_name, EventFunction *function) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool EventHandler::
 bool EventHandler::
 add_hook(const string &event_name, EventCallbackFunction *function,
 add_hook(const string &event_name, EventCallbackFunction *function,
-	 void *data) {
+     void *data) {
   return _cbhooks[event_name].insert(CallbackFunction(function, data)).second;
   return _cbhooks[event_name].insert(CallbackFunction(function, data)).second;
 }
 }
 
 
@@ -178,7 +178,7 @@ remove_hook(const string &event_name, EventFunction *function) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool EventHandler::
 bool EventHandler::
 remove_hook(const string &event_name, EventCallbackFunction *function,
 remove_hook(const string &event_name, EventCallbackFunction *function,
-	    void *data) {
+        void *data) {
   return _cbhooks[event_name].erase(CallbackFunction(function, data)) != 0;
   return _cbhooks[event_name].erase(CallbackFunction(function, data)) != 0;
 }
 }
 
 

+ 31 - 31
panda/src/express/typeHandle.cxx

@@ -102,7 +102,7 @@ register_type(TypeHandle &type_handle, const string &name) {
     // The name was not already used; this is the first time this
     // The name was not already used; this is the first time this
     // class has been defined.
     // class has been defined.
 
 
-    if (express_cat->is_spam()) {
+    if (express_cat.is_spam()) {
       express_cat->spam() << "Registering type " << name << "\n";
       express_cat->spam() << "Registering type " << name << "\n";
     }
     }
     
     
@@ -119,7 +119,7 @@ register_type(TypeHandle &type_handle, const string &name) {
   RegistryNode *rnode = (*ri).second;
   RegistryNode *rnode = (*ri).second;
   nassertr(rnode->_name == (*ri).first, false);
   nassertr(rnode->_name == (*ri).first, false);
   nassertr(rnode->_handle._index >= 0 && 
   nassertr(rnode->_handle._index >= 0 && 
-	   rnode->_handle._index < (int)_handle_registry.size(), false);
+       rnode->_handle._index < (int)_handle_registry.size(), false);
   nassertr(_handle_registry[rnode->_handle._index] == rnode, false);
   nassertr(_handle_registry[rnode->_handle._index] == rnode, false);
   nassertr(rnode->_handle._index != 0, false);
   nassertr(rnode->_handle._index != 0, false);
 
 
@@ -175,7 +175,7 @@ register_dynamic_type(const string &name) {
     // The name was not already used; this is the first time this
     // The name was not already used; this is the first time this
     // class has been defined.
     // class has been defined.
 
 
-    if (express_cat->is_spam()) {
+    if (express_cat.is_spam()) {
       express_cat->spam() << "Registering type " << name << "\n";
       express_cat->spam() << "Registering type " << name << "\n";
     }
     }
     
     
@@ -216,7 +216,7 @@ record_derivation(TypeHandle child, TypeHandle parent) {
   // already made this connection.
   // already made this connection.
   RegistryNode::Classes::iterator ni;
   RegistryNode::Classes::iterator ni;
   ni = find(cnode->_parent_classes.begin(), cnode->_parent_classes.end(),
   ni = find(cnode->_parent_classes.begin(), cnode->_parent_classes.end(),
-	    pnode);
+        pnode);
 
 
   if (ni == cnode->_parent_classes.end()) {
   if (ni == cnode->_parent_classes.end()) {
     cnode->_parent_classes.push_back(pnode);
     cnode->_parent_classes.push_back(pnode);
@@ -241,8 +241,8 @@ record_alternate_name(TypeHandle type, const string &name) {
       _name_registry.insert(NameRegistry::value_type(name, rnode)).first;
       _name_registry.insert(NameRegistry::value_type(name, rnode)).first;
     if ((*ri).second != rnode) {
     if ((*ri).second != rnode) {
       express_cat.warning()
       express_cat.warning()
-	<< "Name " << name << " already assigned to TypeHandle "
-	<< rnode->_name << "; cannot reassign to " << type << "\n";
+    << "Name " << name << " already assigned to TypeHandle "
+    << rnode->_name << "; cannot reassign to " << type << "\n";
     }
     }
   }
   }
 }
 }
@@ -296,7 +296,7 @@ get_name(TypeHandle type, TypedObject *object) const {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool TypeRegistry::
 bool TypeRegistry::
 is_derived_from(TypeHandle child, TypeHandle parent,
 is_derived_from(TypeHandle child, TypeHandle parent,
-		TypedObject *child_object) const {
+        TypedObject *child_object) const {
   RegistryNode *rnode = look_up(child, child_object);
   RegistryNode *rnode = look_up(child, child_object);
   nassertr(rnode != (RegistryNode *)NULL, false);
   nassertr(rnode != (RegistryNode *)NULL, false);
   return rnode->is_derived_from(parent);
   return rnode->is_derived_from(parent);
@@ -363,7 +363,7 @@ get_parent_class(TypeHandle child, int index) const {
   RegistryNode *rnode = look_up(child, (TypedObject *)NULL);
   RegistryNode *rnode = look_up(child, (TypedObject *)NULL);
   nassertr(rnode != (RegistryNode *)NULL, TypeHandle::none());
   nassertr(rnode != (RegistryNode *)NULL, TypeHandle::none());
   nassertr(index >= 0 && index < (int)rnode->_parent_classes.size(),
   nassertr(index >= 0 && index < (int)rnode->_parent_classes.size(),
-	   TypeHandle::none());
+       TypeHandle::none());
   return rnode->_parent_classes[index]->_handle;
   return rnode->_parent_classes[index]->_handle;
 }
 }
 
 
@@ -398,7 +398,7 @@ get_child_class(TypeHandle child, int index) const {
   RegistryNode *rnode = look_up(child, (TypedObject *)NULL);
   RegistryNode *rnode = look_up(child, (TypedObject *)NULL);
   nassertr(rnode != (RegistryNode *)NULL, TypeHandle::none());
   nassertr(rnode != (RegistryNode *)NULL, TypeHandle::none());
   nassertr(index >= 0 && index < (int)rnode->_child_classes.size(),
   nassertr(index >= 0 && index < (int)rnode->_child_classes.size(),
-	   TypeHandle::none());
+       TypeHandle::none());
   return rnode->_child_classes[index]->_handle;
   return rnode->_child_classes[index]->_handle;
 }
 }
 
 
@@ -418,7 +418,7 @@ get_child_class(TypeHandle child, int index) const {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 TypeHandle TypeRegistry::
 TypeHandle TypeRegistry::
 get_parent_towards(TypeHandle child, TypeHandle ancestor,
 get_parent_towards(TypeHandle child, TypeHandle ancestor,
-		   TypedObject *child_object) const {
+           TypedObject *child_object) const {
   if (child_object != (TypedObject *)NULL) {
   if (child_object != (TypedObject *)NULL) {
     // First, guarantee that the ancestor type is defined.
     // First, guarantee that the ancestor type is defined.
     look_up(ancestor, child_object);
     look_up(ancestor, child_object);
@@ -450,7 +450,7 @@ reregister_types() {
     RegistryNode *rnode = (*ri);
     RegistryNode *rnode = (*ri);
     if (rnode != NULL && rnode->_handle != rnode->_ref) {
     if (rnode != NULL && rnode->_handle != rnode->_ref) {
       express_cat->warning()
       express_cat->warning()
-	<< "Reregistering " << rnode->_name << "\n";
+    << "Reregistering " << rnode->_name << "\n";
     }
     }
   }
   }
 }
 }
@@ -537,11 +537,11 @@ freshen_root_classes() {
 
 
     HandleRegistry::iterator hi;
     HandleRegistry::iterator hi;
     for (hi = _handle_registry.begin();
     for (hi = _handle_registry.begin();
-	 hi != _handle_registry.end();
-	 ++hi) {
+     hi != _handle_registry.end();
+     ++hi) {
       RegistryNode *root = *hi;
       RegistryNode *root = *hi;
       if (root != NULL && root->_parent_classes.empty()) {
       if (root != NULL && root->_parent_classes.empty()) {
-	_root_classes.push_back(root);
+    _root_classes.push_back(root);
       }
       }
     }
     }
     _root_classes_fresh = true;
     _root_classes_fresh = true;
@@ -593,32 +593,32 @@ look_up(TypeHandle handle, TypedObject *object) const {
       // Maybe we can use it to resolve the error.
       // Maybe we can use it to resolve the error.
       handle = object->force_init_type();
       handle = object->force_init_type();
       if (handle._index == 0) {
       if (handle._index == 0) {
-	// Strange.
-	express_cat->error()
-	  << "Unable to force_init_type() on unregistered TypeHandle.\n";
-	nassertr(false, NULL);
+    // Strange.
+    express_cat->error()
+      << "Unable to force_init_type() on unregistered TypeHandle.\n";
+    nassertr(false, NULL);
       }
       }
       if (handle == object->get_type()) {
       if (handle == object->get_type()) {
-	// Problem solved!
-	express_cat->warning()
-	  << "Type " << handle << " was unregistered!\n";
+    // Problem solved!
+    express_cat->warning()
+      << "Type " << handle << " was unregistered!\n";
       } else {
       } else {
-	// No good; it looks like the TypeHandle belongs to a class
-	// that defined get_type(), but didn't define
-	// force_init_type().
-	express_cat->error()
-	  << "Attempt to reference unregistered TypeHandle.  Type is of some\n"
-	  << "class derived from " << handle << " that doesn't define a good\n"
-	  << "force_init_type() method.\n";
-	nassertr(false, NULL);
+    // No good; it looks like the TypeHandle belongs to a class
+    // that defined get_type(), but didn't define
+    // force_init_type().
+    express_cat->error()
+      << "Attempt to reference unregistered TypeHandle.  Type is of some\n"
+      << "class derived from " << handle << " that doesn't define a good\n"
+      << "force_init_type() method.\n";
+    nassertr(false, NULL);
       }
       }
 
 
     } else {
     } else {
       // We don't have a TypedObject pointer, so there's nothing we
       // We don't have a TypedObject pointer, so there's nothing we
       // can do about it.
       // can do about it.
       express_cat->error()
       express_cat->error()
-	<< "Attempt to reference unregistered TypeHandle!\n"
-	<< "Registered TypeHandles are:\n";
+    << "Attempt to reference unregistered TypeHandle!\n"
+    << "Registered TypeHandles are:\n";
       write(express_cat->error(false));
       write(express_cat->error(false));
       nassertr(false, NULL);
       nassertr(false, NULL);
     }
     }

+ 13 - 13
panda/src/gobj/texture.cxx

@@ -90,7 +90,7 @@ consider_rescale(PNMImage &pnmimage, const string &name) {
       << new_x_size << " by " << new_y_size << "\n";
       << new_x_size << " by " << new_y_size << "\n";
 
 
     PNMImage scaled(new_x_size, new_y_size, pnmimage.get_num_channels(),
     PNMImage scaled(new_x_size, new_y_size, pnmimage.get_num_channels(),
-		    pnmimage.get_maxval(), pnmimage.get_type());
+            pnmimage.get_maxval(), pnmimage.get_type());
     scaled.quick_filter_from(pnmimage);
     scaled.quick_filter_from(pnmimage);
     pnmimage = scaled;
     pnmimage = scaled;
   }
   }
@@ -150,7 +150,7 @@ read(const string& name) {
 //     Function: read
 //     Function: read
 //       Access: Published
 //       Access: Published
 //  Description: Combine a 3-component image with a grayscale image
 //  Description: Combine a 3-component image with a grayscale image
-//		 to get a 4-component image
+//       to get a 4-component image
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool Texture::
 bool Texture::
 read(const string &name, const string &gray) {
 read(const string &name, const string &gray) {
@@ -180,8 +180,8 @@ read(const string &name, const string &gray) {
       << pnmimage.get_x_size() << " by " << pnmimage.get_y_size() << "\n";
       << pnmimage.get_x_size() << " by " << pnmimage.get_y_size() << "\n";
 
 
     PNMImage scaled(pnmimage.get_x_size(), pnmimage.get_y_size(), 
     PNMImage scaled(pnmimage.get_x_size(), pnmimage.get_y_size(), 
-		    grayimage.get_num_channels(),
-		    grayimage.get_maxval(), grayimage.get_type());
+            grayimage.get_num_channels(),
+            grayimage.get_maxval(), grayimage.get_type());
     scaled.quick_filter_from(grayimage);
     scaled.quick_filter_from(grayimage);
     grayimage = scaled;
     grayimage = scaled;
   }
   }
@@ -323,7 +323,7 @@ void Texture::copy(GraphicsStateGuardianBase *gsg, const DisplayRegion *dr) {
 }
 }
 
 
 void Texture::copy(GraphicsStateGuardianBase *gsg, const DisplayRegion *dr,
 void Texture::copy(GraphicsStateGuardianBase *gsg, const DisplayRegion *dr,
-			const RenderBuffer &rb) {
+            const RenderBuffer &rb) {
   gsg->copy_texture(prepare(gsg), dr, rb);
   gsg->copy_texture(prepare(gsg), dr, rb);
 }
 }
 
 
@@ -337,7 +337,7 @@ void Texture::draw(GraphicsStateGuardianBase *gsg, const DisplayRegion *dr) {
 }
 }
 
 
 void Texture::draw(GraphicsStateGuardianBase *gsg, const DisplayRegion *dr,
 void Texture::draw(GraphicsStateGuardianBase *gsg, const DisplayRegion *dr,
-			const RenderBuffer &rb) {
+            const RenderBuffer &rb) {
   gsg->draw_texture(prepare(gsg), dr, rb);
   gsg->draw_texture(prepare(gsg), dr, rb);
 }
 }
 
 
@@ -472,15 +472,15 @@ fillin(DatagramIterator &scan, BamReader *manager) {
       PixelBuffer::Format format = (PixelBuffer::Format)scan.get_uint8();
       PixelBuffer::Format format = (PixelBuffer::Format)scan.get_uint8();
       int num_components = -1;
       int num_components = -1;
       if (scan.get_remaining_size() > 0) {
       if (scan.get_remaining_size() > 0) {
-	num_components = scan.get_uint8();
+    num_components = scan.get_uint8();
       }
       }
 
 
       if (_pbuffer != (PixelBuffer *)NULL) {
       if (_pbuffer != (PixelBuffer *)NULL) {
-	if (num_components == _pbuffer->get_num_components()) {
-	  // Only reset the format if the number of components hasn't
-	  // changed.
-	  _pbuffer->set_format(format);
-	}
+    if (num_components == _pbuffer->get_num_components()) {
+      // Only reset the format if the number of components hasn't
+      // changed.
+      _pbuffer->set_format(format);
+    }
       }
       }
     }
     }
   }
   }
@@ -524,7 +524,7 @@ make_Texture(const FactoryParams &params)
     dummy->fillin(scan, manager);
     dummy->fillin(scan, manager);
 
 
   } else {
   } else {
-    if (gobj_cat->is_debug()) {
+    if (gobj_cat.is_debug()) {
       gobj_cat->debug() << "Created texture " << me->get_name() << endl;
       gobj_cat->debug() << "Created texture " << me->get_name() << endl;
     }
     }
     me->fillin(scan, manager);
     me->fillin(scan, manager);

+ 117 - 117
panda/src/gui/guiButton.cxx

@@ -25,7 +25,7 @@ find_in_buttons_map(const MouseWatcherRegion* rgn) {
 }
 }
 
 
 inline void GetExtents(GuiLabel* v, GuiLabel* w, GuiLabel* x, GuiLabel* y,
 inline void GetExtents(GuiLabel* v, GuiLabel* w, GuiLabel* x, GuiLabel* y,
-		       GuiLabel* z, float& l, float& r, float& b, float& t) {
+               GuiLabel* z, float& l, float& r, float& b, float& t) {
   float l1, l2, r1, r2, b1, b2, t1, t2;
   float l1, l2, r1, r2, b1, b2, t1, t2;
   v->get_extents(l1, r1, b1, t1);
   v->get_extents(l1, r1, b1, t1);
   w->get_extents(l2, r2, b2, t2);
   w->get_extents(l2, r2, b2, t2);
@@ -57,15 +57,15 @@ inline void GetExtents(GuiLabel* v, GuiLabel* w, GuiLabel* x, GuiLabel* y,
 }
 }
 
 
 inline void my_throw(GuiManager* mgr, const string& name,
 inline void my_throw(GuiManager* mgr, const string& name,
-		     const EventParameter& p) {
+             const EventParameter& p) {
   throw_event(name, p);
   throw_event(name, p);
   if (mgr != (GuiManager*)0L)
   if (mgr != (GuiManager*)0L)
     throw_event_directly(*(mgr->get_private_handler()), name, p);
     throw_event_directly(*(mgr->get_private_handler()), name, p);
 }
 }
 
 
 inline void my_throw(GuiManager* mgr, const string& name,
 inline void my_throw(GuiManager* mgr, const string& name,
-		     const EventParameter& p1,
-		     const EventParameter& p2) {
+             const EventParameter& p1,
+             const EventParameter& p2) {
   throw_event(name, p1, p2);
   throw_event(name, p1, p2);
   if (mgr != (GuiManager*)0L)
   if (mgr != (GuiManager*)0L)
     throw_event_directly(*(mgr->get_private_handler()), name, p1, p2);
     throw_event_directly(*(mgr->get_private_handler()), name, p1, p2);
@@ -144,16 +144,16 @@ void GuiButton::switch_state(GuiButton::States nstate) {
   case INACTIVE:
   case INACTIVE:
     if (_inactive != (GuiLabel*)0L)
     if (_inactive != (GuiLabel*)0L)
       if (_mgr->has_label(_inactive))
       if (_mgr->has_label(_inactive))
-	_mgr->remove_label(_inactive);
+    _mgr->remove_label(_inactive);
     break;
     break;
   case INACTIVE_ROLLOVER:
   case INACTIVE_ROLLOVER:
     if (_inactive != (GuiLabel*)0L)
     if (_inactive != (GuiLabel*)0L)
       if (_mgr->has_label(_inactive))
       if (_mgr->has_label(_inactive))
-	_mgr->remove_label(_inactive);
+    _mgr->remove_label(_inactive);
     break;
     break;
   default:
   default:
     gui_cat->warning() << "switching away from invalid state (" << (int)_state
     gui_cat->warning() << "switching away from invalid state (" << (int)_state
-		       << ")" << endl;
+               << ")" << endl;
   }
   }
   _state = nstate;
   _state = nstate;
   const EventParameter paramthis = EventParameter(this);
   const EventParameter paramthis = EventParameter(this);
@@ -169,20 +169,20 @@ void GuiButton::switch_state(GuiButton::States nstate) {
       _mgr->add_region(_rgn);
       _mgr->add_region(_rgn);
     if (_alt_root.is_null()) {
     if (_alt_root.is_null()) {
       if (!(_mgr->has_label(_up)))
       if (!(_mgr->has_label(_up)))
-	_mgr->add_label(_up);
+    _mgr->add_label(_up);
     } else {
     } else {
       if (!(_mgr->has_label(_up)))
       if (!(_mgr->has_label(_up)))
-	_mgr->add_label(_up, _alt_root);
+    _mgr->add_label(_up, _alt_root);
     }
     }
     if (!_up_event.empty()) {
     if (!_up_event.empty()) {
 #ifdef _DEBUG
 #ifdef _DEBUG
-      if (gui_cat->is_debug())
-	gui_cat->debug() << "throwing _up_event '" << _up_event << "'" << endl;
+      if (gui_cat.is_debug())
+    gui_cat->debug() << "throwing _up_event '" << _up_event << "'" << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
       my_throw(_mgr, _up_event, paramthis);
       my_throw(_mgr, _up_event, paramthis);
 #ifdef _DEBUG
 #ifdef _DEBUG
-    } else if (gui_cat->is_debug())
-	gui_cat->debug() << "_up_event is empty!" << endl;
+    } else if (gui_cat.is_debug())
+    gui_cat->debug() << "_up_event is empty!" << endl;
 #else /* _DEBUG */
 #else /* _DEBUG */
     }
     }
 #endif /* _DEBUG */
 #endif /* _DEBUG */
@@ -193,43 +193,43 @@ void GuiButton::switch_state(GuiButton::States nstate) {
       _mgr->add_region(_rgn);
       _mgr->add_region(_rgn);
     if (_up_rollover != (GuiLabel*)0L) {
     if (_up_rollover != (GuiLabel*)0L) {
       if (_alt_root.is_null()) {
       if (_alt_root.is_null()) {
-	if (!(_mgr->has_label(_up_rollover)))
-	  _mgr->add_label(_up_rollover);
+    if (!(_mgr->has_label(_up_rollover)))
+      _mgr->add_label(_up_rollover);
       } else {
       } else {
-	if (!(_mgr->has_label(_up_rollover)))
-	  _mgr->add_label(_up_rollover, _alt_root);
+    if (!(_mgr->has_label(_up_rollover)))
+      _mgr->add_label(_up_rollover, _alt_root);
       }
       }
       if (!_up_rollover_event.empty()) {
       if (!_up_rollover_event.empty()) {
 #ifdef _DEBUG
 #ifdef _DEBUG
-	if (gui_cat->is_debug())
-	  gui_cat->debug() << "throwing _up_rollover_event '"
-			   << _up_rollover_event << "'" << endl;
+    if (gui_cat.is_debug())
+      gui_cat->debug() << "throwing _up_rollover_event '"
+               << _up_rollover_event << "'" << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
-	my_throw(_mgr, _up_rollover_event, paramthis);
+    my_throw(_mgr, _up_rollover_event, paramthis);
 #ifdef _DEBUG
 #ifdef _DEBUG
-      } else if (gui_cat->is_debug())
-	  gui_cat->debug() << "_up_rollover_event is empty!" << endl;
+      } else if (gui_cat.is_debug())
+      gui_cat->debug() << "_up_rollover_event is empty!" << endl;
 #else /* _DEBUG */
 #else /* _DEBUG */
       }
       }
 #endif /* _DEBUG */
 #endif /* _DEBUG */
     } else {
     } else {
       if (_alt_root.is_null()) {
       if (_alt_root.is_null()) {
-	if (!(_mgr->has_label(_up)))
-	  _mgr->add_label(_up);
+    if (!(_mgr->has_label(_up)))
+      _mgr->add_label(_up);
       } else {
       } else {
-	if (!(_mgr->has_label(_up)))
-	  _mgr->add_label(_up, _alt_root);
+    if (!(_mgr->has_label(_up)))
+      _mgr->add_label(_up, _alt_root);
       }
       }
       if (!_up_event.empty()) {
       if (!_up_event.empty()) {
 #ifdef _DEBUG
 #ifdef _DEBUG
-	if (gui_cat->is_debug())
-	  gui_cat->debug() << "throwing _up_event '" << _up_event << "'"
-			   << endl;
+    if (gui_cat.is_debug())
+      gui_cat->debug() << "throwing _up_event '" << _up_event << "'"
+               << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
-	my_throw(_mgr, _up_event, paramthis);
+    my_throw(_mgr, _up_event, paramthis);
 #ifdef _DEBUG
 #ifdef _DEBUG
-      } else if (gui_cat->is_debug())
-	gui_cat->debug() << "_up_event is empty!" << endl;
+      } else if (gui_cat.is_debug())
+    gui_cat->debug() << "_up_event is empty!" << endl;
 #else /* _DEBUG */
 #else /* _DEBUG */
       }
       }
 #endif /* _DEBUG */
 #endif /* _DEBUG */
@@ -237,7 +237,7 @@ void GuiButton::switch_state(GuiButton::States nstate) {
     }
     }
     _rgn->set_suppress_below(true);
     _rgn->set_suppress_below(true);
     if ((ostate == UP) &&
     if ((ostate == UP) &&
-	(_rollover_functor != (GuiBehavior::BehaviorFunctor*)0L))
+    (_rollover_functor != (GuiBehavior::BehaviorFunctor*)0L))
       _rollover_functor->doit(this);
       _rollover_functor->doit(this);
     break;
     break;
   case DOWN:
   case DOWN:
@@ -245,20 +245,20 @@ void GuiButton::switch_state(GuiButton::States nstate) {
       _mgr->add_region(_rgn);
       _mgr->add_region(_rgn);
     if (_alt_root.is_null()) {
     if (_alt_root.is_null()) {
       if (!(_mgr->has_label(_down)))
       if (!(_mgr->has_label(_down)))
-	_mgr->add_label(_down);
+    _mgr->add_label(_down);
     } else {
     } else {
       if (!(_mgr->has_label(_down)))
       if (!(_mgr->has_label(_down)))
-	_mgr->add_label(_down, _alt_root);
+    _mgr->add_label(_down, _alt_root);
     }
     }
     if (!_down_event.empty()) {
     if (!_down_event.empty()) {
 #ifdef _DEBUG
 #ifdef _DEBUG
-      if (gui_cat->is_debug())
-	gui_cat->debug() << "throwing _down_event '" << _down_event << "'"
-			 << endl;
+      if (gui_cat.is_debug())
+    gui_cat->debug() << "throwing _down_event '" << _down_event << "'"
+             << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
       my_throw(_mgr, _down_event, paramthis);
       my_throw(_mgr, _down_event, paramthis);
 #ifdef _DEBUG
 #ifdef _DEBUG
-    } else if (gui_cat->is_debug())
+    } else if (gui_cat.is_debug())
       gui_cat->debug() << "_down_event is empty!" << endl;
       gui_cat->debug() << "_down_event is empty!" << endl;
 #else /* _DEBUG */
 #else /* _DEBUG */
     }
     }
@@ -270,43 +270,43 @@ void GuiButton::switch_state(GuiButton::States nstate) {
       _mgr->add_region(_rgn);
       _mgr->add_region(_rgn);
     if (_down_rollover != (GuiLabel*)0L) {
     if (_down_rollover != (GuiLabel*)0L) {
       if (_alt_root.is_null()) {
       if (_alt_root.is_null()) {
-	if (!(_mgr->has_label(_down_rollover)))
-	  _mgr->add_label(_down_rollover);
+    if (!(_mgr->has_label(_down_rollover)))
+      _mgr->add_label(_down_rollover);
       } else {
       } else {
-	if (!(_mgr->has_label(_down_rollover)))
-	  _mgr->add_label(_down_rollover, _alt_root);
+    if (!(_mgr->has_label(_down_rollover)))
+      _mgr->add_label(_down_rollover, _alt_root);
       }
       }
       if (!_down_rollover_event.empty()) {
       if (!_down_rollover_event.empty()) {
 #ifdef _DEBUG
 #ifdef _DEBUG
-	if (gui_cat->is_debug())
-	  gui_cat->debug() << "throwing _down_rollover_event '"
-			   << _down_rollover_event << "'" << endl;
+    if (gui_cat.is_debug())
+      gui_cat->debug() << "throwing _down_rollover_event '"
+               << _down_rollover_event << "'" << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
-	my_throw(_mgr, _down_rollover_event, paramthis);
+    my_throw(_mgr, _down_rollover_event, paramthis);
 #ifdef _DEBUG
 #ifdef _DEBUG
-      } else if (gui_cat->is_debug())
-	gui_cat->debug() << "_down_rollover_event is empty!" << endl;
+      } else if (gui_cat.is_debug())
+    gui_cat->debug() << "_down_rollover_event is empty!" << endl;
 #else /* _DEBUG */
 #else /* _DEBUG */
       }
       }
 #endif /* _DEBUG */
 #endif /* _DEBUG */
     } else {
     } else {
       if (_alt_root.is_null()) {
       if (_alt_root.is_null()) {
-	if (!(_mgr->has_label(_down)))
-	  _mgr->add_label(_down);
+    if (!(_mgr->has_label(_down)))
+      _mgr->add_label(_down);
       } else {
       } else {
-	if (!(_mgr->has_label(_down)))
-	  _mgr->add_label(_down, _alt_root);
+    if (!(_mgr->has_label(_down)))
+      _mgr->add_label(_down, _alt_root);
       }
       }
       if (!_down_event.empty()) {
       if (!_down_event.empty()) {
 #ifdef _DEBUG
 #ifdef _DEBUG
-	if (gui_cat->is_debug())
-	  gui_cat->debug() << "throwing _down_event '" << _down_event << "'"
-			   << endl;
+    if (gui_cat.is_debug())
+      gui_cat->debug() << "throwing _down_event '" << _down_event << "'"
+               << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
-	my_throw(_mgr, _down_event, paramthis);
+    my_throw(_mgr, _down_event, paramthis);
 #ifdef _DEBUG
 #ifdef _DEBUG
-      } else if (gui_cat->is_debug())
-	gui_cat->debug() << "_down_event is empty!" << endl;
+      } else if (gui_cat.is_debug())
+    gui_cat->debug() << "_down_event is empty!" << endl;
 #else /* _DEBUG */
 #else /* _DEBUG */
       }
       }
 #endif /* _DEBUG */
 #endif /* _DEBUG */
@@ -319,19 +319,19 @@ void GuiButton::switch_state(GuiButton::States nstate) {
       _mgr->remove_region(_rgn);
       _mgr->remove_region(_rgn);
     if (_inactive != (GuiLabel*)0L) {
     if (_inactive != (GuiLabel*)0L) {
       if (_alt_root.is_null()) {
       if (_alt_root.is_null()) {
-	if (!(_mgr->has_label(_inactive)))
-	  _mgr->add_label(_inactive);
+    if (!(_mgr->has_label(_inactive)))
+      _mgr->add_label(_inactive);
       } else {
       } else {
-	if (!(_mgr->has_label(_inactive)))
-	  _mgr->add_label(_inactive, _alt_root);
+    if (!(_mgr->has_label(_inactive)))
+      _mgr->add_label(_inactive, _alt_root);
       }
       }
       if (!_inactive_event.empty()) {
       if (!_inactive_event.empty()) {
 #ifdef _DEBUG
 #ifdef _DEBUG
-	if (gui_cat->is_debug())
-	  gui_cat->debug() << "throwing _inactive_event '" << _inactive_event
-			   << "'" << endl;
+    if (gui_cat.is_debug())
+      gui_cat->debug() << "throwing _inactive_event '" << _inactive_event
+               << "'" << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
-	my_throw(_mgr, _inactive_event, paramthis);
+    my_throw(_mgr, _inactive_event, paramthis);
       }
       }
     }
     }
     _rgn->set_suppress_below(false);
     _rgn->set_suppress_below(false);
@@ -341,26 +341,26 @@ void GuiButton::switch_state(GuiButton::States nstate) {
       _mgr->remove_region(_rgn);
       _mgr->remove_region(_rgn);
     if (_inactive != (GuiLabel*)0L) {
     if (_inactive != (GuiLabel*)0L) {
       if (_alt_root.is_null()) {
       if (_alt_root.is_null()) {
-	if (!(_mgr->has_label(_inactive)))
-	  _mgr->add_label(_inactive);
+    if (!(_mgr->has_label(_inactive)))
+      _mgr->add_label(_inactive);
       } else {
       } else {
-	if (!(_mgr->has_label(_inactive)))
-	  _mgr->add_label(_inactive, _alt_root);
+    if (!(_mgr->has_label(_inactive)))
+      _mgr->add_label(_inactive, _alt_root);
       }
       }
       if (!_inactive_event.empty()) {
       if (!_inactive_event.empty()) {
 #ifdef _DEBUG
 #ifdef _DEBUG
-	if (gui_cat->is_debug())
-	  gui_cat->debug() << "throwing _inactive_event '" << _inactive_event
-			   << "'" << endl;
+    if (gui_cat.is_debug())
+      gui_cat->debug() << "throwing _inactive_event '" << _inactive_event
+               << "'" << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
-	my_throw(_mgr, _inactive_event, paramthis);
+    my_throw(_mgr, _inactive_event, paramthis);
       }
       }
     }
     }
     _rgn->set_suppress_below(false);
     _rgn->set_suppress_below(false);
     break;
     break;
   default:
   default:
     gui_cat->warning() << "switched to invalid state (" << (int)_state << ")"
     gui_cat->warning() << "switched to invalid state (" << (int)_state << ")"
-		       << endl;
+               << endl;
   }
   }
   if (_state != NONE)
   if (_state != NONE)
     _mgr->recompute_priorities();
     _mgr->recompute_priorities();
@@ -381,7 +381,7 @@ void GuiButton::recompute_frame(void) {
 
 
 void GuiButton::adjust_region(void) {
 void GuiButton::adjust_region(void) {
   GetExtents(_up, _down, _up_rollover, _down_rollover, _inactive, _left,
   GetExtents(_up, _down, _up_rollover, _down_rollover, _inactive, _left,
-	     _right, _bottom, _top);
+         _right, _bottom, _top);
   GuiBehavior::adjust_region();
   GuiBehavior::adjust_region();
   _rgn->set_frame(_left, _right, _bottom, _top);
   _rgn->set_frame(_left, _right, _bottom, _top);
 }
 }
@@ -391,20 +391,20 @@ void GuiButton::set_priority(GuiLabel* l, GuiItem::Priority p) {
   _down->set_priority(l, ((p==P_Low)?GuiLabel::P_LOWER:GuiLabel::P_HIGHER));
   _down->set_priority(l, ((p==P_Low)?GuiLabel::P_LOWER:GuiLabel::P_HIGHER));
   if (_up_rollover != (GuiLabel*)0L)
   if (_up_rollover != (GuiLabel*)0L)
     _up_rollover->set_priority(l, ((p==P_Low)?GuiLabel::P_LOWER:
     _up_rollover->set_priority(l, ((p==P_Low)?GuiLabel::P_LOWER:
-				   GuiLabel::P_HIGHER));
+                   GuiLabel::P_HIGHER));
   if (_down_rollover != (GuiLabel*)0L)
   if (_down_rollover != (GuiLabel*)0L)
     _down_rollover->set_priority(l, ((p==P_Low)?GuiLabel::P_LOWER:
     _down_rollover->set_priority(l, ((p==P_Low)?GuiLabel::P_LOWER:
-				     GuiLabel::P_HIGHER));
+                     GuiLabel::P_HIGHER));
   if (_inactive != (GuiLabel*)0L)
   if (_inactive != (GuiLabel*)0L)
     _inactive->set_priority(l, ((p==P_Low)?GuiLabel::P_LOWER:
     _inactive->set_priority(l, ((p==P_Low)?GuiLabel::P_LOWER:
-				GuiLabel::P_HIGHER));
+                GuiLabel::P_HIGHER));
   GuiItem::set_priority(l, p);
   GuiItem::set_priority(l, p);
 }
 }
 
 
 void GuiButton::behavior_up(CPT_Event e) {
 void GuiButton::behavior_up(CPT_Event e) {
   const GuiButton* button = DCAST(GuiButton, e->get_parameter(0).get_ptr());
   const GuiButton* button = DCAST(GuiButton, e->get_parameter(0).get_ptr());
 #ifdef _DEBUG
 #ifdef _DEBUG
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug() << "behavior_up (0x" << (void*)button << ")" << endl;
     gui_cat->debug() << "behavior_up (0x" << (void*)button << ")" << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
   button->run_button_up();
   button->run_button_up();
@@ -413,7 +413,7 @@ void GuiButton::behavior_up(CPT_Event e) {
 void GuiButton::behavior_down(CPT_Event e) {
 void GuiButton::behavior_down(CPT_Event e) {
   const GuiButton* button = DCAST(GuiButton, e->get_parameter(0).get_ptr());
   const GuiButton* button = DCAST(GuiButton, e->get_parameter(0).get_ptr());
 #ifdef _DEBUG
 #ifdef _DEBUG
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug() << "behavior_down (0x" << (void*)button << ")" << endl;
     gui_cat->debug() << "behavior_down (0x" << (void*)button << ")" << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
   button->run_button_down();
   button->run_button_down();
@@ -421,14 +421,14 @@ void GuiButton::behavior_down(CPT_Event e) {
 
 
 void GuiButton::run_button_up(void) const {
 void GuiButton::run_button_up(void) const {
 #ifdef _DEBUG
 #ifdef _DEBUG
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug() << "run_button_up (0x" << (void*)this << " '"
     gui_cat->debug() << "run_button_up (0x" << (void*)this << " '"
-		     << this->get_name() << "')" << endl;
+             << this->get_name() << "')" << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
   if ((_eh == (EventHandler*)0L) || (!(this->_behavior_running)))
   if ((_eh == (EventHandler*)0L) || (!(this->_behavior_running)))
     return;
     return;
 #ifdef _DEBUG
 #ifdef _DEBUG
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug() << "doing work" << endl;
     gui_cat->debug() << "doing work" << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
   _mgr->get_private_handler()->remove_hook(_up_event, GuiButton::behavior_up);
   _mgr->get_private_handler()->remove_hook(_up_event, GuiButton::behavior_up);
@@ -438,18 +438,18 @@ void GuiButton::run_button_up(void) const {
   if (!_behavior_event.empty()) {
   if (!_behavior_event.empty()) {
     if (_have_event_param) {
     if (_have_event_param) {
 #ifdef _DEBUG
 #ifdef _DEBUG
-      if (gui_cat->is_debug())
-	gui_cat->debug() << "throwing behavior event '" << _behavior_event
-			 << "' with parameter (" << _event_param << ")"
-			 << endl;
+      if (gui_cat.is_debug())
+    gui_cat->debug() << "throwing behavior event '" << _behavior_event
+             << "' with parameter (" << _event_param << ")"
+             << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
       const EventParameter paramparam = EventParameter(_event_param);
       const EventParameter paramparam = EventParameter(_event_param);
       my_throw(_mgr, _behavior_event, paramthis, paramparam);
       my_throw(_mgr, _behavior_event, paramthis, paramparam);
     } else {
     } else {
 #ifdef _DEBUG
 #ifdef _DEBUG
-      if (gui_cat->is_debug())
-	gui_cat->debug() << "throwing behavior event '" << _behavior_event
-			 << "'" << endl;
+      if (gui_cat.is_debug())
+    gui_cat->debug() << "throwing behavior event '" << _behavior_event
+             << "'" << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
       my_throw(_mgr, _behavior_event, paramthis);
       my_throw(_mgr, _behavior_event, paramthis);
     }
     }
@@ -460,16 +460,16 @@ void GuiButton::run_button_up(void) const {
 
 
 void GuiButton::run_button_down(void) const {
 void GuiButton::run_button_down(void) const {
 #ifdef _DEBUG
 #ifdef _DEBUG
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug() << "run_button_down (0x" << (void*)this << " '"
     gui_cat->debug() << "run_button_down (0x" << (void*)this << " '"
-		     << this->get_name() << "')" << endl;
+             << this->get_name() << "')" << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
   if ((_eh == (EventHandler*)0L) || (!(this->_behavior_running)))
   if ((_eh == (EventHandler*)0L) || (!(this->_behavior_running)))
     return;
     return;
 #ifdef _DEBUG
 #ifdef _DEBUG
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug() << "doing work, up_event is '" << _up_event << "' '"
     gui_cat->debug() << "doing work, up_event is '" << _up_event << "' '"
-		     << _up_rollover_event << "'" << endl;
+             << _up_rollover_event << "'" << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
   _mgr->get_private_handler()->add_hook(_up_event, GuiButton::behavior_up);
   _mgr->get_private_handler()->add_hook(_up_event, GuiButton::behavior_up);
   _mgr->get_private_handler()->add_hook(_up_rollover_event,
   _mgr->get_private_handler()->add_hook(_up_rollover_event,
@@ -487,15 +487,15 @@ GuiButton::GuiButton(const string& name, GuiLabel* up, GuiLabel* down)
     _behavior_functor((GuiBehavior::BehaviorFunctor*)0L),
     _behavior_functor((GuiBehavior::BehaviorFunctor*)0L),
     _rollover_functor((GuiBehavior::BehaviorFunctor*)0L) {
     _rollover_functor((GuiBehavior::BehaviorFunctor*)0L) {
   GetExtents(up, down, _up_rollover, _down_rollover, _inactive, _left, _right,
   GetExtents(up, down, _up_rollover, _down_rollover, _inactive, _left, _right,
-	     _bottom, _top);
+         _bottom, _top);
   _rgn = new MouseWatcherRegion("button-" + name, _left, _right, _bottom,
   _rgn = new MouseWatcherRegion("button-" + name, _left, _right, _bottom,
-				_top);
+                _top);
   _rgn->set_suppress_below(true);
   _rgn->set_suppress_below(true);
   buttons[this->_rgn.p()] = this;
   buttons[this->_rgn.p()] = this;
 }
 }
 
 
 GuiButton::GuiButton(const string& name, GuiLabel* up, GuiLabel* down,
 GuiButton::GuiButton(const string& name, GuiLabel* up, GuiLabel* down,
-		     GuiLabel* inactive)
+             GuiLabel* inactive)
   : GuiBehavior(name), _up(up), _up_rollover((GuiLabel*)0L), _down(down),
   : GuiBehavior(name), _up(up), _up_rollover((GuiLabel*)0L), _down(down),
     _down_rollover((GuiLabel*)0L), _inactive(inactive),
     _down_rollover((GuiLabel*)0L), _inactive(inactive),
     _up_event("GuiButton-up"), _up_rollover_event(""),
     _up_event("GuiButton-up"), _up_rollover_event(""),
@@ -507,15 +507,15 @@ GuiButton::GuiButton(const string& name, GuiLabel* up, GuiLabel* down,
     _behavior_functor((GuiBehavior::BehaviorFunctor*)0L),
     _behavior_functor((GuiBehavior::BehaviorFunctor*)0L),
     _rollover_functor((GuiBehavior::BehaviorFunctor*)0L) {
     _rollover_functor((GuiBehavior::BehaviorFunctor*)0L) {
   GetExtents(up, down, _up_rollover, _down_rollover, inactive, _left, _right,
   GetExtents(up, down, _up_rollover, _down_rollover, inactive, _left, _right,
-	     _bottom, _top);
+         _bottom, _top);
   _rgn = new MouseWatcherRegion("button-" + name, _left, _right, _bottom,
   _rgn = new MouseWatcherRegion("button-" + name, _left, _right, _bottom,
-				_top);
+                _top);
   _rgn->set_suppress_below(true);
   _rgn->set_suppress_below(true);
   buttons[this->_rgn.p()] = this;
   buttons[this->_rgn.p()] = this;
 }
 }
 
 
 GuiButton::GuiButton(const string& name, GuiLabel* up, GuiLabel* up_roll,
 GuiButton::GuiButton(const string& name, GuiLabel* up, GuiLabel* up_roll,
-		     GuiLabel* down, GuiLabel* down_roll, GuiLabel* inactive)
+             GuiLabel* down, GuiLabel* down_roll, GuiLabel* inactive)
   : GuiBehavior(name), _up(up), _up_rollover(up_roll), _down(down),
   : GuiBehavior(name), _up(up), _up_rollover(up_roll), _down(down),
     _down_rollover(down_roll), _inactive(inactive), _up_event("GuiButton-up"),
     _down_rollover(down_roll), _inactive(inactive), _up_event("GuiButton-up"),
     _up_rollover_event("GuiButton-up-rollover"), _down_event("GuiButton-down"),
     _up_rollover_event("GuiButton-up-rollover"), _down_event("GuiButton-down"),
@@ -528,9 +528,9 @@ GuiButton::GuiButton(const string& name, GuiLabel* up, GuiLabel* up_roll,
     _behavior_functor((GuiBehavior::BehaviorFunctor*)0L),
     _behavior_functor((GuiBehavior::BehaviorFunctor*)0L),
     _rollover_functor((GuiBehavior::BehaviorFunctor*)0L) {
     _rollover_functor((GuiBehavior::BehaviorFunctor*)0L) {
   GetExtents(up, down, up_roll, down_roll, inactive, _left, _right, _bottom,
   GetExtents(up, down, up_roll, down_roll, inactive, _left, _right, _bottom,
-	     _top);
+         _top);
   _rgn = new MouseWatcherRegion("button-" + name, _left, _right, _bottom,
   _rgn = new MouseWatcherRegion("button-" + name, _left, _right, _bottom,
-				_top);
+                _top);
   _rgn->set_suppress_below(true);
   _rgn->set_suppress_below(true);
   buttons[this->_rgn.p()] = this;
   buttons[this->_rgn.p()] = this;
 }
 }
@@ -541,7 +541,7 @@ GuiButton::~GuiButton(void) {
   // Remove the names from the buttons map, so we don't end up with
   // Remove the names from the buttons map, so we don't end up with
   // an invalid pointer.
   // an invalid pointer.
   buttons.erase(this->_rgn.p());
   buttons.erase(this->_rgn.p());
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug() << "erased from button map" << endl;
     gui_cat->debug() << "erased from button map" << endl;
   if ((buttons.size() == 0) && added_hooks) {
   if ((buttons.size() == 0) && added_hooks) {
     /*
     /*
@@ -555,11 +555,11 @@ GuiButton::~GuiButton(void) {
 
 
   if (_behavior_functor != (GuiBehavior::BehaviorFunctor*)0L)
   if (_behavior_functor != (GuiBehavior::BehaviorFunctor*)0L)
     _behavior_functor.clear();
     _behavior_functor.clear();
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug() << "cleared behavior functor" << endl;
     gui_cat->debug() << "cleared behavior functor" << endl;
   if (_rollover_functor != (GuiBehavior::BehaviorFunctor*)0L)
   if (_rollover_functor != (GuiBehavior::BehaviorFunctor*)0L)
     _rollover_functor.clear();
     _rollover_functor.clear();
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug() << "cleared rollover functor" << endl;
     gui_cat->debug() << "cleared rollover functor" << endl;
 }
 }
 
 
@@ -580,7 +580,7 @@ void GuiButton::manage(GuiManager* mgr, EventHandler& eh) {
     switch_state(UP);
     switch_state(UP);
   } else
   } else
     gui_cat->warning() << "tried to manage button (0x" << (void*)this
     gui_cat->warning() << "tried to manage button (0x" << (void*)this
-		       << ") that is already managed" << endl;
+               << ") that is already managed" << endl;
 }
 }
 
 
 void GuiButton::manage(GuiManager* mgr, EventHandler& eh, Node* n) {
 void GuiButton::manage(GuiManager* mgr, EventHandler& eh, Node* n) {
@@ -600,25 +600,25 @@ void GuiButton::manage(GuiManager* mgr, EventHandler& eh, Node* n) {
     switch_state(UP);
     switch_state(UP);
   } else
   } else
     gui_cat->warning() << "tried to manage button (0x" << (void*)this
     gui_cat->warning() << "tried to manage button (0x" << (void*)this
-		       << ") that is already managed" << endl;
+               << ") that is already managed" << endl;
 }
 }
 
 
 void GuiButton::unmanage(void) {
 void GuiButton::unmanage(void) {
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug() << "in GuiButton::unmanage(0x" << (void*)this << ")"
     gui_cat->debug() << "in GuiButton::unmanage(0x" << (void*)this << ")"
                      << endl;
                      << endl;
   if (_mgr != (GuiManager*)0L)
   if (_mgr != (GuiManager*)0L)
     if (_mgr->has_region(_rgn)) {
     if (_mgr->has_region(_rgn)) {
       _mgr->remove_region(_rgn);
       _mgr->remove_region(_rgn);
-      if (gui_cat->is_debug())
-	gui_cat->debug() << "removed region" << endl;
+      if (gui_cat.is_debug())
+    gui_cat->debug() << "removed region" << endl;
     }
     }
   if (_behavior_running) {
   if (_behavior_running) {
     this->stop_behavior();
     this->stop_behavior();
-    if (gui_cat->is_debug())
+    if (gui_cat.is_debug())
       gui_cat->debug() << "behavior stopped" << endl;
       gui_cat->debug() << "behavior stopped" << endl;
   }
   }
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug() << "switching state to NONE" << endl;
     gui_cat->debug() << "switching state to NONE" << endl;
   _state = NONE;
   _state = NONE;
   if (_mgr != (GuiManager*)0L) {
   if (_mgr != (GuiManager*)0L) {
@@ -633,10 +633,10 @@ void GuiButton::unmanage(void) {
     if (_mgr->has_label(_inactive))
     if (_mgr->has_label(_inactive))
       _mgr->remove_label(_inactive);
       _mgr->remove_label(_inactive);
   }
   }
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug() << "back from switching state to NONE" << endl;
     gui_cat->debug() << "back from switching state to NONE" << endl;
   GuiBehavior::unmanage();
   GuiBehavior::unmanage();
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug() << "back from parent unmanage" << endl;
     gui_cat->debug() << "back from parent unmanage" << endl;
 }
 }
 
 

+ 9 - 9
panda/src/gui/guiItem.cxx

@@ -14,7 +14,7 @@ void GuiItem::recompute_frame(void) {
 void GuiItem::adjust_region(void) {
 void GuiItem::adjust_region(void) {
   test_ref_count_integrity();
   test_ref_count_integrity();
   gui_cat->debug() << "in adjust_region, base values (" << _left << ", "
   gui_cat->debug() << "in adjust_region, base values (" << _left << ", "
-		   << _right << ", " << _bottom << ", " << _top << ")" << endl;
+           << _right << ", " << _bottom << ", " << _top << ")" << endl;
   if (!(_alt_root.is_null())) {
   if (!(_alt_root.is_null())) {
     // adjust for graph transform
     // adjust for graph transform
     LMatrix4f m;
     LMatrix4f m;
@@ -28,8 +28,8 @@ void GuiItem::adjust_region(void) {
     _right = lr.dot(LVector3f::rfu(1., 0., 0.));
     _right = lr.dot(LVector3f::rfu(1., 0., 0.));
     _bottom = lr.dot(LVector3f::rfu(0., 0., 1.));
     _bottom = lr.dot(LVector3f::rfu(0., 0., 1.));
     gui_cat->debug() << "childed to non-default node, current values ("
     gui_cat->debug() << "childed to non-default node, current values ("
-		     << _left << ", " << _right << ", " << _bottom << ", "
-		     << _top << ")" << endl;
+             << _left << ", " << _right << ", " << _bottom << ", "
+             << _top << ")" << endl;
   }
   }
 }
 }
 
 
@@ -37,18 +37,18 @@ void GuiItem::set_priority(GuiLabel*, const GuiItem::Priority) {
 }
 }
 
 
 GuiItem::GuiItem(const string& name) : Namable(name), _scale(1.), _scale_x(1.),
 GuiItem::GuiItem(const string& name) : Namable(name), _scale(1.), _scale_x(1.),
-				       _scale_y(1.), _scale_z(1.), _left(-1.),
-				       _right(1.), _bottom(-1.), _top(1.),
-				       _pos(0., 0., 0.), _mgr((GuiManager*)0L),
-				       _pri(P_Normal) {
+                       _scale_y(1.), _scale_z(1.), _left(-1.),
+                       _right(1.), _bottom(-1.), _top(1.),
+                       _pos(0., 0., 0.), _mgr((GuiManager*)0L),
+                       _pri(P_Normal) {
 
 
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug()
     gui_cat->debug()
       << "creating item '" << get_name() << "' (" << (void *)this << ")\n";
       << "creating item '" << get_name() << "' (" << (void *)this << ")\n";
 }
 }
 
 
 GuiItem::~GuiItem(void) {
 GuiItem::~GuiItem(void) {
-  if (gui_cat->is_debug())
+  if (gui_cat.is_debug())
     gui_cat->debug()
     gui_cat->debug()
       << "deleting item '" << get_name() << "' (" << (void *)this << ")\n";
       << "deleting item '" << get_name() << "' (" << (void *)this << ")\n";
   //  this->unmanage();
   //  this->unmanage();

+ 48 - 48
panda/src/gui/guiManager.cxx

@@ -20,10 +20,10 @@
 GuiManager::GuiMap* GuiManager::_map = (GuiManager::GuiMap*)0L;
 GuiManager::GuiMap* GuiManager::_map = (GuiManager::GuiMap*)0L;
 
 
 GuiManager* GuiManager::get_ptr(GraphicsWindow* w, MouseAndKeyboard* mak,
 GuiManager* GuiManager::get_ptr(GraphicsWindow* w, MouseAndKeyboard* mak,
-				Node *root2d) {
+                Node *root2d) {
   GuiManager* ret;
   GuiManager* ret;
   if (_map == (GuiMap*)0L) {
   if (_map == (GuiMap*)0L) {
-    if (gui_cat->is_debug())
+    if (gui_cat.is_debug())
       gui_cat->debug() << "allocating a manager map" << endl;
       gui_cat->debug() << "allocating a manager map" << endl;
     _map = new GuiMap;
     _map = new GuiMap;
   }
   }
@@ -31,12 +31,12 @@ GuiManager* GuiManager::get_ptr(GraphicsWindow* w, MouseAndKeyboard* mak,
   gi = _map->find(w);
   gi = _map->find(w);
   if (gi != _map->end()) {
   if (gi != _map->end()) {
     ret = (*gi).second;
     ret = (*gi).second;
-    if (gui_cat->is_debug())
+    if (gui_cat.is_debug())
       gui_cat->debug() << "a manager for this window already exists (0x"
       gui_cat->debug() << "a manager for this window already exists (0x"
-		       << (void*)ret << ")" << endl;
+               << (void*)ret << ")" << endl;
   } else {
   } else {
     // going to allocate a new GuiManager for this window
     // going to allocate a new GuiManager for this window
-    if (gui_cat->is_debug())
+    if (gui_cat.is_debug())
       gui_cat->debug() << "allocating a new manager for this window" << endl;
       gui_cat->debug() << "allocating a new manager for this window" << endl;
     // first see if there is a mouseWatcher already under the MouseAndKeyboard
     // first see if there is a mouseWatcher already under the MouseAndKeyboard
     bool has_watcher = false;
     bool has_watcher = false;
@@ -44,46 +44,46 @@ GuiManager* GuiManager::get_ptr(GraphicsWindow* w, MouseAndKeyboard* mak,
     MouseWatcher* watcher = (MouseWatcher*)0L;
     MouseWatcher* watcher = (MouseWatcher*)0L;
     for (int i=0; i<mak->get_num_children(dgt); ++i)
     for (int i=0; i<mak->get_num_children(dgt); ++i)
       if (mak->get_child(dgt, i)->get_child()->get_type() ==
       if (mak->get_child(dgt, i)->get_child()->get_type() ==
-	  MouseWatcher::get_class_type()) {
-	has_watcher = true;
-	watcher = DCAST(MouseWatcher, mak->get_child(dgt, i)->get_child());
+      MouseWatcher::get_class_type()) {
+    has_watcher = true;
+    watcher = DCAST(MouseWatcher, mak->get_child(dgt, i)->get_child());
       }
       }
     if (!has_watcher) {
     if (!has_watcher) {
       // there isn't already a mousewatcher in the data graph, so we'll make
       // there isn't already a mousewatcher in the data graph, so we'll make
       // one and re-parent everything to it.
       // one and re-parent everything to it.
-      if (gui_cat->is_debug())
-	gui_cat->debug() << "no MouseWatcher found, making one" << endl;
+      if (gui_cat.is_debug())
+    gui_cat->debug() << "no MouseWatcher found, making one" << endl;
       watcher = new MouseWatcher("GUI watcher");
       watcher = new MouseWatcher("GUI watcher");
       DataRelation* tmp = new DataRelation(mak, watcher);
       DataRelation* tmp = new DataRelation(mak, watcher);
       for (int j=0; j<mak->get_num_children(dgt); ++j) {
       for (int j=0; j<mak->get_num_children(dgt); ++j) {
-	NodeRelation* rel = mak->get_child(dgt, j);
-	if (rel != tmp)
-	  // it's not the node we just created, so reparent it to ours
-	  rel->change_parent(watcher);
+    NodeRelation* rel = mak->get_child(dgt, j);
+    if (rel != tmp)
+      // it's not the node we just created, so reparent it to ours
+      rel->change_parent(watcher);
       }
       }
     } else {
     } else {
-      if (gui_cat->is_debug())
+      if (gui_cat.is_debug())
       gui_cat->debug() << "found a MouseWatcher, don't have to make one"
       gui_cat->debug() << "found a MouseWatcher, don't have to make one"
-		       << endl;
+               << endl;
     }
     }
     // now setup event triggers for the watcher
     // now setup event triggers for the watcher
 #ifdef _DEBUG
 #ifdef _DEBUG
     if (has_watcher && !watcher->get_button_down_pattern().empty())
     if (has_watcher && !watcher->get_button_down_pattern().empty())
       gui_cat->warning() << "overwriting existing button down pattern '"
       gui_cat->warning() << "overwriting existing button down pattern '"
-			 << watcher->get_button_down_pattern()
-			 << "' with 'gui-button-press'" << endl;
+             << watcher->get_button_down_pattern()
+             << "' with 'gui-button-press'" << endl;
     if (has_watcher && !watcher->get_button_up_pattern().empty())
     if (has_watcher && !watcher->get_button_up_pattern().empty())
       gui_cat->warning() << "overwriting existing button up pattern '"
       gui_cat->warning() << "overwriting existing button up pattern '"
-			 << watcher->get_button_up_pattern()
-			 << "' with 'gui-button-release'" << endl;
+             << watcher->get_button_up_pattern()
+             << "' with 'gui-button-release'" << endl;
     if (has_watcher && !watcher->get_enter_pattern().empty())
     if (has_watcher && !watcher->get_enter_pattern().empty())
       gui_cat->warning() << "overwriting existing enter pattern '"
       gui_cat->warning() << "overwriting existing enter pattern '"
-			 << watcher->get_enter_pattern()
-			 << "' with 'gui-enter'" << endl;
+             << watcher->get_enter_pattern()
+             << "' with 'gui-enter'" << endl;
     if (has_watcher && !watcher->get_leave_pattern().empty())
     if (has_watcher && !watcher->get_leave_pattern().empty())
       gui_cat->warning() << "overwriting existing exit pattern '"
       gui_cat->warning() << "overwriting existing exit pattern '"
-			 << watcher->get_leave_pattern()
-			 << "' with 'gui-exit'" << endl;
+             << watcher->get_leave_pattern()
+             << "' with 'gui-exit'" << endl;
 #endif /* _DEBUG */
 #endif /* _DEBUG */
     watcher->set_button_down_pattern("gui-button-press");
     watcher->set_button_down_pattern("gui-button-press");
     watcher->set_button_up_pattern("gui-button-release");
     watcher->set_button_up_pattern("gui-button-release");
@@ -115,8 +115,8 @@ GuiManager* GuiManager::get_ptr(GraphicsWindow* w, MouseAndKeyboard* mak,
       DisplayRegion *dr = layer->make_display_region();
       DisplayRegion *dr = layer->make_display_region();
       nassertr(dr != (DisplayRegion*)0L, NULL);
       nassertr(dr != (DisplayRegion*)0L, NULL);
       dr->set_camera(cam);
       dr->set_camera(cam);
-      if (gui_cat->is_debug())
-	gui_cat->debug() << "2D layer created" << endl;
+      if (gui_cat.is_debug())
+    gui_cat->debug() << "2D layer created" << endl;
     }
     }
 
 
     // make an event handler for our internal events
     // make an event handler for our internal events
@@ -125,9 +125,9 @@ GuiManager* GuiManager::get_ptr(GraphicsWindow* w, MouseAndKeyboard* mak,
 
 
     // now make the manager for this window
     // now make the manager for this window
     ret = new GuiManager(watcher, root2d, eh);
     ret = new GuiManager(watcher, root2d, eh);
-    if (gui_cat->is_debug())
+    if (gui_cat.is_debug())
       gui_cat->debug() << "new manager allocated (0x" << (void*)ret << ")"
       gui_cat->debug() << "new manager allocated (0x" << (void*)ret << ")"
-		       << endl;
+               << endl;
     (*_map)[w] = ret;
     (*_map)[w] = ret;
   }
   }
   return ret;
   return ret;
@@ -142,7 +142,7 @@ void GuiManager::add_region(MouseWatcherRegion* region) {
     _regions.insert(region);
     _regions.insert(region);
   } else
   } else
     gui_cat->warning() << "tried adding region ('" << *region
     gui_cat->warning() << "tried adding region ('" << *region
-		       << "') more then once" << endl;
+               << "') more then once" << endl;
 }
 }
 
 
 void GuiManager::add_label(GuiLabel* label) {
 void GuiManager::add_label(GuiLabel* label) {
@@ -155,7 +155,7 @@ void GuiManager::add_label(GuiLabel* label) {
     _labels.insert(label);
     _labels.insert(label);
   } else
   } else
     gui_cat->warning() << "tried adding label (0x" << (void*)label
     gui_cat->warning() << "tried adding label (0x" << (void*)label
-		       << ") more then once" << endl;
+               << ") more then once" << endl;
 }
 }
 
 
 void GuiManager::add_label(GuiLabel* label, Node* parent) {
 void GuiManager::add_label(GuiLabel* label, Node* parent) {
@@ -168,7 +168,7 @@ void GuiManager::add_label(GuiLabel* label, Node* parent) {
     _labels.insert(label);
     _labels.insert(label);
   } else
   } else
     gui_cat->warning() << "tried adding label (0x" << (void*)label
     gui_cat->warning() << "tried adding label (0x" << (void*)label
-		       << ") more then once" << endl;
+               << ") more then once" << endl;
 }
 }
 
 
 void GuiManager::remove_region(MouseWatcherRegion* region) {
 void GuiManager::remove_region(MouseWatcherRegion* region) {
@@ -177,7 +177,7 @@ void GuiManager::remove_region(MouseWatcherRegion* region) {
   ri = _regions.find(region);
   ri = _regions.find(region);
   if (ri == _regions.end())
   if (ri == _regions.end())
     gui_cat->warning() << "tried removing region ('" << *region
     gui_cat->warning() << "tried removing region ('" << *region
-		       << "') that isn't there" << endl;
+               << "') that isn't there" << endl;
   else {
   else {
     _watcher->remove_region(region);
     _watcher->remove_region(region);
     _regions.erase(ri);
     _regions.erase(ri);
@@ -190,7 +190,7 @@ void GuiManager::remove_label(GuiLabel* label) {
   li = _labels.find(label);
   li = _labels.find(label);
   if (li == _labels.end())
   if (li == _labels.end())
     gui_cat->warning() << "label (0x" << (void*)label
     gui_cat->warning() << "label (0x" << (void*)label
-		       << ") is not there to be removed" << endl;
+               << ") is not there to be removed" << endl;
   else {
   else {
     // remove it to the scenegraph
     // remove it to the scenegraph
     remove_arc(label->get_arc());
     remove_arc(label->get_arc());
@@ -243,9 +243,9 @@ bool GuiManager::is_sane(void) const {
   for (RegionSet::const_iterator i=_regions.begin(); i!=_regions.end(); ++i)
   for (RegionSet::const_iterator i=_regions.begin(); i!=_regions.end(); ++i)
     for (RegionSet::const_iterator j=_regions.begin(); j!=_regions.end(); ++j) {
     for (RegionSet::const_iterator j=_regions.begin(); j!=_regions.end(); ++j) {
       if ((*i) == (*j))
       if ((*i) == (*j))
-	continue;
+    continue;
       if (overlap((*i), (*j)))
       if (overlap((*i), (*j)))
-	return false;
+    return false;
     }
     }
   return true;
   return true;
 }
 }
@@ -254,21 +254,21 @@ void GuiManager::sanity_check(void) const {
   for (RegionSet::const_iterator i=_regions.begin(); i!=_regions.end(); ++i)
   for (RegionSet::const_iterator i=_regions.begin(); i!=_regions.end(); ++i)
     for (RegionSet::const_iterator j=_regions.begin(); j!=_regions.end(); ++j) {
     for (RegionSet::const_iterator j=_regions.begin(); j!=_regions.end(); ++j) {
       if ((*i) == (*j))
       if ((*i) == (*j))
-	continue;
+    continue;
       if (overlap((*i), (*j))) {
       if (overlap((*i), (*j))) {
-	LVector4f iv = (*i)->get_frame();
-	LVector4f jv = (*j)->get_frame();
-	gui_cat->warning() << "GuiManager::sanity_check: overlapping regions '"
-			   << (*i)->get_name() << "' and '" << (*j)->get_name()
-			   << "'" << endl << "  (" << iv[0] << ", " << iv[1]
-			   << ", " << iv[2] << ", " << iv[3] << ") and ("
-			   << jv[0] << ", " << jv[1] << ", " << jv[2] << ", "
-			   << jv[3] << ")" << endl;
-	
+    LVector4f iv = (*i)->get_frame();
+    LVector4f jv = (*j)->get_frame();
+    gui_cat->warning() << "GuiManager::sanity_check: overlapping regions '"
+               << (*i)->get_name() << "' and '" << (*j)->get_name()
+               << "'" << endl << "  (" << iv[0] << ", " << iv[1]
+               << ", " << iv[2] << ", " << iv[3] << ") and ("
+               << jv[0] << ", " << jv[1] << ", " << jv[2] << ", "
+               << jv[3] << ")" << endl;
+    
       }
       }
       if ((*i)->get_name() == (*j)->get_name())
       if ((*i)->get_name() == (*j)->get_name())
-	gui_cat->warning() << "GuiManager::sanity_check: regions with same "
-			   << "name '" << (*i)->get_name() << " 0x"
-			   << (void*)(*i) << " and 0x" << (void*)(*j) << endl;
+    gui_cat->warning() << "GuiManager::sanity_check: regions with same "
+               << "name '" << (*i)->get_name() << " 0x"
+               << (void*)(*i) << " and 0x" << (void*)(*j) << endl;
     }
     }
 }
 }

+ 3 - 3
panda/src/gui/guiRollover.I

@@ -11,7 +11,7 @@ INLINE void GuiRollover::enter(void) {
 #ifdef _DEBUG
 #ifdef _DEBUG
     if (gui_cat->is_debug())
     if (gui_cat->is_debug())
       gui_cat->debug() << "entered '" << *this
       gui_cat->debug() << "entered '" << *this
-		       << "' more then once without exit" << endl;
+               << "' more then once without exit" << endl;
 #endif
 #endif
   } else if (_mgr != (GuiManager*)0L) {
   } else if (_mgr != (GuiManager*)0L) {
     _mgr->remove_label(_off);
     _mgr->remove_label(_off);
@@ -26,9 +26,9 @@ INLINE void GuiRollover::enter(void) {
 INLINE void GuiRollover::exit(void) {
 INLINE void GuiRollover::exit(void) {
   if (!_state) {
   if (!_state) {
 #ifdef _DEBUG
 #ifdef _DEBUG
-    if (gui_cat->is_debug())
+    if (gui_cat.is_debug())
       gui_cat->debug() << "exited '" << *this
       gui_cat->debug() << "exited '" << *this
-		       << "' more then once without enter" << endl;
+               << "' more then once without enter" << endl;
 #endif
 #endif
   } else if (_mgr != (GuiManager*)0L) {
   } else if (_mgr != (GuiManager*)0L) {
     _mgr->remove_label(_on);
     _mgr->remove_label(_on);

+ 8 - 8
panda/src/putil/buttonRegistry.cxx

@@ -31,7 +31,7 @@ ButtonRegistry *ButtonRegistry::_global_pointer = NULL;
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 bool ButtonRegistry::
 bool ButtonRegistry::
 register_button(ButtonHandle &button_handle, const string &name,
 register_button(ButtonHandle &button_handle, const string &name,
-		char ascii_equivalent) { 
+        char ascii_equivalent) { 
   NameRegistry::iterator ri;
   NameRegistry::iterator ri;
   ri = _name_registry.find(name);
   ri = _name_registry.find(name);
 
 
@@ -42,17 +42,17 @@ register_button(ButtonHandle &button_handle, const string &name,
     int index = -1;
     int index = -1;
     if (ascii_equivalent != '\0') {
     if (ascii_equivalent != '\0') {
       if (_handle_registry[ascii_equivalent] == (RegistryNode *)NULL) {
       if (_handle_registry[ascii_equivalent] == (RegistryNode *)NULL) {
-	index = ascii_equivalent;
+    index = ascii_equivalent;
       } else {
       } else {
-	util_cat->error()
-	  << "Attempt to register multiple buttons under ASCII equivalent "
-	  << ascii_equivalent << "\n";
+    util_cat->error()
+      << "Attempt to register multiple buttons under ASCII equivalent "
+      << ascii_equivalent << "\n";
       }
       }
     }
     }
     
     
-    if (util_cat->is_spam()) {
+    if (util_cat.is_spam()) {
       util_cat->spam()
       util_cat->spam()
-	<< "Registering button " << name << "\n";
+    << "Registering button " << name << "\n";
     }
     }
 
 
     if (index == -1) {
     if (index == -1) {
@@ -75,7 +75,7 @@ register_button(ButtonHandle &button_handle, const string &name,
   RegistryNode *rnode = (*ri).second;
   RegistryNode *rnode = (*ri).second;
   nassertr(rnode->_name == (*ri).first, false);
   nassertr(rnode->_name == (*ri).first, false);
   nassertr(rnode->_handle._index >= 0 && 
   nassertr(rnode->_handle._index >= 0 && 
-	   rnode->_handle._index < (int)_handle_registry.size(), false);
+       rnode->_handle._index < (int)_handle_registry.size(), false);
   nassertr(_handle_registry[rnode->_handle._index] == rnode, false);
   nassertr(_handle_registry[rnode->_handle._index] == rnode, false);
   nassertr(rnode->_handle._index != 0, false);
   nassertr(rnode->_handle._index != 0, false);
 
 

+ 3 - 3
panda/src/sgattrib/materialTransition.cxx

@@ -117,10 +117,10 @@ write_datagram(BamWriter *manager, Datagram &me) {
 int MaterialTransition::
 int MaterialTransition::
 complete_pointers(vector_typedWritable &plist, BamReader *) {
 complete_pointers(vector_typedWritable &plist, BamReader *) {
   if (plist[0] == TypedWritable::Null) {
   if (plist[0] == TypedWritable::Null) {
-    if (sgattrib_cat->is_debug()) {
+    if (sgattrib_cat.is_debug()) {
       sgattrib_cat->debug()
       sgattrib_cat->debug()
-	<< get_type().get_name() << " received null Material," 
-	<< " turning off" << endl;
+    << get_type().get_name() << " received null Material," 
+    << " turning off" << endl;
     }
     }
     _value = (const Material *)NULL;
     _value = (const Material *)NULL;
     set_off();
     set_off();

+ 3 - 3
panda/src/sgattrib/textureTransition.cxx

@@ -118,10 +118,10 @@ write_datagram(BamWriter *manager, Datagram &me) {
 int TextureTransition::
 int TextureTransition::
 complete_pointers(vector_typedWritable &plist, BamReader *) {
 complete_pointers(vector_typedWritable &plist, BamReader *) {
   if (plist[0] == TypedWritable::Null) {
   if (plist[0] == TypedWritable::Null) {
-    if (sgattrib_cat->is_debug()) {
+    if (sgattrib_cat.is_debug()) {
       sgattrib_cat->debug()
       sgattrib_cat->debug()
-	<< get_type().get_name() << " received null Texture," 
-	<< " turning off" << endl;
+    << get_type().get_name() << " received null Texture," 
+    << " turning off" << endl;
     }
     }
     _value = (Texture *)NULL;
     _value = (Texture *)NULL;
     set_off();
     set_off();

+ 152 - 152
panda/src/wgldisplay/wglGraphicsWindow.cxx

@@ -42,7 +42,7 @@ wglGraphicsWindow(GraphicsPipe* pipe) : GraphicsWindow(pipe) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 wglGraphicsWindow::
 wglGraphicsWindow::
 wglGraphicsWindow(GraphicsPipe* pipe, const
 wglGraphicsWindow(GraphicsPipe* pipe, const
-	GraphicsWindow::Properties& props) : GraphicsWindow(pipe, props) {
+    GraphicsWindow::Properties& props) : GraphicsWindow(pipe, props) {
   config();
   config();
 }
 }
 
 
@@ -54,7 +54,7 @@ wglGraphicsWindow(GraphicsPipe* pipe, const
 wglGraphicsWindow::~wglGraphicsWindow(void) {
 wglGraphicsWindow::~wglGraphicsWindow(void) {
 
 
   if(gl_show_fps_meter)
   if(gl_show_fps_meter)
-	glDeleteLists(FONT_BITMAP_OGLDISPLAYLISTNUM, 128);
+    glDeleteLists(FONT_BITMAP_OGLDISPLAYLISTNUM, 128);
 
 
   if(_visual!=NULL)
   if(_visual!=NULL)
     free(_visual);
     free(_visual);
@@ -75,7 +75,7 @@ wglGraphicsWindow::~wglGraphicsWindow(void) {
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 PIXELFORMATDESCRIPTOR* wglGraphicsWindow::
 PIXELFORMATDESCRIPTOR* wglGraphicsWindow::
 try_for_visual(wglGraphicsPipe *pipe, int mask,
 try_for_visual(wglGraphicsPipe *pipe, int mask,
-	       int want_depth_bits, int want_color_bits) {
+           int want_depth_bits, int want_color_bits) {
   static const int max_attrib_list = 32;
   static const int max_attrib_list = 32;
   int attrib_list[max_attrib_list];
   int attrib_list[max_attrib_list];
   int n=0;
   int n=0;
@@ -157,55 +157,55 @@ try_for_visual(wglGraphicsPipe *pipe, int mask,
   while (*p) {
   while (*p) {
     switch (*p) {
     switch (*p) {
       case GLX_USE_GL:
       case GLX_USE_GL:
-	pfd.dwFlags |= PFD_SUPPORT_OPENGL;
-	break;
+    pfd.dwFlags |= PFD_SUPPORT_OPENGL;
+    break;
       case GLX_LEVEL:
       case GLX_LEVEL:
-	pfd.bReserved = *(++p);
-	break;
+    pfd.bReserved = *(++p);
+    break;
       case GLX_RGBA:
       case GLX_RGBA:
-	pfd.iPixelType = PFD_TYPE_RGBA;
-	break;
+    pfd.iPixelType = PFD_TYPE_RGBA;
+    break;
       case GLX_DOUBLEBUFFER:
       case GLX_DOUBLEBUFFER:
-	pfd.dwFlags |= PFD_DOUBLEBUFFER;
-	break;
+    pfd.dwFlags |= PFD_DOUBLEBUFFER;
+    break;
       case GLX_STEREO:
       case GLX_STEREO:
-	stereo = true;
-	pfd.dwFlags |= PFD_STEREO;
-	break;
+    stereo = true;
+    pfd.dwFlags |= PFD_STEREO;
+    break;
       case GLX_AUX_BUFFERS:
       case GLX_AUX_BUFFERS:
-	pfd.cAuxBuffers = *(++p);
-	break;
+    pfd.cAuxBuffers = *(++p);
+    break;
       case GLX_RED_SIZE:
       case GLX_RED_SIZE:
-	pfd.cRedBits = 8; // Try to get the maximum
-	++p;
-	break;
+    pfd.cRedBits = 8; // Try to get the maximum
+    ++p;
+    break;
       case GLX_GREEN_SIZE:
       case GLX_GREEN_SIZE:
-	pfd.cGreenBits = 8; // Try to get the maximum
-	++p;
-	break;
+    pfd.cGreenBits = 8; // Try to get the maximum
+    ++p;
+    break;
       case GLX_BLUE_SIZE:
       case GLX_BLUE_SIZE:
-	pfd.cBlueBits = 8; // Try to get the maximum
-	++p;
-	break;
+    pfd.cBlueBits = 8; // Try to get the maximum
+    ++p;
+    break;
       case GLX_ALPHA_SIZE:
       case GLX_ALPHA_SIZE:
-	pfd.cAlphaBits = 8; // Try to get the maximum
-	++p;
-	break;
+    pfd.cAlphaBits = 8; // Try to get the maximum
+    ++p;
+    break;
       case GLX_DEPTH_SIZE:
       case GLX_DEPTH_SIZE:
-	pfd.cDepthBits = 32; // Try to get the maximum
-	++p;
-	break;
+    pfd.cDepthBits = 32; // Try to get the maximum
+    ++p;
+    break;
       case GLX_STENCIL_SIZE:
       case GLX_STENCIL_SIZE:
-	pfd.cStencilBits = *(++p);
-	break;
+    pfd.cStencilBits = *(++p);
+    break;
       case GLX_ACCUM_RED_SIZE:
       case GLX_ACCUM_RED_SIZE:
       case GLX_ACCUM_GREEN_SIZE:
       case GLX_ACCUM_GREEN_SIZE:
       case GLX_ACCUM_BLUE_SIZE:
       case GLX_ACCUM_BLUE_SIZE:
       case GLX_ACCUM_ALPHA_SIZE:
       case GLX_ACCUM_ALPHA_SIZE:
-	// Only cAccumBits is used for requesting accum buffer
-	pfd.cAccumBits = 1;
-	++p;
-	break;
+    // Only cAccumBits is used for requesting accum buffer
+    pfd.cAccumBits = 1;
+    ++p;
+    break;
     }
     }
     ++p;
     ++p;
   }
   }
@@ -218,8 +218,8 @@ try_for_visual(wglGraphicsPipe *pipe, int mask,
     // ChoosePixelFormat is dumb about stereo
     // ChoosePixelFormat is dumb about stereo
     if (stereo) {
     if (stereo) {
       if (!(match->dwFlags & PFD_STEREO)) {
       if (!(match->dwFlags & PFD_STEREO)) {
-	wgldisplay_cat.info()
-	  << "wglGraphicsWindow::try_for_visual() - request for stereo failed" << endl;	
+    wgldisplay_cat.info()
+      << "wglGraphicsWindow::try_for_visual() - request for stereo failed" << endl; 
       }
       }
     }
     }
   }
   }
@@ -240,21 +240,21 @@ get_config(PIXELFORMATDESCRIPTOR *visual, int attrib, int *value) {
   switch (attrib) {
   switch (attrib) {
     case GLX_USE_GL:
     case GLX_USE_GL:
       if (visual->dwFlags & (PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW)) {
       if (visual->dwFlags & (PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW)) {
-	if (visual->iPixelType == PFD_TYPE_COLORINDEX &&
-	    visual->cColorBits >= 24) {
-	  *value = 0;
-	} else {
-	  *value = 1;
-	}
+    if (visual->iPixelType == PFD_TYPE_COLORINDEX &&
+        visual->cColorBits >= 24) {
+      *value = 0;
+    } else {
+      *value = 1;
+    }
       } else {
       } else {
-	*value = 0;
+    *value = 0;
       }
       }
       break;
       break;
     case GLX_BUFFER_SIZE:
     case GLX_BUFFER_SIZE:
       if (visual->iPixelType == PFD_TYPE_RGBA)
       if (visual->iPixelType == PFD_TYPE_RGBA)
- 	*value = visual->cColorBits;
+    *value = visual->cColorBits;
       else
       else
-	*value = 8;
+    *value = 8;
       break;
       break;
     case GLX_LEVEL:
     case GLX_LEVEL:
       *value = visual->bReserved;
       *value = visual->bReserved;
@@ -317,7 +317,7 @@ int wglGraphicsWindow::choose_visual(void) {
 
 
     wgldisplay_cat.info()
     wgldisplay_cat.info()
       << "wglGraphicsWindow::mask =0x" << (void*) _props._mask
       << "wglGraphicsWindow::mask =0x" << (void*) _props._mask
-	<< endl;
+    << endl;
 
 
   int want_depth_bits = _props._want_depth_bits;
   int want_depth_bits = _props._want_depth_bits;
   int want_color_bits = _props._want_color_bits;
   int want_color_bits = _props._want_color_bits;
@@ -325,7 +325,7 @@ int wglGraphicsWindow::choose_visual(void) {
   if (mask & W_MULTISAMPLE) {
   if (mask & W_MULTISAMPLE) {
     wgldisplay_cat.info()
     wgldisplay_cat.info()
       << "wglGraphicsWindow::config() - multisample not supported"
       << "wglGraphicsWindow::config() - multisample not supported"
-	<< endl;
+    << endl;
     mask &= ~W_MULTISAMPLE;
     mask &= ~W_MULTISAMPLE;
   }
   }
 
 
@@ -370,32 +370,32 @@ int wglGraphicsWindow::choose_visual(void) {
       // the requested mask, in order.
       // the requested mask, in order.
       
       
       static const int strip_properties[] = { 
       static const int strip_properties[] = { 
-	// One esoteric option removed.
-	W_MULTISAMPLE,
-	W_STENCIL,
-	W_ACCUM,
-	W_ALPHA,
-	W_STEREO,
-	
-	// Two esoteric options removed.
-	W_STENCIL | W_MULTISAMPLE,
-	W_ACCUM | W_MULTISAMPLE,
-	W_ALPHA | W_MULTISAMPLE,
-	W_STEREO | W_MULTISAMPLE,
-	W_STENCIL | W_ACCUM,
-	W_ALPHA | W_STEREO,
-	W_STENCIL | W_ACCUM | W_MULTISAMPLE,
-	W_ALPHA | W_STEREO | W_MULTISAMPLE,
-	
-	// All esoteric options removed.
-	W_STENCIL | W_ACCUM | W_ALPHA | W_STEREO | W_MULTISAMPLE,
-
-	// All esoteric options, plus some we'd really really prefer,
-	// removed.
-	W_STENCIL | W_ACCUM | W_ALPHA | W_STEREO | W_MULTISAMPLE | W_DOUBLE,
-	
-	// A zero marks the end of the array.
-	0
+    // One esoteric option removed.
+    W_MULTISAMPLE,
+    W_STENCIL,
+    W_ACCUM,
+    W_ALPHA,
+    W_STEREO,
+    
+    // Two esoteric options removed.
+    W_STENCIL | W_MULTISAMPLE,
+    W_ACCUM | W_MULTISAMPLE,
+    W_ALPHA | W_MULTISAMPLE,
+    W_STEREO | W_MULTISAMPLE,
+    W_STENCIL | W_ACCUM,
+    W_ALPHA | W_STEREO,
+    W_STENCIL | W_ACCUM | W_MULTISAMPLE,
+    W_ALPHA | W_STEREO | W_MULTISAMPLE,
+    
+    // All esoteric options removed.
+    W_STENCIL | W_ACCUM | W_ALPHA | W_STEREO | W_MULTISAMPLE,
+
+    // All esoteric options, plus some we'd really really prefer,
+    // removed.
+    W_STENCIL | W_ACCUM | W_ALPHA | W_STEREO | W_MULTISAMPLE | W_DOUBLE,
+    
+    // A zero marks the end of the array.
+    0
       };
       };
 
 
       set<int> tried_masks;
       set<int> tried_masks;
@@ -403,40 +403,40 @@ int wglGraphicsWindow::choose_visual(void) {
 
 
       int i;
       int i;
       for (i = 0; _visual == NULL && strip_properties[i] != 0; i++) {
       for (i = 0; _visual == NULL && strip_properties[i] != 0; i++) {
-	int new_mask = mask & ~strip_properties[i];
-	if (tried_masks.insert(new_mask).second) {
-	  _visual = try_for_visual(pipe, new_mask, want_depth_bits,
-				   want_color_bits);
-	}
+    int new_mask = mask & ~strip_properties[i];
+    if (tried_masks.insert(new_mask).second) {
+      _visual = try_for_visual(pipe, new_mask, want_depth_bits,
+                   want_color_bits);
+    }
       }
       }
 
 
       if (special_size_request) {
       if (special_size_request) {
-	tried_masks.clear();
-	tried_masks.insert(mask);
-	
-	if (_visual == NULL) {
-	  // Try once more, this time eliminating all of the size
-	  // requests.
-	  for (i = 0; _visual == NULL && strip_properties[i] != 0; i++) {
-	    int new_mask = mask & ~strip_properties[i];
-	    if (tried_masks.insert(new_mask).second) {
-	      _visual = try_for_visual(pipe, new_mask);
-	    }
-	  }
-	}
+    tried_masks.clear();
+    tried_masks.insert(mask);
+    
+    if (_visual == NULL) {
+      // Try once more, this time eliminating all of the size
+      // requests.
+      for (i = 0; _visual == NULL && strip_properties[i] != 0; i++) {
+        int new_mask = mask & ~strip_properties[i];
+        if (tried_masks.insert(new_mask).second) {
+          _visual = try_for_visual(pipe, new_mask);
+        }
+      }
+    }
       }
       }
-	
+    
       if (_visual == NULL) {
       if (_visual == NULL) {
-	// Here's our last-ditch desparation attempt: give us any GLX
-	// visual at all!
-	_visual = try_for_visual(pipe, 0);
+    // Here's our last-ditch desparation attempt: give us any GLX
+    // visual at all!
+    _visual = try_for_visual(pipe, 0);
       }
       }
-	
+    
       if (_visual == NULL) {
       if (_visual == NULL) {
-	wgldisplay_cat.fatal()
-	  << "wglGraphicsWindow::choose_visual() - could not get any "
-	  	"visual." << endl;
-	exit(1);
+    wgldisplay_cat.fatal()
+      << "wglGraphicsWindow::choose_visual() - could not get any "
+        "visual." << endl;
+    exit(1);
       }
       }
     }
     }
   }
   }
@@ -513,7 +513,7 @@ int wglGraphicsWindow::choose_visual(void) {
   }
   }
     wgldisplay_cat.info()
     wgldisplay_cat.info()
       << "wglGraphicsWindow::mask =0x" << (void*) mask
       << "wglGraphicsWindow::mask =0x" << (void*) mask
-	<< endl;
+    << endl;
 
 
   PIXELFORMATDESCRIPTOR pfd;
   PIXELFORMATDESCRIPTOR pfd;
   ZeroMemory(&pfd,sizeof(PIXELFORMATDESCRIPTOR));
   ZeroMemory(&pfd,sizeof(PIXELFORMATDESCRIPTOR));
@@ -532,8 +532,8 @@ int wglGraphicsWindow::choose_visual(void) {
   for(i=1;i<=MaxPixFmtNum;i++) {
   for(i=1;i<=MaxPixFmtNum;i++) {
       DescribePixelFormat(_hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
       DescribePixelFormat(_hdc, i, sizeof(PIXELFORMATDESCRIPTOR), &pfd);
 
 
-      if (wgldisplay_cat->is_debug())
-	wgldisplay_cat->debug() << "----------------" << endl;
+      if (wgldisplay_cat.is_debug())
+    wgldisplay_cat->debug() << "----------------" << endl;
 
 
       if((pfd.dwFlags & PFD_GENERIC_ACCELERATED) && (pfd.dwFlags & PFD_GENERIC_FORMAT))
       if((pfd.dwFlags & PFD_GENERIC_ACCELERATED) && (pfd.dwFlags & PFD_GENERIC_FORMAT))
           drvtype=MCD;
           drvtype=MCD;
@@ -541,8 +541,8 @@ int wglGraphicsWindow::choose_visual(void) {
           drvtype=ICD;
           drvtype=ICD;
        else {
        else {
          drvtype=Software;
          drvtype=Software;
-	 if (wgldisplay_cat->is_debug())
-	   wgldisplay_cat->debug() << "skipping software driver" << endl;
+     if (wgldisplay_cat.is_debug())
+       wgldisplay_cat->debug() << "skipping software driver" << endl;
          continue;  // skipping all SW fmts
          continue;  // skipping all SW fmts
        }
        }
 
 
@@ -558,22 +558,22 @@ int wglGraphicsWindow::choose_visual(void) {
 
 
        DWORD dwReqFlags=(PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW);
        DWORD dwReqFlags=(PFD_SUPPORT_OPENGL | PFD_DRAW_TO_WINDOW);
 
 
-       if (wgldisplay_cat->is_debug()) {
-	 if (mask & W_ALPHA)
-	   wgldisplay_cat->debug() << "want alpha, pfd says '"
-				   << (int)(pfd.cAlphaBits) << "'" << endl;
-	 if (mask & W_DEPTH)
-	   wgldisplay_cat->debug() << "want depth, pfd says '"
-				   << (int)(pfd.cDepthBits) << "'" << endl;
-	 if (mask & W_STENCIL)
-	   wgldisplay_cat->debug() << "want stencil, pfd says '"
-				   << (int)(pfd.cStencilBits) << "'" << endl;
-	 wgldisplay_cat->debug() << "final flag check "
-				 << (int)(pfd.dwFlags & dwReqFlags) << " =? "
-				 << (int)dwReqFlags << endl;
-	 wgldisplay_cat->debug() << "pfd bits = " << (int)(pfd.cColorBits)
-				 << endl;
-	 wgldisplay_cat->debug() << "cur_bpp = " << cur_bpp << endl;
+       if (wgldisplay_cat.is_debug()) {
+     if (mask & W_ALPHA)
+       wgldisplay_cat->debug() << "want alpha, pfd says '"
+                   << (int)(pfd.cAlphaBits) << "'" << endl;
+     if (mask & W_DEPTH)
+       wgldisplay_cat->debug() << "want depth, pfd says '"
+                   << (int)(pfd.cDepthBits) << "'" << endl;
+     if (mask & W_STENCIL)
+       wgldisplay_cat->debug() << "want stencil, pfd says '"
+                   << (int)(pfd.cStencilBits) << "'" << endl;
+     wgldisplay_cat->debug() << "final flag check "
+                 << (int)(pfd.dwFlags & dwReqFlags) << " =? "
+                 << (int)dwReqFlags << endl;
+     wgldisplay_cat->debug() << "pfd bits = " << (int)(pfd.cColorBits)
+                 << endl;
+     wgldisplay_cat->debug() << "cur_bpp = " << cur_bpp << endl;
        }
        }
 
 
        if(mask & W_DOUBLE)
        if(mask & W_DOUBLE)
@@ -630,9 +630,9 @@ int wglGraphicsWindow::choose_visual(void) {
 //     Function: adjust_coords 
 //     Function: adjust_coords 
 //       Access:
 //       Access:
 //  Description: Adjust the window rectangle because Win32 thinks
 //  Description: Adjust the window rectangle because Win32 thinks
-//		 that the x, y, width, and height are the *entire*
-//		 window, including decorations, whereas we assume
-//		 the size is the *client* area of the window.
+//       that the x, y, width, and height are the *entire*
+//       window, including decorations, whereas we assume
+//       the size is the *client* area of the window.
 ////////////////////////////////////////////////////////////////////
 ////////////////////////////////////////////////////////////////////
 void wglGraphicsWindow::
 void wglGraphicsWindow::
 adjust_coords(int &xorg, int &yorg, int &xsize, int &ysize) {
 adjust_coords(int &xorg, int &yorg, int &xsize, int &ysize) {
@@ -644,7 +644,7 @@ adjust_coords(int &xorg, int &yorg, int &xsize, int &ysize) {
   // Style determines whether there are borders or not
   // Style determines whether there are borders or not
   // False in third parameter indicates window has no menu bar
   // False in third parameter indicates window has no menu bar
   AdjustWindowRect(&rect, WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
   AdjustWindowRect(&rect, WS_CLIPSIBLINGS | WS_CLIPCHILDREN |
-			  WS_OVERLAPPEDWINDOW, false);
+              WS_OVERLAPPEDWINDOW, false);
 
 
   // Readjust if the x and y are offscreen
   // Readjust if the x and y are offscreen
   if (rect.left < 0)
   if (rect.left < 0)
@@ -690,7 +690,7 @@ void wglGraphicsWindow::config(void) {
     _props._ysize = GetSystemMetrics(SM_CYSCREEN);
     _props._ysize = GetSystemMetrics(SM_CYSCREEN);
     _mwindow = CreateWindow("wglFullscreen", _props._title.c_str(),
     _mwindow = CreateWindow("wglFullscreen", _props._title.c_str(),
                 WS_POPUP | WS_MAXIMIZE, 
                 WS_POPUP | WS_MAXIMIZE, 
-		_props._xorg, _props._yorg, _props._xsize, _props._ysize,
+        _props._xorg, _props._yorg, _props._xsize, _props._ysize,
                 desktop, NULL, hinstance, 0);
                 desktop, NULL, hinstance, 0);
 
 
   } else {
   } else {
@@ -773,28 +773,28 @@ void wglGraphicsWindow::config(void) {
 
 
   if(gl_show_fps_meter) {
   if(gl_show_fps_meter) {
 
 
-	  _start_time = timeGetTime();
-	  _current_fps = 0.0;
-	  _start_frame_count = _cur_frame_count = 0;
+      _start_time = timeGetTime();
+      _current_fps = 0.0;
+      _start_frame_count = _cur_frame_count = 0;
 
 
-	 // 128 enough to handle all the ascii chars
-	 // this creates a display list for each char.  displist numbering starts
-	 // at FONT_BITMAP_OGLDISPLAYLISTNUM.  Might want to optimize just to save
-	 // mem by just allocing bitmaps for chars we need (0-9 fps,SPC) 
+     // 128 enough to handle all the ascii chars
+     // this creates a display list for each char.  displist numbering starts
+     // at FONT_BITMAP_OGLDISPLAYLISTNUM.  Might want to optimize just to save
+     // mem by just allocing bitmaps for chars we need (0-9 fps,SPC) 
      wglUseFontBitmaps(_hdc, 0, 128, FONT_BITMAP_OGLDISPLAYLISTNUM);
      wglUseFontBitmaps(_hdc, 0, 128, FONT_BITMAP_OGLDISPLAYLISTNUM);
   }
   }
 
 
   if(wgldisplay_cat.is_debug()) {
   if(wgldisplay_cat.is_debug()) {
-	  const GLubyte *vendorname=glGetString(GL_VENDOR);
-	  if(vendorname!=NULL) {
-		  if(strncmp((const char *)vendorname,"Microsoft",9)==0) {
-			  wgldisplay_cat.debug() << "wglGraphicsWindow:: GL VendorID: " <<   glGetString(GL_VENDOR) << " (Software Rendering)" << endl;
-		  } else {
-			  wgldisplay_cat.debug() << "wglGraphicsWindow:: GL VendorID: " <<   glGetString(GL_VENDOR) << endl;
-		  }
-	  } else {
-		 wgldisplay_cat.info() << "wglGraphicsWindow:: glGetString(GL_VENDOR) returns NULL!!!\n";
-	  }
+      const GLubyte *vendorname=glGetString(GL_VENDOR);
+      if(vendorname!=NULL) {
+          if(strncmp((const char *)vendorname,"Microsoft",9)==0) {
+              wgldisplay_cat.debug() << "wglGraphicsWindow:: GL VendorID: " <<   glGetString(GL_VENDOR) << " (Software Rendering)" << endl;
+          } else {
+              wgldisplay_cat.debug() << "wglGraphicsWindow:: GL VendorID: " <<   glGetString(GL_VENDOR) << endl;
+          }
+      } else {
+         wgldisplay_cat.info() << "wglGraphicsWindow:: glGetString(GL_VENDOR) returns NULL!!!\n";
+      }
   }
   }
 }
 }
 
 
@@ -905,7 +905,7 @@ void wglGraphicsWindow::end_frame(void) {
     glLoadMatrixf(LMatrix4f::ident_mat().get_data());
     glLoadMatrixf(LMatrix4f::ident_mat().get_data());
     
     
     glOrtho(_props._xorg,_props._xorg+_props._xsize,
     glOrtho(_props._xorg,_props._xorg+_props._xsize,
-	    _props._yorg,_props._yorg+_props._ysize,-1.0,1.0);
+        _props._yorg,_props._yorg+_props._ysize,-1.0,1.0);
     
     
     glRasterPos2f(_props._xsize-70,_props._ysize-20);  // these seem to be good for default font
     glRasterPos2f(_props._xsize-70,_props._ysize-20);  // these seem to be good for default font
     
     
@@ -1014,11 +1014,11 @@ void wglGraphicsWindow::handle_changes(void) {
     changes.top = point.y;
     changes.top = point.y;
     // Don't do this in full-screen mode
     // Don't do this in full-screen mode
     AdjustWindowRect(&changes, WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS |
     AdjustWindowRect(&changes, WS_OVERLAPPEDWINDOW | WS_CLIPSIBLINGS |
-		WS_CLIPCHILDREN, FALSE);
+        WS_CLIPCHILDREN, FALSE);
     SetWindowPos(_mwindow, HWND_TOP, changes.left, changes.top,
     SetWindowPos(_mwindow, HWND_TOP, changes.left, changes.top,
-		changes.right - changes.left, changes.bottom - changes.top,
-		SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER |
-		SWP_NOSENDCHANGING | SWP_NOSIZE | SWP_NOZORDER);
+        changes.right - changes.left, changes.bottom - changes.top,
+        SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOOWNERZORDER |
+        SWP_NOSENDCHANGING | SWP_NOSIZE | SWP_NOZORDER);
   }
   }
   _change_mask = 0;
   _change_mask = 0;
 }
 }
@@ -1180,7 +1180,7 @@ TypeHandle wglGraphicsWindow::get_class_type(void) {
 void wglGraphicsWindow::init_type(void) {
 void wglGraphicsWindow::init_type(void) {
   GraphicsWindow::init_type();
   GraphicsWindow::init_type();
   register_type(_type_handle, "wglGraphicsWindow",
   register_type(_type_handle, "wglGraphicsWindow",
-		GraphicsWindow::get_class_type());
+        GraphicsWindow::get_class_type());
 }
 }
 
 
 TypeHandle wglGraphicsWindow::get_type(void) const {
 TypeHandle wglGraphicsWindow::get_type(void) const {