diff options
| author | Tilka <tilkax@gmail.com> | 2025-04-25 01:43:53 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-04-25 01:43:53 +0100 |
| commit | a95779add09bf24002ba9e5d0d5987d2c6945e47 (patch) | |
| tree | 7ce613c858dd5d1f0a492019b7e99c427c87fe59 /Source/Android/jni/GameList/GameFile.cpp | |
| parent | 5523b9a01b5e2628b3b22a5b97cb78aac0cd83f6 (diff) | |
| parent | b8e70df413ddd4663aa8e65a6f9d8a1e059c64c7 (diff) | |
Merge pull request #13506 from JosJuice/android-time-played
Android: Show time played in game details
Diffstat (limited to 'Source/Android/jni/GameList/GameFile.cpp')
| -rw-r--r-- | Source/Android/jni/GameList/GameFile.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Source/Android/jni/GameList/GameFile.cpp b/Source/Android/jni/GameList/GameFile.cpp index 3bf60beb28..dc922d701c 100644 --- a/Source/Android/jni/GameList/GameFile.cpp +++ b/Source/Android/jni/GameList/GameFile.cpp @@ -3,12 +3,14 @@ #include "jni/GameList/GameFile.h" +#include <chrono> #include <memory> #include <utility> #include <vector> #include <jni.h> +#include "Core/TimePlayed.h" #include "DiscIO/Blob.h" #include "DiscIO/Enums.h" #include "UICommon/GameFile.h" @@ -190,6 +192,13 @@ JNIEXPORT jint JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_getBannerHe return static_cast<jint>(GetRef(env, obj)->GetBannerImage().height); } +JNIEXPORT jlong JNICALL +Java_org_dolphinemu_dolphinemu_model_GameFile_getTimePlayedMsInternal(JNIEnv* env, jobject obj) +{ + const std::chrono::milliseconds time = TimePlayed().GetTimePlayed(GetRef(env, obj)->GetGameID()); + return time.count(); +} + JNIEXPORT jobject JNICALL Java_org_dolphinemu_dolphinemu_model_GameFile_parse(JNIEnv* env, jclass, jstring path) { |
