Skip to content

Commit

Permalink
CheatSearchTab: Display floating point equivalent results
Browse files Browse the repository at this point in the history
  • Loading branch information
lioncash committed Aug 6, 2015
1 parent 2aa7d2f commit 14535ec
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Source/Core/DolphinWX/Cheats/CheatSearchTab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// Refer to the license.txt file included.

#include <array>
#include <cstring>
#include <wx/button.h>
#include <wx/choice.h>
#include <wx/listctrl.h>
Expand Down Expand Up @@ -294,6 +295,11 @@ void CheatSearchTab::UpdateCheatSearchResultsList()

buf.Printf("0x%08X", display_value);
m_lview_search_results->SetItem(index, 1, buf);

float display_value_float = 0.0f;
std::memcpy(&display_value_float, &display_value, sizeof(float));
buf.Printf("%e", display_value_float);
m_lview_search_results->SetItem(index, 2, buf);
}

m_lview_search_results->Thaw();
Expand All @@ -320,4 +326,5 @@ void CheatSearchTab::ResetListViewColumns()
{
m_lview_search_results->AppendColumn(_("Address"));
m_lview_search_results->AppendColumn(_("Value"));
m_lview_search_results->AppendColumn(_("Value (floating point)"));
}

0 comments on commit 14535ec

Please sign in to comment.