Skip to content

Commit

Permalink
Screen shouldn't flash gray on startup
Browse files Browse the repository at this point in the history
Xcode project files were updated to recommended
settings in Xcode 12.5.1 as well.
  • Loading branch information
Robert Venturini committed Aug 16, 2021
1 parent 5489533 commit 15644bb
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 13 deletions.
34 changes: 31 additions & 3 deletions Flying Toasters.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
ABF4BEDD2234F602000D5A44 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0620;
LastUpgradeCheck = 1250;
ORGANIZATIONNAME = "Robert Venturini";
TargetAttributes = {
ABF4BEE52234F602000D5A44 = {
Expand All @@ -219,10 +219,9 @@
};
buildConfigurationList = ABF4BEE02234F602000D5A44 /* Build configuration list for PBXProject "Flying Toasters" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
English,
en,
Base,
);
Expand Down Expand Up @@ -307,23 +306,37 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
Expand All @@ -347,24 +360,37 @@
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu99;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
Expand Down Expand Up @@ -411,6 +437,7 @@
);
INFOPLIST_FILE = "Flying Toaster Test/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.robert-venturini.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
Expand All @@ -423,6 +450,7 @@
COMBINE_HIDPI_IMAGES = YES;
INFOPLIST_FILE = "Flying Toaster Test/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = "com.robert-venturini.$(PRODUCT_NAME:rfc1034identifier)";
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
15 changes: 6 additions & 9 deletions Flying Toasters/FlyingToastersView.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ - (instancetype)init
if (self = [super initWithFrame:NSZeroRect]) {
_speed = kMediumSpeed;
_toastLevel = kGoldenBrownToast;

_toasterScene = [[ScreenSaverScene alloc] initWithSize:self.frame.size];
_toasterScene.backgroundColor = [NSColor blackColor];

[self presentScene:_toasterScene];
}

return self;
Expand Down Expand Up @@ -266,16 +271,11 @@ - (void)_addToasterAtIndex:(NSUInteger)index

- (void)start
{
self.toasterScene = [[ScreenSaverScene alloc] initWithSize:self.frame.size];
self.toasterScene.backgroundColor = [NSColor blackColor];

[self presentScene:self.toasterScene];

NSUInteger toasterCount = self.numOfToasters;
if (toasterCount) {
NSUInteger toastIndex = rand() % toasterCount;
NSUInteger fastToasterIndex = rand() % toasterCount;

[self _addToasterAtIndex:0 toastIndex:toastIndex fastToasterIndex:fastToasterIndex];
}
}
Expand All @@ -284,9 +284,6 @@ - (void)end
{
[self.toasterScene removeAllActions];
[self.toasterScene removeAllChildren];
[self.toasterScene removeFromParent];

self.toasterScene = nil;
}

- (BOOL)acceptsFirstResponder
Expand Down

0 comments on commit 15644bb

Please sign in to comment.