mirror of
https://github.com/blawar/GLideN64.git
synced 2024-06-25 22:09:35 +00:00
Add 'texture cache path' and 'texture dump path' config option.
Implemented request mult htc support #1383
This commit is contained in:
parent
e284f432d1
commit
2da7be29d4
|
@ -84,6 +84,10 @@ void Config::resetToDefaults()
|
|||
|
||||
api().GetUserDataPath(textureFilter.txPath);
|
||||
gln_wcscat(textureFilter.txPath, wst("/hires_texture"));
|
||||
api().GetUserCachePath(textureFilter.txCachePath);
|
||||
gln_wcscat(textureFilter.txCachePath, wst("/cache"));
|
||||
api().GetUserCachePath(textureFilter.txDumpPath);
|
||||
gln_wcscat(textureFilter.txDumpPath, wst("/texture_dump"));
|
||||
|
||||
#ifdef OS_WINDOWS
|
||||
font.name.assign("arial.ttf");
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
#include <string>
|
||||
#include "Types.h"
|
||||
|
||||
#define CONFIG_VERSION_CURRENT 19U
|
||||
#define CONFIG_VERSION_CURRENT 20U
|
||||
|
||||
#define BILINEAR_3POINT 0
|
||||
#define BILINEAR_STANDARD 1
|
||||
|
@ -130,7 +130,9 @@ struct Config
|
|||
u32 txCacheCompression; // Zip textures cache
|
||||
u32 txSaveCache; // Save texture cache to hard disk
|
||||
|
||||
wchar_t txPath[PLUGIN_PATH_SIZE];
|
||||
wchar_t txPath[PLUGIN_PATH_SIZE]; // Path to texture packs
|
||||
wchar_t txCachePath[PLUGIN_PATH_SIZE]; // Path to store texture cache, that is .htc files
|
||||
wchar_t txDumpPath[PLUGIN_PATH_SIZE]; // Path to store texture dumps
|
||||
} textureFilter;
|
||||
|
||||
struct
|
||||
|
|
|
@ -220,7 +220,8 @@ extern "C"{
|
|||
|
||||
TAPI boolean TAPIENTRY
|
||||
txfilter_init(int maxwidth, int maxheight, int maxbpp, int options, int cachesize,
|
||||
const wchar_t *path, const wchar_t * texPackPath, const wchar_t*ident, dispInfoFuncExt callback);
|
||||
const wchar_t *txCachePath, const wchar_t *txDumpPath, const wchar_t * texPackPath,
|
||||
const wchar_t* ident, dispInfoFuncExt callback);
|
||||
|
||||
TAPI void TAPIENTRY
|
||||
txfilter_shutdown(void);
|
||||
|
|
|
@ -38,7 +38,7 @@ TxCache::~TxCache()
|
|||
clear();
|
||||
}
|
||||
|
||||
TxCache::TxCache(int options, int cachesize, const wchar_t *path, const wchar_t *ident,
|
||||
TxCache::TxCache(int options, int cachesize, const wchar_t *cachePath, const wchar_t *ident,
|
||||
dispInfoFuncExt callback)
|
||||
{
|
||||
_options = options;
|
||||
|
@ -47,8 +47,8 @@ TxCache::TxCache(int options, int cachesize, const wchar_t *path, const wchar_t
|
|||
_totalSize = 0;
|
||||
|
||||
/* save path name */
|
||||
if (path)
|
||||
_path.assign(path);
|
||||
if (cachePath)
|
||||
_cachePath.assign(cachePath);
|
||||
|
||||
/* save ROM name */
|
||||
if (ident)
|
||||
|
|
|
@ -39,7 +39,7 @@ private:
|
|||
protected:
|
||||
int _options;
|
||||
tx_wstring _ident;
|
||||
tx_wstring _path;
|
||||
tx_wstring _cachePath;
|
||||
dispInfoFuncExt _callback;
|
||||
struct TXCACHE {
|
||||
int size;
|
||||
|
@ -56,7 +56,7 @@ protected:
|
|||
void clear();
|
||||
public:
|
||||
~TxCache();
|
||||
TxCache(int options, int cachesize, const wchar_t *path, const wchar_t *ident,
|
||||
TxCache(int options, int cachesize, const wchar_t *cachePath, const wchar_t *ident,
|
||||
dispInfoFuncExt callback);
|
||||
boolean add(uint64 checksum, /* checksum hi:palette low:texture */
|
||||
GHQTexInfo *info, int dataSize = 0);
|
||||
|
|
|
@ -56,10 +56,22 @@ TxFilter::~TxFilter()
|
|||
clear();
|
||||
}
|
||||
|
||||
TxFilter::TxFilter(int maxwidth, int maxheight, int maxbpp, int options,
|
||||
int cachesize, const wchar_t * path, const wchar_t * texPackPath, const wchar_t * ident,
|
||||
dispInfoFuncExt callback) :
|
||||
_tex1(nullptr), _tex2(nullptr), _txQuantize(nullptr), _txTexCache(nullptr), _txHiResCache(nullptr), _txImage(nullptr)
|
||||
TxFilter::TxFilter(int maxwidth,
|
||||
int maxheight,
|
||||
int maxbpp,
|
||||
int options,
|
||||
int cachesize,
|
||||
const wchar_t * texCachePath,
|
||||
const wchar_t * texDumpPath,
|
||||
const wchar_t * texPackPath,
|
||||
const wchar_t * ident,
|
||||
dispInfoFuncExt callback)
|
||||
: _tex1(nullptr)
|
||||
, _tex2(nullptr)
|
||||
, _txQuantize(nullptr)
|
||||
, _txTexCache(nullptr)
|
||||
, _txHiResCache(nullptr)
|
||||
, _txImage(nullptr)
|
||||
{
|
||||
/* HACKALERT: the emulator misbehaves and sometimes forgets to shutdown */
|
||||
if ((ident && wcscmp(ident, wst("DEFAULT")) != 0 && _ident.compare(ident) == 0) &&
|
||||
|
@ -69,6 +81,8 @@ TxFilter::TxFilter(int maxwidth, int maxheight, int maxbpp, int options,
|
|||
_options == options &&
|
||||
_cacheSize == cachesize) return;
|
||||
// clear(); /* gcc does not allow the destructor to be called */
|
||||
if (texCachePath == nullptr || texDumpPath == nullptr || texPackPath == nullptr)
|
||||
return;
|
||||
|
||||
/* shamelessness :P this first call to the debug output message creates
|
||||
* a file in the executable directory. */
|
||||
|
@ -106,9 +120,9 @@ TxFilter::TxFilter(int maxwidth, int maxheight, int maxbpp, int options,
|
|||
|
||||
/* TODO: validate options and do overrides here*/
|
||||
|
||||
/* save path name */
|
||||
if (path)
|
||||
_path.assign(path);
|
||||
/* save pathes */
|
||||
if (texDumpPath)
|
||||
_dumpPath.assign(texDumpPath);
|
||||
|
||||
/* save ROM name */
|
||||
if (ident && wcscmp(ident, wst("DEFAULT")) != 0)
|
||||
|
@ -128,11 +142,11 @@ TxFilter::TxFilter(int maxwidth, int maxheight, int maxbpp, int options,
|
|||
#endif
|
||||
|
||||
/* initialize texture cache in bytes. 128Mb will do nicely in most cases */
|
||||
_txTexCache = new TxTexCache(_options, _cacheSize, _path.c_str(), _ident.c_str(), callback);
|
||||
_txTexCache = new TxTexCache(_options, _cacheSize, texCachePath, _ident.c_str(), callback);
|
||||
|
||||
/* hires texture */
|
||||
#if HIRES_TEXTURE
|
||||
_txHiResCache = new TxHiResCache(_maxwidth, _maxheight, _maxbpp, _options, _path.c_str(), texPackPath, _ident.c_str(), callback);
|
||||
_txHiResCache = new TxHiResCache(_maxwidth, _maxheight, _maxbpp, _options, texCachePath, texPackPath, _ident.c_str(), callback);
|
||||
|
||||
if (_txHiResCache->empty())
|
||||
_options &= ~HIRESTEXTURES_MASK;
|
||||
|
@ -586,13 +600,13 @@ TxFilter::dmptx(uint8 *src, int width, int height, int rowStridePixel, uint16 gf
|
|||
src = _tex1;
|
||||
}
|
||||
|
||||
if (!_path.empty() && !_ident.empty()) {
|
||||
if (!_dumpPath.empty() && !_ident.empty()) {
|
||||
/* dump it to disk */
|
||||
FILE *fp = nullptr;
|
||||
tx_wstring tmpbuf;
|
||||
|
||||
/* create directories */
|
||||
tmpbuf.assign(_path + wst("/texture_dump"));
|
||||
tmpbuf.assign(_dumpPath);
|
||||
tmpbuf.append(wst("/"));
|
||||
tmpbuf.append(_ident);
|
||||
tmpbuf.append(wst("/GLideNHQ"));
|
||||
|
|
|
@ -44,7 +44,7 @@ private:
|
|||
int _options;
|
||||
int _cacheSize;
|
||||
tx_wstring _ident;
|
||||
tx_wstring _path;
|
||||
tx_wstring _dumpPath;
|
||||
TxQuantize *_txQuantize;
|
||||
TxTexCache *_txTexCache;
|
||||
TxHiResCache *_txHiResCache;
|
||||
|
@ -58,9 +58,10 @@ public:
|
|||
int maxbpp,
|
||||
int options,
|
||||
int cachesize,
|
||||
const wchar_t *path,
|
||||
const wchar_t * texCachePath,
|
||||
const wchar_t * texDumpPath,
|
||||
const wchar_t * texPackPath,
|
||||
const wchar_t *ident,
|
||||
const wchar_t * ident,
|
||||
dispInfoFuncExt callback);
|
||||
boolean filter(uint8 *src,
|
||||
int srcwidth,
|
||||
|
|
|
@ -35,13 +35,13 @@ extern "C"{
|
|||
|
||||
TAPI boolean TAPIENTRY
|
||||
txfilter_init(int maxwidth, int maxheight, int maxbpp, int options, int cachesize,
|
||||
const wchar_t * path, const wchar_t * texPackPath, const wchar_t * ident,
|
||||
const wchar_t * txCachePath, const wchar_t* txDumpPath, const wchar_t * texPackPath, const wchar_t * ident,
|
||||
dispInfoFuncExt callback)
|
||||
{
|
||||
if (txFilter) return 0;
|
||||
|
||||
txFilter = new TxFilter(maxwidth, maxheight, maxbpp, options, cachesize,
|
||||
path, texPackPath, ident, callback);
|
||||
txCachePath, txDumpPath, texPackPath, ident, callback);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -51,10 +51,15 @@ TxHiResCache::~TxHiResCache()
|
|||
delete _txReSample;
|
||||
}
|
||||
|
||||
TxHiResCache::TxHiResCache(int maxwidth, int maxheight, int maxbpp, int options,
|
||||
const wchar_t *cachePath, const wchar_t *texPackPath, const wchar_t *ident,
|
||||
dispInfoFuncExt callback
|
||||
) : TxCache((options & ~GZ_TEXCACHE), 0, cachePath, ident, callback)
|
||||
TxHiResCache::TxHiResCache(int maxwidth,
|
||||
int maxheight,
|
||||
int maxbpp,
|
||||
int options,
|
||||
const wchar_t *cachePath,
|
||||
const wchar_t *texPackPath,
|
||||
const wchar_t *ident,
|
||||
dispInfoFuncExt callback)
|
||||
: TxCache((options & ~GZ_TEXCACHE), 0, cachePath, ident, callback)
|
||||
{
|
||||
_txImage = new TxImage();
|
||||
_txQuantize = new TxQuantize();
|
||||
|
@ -69,7 +74,7 @@ TxHiResCache::TxHiResCache(int maxwidth, int maxheight, int maxbpp, int options,
|
|||
if (texPackPath)
|
||||
_texPackPath.assign(texPackPath);
|
||||
|
||||
if (_path.empty() || _ident.empty()) {
|
||||
if (_cachePath.empty() || _ident.empty()) {
|
||||
_options &= ~DUMP_HIRESTEXCACHE;
|
||||
return;
|
||||
}
|
||||
|
@ -79,12 +84,9 @@ TxHiResCache::TxHiResCache(int maxwidth, int maxheight, int maxbpp, int options,
|
|||
/* find it on disk */
|
||||
tx_wstring filename = _ident + wst("_HIRESTEXTURES.") + TEXCACHE_EXT;
|
||||
removeColon(filename);
|
||||
tx_wstring cachepath(_path);
|
||||
cachepath += OSAL_DIR_SEPARATOR_STR;
|
||||
cachepath += wst("cache");
|
||||
int config = _options & (HIRESTEXTURES_MASK|TILE_HIRESTEX|FORCE16BPP_HIRESTEX|GZ_HIRESTEXCACHE|LET_TEXARTISTS_FLY);
|
||||
|
||||
_cacheDumped = TxCache::load(cachepath.c_str(), filename.c_str(), config);
|
||||
_cacheDumped = TxCache::load(_cachePath.c_str(), filename.c_str(), config);
|
||||
}
|
||||
|
||||
/* read in hires textures */
|
||||
|
@ -98,12 +100,9 @@ void TxHiResCache::dump()
|
|||
/* dump cache to disk */
|
||||
tx_wstring filename = _ident + wst("_HIRESTEXTURES.") + TEXCACHE_EXT;
|
||||
removeColon(filename);
|
||||
tx_wstring cachepath(_path);
|
||||
cachepath += OSAL_DIR_SEPARATOR_STR;
|
||||
cachepath += wst("cache");
|
||||
int config = _options & (HIRESTEXTURES_MASK|TILE_HIRESTEX|FORCE16BPP_HIRESTEX|GZ_HIRESTEXCACHE|LET_TEXARTISTS_FLY);
|
||||
|
||||
_cacheDumped = TxCache::save(cachepath.c_str(), filename.c_str(), config);
|
||||
_cacheDumped = TxCache::save(_cachePath.c_str(), filename.c_str(), config);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,8 +144,6 @@ boolean TxHiResCache::load(boolean replace) /* 0 : reload, 1 : replace partial *
|
|||
_cache.clear();
|
||||
}
|
||||
return res == resOk ? 1 : 0;
|
||||
defauilt:
|
||||
break;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -55,9 +55,14 @@ private:
|
|||
LoadResult loadHiResTextures(const wchar_t * dir_path, boolean replace);
|
||||
public:
|
||||
~TxHiResCache();
|
||||
TxHiResCache(int maxwidth, int maxheight, int maxbpp, int options,
|
||||
const wchar_t *cachePath, const wchar_t *texPackPath, const wchar_t *ident,
|
||||
dispInfoFuncExt callback);
|
||||
TxHiResCache(int maxwidth,
|
||||
int maxheight,
|
||||
int maxbpp,
|
||||
int options,
|
||||
const wchar_t *cachePath,
|
||||
const wchar_t *texPackPath,
|
||||
const wchar_t *ident,
|
||||
dispInfoFuncExt callback);
|
||||
boolean empty();
|
||||
boolean load(boolean replace);
|
||||
void dump();
|
||||
|
|
|
@ -34,12 +34,12 @@ TxTexCache::~TxTexCache()
|
|||
{
|
||||
}
|
||||
|
||||
TxTexCache::TxTexCache(int options, int cachesize, const wchar_t *path, const wchar_t *ident,
|
||||
TxTexCache::TxTexCache(int options, int cachesize, const wchar_t *cachePath, const wchar_t *ident,
|
||||
dispInfoFuncExt callback
|
||||
) : TxCache((options & ~GZ_HIRESTEXCACHE), cachesize, path, ident, callback)
|
||||
) : TxCache((options & ~GZ_HIRESTEXCACHE), cachesize, cachePath, ident, callback)
|
||||
{
|
||||
/* assert local options */
|
||||
if (_path.empty() || _ident.empty() || !_cacheSize)
|
||||
if (_cachePath.empty() || _ident.empty() || !_cacheSize)
|
||||
_options &= ~DUMP_TEXCACHE;
|
||||
|
||||
_cacheDumped = 0;
|
||||
|
@ -48,12 +48,9 @@ TxTexCache::TxTexCache(int options, int cachesize, const wchar_t *path, const wc
|
|||
/* find it on disk */
|
||||
tx_wstring filename = _ident + wst("_MEMORYCACHE.") + TEXCACHE_EXT;
|
||||
removeColon(filename);
|
||||
tx_wstring cachepath(_path);
|
||||
cachepath += OSAL_DIR_SEPARATOR_STR;
|
||||
cachepath += wst("cache");
|
||||
int config = _options & (FILTER_MASK | ENHANCEMENT_MASK | FORCE16BPP_TEX | GZ_TEXCACHE);
|
||||
|
||||
_cacheDumped = TxCache::load(cachepath.c_str(), filename.c_str(), config);
|
||||
_cacheDumped = TxCache::load(_cachePath.c_str(), filename.c_str(), config);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -76,11 +73,8 @@ TxTexCache::dump()
|
|||
/* dump cache to disk */
|
||||
tx_wstring filename = _ident + wst("_MEMORYCACHE.") + TEXCACHE_EXT;
|
||||
removeColon(filename);
|
||||
tx_wstring cachepath(_path);
|
||||
cachepath += OSAL_DIR_SEPARATOR_STR;
|
||||
cachepath += wst("cache");
|
||||
int config = _options & (FILTER_MASK | ENHANCEMENT_MASK | FORCE16BPP_TEX | GZ_TEXCACHE);
|
||||
|
||||
_cacheDumped = TxCache::save(cachepath.c_str(), filename.c_str(), config);
|
||||
_cacheDumped = TxCache::save(_cachePath.c_str(), filename.c_str(), config);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ private:
|
|||
|
||||
public:
|
||||
~TxTexCache();
|
||||
TxTexCache(int options, int cachesize, const wchar_t *path, const wchar_t *ident,
|
||||
TxTexCache(int options, int cachesize, const wchar_t *cachePath, const wchar_t *ident,
|
||||
dispInfoFuncExt callback);
|
||||
boolean add(uint64 checksum, /* checksum hi:palette low:texture */
|
||||
GHQTexInfo *info);
|
||||
|
|
|
@ -160,7 +160,7 @@ void ConfigDialog::_init()
|
|||
ui->copyColorBufferComboBox->setCurrentIndex(config.frameBufferEmulation.copyToRDRAM);
|
||||
ui->copyDepthBufferComboBox->setCurrentIndex(config.frameBufferEmulation.copyDepthToRDRAM);
|
||||
ui->RenderFBCheckBox->setChecked(config.frameBufferEmulation.copyFromRDRAM != 0);
|
||||
ui->n64DepthCompareCheckBox->toggle();
|
||||
ui->n64DepthCompareCheckBox->toggle();
|
||||
ui->n64DepthCompareCheckBox->setChecked(config.frameBufferEmulation.N64DepthCompare != 0);
|
||||
|
||||
switch (config.frameBufferEmulation.aspect) {
|
||||
|
@ -220,6 +220,8 @@ void ConfigDialog::_init()
|
|||
ui->saveTextureCacheCheckBox->setChecked(config.textureFilter.txSaveCache != 0);
|
||||
|
||||
ui->txPathLabel->setText(QString::fromWCharArray(config.textureFilter.txPath));
|
||||
ui->txCachePathLabel->setText(QString::fromWCharArray(config.textureFilter.txCachePath));
|
||||
ui->txDumpPathLabel->setText(QString::fromWCharArray(config.textureFilter.txDumpPath));
|
||||
|
||||
// Post filter settings
|
||||
ui->gammaCorrectionGroupBox->setChecked(config.gammaCorrection.force != 0);
|
||||
|
@ -449,6 +451,12 @@ void ConfigDialog::accept()
|
|||
QString txPath = ui->txPathLabel->text();
|
||||
if (!txPath.isEmpty())
|
||||
config.textureFilter.txPath[txPath.toWCharArray(config.textureFilter.txPath)] = L'\0';
|
||||
QString txCachePath = ui->txCachePathLabel->text();
|
||||
if (!txPath.isEmpty())
|
||||
config.textureFilter.txCachePath[txCachePath.toWCharArray(config.textureFilter.txCachePath)] = L'\0';
|
||||
QString txDumpPath = ui->txDumpPathLabel->text();
|
||||
if (!txDumpPath.isEmpty())
|
||||
config.textureFilter.txDumpPath[txDumpPath.toWCharArray(config.textureFilter.txDumpPath)] = L'\0';
|
||||
|
||||
// Post filter settings
|
||||
config.gammaCorrection.force = ui->gammaCorrectionGroupBox->isChecked() ? 1 : 0;
|
||||
|
@ -560,6 +568,29 @@ void ConfigDialog::on_texPackPathButton_clicked()
|
|||
ui->txPathLabel->setText(directory);
|
||||
}
|
||||
|
||||
|
||||
void ConfigDialog::on_texCachePathButton_clicked()
|
||||
{
|
||||
QFileDialog::Options options = QFileDialog::DontResolveSymlinks | QFileDialog::ShowDirsOnly | QFileDialog::ReadOnly | QFileDialog::DontUseSheet | QFileDialog::ReadOnly | QFileDialog::HideNameFilterDetails;
|
||||
QString directory = QFileDialog::getExistingDirectory(this,
|
||||
"",
|
||||
ui->txCachePathLabel->text(),
|
||||
options);
|
||||
if (!directory.isEmpty())
|
||||
ui->txCachePathLabel->setText(directory);
|
||||
}
|
||||
|
||||
void ConfigDialog::on_texDumpPathButton_clicked()
|
||||
{
|
||||
QFileDialog::Options options = QFileDialog::DontResolveSymlinks | QFileDialog::ShowDirsOnly | QFileDialog::ReadOnly | QFileDialog::DontUseSheet | QFileDialog::ReadOnly | QFileDialog::HideNameFilterDetails;
|
||||
QString directory = QFileDialog::getExistingDirectory(this,
|
||||
"",
|
||||
ui->txDumpPathLabel->text(),
|
||||
options);
|
||||
if (!directory.isEmpty())
|
||||
ui->txDumpPathLabel->setText(directory);
|
||||
}
|
||||
|
||||
void ConfigDialog::on_windowedResolutionComboBox_currentIndexChanged(int index)
|
||||
{
|
||||
if (index < numWindowedModes)
|
||||
|
|
|
@ -39,7 +39,7 @@ private slots:
|
|||
void on_cropImageComboBox_currentIndexChanged(int index);
|
||||
|
||||
void on_frameBufferCheckBox_toggled(bool checked);
|
||||
|
||||
|
||||
void on_aliasingSlider_valueChanged(int value);
|
||||
|
||||
void on_fontTreeWidget_currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
|
||||
|
@ -48,6 +48,10 @@ private slots:
|
|||
|
||||
void on_tabWidget_currentChanged(int tab);
|
||||
|
||||
void on_texCachePathButton_clicked();
|
||||
|
||||
void on_texDumpPathButton_clicked();
|
||||
|
||||
private:
|
||||
void _init();
|
||||
void _getTranslations(QStringList & _translationFiles) const;
|
||||
|
|
|
@ -79,6 +79,10 @@ void _loadSettings(QSettings & settings)
|
|||
config.textureFilter.txSaveCache = settings.value("txSaveCache", config.textureFilter.txSaveCache).toInt();
|
||||
QString txPath = QString::fromWCharArray(config.textureFilter.txPath);
|
||||
config.textureFilter.txPath[settings.value("txPath", txPath).toString().toWCharArray(config.textureFilter.txPath)] = L'\0';
|
||||
QString txCachePath = QString::fromWCharArray(config.textureFilter.txCachePath);
|
||||
config.textureFilter.txCachePath[settings.value("txCachePath", txCachePath).toString().toWCharArray(config.textureFilter.txCachePath)] = L'\0';
|
||||
QString txDumpPath = QString::fromWCharArray(config.textureFilter.txDumpPath);
|
||||
config.textureFilter.txDumpPath[settings.value("txDumpPath", txDumpPath).toString().toWCharArray(config.textureFilter.txDumpPath)] = L'\0';
|
||||
|
||||
settings.endGroup();
|
||||
|
||||
|
@ -199,6 +203,8 @@ void writeSettings(const QString & _strIniFolder)
|
|||
settings.setValue("txCacheCompression", config.textureFilter.txCacheCompression);
|
||||
settings.setValue("txSaveCache", config.textureFilter.txSaveCache);
|
||||
settings.setValue("txPath", QString::fromWCharArray(config.textureFilter.txPath));
|
||||
settings.setValue("txCachePath", QString::fromWCharArray(config.textureFilter.txCachePath));
|
||||
settings.setValue("txDumpPath", QString::fromWCharArray(config.textureFilter.txDumpPath));
|
||||
settings.endGroup();
|
||||
|
||||
settings.beginGroup("font");
|
||||
|
|
|
@ -2393,6 +2393,92 @@
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="txPackCacheLabel">
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="texCachePathLabel">
|
||||
<property name="text">
|
||||
<string>Texture cache path:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>texCachePathButton</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="txCachePathLabel">
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="texCachePathButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="txCacheDumpLabel">
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="texDumpPathLabel">
|
||||
<property name="text">
|
||||
<string>Texture dump path:</string>
|
||||
</property>
|
||||
<property name="buddy">
|
||||
<cstring>texDumpPathButton</cstring>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="txDumpPathLabel">
|
||||
<property name="text">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="texDumpPathButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Browse...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -75,6 +75,7 @@ void TextureFilterHandler::init()
|
|||
s32 maxTextureSize = gfxContext.getMaxTextureSize();
|
||||
wchar_t wRomName[32];
|
||||
::mbstowcs(wRomName, RSP.romname, 32);
|
||||
|
||||
wchar_t txPath[PLUGIN_PATH_SIZE + 16];
|
||||
wchar_t * pTexPackPath = config.textureFilter.txPath;
|
||||
if (::wcslen(config.textureFilter.txPath) == 0) {
|
||||
|
@ -82,15 +83,30 @@ void TextureFilterHandler::init()
|
|||
gln_wcscat(txPath, wst("/hires_texture"));
|
||||
pTexPackPath = txPath;
|
||||
}
|
||||
wchar_t txCachePath[PLUGIN_PATH_SIZE];
|
||||
api().GetUserCachePath(txCachePath);
|
||||
|
||||
wchar_t txCachePath[PLUGIN_PATH_SIZE + 16];
|
||||
wchar_t * pTexCachePath = config.textureFilter.txCachePath;
|
||||
if (::wcslen(config.textureFilter.txCachePath) == 0) {
|
||||
api().GetUserCachePath(txCachePath);
|
||||
gln_wcscat(txPath, wst("/cache"));
|
||||
pTexCachePath = txCachePath;
|
||||
}
|
||||
|
||||
wchar_t txDumpPath[PLUGIN_PATH_SIZE + 16];
|
||||
wchar_t * pTexDumpPath = config.textureFilter.txDumpPath;
|
||||
if (::wcslen(config.textureFilter.txDumpPath) == 0) {
|
||||
api().GetUserCachePath(txDumpPath);
|
||||
gln_wcscat(txPath, wst("/texture_dump"));
|
||||
pTexDumpPath = txDumpPath;
|
||||
}
|
||||
|
||||
m_inited = txfilter_init(maxTextureSize, // max texture width supported by hardware
|
||||
maxTextureSize, // max texture height supported by hardware
|
||||
32, // max texture bpp supported by hardware
|
||||
m_options,
|
||||
config.textureFilter.txCacheSize, // cache texture to system memory
|
||||
txCachePath, // path to store cache files
|
||||
pTexCachePath, // path to store cache files
|
||||
pTexDumpPath, // path to folder with dumped textures
|
||||
pTexPackPath, // path to texture packs folder
|
||||
wRomName, // name of ROM. must be no longer than 256 characters
|
||||
displayLoadProgress);
|
||||
|
|
|
@ -144,6 +144,12 @@ bool Config_SetDefault()
|
|||
wcstombs(txPath, config.textureFilter.txPath, PLUGIN_PATH_SIZE * 2);
|
||||
res = ConfigSetDefaultString(g_configVideoGliden64, "txPath", txPath, "Path to folder with hi-res texture packs.");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
wcstombs(txPath, config.textureFilter.txCachePath, PLUGIN_PATH_SIZE * 2);
|
||||
res = ConfigSetDefaultString(g_configVideoGliden64, "txCachePath", txPath, "Path to folder where plugin saves texture cache files.");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
wcstombs(txPath, config.textureFilter.txDumpPath, PLUGIN_PATH_SIZE * 2);
|
||||
res = ConfigSetDefaultString(g_configVideoGliden64, "txDumpPath", txPath, "Path to folder where plugin saves dumped textures.");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
|
||||
res = ConfigSetDefaultString(g_configVideoGliden64, "fontName", config.font.name.c_str(), "File name of True Type Font for text messages.");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
|
@ -355,6 +361,7 @@ void Config_LoadConfig()
|
|||
config.textureFilter.txCacheCompression = ConfigGetParamBool(g_configVideoGliden64, "txCacheCompression");
|
||||
config.textureFilter.txSaveCache = ConfigGetParamBool(g_configVideoGliden64, "txSaveCache");
|
||||
::mbstowcs(config.textureFilter.txPath, ConfigGetParamString(g_configVideoGliden64, "txPath"), PLUGIN_PATH_SIZE);
|
||||
::mbstowcs(config.textureFilter.txCachePath, ConfigGetParamString(g_configVideoGliden64, "txCachePath"), PLUGIN_PATH_SIZE);
|
||||
|
||||
//#Font settings
|
||||
config.font.name = ConfigGetParamString(g_configVideoGliden64, "fontName");
|
||||
|
|
Loading…
Reference in New Issue
Block a user