From aafe464bc697cd42abea2019acd153392b07c4e6 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 26 May 2018 01:11:19 +0200 Subject: [PATCH] added hooks_initgame, hooks_drawcell allows replacement --- graph.cpp | 4 ++-- hyper.h | 2 +- system.cpp | 5 ++++- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/graph.cpp b/graph.cpp index add09c1c..9f70cae3 100644 --- a/graph.cpp +++ b/graph.cpp @@ -12,7 +12,7 @@ bool mmspatial, mmhigh, mmmon, mmitem; int detaillevel = 0; hookset *hooks_handleKey; -hookset *hooks_drawcell; +hookset *hooks_drawcell; purehookset hooks_frame; #define WOLNIEJ 1 @@ -3447,7 +3447,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) { // if(behindsphere(V)) return; - callhooks(hooks_drawcell, c, V); + if(callhandlers(0, hooks_drawcell, c, V)) return; ld dist0 = hdist0(tC0(V)) - 1e-6; if(dist0 < geom3::highdetail) detaillevel = 2; diff --git a/hyper.h b/hyper.h index 637953e9..5c06ac22 100644 --- a/hyper.h +++ b/hyper.h @@ -1938,7 +1938,7 @@ template V callhandlers(V zero, hookset *h, U&. } extern hookset *hooks_handleKey; -extern hookset *hooks_drawcell; +extern hookset *hooks_drawcell; extern hookset *hooks_main; extern hookset *hooks_args; extern hookset *hooks_nextland; diff --git a/system.cpp b/system.cpp index 14b084a5..4bf7f50d 100644 --- a/system.cpp +++ b/system.cpp @@ -85,10 +85,13 @@ void welcomeMessage() { int trailer_cash0 = 5; int trailer_cash1 = 15; bool trailer_safety = true; - + +hookset *hooks_initgame; + // initialize the game void initgame() { DEBB(DF_INIT, (debugfile,"initGame\n")); + callhooks(hooks_initgame); yendor::init(1);