mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-09-29 14:30:40 +00:00
rogueviz:: option -rvspaces
This commit is contained in:
parent
d7326e7f87
commit
279cd5a6ba
@ -120,7 +120,7 @@ void loadsamples(const string& fname) {
|
|||||||
int c = fgetc(f.f);
|
int c = fgetc(f.f);
|
||||||
if(c == -1 || c == 10 || c == 13) break;
|
if(c == -1 || c == 10 || c == 13) break;
|
||||||
if(c == '!' && s.name == "") shown = true;
|
if(c == '!' && s.name == "") shown = true;
|
||||||
else if(c != 32 && c != 9) s.name += c;
|
else if(!rv_ignore(c)) s.name += c;
|
||||||
}
|
}
|
||||||
data.push_back(move(s));
|
data.push_back(move(s));
|
||||||
if(shown)
|
if(shown)
|
||||||
@ -1146,6 +1146,7 @@ void kloadw(const string& fname) {
|
|||||||
goto nexti;
|
goto nexti;
|
||||||
}
|
}
|
||||||
else if(c == '=' || c == '/' || c == '*') kind = c;
|
else if(c == '=' || c == '/' || c == '*') kind = c;
|
||||||
|
else if(rv_ignore(c)) ;
|
||||||
else (kind?s2:s1) += c;
|
else (kind?s2:s1) += c;
|
||||||
}
|
}
|
||||||
nexti: ;
|
nexti: ;
|
||||||
|
@ -809,6 +809,14 @@ bool rogueviz_hud() {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool rv_ignore_spaces = true;
|
||||||
|
|
||||||
|
bool rv_ignore(char c) {
|
||||||
|
if(c == 32 && !rv_ignore_spaces) return true;
|
||||||
|
if(c == 10 || c == 13 || c == 32 || c == 9) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void readcolor(const string& cfname) {
|
void readcolor(const string& cfname) {
|
||||||
FILE *f = fopen(cfname.c_str(), "rt");
|
FILE *f = fopen(cfname.c_str(), "rt");
|
||||||
if(!f) { printf("color file missing\n"); exit(1); }
|
if(!f) { printf("color file missing\n"); exit(1); }
|
||||||
@ -817,8 +825,8 @@ void readcolor(const string& cfname) {
|
|||||||
while(true) {
|
while(true) {
|
||||||
int c = fgetc(f);
|
int c = fgetc(f);
|
||||||
if(c == EOF) { fclose(f); return; }
|
if(c == EOF) { fclose(f); return; }
|
||||||
else if(c == 10 || c == 13 || c == 32 || c == 9) ;
|
|
||||||
else if(c == ',' || c == ';') break;
|
else if(c == ',' || c == ';') break;
|
||||||
|
else if(rv_ignore(c)) ;
|
||||||
else lab += c;
|
else lab += c;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -836,7 +844,7 @@ void readcolor(const string& cfname) {
|
|||||||
string lab2 = "";
|
string lab2 = "";
|
||||||
while(true) {
|
while(true) {
|
||||||
int c = fgetc(f);
|
int c = fgetc(f);
|
||||||
if(c == 10 || c == 13 || c == 32 || c == 9 || c == ',' || c == ';' || c == EOF) break;
|
if(rv_ignore(ch) || c == ',' || c == ';' || c == EOF) break;
|
||||||
else lab2 += c;
|
else lab2 += c;
|
||||||
}
|
}
|
||||||
x = vdata[getid(lab2)].cp;
|
x = vdata[getid(lab2)].cp;
|
||||||
@ -979,6 +987,9 @@ int readArgs() {
|
|||||||
else if(argis("-lab-off")) {
|
else if(argis("-lab-off")) {
|
||||||
showlabels = false;
|
showlabels = false;
|
||||||
}
|
}
|
||||||
|
else if(argis("-rvspaces")) {
|
||||||
|
rv_ignore_spaces = false;
|
||||||
|
}
|
||||||
else if(argis("-rog3")) {
|
else if(argis("-rog3")) {
|
||||||
rog3 = true;
|
rog3 = true;
|
||||||
}
|
}
|
||||||
|
@ -267,8 +267,8 @@ namespace sag {
|
|||||||
while(true) {
|
while(true) {
|
||||||
int c = fgetc(sf);
|
int c = fgetc(sf);
|
||||||
if(c == EOF) goto afterload;
|
if(c == EOF) goto afterload;
|
||||||
else if(c == 10 || c == 13 || c == 32 || c == 9) ;
|
|
||||||
else if(c == ',' || c == ';') break;
|
else if(c == ',' || c == ';') break;
|
||||||
|
else if(rv_ignore(c)) ;
|
||||||
else lab += c;
|
else lab += c;
|
||||||
}
|
}
|
||||||
int sid = -1;
|
int sid = -1;
|
||||||
@ -412,14 +412,14 @@ namespace sag {
|
|||||||
int c = fgetc(f.f);
|
int c = fgetc(f.f);
|
||||||
if(c == EOF) goto finish;
|
if(c == EOF) goto finish;
|
||||||
else if(c == ';') break;
|
else if(c == ';') break;
|
||||||
else if(c == 10 || c == 13 || c == 9) ;
|
else if(rv_ignore(c)) ;
|
||||||
else l1 += c;
|
else l1 += c;
|
||||||
}
|
}
|
||||||
while(true) {
|
while(true) {
|
||||||
int c = fgetc(f.f);
|
int c = fgetc(f.f);
|
||||||
if(c == EOF) goto finish;
|
if(c == EOF) goto finish;
|
||||||
else if(c == ';') goto finish;
|
else if(c == ';') goto finish;
|
||||||
else if(c == 10 || c == 13 || c == 9) break;
|
else if(rv_ignore(c)) break;
|
||||||
else l2 += c;
|
else l2 += c;
|
||||||
}
|
}
|
||||||
printf("%s -> %s\n", l1.c_str(), l2.c_str());
|
printf("%s -> %s\n", l1.c_str(), l2.c_str());
|
||||||
@ -445,14 +445,14 @@ namespace sag {
|
|||||||
int c = fgetc(f.f);
|
int c = fgetc(f.f);
|
||||||
if(c == EOF) return;
|
if(c == EOF) return;
|
||||||
else if(c == ';') break;
|
else if(c == ';') break;
|
||||||
else if(c == 10 || c == 13 || c == 32 || c == 9) ;
|
else if(rv_ignore(c)) ;
|
||||||
else l1 += c;
|
else l1 += c;
|
||||||
}
|
}
|
||||||
while(true) {
|
while(true) {
|
||||||
int c = fgetc(f.f);
|
int c = fgetc(f.f);
|
||||||
if(c == EOF) return;
|
if(c == EOF) return;
|
||||||
else if(c == ';') break;
|
else if(c == ';') break;
|
||||||
else if(c == 10 || c == 13 || c == 32 || c == 9) ;
|
else if(rv_ignore(c)) ;
|
||||||
else l2 += c;
|
else l2 += c;
|
||||||
}
|
}
|
||||||
ld wei;
|
ld wei;
|
||||||
|
Loading…
Reference in New Issue
Block a user