| 906 | } |
| 907 | |
| 908 | int parseConstellationColor(CommandConstellationColor* cmd, string s, Vec3d *col, int act) |
| 909 | { |
| 910 | istringstream in(s); |
| 911 | |
| 912 | Tokenizer tokenizer(&in); |
| 913 | int flags = 0; |
| 914 | |
| 915 | if(!act) |
| 916 | cmd->unsetColor(); |
| 917 | else |
| 918 | cmd->setColor((float)col->x, (float)col->y, (float)col->z); |
| 919 | |
| 920 | Tokenizer::TokenType ttype = tokenizer.nextToken(); |
| 921 | while (ttype != Tokenizer::TokenEnd) |
| 922 | { |
| 923 | if (ttype == Tokenizer::TokenName) |
| 924 | { |
| 925 | string name = tokenizer.getNameValue(); |
| 926 | if (compareIgnoringCase(name, "all") == 0 && act==1) |
| 927 | cmd->all=1; |
| 928 | else if (compareIgnoringCase(name, "all") == 0 && act==0) |
| 929 | cmd->none=1; |
| 930 | else |
| 931 | cmd->setConstellations(name); |
| 932 | |
| 933 | ttype = tokenizer.nextToken(); |
| 934 | if (ttype == Tokenizer::TokenBar) |
| 935 | ttype = tokenizer.nextToken(); |
| 936 | } |
| 937 | else |
| 938 | { |
| 939 | DPRINTF(0, "Command Parser: error parsing render flags\n"); |
| 940 | return 0; |
| 941 | } |
| 942 | } |
| 943 | |
| 944 | return flags; |
| 945 | } |
no test coverage detected