Skip to content

Commit

Permalink
Cleanup and make it build on Big Sur
Browse files Browse the repository at this point in the history
Sorry that this took so long.
  • Loading branch information
cochrane committed Nov 26, 2020
1 parent 392321b commit 01ac6db
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 28 deletions.
14 changes: 9 additions & 5 deletions GLLara.xcodeproj/project.pbxproj
Expand Up @@ -1669,7 +1669,7 @@
attributes = {
CLASSPREFIX = GLL;
LastTestingUpgradeCheck = 0620;
LastUpgradeCheck = 1100;
LastUpgradeCheck = 1210;
ORGANIZATIONNAME = "Torsten Kammer";
TargetAttributes = {
525ACD4615F0F1A700534E7D = {
Expand Down Expand Up @@ -2447,6 +2447,7 @@
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;
Expand Down Expand Up @@ -2504,6 +2505,7 @@
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;
Expand Down Expand Up @@ -2537,9 +2539,10 @@
525ACD7D15F0F1A700534E7D /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 15;
DEVELOPMENT_TEAM = MXAKMKWG34;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "GLLara/GLLara-Info.plist";
Expand All @@ -2555,9 +2558,10 @@
525ACD7E15F0F1A700534E7D /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_IDENTITY = "Mac Developer";
CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 11;
CURRENT_PROJECT_VERSION = 15;
DEVELOPMENT_TEAM = MXAKMKWG34;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "GLLara/GLLara-Info.plist";
Expand Down
4 changes: 2 additions & 2 deletions GLLara/GLLModelBone.h
Expand Up @@ -21,10 +21,10 @@
@interface GLLModelBone : NSObject

// Bone without parent, children at position 0, 0, 0. No need to call setupParent afterwards.
- (id)initWithModel:(GLLModel *)model;
- (instancetype)initWithModel:(GLLModel *)model;

// Stream must be either a GLLASCIIScanner or a TRInDataStream.
- (id)initFromSequentialData:(id)stream partOfModel:(GLLModel *)model atIndex:(NSUInteger)index error:(NSError *__autoreleasing*)error;
- (instancetype)initFromSequentialData:(id)stream partOfModel:(GLLModel *)model atIndex:(NSUInteger)index error:(NSError *__autoreleasing*)error;

// Export
- (NSString *)writeASCII;
Expand Down
4 changes: 2 additions & 2 deletions GLLara/GLLModelBone.m
Expand Up @@ -16,7 +16,7 @@

@implementation GLLModelBone

- (id)initWithModel:(GLLModel *)model;
- (instancetype)initWithModel:(GLLModel *)model;
{
if (!(self = [super init])) return nil;

Expand All @@ -38,7 +38,7 @@ - (id)initWithModel:(GLLModel *)model;

}

- (id)initFromSequentialData:(id)stream partOfModel:(GLLModel *)model atIndex:(NSUInteger)index error:(NSError *__autoreleasing*)error;
- (instancetype)initFromSequentialData:(id)stream partOfModel:(GLLModel *)model atIndex:(NSUInteger)index error:(NSError *__autoreleasing*)error;
{
if (!(self = [super init])) return nil;

Expand Down
4 changes: 2 additions & 2 deletions GLLara/GLLPoseExporter.h
Expand Up @@ -17,8 +17,8 @@
*/
@interface GLLPoseExporter : NSObject

- (id)initWithBones:(id)bones __attribute__((nonnull(1)));
- (id)initWithItem:(GLLItem *)item __attribute__((nonnull(1)));
- (instancetype)initWithBones:(id)bones __attribute__((nonnull(1)));
- (instancetype)initWithItem:(GLLItem *)item __attribute__((nonnull(1)));

@property (nonatomic) BOOL skipUnused;

Expand Down
4 changes: 2 additions & 2 deletions GLLara/GLLPoseExporter.m
Expand Up @@ -20,13 +20,13 @@ @interface GLLPoseExporter ()

@implementation GLLPoseExporter

- (id)initWithItem:(GLLItem *)item
- (instancetype)initWithItem:(GLLItem *)item
{
NSParameterAssert(item);
return [self initWithBones:item.combinedBones];
}

- (id)initWithBones:(id)bones
- (instancetype)initWithBones:(id)bones
{
NSParameterAssert(bones);
if (!(self = [super init])) return nil;
Expand Down
2 changes: 1 addition & 1 deletion GLLara/GLLProgram.m
Expand Up @@ -87,7 +87,7 @@ - (id)initWithName:(NSString *)name fragmentShader:(GLLShader *)fragment geometr

if (error)
*error = [NSError errorWithDomain:@"OpenGL" code:1 userInfo:@{ NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"The shader \"%@\" could not be linked", @"GLLShader error message description"), _name],
NSLocalizedFailureReasonErrorKey : [NSString stringWithFormat:NSLocalizedString(@"Message from OpenGL driver: %s", log)],
NSLocalizedFailureReasonErrorKey : [NSString stringWithFormat:NSLocalizedString(@"Message from OpenGL driver: %s", "No shader there wtf?"), log],
NSLocalizedRecoverySuggestionErrorKey : NSLocalizedString(@"Please inform a developer of this problem.", @"No shader there wtf?")
}];
NSLog(@"link error in shader %@: %s", _name, log);
Expand Down
2 changes: 1 addition & 1 deletion GLLara/GLLRenderWindowController.m
Expand Up @@ -110,7 +110,7 @@ - (NSManagedObjectContext *)managedObjectContext

- (NSString *)windowTitleForDocumentDisplayName:(NSString *)displayName
{
return [NSString stringWithFormat:NSLocalizedString(@"%@ - Render view %lu", @"render window title format"), displayName, self.camera.index + 1];
return [NSString stringWithFormat:NSLocalizedString(@"%@ - Render view %lld", @"render window title format"), displayName, self.camera.index + 1];
}

#pragma mark - Actions
Expand Down
2 changes: 1 addition & 1 deletion GLLara/GLLShader.m
Expand Up @@ -61,7 +61,7 @@ - (id)initWithSource:(NSString *)sourceString name:(NSString *)name additionalDe

if (error)
*error = [NSError errorWithDomain:@"OpenGL" code:1 userInfo:@{ NSLocalizedDescriptionKey : [NSString stringWithFormat:NSLocalizedString(@"The shader \"%@\" could not be compiled properly", @"GLLShader error message description"), name],
NSLocalizedFailureReasonErrorKey : [NSString stringWithFormat:NSLocalizedString(@"Message from OpenGL driver: %s", log)],
NSLocalizedFailureReasonErrorKey : [NSString stringWithFormat:NSLocalizedString(@"Message from OpenGL driver: %s", "No shade there wtf?"), log],
NSLocalizedRecoverySuggestionErrorKey : NSLocalizedString(@"Please inform a developer of this problem.", @"No shader there wtf?")
}];
NSLog(@"compile error in shader %@: %s", _name, log);
Expand Down
21 changes: 9 additions & 12 deletions GLLara/NSCharacterSet+SetOperations.m
Expand Up @@ -8,9 +8,6 @@

#import "NSCharacterSet+SetOperations.h"

#include <xmmintrin.h>
#include <emmintrin.h>

@implementation NSCharacterSet (SetOperations)

- (BOOL)hasIntersectionWithSet:(NSCharacterSet *)other;
Expand All @@ -20,18 +17,18 @@ - (BOOL)hasIntersectionWithSet:(NSCharacterSet *)other;

NSAssert(myData.length == 8192 && theirData.length == 8192, @"bitmap representation of character set should always be 8192 bytes");

const __m128 *mine = (const __m128 *) myData.bytes;
const __m128 *theirs = (const __m128 *) theirData.bytes;
__m128 result = _mm_setzero_ps();
for (NSUInteger i = 0; i < 512; i += 4)
const uint64_t *mine = (const uint64_t *) myData.bytes;
const uint64_t *theirs = (const uint64_t *) theirData.bytes;
uint64_t result = 0;
for (NSUInteger i = 0; i < (8192/(4*sizeof(mine[0]))) && result == 0; i += 4)
{
result = _mm_or_ps(result, _mm_and_ps(mine[i + 0], theirs[i + 0]));
result = _mm_or_ps(result, _mm_and_ps(mine[i + 1], theirs[i + 1]));
result = _mm_or_ps(result, _mm_and_ps(mine[i + 2], theirs[i + 2]));
result = _mm_or_ps(result, _mm_and_ps(mine[i + 3], theirs[i + 3]));
result |= mine[i+0] & theirs[i+0];
result |= mine[i+1] & theirs[i+1];
result |= mine[i+2] & theirs[i+2];
result |= mine[i+3] & theirs[i+3];
}

return _mm_movemask_ps(_mm_cmpneq_ps(result, _mm_setzero_ps()));
return result != 0;
}

@end

0 comments on commit 01ac6db

Please sign in to comment.