Fix issue 2019, fix hiding or showing games with country == Italy, France, Taiwan or Korea from the gamelist, add missing Korea flag to the gamelist and disable netplay from the menu until it can be made more usable.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5100 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
sl1nk3.s 2010-02-21 19:19:16 +00:00
parent d2a3dd435a
commit 3dc3c1c3b3
9 changed files with 346 additions and 39 deletions

View File

@ -2720,7 +2720,7 @@ DEFINE_LUA_FUNCTION(emulua_loadrom, "filename")
// Load game specific settings
IniFile game_ini;
std::string unique_id = StartUp.GetUniqueID();
StartUp.m_strGameIni = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + unique_id + ".ini";
StartUp.m_strGameIni = std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + unique_id + ".ini";
if (unique_id.size() == 6 && game_ini.Load(StartUp.m_strGameIni.c_str()))
{
// General settings

View File

@ -194,7 +194,8 @@ void CFrame::CreateMenu()
toolsMenu->Append(IDM_CHEATS, _T("Action &Replay Manager"));
#if defined(HAVE_SFML) && HAVE_SFML
toolsMenu->Append(IDM_NETPLAY, _T("Start &NetPlay"));
// Disabled for now, netplay doesn't quite work currently
// toolsMenu->Append(IDM_NETPLAY, _T("Start &NetPlay"));
#endif
if (DiscIO::CNANDContentManager::Access().GetNANDLoader(std::string (File::GetUserPath(D_WIIMENU_IDX))).IsValid())

View File

@ -42,6 +42,7 @@
#include "../resources/Flag_Japan.xpm"
#include "../resources/Flag_USA.xpm"
#include "../resources/Flag_Taiwan.xpm"
#include "../resources/Flag_Korea.xpm"
#include "../resources/Flag_Unknown.xpm"
#include "../resources/Platform_Wad.xpm"
@ -98,6 +99,9 @@ BEGIN_EVENT_TABLE(wxEmuStateTip, wxTipWindow)
END_EVENT_TABLE()
BEGIN_EVENT_TABLE(CGameListCtrl, wxListCtrl)
#ifdef _WIN32
EVT_PAINT(CGameListCtrl::OnPaintDrawImages)
#endif
EVT_SIZE(CGameListCtrl::OnSize)
EVT_RIGHT_DOWN(CGameListCtrl::OnRightClick)
EVT_LEFT_DOWN(CGameListCtrl::OnLeftClick)
@ -133,9 +137,9 @@ void CGameListCtrl::InitBitmaps()
{
m_imageListSmall = new wxImageList(96, 32);
SetImageList(m_imageListSmall, wxIMAGE_LIST_SMALL);
m_FlagImageIndex.resize(DiscIO::IVolume::NUMBER_OF_COUNTRIES);
wxIcon iconTemp;
m_FlagImageIndex.resize(DiscIO::IVolume::NUMBER_OF_COUNTRIES);
iconTemp.CopyFromBitmap(wxBitmap(Flag_Europe_xpm));
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_EUROPE] = m_imageListSmall->Add(iconTemp);
iconTemp.CopyFromBitmap(wxBitmap(Flag_France_xpm));
@ -144,13 +148,12 @@ void CGameListCtrl::InitBitmaps()
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_USA] = m_imageListSmall->Add(iconTemp);
iconTemp.CopyFromBitmap(wxBitmap(Flag_Japan_xpm));
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_JAPAN] = m_imageListSmall->Add(iconTemp);
iconTemp.CopyFromBitmap(wxBitmap(Flag_Unknown_xpm)); // TODO add korea flag
iconTemp.CopyFromBitmap(wxBitmap(Flag_Korea_xpm));
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_KOREA] = m_imageListSmall->Add(iconTemp);
iconTemp.CopyFromBitmap(wxBitmap(Flag_Italy_xpm));
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_ITALY] = m_imageListSmall->Add(iconTemp);
iconTemp.CopyFromBitmap(wxBitmap(Flag_Taiwan_xpm));
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_TAIWAN] = m_imageListSmall->Add(iconTemp);
iconTemp.CopyFromBitmap(wxBitmap(Flag_Unknown_xpm));
m_FlagImageIndex[DiscIO::IVolume::COUNTRY_SDK] = m_imageListSmall->Add(iconTemp);
iconTemp.CopyFromBitmap(wxBitmap(Flag_Unknown_xpm));
@ -327,19 +330,61 @@ std::string CGameListCtrl::GetGameNames() const
return m_gameList;
}
// This draws our icons on top of the gamelist, it's only used on Windows
void CGameListCtrl::OnPaintDrawImages(wxPaintEvent& event)
{
int i = 0, nState = 0;
IniFile ini;
wxRect itemRect;
wxPaintDC dc(this);
// Calls the default drawing code
wxControl::OnPaint(event);
// Draw the flags, platform icons and emustate icons on top if there's games to show
if (m_ISOFiles.size() != 0)
{
// Retrieve the topmost shown item and get drawing offsets
long top = GetTopItem();
int flagOffset = GetColumnWidth(0) + GetColumnWidth(1) + GetColumnWidth(2) + GetColumnWidth(3);
int stateOffset = flagOffset + GetColumnWidth(4) + GetColumnWidth(5);
// Only redraw shown lines
for (i = top; i < top + GetCountPerPage() + 2; i++)
{
if (GetItemRect(i, itemRect))
{
int itemY = itemRect.GetTop();
const GameListItem& rISOFile = m_ISOFiles[GetItemData(i)];
m_imageListSmall->Draw(m_PlatformImageIndex[rISOFile.GetPlatform()], dc, itemRect.GetX()+3, itemY);
m_imageListSmall->Draw(m_FlagImageIndex[rISOFile.GetCountry()], dc, flagOffset, itemY);
ini.Load((std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + (rISOFile.GetUniqueID()) + ".ini").c_str());
ini.Get("EmuState", "EmulationStateId", &nState);
m_imageListSmall->Draw(m_EmuStateImageIndex[nState], dc, stateOffset, itemY);
}
}
}
}
void CGameListCtrl::InsertItemInReportView(long _Index)
{
// When using wxListCtrl, there is no hope of per-column text colors.
// But for reference, here are the old colors that were used: (BGR)
// title: 0xFF0000
// company: 0x007030
int ImageIndex = -1;
wxCSConv SJISConv(wxFontMapper::GetEncodingName(wxFONTENCODING_SHIFT_JIS));
GameListItem& rISOFile = m_ISOFiles[_Index];
// Insert a row with the platform image, that will be used as the Index
m_gamePath.append(rISOFile.GetFileName() + '\n');
// Insert a first row with the platform image, that will be used as the Index
#ifndef _WIN32
long ItemIndex = InsertItem(_Index, wxEmptyString, m_PlatformImageIndex[rISOFile.GetPlatform()]);
#else
long ItemIndex = InsertItem(_Index, wxEmptyString, -1);
#endif
if (rISOFile.GetImage().IsOk())
ImageIndex = m_imageListSmall->Add(rISOFile.GetImage());
@ -350,7 +395,6 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
if (rISOFile.GetPlatform() != GameListItem::WII_WAD)
{
std::string company;
m_gamePath.append(rISOFile.GetFileName() + '\n');
// We show the company string on Gamecube only
// On Wii we show the description instead as the company string is empty
@ -391,6 +435,7 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
SetItem(_Index, COLUMN_NOTES, wxString(rISOFile.GetDescription(0).c_str(), SJISConv), -1);
}
#ifndef _WIN32
// Load the INI file for columns that read from it
IniFile ini;
ini.Load((std::string(File::GetUserPath(D_GAMECONFIG_IDX)) + (rISOFile.GetUniqueID()) + ".ini").c_str());
@ -399,12 +444,15 @@ void CGameListCtrl::InsertItemInReportView(long _Index)
int nState;
ini.Get("EmuState", "EmulationStateId", &nState);
// File size + Emulation state
SetItem(_Index, COLUMN_SIZE, NiceSizeFormat(rISOFile.GetFileSize()), -1);
// Emulation state
SetItemColumnImage(_Index, COLUMN_EMULATION_STATE, m_EmuStateImageIndex[nState]);
// Country
SetItemColumnImage(_Index, COLUMN_COUNTRY, m_FlagImageIndex[rISOFile.GetCountry()]);
#endif
// File size
SetItem(_Index, COLUMN_SIZE, NiceSizeFormat(rISOFile.GetFileSize()), -1);
// Background color
SetBackgroundColor();
@ -535,8 +583,11 @@ void CGameListCtrl::ScanForISOs()
switch(ISOFile.GetCountry())
{
case DiscIO::IVolume::COUNTRY_TAIWAN:
if (!SConfig::GetInstance().m_ListTaiwan)
list = false;
case DiscIO::IVolume::COUNTRY_KOREA:
// TODO: Add these to interface choices, or combine with japan?
if (!SConfig::GetInstance().m_ListKorea)
list = false;
break;
case DiscIO::IVolume::COUNTRY_JAPAN:
if (!SConfig::GetInstance().m_ListJap)
@ -546,6 +597,14 @@ void CGameListCtrl::ScanForISOs()
if (!SConfig::GetInstance().m_ListUsa)
list = false;
break;
case DiscIO::IVolume::COUNTRY_FRANCE:
if (!SConfig::GetInstance().m_ListFrance)
list = false;
break;
case DiscIO::IVolume::COUNTRY_ITALY:
if (!SConfig::GetInstance().m_ListItaly)
list = false;
break;
default:
if (!SConfig::GetInstance().m_ListPal)
list = false;
@ -562,7 +621,7 @@ void CGameListCtrl::ScanForISOs()
std::vector<std::string> drives = cdio_get_devices();
GameListItem * Drive[24];
// Another silly Windows limitation of 24 drive letters
for (int i = 0; i < drives.size() && i < 24; i++)
for (u32 i = 0; i < drives.size() && i < 24; i++)
{
Drive[i] = new GameListItem(drives[i].c_str());
if (Drive[i]->IsValid()) m_ISOFiles.push_back(*Drive[i]);

View File

@ -89,6 +89,7 @@ private:
DECLARE_EVENT_TABLE()
// events
void OnPaintDrawImages(wxPaintEvent& event);
void OnLeftClick(wxMouseEvent& event);
void OnRightClick(wxMouseEvent& event);
void OnMouseMotion(wxMouseEvent& event);

View File

@ -0,0 +1,248 @@
/* XPM */
static char *Flag_Korea_xpm[] = {
/* columns rows colors chars-per-pixel */
"96 32 210 2",
". c Black",
"p c #CACACA",
"= c #D9D9D9",
"a c #EED0D6",
">. c #770730",
"e c #F7F7F7",
"^ c #4B4B4B",
"}. c #5A5A5A",
"OX c #A0A4A8",
"k. c #878787",
"P c #D38494",
"u. c #161951",
"@ c #E1E1E1",
"{. c #353535",
"X c #FFFFFF",
"-. c #71163F",
"g c #E3A3AE",
"0 c #444444",
"t c #535353",
"%X c #626262",
"g. c #011F5A",
"x. c #3D557C",
"P. c #475D7F",
"C. c #8F8F8F",
"B c #B80020",
"$. c #949CB0",
"# c #9E9E9E",
".. c #B60323",
"N c #B6001A",
"C c #B6001B",
"k c #5B5B5B",
"`. c #6A6A6A",
"/ c #797979",
"*. c #AD0B2A",
"6 c #888888",
"2X c #979797",
"f c #D5667A",
"w. c #843656",
"Q c #BD2D47",
"y. c #16396E",
"+. c #D3D3D3",
"9. c #002F6C",
"$ c #E2E2E2",
"s. c #002C65",
"` c #D0C6CD",
"x c #F1F1F1",
"S. c #363636",
"=. c #B20927",
"F c #454545",
"W. c #959DA6",
"n. c #00295F",
"l c #545454",
"v. c #002962",
",. c #C0344C",
"J. c #00265A",
"2. c #7394AE",
"Z c #C53851",
"Q. c #3E5375",
";X c #9F9F9F",
"H. c #002358",
"z. c #C2C4C6",
"j c #AEAEAE",
"V. c #BDBDBD",
"e. c #D7B8BA",
"( c #CCCCCC",
"U c #B2001E",
"$X c #2F2F2F",
"; c #F9F9F9",
"! c #E1C0C6",
"v c #4D4D4D",
"@X c #6B6B6B",
"< c #7A7A7A",
"3. c #412554",
"c. c #001D59",
"q c #898989",
"<X c #989898",
"7. c #621842",
"L. c #001A52",
"l. c #A7A7A7",
"+ c #F2F2F2",
"' c #B0324D",
"b c #373737",
"} c #B30A2A",
"& c #464646",
"3 c #555555",
",X c #737373",
"5. c #BF0621",
"&. c #AE001D",
"). c #AFB2B4",
"5X c #919191",
":. c #332358",
"-X c #A0A0A0",
"E. c #AFAFAF",
": c #BEBEBE",
"_ c #DCDCDC",
"7 c #EBEBEB",
"J c #4E4E4E",
"T c #B60B2D",
"c c #8A8A8A",
";. c #2A255B",
"_. c #A8A8A8",
"I. c #BCBEC0",
"O c #B7B7B7",
"%. c #8C1D3E",
" c None",
") c #E4E4E4",
"5 c #383838",
"i c #565656",
"> c #656565",
"6X c #838383",
"1X c #929292",
"F. c #223A67",
"B. c #747D96",
"i. c #471E4A",
"Z. c #A1A1A1",
"N. c #0E275D",
"n c #B0B0B0",
"8. c #072C66",
"| c #B90928",
"!. c #072657",
"'. c #313131",
"b. c #002B62",
":X c #404040",
"y c #4F4F4F",
"2 c #6D6D6D",
"R c #B70C2D",
"3X c #8B8B8A",
"q. c #151C56",
"{ c #B00B2B",
"w c #C7C7C7",
"4. c #930326",
"z c #D6D6D6",
"^. c #001F53",
", c #484848",
"D. c #939CA9",
"% c #575757",
"p. c #302152",
"s c #DC8696",
"V c #B7001E",
"X. c #B7001F",
"d c #D35C72",
"H c #B1B1B1",
"#. c #DEDEDE",
"G. c #00164F",
"R. c #323232",
"1 c #FCFCFC",
"<. c #DBCBCE",
" . c #B80A29",
"D c #9B9B9B",
"T. c #B9B9B9",
"a. c #062A62",
"W c #B30018",
"O. c #E1E2E2",
"m c #D88695",
"1. c #D7D7D7",
"XX c #808A97",
"A c #E4BAC2",
"oX c #858E99",
"]. c #3A3A3A",
"+X c #585858",
"r c #949494",
" X c #ADAEAE",
"o. c #C66174",
"~ c #C1C1C1",
"L c #DADBDB",
"8 c #D0D0D0",
"t. c #92A0B1",
"=X c #333333",
"- c #FDFDFD",
"*X c #424242",
"u c #515151",
"#X c #606060",
"6. c #B40723",
"K c #7E7E7E",
"* c #8D8D8D",
"h. c #5A4F73",
"Y. c #BABABA",
"0. c #00306C",
"@. c #D8D8D8",
"S c #E7E7E7",
"|. c #2C2C2C",
">X c #3B3B3B",
"m. c #002A60",
"[ c #B20A2B",
"d. c #002A62",
"f. c #002A63",
"/. c #16315F",
"M c #BC1231",
"4 c #595959",
".X c #959BA2",
"] c #AD001C",
"h c #F3E6E9",
"7X c #959594",
"4X c #959595",
"Y c #B70B2E",
"o c #B3B3B3",
"A. c #C2C2C2",
"E c #B7082A",
"I c #B50E29",
"r. c #D1D1D1",
"U. c #252525",
"M. c #00215A",
"~. c #001E52",
"K. c #001E55",
"9 c #525252",
"G c #616161",
"[. c #7F7F7F",
"&X c #8E8E8E",
"j. c #D1C8C7",
"(. c #5F7088",
/* pixels */
" ",
" ",
" ",
" ",
" ",
". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
". X X X X X X X X X X X X X X X X X X X X X X X X X X X X X X . ",
". X X X X X X o O + X X X X X X X X X X X X @ # $ X X X X X X . ",
". X X X X X @ % & * = - X X X X X X X X ; : > , < X X X X X X . ",
". 1 1 1 1 1 2 3 4 5 6 7 1 1 1 1 1 1 1 1 8 9 0 3 q w 1 1 1 1 1 . ",
". e e e e r t y u i p e e a s d f g h e + j k 2 3 l z e e e e . ",
". x x x x c v l b n x x m M N B V C Z A x S D F & G H x x x x . ",
". 7 7 7 7 7 O J K L 7 P I U Y T R E W Q ! 7 ~ ^ / ( 7 7 7 7 7 . ",
". ) ) ) ) ) ) ( _ ) ` ' ] [ { } | ...X.o.) O.+.@.) ) ) ) ) ) . ",
". #.#.#.#.#.#.#.#.#.$.%.&.*.=.=.-.;.:.>.,.<.#.#.#.#.#.#.#.#.#.. ",
". 1.1.1.1.1.1.1.1.1.2.3.4.5.6.7.8.9.0.q.w.e.1.1.1.1.1.1.1.1.1.. ",
". r.r.r.r.r.r.r.r.r.t.y.u.i.p.a.s.d.f.g.h.j.r.r.r.r.r.r.r.r.r.. ",
". p p p p p p k.l.p z.x.c.v.b.n.n.m.M.N.B.p V.C.Z.p p p p p p . ",
". A.A.A.A.H 2 S.& l.A.D.F.G.H.J.J.K.L.P.I.A.C.U.y k.Y.A.A.A.A.. ",
". T.T.T.T.9 5 , R.2 E.T.W.Q.!.~.^./.(.).T._.`.u '.].[.T.T.T.T.. ",
". n n n n C.{.}.4 |./ n n X.XXXoXOXn n Z.+Xb @X#Xv n n n n n . ",
". l.l.l.l.l.G 5 $X'.%XD l.l.l.l.l.l.l.l.&X*X$X=X9 -Xl.l.l.l.l.. ",
". ;X;X;X;X;X;X:X>X,X<X;X;X;X;X;X;X;X;X;X;X1X+XR.G ;X;X;X;X;X;X. ",
". 2X2X2X2X2X2X6 3X4X2X2X2X2X2X2X2X2X2X2X2X2X5X6X7X2X2X2X2X2X2X. ",
". . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
};

View File

@ -1,5 +1,5 @@
/* XPM */
static const char * Flag_Taiwan_xpm[] = {
static const char *const Flag_Taiwan_xpm[] = {
"96 32 89 1",
" c None",
". c #000000",

View File

@ -1,6 +1,5 @@
/* XPM */
static const char *Platform_Gamecube_xpm[] = {
/* columns rows colors chars-per-pixel */
"96 32 204 2",
"E. c #B1B0B0",
"] c #8E8B8C",
@ -212,28 +211,28 @@ static const char *Platform_Gamecube_xpm[] = {
" ",
" ",
" ",
" . . . . . . . . X o O + . . . . . . . . ",
" . . . . . . . @ # $ % & * . . . . . . . ",
" . . . . . = - ; : > > , < 1 2 . . . . . ",
" . . . . 3 4 , > 5 6 7 > 5 8 9 0 . . . . ",
" . X q w e r t y u i p a 5 t s d f * . . ",
" . g h j t s k 1 . . . + l z x c v & . . ",
" b n m M N B b . V C Z b . b A S D . F G ",
" H J @ K L . . P I x r U Y T . . . R E W ",
" Q ! ~ R . T ^ / ( ) ~ j _ ` . ' ] [ { } ",
" | . .... X.o.O.+.r s @.#.$.%.&.*.=., -. ",
" | .;.:.T >.E ,.<.1.2.<.3.4.5.> M ~ , -. ",
" | .;.:.. 6.7.8.9.0.q.w.e.5 5 r.t.e , -. ",
" | .;.:.. y.u.e i.p.a.s.=.d.f.g.| h 8 -. ",
" | .;.& . h.j.~ k.l.z._ =.x.:.. c.;.8 -. ",
" | .v.b.. n.m.M.N.B.V.N.t C.Z.. O.: 8 -. ",
" O.x A.S.D.. . F.G.H.J.z K.. . L.P.7 _ I. ",
" U.Y.e M.e T.n . D R.K g.. i E.=.t M 7.3 ",
" W.Q.!. .M.~.^./.+ . . 0.(.).5.t ._.H 2 ",
" . . `.'.~ s ].5 [.{.}.|. Xt 5..XXXi . . ",
" . . . . oXOX, +X@X6.#X! 5 8 h.L . . . . ",
" . . . . . $X%X&X*X=X-X;X:X>X2 . . . . . ",
" . . . . . . . ,XC XX<X1X$.. . . . . . . ",
" . . . . . . . . X o O + . . . . . . . . ",
" . . . . . . . @ # $ % & * . . . . . . . ",
" . . . . . = - ; : > > , < 1 2 . . . . . ",
" . . . . 3 4 , > 5 6 7 > 5 8 9 0 . . . . ",
" . X q w e r t y u i p a 5 t s d f * . . ",
" . g h j t s k 1 . . . + l z x c v & . . ",
" b n m M N B b . V C Z b . b A S D . F G ",
" H J @ K L . . P I x r U Y T . . . R E W ",
" Q ! ~ R . T ^ / ( ) ~ j _ ` . ' ] [ { } ",
" | . .... X.o.O.+.r s @.#.$.%.&.*.=., -. ",
" | .;.:.T >.E ,.<.1.2.<.3.4.5.> M ~ , -. ",
" | .;.:.. 6.7.8.9.0.q.w.e.5 5 r.t.e , -. ",
" | .;.:.. y.u.e i.p.a.s.=.d.f.g.| h 8 -. ",
" | .;.& . h.j.~ k.l.z._ =.x.:.. c.;.8 -. ",
" | .v.b.. n.m.M.N.B.V.N.t C.Z.. O.: 8 -. ",
" O.x A.S.D.. . F.G.H.J.z K.. . L.P.7 _ I. ",
" U.Y.e M.e T.n . D R.K g.. i E.=.t M 7.3 ",
" W.Q.!. .M.~.^./.+ . . 0.(.).5.t ._.H 2 ",
" . . `.'.~ s ].5 [.{.}.|. Xt 5..XXXi . . ",
" . . . . oXOX, +X@X6.#X! 5 8 h.L . . . . ",
" . . . . . $X%X&X*X=X-X;X:X>X2 . . . . . ",
" . . . . . . . ,XC XX<X1X$.. . . . . . . ",
" ",
" ",
" ",

View File

@ -1,6 +1,5 @@
/* XPM */
static const char *Platform_Wad_xpm[] = {
/* columns rows colors chars-per-pixel */
"96 32 347 2",
"hX c #71CBE2",
"v. c #DADCDC",

View File

@ -73,4 +73,4 @@ public:
enum { RED_C, GRN_C, BLU_C, ALP_C };
};
#endif
#endif