From 2a59ff7ab2777536b39109a3f8fdc0e0b351ebd7 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Thu, 8 Feb 2018 22:27:12 +0100 Subject: [PATCH] CAP_TOUR guards added, more exported in hyper.h, general cleanup --- barriers.cpp | 4 +-- cell.cpp | 6 ---- classes.cpp | 2 -- classes.h | 1 + config.cpp | 5 ++- control.cpp | 1 + hyper.cpp | 2 +- hyper.h | 86 ++++++++++++++++++++++++++++++++++++++++++++++++++++ polygons.cpp | 1 - quit.cpp | 6 +++- system.cpp | 24 ++------------- util.cpp | 16 ---------- 12 files changed, 101 insertions(+), 53 deletions(-) diff --git a/barriers.cpp b/barriers.cpp index f80e0e7e..5ef55e57 100644 --- a/barriers.cpp +++ b/barriers.cpp @@ -142,8 +142,6 @@ void setbarrier(cell *c) { c->wall = waBarrier; c->land = laBarrier; } -/*if(isHive(c->barleft) && isHive(c->barright)) - c->wall = waWaxWall, c->land = c->barleft; */ } void setland(cell *c, eLand l) { @@ -795,6 +793,6 @@ bool buildBarrierNowall(cell *c, eLand l2, bool force) { } } - return false; + return false; } diff --git a/cell.cpp b/cell.cpp index 28a754ee..22ead80a 100644 --- a/cell.cpp +++ b/cell.cpp @@ -192,10 +192,6 @@ heptagon *getDodecahedron(int i) { // --- euclidean geometry --- -cell*& euclideanAtCreate(int vec); - -static const int max_vec = (1<<14); - // NOTE: patterns assume that pair_to_vec(0,1) % 3 == 2! // Thus, pair_to_vec(0,1) must not be e.g. a power of four @@ -1062,8 +1058,6 @@ bool randpattern(cell *c, int rval) { return 0; } -extern int randompattern[landtypes]; - string describeRPM(eLand l) { int rval = randompattern[l]; switch(rval%5) { diff --git a/classes.cpp b/classes.cpp index 7780bc5b..0d2c85fc 100644 --- a/classes.cpp +++ b/classes.cpp @@ -1612,8 +1612,6 @@ const landtype linf[landtypes] = { }, }; -struct landtacinfo { eLand l; int tries, multiplier; }; - vector land_tac = { {laIce, 10, 1}, {laDesert, 10, 1}, {laHunting, 5, 2}, diff --git a/classes.h b/classes.h index 02cd14c3..6b95f9e4 100644 --- a/classes.h +++ b/classes.h @@ -231,3 +231,4 @@ enum cpatterntype { cpFootball, cpThree, cpChess, cpSingle, cpLarge, cpZebra, cpUnknown }; +struct landtacinfo { eLand l; int tries, multiplier; }; diff --git a/config.cpp b/config.cpp index 0b0f1d03..5644e87f 100644 --- a/config.cpp +++ b/config.cpp @@ -348,7 +348,10 @@ void initConfig() { } bool inSpecialMode() { - return chaosmode || nonbitrunc || peace::on || tour::on || + return chaosmode || nonbitrunc || peace::on || + #if CAP_TOUR + tour::on || + #endif yendor::on || tactic::on || randomPatternsMode || geometry != gNormal || pmodel != mdDisk || vid.alpha != 1 || vid.scale != 1 || rug::rugged || vid.monmode != DEFAULT_MONMODE || diff --git a/control.cpp b/control.cpp index 0564ea9d..5dd763f3 100644 --- a/control.cpp +++ b/control.cpp @@ -842,6 +842,7 @@ bool handleCompass() { if(!haveMobileCompass()) return false; using namespace shmupballs; + int dx = mousex - xmove; int dy = mousey - yb; int h = hypot(dx, dy); diff --git a/hyper.cpp b/hyper.cpp index 75ba1d41..87535a38 100644 --- a/hyper.cpp +++ b/hyper.cpp @@ -65,5 +65,5 @@ int main(int argc, char **argv) { profile_info(); return 0; } -#endif +#endif #endif diff --git a/hyper.h b/hyper.h index 0cc941da..5c845cdd 100644 --- a/hyper.h +++ b/hyper.h @@ -1162,6 +1162,7 @@ extern bool timerghost; #endif namespace dialog { + extern string highlight_text; enum tDialogItem {diTitle, diItem, diBreak, diHelp, diInfo, diSlider, diBigItem}; @@ -2184,6 +2185,11 @@ namespace princess { extern bool gotoPrincess; extern bool forceMouse; extern bool challenge; + extern bool squeaked; + extern bool saved; + extern bool nodungeon; + extern int reviveAt; + extern bool forceVizier; struct info { int id; // id of this info @@ -2564,3 +2570,83 @@ double randd(); transmatrix getOrientation(); #endif +bool showHalloween(); +extern bool havesave; +extern vector gamelog; +extern time_t savetime; +extern bool cblind; +extern void save_memory(); +namespace inv { void init(); } +extern bool survivalist; +extern bool hauntedWarning; +extern bool usedSafety; + +namespace elec { extern int lightningfast; } +extern int lastkills; +extern map rosemap; +extern int hardcoreAt; +extern flagtype havewhat, hadwhat; +extern int safetyseed; +extern int lastsafety; +extern int knighted; +extern int rosephase; +extern int rosewave; +extern eItem localTreasureType(); +extern void clearshadow(); +extern bool seenSevenMines; +extern vector dcal; // queue for cpdist +extern vector pathq; // queue for pathdist +extern vector > butterflies; +extern vector crush_now, crush_next; +extern void shrand(int seed); +extern eLand safetyland; +extern int sagephase; +extern int lastsize; +extern int noiseuntil; +inline hyperpoint xpush0(ld x); +extern eGeometry targetgeometry; +inline hyperpoint xspinpush0(ld alpha, ld x); + +#define DF_INIT 0 // always display these +#define DF_MSG 0 // always display these +#define DF_STEAM 1 +#define DF_GRAPH 2 +#define DF_TURN 4 +#define DF_FIELD 8 + +#if ISANDROID +#define DEBB(r,x) +#else +#define DEBB(r,x) { if(debugfile && (!(r) || (debugflags & (r)))) { fprintf x; fflush(debugfile); } } +#endif + +extern FILE *debugfile; +extern int debugflags; +int gmod(int i, int j); +extern walltype winf[walltypes]; +extern vector land_tac; +string llts(long long i); +void clearMemoRPM(); +extern int randompattern[landtypes]; +extern int pair_to_vec(int x, int y); +cell*& euclideanAtCreate(int vec); +bool isCyclic(eLand l); +bool generateAll(eLand l); +void extendcheck(cell *c); +void extendNowall(cell *c); +bool isbar4(cell *c); +void extendBarrierFront(cell *c); +void extendBarrierBack(cell *c); +void extendCR5(cell *c); + +bool mirrorwall(cell *c); +extern void setbarrier(cell *c); +extern function call_initgame; +extern void initializeCLI(); + +static const int max_vec = (1<<14); + +extern void popGame(); +string helptitle(string s, int col); +pair cell_to_pair(cell *c); +extern bool nohud, nofps; diff --git a/polygons.cpp b/polygons.cpp index e80f4dac..afc01be8 100644 --- a/polygons.cpp +++ b/polygons.cpp @@ -416,7 +416,6 @@ void gldraw(int useV, const transmatrix& V, int ps, int pq, int col, int outline glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisable(GL_TEXTURE_2D); } - } #endif diff --git a/quit.cpp b/quit.cpp index 2aaebc55..034adeb5 100644 --- a/quit.cpp +++ b/quit.cpp @@ -333,8 +333,12 @@ void showMission() { dialog::addInfo(XLAT("CONGRATULATIONS!"), iinf[itOrbYendor].color); } else { - if(tour::on) + if(0) ; +#if CAP_TOUR + else if(tour::on) + ; +#endif else if(princess::challenge) dialog::addInfo(XLAT("Follow the Mouse and escape with %the1!", moPrincess)); else if(gold() < R30) diff --git a/system.cpp b/system.cpp index f19cf390..bc7b55f0 100644 --- a/system.cpp +++ b/system.cpp @@ -35,14 +35,7 @@ void welcomeMessage() { items[itGreenStone] = 99; addMessage(XLAT("Welcome to %the1 Challenge!", moPrincess)); addMessage(XLAT("The more Hypersian Rugs you collect, the harder it is.", moPrincess)); - } - /* if(tactic::on && isCrossroads(firstland)) { - for(int i=0; i= 0) { -/* if(!timerghost) - addMessage(XLAT("Emergency truncate to ") + its(saveposition)); */ if(truncate(scorefile, saveposition)) {} saveposition = -1; } @@ -831,16 +822,6 @@ void saveStats(bool emergency = false) { if(multi::players > 1) fprintf(f, "Multi-player (%d players)\n", multi::players); fprintf(f, "Number of cells explored, by distance from the player:\n"); {for(int i=0; i<10; i++) fprintf(f, " %d", explore[i]);} fprintf(f, "\n"); -/*for(int j=0; j