diff options
| author | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-06-25 17:05:29 +0000 |
|---|---|---|
| committer | SND\MaddTheSane_cp <SND\MaddTheSane_cp@e17a0e51-4ae3-4d35-97c3-1a29b211df97> | 2013-06-25 17:05:29 +0000 |
| commit | 1e070eefdd97247bffec46c5553e435e2bcc9972 (patch) | |
| tree | f0b36f16b560377a4ee4010151f1b417b7bc07ae /macosx/PcsxrMemoryObject.m | |
| parent | 5a29c04f291e9eb2f93fafb90ee2d7368b5627b9 (diff) | |
| download | pcsxr-1e070eefdd97247bffec46c5553e435e2bcc9972.tar.gz | |
Removing commented-out code in the memory object.
Encapsulate the icon image generator and setter in an autorelease block.
git-svn-id: https://pcsxr.svn.codeplex.com/svn/pcsxr@85532 e17a0e51-4ae3-4d35-97c3-1a29b211df97
Diffstat (limited to 'macosx/PcsxrMemoryObject.m')
| -rwxr-xr-x | macosx/PcsxrMemoryObject.m | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/macosx/PcsxrMemoryObject.m b/macosx/PcsxrMemoryObject.m index 1a13c879..71ecb0d7 100755 --- a/macosx/PcsxrMemoryObject.m +++ b/macosx/PcsxrMemoryObject.m @@ -30,20 +30,6 @@ { NSBitmapImageRep *imageRep = [[NSBitmapImageRep alloc] initWithBitmapDataPlanes:NULL pixelsWide:16 pixelsHigh:16 bitsPerSample:8 samplesPerPixel:3 hasAlpha:NO isPlanar:NO colorSpaceName:NSCalibratedRGBColorSpace bytesPerRow:0 bitsPerPixel:0]; -#if 0 - int x, y, c; - for (y = 0; y < 32; y++) { - for (x = 0; x < 32; x++) { - c = icon[(y>>1) * 16 + (x>>1)]; - c = ((c & 0x001f) << 10) | ((c & 0x7c00) >> 10) | (c & 0x03e0); - c = ((c & 0x001f) << 3) | ((c & 0x03e0) << 6) | ((c & 0x7c00) << 9); - - NSUInteger NSc = c; - - [imageRep setPixel:&NSc atX:x y:y]; - } - } -#else int x, y, c, i, r, g, b; for (i = 0; i < 256; i++) { x = (i % 16); @@ -54,11 +40,9 @@ b = ((c & 0x7c00) >> 10) << 3; [imageRep setColor:[NSColor colorWithCalibratedRed:r/255.0 green:g/255.0 blue:b/255.0 alpha:1.0] atX:x y:y]; } -#endif NSImage *theImage = [[NSImage alloc] init]; [theImage addRepresentation:imageRep]; RELEASEOBJ(imageRep); - [theImage setScalesWhenResized:YES]; [theImage setSize:NSMakeSize(32, 32)]; return AUTORELEASEOBJ(theImage); } @@ -68,7 +52,9 @@ if (self = [super init]) { self.englishName = [NSString stringWithCString:infoBlock->Title encoding:NSASCIIStringEncoding]; self.sjisName = [NSString stringWithCString:infoBlock->sTitle encoding:NSShiftJISStringEncoding]; - self.memImage = [PcsxrMemoryObject imageFromMcd:infoBlock->Icon]; + @autoreleasepool { + self.memImage = [PcsxrMemoryObject imageFromMcd:infoBlock->Icon]; + } self.memName = [NSString stringWithCString:infoBlock->Name encoding:NSASCIIStringEncoding]; self.memID = [NSString stringWithCString:infoBlock->ID encoding:NSASCIIStringEncoding]; self.memIconCount = infoBlock->IconCount; |
