mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-02-03 10:13:11 +00:00
(OSX) Improvements:
Pause emulation while settings window is open Allow negative numbers to be input in the settings list Don't crash when changing a setting value to an empty string
This commit is contained in:
parent
ff61d97a06
commit
3b27a50625
@ -114,13 +114,11 @@ static const char* get_axis_name(const rarch_setting_t* setting)
|
||||
{
|
||||
unichar ch = [partialString characterAtIndex:i];
|
||||
|
||||
if (self.allowsFloats && !hasDot && ch == '.')
|
||||
{
|
||||
hasDot = true;
|
||||
if (i == 0 && (!self.minimum || self.minimum.intValue < 0) && ch == '-')
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!isnumber(ch))
|
||||
else if (self.allowsFloats && !hasDot && ch == '.')
|
||||
hasDot = true;
|
||||
else if (!isdigit(ch))
|
||||
return NO;
|
||||
}
|
||||
|
||||
@ -216,7 +214,7 @@ static const char* get_axis_name(const rarch_setting_t* setting)
|
||||
|
||||
- (void)setStringValue:(NSString *)stringValue
|
||||
{
|
||||
_stringValue = stringValue;
|
||||
_stringValue = stringValue ? stringValue : @"";
|
||||
|
||||
if (_setting && (_setting->type == ST_STRING || _setting->type == ST_PATH))
|
||||
strlcpy(_setting->value, _stringValue.UTF8String, _setting->size);
|
||||
@ -291,6 +289,8 @@ static const char* get_axis_name(const rarch_setting_t* setting)
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
apple_enter_stasis();
|
||||
|
||||
NSMutableArray* thisGroup = nil;
|
||||
NSMutableArray* thisSubGroup = nil;
|
||||
_settings = [NSMutableArray array];
|
||||
@ -400,7 +400,7 @@ static const char* get_axis_name(const rarch_setting_t* setting)
|
||||
config_file_write(conf, apple_platform.globalConfigFile.UTF8String);
|
||||
config_file_free(conf);
|
||||
|
||||
apple_refresh_config();
|
||||
apple_exit_stasis(true);
|
||||
|
||||
[NSApp stopModal];
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ extern void apple_event_show_rgui(void* userdata);
|
||||
|
||||
extern void apple_refresh_config();
|
||||
extern void apple_enter_stasis();
|
||||
extern void apple_exit_stasis();
|
||||
extern void apple_exit_stasis(bool reload_config);
|
||||
extern void apple_run_core(RAModuleInfo* core, const char* file);
|
||||
|
||||
// utility.m
|
||||
|
@ -71,8 +71,6 @@ pthread_mutex_t stasis_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||
|
||||
static void event_stasis(void* userdata)
|
||||
{
|
||||
// HACK: uninit_drivers is the nuclear option; uninit_audio would be better but will
|
||||
// crash when resuming.
|
||||
uninit_drivers();
|
||||
pthread_mutex_lock(&stasis_mutex);
|
||||
pthread_mutex_unlock(&stasis_mutex);
|
||||
@ -88,8 +86,14 @@ void apple_enter_stasis()
|
||||
}
|
||||
}
|
||||
|
||||
void apple_exit_stasis()
|
||||
void apple_exit_stasis(bool reload_config)
|
||||
{
|
||||
if (reload_config)
|
||||
{
|
||||
objc_clear_config_hack();
|
||||
config_load();
|
||||
}
|
||||
|
||||
if (apple_is_running)
|
||||
pthread_mutex_unlock(&stasis_mutex);
|
||||
}
|
||||
|
@ -132,7 +132,7 @@ static void handle_touch_event(NSArray* touches)
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application
|
||||
{
|
||||
apple_exit_stasis();
|
||||
apple_exit_stasis(false);
|
||||
}
|
||||
|
||||
- (void)applicationWillResignActive:(UIApplication *)application
|
||||
|
Loading…
x
Reference in New Issue
Block a user