Removed some debug prints on iOS.

This commit is contained in:
Alex Szpakowski
2015-06-11 21:16:28 -03:00
parent 3053278048
commit 59e4b1b8d6
2 changed files with 29 additions and 27 deletions
@@ -1466,6 +1466,8 @@
FA0B7CCC1A95902C000E1D17 /* wrap_Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Window.h; sourceTree = "<group>"; }; FA0B7CCC1A95902C000E1D17 /* wrap_Window.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wrap_Window.h; sourceTree = "<group>"; };
FA0B7EF01A959D2C000E1D17 /* iOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iOS.h; sourceTree = "<group>"; }; FA0B7EF01A959D2C000E1D17 /* iOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = iOS.h; sourceTree = "<group>"; };
FA0B7EF11A959D2C000E1D17 /* iOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = iOS.mm; sourceTree = "<group>"; }; FA0B7EF11A959D2C000E1D17 /* iOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = iOS.mm; sourceTree = "<group>"; };
FA283EDC1B27CFAA00C70067 /* nogame.lua */ = {isa = PBXFileReference; lastKnownFileType = text; path = nogame.lua; sourceTree = "<group>"; };
FA283EDD1B27CFAA00C70067 /* nogame.lua.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = nogame.lua.h; sourceTree = "<group>"; };
FA317EB918F28B6D00B0BCD7 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; FA317EB918F28B6D00B0BCD7 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
FA4B66C81ABBCF1900558F15 /* Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Timer.cpp; sourceTree = "<group>"; }; FA4B66C81ABBCF1900558F15 /* Timer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Timer.cpp; sourceTree = "<group>"; };
FA577A6716C719D900860150 /* FreeType.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FreeType.framework; path = /Library/Frameworks/FreeType.framework; sourceTree = "<absolute>"; }; FA577A6716C719D900860150 /* FreeType.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FreeType.framework; path = /Library/Frameworks/FreeType.framework; sourceTree = "<absolute>"; };
@@ -1566,6 +1568,8 @@
503971A86B7167A91B670FBA /* boot.lua.h */, 503971A86B7167A91B670FBA /* boot.lua.h */,
FA577A8E16C71D3600860150 /* graphics.lua */, FA577A8E16C71D3600860150 /* graphics.lua */,
104144AB73A974BC04A03131 /* graphics.lua.h */, 104144AB73A974BC04A03131 /* graphics.lua.h */,
FA283EDC1B27CFAA00C70067 /* nogame.lua */,
FA283EDD1B27CFAA00C70067 /* nogame.lua.h */,
); );
name = scripts; name = scripts;
path = ../../src/scripts; path = ../../src/scripts;
+25 -27
View File
@@ -148,35 +148,38 @@ static bool deleteFileInDocuments(NSString *filename)
static int dropFileEventFilter(void *userdata, SDL_Event *event) static int dropFileEventFilter(void *userdata, SDL_Event *event)
{ {
if (event->type != SDL_DROPFILE) @autoreleasepool
return 1;
NSString *fname = @(event->drop.file);
NSFileManager *fmanager = [NSFileManager defaultManager];
if ([fmanager fileExistsAtPath:fname] && [fname.pathExtension isEqual:@"love"])
{ {
NSString *documents = getDocumentsDirectory(); if (event->type != SDL_DROPFILE)
return 1;
documents = [[documents stringByStandardizingPath] stringByResolvingSymlinksInPath]; NSString *fname = @(event->drop.file);
fname = [[fname stringByStandardizingPath] stringByResolvingSymlinksInPath]; NSFileManager *fmanager = [NSFileManager defaultManager];
// Is the file inside the Documents directory? if ([fmanager fileExistsAtPath:fname] && [fname.pathExtension isEqual:@"love"])
if ([fname hasPrefix:documents])
{ {
LOVETableViewController *vc = (__bridge LOVETableViewController *) userdata; NSString *documents = getDocumentsDirectory();
// Update the game list. documents = documents.stringByStandardizingPath.stringByResolvingSymlinksInPath;
NSArray *games = getLovesInDocuments(); fname = fname.stringByStandardizingPath.stringByResolvingSymlinksInPath;
vc.gameList = [[NSMutableArray alloc] initWithArray:games copyItems:YES];
[vc.tableView reloadData];
SDL_free(event->drop.file); // Is the file inside the Documents directory?
return 0; if ([fname hasPrefix:documents])
{
LOVETableViewController *vc = (__bridge LOVETableViewController *) userdata;
// Update the game list.
NSArray *games = getLovesInDocuments();
vc.gameList = [[NSMutableArray alloc] initWithArray:games copyItems:YES];
[vc.tableView reloadData];
SDL_free(event->drop.file);
return 0;
}
} }
}
return 1; return 1;
}
} }
namespace love namespace love
@@ -245,7 +248,6 @@ std::string getLoveInResources(bool &fused)
{ {
// The game should be fused if we have something here. // The game should be fused if we have something here.
fused = true; fused = true;
NSLog(@".love files in main Bundle: %@", bundlepaths);
return [bundlepaths[0] UTF8String]; return [bundlepaths[0] UTF8String];
} }
@@ -253,9 +255,6 @@ std::string getLoveInResources(bool &fused)
// fused. // fused.
NSArray *filepaths = getLovesInDocuments(); NSArray *filepaths = getLovesInDocuments();
if (filepaths.count > 0)
NSLog(@".love files in Documents: %@", filepaths);
// Let the user select a game from the un-fused list. // Let the user select a game from the un-fused list.
NSString *selectedfile = showGameList(filepaths); NSString *selectedfile = showGameList(filepaths);
@@ -263,8 +262,7 @@ std::string getLoveInResources(bool &fused)
if (selectedfile != nil && selectedfile.length > 0) if (selectedfile != nil && selectedfile.length > 0)
{ {
NSString *documents = getDocumentsDirectory(); NSString *documents = getDocumentsDirectory();
path = [[documents stringByAppendingPathComponent:selectedfile] UTF8String]; path = [documents stringByAppendingPathComponent:selectedfile].UTF8String;
NSLog(@"Using unfused .love file: %@", selectedfile);
} }
} }