Path: blob/master/libmupen64plus/mupen64plus-video-glide64mk2/src/GlideHQ/TxCache.h
2 views
/*1* Texture Filtering2* Version: 1.03*4* Copyright (C) 2007 Hiroshi Morii All Rights Reserved.5* Email koolsmoky(at)users.sourceforge.net6* Web http://www.3dfxzone.it/koolsmoky7*8* this is free software; you can redistribute it and/or modify9* it under the terms of the GNU General Public License as published by10* the Free Software Foundation; either version 2, or (at your option)11* any later version.12*13* this is distributed in the hope that it will be useful,14* but WITHOUT ANY WARRANTY; without even the implied warranty of15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16* GNU General Public License for more details.17*18* You should have received a copy of the GNU General Public License19* along with GNU Make; see the file COPYING. If not, write to20* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.21*/2223#ifndef __TXCACHE_H__24#define __TXCACHE_H__2526#include "TxInternal.h"27#include "TxUtil.h"28#include <list>29#include <map>30#include <string>3132class TxCache33{34private:35std::list<uint64> _cachelist;36uint8 *_gzdest0;37uint8 *_gzdest1;38uint32 _gzdestLen;39protected:40int _options;41std::wstring _ident;42std::wstring _datapath;43std::wstring _cachepath;44dispInfoFuncExt _callback;45TxUtil *_txUtil;46struct TXCACHE {47int size;48GHQTexInfo info;49std::list<uint64>::iterator it;50};51int _totalSize;52int _cacheSize;53std::map<uint64, TXCACHE*> _cache;54boolean save(const wchar_t *path, const wchar_t *filename, const int config);55boolean load(const wchar_t *path, const wchar_t *filename, const int config);56boolean del(uint64 checksum); /* checksum hi:palette low:texture */57boolean is_cached(uint64 checksum); /* checksum hi:palette low:texture */58void clear();59public:60~TxCache();61TxCache(int options, int cachesize, const wchar_t *datapath,62const wchar_t *cachepath, const wchar_t *ident,63dispInfoFuncExt callback);64boolean add(uint64 checksum, /* checksum hi:palette low:texture */65GHQTexInfo *info, int dataSize = 0);66boolean get(uint64 checksum, /* checksum hi:palette low:texture */67GHQTexInfo *info);68};6970#endif /* __TXCACHE_H__ */717273