Changeset 973 for cpp/frams/_demos/loader_test_geno.cpp
- Timestamp:
- 07/03/20 00:37:13 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/frams/_demos/loader_test_geno.cpp
r732 r973 1 1 // This file is a part of Framsticks SDK. http://www.framsticks.com/ 2 // Copyright (C) 1999-20 15Maciej Komosinski and Szymon Ulatowski.2 // Copyright (C) 1999-2020 Maciej Komosinski and Szymon Ulatowski. 3 3 // See LICENSE.txt for details. 4 4 … … 20 20 "If a genotype is indicated (by providing the optional genotype identifier), the program will output the raw genotype, suitable for Framsticks Theater's genotype viewer mode. If a genotype and a field name is given, the field value (instead of the raw genotype) is printed. If the second argument is not given, the genotype names from the file will be listed.\n" 21 21 "Example: loader_test walking.gen \"Basic Quadruped\" | theater -g -\n" 22 22 ); 23 23 return 1; 24 24 } … … 29 29 const char* selected = (argc < 3) ? NULL : argv[2]; 30 30 const char* field_name = (argc < 4) ? NULL : argv[3]; 31 int selected_index = (selected &&isdigit(selected[0])) ? atol(selected) : 0;31 int selected_index = (selected && isdigit(selected[0])) ? atol(selected) : 0; 32 32 // using char* constructor (passing the file name to open) 33 33 GenotypeMini *loaded; … … 36 36 // loaded into MiniGenotype object 37 37 count++; 38 totalsize += loaded->genotype.len ();38 totalsize += loaded->genotype.length(); 39 39 if (selected) 40 40 { … … 65 65 return 0; 66 66 } 67 fprintf(stderr, "%d. %s\t(%d characters)\n", count, loaded->name.c_str(), loaded->genotype.len ());67 fprintf(stderr, "%d. %s\t(%d characters)\n", count, loaded->name.c_str(), loaded->genotype.length()); 68 68 } 69 69 // the loop repeats until loaded==NULL, which could be beacause of error
Note: See TracChangeset
for help on using the changeset viewer.