From: Matthias Braun Date: Thu, 23 Jun 2005 01:47:12 +0000 (+0000) Subject: don't need these anymore X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8ba41a1a5c31a562472998baddbe70138b581196;p=supertux.git don't need these anymore SVN-Revision: 2638 --- diff --git a/src/audio/musicref.cpp b/src/audio/musicref.cpp deleted file mode 100644 index 2bf8dd4af..000000000 --- a/src/audio/musicref.cpp +++ /dev/null @@ -1,67 +0,0 @@ -// $Id: musicref.cpp 2168 2004-11-24 14:10:27Z matzebraun $ -// -// SuperTux - A Jump'n Run -// Copyright (C) 2000 Bill Kendrick -// Copyright (C) 2004 Matthias Braun -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -#include - -#include "audio/musicref.h" - -MusicRef::MusicRef() - : music(0) -{ -} - -MusicRef::MusicRef(SoundManager::MusicResource* newmusic) - : music(newmusic) -{ - if(music) - music->refcount++; -} - -MusicRef::~MusicRef() -{ - if(music) { - music->refcount--; - if(music->refcount == 0) - music->manager->free_music(music); - } -} - -MusicRef::MusicRef(const MusicRef& other) - : music(other.music) -{ - if(music) - music->refcount++; -} - -MusicRef& -MusicRef::operator =(const MusicRef& other) -{ - SoundManager::MusicResource* oldres = music; - music = other.music; - if(music) - music->refcount++; - if(oldres) { - oldres->refcount--; - if(oldres->refcount == 0) - music->manager->free_music(music); - } - - return *this; -} - diff --git a/src/audio/musicref.h b/src/audio/musicref.h deleted file mode 100644 index 98720cdca..000000000 --- a/src/audio/musicref.h +++ /dev/null @@ -1,45 +0,0 @@ -// $Id: musicref.h 2168 2004-11-24 14:10:27Z matzebraun $ -// -// SuperTux - A Jump'n Run -// Copyright (C) 2004 Matthias Braun -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -// -// You should have received a copy of the GNU General Public License -// along with this program; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - -#ifndef SUPERTUX_MUSICREF_H -#define SUPERTUX_MUSICREF_H - -#include "sound_manager.h" - -/** This class holds a reference to a music file and maintains a correct - * refcount for that file. - */ -class MusicRef -{ -public: - MusicRef(); - MusicRef(const MusicRef& other); - ~MusicRef(); - - MusicRef& operator= (const MusicRef& other); - -private: - friend class SoundManager; - MusicRef(SoundManager::MusicResource* music); - - SoundManager::MusicResource* music; -}; - -#endif /*SUPERTUX_MUSICREF_H*/ -