mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-03-20 18:37:02 +00:00
calls to rogueviz::mark and rogueviz::fixparam from HR main are now replaced by hooks
This commit is contained in:
parent
827ae794d6
commit
508c63d731
@ -1025,9 +1025,6 @@ void saveHighQualityShot(const char *fname, const char *caption, int fade) {
|
||||
|
||||
// if(vid.pmodel == 0) vid.scale = 0.99;
|
||||
calcparam();
|
||||
#if CAP_ROGUEVIZ
|
||||
rogueviz::fixparam();
|
||||
#endif
|
||||
|
||||
renderbuffer glbuf(vid.xres, vid.yres, vid.usingGL);
|
||||
glbuf.enable();
|
||||
|
6
game.cpp
6
game.cpp
@ -8044,10 +8044,10 @@ bool mightBeMine(cell *c) {
|
||||
return c->wall == waMineUnknown || c->wall == waMineMine;
|
||||
}
|
||||
|
||||
hookset<bool(cell*)> *hooks_mark;
|
||||
|
||||
void performMarkCommand(cell *c) {
|
||||
#if CAP_ROGUEVIZ
|
||||
rogueviz::mark(c);
|
||||
#endif
|
||||
if(callhandlers(false, hooks_mark, c)) return;
|
||||
if(c->land == laCA && c->wall == waNone)
|
||||
c->wall = waFloorA;
|
||||
else if(c->land == laCA && c->wall == waFloorA)
|
||||
|
@ -5321,6 +5321,8 @@ bool sidescreen;
|
||||
|
||||
bool dronemode;
|
||||
|
||||
purehookset hooks_calcparam;
|
||||
|
||||
void calcparam() {
|
||||
DEBB(DF_GRAPH, (debugfile,"calc param\n"));
|
||||
vid.xcenter = vid.xres / 2;
|
||||
@ -5361,6 +5363,8 @@ void calcparam() {
|
||||
else
|
||||
stereo::scrdist = vid.radius;
|
||||
stereo::scrdist_text = stereo::scrdist;
|
||||
|
||||
callhooks(hooks_calcparam);
|
||||
}
|
||||
|
||||
int ringcolor = darkena(0xFF, 0, 0xFF);
|
||||
@ -5616,9 +5620,6 @@ void drawscreen() {
|
||||
|
||||
calcparam();
|
||||
// rug::setVidParam();
|
||||
#if CAP_ROGUEVIZ
|
||||
rogueviz::fixparam();
|
||||
#endif
|
||||
|
||||
#if CAP_GL
|
||||
if(vid.usingGL) setGLProjection();
|
||||
|
3
hyper.h
3
hyper.h
@ -2013,7 +2013,7 @@ template<class T, class U> int addHook(hookset<T>*& m, int prio, const U& hook)
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern purehookset hooks_frame, hooks_stats, clearmemory, hooks_config, hooks_tests, hooks_removecells, hooks_initgame;
|
||||
extern purehookset hooks_frame, hooks_stats, clearmemory, hooks_config, hooks_tests, hooks_removecells, hooks_initgame, hooks_calcparam;
|
||||
|
||||
template<class T, class... U> void callhooks(hookset<T> *h, U... args) {
|
||||
if(h) for(auto& p: *h) p.second(args...);
|
||||
@ -2031,6 +2031,7 @@ extern hookset<bool(int sym, int uni)> *hooks_handleKey;
|
||||
extern hookset<bool(cell *c, const transmatrix& V)> *hooks_drawcell;
|
||||
extern hookset<bool(int argc, char** argv)> *hooks_main;
|
||||
extern hookset<int()> *hooks_args;
|
||||
extern hookset<bool(cell*)> *hooks_mark;
|
||||
extern hookset<eLand(eLand)> *hooks_nextland;
|
||||
|
||||
// hooks to extend HyperRogue with an external program
|
||||
|
@ -2567,9 +2567,6 @@ namespace svg {
|
||||
vid.usingGL = false;
|
||||
vid.xres = vid.yres = svgsize ? svgsize : min(1 << (get_sightrange()+7), 16384);
|
||||
calcparam();
|
||||
#if CAP_ROGUEVIZ
|
||||
rogueviz::fixparam();
|
||||
#endif
|
||||
dynamicval<bool> v6(inHighQual, true);
|
||||
darken = 0;
|
||||
|
||||
|
@ -2045,7 +2045,8 @@ auto hooks =
|
||||
addHook(hooks_config, 0, [] () { tour::ss::list(rogueviz::rvtour::rvslides); }) +
|
||||
#endif
|
||||
addHook(clearmemory, 0, close) +
|
||||
addHook(hooks_prestats, 100, rogueviz_hud);
|
||||
addHook(hooks_prestats, 100, rogueviz_hud) +
|
||||
addHook(hooks_calcparam, 100, fixparam);
|
||||
|
||||
};
|
||||
|
||||
|
@ -11,10 +11,7 @@ namespace rogueviz {
|
||||
bool virt(shmup::monster *m);
|
||||
void turn(int delta);
|
||||
void drawExtra();
|
||||
void fixparam();
|
||||
int readArgs();
|
||||
void close();
|
||||
void mark(cell *c);
|
||||
void showMenu();
|
||||
string makehelp();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user