Changeset 726


Ignore:
Timestamp:
Mar 6, 2011, 11:49:41 PM (10 years ago)
Author:
sam
Message:

ios: get texture loading to work, somehow.

Location:
trunk/src
Files:
1 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/Makefile.am

    r725 r726  
    2121liblol_a_CPPFLAGS = @LOL_CFLAGS@
    2222
    23 EXTRA_DIST = image.mm
    24 
  • trunk/src/image.cpp

    r725 r726  
    1717
    1818#if defined __APPLE__ && defined __MACH__
    19 #
     19#   import <UIKit/UIKit.h>
    2020#elif defined USE_SDL
    2121#   include <SDL.h>
     
    6969{
    7070#if defined __APPLE__ && defined __MACH__
    71     NSString *path = [[NSBundle mainBundle] pathForResource:@"ascii" ofType:@"png"];
    72     NSData *pngdata = [[NSData alloc] initWithContentsOfFile:path];
     71        NSString *fullpath = [NSString stringWithUTF8String:path];
     72        NSArray *chunks = [fullpath componentsSeparatedByString: @"/"];
     73        NSString *filename = [chunks objectAtIndex: [chunks count] - 1];
     74        chunks = [filename componentsSeparatedByString: @"."];
     75        NSString *prefix = [chunks objectAtIndex: 0];
     76    NSString *mypath = [[NSBundle mainBundle] pathForResource:prefix ofType:@"png"];
     77    NSData *pngdata = [[NSData alloc] initWithContentsOfFile:mypath];
    7378    UIImage *image = [[UIImage alloc] initWithData:pngdata];
    7479    if (!image)
Note: See TracChangeset for help on using the changeset viewer.