mirror of
https://github.com/blawar/GLideN64.git
synced 2024-06-30 08:24:05 +00:00
Separate "Dump" and "Reload" options.
This commit is contained in:
parent
156171bebd
commit
7228d0d5db
|
@ -92,6 +92,7 @@ void Config::resetToDefaults()
|
|||
textureFilter.txHiresFullAlphaChannel = 1;
|
||||
textureFilter.txHresAltCRC = 0;
|
||||
textureFilter.txDump = 0;
|
||||
textureFilter.txReloadHiresTex = 0;
|
||||
|
||||
textureFilter.txForce16bpp = 0;
|
||||
textureFilter.txCacheCompression = 1;
|
||||
|
|
|
@ -168,6 +168,7 @@ struct Config
|
|||
u32 txHiresFullAlphaChannel; // Use alpha channel fully
|
||||
u32 txHresAltCRC; // Use alternative method of paletted textures CRC calculation
|
||||
u32 txDump; // Dump textures
|
||||
u32 txReloadHiresTex; // Reload hires textures
|
||||
|
||||
u32 txForce16bpp; // Force use 16bit color textures
|
||||
u32 txCacheCompression; // Zip textures cache
|
||||
|
|
|
@ -270,6 +270,8 @@ void ConfigDialog::_init(bool reInit, bool blockCustomSettings)
|
|||
ui->alternativeCRCCheckBox->setChecked(config.textureFilter.txHresAltCRC != 0);
|
||||
ui->textureDumpCheckBox->toggle();
|
||||
ui->textureDumpCheckBox->setChecked(config.textureFilter.txDump != 0);
|
||||
ui->textureReloadCheckBox->toggle();
|
||||
ui->textureReloadCheckBox->setChecked(config.textureFilter.txReloadHiresTex != 0);
|
||||
ui->force16bppCheckBox->setChecked(config.textureFilter.txForce16bpp != 0);
|
||||
ui->compressCacheCheckBox->setChecked(config.textureFilter.txCacheCompression != 0);
|
||||
ui->saveTextureCacheCheckBox->setChecked(config.textureFilter.txSaveCache != 0);
|
||||
|
@ -547,6 +549,7 @@ void ConfigDialog::accept(bool justSave) {
|
|||
config.textureFilter.txHiresFullAlphaChannel = ui->alphaChannelCheckBox->isChecked() ? 1 : 0;
|
||||
config.textureFilter.txHresAltCRC = ui->alternativeCRCCheckBox->isChecked() ? 1 : 0;
|
||||
config.textureFilter.txDump = ui->textureDumpCheckBox->isChecked() ? 1 : 0;
|
||||
config.textureFilter.txReloadHiresTex = ui->textureReloadCheckBox->isChecked() ? 1 : 0;
|
||||
|
||||
config.textureFilter.txCacheCompression = ui->compressCacheCheckBox->isChecked() ? 1 : 0;
|
||||
config.textureFilter.txForce16bpp = ui->force16bppCheckBox->isChecked() ? 1 : 0;
|
||||
|
|
|
@ -92,6 +92,7 @@ void _loadSettings(QSettings & settings)
|
|||
config.textureFilter.txHiresFullAlphaChannel = settings.value("txHiresFullAlphaChannel", config.textureFilter.txHiresFullAlphaChannel).toInt();
|
||||
config.textureFilter.txHresAltCRC = settings.value("txHresAltCRC", config.textureFilter.txHresAltCRC).toInt();
|
||||
config.textureFilter.txDump = settings.value("txDump", config.textureFilter.txDump).toInt();
|
||||
config.textureFilter.txReloadHiresTex = settings.value("txReloadHiresTex", config.textureFilter.txReloadHiresTex).toInt();
|
||||
config.textureFilter.txForce16bpp = settings.value("txForce16bpp", config.textureFilter.txForce16bpp).toInt();
|
||||
config.textureFilter.txCacheCompression = settings.value("txCacheCompression", config.textureFilter.txCacheCompression).toInt();
|
||||
config.textureFilter.txSaveCache = settings.value("txSaveCache", config.textureFilter.txSaveCache).toInt();
|
||||
|
@ -267,6 +268,7 @@ void writeSettings(const QString & _strIniFolder)
|
|||
settings.setValue("txHiresFullAlphaChannel", config.textureFilter.txHiresFullAlphaChannel);
|
||||
settings.setValue("txHresAltCRC", config.textureFilter.txHresAltCRC);
|
||||
settings.setValue("txDump", config.textureFilter.txDump);
|
||||
settings.setValue("txReloadHiresTex", config.textureFilter.txReloadHiresTex);
|
||||
settings.setValue("txForce16bpp", config.textureFilter.txForce16bpp);
|
||||
settings.setValue("txCacheCompression", config.textureFilter.txCacheCompression);
|
||||
settings.setValue("txSaveCache", config.textureFilter.txSaveCache);
|
||||
|
@ -461,6 +463,7 @@ void saveCustomRomSettings(const QString & _strIniFolder, const char * _strRomNa
|
|||
WriteCustomSetting(textureFilter, txHiresFullAlphaChannel);
|
||||
WriteCustomSetting(textureFilter, txHresAltCRC);
|
||||
WriteCustomSetting(textureFilter, txDump);
|
||||
WriteCustomSetting(textureFilter, txReloadHiresTex);
|
||||
WriteCustomSetting(textureFilter, txForce16bpp);
|
||||
WriteCustomSetting(textureFilter, txCacheCompression);
|
||||
WriteCustomSetting(textureFilter, txSaveCache);
|
||||
|
|
|
@ -2679,6 +2679,9 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="hiresTexFileStorageCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This option enables alternative storage for hi-res textures.</p><p>Normally memory cache is used. It keeps all hi-res textures in RAM and thus limited by available RAM size.</p><p>File storage keeps texture cache on HDD. It is slower than memory cache, but has virtually no limits on cache size.</p><p>Disable &quot;Compress texture cache&quot; option for better performance.</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Use file storage instead of memory cache</string>
|
||||
</property>
|
||||
|
@ -2690,10 +2693,20 @@
|
|||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This option dumps textures on screen to a texture pack folder. You can also reload textures while the game is running to see how they look instantly—big time saver!</p><p>Hotkeys:<br/>Use <span style=" font-weight:600;">R</span> to reload textures from the texture pack<br/>Use <span style=" font-weight:600;">D</span> to toggle texture dumping on or off</p></body></html></string>
|
||||
<string><html><head/><body><p>This option dumps textures on screen to a texture pack folder. </p><p>Hotkey:<br/>Use <span style=" font-weight:600;">D</span> to toggle texture dumping on or off</p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Dump/edit textures</string>
|
||||
<string>Press 'd' to dump N64 textures (for texture artists)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="textureReloadCheckBox">
|
||||
<property name="toolTip">
|
||||
<string><html><head/><body><p>This option allows texture artists to reload hi-res textures while the game is running to instantly see how they look —big time saver!</p><p>Hotkey:<br/>Use <span style=" font-weight:600;">R</span> to reload textures from the texture pack<br/></p></body></html></string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Press 'r' to reload hi-res textures (for texture artists)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -672,7 +672,7 @@ void _updateCachedTexture(const GHQTexInfo & _info, CachedTexture *_pTexture, u1
|
|||
|
||||
_pTexture->scaleS = 1.0f / (_pTexture->maskS ? f32(pow2(widthOrg)) : f32(widthOrg));
|
||||
_pTexture->scaleT = 1.0f / (_pTexture->maskT ? f32(pow2(heightOrg)) : f32(heightOrg));
|
||||
|
||||
|
||||
_pTexture->hdRatioS = f32(_info.width / _pTexture->width);
|
||||
_pTexture->hdRatioT = f32(_info.height / _pTexture->height);
|
||||
|
||||
|
@ -1449,24 +1449,29 @@ void TextureCache::_clear()
|
|||
|
||||
void TextureCache::update(u32 _t)
|
||||
{
|
||||
if (config.textureFilter.txHiresEnable != 0 && config.textureFilter.txDump != 0) {
|
||||
/* Force reload hi-res textures. Useful for texture artists */
|
||||
if (isKeyPressed(G64_VK_R, 0x0001)) {
|
||||
if (txfilter_reloadhirestex()) {
|
||||
_clear();
|
||||
if (config.textureFilter.txHiresEnable != 0) {
|
||||
if (config.textureFilter.txReloadHiresTex != 0) {
|
||||
/* Force reload hi-res textures. Useful for texture artists */
|
||||
if (isKeyPressed(G64_VK_R, 0x0001)) {
|
||||
if (txfilter_reloadhirestex()) {
|
||||
_clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
/* Turn on texture dump */
|
||||
else if (isKeyPressed(G64_VK_D, 0x0001)) {
|
||||
m_toggleDumpTex = !m_toggleDumpTex;
|
||||
if (m_toggleDumpTex) {
|
||||
displayLoadProgress(L"Texture dump - ON\n");
|
||||
_clear();
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
}
|
||||
else {
|
||||
displayLoadProgress(L"Texture dump - OFF\n");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
|
||||
if (config.textureFilter.txDump != 0) {
|
||||
/* Turn on texture dump */
|
||||
if (isKeyPressed(G64_VK_D, 0x0001)) {
|
||||
m_toggleDumpTex = !m_toggleDumpTex;
|
||||
if (m_toggleDumpTex) {
|
||||
displayLoadProgress(L"Texture dump - ON\n");
|
||||
_clear();
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
}
|
||||
else {
|
||||
displayLoadProgress(L"Texture dump - OFF\n");
|
||||
std::this_thread::sleep_for(std::chrono::seconds(1));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -167,7 +167,9 @@ bool Config_SetDefault()
|
|||
assert(res == M64ERR_SUCCESS);
|
||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "txHresAltCRC", config.textureFilter.txHresAltCRC, "Use alternative method of paletted textures CRC calculation.");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "txDump", config.textureFilter.txDump, "Enable dump of loaded N64 textures.");
|
||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "txDump", config.textureFilter.txDump, "Press 'd' to start dump of N64 textures.");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "txReloadHiresTex", config.textureFilter.txReloadHiresTex, "Press 'r' to reload HD textures.");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
res = ConfigSetDefaultBool(g_configVideoGliden64, "txCacheCompression", config.textureFilter.txCacheCompression, "Zip textures cache.");
|
||||
assert(res == M64ERR_SUCCESS);
|
||||
|
@ -369,6 +371,8 @@ void Config_LoadCustomConfig()
|
|||
if (result == M64ERR_SUCCESS) config.textureFilter.txHresAltCRC = atoi(value);
|
||||
result = ConfigExternalGetParameter(fileHandle, sectionName, "textureFilter\\txDump", value, sizeof(value));
|
||||
if (result == M64ERR_SUCCESS) config.textureFilter.txDump = atoi(value);
|
||||
result = ConfigExternalGetParameter(fileHandle, sectionName, "textureFilter\\txReloadHiresTex", value, sizeof(value));
|
||||
if (result == M64ERR_SUCCESS) config.textureFilter.txReloadHiresTex = atoi(value);
|
||||
result = ConfigExternalGetParameter(fileHandle, sectionName, "textureFilter\\txForce16bpp", value, sizeof(value));
|
||||
if (result == M64ERR_SUCCESS) config.textureFilter.txForce16bpp = atoi(value);
|
||||
result = ConfigExternalGetParameter(fileHandle, sectionName, "textureFilter\\txCacheCompression", value, sizeof(value));
|
||||
|
@ -461,6 +465,7 @@ void Config_LoadConfig()
|
|||
config.textureFilter.txHiresFullAlphaChannel = ConfigGetParamBool(g_configVideoGliden64, "txHiresFullAlphaChannel");
|
||||
config.textureFilter.txHresAltCRC = ConfigGetParamBool(g_configVideoGliden64, "txHresAltCRC");
|
||||
config.textureFilter.txDump = ConfigGetParamBool(g_configVideoGliden64, "txDump");
|
||||
config.textureFilter.txReloadHiresTex = ConfigGetParamBool(g_configVideoGliden64, "txReloadHiresTex");
|
||||
config.textureFilter.txForce16bpp = ConfigGetParamBool(g_configVideoGliden64, "txForce16bpp");
|
||||
config.textureFilter.txCacheCompression = ConfigGetParamBool(g_configVideoGliden64, "txCacheCompression");
|
||||
config.textureFilter.txSaveCache = ConfigGetParamBool(g_configVideoGliden64, "txSaveCache");
|
||||
|
|
Loading…
Reference in New Issue
Block a user