Skip to content

Commit

Permalink
Dust off this old project. Update the nibs to xibs, migrate to the mo…
Browse files Browse the repository at this point in the history
…dern localization system, and enable base localization. Increase the maximum frame rate to 60 FPS. Set the new minimum OS to 10.9 so the screen saver will now use libc++ as its C++ library. Enable theoretical support for the integrated GPU.
  • Loading branch information
nickzman committed May 25, 2020
1 parent b484cf7 commit 2775328
Show file tree
Hide file tree
Showing 21 changed files with 578 additions and 7,004 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ profile
# Ignore leftovers from other SCM systems:
CVS
.svn
Hyperspace.xcodeproj/project.xcworkspace/xcuserdata
Hyperspace.xcodeproj/xcuserdata
321 changes: 321 additions & 0 deletions Base.lproj/ConfigureSheet.xib

Large diffs are not rendered by default.

2,313 changes: 0 additions & 2,313 deletions English.lproj/ConfigureSheet.nib/designable.nib

This file was deleted.

Binary file removed English.lproj/ConfigureSheet.nib/keyedobjects.nib
Binary file not shown.
2,313 changes: 0 additions & 2,313 deletions French.lproj/ConfigureSheet.nib/designable.nib

This file was deleted.

Binary file removed French.lproj/ConfigureSheet.nib/keyedobjects.nib
Binary file not shown.
2,313 changes: 0 additions & 2,313 deletions German.lproj/ConfigureSheet.nib/designable.nib

This file was deleted.

Binary file removed German.lproj/ConfigureSheet.nib/keyedobjects.nib
Binary file not shown.
120 changes: 89 additions & 31 deletions Hyperspace.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
33 changes: 7 additions & 26 deletions HyperspaceView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,6 @@
#import <OpenGL/OpenGL.h>
#import "Hyperspace/extensions.h"

FOUNDATION_STATIC_INLINE bool RSSShadersSupported(void)
{
SInt32 osVersion;

Gestalt(gestaltSystemVersion, &osVersion);
return (osVersion >= 0x1043 && queryExtension("GL_ARB_multitexture") && queryExtension("GL_ARB_texture_cube_map") && queryExtension("GL_ARB_shader_objects"));
}

@interface HyperspaceView (Private)
- (void)readDefaults:(ScreenSaverDefaults *)inDefaults;
- (void)setDialogValue;
Expand Down Expand Up @@ -68,15 +60,15 @@ - (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview
NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute)32,
NSOpenGLPFADoubleBuffer,
NSOpenGLPFAMinimumPolicy,
NSOpenGLPFAAllowOfflineRenderers,
(NSOpenGLPixelFormatAttribute)0
};
NSOpenGLPixelFormat *format = [[[NSOpenGLPixelFormat alloc] initWithAttributes:attribs] autorelease];
NSOpenGLPixelFormat *format = [[NSOpenGLPixelFormat alloc] initWithAttributes:attribs];

if (format)
{
lView = [[[NSOpenGLView alloc] initWithFrame:NSZeroRect pixelFormat:format] autorelease];
if ([lView respondsToSelector:@selector(setWantsBestResolutionOpenGLSurface:)])
lView.wantsBestResolutionOpenGLSurface = YES;
lView = [[NSOpenGLView alloc] initWithFrame:NSZeroRect pixelFormat:format];
lView.wantsBestResolutionOpenGLSurface = YES;
[self addSubview:lView];

lSettings.frameTime = 0;
Expand All @@ -88,7 +80,7 @@ - (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview
[self readDefaults:defaults];
}

[self setAnimationTimeInterval:1/30.0];
self.animationTimeInterval = 1.0/60.0;
lSettings.first = 1;
}
}
Expand All @@ -97,20 +89,13 @@ - (id)initWithFrame:(NSRect)frame isPreview:(BOOL)isPreview
}


- (void)dealloc
{
[ibConfigureSheet release]; // we have to release top level nib objects
[super dealloc];
}


