Add Recent Roms

This commit is contained in:
zilmar 2016-11-21 18:02:12 +11:00
parent d230250930
commit 8ef73a3f32
3 changed files with 20 additions and 2 deletions

View File

@ -156,4 +156,14 @@ void JavaBridge::EmulationStopped(void)
}
}
void JavaBridge::RecentRomsUpdated(void)
{
JNIEnv *env = Android_JNI_GetEnv();
if (env)
{
jmethodID midRRecentRomsUpdated = env->GetStaticMethodID(m_GalleryActivityClass, "RecentRomsUpdated", "()V");
env->CallStaticVoidMethod(m_GalleryActivityClass, midRRecentRomsUpdated);
}
}
#endif

View File

@ -20,6 +20,7 @@ public:
void RomListReset(void);
void RomListAddItem(const char * FullFileName, const char * FileName, const char * GoodName, uint32_t TextColor );
void RomListLoaded(void);
void RecentRomsUpdated(void);
//Notification
void DisplayError(const char * Message);

View File

@ -120,7 +120,7 @@ void AddRecentRom(const char * ImagePath)
RecentGames.push_back(RecentGame);
}
//See if the dir is already in the list if so then move it to the top of the list
//See if the game is already in the list if so then move it to the top of the list
strlist::iterator iter;
for (iter = RecentGames.begin(); iter != RecentGames.end(); iter++)
{
@ -141,6 +141,12 @@ void AddRecentRom(const char * ImagePath)
{
UISettingsSaveStringIndex(File_RecentGameFileIndex, i, *iter);
}
if (g_JavaBridge)
{
WriteTrace(TraceUserInterface, TraceDebug, "calling RecentRomsUpdated");
g_JavaBridge->RecentRomsUpdated();
}
WriteTrace(TraceUserInterface, TraceDebug, "Done");
}
@ -156,6 +162,7 @@ void GameCpuRunning(void * /*NotUsed*/)
{
AddRecentRom(FileLoc.c_str());
}
g_System->RefreshGameSettings();
}
else
{
@ -254,7 +261,7 @@ EXPORT void CALL Java_emu_project64_jni_NativeExports_SettingsSaveBool(JNIEnv* e
EXPORT void CALL Java_emu_project64_jni_NativeExports_SettingsSaveDword(JNIEnv* env, jclass cls, int Type, int Value)
{
WriteTrace(TraceUserInterface, TraceDebug, "Saving %d value: 0x%X",Type,Value);
WriteTrace(TraceUserInterface, TraceDebug, "Saving %d value: 0x%X", Type, Value);
g_Settings->SaveDword((SettingID)Type, Value);
CSettings::FlushSettings(g_Settings);
WriteTrace(TraceUserInterface, TraceDebug, "Saved");