Painter/PainterFactoryForMacTrek.m

00001 //
00002 //  PainterFactoryForMacTrek.m
00003 //  MacTrek
00004 //
00005 //  Created by Aqua on 23/07/2006.
00006 //  Copyright 2006 Luky Soft. All rights reserved.
00007 //
00008 
00009 #import "PainterFactoryForMacTrek.h"
00010 
00011 
00012 @implementation PainterFactoryForMacTrek
00013 
00014 - (NSImage *)loadImage:(NSString*)imageName {
00015     
00016     // try new image first
00017     NSString *pathToResources = [[NSBundle mainBundle] resourcePath];
00018     NSString *pathToImage = [NSString stringWithFormat:@"%@/ImagesPainter2%@", pathToResources, imageName];
00019     
00020     NSImage *rawImage = [[NSImage alloc] initWithContentsOfFile:pathToImage];
00021     
00022     if (rawImage == nil) {
00023         //NSLog(@"PainterFactoryForMacTrek.loadImage %@ failed, reverting to super", pathToImage);
00024         // something went wrong try super image
00025         return [super loadImage:imageName];
00026     }
00027        
00028     return rawImage;
00029 }
00030 
00031 
00032 
00033 @end

Generated on Sat Aug 26 21:14:16 2006 for MacTrek by  doxygen 1.4.7