/[hegemonie]/hegemonie/Map/MapTerrain.m
ViewVC logotype

Diff of /hegemonie/Map/MapTerrain.m

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.3 by el_doc, Wed Jul 2 16:41:57 2003 UTC revision 1.4 by dam, Sun Jul 6 22:17:13 2003 UTC
# Line 24  Line 24 
24  #include <errno.h>  #include <errno.h>
25  #include <stdio.h>  #include <stdio.h>
26    
 #include <AppKit/NSBitmapImageRep.h>  
27  #include <Foundation/NSArray.h>  #include <Foundation/NSArray.h>
28  #include <Foundation/NSException.h>  #include <Foundation/NSException.h>
29    #include <Foundation/NSDebug.h>
30    #include <AppKit/NSBitmapImageRep.h>
31    
32  #include "Map/MapTerrain.h"  #include "Map/MapTerrain.h"
33    
# Line 71  aroundTheWorld (int n, int max) Line 72  aroundTheWorld (int n, int max)
72      {      {
73        NSArray *imageReps = [NSBitmapImageRep imageRepsWithFile: imageName];        NSArray *imageReps = [NSBitmapImageRep imageRepsWithFile: imageName];
74        if ([imageReps count] != 1)        if ([imageReps count] != 1)
75          return nil;          {
76              NSWarnMLog (@"Could not open map file");
77              return nil;
78            }
79    
80        NSBitmapImageRep *image = [imageReps objectAtIndex: 0];        NSBitmapImageRep *image = [imageReps objectAtIndex: 0];
81    
82        if ( [image bitsPerSample] != 8        if ( [image bitsPerSample] != 8
83             || [image samplesPerPixel] != 1 ) // gray level check             || [image samplesPerPixel] != 1 ) // gray level check
84          return nil;          {
85              NSWarnMLog (@"Incorrect map colors file format");
86              return nil;
87            }
88    
89        /* FIXME - Must be retained */        /* FIXME - Must be retained */
90        _heightField = [image bitmapData];        _heightField = [image bitmapData];

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26