mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 15:40:44 +00:00
[ANDROID] "handle" all config changes while executing the emulator
re-init video code on orientation change
This commit is contained in:
parent
2c2328d8a0
commit
1e03bb3d50
@ -34,6 +34,7 @@ struct droid
|
||||
unsigned width;
|
||||
unsigned height;
|
||||
struct saved_state state;
|
||||
int32_t last_orient;
|
||||
};
|
||||
|
||||
extern struct droid g_android;
|
||||
|
@ -385,7 +385,17 @@ static void* android_app_entry(void* param)
|
||||
RARCH_LOG("Initializing succeeded.\n");
|
||||
RARCH_LOG("RetroArch started.\n");
|
||||
rarch_init_msg_queue();
|
||||
while (rarch_main_iterate());
|
||||
g_android.last_orient = AConfiguration_getOrientation(android_app->config);
|
||||
while (rarch_main_iterate())
|
||||
{
|
||||
if (AConfiguration_getOrientation(android_app->config) != g_android.last_orient)
|
||||
{
|
||||
// reinit video driver for new window dimensions
|
||||
driver.video->free(driver.video_data);
|
||||
init_video_input();
|
||||
g_android.last_orient = AConfiguration_getOrientation(android_app->config);
|
||||
}
|
||||
}
|
||||
RARCH_LOG("RetroArch stopped.\n");
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@
|
||||
</activity>
|
||||
<activity android:label="@string/app_name" android:name="com.retroarch.fileio.FileChooser" />
|
||||
<activity android:label="@string/app_name" android:name="rombrowser" />
|
||||
<activity android:name="android.app.NativeActivity">
|
||||
<activity android:name="android.app.NativeActivity" android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale">
|
||||
<meta-data android:name="android.app.lib_name" android:value="retroarch-activity" />
|
||||
<meta-data android:name="android.app.func_name" android:value="ANativeActivity_onCreate" />
|
||||
</activity>
|
||||
|
Loading…
x
Reference in New Issue
Block a user