Permalink
Browse files

ANSi generation routine now based on AnsiLove/C's synopsis

  • Loading branch information...
1 parent 628e5e1 commit 12f16e61007f8dec0c26196c2fab227b6d8359d5 @ByteProject ByteProject committed Mar 24, 2012
Showing with 10 additions and 6 deletions.
  1. +10 −6 AnsiLove/Classes/ALAnsiGenerator.m
View
16 AnsiLove/Classes/ALAnsiGenerator.m
@@ -2,7 +2,7 @@
// ALAnsiGenerator.m
// AnsiLove.framework
//
-// Copyright (c) 2011, Stefan Vogt. All rights reserved.
+// Copyright (c) 2011-2012, Stefan Vogt. All rights reserved.
// http://byteproject.net
//
// Use of this source code is governed by a MIT-style license.
@@ -21,10 +21,10 @@ - (id)init
+ (void)createPNGFromAnsiSource:(NSString *)inputFile
outputFile:(NSString *)outputFile
- columns:(NSString *)columns
font:(NSString *)font
bits:(NSString *)bits
iceColors:(NSString *)iceColors
+ columns:(NSString *)columns
{
if (inputFile == nil || inputFile == @"") {
// No inputfile? This means we can't do anything. Get the hell outta here.
@@ -44,15 +44,16 @@ + (void)createPNGFromAnsiSource:(NSString *)inputFile
// Initialize the arguments array.
NSMutableArray *arguments = [[NSMutableArray alloc] init];
- // Add the two most necessary arguments to the array.
+ // option flag for generating output in AnsiLove/C
+ NSString *optionFlag = @"-o";
+
+ // Add the three most necessary arguments to the array.
[arguments addObject:inputFile];
+ [arguments addObject:optionFlag];
[arguments addObject:outputFile];
// The following if statements check if a string is nil or empty. That way we can
// be sure only strings with proper contents will be added to the arguments array.
- if (columns && ![columns isEqualToString:@""]) {
- [arguments addObject:columns];
- }
if (font && ![font isEqualToString:@""]) {
[arguments addObject:font];
}
@@ -62,6 +63,9 @@ + (void)createPNGFromAnsiSource:(NSString *)inputFile
if (iceColors && [iceColors isEqualToString:@"1"]) {
[arguments addObject:iceColors];
}
+ if (columns && ![columns isEqualToString:@""]) {
+ [arguments addObject:columns];
+ }
// Finally start the task with the flags we gathered.
NSPipe *pipe;

0 comments on commit 12f16e6

Please sign in to comment.