added hooks_initgame, hooks_drawcell allows replacement

This commit is contained in:
Zeno Rogue 2018-05-26 01:11:19 +02:00
parent 5cd3ccabb8
commit aafe464bc6
3 changed files with 7 additions and 4 deletions

View File

@ -12,7 +12,7 @@ bool mmspatial, mmhigh, mmmon, mmitem;
int detaillevel = 0; int detaillevel = 0;
hookset<bool(int sym, int uni)> *hooks_handleKey; hookset<bool(int sym, int uni)> *hooks_handleKey;
hookset<void(cell *c, const transmatrix& V)> *hooks_drawcell; hookset<bool(cell *c, const transmatrix& V)> *hooks_drawcell;
purehookset hooks_frame; purehookset hooks_frame;
#define WOLNIEJ 1 #define WOLNIEJ 1
@ -3447,7 +3447,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
// if(behindsphere(V)) return; // if(behindsphere(V)) return;
callhooks(hooks_drawcell, c, V); if(callhandlers(0, hooks_drawcell, c, V)) return;
ld dist0 = hdist0(tC0(V)) - 1e-6; ld dist0 = hdist0(tC0(V)) - 1e-6;
if(dist0 < geom3::highdetail) detaillevel = 2; if(dist0 < geom3::highdetail) detaillevel = 2;

View File

@ -1938,7 +1938,7 @@ template<class T, class V, class... U> V callhandlers(V zero, hookset<T> *h, U&.
} }
extern hookset<bool(int sym, int uni)> *hooks_handleKey; extern hookset<bool(int sym, int uni)> *hooks_handleKey;
extern hookset<void(cell *c, const transmatrix& V)> *hooks_drawcell; extern hookset<bool(cell *c, const transmatrix& V)> *hooks_drawcell;
extern hookset<bool(int argc, char** argv)> *hooks_main; extern hookset<bool(int argc, char** argv)> *hooks_main;
extern hookset<int()> *hooks_args; extern hookset<int()> *hooks_args;
extern hookset<eLand(eLand)> *hooks_nextland; extern hookset<eLand(eLand)> *hooks_nextland;

View File

@ -85,10 +85,13 @@ void welcomeMessage() {
int trailer_cash0 = 5; int trailer_cash0 = 5;
int trailer_cash1 = 15; int trailer_cash1 = 15;
bool trailer_safety = true; bool trailer_safety = true;
hookset<void()> *hooks_initgame;
// initialize the game // initialize the game
void initgame() { void initgame() {
DEBB(DF_INIT, (debugfile,"initGame\n")); DEBB(DF_INIT, (debugfile,"initGame\n"));
callhooks(hooks_initgame);
yendor::init(1); yendor::init(1);