- (void)setFrameSize:(NSSize)size
{
[super setFrameSize:size];
if (lView)
[lView setFrameSize:size];

if ([lView respondsToSelector:@selector(convertRectToBacking:)] && lView.wantsBestResolutionOpenGLSurface) // on Lion & later, if we're using a best resolution surface, then call glViewport() with the appropriate width and height for the backing
if (lView.wantsBestResolutionOpenGLSurface) // on Lion & later, if we're using a best resolution surface, then call glViewport() with the appropriate width and height for the backing
{
NSRect newBounds = [self convertRectToBacking:self.bounds];

Expand Down Expand Up @@ -184,8 +169,6 @@ - (void)drawRect:(NSRect)rect

tAttributes = [NSDictionary dictionaryWithObjectsAndKeys:[NSFont systemFontOfSize:[NSFont systemFontSize]],NSFontAttributeName,[NSColor whiteColor],NSForegroundColorAttributeName,tParagraphStyle,NSParagraphStyleAttributeName,nil];

[tParagraphStyle release];

tString=NSLocalizedStringFromTableInBundle(@"Minimum OpenGL requirements\rfor this Screen Effect\rnot available\ron your graphic card.",@"Localizable",[NSBundle bundleForClass:[self class]],@"No comment");

tStringFrame.origin=NSZeroPoint;
Expand Down Expand Up @@ -228,12 +211,10 @@ - (NSWindow*)configureSheet
lIsConfiguring = YES;
if (ibConfigureSheet == nil)
{
if ([NSBundle loadNibNamed:@"ConfigureSheet" owner:self])
if ([[NSBundle bundleForClass:self.class] loadNibNamed:@"ConfigureSheet" owner:self topLevelObjects:NULL])
{
[ibVersionTxt setStringValue:[[[NSBundle bundleForClass:[self class]] infoDictionary] objectForKey:@"CFBundleVersion"]]; // set the version text
[self setDialogValue];
if (RSSShadersSupported() == false)
[ibShaderCbx setEnabled:NO];
}
else
NSLog(@"Warning: %@ couldn't load ConfigureSheet.nib.", [self className]);
Expand Down
14 changes: 6 additions & 8 deletions Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,24 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIconFile</key>
<string></string>
<key>CFBundleIdentifier</key>
<string>com.reallyslick.Hyperspace</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>${PRODUCT_NAME}</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>2.1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>2.1.0</string>
<key>NSPrincipalClass</key>
<string>HyperspaceView</string>
<key>NSSupportsAutomaticGraphicsSwitching</key>
<true/>
</dict>
</plist>
69 changes: 69 additions & 0 deletions de.lproj/ConfigureSheet.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

/* Class = "NSWindow"; title = "Window"; ObjectID = "5"; */
"5.title" = "Window";

/* Class = "NSTextFieldCell"; title = "Hyperspace"; ObjectID = "61"; */
"61.title" = "Hyperspace";

/* Class = "NSTextFieldCell"; title = "(don't localize)"; ObjectID = "62"; */
"62.title" = "(don't localize)";

/* Class = "NSTextFieldCell"; title = "Copyright © 2005-2010 Terence M. Welsh."; ObjectID = "63"; */
"63.title" = "Copyright © 2005-2010 Terence M. Welsh.";

/* Class = "NSTextFieldCell"; title = "macOS port by Nick Zitzmann"; ObjectID = "64"; */
"64.title" = "macOS-Portierung by Nick Zitzmann";

/* Class = "NSTextFieldCell"; title = "Resolution of geometry:"; ObjectID = "65"; */
"65.title" = "Geometrische Verteilung:";

/* Class = "NSTextFieldCell"; title = "Number of stars:"; ObjectID = "66"; */
"66.title" = "Anzahl der Sterne:";

/* Class = "NSTextFieldCell"; title = "Speed:"; ObjectID = "67"; */
"67.title" = "Geschwindigkeit:";

/* Class = "NSTextFieldCell"; title = "Size of stars:"; ObjectID = "68"; */
"68.title" = "Größe der Sterne:";

/* Class = "NSTextFieldCell"; title = "View depth:"; ObjectID = "69"; */
"69.title" = "Sichtweite:";

/* Class = "NSTextFieldCell"; title = "Field of view:"; ObjectID = "70"; */
"70.title" = "Sichtfeld:";

/* Class = "NSButtonCell"; title = "Enable pixel & vertex shaders (if available)"; ObjectID = "71"; */
"71.title" = "Pixel- & Vertexshader aktivieren (wenn verfügbar)";

/* Class = "NSButtonCell"; title = "Main screen only"; ObjectID = "72"; */
"72.title" = "Nur auf Hauptbildschirm zeigen";

/* Class = "NSButtonCell"; title = "Close"; ObjectID = "73"; */
"73.title" = "Schließen";

/* Class = "NSButtonCell"; title = "Defaults"; ObjectID = "74"; */
"74.title" = "Voreinstellungen";

/* Class = "NSTextFieldCell"; title = "#"; ObjectID = "76"; */
"76.title" = "#";

/* Class = "NSTextFieldCell"; title = "#"; ObjectID = "79"; */
"79.title" = "#";

/* Class = "NSTextFieldCell"; title = "#"; ObjectID = "80"; */
"80.title" = "#";

/* Class = "NSTextFieldCell"; title = "#"; ObjectID = "81"; */
"81.title" = "#";

/* Class = "NSTextFieldCell"; title = "#"; ObjectID = "82"; */
"82.title" = "#";

/* Class = "NSTextFieldCell"; title = "#"; ObjectID = "83"; */
"83.title" = "#";

/* Class = "NSButtonCell"; title = "Enable the nebula"; ObjectID = "88"; */
"88.title" = "Nebelfleck aktivieren";

/* Class = "NSButtonCell"; title = "Enable wormholes"; ObjectID = "90"; */
"90.title" = "Wurmlock aktivieren";
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
69 changes: 69 additions & 0 deletions fr.lproj/ConfigureSheet.strings
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@

/* Class = "NSWindow"; title = "Window"; ObjectID = "5"; */
"5.title" = "Window";

/* Class = "NSTextFieldCell"; title = "Hyperspace"; ObjectID = "61"; */
"61.title" = "Hyperspace";

/* Class = "NSTextFieldCell"; title = "(don't localize)"; ObjectID = "62"; */
"62.title" = "(don't localize)";

/* Class = "NSTextFieldCell"; title = "Copyright © 2005-2010 Terence M. Welsh."; ObjectID = "63"; */
"63.title" = "Copyright © 2005-2010 Terence M. Welsh.";

/* Class = "NSTextFieldCell"; title = "macOS port by Nick Zitzmann"; ObjectID = "64"; */
"64.title" = "port macOS par Nick Zitzmann";

/* Class = "NSTextFieldCell"; title = "Resolution of geometry:"; ObjectID = "65"; */
"65.title" = "Résolution de géometrie :";

/* Class = "NSTextFieldCell"; title = "Number of stars:"; ObjectID = "66"; */
"66.title" = "Nombre d'étoiles :";

/* Class = "NSTextFieldCell"; title = "Speed:"; ObjectID = "67"; */
"67.title" = "Vitesse :";

/* Class = "NSTextFieldCell"; title = "Size of stars:"; ObjectID = "68"; */
"68.title" = "Taille des étoiles :";

/* Class = "NSTextFieldCell"; title = "View depth:"; ObjectID = "69"; */
"69.title" = "Profondeur du champ :";

/* Class = "NSTextFieldCell"; title = "Field of view:"; ObjectID = "70"; */
"70.title" = "Champ de vision :";

/* Class = "NSButtonCell"; title = "Enable pixel & vertex shaders (if available)"; ObjectID = "71"; */
"71.title" = "Activer les ombres des pixels et des vertex (si disponible)";

/* Class = "NSButtonCell"; title = "Main screen only"; ObjectID = "72"; */
"72.title" = "Écran principal uniquement";

/* Class = "NSButtonCell"; title = "Close"; ObjectID = "73"; */
"73.title" = "Fermer";

/* Class = "NSButtonCell"; title = "Defaults"; ObjectID = "74"; */
"74.title" = "Réglages par défaut";

/* Class = "NSTextFieldCell"; title = "#"; ObjectID = "76"; */
"76.title" = "#";

/* Class = "NSTextFieldCell"; title = "#"; ObjectID = "79"; */
"79.title" = "#";

/* Class = "NSTextFieldCell"; title = "#"; ObjectID = "80"; */
"80.title" = "#";

/* Class = "NSTextFieldCell"; title = "#"; ObjectID = "81"; */
"81.title" = "#";

/* Class = "NSTextFieldCell"; title = "#"; ObjectID = "82"; */
"82.title" = "#";

/* Class = "NSTextFieldCell"; title = "#"; ObjectID = "83"; */
"83.title" = "#";

/* Class = "NSButtonCell"; title = "Enable the nebula"; ObjectID = "88"; */
"88.title" = "Activer la nébuleuse";

/* Class = "NSButtonCell"; title = "Enable wormholes"; ObjectID = "90"; */
"90.title" = "Activer trous de ver";
File renamed without changes.
File renamed without changes.

0 comments on commit 2775328

Please sign in to comment.