mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
svg::render now accepts a function to draw something else
This commit is contained in:
parent
6ebd8ab9da
commit
99cad10617
2
hyper.h
2
hyper.h
@ -1673,7 +1673,7 @@ namespace svg {
|
|||||||
void text(int x, int y, int size, const string& str, bool frame, int col, int align);
|
void text(int x, int y, int size, const string& str, bool frame, int col, int align);
|
||||||
extern bool in;
|
extern bool in;
|
||||||
extern const string *link;
|
extern const string *link;
|
||||||
void render(const char *fname = NULL);
|
void render(const char *fname = NULL, const function<void()>& what = drawfullmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
extern int sightrange_bonus, genrange_bonus, gamerange_bonus;
|
extern int sightrange_bonus, genrange_bonus, gamerange_bonus;
|
||||||
|
@ -174,9 +174,7 @@ namespace svg {
|
|||||||
fprintf(f, "\n");
|
fprintf(f, "\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void render(const char *fname) {
|
void render(const char *fname, const function<void()>& what) {
|
||||||
|
|
||||||
if(cheater) doOvergenerate();
|
|
||||||
|
|
||||||
dynamicval<videopar> v(vid, vid);
|
dynamicval<videopar> v(vid, vid);
|
||||||
dynamicval<bool> v2(in, true);
|
dynamicval<bool> v2(in, true);
|
||||||
@ -196,7 +194,7 @@ namespace svg {
|
|||||||
|
|
||||||
f = fopen(fname, "wt");
|
f = fopen(fname, "wt");
|
||||||
fprintf(f, "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"%s\" height=\"%s\">\n", coord(vid.xres), coord(vid.yres));
|
fprintf(f, "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"%s\" height=\"%s\">\n", coord(vid.xres), coord(vid.yres));
|
||||||
drawfullmap();
|
what();
|
||||||
fprintf(f, "</svg>\n");
|
fprintf(f, "</svg>\n");
|
||||||
fclose(f);
|
fclose(f);
|
||||||
addMessage(XLAT("Saved the SVG shot to %1 (sightrange %2)", fname, its(get_sightrange())));
|
addMessage(XLAT("Saved the SVG shot to %1 (sightrange %2)", fname, its(get_sightrange())));
|
||||||
|
Loading…
Reference in New Issue
Block a user