Skip to content

Commit

Permalink
macos: replace deprecated things based on 10.15 deployment target
Browse files Browse the repository at this point in the history
  • Loading branch information
jonof committed Dec 2, 2023
1 parent 4db4f32 commit 25652b0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
26 changes: 13 additions & 13 deletions kenbuild/src/StartupWinController.m
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ - (void)populateVideoModes:(BOOL)firstTime
bpp = settings->bpp3d;
fullscreen = settings->fullscreen;
} else {
fullscreen = ([fullscreenButton state] == NSOnState);
fullscreen = ([fullscreenButton state] == NSControlStateValueOn);
mode3d = (int)[[videoMode3DPUButton selectedItem] tag];
if (mode3d >= 0) {
xdim = validmode[mode3d].xdim;
Expand Down Expand Up @@ -155,12 +155,12 @@ - (IBAction)fullscreenClicked:(id)sender

- (IBAction)multiPlayerModeClicked:(id)sender
{
[singlePlayerButton setState:(sender == singlePlayerButton ? NSOnState : NSOffState)];
[singlePlayerButton setState:(sender == singlePlayerButton ? NSControlStateValueOn : NSControlStateValueOff)];

[joinMultiButton setState:(sender == joinMultiButton ? NSOnState : NSOffState)];
[joinMultiButton setState:(sender == joinMultiButton ? NSControlStateValueOn : NSControlStateValueOff)];
[hostField setEnabled:(sender == joinMultiButton)];

[hostMultiButton setState:(sender == hostMultiButton ? NSOnState : NSOffState)];
[hostMultiButton setState:(sender == hostMultiButton ? NSControlStateValueOn : NSControlStateValueOff)];
[numPlayersField setEnabled:(sender == hostMultiButton)];
[numPlayersStepper setEnabled:(sender == hostMultiButton)];
}
Expand All @@ -187,17 +187,17 @@ - (IBAction)start:(id)sender

settings->numplayers = 0;
settings->joinhost = NULL;
if ([singlePlayerButton state] == NSOnState) {
if ([singlePlayerButton state] == NSControlStateValueOn) {
settings->numplayers = 1;
} else if ([joinMultiButton state] == NSOnState) {
} else if ([joinMultiButton state] == NSControlStateValueOn) {
NSString *host = [hostField stringValue];
settings->numplayers = 2;
settings->joinhost = strdup([host cStringUsingEncoding:NSUTF8StringEncoding]);
} else if ([hostMultiButton state] == NSOnState) {
} else if ([hostMultiButton state] == NSControlStateValueOn) {
settings->numplayers = [numPlayersField intValue];
}

settings->forcesetup = [alwaysShowButton state] == NSOnState;
settings->forcesetup = [alwaysShowButton state] == NSControlStateValueOn;

if (inmodal) {
[NSApp stopModalWithCode:STARTWIN_RUN];
Expand All @@ -206,27 +206,27 @@ - (IBAction)start:(id)sender

- (void)setupConfigMode
{
[alwaysShowButton setState: (settings->forcesetup ? NSOnState : NSOffState)];
[alwaysShowButton setState: (settings->forcesetup ? NSControlStateValueOn : NSControlStateValueOff)];
[alwaysShowButton setEnabled:YES];

[videoMode3DPUButton setEnabled:YES];
[self populateVideoModes:YES];
[fullscreenButton setEnabled:YES];
[fullscreenButton setState: (settings->fullscreen ? NSOnState : NSOffState)];
[fullscreenButton setState: (settings->fullscreen ? NSControlStateValueOn : NSControlStateValueOff)];

if (!settings->netoverride) {
[singlePlayerButton setEnabled:YES];
[singlePlayerButton setState:NSOnState];
[singlePlayerButton setState:NSControlStateValueOn];

[hostMultiButton setEnabled:YES];
[hostMultiButton setState:NSOffState];
[hostMultiButton setState:NSControlStateValueOff];
[numPlayersField setEnabled:NO];
[numPlayersField setIntValue:2];
[numPlayersStepper setEnabled:NO];
[numPlayersStepper setMaxValue:MAXPLAYERS];

[joinMultiButton setEnabled:YES];
[joinMultiButton setState:NSOffState];
[joinMultiButton setState:NSControlStateValueOff];
[hostField setEnabled:NO];
} else {
[singlePlayerButton setEnabled:NO];
Expand Down
4 changes: 2 additions & 2 deletions src/osxbits.m
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int wmosx_filechooser(const char *initialdir, const char *initialfile, const cha
[panel setDirectoryURL:initialdirurl];

resp = [panel runModal];
if (resp == NSFileHandlingPanelOKButton) {
if (resp == NSModalResponseOK) {
NSURL *file = [panel URL];
if ([file isFileURL]) {
*choice = strdup([[file path] UTF8String]);
Expand All @@ -69,5 +69,5 @@ int wmosx_filechooser(const char *initialdir, const char *initialfile, const cha
[filetypes release];
[initialdirurl release];

return resp == NSFileHandlingPanelOKButton ? 1 : 0;
return resp == NSModalResponseOK ? 1 : 0;
}
4 changes: 2 additions & 2 deletions xcode/engine.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@
);
GCC_WARN_PEDANTIC = YES;
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../src";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.15;
ONLY_ACTIVE_ARCH = YES;
SKIP_INSTALL = YES;
WARNING_CFLAGS = (
Expand Down Expand Up @@ -1020,7 +1020,7 @@
);
GCC_WARN_PEDANTIC = YES;
HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/../src";
MACOSX_DEPLOYMENT_TARGET = 10.9;
MACOSX_DEPLOYMENT_TARGET = 10.15;
SKIP_INSTALL = YES;
WARNING_CFLAGS = (
"-W",
Expand Down

0 comments on commit 25652b0

Please sign in to comment.