Skip to content

Commit

Permalink
fixed rombrowser
Browse files Browse the repository at this point in the history
  • Loading branch information
lantus360 committed Aug 20, 2018
1 parent cb92973 commit 9595f23
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 19 deletions.
20 changes: 13 additions & 7 deletions src/CustomUI.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ int db = 0;

namespace UI
{
std::string currentGame;

int selRed,selGreen,selBlue,selAlpha;
int optRed,optGreen,optBlue,optAlpha;

Expand Down Expand Up @@ -145,7 +147,7 @@ namespace UI
}

void Draw()
{
{
char currentName[120];
int iTempGameSel;
int iGameidx;
Expand Down Expand Up @@ -209,17 +211,19 @@ namespace UI
iTempGameSel = iGameSelect;

if (iNumGames == 0)
DrawText(fntLarge, 320, 202, txtcolor, "No Roms Found");
DrawText(fntLarge, fx, 202, txtcolor, "No Roms Found");
for (iGameidx=0; iGameidx<iMaxWindowList; iGameidx++)
{

sprintf( currentName, "");
sprintf( currentName, "%s\n", m_vecAvailRomList[iTempGameSel++].c_str() );
sprintf( currentName, "%s", m_vecAvailRomList[iTempGameSel++].c_str() );


if (iGameidx==iCursorPos){

DrawText(fntLarge, fx, fy + (28*iGameidx), { selRed, selGreen, selBlue, 255 }, currentName);

currentGame = currentName;
}
else
{
Expand All @@ -232,12 +236,12 @@ namespace UI
}
else if(i == 1)
{
DrawText(fntLarge, 320, 400, txtcolor, "No Options - Yet");
DrawText(fntLarge, 450, 400, txtcolor, "No Options - Yet");

}
else if(i == 2)
{

DrawText(fntLarge, 450, 400, txtcolor, "Release 1. Ported by MVG in 2018");
}
else if(i == 3)
{
Expand Down Expand Up @@ -304,6 +308,8 @@ namespace UI
{
// clamp cursor position
bClampCursor = true;

//fCursorPos += 0.8f * 0.5f * 5.0f; // velocity

// advance gameselect
if(fGameSelect == 0) fGameSelect += (fCursorPos - iWindowMiddle);
Expand Down Expand Up @@ -359,8 +365,8 @@ namespace UI
Draw();
}
else if(k & KEY_A)
{
int gameIndex = mapRoms[m_vecAvailRomList[iCursorPos]];
{
int gameIndex = mapRoms[currentGame];
SDL_SetRenderDrawColor(sdl_render, 0, 0, 0, 255);
SDL_RenderClear(sdl_render);

Expand Down
3 changes: 1 addition & 2 deletions src/nx/nx_maintest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ int main()
romList.RefreshRomList();

UI::Init();



options.samplerate = 48000;
options.use_samples = true;

Expand Down
12 changes: 2 additions & 10 deletions src/nx/nx_romlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ int ThreeOrFourPlayerOnly = 0;

std::vector<std::string> m_vecAvailRomList;
std::vector<std::string> m_ListData;
std::map<std::string, int> mapType;
std::map<std::string, int> mapRoms;


Expand Down Expand Up @@ -118,20 +117,13 @@ int CRomList::RefreshRomList()
}

InitRomList();

mapType.clear();



for( totalMAMEGames = 0; drivers[totalMAMEGames]; ++totalMAMEGames)
{
char fullname[60];
sprintf(fullname,"%s.zip",drivers[totalMAMEGames]->name);

vecAvailRomListFileName.push_back(fullname);
//vecAvailRomList.push_back(drivers[totalMAMEGames]->name);
//vecAvailRomIndex.push_back(totalMAMEGames);

//mapType[drivers[totalMAMEGames]->name] = totalMAMEGames;
vecAvailRomListFileName.push_back(fullname);
mapRoms[drivers[totalMAMEGames]->description] = totalMAMEGames;

}
Expand Down

0 comments on commit 9595f23

Please sign in to comment.