fix crashes, add custom texture cache, load textures from load directory

This commit is contained in:
Khangaroo 2019-08-06 08:43:24 -04:00 committed by James Rowe
parent f866b2a917
commit 6d90c42a79
16 changed files with 167 additions and 49 deletions

View file

@ -231,9 +231,11 @@ void Config::ReadControlValues() {
}
void Config::ReadUtilityValues() {
qt_config->beginGroup("Utility");
Settings::values.dump_textures = ReadSetting("dump_textures", false).toBool();
Settings::values.custom_textures = ReadSetting("custom_textures", false).toBool();
qt_config->endGroup();
}
@ -704,6 +706,7 @@ void Config::SaveUtilityValues() {
qt_config->beginGroup("Utility");
WriteSetting("dump_textures", Settings::values.dump_textures, false);
WriteSetting("custom_textures", Settings::values.custom_textures, false);
qt_config->endGroup();
}

View file

@ -88,6 +88,7 @@ void ConfigureGraphics::ApplyConfiguration() {
static_cast<Settings::LayoutOption>(ui->layout_combobox->currentIndex());
Settings::values.swap_screen = ui->swap_screen->isChecked();
Settings::values.dump_textures = ui->toggle_dump_textures->isChecked();
Settings::values.custom_textures = ui->toggle_custom_textures->isChecked();
Settings::values.bg_red = static_cast<float>(bg_color.redF());
Settings::values.bg_green = static_cast<float>(bg_color.greenF());
Settings::values.bg_blue = static_cast<float>(bg_color.blueF());

View file

@ -334,6 +334,16 @@
<string>Utility</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_4">
<item>
<widget class="QCheckBox" name="toggle_custom_textures">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Replace textures with PNG files.&lt;/p&gt;&lt;p&gt;Textures are loaded from load/textures/[Title ID]/.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Use Custom Textures (Hardware Renderer only)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="toggle_dump_textures">
<property name="toolTip">
@ -347,19 +357,6 @@
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>