1 /******************************************************************************
2 * Arachnoid Graphics Plugin for Mupen64Plus
3 * http://bitbucket.org/wahrhaft/mupen64plus-video-arachnoid/
5 * Copyright (C) 2007 Kristofer Karlsson, Rickard Niklasson
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 *****************************************************************************/
22 #include "CombinerCache.h"
24 //-----------------------------------------------------------------------------
25 //* New Compiled Combiner
26 //! Function used to add decoded mux values and the result of them to the list.
27 //-----------------------------------------------------------------------------
28 void CombinerCache::newCompiledCombiner(unsigned long long mux, TexEnvCombiner* compiled)
31 CachedCombiner* newCombiner = new CachedCombiner();
32 newCombiner->mux = mux;
33 newCombiner->compiled = compiled;
35 //Add Combiner to list
36 m_cachedCombiners.push_back(newCombiner);
39 //-----------------------------------------------------------------------------
40 //* New Compiled Combiner
41 //! Function used to retrive decoded mux values and the result of them to the list.
42 //-----------------------------------------------------------------------------
43 CachedCombiner* CombinerCache::findCachedCombiner(unsigned long long mux)
45 for (CombinerList::iterator it = m_cachedCombiners.begin(); it!=m_cachedCombiners.end(); ++it)
47 if ( (*it)->mux == mux )
49 return (*it); //Found old combiner!!
53 return 0; //Could not find it
56 //-----------------------------------------------------------------------------
58 //! Destroys all values in list.
59 //-----------------------------------------------------------------------------
60 void CombinerCache::dispose()
62 for (CombinerList::iterator it = m_cachedCombiners.begin(); it!=m_cachedCombiners.end(); ++it)
64 delete (*it)->compiled;
68 m_cachedCombiners.clear();