git.y1.nz

SameBoy

Accurate GB/GBC emulator
download: https://git.y1.nz/archives/sameboy.tar.gz
README | Files | Log | Refs | LICENSE

Cocoa/GBTintedImageCell.m

      1 #import "GBTintedImageCell.h"
      2 
      3 @implementation GBTintedImageCell
      4 
      5 - (NSImage *)image
      6 {
      7     if (!self.tint || !super.image.isTemplate) {
      8         return [super image];
      9     }
     10     
     11     NSImage *tinted = [super.image copy];
     12     [tinted lockFocus];
     13     [self.tint set];
     14     NSRectFillUsingOperation((NSRect){.size = tinted.size}, NSCompositeSourceIn);
     15     [tinted unlockFocus];
     16     tinted.template = false;
     17     return tinted;
     18 }
     19 
     20 @end

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.