Skip to content

Commit

Permalink
update to build on BigSur
Browse files Browse the repository at this point in the history
  • Loading branch information
srirangav committed May 21, 2021
1 parent 2e0b63d commit 3fddbb7
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 37 deletions.
52 changes: 41 additions & 11 deletions ElectropaintOSX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
42 changes: 24 additions & 18 deletions ElectropaintView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -251,27 +256,30 @@ - (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 };
CGLSetParameter(CGLGetCurrentContext(), kCGLCPSwapInterval, params);

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);
Expand Down Expand Up @@ -312,9 +320,7 @@ - (void)display {
std::list<wing_type>::const_iterator i(wings.begin());
std::list<wing_type>::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();
Expand Down
2 changes: 1 addition & 1 deletion Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>0.3.5</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string>ElectropaintOSXView</string>
</dict>
Expand Down
33 changes: 26 additions & 7 deletions README.txt
Original file line number Diff line number Diff line change
@@ -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 <ynniv-ep@ynniv.com>. Thanks Vincent!

Version 0.3 is a universal binary, currently raising the minimum system requirements to 10.3.9. Changes by Alexander von Below <Alex@vonBelow.Com>
Version 0.3 is a universal binary, currently raising the minimum system
requirements to 10.3.9. Changes by Alexander von Below <Alex@vonBelow.Com>

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 <info@crimsonmagic.net>.
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 <info@crimsonmagic.net>.

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 <info@crimsonmagic.net>.
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 <info@crimsonmagic.net>.

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

Expand Down

0 comments on commit 3fddbb7

Please sign in to comment.