(iOS) Enable RGUI
This commit is contained in:
parent
072c52fe4e
commit
5a06fe347d
|
@ -552,6 +552,7 @@
|
||||||
OTHER_CFLAGS = (
|
OTHER_CFLAGS = (
|
||||||
"-DHAVE_RARCH_MAIN_WRAP",
|
"-DHAVE_RARCH_MAIN_WRAP",
|
||||||
"-DHAVE_GRIFFIN",
|
"-DHAVE_GRIFFIN",
|
||||||
|
"-DHAVE_RGUI",
|
||||||
"-DIOS",
|
"-DIOS",
|
||||||
"-DHAVE_OPENGL",
|
"-DHAVE_OPENGL",
|
||||||
"-DHAVE_FBO",
|
"-DHAVE_FBO",
|
||||||
|
@ -590,6 +591,7 @@
|
||||||
"-DNDEBUG",
|
"-DNDEBUG",
|
||||||
"-DHAVE_RARCH_MAIN_WRAP",
|
"-DHAVE_RARCH_MAIN_WRAP",
|
||||||
"-DHAVE_GRIFFIN",
|
"-DHAVE_GRIFFIN",
|
||||||
|
"-DHAVE_RGUI",
|
||||||
"-DIOS",
|
"-DIOS",
|
||||||
"-DHAVE_OPENGL",
|
"-DHAVE_OPENGL",
|
||||||
"-DHAVE_FBO",
|
"-DHAVE_FBO",
|
||||||
|
|
|
@ -16,6 +16,8 @@
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "rarch_wrapper.h"
|
#include "rarch_wrapper.h"
|
||||||
#include "general.h"
|
#include "general.h"
|
||||||
|
#include "frontend/menu/rmenu.h"
|
||||||
|
|
||||||
#import "browser/browser.h"
|
#import "browser/browser.h"
|
||||||
#import "settings/settings.h"
|
#import "settings/settings.h"
|
||||||
|
|
||||||
|
@ -64,6 +66,10 @@
|
||||||
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
_window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||||
_window.rootViewController = self;
|
_window.rootViewController = self;
|
||||||
[_window makeKeyAndVisible];
|
[_window makeKeyAndVisible];
|
||||||
|
|
||||||
|
// RetroArch init
|
||||||
|
rarch_init_msg_queue();
|
||||||
|
menu_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)applicationDidBecomeActive:(UIApplication*)application
|
- (void)applicationDidBecomeActive:(UIApplication*)application
|
||||||
|
@ -139,6 +145,7 @@
|
||||||
//
|
//
|
||||||
[self pushViewController:RAGameView.get animated:NO];
|
[self pushViewController:RAGameView.get animated:NO];
|
||||||
_isRunning = true;
|
_isRunning = true;
|
||||||
|
g_extern.lifecycle_mode_state |= 1ULL << MODE_GAME;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -191,19 +198,58 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
_isIterating = true;
|
_isIterating = true;
|
||||||
SInt32 runLoopResult = kCFRunLoopRunTimedOut;
|
|
||||||
|
|
||||||
while (!_isPaused && _isRunning && _isGameTop && _isScheduled && runLoopResult == kCFRunLoopRunTimedOut)
|
while (!_isPaused && _isRunning && _isGameTop && _isScheduled)
|
||||||
{
|
{
|
||||||
if (!rarch_main_iterate())
|
if (g_extern.lifecycle_mode_state & (1ULL << MODE_GAME))
|
||||||
[self closeGame];
|
{
|
||||||
|
if (((g_extern.is_paused && !g_extern.is_oneshot) ? rarch_main_idle_iterate() : rarch_main_iterate()))
|
||||||
|
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true) == kCFRunLoopRunHandledSource);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_GAME);
|
||||||
|
|
||||||
// Here's a construct you don't see every day
|
if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU))
|
||||||
for (
|
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU_PREINIT);
|
||||||
runLoopResult = kCFRunLoopRunHandledSource;
|
}
|
||||||
runLoopResult == kCFRunLoopRunHandledSource;
|
}
|
||||||
runLoopResult = CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true)
|
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_INIT))
|
||||||
);
|
{
|
||||||
|
if (g_extern.main_is_init)
|
||||||
|
rarch_main_deinit();
|
||||||
|
|
||||||
|
struct rarch_main_wrap args = {0};
|
||||||
|
|
||||||
|
args.verbose = g_extern.verbose;
|
||||||
|
args.config_path = *g_extern.config_path ? g_extern.config_path : NULL;
|
||||||
|
args.sram_path = NULL;
|
||||||
|
args.state_path = NULL;
|
||||||
|
args.rom_path = g_extern.fullpath;
|
||||||
|
args.libretro_path = g_settings.libretro;
|
||||||
|
|
||||||
|
int init_ret = rarch_main_init_wrap(&args);
|
||||||
|
if (init_ret == 0)
|
||||||
|
{
|
||||||
|
RARCH_LOG("rarch_main_init() succeeded.\n");
|
||||||
|
g_extern.lifecycle_mode_state |= (1ULL << MODE_GAME);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
RARCH_ERR("rarch_main_init() failed.\n");
|
||||||
|
g_extern.lifecycle_mode_state |= (1ULL << MODE_MENU);
|
||||||
|
}
|
||||||
|
|
||||||
|
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_INIT);
|
||||||
|
}
|
||||||
|
else if (g_extern.lifecycle_mode_state & (1ULL << MODE_MENU))
|
||||||
|
{
|
||||||
|
if (menu_iterate())
|
||||||
|
while (CFRunLoopRunInMode(kCFRunLoopDefaultMode, 0, true) == kCFRunLoopRunHandledSource);
|
||||||
|
else
|
||||||
|
g_extern.lifecycle_mode_state &= ~(1ULL << MODE_MENU);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
[self closeGame];
|
||||||
}
|
}
|
||||||
|
|
||||||
RARCH_LOG("Iterate Ended\n");
|
RARCH_LOG("Iterate Ended\n");
|
||||||
|
|
Loading…
Reference in New Issue