RSS

(root)/iphone/common : 69 : source/NSObject_DeviceDetection.m

To get this branch, use:
bzr branch /browse/iphone/common

« back to all changes in this revision

Viewing changes to source/NSObject_DeviceDetection.m

Dömötör Gulyás
2010-07-17 20:07:09
Revision ID: dognotdog@gmail.com-20100717180709-omc3fn0qfclzvcad
fixes crash caused by -currentMode on UIScreen not being available prior to iOS 3.2

Show diffs side-by-side

added added

removed removed

43
43
 
44
44
- (uint32_t) fullScreenTexturePotSize
45
45
{
46
 
 
47
 
        CGSize size = [UIScreen mainScreen].currentMode.size;
 
46
        UIScreen* screen = [UIScreen mainScreen];
 
47
 
 
48
        CGSize size = CGSizeMake(320.0f,480.0f);
 
49
        if ([screen respondsToSelector: @selector(currentMode)]) // iOS 3.2 and later only
 
50
                size = screen.currentMode.size;
 
51
        
 
52
 
48
53
        uint32_t px = fmaxf(size.width,size.height);
49
54
        return nextPot(px);
50
55
        

Loggerhead 1.17 is a web-based interface for Bazaar branches