SameBoy | Accurate GB/GBC emulator |
| download: https://git.y1.nz/archives/sameboy.tar.gz | |
| README | Files | Log | Refs | LICENSE |
commit 686a506e174dfdc761a45b5733438c163b6ba01a parent 5fb6d55c67ce3f6f5752c3877d38e6caef88e01f Author: Lior Halphon <LIJI32@gmail.com> Date: Thu, 11 Jan 2024 23:55:01 +0200 Fix the Quick Look generator for macOS Sonoma, fixes #581 Diffstat:
| M | QuickLook/generator.m | 7 | +++++-- |
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/QuickLook/generator.m b/QuickLook/generator.m @@ -10,9 +10,12 @@ static OSStatus render(CGContextRef cgContext, CFURLRef url, bool showBorder) static NSImage *templateColor = nil; static NSBundle *bundle = nil; static dispatch_once_t onceToken; + dispatch_once(&onceToken, ^{ + bundle = [NSBundle bundleWithIdentifier:@"com.github.liji32.sameboy.previewer"]; + }); if (showBorder) { + static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - bundle = [NSBundle bundleWithIdentifier:@"com.github.liji32.sameboy.previewer"]; template = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"CartridgeTemplate" ofType:@"png"]]; templateUniversal = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"UniversalCartridgeTemplate" ofType:@"png"]]; templateColor = [[NSImage alloc] initWithContentsOfFile:[bundle pathForResource:@"ColorCartridgeTemplate" ofType:@"png"]]; @@ -31,7 +34,7 @@ static OSStatus render(CGContextRef cgContext, CFURLRef url, bool showBorder) /* Convert the screenshot to a CGImageRef */ CGDataProviderRef provider = CGDataProviderCreateWithData(NULL, bitmap, sizeof(bitmap), NULL); CGColorSpaceRef colorSpaceRef = CGColorSpaceCreateDeviceRGB(); - CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault; + CGBitmapInfo bitmapInfo = kCGBitmapByteOrderDefault | kCGImageAlphaNoneSkipLast; CGColorRenderingIntent renderingIntent = kCGRenderingIntentDefault; CGImageRef iref = CGImageCreate(160,
This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.