Skip to content

Commit

Permalink
changed now outputs string text for .fitler files
Browse files Browse the repository at this point in the history
  • Loading branch information
lostjared committed Feb 6, 2019
1 parent 1d3f1de commit b148a1d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
Binary file not shown.
30 changes: 23 additions & 7 deletions Acid.Cam.v2.OSX/AC_Controller.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2390,7 +2390,13 @@ - (IBAction) custom_Save: (id) sender {
NSNumber *sval = [custom_subfilters objectAtIndex:i];
NSInteger value1 = [nval integerValue];
NSInteger value2 = [sval integerValue];
file_n << (int)value1 << ":" << value2 << "\n";
std::string value1s, value2s;
value1s = ac::draw_strings[value1];
if(value2 != -1)
value2s = ac::draw_strings[value2];
else
value2s = "None";
file_n << value1s << ":" << value2s << "\n";
}
std::ostringstream stream;
stream << "Wrote custom to: " << [fileName UTF8String] << "\n";
Expand Down Expand Up @@ -2430,8 +2436,13 @@ - (IBAction) custom_Load: (id) sender {
}
s_left = item.substr(0,pos);
s_right = item.substr(pos+1, item.length());
int val1 = atoi(s_left.c_str());
int val2 = atoi(s_right.c_str());
int val1 = ac::filter_map[s_left];
int val2 = 0;
if(s_right == "None")
val2 = -1;
else
val2 = ac::filter_map[s_right];

if(!(val1 >= 0 && val1 < ac::draw_max-4)) {
_NSRunAlertPanel(@"Unsupported Value", @"Filter value out of range... wrong program revision?", @"Ok", nil, nil);
return;
Expand All @@ -2446,13 +2457,18 @@ - (IBAction) custom_Load: (id) sender {
for(int i = 0; i < values.size(); ++i) {
std::string item = values[i];
std::string s_left, s_right;
s_left = item.substr(0, item.find(";"));
s_left = item.substr(0, item.find(":"));
s_right = item.substr(item.find(":")+1, item.length());
NSNumber *num1 = [NSNumber numberWithInteger: atoi(s_left.c_str())];
NSNumber *num2 = [NSNumber numberWithInteger: atoi(s_right.c_str())];
int val1 = ac::filter_map[s_left];
int val2 = 0;
if(s_right == "None")
val2 = -1;
else
val2 = ac::filter_map[s_right];
NSNumber *num1 = [NSNumber numberWithInteger: val1];
NSNumber *num2 = [NSNumber numberWithInteger: val2];
[custom_array addObject:num1];
[custom_subfilters addObject:num2];

}
[table_view reloadData];
file.close();
Expand Down

0 comments on commit b148a1d

Please sign in to comment.