diff --git a/ElectropaintOSX.xcodeproj/project.pbxproj b/ElectropaintOSX.xcodeproj/project.pbxproj index bfc6a41..7fbf5eb 100644 --- a/ElectropaintOSX.xcodeproj/project.pbxproj +++ b/ElectropaintOSX.xcodeproj/project.pbxproj @@ -169,7 +169,7 @@ 089C1669FE841209C02AAC07 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 1150; + LastUpgradeCheck = 1250; }; buildConfigurationList = CBD518070C3E95E6008328F8 /* Build configuration list for PBXProject "ElectropaintOSX" */; compatibilityVersion = "Xcode 11.4"; @@ -251,12 +251,13 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + 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; - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Apple Development"; DEVELOPMENT_TEAM = 848G93TEQ4; ENABLE_OPENMP_SUPPORT = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -277,8 +278,8 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.8; - ONLY_ACTIVE_ARCH = NO; + MACOSX_DEPLOYMENT_TARGET = 10.9; + ONLY_ACTIVE_ARCH = YES; OTHER_CODE_SIGN_FLAGS = "--timestamp"; SDKROOT = macosx; USE_HEADERMAP = NO; @@ -302,12 +303,13 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + 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; - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Apple Development"; DEVELOPMENT_TEAM = 848G93TEQ4; ENABLE_OPENMP_SUPPORT = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -328,7 +330,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.9; ONLY_ACTIVE_ARCH = YES; OTHER_CODE_SIGN_FLAGS = "--timestamp"; SDKROOT = macosx; @@ -353,12 +355,13 @@ CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + 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; - CODE_SIGN_IDENTITY = "Developer ID Application"; + CODE_SIGN_IDENTITY = "Apple Development"; DEVELOPMENT_TEAM = 848G93TEQ4; ENABLE_OPENMP_SUPPORT = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -379,7 +382,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - MACOSX_DEPLOYMENT_TARGET = 10.8; + MACOSX_DEPLOYMENT_TARGET = 10.9; OTHER_CODE_SIGN_FLAGS = "--timestamp"; SDKROOT = macosx; USE_HEADERMAP = NO; @@ -389,9 +392,13 @@ CBD518040C3E95E4008328F8 /* Development */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ""; GCC_ENABLE_TRIGRAPHS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -405,7 +412,12 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Library/Screen Savers"; LIBRARY_SEARCH_PATHS = ""; - OTHER_CFLAGS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MARKETING_VERSION = 0.3.6; + OTHER_CFLAGS = ( + "-D", + GL_SILENCE_DEPRECATION, + ); OTHER_LDFLAGS = ""; OTHER_REZFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = org.lloydslounge.electropaint; @@ -423,9 +435,13 @@ CBD518050C3E95E4008328F8 /* Deployment */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = YES; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ""; GCC_ENABLE_TRIGRAPHS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -439,7 +455,12 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Library/Screen Savers"; LIBRARY_SEARCH_PATHS = ""; - OTHER_CFLAGS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MARKETING_VERSION = 0.3.6; + OTHER_CFLAGS = ( + "-D", + GL_SILENCE_DEPRECATION, + ); OTHER_LDFLAGS = ""; OTHER_REZFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = org.lloydslounge.electropaint; @@ -457,8 +478,12 @@ CBD518060C3E95E4008328F8 /* Default */ = { isa = XCBuildConfiguration; buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; COMBINE_HIDPI_IMAGES = YES; + CURRENT_PROJECT_VERSION = 1; + DEVELOPMENT_TEAM = ""; FRAMEWORK_SEARCH_PATHS = ""; GCC_ENABLE_TRIGRAPHS = NO; GCC_GENERATE_DEBUGGING_SYMBOLS = NO; @@ -472,7 +497,12 @@ INFOPLIST_FILE = Info.plist; INSTALL_PATH = "$(HOME)/Library/Screen Savers"; LIBRARY_SEARCH_PATHS = ""; - OTHER_CFLAGS = ""; + MACOSX_DEPLOYMENT_TARGET = 10.9; + MARKETING_VERSION = 0.3.6; + OTHER_CFLAGS = ( + "-D", + GL_SILENCE_DEPRECATION, + ); OTHER_LDFLAGS = ""; OTHER_REZFLAGS = ""; PRODUCT_BUNDLE_IDENTIFIER = org.lloydslounge.electropaint; diff --git a/ElectropaintView.mm b/ElectropaintView.mm index e760f69..e51294b 100644 --- a/ElectropaintView.mm +++ b/ElectropaintView.mm @@ -142,8 +142,10 @@ CGFloat operator()(void) NSUInteger rand_state; CGFloat getNewAccel(void) { - // unsigned int r(rand_r(&rand_state)); - NSUInteger r(rand()); + // unsigned int r(rand_r(&rand_state)); + // NSUInteger r(rand()); + // switch to arc4random() as rand() is outdated + NSUInteger r(arc4random()); CGFloat f = r / (RAND_MAX + 1.0f); f = (f - 0.5f) * 2.0f; f *= max_acceleration; @@ -184,14 +186,17 @@ - (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview { NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute) 24, NSOpenGLPFAAlphaSize, (NSOpenGLPixelFormatAttribute) 8, NSOpenGLPFAStencilSize, (NSOpenGLPixelFormatAttribute) 0, - NSOpenGLPFAWindow, + // NSOpenGLPFAWindow, + // use the defined value 80 for NSOpenGLFAWindow to avoid + // deprication warnings + (NSOpenGLPixelFormatAttribute) 80, (NSOpenGLPixelFormatAttribute) 0, }; - NSOpenGLPixelFormat *format = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attr] autorelease]; - // removed the autorelease ... - // glview = [[[NSOpenGLView alloc] initWithFrame:NSZeroRect pixelFormat:format] autorelease]; - glview = [[NSOpenGLView alloc] initWithFrame:NSZeroRect pixelFormat:format]; + NSOpenGLPixelFormat *format = + [[[NSOpenGLPixelFormat alloc] initWithAttributes:attr] autorelease]; + glview = [[NSOpenGLView alloc] initWithFrame: NSZeroRect + pixelFormat: format]; [self initGL]; } return self; @@ -251,7 +256,9 @@ - (void)dealloc { - (void)initGL { - srand(time(NULL)); + + // srand() no longer needed, as we are switching to arc4random() + // srand(time(NULL)); [[glview openGLContext] makeCurrentContext]; GLint params[] = { 1 }; @@ -259,19 +266,20 @@ - (void)initGL { glutInitDisplayMode(GLUT_RGBA | GLUT_DEPTH | GLUT_DOUBLE); - //glutDisplayFunc(display); - //glutReshapeFunc(reshape); + glEnable (GL_DEPTH_TEST); + glEnable (GL_NORMALIZE); - glEnable (GL_LINE_SMOOTH); - glHint (GL_LINE_SMOOTH_HINT, GL_DONT_CARE); - glBlendFunc (GL_SRC_ALPHA, GL_ONE); + glHint (GL_LINE_SMOOTH_HINT, GL_NICEST); + glEnable (GL_LINE_SMOOTH); - glEnable(GL_DEPTH_TEST); + glEnable (GL_BLEND); + glBlendFunc (GL_SRC_ALPHA, GL_ONE); + glDepthMask(GL_FALSE); - #if defined(GL_VERSION_1_1) +#if defined(GL_VERSION_1_1) glPolygonOffset(-0.5, -2); - #endif +#endif wing_dl = glGenLists(1); glNewList(wing_dl, GL_COMPILE); @@ -312,9 +320,7 @@ - (void)display { std::list::const_iterator i(wings.begin()); std::list::const_iterator end(wings.end()); unsigned int count(0); - //if (hasOpenGL(1, 1)) { #if defined(GL_VERSION_1_1) - // if (hasOpenGL(1, 1)) glEnable(GL_POLYGON_OFFSET_LINE); #endif glPushMatrix(); diff --git a/Info.plist b/Info.plist index be6939a..258cc3a 100644 --- a/Info.plist +++ b/Info.plist @@ -17,7 +17,7 @@ CFBundleSignature ???? CFBundleVersion - 0.3.5 + $(CURRENT_PROJECT_VERSION) NSPrincipalClass ElectropaintOSXView diff --git a/README.txt b/README.txt index 0422a23..1bca901 100644 --- a/README.txt +++ b/README.txt @@ -1,28 +1,47 @@ ElectropaintOSX -ElectropaintOSX is an OS X screensaver module port of Kent Rosenkoetter's clone of SGI's Electropaint screensaver "the most mesmerizing screensaver ever written". +ElectropaintOSX is an OS X screensaver module port of Kent Rosenkoetter's +clone of SGI's Electropaint screensaver "the most mesmerizing screensaver +ever written". + Kent's page can be found here: + http://legolas.homelinux.org/~kent/electropaint/ +https://web.archive.org/web/20041210033146/http://legolas.homelinux.org/~kent/electropaint/ + The OS X port by Douglas McInnes lives here: + http://www.lloydslounge.org/electropaint/ +https://web.archive.org/web/20110222022854/http://www.lloydslounge.org/electropaint/ -This port only wraps Kent's OpenGL code in a screensaver module using Objective-C++. The source is released under the General Public License. Please see the included gpl.txt for the full license text. +This port only wraps Kent's OpenGL code in a screensaver module using +Objective-C++. The source is released under the General Public License. +Please see the included gpl.txt for the full license text. For the 0.2 version, Modifications for antialiasing, VBL, parameter tweak has been done by Vincent Fiano . Thanks Vincent! -Version 0.3 is a universal binary, currently raising the minimum system requirements to 10.3.9. Changes by Alexander von Below +Version 0.3 is a universal binary, currently raising the minimum system +requirements to 10.3.9. Changes by Alexander von Below -Version 0.3.1 is a universal binary, currently raising the minimum system requirements to 10.5. It supports 64-bit and Garbage Collection under 10.6. Changes by Thomas Vo§en . +Version 0.3.1 is a universal binary, currently raising the minimum system +requirements to 10.5. It supports 64-bit and Garbage Collection under 10.6. +Changes by Thomas Vo§en . -Version 0.3.2 has been build against the 10.8 SDK. It is compatible with Mac OS X 10.8, raising the minimum system requirements to 10.8.0. No changes in code. Build by Thomas Vo§en . +Version 0.3.2 has been build against the 10.8 SDK. It is compatible with +Mac OS X 10.8, raising the minimum system requirements to 10.8.0. No +changes in code. Build by Thomas Vo§en . -Version 0.3.3 includes normal and HIPDI icons used in the system preferences panel. Thanks to Peter Leonard for kindly supplying the image files. +Version 0.3.3 includes normal and HIPDI icons used in the system +preferences panel. Thanks to Peter Leonard for kindly supplying the image +files. -Version 0.3.4 fixes a warning during build under Mac OS X 10.10. Thanks to Douglas Carmichael for sending the bug report. +Version 0.3.4 fixes a warning during build under Mac OS X 10.10. Thanks to +Douglas Carmichael for sending the bug report. Version 0.3.5 is notarised and some autorelease initializer have been changed. +Version 0.3.6 is a minor update for BigSur (MacOSX 11) and M1 macs. Copyright (C) 2004 Kent Rosenkoetter, Douglas McInnes