mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-03-13 23:18:16 +00:00
Merge pull request #92 from Quuxplusone/pedantic
Add `-pedantic` to the Makefile, and fix all resulting warnings
This commit is contained in:
commit
b5a70c1bc6
@ -137,7 +137,7 @@ script:
|
||||
# Build hyperrogue.
|
||||
if [[ "$TRAVIS_BUILD_SYSTEM" == "autotools" ]]; then
|
||||
autoreconf -vi
|
||||
./configure CXXFLAGS="-Wall -Werror -Wno-unknown-warning-option -Wno-maybe-uninitialized"
|
||||
./configure CXXFLAGS="-W -Wall -Wextra -Werror -Wno-unused-parameter -Wno-maybe-uninitialized -Wno-unknown-warning-option"
|
||||
make
|
||||
elif [[ "$TRAVIS_BUILD_SYSTEM" == "Makefile" ]]; then
|
||||
make -f Makefile.simple CXX="${HYPERROGUE_CXX-g++}"
|
||||
|
@ -82,19 +82,19 @@ endif
|
||||
ifeq (${TOOLCHAIN},clang)
|
||||
CXXFLAGS_EARLY += -std=c++11 -march=native
|
||||
CXXFLAGS_EARLY += -W -Wall -Wextra -Werror -pedantic
|
||||
CXXFLAGS_EARLY += -Wno-unknown-warning-option -Wno-format-pedantic -Wno-missing-field-initializers -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized
|
||||
CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized -Wno-unknown-warning-option
|
||||
endif
|
||||
|
||||
ifeq (${TOOLCHAIN},gcc)
|
||||
CXXFLAGS_EARLY += -std=c++11 -march=native
|
||||
CXXFLAGS_EARLY += -W -Wall -Wextra -Werror
|
||||
CXXFLAGS_EARLY += -Wno-unknown-warning-option -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized
|
||||
CXXFLAGS_EARLY += -W -Wall -Wextra -Werror -pedantic
|
||||
CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized
|
||||
endif
|
||||
|
||||
ifeq (${TOOLCHAIN},mingw)
|
||||
CXXFLAGS_EARLY += -std=c++11 -march=native
|
||||
CXXFLAGS_EARLY += -W -Wall -Wextra -Werror
|
||||
CXXFLAGS_EARLY += -Wno-unknown-warning-option -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized
|
||||
CXXFLAGS_EARLY += -Wno-unused-parameter -Wno-implicit-fallthrough -Wno-maybe-uninitialized
|
||||
endif
|
||||
|
||||
|
||||
|
@ -964,7 +964,7 @@ EX void achievement_display() {
|
||||
|
||||
EX bool isAscending(int i) {
|
||||
return i == 13 || i == 14 || i == 15 || i == 16 || i == 29 || i == 30 || i == 45;
|
||||
};
|
||||
}
|
||||
|
||||
EX int score_default(int i) {
|
||||
if(isAscending(i)) return 1999999999;
|
||||
|
@ -557,7 +557,7 @@ struct hrmap_archimedean : hrmap {
|
||||
|
||||
heptagon *create_step(heptagon *h, int d) override {
|
||||
|
||||
DEBB(DF_GEOM, (format("%p.%d ~ ?\n", h, d)));
|
||||
DEBB(DF_GEOM, (format("%p.%d ~ ?\n", hr::voidp(h), d)));
|
||||
|
||||
heptspin hi(h, d);
|
||||
|
||||
@ -707,7 +707,7 @@ EX hrmap *new_map() { return new hrmap_archimedean; }
|
||||
heptagon *build_child(heptspin p, pair<int, int> adj) {
|
||||
indenter ind;
|
||||
auto h = buildHeptagon1(tailored_alloc<heptagon> (isize(current.adjacent[adj.first])), p.at, p.spin, hstate(1), 0);
|
||||
DEBB(DF_GEOM, (format("NEW %p.%d ~ %p.0\n", p.at, p.spin, h)));
|
||||
DEBB(DF_GEOM, (format("NEW %p.%d ~ %p.0\n", hr::voidp(p.at), p.spin, hr::voidp(h))));
|
||||
id_of(h) = adj.first;
|
||||
parent_index_of(h) = adj.second;
|
||||
int nei = neighbors_of(h);
|
||||
@ -751,13 +751,13 @@ void connect_digons_too(heptspin h1, heptspin h2) {
|
||||
// no need to specify archimedean_gmatrix and altmap
|
||||
hnew->c.connect(1, h2);
|
||||
h1--, h2++;
|
||||
DEBB(DF_GEOM, (format("OL2 %p.%d ~ %p.%d\n", h1.at, h1.spin, h2.at, h2.spin)));
|
||||
DEBB(DF_GEOM, (format("OL2 %p.%d ~ %p.%d\n", hr::voidp(h1.at), h1.spin, hr::voidp(h2.at), h2.spin)));
|
||||
h1.at->c.connect(h1.spin, h2);
|
||||
}
|
||||
}
|
||||
|
||||
void connectHeptagons(heptspin hi, heptspin hs) {
|
||||
DEBB(DF_GEOM, (format("OLD %p.%d ~ %p.%d\n", hi.at, hi.spin, hs.at, hs.spin)));
|
||||
DEBB(DF_GEOM, (format("OLD %p.%d ~ %p.%d\n", hr::voidp(hi.at), hi.spin, hr::voidp(hs.at), hs.spin)));
|
||||
if(hi.at->move(hi.spin) == hs.at && hi.at->c.spin(hi.spin) == hs.spin) {
|
||||
DEBB(DF_GEOM, (format("WARNING: already connected\n")));
|
||||
return;
|
||||
@ -1144,7 +1144,7 @@ function<void()> setcanvas(char c) {
|
||||
patterns::whichCanvas = c;
|
||||
start_game();
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
EX void show() {
|
||||
if(lastsample < isize(samples)) {
|
||||
|
18
barriers.cpp
18
barriers.cpp
@ -43,7 +43,7 @@ EX void preventbarriers(cell *c) {
|
||||
}
|
||||
|
||||
EX bool checkBarriersBack(cellwalker bb, int q IS(5), bool cross IS(false)) {
|
||||
// printf("back, %p, s%d\n", bb.at, bb.spin);
|
||||
// printf("back, %p, s%d\n", hr::voidp(bb.at), bb.spin);
|
||||
|
||||
// if(mark) { printf("mpdist = %d [%d] bardir = %d spin=%d q=%d cross=%d\n", bb.at->mpdist, BARLEV, bb.at->bardir, bb.spin, q, cross); }
|
||||
|
||||
@ -172,7 +172,7 @@ EX bool mirrorwall(cell *c) {
|
||||
}
|
||||
|
||||
EX void extendBarrierFront(cell *c) {
|
||||
limitgen("extend front %p\n", c);
|
||||
limitgen("extend front %p\n", hr::voidp(c));
|
||||
if(buggyGeneration) return;
|
||||
int ht = c->landparam;
|
||||
extendcheck(c);
|
||||
@ -222,7 +222,7 @@ EX void extendBarrierFront(cell *c) {
|
||||
}
|
||||
|
||||
EX void extendBarrierBack(cell *c) {
|
||||
limitgen("extend back %p\n", c);
|
||||
limitgen("extend back %p\n", hr::voidp(c));
|
||||
if(buggyGeneration) return;
|
||||
int ht = c->landparam;
|
||||
extendcheck(c);
|
||||
@ -343,14 +343,14 @@ EX bool isbar4(cell *c) {
|
||||
}
|
||||
|
||||
EX void extendBarrier(cell *c) {
|
||||
limitgen("extend barrier %p\n", c);
|
||||
limitgen("extend barrier %p\n", hr::voidp(c));
|
||||
if(buggyGeneration) return;
|
||||
|
||||
if(c->barleft == NOWALLSEP_USED) return;
|
||||
|
||||
extendcheck(c);
|
||||
|
||||
// printf("build barrier at %p", c);
|
||||
// printf("build barrier at %p", hr::voidp(c));
|
||||
if(c->land == laBarrier || c->land == laElementalWall || c->land == laHauntedWall || c->land == laOceanWall ||
|
||||
c->land == laMirrorWall || c->land == laMirrorWall2 || c->land == laMercuryRiver) {
|
||||
// printf("-> ready\n");
|
||||
@ -456,7 +456,7 @@ EX void buildBarrier(cell *c, int d, eLand l IS(laNone)) {
|
||||
}
|
||||
|
||||
EX bool buildBarrier6(cellwalker cw, int type) {
|
||||
limitgen("build6 %p/%d (%d)\n", cw.at, cw.spin, type);
|
||||
limitgen("build6 %p/%d (%d)\n", hr::voidp(cw.at), cw.spin, type);
|
||||
|
||||
cellwalker b[4];
|
||||
|
||||
@ -481,7 +481,7 @@ EX bool buildBarrier6(cellwalker cw, int type) {
|
||||
|
||||
if(false) {
|
||||
for(int z=0; z<4; z++) {
|
||||
printf("%p/%d\n", b[z].at, b[z].spin);
|
||||
printf("%p/%d\n", hr::voidp(b[z].at), b[z].spin);
|
||||
b[z].at->wall = waStrandedBoat; b[z].at->land = laAlchemist;
|
||||
b[z].at->mondir = b[z].spin;
|
||||
b[z].at->mpdist = 7;
|
||||
@ -567,7 +567,7 @@ EX bool buildBarrier6(cellwalker cw, int type) {
|
||||
}
|
||||
|
||||
EX bool buildBarrier4(cell *c, int d, int mode, eLand ll, eLand lr) {
|
||||
limitgen("build4 %p\n", c);
|
||||
limitgen("build4 %p\n", hr::voidp(c));
|
||||
if(buggyGeneration) return true;
|
||||
d %= 7;
|
||||
|
||||
@ -833,7 +833,7 @@ EX bool buildBarrierNowall(cell *c, eLand l2, int forced_dir IS(NODIR)) {
|
||||
#endif
|
||||
|
||||
if(c->land == laNone) {
|
||||
printf("barrier nowall! [%p]\n", c);
|
||||
printf("barrier nowall! [%p]\n", hr::voidp(c));
|
||||
raiseBuggyGeneration(c, "barrier nowall!");
|
||||
return false;
|
||||
}
|
||||
|
20
bigstuff.cpp
20
bigstuff.cpp
@ -168,10 +168,10 @@ void hrmap::generateAlts(heptagon *h, int levs, bool link_cdata) {
|
||||
}
|
||||
if(relspin == -4 && geometry != gFieldQuotient) {
|
||||
if(h->alt != h->alt->alt) {
|
||||
printf("relspin {%p:%p}\n", h->alt, h->alt->alt);
|
||||
{for(int i=0; i<S7; i++) printf("%p ", h->alt->move(i));} printf(" ALT\n");
|
||||
{for(int i=0; i<S7; i++) printf("%p ", h->move(i));} printf(" REAL\n");
|
||||
{for(int i=0; i<S7; i++) printf("%p ", h->move(i)->alt);} printf(" REAL ALT\n");
|
||||
printf("relspin {%p:%p}\n", hr::voidp(h->alt), hr::voidp(h->alt->alt));
|
||||
{for(int i=0; i<S7; i++) printf("%p ", hr::voidp(h->alt->move(i)));} printf(" ALT\n");
|
||||
{for(int i=0; i<S7; i++) printf("%p ", hr::voidp(h->move(i)));} printf(" REAL\n");
|
||||
{for(int i=0; i<S7; i++) printf("%p ", hr::voidp(h->move(i)->alt));} printf(" REAL ALT\n");
|
||||
}
|
||||
relspin = 3;
|
||||
} }
|
||||
@ -183,8 +183,8 @@ void hrmap::generateAlts(heptagon *h, int levs, bool link_cdata) {
|
||||
heptagon *hm = h->alt->move(ir);
|
||||
heptagon *ho = createStep(h, i);
|
||||
// printf("[%p:%d ~ %p:%d] %p ~ %p\n",
|
||||
// h, i, h->alt, ir,
|
||||
// ho, hm);
|
||||
// hr::voidp(h), i, hr::voidp(h->alt), ir,
|
||||
// hr::voidp(ho), hr::voidp(hm));
|
||||
if(ho->alt && ho->alt != hm) {
|
||||
if(ho->alt->alt == hm->alt && !quotient) {
|
||||
printf("ERROR: alt cross! [%d -> %d]\n", ho->alt->distance, hm->distance);
|
||||
@ -287,7 +287,7 @@ EX heptagon *createAlternateMap(cell *c, int rad, hstate firststate, int special
|
||||
|
||||
heptagon *alt = tailored_alloc<heptagon> (h->type);
|
||||
allmaps.push_back(newAltMap(alt));
|
||||
//printf("new alt {%p}\n", alt);
|
||||
//printf("new alt {%p}\n", hr::voidp(alt));
|
||||
alt->s = firststate;
|
||||
alt->emeraldval = 0;
|
||||
alt->zebraval = 0;
|
||||
@ -328,7 +328,7 @@ EX heptagon *createAlternateMap(cell *c, int rad, hstate firststate, int special
|
||||
}
|
||||
|
||||
return alt;
|
||||
//for(int d=rad; d>=0; d--) printf("%3d. %p {%d}\n", d, cx[d]->master, cx[d]->master->alt->distance);
|
||||
//for(int d=rad; d>=0; d--) printf("%3d. %p {%d}\n", d, hr::voidp(cx[d]->master), cx[d]->master->alt->distance);
|
||||
}
|
||||
|
||||
EX void beCIsland(cell *c) {
|
||||
@ -393,7 +393,7 @@ EX void generateTreasureIsland(cell *c) {
|
||||
if(cc->wall != waCTree)
|
||||
end = false;
|
||||
}
|
||||
// printf("%p: end=%d, qc=%d, dist=%d\n", c, end, qc, celldistAlt(c));
|
||||
// printf("%p: end=%d, qc=%d, dist=%d\n", hr::voidp(c), end, qc, celldistAlt(c));
|
||||
if(end) c->item = itPirate;
|
||||
else c->item = itCompass;
|
||||
}
|
||||
@ -567,7 +567,7 @@ EX void buildEquidistant(cell *c) {
|
||||
eLand b = c->land;
|
||||
if(chaosmode && !inmirror(b)) return;
|
||||
if(!b) {
|
||||
printf("land missing at %p\n", c);
|
||||
printf("land missing at %p\n", hr::voidp(c));
|
||||
describeCell(c);
|
||||
for(int i=0; i<c->type; i++) if(c->move(i))
|
||||
describeCell(c->move(i));
|
||||
|
14
cell.cpp
14
cell.cpp
@ -87,7 +87,7 @@ struct hrmap_hyperbolic : hrmap_standard {
|
||||
heptagon *getOrigin() override { return origin; }
|
||||
~hrmap_hyperbolic() {
|
||||
// verifycells(origin);
|
||||
// printf("Deleting hyperbolic map: %p\n", this);
|
||||
// printf("Deleting hyperbolic map: %p\n", hr::voidp(this));
|
||||
clearfrom(origin);
|
||||
}
|
||||
void verify() override { verifycells(origin); }
|
||||
@ -205,7 +205,7 @@ EX cell *createMov(cell *c, int d) {
|
||||
else if(GOLDBERG) {
|
||||
gp::extend_map(c, d);
|
||||
if(!c->move(d)) {
|
||||
printf("extend failed to create for %p/%d\n", c, d);
|
||||
printf("extend failed to create for %p/%d\n", hr::voidp(c), d);
|
||||
exit(1);
|
||||
}
|
||||
hybrid::link();
|
||||
@ -316,9 +316,9 @@ EX void initcells() {
|
||||
|
||||
EX void clearcell(cell *c) {
|
||||
if(!c) return;
|
||||
DEBB(DF_MEMORY, (format("c%d %p\n", c->type, c)));
|
||||
DEBB(DF_MEMORY, (format("c%d %p\n", c->type, hr::voidp(c))));
|
||||
for(int t=0; t<c->type; t++) if(c->move(t)) {
|
||||
DEBB(DF_MEMORY, (format("mov %p [%p] S%d\n", c->move(t), c->move(t)->move(c->c.spin(t)), c->c.spin(t))));
|
||||
DEBB(DF_MEMORY, (format("mov %p [%p] S%d\n", hr::voidp(c->move(t)), hr::voidp(c->move(t)->move(c->c.spin(t))), c->c.spin(t))));
|
||||
if(c->move(t)->move(c->c.spin(t)) != NULL &&
|
||||
c->move(t)->move(c->c.spin(t)) != c) {
|
||||
DEBB(DF_MEMORY | DF_ERROR, (format("cell error: type = %d %d -> %d\n", c->type, t, c->c.spin(t))));
|
||||
@ -326,7 +326,7 @@ EX void clearcell(cell *c) {
|
||||
}
|
||||
c->move(t)->move(c->c.spin(t)) = NULL;
|
||||
}
|
||||
DEBB(DF_MEMORY, (format("DEL %p\n", c)));
|
||||
DEBB(DF_MEMORY, (format("DEL %p\n", hr::voidp(c))));
|
||||
tailored_delete(c);
|
||||
}
|
||||
|
||||
@ -418,7 +418,7 @@ EX void verifycell(cell *c) {
|
||||
if(c2) {
|
||||
if(BITRUNCATED && c == c->master->c7) verifycell(c2);
|
||||
if(c2->move(c->c.spin(i)) && c2->move(c->c.spin(i)) != c) {
|
||||
printf("cell error %p:%d [%d] %p:%d [%d]\n", c, i, c->type, c2, c->c.spin(i), c2->type);
|
||||
printf("cell error %p:%d [%d] %p:%d [%d]\n", hr::voidp(c), i, c->type, hr::voidp(c2), c->c.spin(i), c2->type);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
@ -428,7 +428,7 @@ EX void verifycell(cell *c) {
|
||||
EX void verifycells(heptagon *at) {
|
||||
if(GOLDBERG || IRREGULAR || arcm::in()) return;
|
||||
for(int i=0; i<at->type; i++) if(at->move(i) && at->move(i)->move(at->c.spin(i)) && at->move(i)->move(at->c.spin(i)) != at) {
|
||||
printf("hexmix error %p [%d s=%d] %p %p\n", at, i, at->c.spin(i), at->move(i), at->move(i)->move(at->c.spin(i)));
|
||||
printf("hexmix error %p [%d s=%d] %p %p\n", hr::voidp(at), i, at->c.spin(i), hr::voidp(at->move(i)), hr::voidp(at->move(i)->move(at->c.spin(i))));
|
||||
}
|
||||
if(!sphere && !quotient)
|
||||
for(int i=0; i<S7; i++) if(at->move(i) && at->c.spin(i) == 0 && at->s != hsOrigin)
|
||||
|
66
classes.cpp
66
classes.cpp
@ -931,7 +931,7 @@ namespace mf {
|
||||
|
||||
static const flagtype band = (cylindrical | pseudocylindrical | uses_bandshift);
|
||||
static const flagtype pseudoband = (pseudocylindrical | uses_bandshift);
|
||||
};
|
||||
}
|
||||
|
||||
struct modelinfo {
|
||||
const char *name_hyperbolic;
|
||||
@ -971,43 +971,45 @@ enum eModel : int {
|
||||
// (other bits are used for other information)
|
||||
|
||||
#define X3(x) x, x, x
|
||||
#define DEFAULTS 0, 0, 0, 0, 0, nullptr
|
||||
|
||||
/** list of available models (i.e., projections) */
|
||||
EX vector<modelinfo> mdinf = {
|
||||
{"disk/Gans", "general perspective", "general perspective", mf::azimuthal | mf::conformal},
|
||||
{"half-plane", "inversion", "half-plane", mf::conformal},
|
||||
{"band", "band", "Mercator", mf::band | mf::conformal},
|
||||
{X3("polygonal"), mf::conformal},
|
||||
{X3("formula"), 0},
|
||||
{X3("azimuthal equidistant"), mf::azimuthal | mf::equidistant | mf::euc_boring},
|
||||
{X3("azimuthal equi-area"), mf::azimuthal | mf::equiarea | mf::euc_boring},
|
||||
{X3("ball model"), mf::conformal | mf::azimuthal | mf::space},
|
||||
{"Minkowski hyperboloid", "plane", "sphere", mf::conformal | mf::space | mf::euc_boring},
|
||||
{"hemisphere", "sphere", "sphere", mf::conformal | mf::space},
|
||||
{X3("band equidistant"), mf::band | mf::equidistant | mf::euc_boring},
|
||||
{X3("band equi-area"), mf::band | mf::equiarea | mf::euc_boring},
|
||||
{X3("sinusoidal"), mf::pseudoband | mf::equiarea | mf::euc_boring},
|
||||
{X3("two-point equidistant"), mf::equidistant | mf::euc_boring | mf::twopoint},
|
||||
{X3("fisheye"), 0},
|
||||
{X3("Joukowsky transform"), mf::hyper_only | mf::conformal},
|
||||
{X3("Joukowsky+inversion"), mf::hyper_only | mf::conformal},
|
||||
{X3("rotated hyperboles"), mf::hyper_only},
|
||||
{X3("spiral/ring"), mf::hyper_or_torus | mf::uses_bandshift},
|
||||
{X3("native perspective"), 0},
|
||||
{X3("azimuthal equi-volume"), mf::azimuthal | mf::equivolume | mf::euc_boring},
|
||||
{X3("central inversion"), mf::azimuthal | mf::conformal},
|
||||
{X3("two-point azimuthal"), mf::euc_boring | mf::twopoint},
|
||||
{X3("two-point hybrid"), mf::euc_boring | mf::twopoint},
|
||||
{X3("geodesic"), 0},
|
||||
{X3("Mollweide"), mf::euc_boring | mf::pseudoband | mf::equiarea },
|
||||
{X3("central cylindrical"), mf::euc_boring | mf::band },
|
||||
{X3("Collignon"), mf::pseudoband | mf::equiarea },
|
||||
{X3("horocyclic coordinates"), mf::euc_boring },
|
||||
{X3("guard"), 0},
|
||||
{X3("polynomial"), mf::conformal}
|
||||
{"disk/Gans", "general perspective", "general perspective", mf::azimuthal | mf::conformal, DEFAULTS},
|
||||
{"half-plane", "inversion", "half-plane", mf::conformal, DEFAULTS},
|
||||
{"band", "band", "Mercator", mf::band | mf::conformal, DEFAULTS},
|
||||
{X3("polygonal"), mf::conformal, DEFAULTS},
|
||||
{X3("formula"), 0, DEFAULTS},
|
||||
{X3("azimuthal equidistant"), mf::azimuthal | mf::equidistant | mf::euc_boring, DEFAULTS},
|
||||
{X3("azimuthal equi-area"), mf::azimuthal | mf::equiarea | mf::euc_boring, DEFAULTS},
|
||||
{X3("ball model"), mf::conformal | mf::azimuthal | mf::space, DEFAULTS},
|
||||
{"Minkowski hyperboloid", "plane", "sphere", mf::conformal | mf::space | mf::euc_boring, DEFAULTS},
|
||||
{"hemisphere", "sphere", "sphere", mf::conformal | mf::space, DEFAULTS},
|
||||
{X3("band equidistant"), mf::band | mf::equidistant | mf::euc_boring, DEFAULTS},
|
||||
{X3("band equi-area"), mf::band | mf::equiarea | mf::euc_boring, DEFAULTS},
|
||||
{X3("sinusoidal"), mf::pseudoband | mf::equiarea | mf::euc_boring, DEFAULTS},
|
||||
{X3("two-point equidistant"), mf::equidistant | mf::euc_boring | mf::twopoint, DEFAULTS},
|
||||
{X3("fisheye"), 0, DEFAULTS},
|
||||
{X3("Joukowsky transform"), mf::hyper_only | mf::conformal, DEFAULTS},
|
||||
{X3("Joukowsky+inversion"), mf::hyper_only | mf::conformal, DEFAULTS},
|
||||
{X3("rotated hyperboles"), mf::hyper_only, DEFAULTS},
|
||||
{X3("spiral/ring"), mf::hyper_or_torus | mf::uses_bandshift, DEFAULTS},
|
||||
{X3("native perspective"), 0, DEFAULTS},
|
||||
{X3("azimuthal equi-volume"), mf::azimuthal | mf::equivolume | mf::euc_boring, DEFAULTS},
|
||||
{X3("central inversion"), mf::azimuthal | mf::conformal, DEFAULTS},
|
||||
{X3("two-point azimuthal"), mf::euc_boring | mf::twopoint, DEFAULTS},
|
||||
{X3("two-point hybrid"), mf::euc_boring | mf::twopoint, DEFAULTS},
|
||||
{X3("geodesic"), 0, DEFAULTS},
|
||||
{X3("Mollweide"), mf::euc_boring | mf::pseudoband | mf::equiarea, DEFAULTS},
|
||||
{X3("central cylindrical"), mf::euc_boring | mf::band, DEFAULTS},
|
||||
{X3("Collignon"), mf::pseudoband | mf::equiarea, DEFAULTS},
|
||||
{X3("horocyclic coordinates"), mf::euc_boring, DEFAULTS},
|
||||
{X3("guard"), 0, DEFAULTS},
|
||||
{X3("polynomial"), mf::conformal, DEFAULTS},
|
||||
};
|
||||
|
||||
#undef X3
|
||||
#undef DEFAULTS
|
||||
|
||||
#if HDR
|
||||
static inline bool orbProtection(eItem it) { return false; } // not implemented
|
||||
|
@ -2629,7 +2629,7 @@ EX namespace dragon {
|
||||
}
|
||||
if(cmode & sm::MAP) return c;
|
||||
if(!history::includeHistory) {
|
||||
printf("dragon bug #3 (%p -> %p)\n", cor, c);
|
||||
printf("dragon bug #3 (%p -> %p)\n", hr::voidp(cor), hr::voidp(c));
|
||||
dragbugs = true;
|
||||
}
|
||||
c->monst = moDragonHead; return c;
|
||||
@ -3119,7 +3119,7 @@ EX namespace prairie {
|
||||
forCellEx(c2, c) forCellEx(c3, c2)
|
||||
if(barrierhept(c3)) barclose++;
|
||||
|
||||
printf("c = %p bc = %d\n", c, barclose);
|
||||
printf("c = %p bc = %d\n", hr::voidp(c), barclose);
|
||||
|
||||
raiseBuggyGeneration(c, "could not set river fval");
|
||||
}
|
||||
|
10
debug.cpp
10
debug.cpp
@ -44,7 +44,7 @@ bool errorReported = false;
|
||||
|
||||
EX void describeCell(cell *c) {
|
||||
if(!c) { printf("NULL\n"); return; }
|
||||
printf("describe %p: ", c);
|
||||
printf("describe %p: ", hr::voidp(c));
|
||||
printf("%-15s", linf[c->land].name);
|
||||
printf("%-15s", winf[c->wall].name);
|
||||
printf("%-15s", iinf[c->item].name);
|
||||
@ -285,7 +285,7 @@ EX bool applyCheat(char u, cell *c IS(NULL)) {
|
||||
if(u == 'L'-64) {
|
||||
cell *c = mouseover;
|
||||
describeCell(c);
|
||||
printf("Neighbors:"); for(int i=0; i<c->type; i++) printf("%p ", c->move(i));
|
||||
printf("Neighbors:"); for(int i=0; i<c->type; i++) printf("%p ", hr::voidp(c->move(i)));
|
||||
printf("Barrier: dir=%d left=%d right=%d\n",
|
||||
c->bardir, c->barleft, c->barright);
|
||||
return true;
|
||||
@ -358,7 +358,7 @@ struct debugScreen {
|
||||
queuepoly(gmatrix[what], cgi.shAsymmetric, 0x80808080);
|
||||
#endif
|
||||
char buf[200];
|
||||
sprintf(buf, "%p", what);
|
||||
sprintf(buf, "%p", hr::voidp(what));
|
||||
dialog::addSelItem("mpdist", its(what->mpdist), 'd');
|
||||
dialog::add_action([what] () {
|
||||
bitfield_editor(what->mpdist, [what] (int i) { what->mpdist = 0; }, "generation level");
|
||||
@ -561,7 +561,7 @@ EX void viewall() {
|
||||
EX void modalDebug(cell *c) {
|
||||
centerover = c; View = Id;
|
||||
if(noGUI) {
|
||||
fprintf(stderr, "fatal: modalDebug called on %p without GUI\n", c);
|
||||
fprintf(stderr, "fatal: modalDebug called on %p without GUI\n", hr::voidp(c));
|
||||
exit(1);
|
||||
}
|
||||
push_debug_screen();
|
||||
@ -583,7 +583,7 @@ void test_distances(int max) {
|
||||
|
||||
EX void raiseBuggyGeneration(cell *c, const char *s) {
|
||||
|
||||
printf("procgen error (%p): %s\n", c, s);
|
||||
printf("procgen error (%p): %s\n", hr::voidp(c), s);
|
||||
|
||||
if(!errorReported) {
|
||||
addMessage(string("something strange happened in: ") + s);
|
||||
|
@ -37,7 +37,7 @@ EX namespace dialog {
|
||||
bool positive;
|
||||
};
|
||||
|
||||
static inline ld identity_f(ld x) { return x; };
|
||||
static inline ld identity_f(ld x) { return x; }
|
||||
|
||||
const static scaler identity = {identity_f, identity_f, false};
|
||||
const static scaler logarithmic = {log, exp, true};
|
||||
@ -100,7 +100,7 @@ EX namespace dialog {
|
||||
if(clicked) hr::displayfr(x * zoomf + shiftx, y * zoomf + shifty, b, size * zoomf, s, hicolor, align);
|
||||
return clicked;
|
||||
}
|
||||
EX };
|
||||
EX }
|
||||
|
||||
#if CAP_MENUSCALING && CAP_SDL
|
||||
EX void handleZooming(SDL_Event &ev) {
|
||||
@ -142,7 +142,7 @@ EX namespace dialog {
|
||||
EX void handler(int sym, int uni) {
|
||||
dialog::handleNavigation(sym, uni);
|
||||
if(doexiton(sym, uni)) popScreen();
|
||||
};
|
||||
}
|
||||
|
||||
EX void init() {
|
||||
items.clear();
|
||||
@ -1268,6 +1268,6 @@ EX namespace dialog {
|
||||
}
|
||||
#endif
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -459,7 +459,7 @@ EX namespace euc {
|
||||
cat += val * main_axes[i];
|
||||
}
|
||||
return cat;
|
||||
};
|
||||
}
|
||||
|
||||
EX bool valid_third_turn(const intmatrix& m) {
|
||||
if(m[0][2] != -m[0][0]-m[0][1]) return false;
|
||||
@ -630,7 +630,7 @@ EX namespace euc {
|
||||
int diagonal_cross(const coord& a, const coord& b) {
|
||||
return a[0]*b[1] + a[1]*b[2] + a[2]*b[0]
|
||||
- b[0]*a[1] - b[1]*a[2] - b[2]*a[0];
|
||||
};
|
||||
}
|
||||
|
||||
void torus_config_full::canonicalize(coord& x, coord& d, transmatrix& M, bool& mirr) {
|
||||
if(!twisted) {
|
||||
|
@ -409,34 +409,34 @@ vector<matrix> fpattern::generate_isometries3() {
|
||||
if(dis && dis->stop_it) return res;
|
||||
#endif
|
||||
|
||||
for(T[0][2]=low; T[0][2]<Prime; T[0][2]++)
|
||||
for(T[0][3]=low; T[0][3]<Prime; T[0][3]++)
|
||||
if(rowcol(0, 0) == 1)
|
||||
if(rowcol(0, 1) == 0)
|
||||
for(T[1][2]=low; T[1][2]<Prime; T[1][2]++)
|
||||
for(T[1][3]=low; T[1][3]<Prime; T[1][3]++)
|
||||
if(rowcol(1, 0) == 0)
|
||||
if(rowcol(1, 1) == 1)
|
||||
for(T[2][2]=low; T[2][2]<Prime; T[2][2]++)
|
||||
for(T[3][2]=low; T[3][2]<Prime; T[3][2]++)
|
||||
if(colprod(2, 2) == 1)
|
||||
if(colprod(2, 0) == 0)
|
||||
if(colprod(2, 1) == 0)
|
||||
for(T[2][3]=low; T[2][3]<Prime; T[2][3]++)
|
||||
for(T[3][3]=low; T[3][3]<Prime; T[3][3]++)
|
||||
if(rowcol(2, 0) == 0)
|
||||
if(rowcol(2, 1) == 0)
|
||||
if(rowcol(2, 2) == 1)
|
||||
// if(colprod(3, 3) == 1)
|
||||
if(add(colprod(3, 3), 1) == 0)
|
||||
if(colprod(3, 0) == 0)
|
||||
if(colprod(3, 1) == 0)
|
||||
if(colprod(3, 2) == 0)
|
||||
if(rowcol(3, 3) == 1)
|
||||
if(rowcol(3, 0) == 0)
|
||||
if(rowcol(3, 1) == 0)
|
||||
if(rowcol(3, 2) == 0)
|
||||
res.push_back(T);
|
||||
for(T[0][2]=low; T[0][2]<Prime; T[0][2]++)
|
||||
for(T[0][3]=low; T[0][3]<Prime; T[0][3]++)
|
||||
if(rowcol(0, 0) == 1)
|
||||
if(rowcol(0, 1) == 0)
|
||||
for(T[1][2]=low; T[1][2]<Prime; T[1][2]++)
|
||||
for(T[1][3]=low; T[1][3]<Prime; T[1][3]++)
|
||||
if(rowcol(1, 0) == 0)
|
||||
if(rowcol(1, 1) == 1)
|
||||
for(T[2][2]=low; T[2][2]<Prime; T[2][2]++)
|
||||
for(T[3][2]=low; T[3][2]<Prime; T[3][2]++)
|
||||
if(colprod(2, 2) == 1)
|
||||
if(colprod(2, 0) == 0)
|
||||
if(colprod(2, 1) == 0)
|
||||
for(T[2][3]=low; T[2][3]<Prime; T[2][3]++)
|
||||
for(T[3][3]=low; T[3][3]<Prime; T[3][3]++)
|
||||
if(rowcol(2, 0) == 0)
|
||||
if(rowcol(2, 1) == 0)
|
||||
if(rowcol(2, 2) == 1)
|
||||
// if(colprod(3, 3) == 1)
|
||||
if(add(colprod(3, 3), 1) == 0)
|
||||
if(colprod(3, 0) == 0)
|
||||
if(colprod(3, 1) == 0)
|
||||
if(colprod(3, 2) == 0)
|
||||
if(rowcol(3, 3) == 1)
|
||||
if(rowcol(3, 0) == 0)
|
||||
if(rowcol(3, 1) == 0)
|
||||
if(rowcol(3, 2) == 0)
|
||||
res.push_back(T);
|
||||
if(isize(res) > limitp) return res;
|
||||
}
|
||||
|
||||
|
@ -35,7 +35,7 @@ void geometry_information::init_floorshapes() {
|
||||
|
||||
for(auto s: all_plain_floorshapes) s->is_plain = true;
|
||||
|
||||
auto init_escher = [this] (escher_floorshape& sh, int s0, int s1, int noft=0, int s2=0) {
|
||||
auto init_escher = [this] (escher_floorshape& sh, int s0, int s1, int noft, int s2) {
|
||||
sh.shapeid0 = s0;
|
||||
sh.shapeid1 = s1;
|
||||
sh.noftype = noft;
|
||||
@ -45,22 +45,22 @@ void geometry_information::init_floorshapes() {
|
||||
all_escher_floorshapes.push_back(&sh);
|
||||
};
|
||||
|
||||
init_escher(shStarFloor, 1,2);
|
||||
init_escher(shCloudFloor, 3, 4);
|
||||
init_escher(shStarFloor, 1, 2, 0, 0);
|
||||
init_escher(shCloudFloor, 3, 4, 0, 0);
|
||||
init_escher(shCrossFloor, 5, 6, 2, 54);
|
||||
init_escher(shChargedFloor, 7, 385, 1, 10);
|
||||
init_escher(shSStarFloor, 11, 12);
|
||||
init_escher(shSStarFloor, 11, 12, 0, 0);
|
||||
init_escher(shOverFloor, 13, 15, 1, 14);
|
||||
init_escher(shTriFloor, 17, 18, 0, 385);
|
||||
init_escher(shFeatherFloor, 19, 21, 1, 20);
|
||||
init_escher(shBarrowFloor, 23, 24, 1, 25);
|
||||
init_escher(shNewFloor, 26, 27, 2, 54);
|
||||
init_escher(shTrollFloor, 28, 29);
|
||||
init_escher(shTrollFloor, 28, 29, 0, 0);
|
||||
init_escher(shButterflyFloor, 325, 326, 1, 178);
|
||||
init_escher(shLavaFloor, 359, 360, 1, 178);
|
||||
init_escher(shLavaSeabed, 386, 387, 1, 178);
|
||||
init_escher(shSeabed, 334, 335);
|
||||
init_escher(shCloudSeabed, 336, 337);
|
||||
init_escher(shSeabed, 334, 335, 0, 0);
|
||||
init_escher(shCloudSeabed, 336, 337, 0, 0);
|
||||
init_escher(shCaveSeabed, 338, 339, 2, 54);
|
||||
init_escher(shPalaceFloor, 45, 46, 0, 385);
|
||||
init_escher(shDemonFloor, 51, 50, 1, 178);
|
||||
@ -71,7 +71,7 @@ void geometry_information::init_floorshapes() {
|
||||
init_escher(shSwitchFloor, 377, 378, 1, 379);
|
||||
init_escher(shTurtleFloor, 176, 177, 1, 178);
|
||||
for(int i: {0,1,2})
|
||||
init_escher(shRedRockFloor[i], 55, 56);
|
||||
init_escher(shRedRockFloor[i], 55, 56, 0, 0);
|
||||
init_escher(shDragonFloor, 181, 182, 2, 183); /* dragon */
|
||||
|
||||
int ids = 0;
|
||||
|
2
glhr.cpp
2
glhr.cpp
@ -625,7 +625,7 @@ void init() {
|
||||
printf("Failed to initialize GLEW\n");
|
||||
return;
|
||||
}
|
||||
printf("CreateProgram = %p\n", __glewCreateProgram);
|
||||
printf("CreateProgram = %p\n", reinterpret_cast<void*>(__glewCreateProgram));
|
||||
if(!__glewCreateProgram) noshaders = true;
|
||||
}
|
||||
#endif
|
||||
|
24
graph.cpp
24
graph.cpp
@ -483,7 +483,7 @@ EX namespace tortoise {
|
||||
|
||||
return gradient(0x487830, mcol, 0, dd, 0xFF);
|
||||
}
|
||||
EX };
|
||||
EX }
|
||||
|
||||
double footfun(double d) {
|
||||
d -= floor(d);
|
||||
@ -595,7 +595,7 @@ transmatrix otherbodyparts(const transmatrix& V, color_t col, eMonster who, doub
|
||||
#define VAHEAD mmscale(V, cgi.AHEAD)
|
||||
|
||||
#define VFISH V
|
||||
#define VBIRD ((GDIM == 3 || (where && bird_disruption(where))) ? (WDIM == 2 ? mmscale(V, cgi.BIRD) : V) : mmscale(V, cgi.BIRD + .05 * sintick(1000, (int) (size_t(where))/1000.)))
|
||||
#define VBIRD ((GDIM == 3 || (where && bird_disruption(where))) ? (WDIM == 2 ? mmscale(V, cgi.BIRD) : V) : mmscale(V, cgi.BIRD + .05 * sintick(1000, static_cast<int>(reinterpret_cast<size_t>(where))/1000.)))
|
||||
#define VGHOST mmscale(V, cgi.GHOST)
|
||||
|
||||
#define VSLIMEEYE mscale(V, cgi.FLATEYE)
|
||||
@ -750,7 +750,7 @@ EX bool drawItemType(eItem it, cell *c, const transmatrix& V, color_t icol, int
|
||||
#else
|
||||
char xch = iinf[it].glyph;
|
||||
auto sinptick = [c, pticks] (int period) { return c ? sintick(period) : sin(animation_factor * pticks / period);};
|
||||
auto spinptick = [c, pticks] (int period, ld phase=0) { return c ? spintick(period, phase) : spin((animation_factor * pticks + phase) / period); };
|
||||
auto spinptick = [c, pticks] (int period, ld phase) { return c ? spintick(period, phase) : spin((animation_factor * pticks + phase) / period); };
|
||||
int ct6 = c ? ctof(c) : 1;
|
||||
hpcshape *xsh =
|
||||
(it == itPirate || it == itKraken) ? &cgi.shPirateX :
|
||||
@ -805,17 +805,17 @@ EX bool drawItemType(eItem it, cell *c, const transmatrix& V, color_t icol, int
|
||||
}
|
||||
|
||||
else if(it == itStrongWind) {
|
||||
queuepoly(Vit * spinptick(750), cgi.shFan, darkena(icol, 0, 255));
|
||||
queuepoly(Vit * spinptick(750, 0), cgi.shFan, darkena(icol, 0, 255));
|
||||
}
|
||||
|
||||
else if(it == itWarning) {
|
||||
queuepoly(Vit * spinptick(750), cgi.shTriangle, darkena(icol, 0, 255));
|
||||
queuepoly(Vit * spinptick(750, 0), cgi.shTriangle, darkena(icol, 0, 255));
|
||||
}
|
||||
|
||||
else if(it == itBabyTortoise) {
|
||||
int bits = c ? tortoise::babymap[c] : tortoise::last;
|
||||
int over = c && c->monst == moTortoise;
|
||||
tortoise::draw(Vit * spinptick(5000) * ypush(cgi.crossf*.15), bits, over ? 4 : 2, 0);
|
||||
tortoise::draw(Vit * spinptick(5000, 0) * ypush(cgi.crossf*.15), bits, over ? 4 : 2, 0);
|
||||
// queuepoly(Vit, cgi.shHeptaMarker, darkena(tortoise::getMatchColor(bits), 0, 0xC0));
|
||||
}
|
||||
|
||||
@ -903,12 +903,12 @@ EX bool drawItemType(eItem it, cell *c, const transmatrix& V, color_t icol, int
|
||||
|
||||
else if(it == itRose) {
|
||||
for(int u=0; u<4; u++)
|
||||
queuepoly(Vit * spinptick(1500) * spin(2*M_PI / 3 / 4 * u), cgi.shRoseItem, darkena(icol, 0, hidden ? 0x30 : 0xA0));
|
||||
queuepoly(Vit * spinptick(1500, 0) * spin(2*M_PI / 3 / 4 * u), cgi.shRoseItem, darkena(icol, 0, hidden ? 0x30 : 0xA0));
|
||||
}
|
||||
|
||||
else if(it == itBarrow && c) {
|
||||
for(int i = 0; i<c->landparam; i++)
|
||||
queuepolyat(Vit * spin(2 * M_PI * i / c->landparam) * xpush(.15) * spinptick(1500), *xsh, darkena(icol, 0, hidden ? 0x40 :
|
||||
queuepolyat(Vit * spin(2 * M_PI * i / c->landparam) * xpush(.15) * spinptick(1500, 0), *xsh, darkena(icol, 0, hidden ? 0x40 :
|
||||
(highwall(c) && wmspatial) ? 0x60 : 0xFF),
|
||||
PPR::HIDDEN);
|
||||
|
||||
@ -923,7 +923,7 @@ EX bool drawItemType(eItem it, cell *c, const transmatrix& V, color_t icol, int
|
||||
if(it == itLotus) icol = 0x101010;
|
||||
if(it == itSwitch) icol = minf[active_switch()].color;
|
||||
|
||||
transmatrix V2 = Vit * spinptick(1500);
|
||||
transmatrix V2 = Vit * spinptick(1500, 0);
|
||||
|
||||
if(xsh == &cgi.shBookCover && mmitem) {
|
||||
if(GDIM == 3)
|
||||
@ -957,11 +957,11 @@ EX bool drawItemType(eItem it, cell *c, const transmatrix& V, color_t icol, int
|
||||
color_t col = darkena(icol, 0, int(0x80 + 0x70 * sinptick(300)));
|
||||
|
||||
if(it == itOrbFish)
|
||||
queuepolyat(Vit * spinptick(1500), cgi.shFishTail, col, PPR::ITEM_BELOW);
|
||||
queuepolyat(Vit * spinptick(1500, 0), cgi.shFishTail, col, PPR::ITEM_BELOW);
|
||||
|
||||
queuepolyat(Vit, cgi.shDisk, darkena(icol1, 0, inice ? 0x80 : hidden ? 0x20 : 0xC0), prio);
|
||||
|
||||
queuepolyat(Vit * spinptick(1500), orbshape(iinf[it].orbshape), col, prio);
|
||||
queuepolyat(Vit * spinptick(1500, 0), orbshape(iinf[it].orbshape), col, prio);
|
||||
}
|
||||
|
||||
else if(it) return true;
|
||||
@ -5019,7 +5019,7 @@ namespace sm {
|
||||
static const int DIALOG_STRICT_X = 32768; // do not interpret dialog clicks outside of the X region
|
||||
static const int EXPANSION = (1<<16);
|
||||
static const int HEXEDIT = (1<<17);
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
EX int cmode;
|
||||
|
8
help.cpp
8
help.cpp
@ -755,11 +755,11 @@ void gotoHelpFor(eItem i) {
|
||||
|
||||
void gotoHelpFor(eWall w) {
|
||||
help = generateHelpForWall(w);
|
||||
};
|
||||
}
|
||||
|
||||
void gotoHelpFor(eMonster m) {
|
||||
help = generateHelpForMonster(m);
|
||||
};
|
||||
}
|
||||
|
||||
EX void appendHelp(string s) {
|
||||
auto h = helpgenerator;
|
||||
@ -832,7 +832,7 @@ EX void describeMouseover() {
|
||||
if(c->land == laTortoise && tortoise::seek()) out += " " + tortoise::measure(getBits(c));
|
||||
|
||||
if(buggyGeneration) {
|
||||
char buf[80]; sprintf(buf, " %p H=%d M=%d", c, c->landparam, c->mpdist); out += buf;
|
||||
char buf[80]; sprintf(buf, " %p H=%d M=%d", hr::voidp(c), c->landparam, c->mpdist); out += buf;
|
||||
}
|
||||
|
||||
if(randomPatternsMode)
|
||||
@ -877,7 +877,7 @@ EX void describeMouseover() {
|
||||
"Trees in this forest can be chopped down. Big trees take two turns to chop down.";
|
||||
else
|
||||
if(c->wall != waSea && c->wall != waPalace && c->wall != waDeadfloor)
|
||||
if(!((c->wall == waCavefloor || c->wall == waCavewall) && (c->land == laEmerald && c->land == laCaves)))
|
||||
if(!((c->wall == waCavefloor || c->wall == waCavewall) && (c->land == laEmerald || c->land == laCaves)))
|
||||
if(!((isAlch(c->wall) && c->land == laAlchemist)))
|
||||
help = bygen([c] () { gotoHelpFor(c->wall); });
|
||||
}
|
||||
|
5
hyper.h
5
hyper.h
@ -35,6 +35,11 @@ template<class T>
|
||||
void ignore(T&&) {
|
||||
}
|
||||
|
||||
const void *voidp(const void *p) {
|
||||
// a simple static_cast<void*> for use with printf("%p")
|
||||
return p;
|
||||
}
|
||||
|
||||
/** Is the value of first parameter equal to one of the remaining parameters? */
|
||||
template<class T, class V, class... U> bool among(T x, V y) { return x == y; }
|
||||
template<class T, class V, class... U> bool among(T x, V y, U... u) { return x==y || among(x,u...); }
|
||||
|
@ -307,7 +307,7 @@ hyperpoint compute_hybrid(hyperpoint H, int rootid) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
EX ld signed_sqrt(ld x) { return x > 0 ? sqrt(x) : -sqrt(-x); };
|
||||
EX ld signed_sqrt(ld x) { return x > 0 ? sqrt(x) : -sqrt(-x); }
|
||||
|
||||
EX void applymodel(hyperpoint H, hyperpoint& ret) {
|
||||
|
||||
|
@ -144,7 +144,7 @@ void rebase(cellinfo& ci) {
|
||||
cell *cx = ci.owner;
|
||||
virtualRebase(ci.owner, ci.p);
|
||||
if(ci.owner != cx) {
|
||||
printf("rebased %p to %p\n", cx, ci.owner);
|
||||
printf("rebased %p to %p\n", hr::voidp(cx), hr::voidp(ci.owner));
|
||||
set_relmatrices(ci);
|
||||
}
|
||||
}
|
||||
@ -463,7 +463,7 @@ bool step(int delta) {
|
||||
|
||||
int heptas = 0;
|
||||
for(auto p: cells_of_heptagon) {
|
||||
printf("%p: %d\n", p.first, isize(p.second));
|
||||
printf("%p: %d\n", hr::voidp(p.first), isize(p.second));
|
||||
heptas++;
|
||||
}
|
||||
|
||||
@ -583,7 +583,7 @@ struct heptinfo {
|
||||
EX map<heptagon*, heptinfo> periodmap;
|
||||
|
||||
EX void link_to_base(heptagon *h, heptspin base) {
|
||||
// printf("linking %p to %p/%d\n", h, base.at, base.spin);
|
||||
// printf("linking %p to %p/%d\n", hr::voidp(h), hr::voidp(base.at), base.spin);
|
||||
auto &hi = periodmap[h];
|
||||
hi.base = base;
|
||||
for(int k: cells_of_heptagon[base.at]) {
|
||||
@ -612,7 +612,7 @@ EX void link_start(heptagon *h) {
|
||||
EX void link_next(heptagon *parent, int d) {
|
||||
if(!periodmap.count(parent))
|
||||
link_to_base(parent, heptspin(cells[0].owner->master, 0));
|
||||
// printf("linking next: %p direction %d [s%d]\n", parent, d, parent->c.spin(d));
|
||||
// printf("linking next: %p direction %d [s%d]\n", hr::voidp(parent), d, parent->c.spin(d));
|
||||
auto *h = parent->move(d);
|
||||
heptspin hs = periodmap[parent].base + d + wstep - parent->c.spin(d);
|
||||
link_to_base(h, hs);
|
||||
@ -625,7 +625,7 @@ EX void may_link_next(heptagon *parent, int d) {
|
||||
|
||||
|
||||
EX void link_cell(cell *c, int d) {
|
||||
// printf("linking cell: %p direction %d\n", c, d);
|
||||
// printf("linking cell: %p direction %d\n", hr::voidp(c), d);
|
||||
int ci = cellindex[c];
|
||||
auto& sc = cells[ci];
|
||||
int ci2 = sc.neid[d];
|
||||
@ -644,7 +644,7 @@ EX void link_cell(cell *c, int d) {
|
||||
heptspin hss(c->master, d);
|
||||
hss += wstep;
|
||||
master2 = hss.at;
|
||||
// printf("master2 is %p; base = %p; should be = %p\n", master2, periodmap[master2].base.at, sc2.owner->master);
|
||||
// printf("master2 is %p; base = %p; should be = %p\n", hr::voidp(master2), hr::voidp(periodmap[master2].base.at), hr::voidp(sc2.owner->master));
|
||||
dirs++;
|
||||
}
|
||||
if(dirs != 1) { printf("dirs error\n"); exit(1); }
|
||||
@ -674,7 +674,7 @@ map<heptagon*, heptagon*> last_on_horocycle;
|
||||
void compute_horocycle(heptagon *);
|
||||
|
||||
void compute_distances(heptagon *h, bool alts) {
|
||||
/* if(alts) printf("[%p] compute_distances %p\n", h->alt->alt, h);
|
||||
/* if(alts) printf("[%p] compute_distances %p\n", hr::voidp(h->alt->alt), hr::voidp(h));
|
||||
printf("neighbors:"); for(int i=0; i<S7; i++) printf(" %p", createStep(h, i)); printf("\n"); */
|
||||
|
||||
if(alts) {
|
||||
@ -741,7 +741,7 @@ void erase_alt(heptagon *alt) {
|
||||
|
||||
void compute_horocycle(heptagon *alt) {
|
||||
heptagon *master = last_on_horocycle[alt];
|
||||
// printf("computing horocycle, master distance = %d [M=%p, A=%p]\n", master->alt->distance, master, alt);
|
||||
// printf("computing horocycle, master distance = %d [M=%p, A=%p]\n", master->alt->distance, hr::voidp(master), hr::voidp(alt));
|
||||
|
||||
static const int LOOKUP = 16;
|
||||
set<heptagon*> hs[LOOKUP];
|
||||
|
@ -516,7 +516,7 @@ namespace lv {
|
||||
static const flagtype appears_in_ptm = 8;
|
||||
static const flagtype display_in_help = 16;
|
||||
static const flagtype one_and_half = 32;
|
||||
};
|
||||
}
|
||||
|
||||
struct land_validity_t {
|
||||
int quality_level; // 0 (dont show), 1 (1/2), 2 (ok), 3(1!)
|
||||
|
@ -325,7 +325,7 @@ int main() {
|
||||
printf("#define NUMEXTRA %d\n", isize(vchars));
|
||||
printf("#define NATCHARS {");
|
||||
for(auto&& elt : vchars) printf("\"%s\",", elt.c_str());
|
||||
printf("};\n");
|
||||
printf("}\n");
|
||||
printf("extern const char* natchars[NUMEXTRA];\n");
|
||||
printf("#endif\n");
|
||||
printf("#endif\n");
|
||||
|
@ -2141,7 +2141,7 @@ namespace mapeditor {
|
||||
addHook(hooks_removecells, 0, [] () {
|
||||
modelcell.clear();
|
||||
set_if_removed(mapeditor::copysource.at, NULL);
|
||||
});;;
|
||||
});
|
||||
#endif
|
||||
|
||||
EX void initdraw(cell *c) {
|
||||
|
@ -25,7 +25,7 @@ string preprocessor =
|
||||
"g++ -E";
|
||||
|
||||
string compiler =
|
||||
"g++ -Wall -Wextra -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -Wno-implicit-fallthrough -rdynamic -fdiagnostics-color=always -c";
|
||||
"g++ -Wall -Wextra -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-implicit-fallthrough -rdynamic -fdiagnostics-color=always -c";
|
||||
|
||||
string linker =
|
||||
"g++ -rdynamic -o hyper";
|
||||
|
@ -2889,7 +2889,7 @@ EX namespace linepatterns {
|
||||
dialog::display();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
int val46(cell *c) {
|
||||
patterns::patterninfo si;
|
||||
|
@ -136,7 +136,7 @@ struct raycaster : glhr::GLprogram {
|
||||
|
||||
shared_ptr<raycaster> our_raycaster;
|
||||
|
||||
EX void reset_raycaster() { our_raycaster = nullptr; };
|
||||
EX void reset_raycaster() { our_raycaster = nullptr; }
|
||||
|
||||
int deg;
|
||||
|
||||
@ -846,7 +846,7 @@ array<float, 2> enc(int i, int a) {
|
||||
res[0] = ((i%per_row) * deg + a + .5) / length;
|
||||
res[1] = ((i / per_row) + .5) / rows;
|
||||
return res;
|
||||
};
|
||||
}
|
||||
|
||||
color_t color_out_of_range = 0x0F0800FF;
|
||||
|
||||
|
@ -151,10 +151,8 @@ void recursive_paint(cwpath& pinv, vector<int>& way, int noway) {
|
||||
else
|
||||
gid = 3;
|
||||
|
||||
infos[c] = cellinfo{c, gid, 0};
|
||||
infos[c].way = way;
|
||||
infos[c].pinv = pinv;
|
||||
|
||||
infos[c] = cellinfo{c, gid, 0, waNone, itNone, laNone, moNone, way, pinv};
|
||||
|
||||
// c->landparam ^= ((isize(way)&1) * 0x3F3F3F);
|
||||
// c->landparam = hsh; // d * 5 + 256 * (hsh&0xFFFF) + 0x400000;
|
||||
if(cidd>112899) c->landparam = 0x101010;
|
||||
|
@ -480,14 +480,14 @@ void verify_crawlers() {
|
||||
if(allcrawlers.count(id.first)) {
|
||||
bool b = verify_crawler(allcrawlers[id.first], cellwalker(c, id.second));
|
||||
if(!b) {
|
||||
printf("cell %p: type = %d id = %d dir = %d / earlier crawler failed\n", c, c->type, id.first, id.second);
|
||||
printf("cell %p: type = %d id = %d dir = %d / earlier crawler failed\n", hr::voidp(c), c->type, id.first, id.second);
|
||||
failures++;
|
||||
}
|
||||
}
|
||||
else {
|
||||
for(int i=0; i<c->type; i++)
|
||||
for(auto& cc: allcrawlers) if(verify_crawler(cc.second, cellwalker(c, i))) {
|
||||
printf("cell %p: type = %d id = %d dir = %d / also works id %d in direction %d\n", c, c->type, id.first, id.second, cc.first, i);
|
||||
printf("cell %p: type = %d id = %d dir = %d / also works id %d in direction %d\n", hr::voidp(c), c->type, id.first, id.second, cc.first, i);
|
||||
uniq--;
|
||||
goto breakcheck;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ struct coord {
|
||||
|
||||
char out = '-';
|
||||
|
||||
char& fmap_at(coord c) { return c.x >= 0 && c.x < isize(fmap[0]) && c.y >= 0 && c.y < isize(fmap) ? fmap[c.y][c.x] : out; };
|
||||
char& fmap_at(coord c) { return c.x >= 0 && c.x < isize(fmap[0]) && c.y >= 0 && c.y < isize(fmap) ? fmap[c.y][c.x] : out; }
|
||||
|
||||
ld vx[256][256], vy[256][256];
|
||||
|
||||
@ -398,7 +398,7 @@ void changepoint(int x, int y, bool can_add) {
|
||||
|
||||
for(int k=0; k<4; k++) if(!live[k]) fmap_at(cc+k) = '0';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
bool showmenu = true;
|
||||
|
||||
|
@ -72,7 +72,8 @@ color_t parse1(const string& s) {
|
||||
// color can be given as RRGGBB
|
||||
// or as 'Rmax,min,alpha,step,start', for rainbow Collatz
|
||||
if(s[0] == 'R') {
|
||||
int mh = 192, minh = 0, alpha = 255, step = 50, start = 0;
|
||||
color_t mh = 192, minh = 0, alpha = 255;
|
||||
int step = 50, start = 0;
|
||||
sscanf(s.c_str(), "R%x,%x,%x,%d,%d", &mh, &minh, &alpha, &step, &start);
|
||||
vector<color_t> hues;
|
||||
color_t difh = mh - minh;
|
||||
@ -2474,7 +2475,7 @@ auto hooks =
|
||||
addHook(hooks_markers, 100, search_marker) +
|
||||
0;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#include "kohonen.cpp"
|
||||
#include "staircase.cpp"
|
||||
|
@ -41,7 +41,7 @@ extern "C"
|
||||
SDL_Surface *SDL_PNGFormatAlpha(SDL_Surface *src)
|
||||
{
|
||||
SDL_Surface *surf;
|
||||
SDL_Rect rect = { 0 };
|
||||
SDL_Rect rect = { 0, 0, 0, 0 };
|
||||
|
||||
/* NO-OP for images < 32bpp and 32bpp images that already have Alpha channel */
|
||||
if (src->format->BitsPerPixel <= 24 || src->format->Amask) {
|
||||
|
@ -238,7 +238,7 @@ bool isMonster(monster *m) { return m->type != moPlayer && m->type != moBullet;
|
||||
|
||||
EX hookset<bool(shmup::monster*)> *hooks_kill;
|
||||
|
||||
void killMonster(monster* m, eMonster who_kills, int flags = 0) {
|
||||
void killMonster(monster* m, eMonster who_kills, flagtype flags = 0) {
|
||||
int tk = tkills();
|
||||
if(callhandlers(false, hooks_kill, m)) return;
|
||||
if(m->dead) return;
|
||||
|
@ -192,7 +192,7 @@ bool flag_clamp_max(ld& coord, ld maxv) {
|
||||
|
||||
bool flag_clamp(ld& coord, ld minv, ld maxv) {
|
||||
return flag_clamp_min(coord, minv) & flag_clamp_max(coord, maxv);
|
||||
};
|
||||
}
|
||||
|
||||
bool flag_clamp_sym(ld& coord, ld v) {
|
||||
return flag_clamp(coord, -v, v);
|
||||
|
@ -421,6 +421,7 @@ extern "C" {
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include <queue>
|
||||
#include <sstream>
|
||||
#include <stdexcept>
|
||||
#include <array>
|
||||
#include <set>
|
||||
|
@ -918,7 +918,7 @@ EX void remove_emergency_save() {
|
||||
}
|
||||
|
||||
EX void saveStats(bool emergency IS(false)) {
|
||||
DEBBI(DF_INIT, ("saveStats [%s]", scorefile));
|
||||
DEBBI(DF_INIT, ("saveStats [", scorefile, "]"));
|
||||
|
||||
if(autocheat) return;
|
||||
#if CAP_TOUR
|
||||
@ -1572,5 +1572,5 @@ addHook(hooks_removecells, 0, [] () {
|
||||
eliminate_if(butterflies, [] (pair<cell*,int>& p) { return is_cell_removed(p.first); });
|
||||
for(int i=0; i<SHSIZE; i++) for(int p=0; p<MAXPLAYER; p++)
|
||||
set_if_removed(shpos[p][i], NULL);
|
||||
});;
|
||||
});
|
||||
}
|
||||
|
@ -1354,7 +1354,7 @@ EX namespace peace {
|
||||
}
|
||||
|
||||
auto aNext = addHook(hooks_nextland, 100, getNext);
|
||||
};
|
||||
}
|
||||
|
||||
#if CAP_COMMANDLINE
|
||||
int read_mode_args() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user