1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2024-12-24 17:10:36 +00:00

cpp files no longer include other cpp files

This commit is contained in:
Zeno Rogue 2018-06-11 01:12:18 +02:00
parent 98246d3066
commit c2e3ed54f0
9 changed files with 65 additions and 43 deletions

View File

@ -48,6 +48,10 @@ struct blizzardcell {
map<cell*, blizzardcell> blizzardcells;
void set_blizzard_frame(cell *c, int frameid) {
blizzardcells[c].frame = frameid;
}
vector<blizzardcell*> bcells;
int N;

View File

@ -52,6 +52,7 @@ bool inv::activating;
#include "debug.cpp"
#include "geometry.cpp"
#include "polygons.cpp"
#include "floorshapes.cpp"
#include "mapeditor.cpp"
#if CAP_MODEL
#include "netgen.cpp"
@ -64,6 +65,7 @@ bool inv::activating;
#include "help.cpp"
#include "config.cpp"
#include "scores.cpp"
#include "dialogs.cpp"
#include "menus.cpp"
#include "geom-exp.cpp"
#include "quit.cpp"
@ -78,6 +80,7 @@ bool inv::activating;
#include "hypgraph.cpp"
#include "textures.cpp"
#include "graph.cpp"
#include "blizzard.cpp"
#include "sound.cpp"
#include "achievement.cpp"
#include "barriers.cpp"

View File

@ -1,31 +1,6 @@
struct plain_floorshape;
struct escher_floorshape;
vector<plain_floorshape*> all_plain_floorshapes;
vector<escher_floorshape*> all_escher_floorshapes;
struct floorshape {
bool is_plain;
int shapeid, prio;
vector<hpcshape> b, shadow, side[SIDEPARS], gpside[SIDEPARS][8];
floorshape() { prio = PPR_FLOOR; }
};
struct plain_floorshape : floorshape {
ld rad0, rad1;
plain_floorshape() { is_plain = true; all_plain_floorshapes.push_back(this); }
void configure(ld r0, ld r1) { rad0 = r0; rad1 = r1; }
};
// noftype: 0 (shapeid2 is heptagonal or just use shapeid1), 1 (shapeid2 is pure heptagonal), 2 (shapeid2 is Euclidean), 3 (shapeid2 is hexagonal)
struct escher_floorshape : floorshape {
int shapeid0, shapeid1, noftype, shapeid2;
ld scale;
escher_floorshape(int s0, int s1, int noft=0, int s2=0) : shapeid0(s0), shapeid1(s1), noftype(noft), shapeid2(s2) {
all_escher_floorshapes.push_back(this); scale = 1; is_plain = false;
}
};
plain_floorshape
shFloor,
shMFloor, shMFloor2, shMFloor3, shMFloor4, shFullFloor,

View File

@ -3275,8 +3275,6 @@ bool allemptynear(cell *c) {
return true;
}
#include "blizzard.cpp"
static const int trapcol[4] = {0x904040, 0xA02020, 0xD00000, 0x303030};
static const int terracol[8] = {0xD000, 0xE25050, 0xD0D0D0, 0x606060, 0x303030, 0x181818, 0x0080, 0x8080};
@ -4640,7 +4638,7 @@ void drawcell(cell *c, transmatrix V, int spinv, bool mirrored) {
if(c->land == laBlizzard) {
if(vid.backeffects) {
if(c->cpdist <= getDistLimit())
blizzardcells[c].frame = frameid;
set_blizzard_frame(c, frameid);
}
else {
forCellIdEx(c2, i, c) if(againstWind(c, c2))

51
hyper.h
View File

@ -3407,3 +3407,54 @@ void switch_game_mode(char switchWhat);
void stop_game_and_switch_mode(char switchWhat = rg::nothing); // stop_game + switch_game_mode
void restart_game(char switchWhat = rg::nothing); // popAllScreens + popAllGames + stop_game + switch_game_mode + start_game
void generate_floorshapes();
void drawArrowTraps();
void drawBlizzards();
struct blizzardcell;
extern vector<cell*> arrowtraps;
extern map<cell*, blizzardcell> blizzardcells;
extern vector<blizzardcell*> bcells;
void set_blizzard_frame(cell *c, int frameid);
#define SIDE_SLEV 0
#define SIDE_WALL 3
#define SIDE_LAKE 4
#define SIDE_LTOB 5
#define SIDE_BTOI 6
#define SIDE_WTS3 7
#define SIDEPARS 8
struct floorshape {
bool is_plain;
int shapeid, prio;
vector<hpcshape> b, shadow, side[SIDEPARS], gpside[SIDEPARS][8];
floorshape() { prio = PPR_FLOOR; }
};
extern vector<struct plain_floorshape*> all_plain_floorshapes;
extern vector<struct escher_floorshape*> all_escher_floorshapes;
struct plain_floorshape : floorshape {
ld rad0, rad1;
plain_floorshape() { is_plain = true; all_plain_floorshapes.push_back(this); }
void configure(ld r0, ld r1) { rad0 = r0; rad1 = r1; }
};
// noftype: 0 (shapeid2 is heptagonal or just use shapeid1), 1 (shapeid2 is pure heptagonal), 2 (shapeid2 is Euclidean), 3 (shapeid2 is hexagonal)
struct escher_floorshape : floorshape {
int shapeid0, shapeid1, noftype, shapeid2;
ld scale;
escher_floorshape(int s0, int s1, int noft=0, int s2=0) : shapeid0(s0), shapeid1(s1), noftype(noft), shapeid2(s2) {
all_escher_floorshapes.push_back(this); scale = 1; is_plain = false;
}
};
extern plain_floorshape
shFloor,
shMFloor, shMFloor2, shMFloor3, shMFloor4, shFullFloor,
shBigTriangle, shTriheptaFloor, shBigHepta;
extern escher_floorshape shDragonFloor, shPowerFloor, shRedRockFloor[3];

View File

@ -1,8 +1,6 @@
// HyperRogue menus
// Copyright (C) 2011-2018 Zeno Rogue, see 'hyper.cpp' for details
#include "dialogs.cpp"
// -- overview --
#define BLACKISH 0x404040

View File

@ -79,14 +79,6 @@ void hpcpush(hyperpoint h) {
hpc.push_back(h);
}
#define SIDE_SLEV 0
#define SIDE_WALL 3
#define SIDE_LAKE 4
#define SIDE_LTOB 5
#define SIDE_BTOI 6
#define SIDE_WTS3 7
#define SIDEPARS 8
bool validsidepar[SIDEPARS];
void chasmifyPoly(double fac, double fac2, int k) {
@ -1398,8 +1390,6 @@ ld dlow_table[SIDEPARS], dhi_table[SIDEPARS];
#define SHADMUL (S3==4 ? 1.05 : 1.3)
#include "floorshapes.cpp"
void buildpolys() {
symmetriesAt.clear();

View File

@ -914,9 +914,6 @@ bool edgecmp(edgeinfo *e1, edgeinfo *e2) {
return e1->weight > e2->weight;
}
#include "rogueviz-kohonen.cpp"
#include "rogueviz-staircase.cpp"
void describe(cell *c) {
if(kind == kKohonen) return kohonen::describe(c);
}
@ -1987,5 +1984,8 @@ auto hooks =
#endif
addHook(clearmemory, 0, close);
#include "rogueviz-kohonen.cpp"
#include "rogueviz-staircase.cpp"
};

View File

@ -1078,6 +1078,7 @@ void popAllGames() {
void stop_game() {
if(!game_active) return;
DEBB(DF_INIT, (debugfile,"stop_game\n"));
achievement_final(true);
#if CAP_SAVE
saveStats();
@ -1119,6 +1120,7 @@ void push_game() {
}
void switch_game_mode(char switchWhat) {
DEBB(DF_INIT, (debugfile,"switch_game_mode\n"));
switch(switchWhat) {
case rg::peace:
peace::on = !peace::on;
@ -1243,6 +1245,7 @@ void switch_game_mode(char switchWhat) {
void start_game() {
if(game_active) return;
DEBB(DF_INIT, (debugfile,"start_game\n"));
game_active = true;
if(need_reset_geometry) resetGeometry();
initcells();