Skip to content

Commit

Permalink
Add texture dump/replace hotkeys.
Browse files Browse the repository at this point in the history
  • Loading branch information
LunaMoo committed Mar 26, 2019
1 parent 47ce2fc commit 1fa7bbc
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Common/KeyMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -668,6 +668,8 @@ const KeyMap_IntStrPair psp_button_names[] = {

{VIRTKEY_AXIS_SWAP, "AxisSwap"},
{VIRTKEY_DEVMENU, "DevMenu"},
{VIRTKEY_TEXTURE_DUMP, "Texture Dumping"},
{VIRTKEY_TEXTURE_REPLACE, "Texture Replacement"},

{CTRL_HOME, "Home"},
{CTRL_HOLD, "Hold"},
Expand Down
2 changes: 2 additions & 0 deletions Common/KeyMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ enum {
VIRTKEY_RECORD = 0x40000016,
VIRTKEY_SPEED_CUSTOM1 = 0x40000017,
VIRTKEY_SPEED_CUSTOM2 = 0x40000018,
VIRTKEY_TEXTURE_DUMP = 0x40000019,
VIRTKEY_TEXTURE_REPLACE = 0x4000001A,
VIRTKEY_LAST,
VIRTKEY_COUNT = VIRTKEY_LAST - VIRTKEY_FIRST
};
Expand Down
18 changes: 18 additions & 0 deletions UI/EmuScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,24 @@ void EmuScreen::onVKeyDown(int virtualKeyCode) {
case VIRTKEY_TOGGLE_FULLSCREEN:
System_SendMessage("toggle_fullscreen", "");
break;

case VIRTKEY_TEXTURE_DUMP:
g_Config.bSaveNewTextures = !g_Config.bSaveNewTextures;
if (g_Config.bSaveNewTextures) {
osm.Show(sc->T("saveNewTextures_true", "Textures will now be saved to your storage"), 2.0);
NativeMessageReceived("gpu_clearCache", "");
} else {
osm.Show(sc->T("saveNewTextures_false", "Texture saving was disabled"), 2.0);
}
break;
case VIRTKEY_TEXTURE_REPLACE:
g_Config.bReplaceTextures = !g_Config.bReplaceTextures;
if (g_Config.bReplaceTextures)
osm.Show(sc->T("replaceTextures_true", "Texture replacement enabled"), 2.0);
else
osm.Show(sc->T("replaceTextures_false", "Textures no longer are being replaced"), 2.0);
NativeMessageReceived("gpu_clearCache", "");
break;
}
}

Expand Down

0 comments on commit 1fa7bbc

Please sign in to comment.