mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-02-22 22:10:20 +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);
|
||||
if(c == -1 || c == 10 || c == 13) break;
|
||||
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));
|
||||
if(shown)
|
||||
@ -1146,6 +1146,7 @@ void kloadw(const string& fname) {
|
||||
goto nexti;
|
||||
}
|
||||
else if(c == '=' || c == '/' || c == '*') kind = c;
|
||||
else if(rv_ignore(c)) ;
|
||||
else (kind?s2:s1) += c;
|
||||
}
|
||||
nexti: ;
|
||||
|
@ -809,6 +809,14 @@ bool rogueviz_hud() {
|
||||
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) {
|
||||
FILE *f = fopen(cfname.c_str(), "rt");
|
||||
if(!f) { printf("color file missing\n"); exit(1); }
|
||||
@ -817,8 +825,8 @@ void readcolor(const string& cfname) {
|
||||
while(true) {
|
||||
int c = fgetc(f);
|
||||
if(c == EOF) { fclose(f); return; }
|
||||
else if(c == 10 || c == 13 || c == 32 || c == 9) ;
|
||||
else if(c == ',' || c == ';') break;
|
||||
else if(rv_ignore(c)) ;
|
||||
else lab += c;
|
||||
}
|
||||
|
||||
@ -836,7 +844,7 @@ void readcolor(const string& cfname) {
|
||||
string lab2 = "";
|
||||
while(true) {
|
||||
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;
|
||||
}
|
||||
x = vdata[getid(lab2)].cp;
|
||||
@ -979,6 +987,9 @@ int readArgs() {
|
||||
else if(argis("-lab-off")) {
|
||||
showlabels = false;
|
||||
}
|
||||
else if(argis("-rvspaces")) {
|
||||
rv_ignore_spaces = false;
|
||||
}
|
||||
else if(argis("-rog3")) {
|
||||
rog3 = true;
|
||||
}
|
||||
|
@ -267,8 +267,8 @@ namespace sag {
|
||||
while(true) {
|
||||
int c = fgetc(sf);
|
||||
if(c == EOF) goto afterload;
|
||||
else if(c == 10 || c == 13 || c == 32 || c == 9) ;
|
||||
else if(c == ',' || c == ';') break;
|
||||
else if(rv_ignore(c)) ;
|
||||
else lab += c;
|
||||
}
|
||||
int sid = -1;
|
||||
@ -412,14 +412,14 @@ namespace sag {
|
||||
int c = fgetc(f.f);
|
||||
if(c == EOF) goto finish;
|
||||
else if(c == ';') break;
|
||||
else if(c == 10 || c == 13 || c == 9) ;
|
||||
else if(rv_ignore(c)) ;
|
||||
else l1 += c;
|
||||
}
|
||||
while(true) {
|
||||
int c = fgetc(f.f);
|
||||
if(c == EOF) 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;
|
||||
}
|
||||
printf("%s -> %s\n", l1.c_str(), l2.c_str());
|
||||
@ -445,14 +445,14 @@ namespace sag {
|
||||
int c = fgetc(f.f);
|
||||
if(c == EOF) return;
|
||||
else if(c == ';') break;
|
||||
else if(c == 10 || c == 13 || c == 32 || c == 9) ;
|
||||
else if(rv_ignore(c)) ;
|
||||
else l1 += c;
|
||||
}
|
||||
while(true) {
|
||||
int c = fgetc(f.f);
|
||||
if(c == EOF) return;
|
||||
else if(c == ';') break;
|
||||
else if(c == 10 || c == 13 || c == 32 || c == 9) ;
|
||||
else if(rv_ignore(c)) ;
|
||||
else l2 += c;
|
||||
}
|
||||
ld wei;
|
||||
|
Loading…
x
Reference in New Issue
Block a user