mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2025-01-11 09:50:34 +00:00
rogueviz.cpp now includes only rogueviz core while rogueviz-all includes all; rogueviz modules can be included separately now
This commit is contained in:
parent
de0218b732
commit
c0e11b731a
@ -121,7 +121,7 @@
|
||||
#include "dpgen.cpp"
|
||||
|
||||
#if CAP_ROGUEVIZ
|
||||
#include "rogueviz/rogueviz.cpp"
|
||||
#include "rogueviz/rogueviz-all.cpp"
|
||||
#endif
|
||||
|
||||
#if CAP_DAILY
|
||||
|
@ -4,6 +4,8 @@
|
||||
// good parameters: -fixx 10 -W Cros -bantar_anim
|
||||
// use -bantar_map to see how it works
|
||||
|
||||
#include "rogueviz.h"
|
||||
|
||||
namespace rogueviz { namespace banachtarski {
|
||||
|
||||
bool on;
|
||||
|
@ -251,6 +251,16 @@ struct storydata { int s; int e; const char *text; } story[] = {
|
||||
|
||||
string its05(int i) { char buf[64]; sprintf(buf, "%05d", i); return buf; }
|
||||
|
||||
int dimid(char x) {
|
||||
if(x >= 'a' && x < 'a' + GDIM) return x - 'a';
|
||||
else if(x >= '0' && x < '0' + GDIM) return x - '0';
|
||||
else if(x >= 'x' && x < 'x' + GDIM) return x - 'x';
|
||||
else {
|
||||
println(hlog, "incorrect dimension ID");
|
||||
throw hr_exception();
|
||||
}
|
||||
}
|
||||
|
||||
int readArgs() {
|
||||
#if CAP_COMMANDLINE
|
||||
using namespace arg;
|
||||
|
@ -40,6 +40,8 @@ template<class T> auto parallelize(long long N, T action) -> decltype(action(0,0
|
||||
#endif
|
||||
}
|
||||
|
||||
#include "rogueviz.h"
|
||||
|
||||
namespace rogueviz {
|
||||
|
||||
namespace flocking {
|
||||
|
@ -1,3 +1,5 @@
|
||||
#include "rogueviz.h"
|
||||
|
||||
namespace rogueviz {
|
||||
|
||||
namespace graph {
|
||||
|
@ -1,6 +1,8 @@
|
||||
// show the fundamental domain for quotient spaces
|
||||
// Copyright (C) 2018 Zeno and Tehora Rogue, see 'hyper.cpp' for details
|
||||
|
||||
#include "rogueviz.h"
|
||||
|
||||
namespace hr {
|
||||
|
||||
namespace fundamental {
|
||||
|
@ -4,6 +4,8 @@
|
||||
// Kohonen's self-organizing maps.
|
||||
// This is a part of RogueViz, not a part of HyperRogue.
|
||||
|
||||
#include "rogueviz.h"
|
||||
|
||||
namespace rogueviz { namespace kohonen {
|
||||
|
||||
int kohonen_id;
|
||||
|
21
rogueviz/rogueviz-all.cpp
Normal file
21
rogueviz/rogueviz-all.cpp
Normal file
@ -0,0 +1,21 @@
|
||||
// include all RogueViz vizualizations
|
||||
|
||||
#include "rogueviz.cpp"
|
||||
#include "kohonen.cpp"
|
||||
#include "staircase.cpp"
|
||||
#include "banachtarski.cpp"
|
||||
#include "pentagonal.cpp"
|
||||
#include "functions.cpp"
|
||||
#include "fundamental.cpp"
|
||||
#include "sunflower.cpp"
|
||||
#include "flocking.cpp"
|
||||
#include "magiccube.cpp"
|
||||
#include "cvl.cpp"
|
||||
#include "newconf.cpp"
|
||||
#include "grigorchuk.cpp"
|
||||
#include "qtm.cpp"
|
||||
#include "rewriting.cpp"
|
||||
#include "sag.cpp"
|
||||
#include "collatz.cpp"
|
||||
#include "tree.cpp"
|
||||
#include "fullnet.cpp"
|
@ -21,6 +21,8 @@
|
||||
|
||||
namespace rogueviz {
|
||||
|
||||
string weight_label;
|
||||
|
||||
ld fat_edges = 0;
|
||||
ld ggamma = 1;
|
||||
|
||||
@ -795,8 +797,6 @@ bool rogueviz_hud() {
|
||||
return true;
|
||||
}
|
||||
|
||||
inline hookset<bool(int&, string&, FILE*)> *hooks_readcolor;
|
||||
|
||||
void readcolor(const string& cfname) {
|
||||
FILE *f = fopen(cfname.c_str(), "rt");
|
||||
if(!f) { printf("color file missing\n"); exit(1); }
|
||||
@ -901,8 +901,6 @@ void init(void *_vizid, flagtype _vizflags) {
|
||||
|
||||
int search_for = -1;
|
||||
|
||||
purehookset hooks_close;
|
||||
|
||||
void close() {
|
||||
search_for = -1;
|
||||
for(int i=0; i<isize(vdata); i++)
|
||||
@ -923,16 +921,6 @@ void close() {
|
||||
#define CAP_RVSLIDES (CAP_TOUR && !ISWEB)
|
||||
#endif
|
||||
|
||||
int dimid(char x) {
|
||||
if(x >= 'a' && x < 'a' + GDIM) return x - 'a';
|
||||
else if(x >= '0' && x < '0' + GDIM) return x - '0';
|
||||
else if(x >= 'x' && x < 'x' + GDIM) return x - 'x';
|
||||
else {
|
||||
println(hlog, "incorrect dimension ID");
|
||||
throw hr_exception();
|
||||
}
|
||||
}
|
||||
|
||||
#if CAP_COMMANDLINE
|
||||
int readArgs() {
|
||||
using namespace arg;
|
||||
@ -1112,10 +1100,6 @@ void showVertexSearch() {
|
||||
|
||||
}
|
||||
|
||||
purehookset hooks_rvmenu;
|
||||
|
||||
hookset<bool()> *hooks_rvmenu_replace;
|
||||
|
||||
void showMenu() {
|
||||
if(callhandlers(false, hooks_rvmenu_replace)) return;
|
||||
cmode = sm::SIDE | sm::MAYDARK | sm::DIALOG_STRICT_X;
|
||||
@ -1161,45 +1145,6 @@ namespace rvtour {
|
||||
|
||||
using namespace tour;
|
||||
|
||||
template<class T> function<void(presmode)> roguevizslide(char c, const T& t) {
|
||||
return [c,t] (presmode mode) {
|
||||
patterns::canvasback = 0x101010;
|
||||
setCanvas(mode, c);
|
||||
if(mode == 1 || mode == pmGeometryStart) t();
|
||||
|
||||
if(mode == 3 || mode == pmGeometry || mode == pmGeometryReset) {
|
||||
rogueviz::close();
|
||||
shmup::clearMonsters();
|
||||
if(mode == pmGeometryReset) t();
|
||||
}
|
||||
|
||||
slidecommand = "toggle the player";
|
||||
if(mode == 4)
|
||||
mapeditor::drawplayer = !mapeditor::drawplayer;
|
||||
pd_from = NULL;
|
||||
};
|
||||
}
|
||||
|
||||
template<class T, class U>
|
||||
function<void(presmode)> roguevizslide_action(char c, const T& t, const U& act) {
|
||||
return [c,t,act] (presmode mode) {
|
||||
patterns::canvasback = 0x101010;
|
||||
setCanvas(mode, c);
|
||||
if(mode == pmStart || mode == pmGeometryStart) t();
|
||||
|
||||
act(mode);
|
||||
|
||||
if(mode == pmStop || mode == pmGeometry || mode == pmGeometryReset) {
|
||||
rogueviz::close();
|
||||
shmup::clearMonsters();
|
||||
if(mode == pmGeometryReset) t();
|
||||
}
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
#define RVPATH HYPERPATH "rogueviz/"
|
||||
|
||||
vector<slide> rvslides;
|
||||
extern vector<slide> rvslides_default;
|
||||
|
||||
@ -1333,22 +1278,3 @@ auto hooks =
|
||||
0;
|
||||
|
||||
}
|
||||
|
||||
#include "kohonen.cpp"
|
||||
#include "staircase.cpp"
|
||||
#include "banachtarski.cpp"
|
||||
#include "pentagonal.cpp"
|
||||
#include "functions.cpp"
|
||||
#include "fundamental.cpp"
|
||||
#include "sunflower.cpp"
|
||||
#include "flocking.cpp"
|
||||
#include "magiccube.cpp"
|
||||
#include "cvl.cpp"
|
||||
#include "newconf.cpp"
|
||||
#include "grigorchuk.cpp"
|
||||
#include "qtm.cpp"
|
||||
#include "rewriting.cpp"
|
||||
#include "sag.cpp"
|
||||
#include "collatz.cpp"
|
||||
#include "tree.cpp"
|
||||
#include "fullnet.cpp"
|
||||
|
@ -1,4 +1,3 @@
|
||||
#include "../hyper.h"
|
||||
#include "rogueviz.h"
|
||||
|
||||
// SAG visualizer (e.g. Reddit roguelikes, GitHub languages)
|
||||
|
@ -4,6 +4,8 @@
|
||||
// Kohonen's self-organizing networks.
|
||||
// This is a part of RogueViz, not a part of HyperRogue.
|
||||
|
||||
#include "rogueviz.h"
|
||||
|
||||
namespace rogueviz { namespace staircase {
|
||||
|
||||
ld scurvature = 0;
|
||||
|
@ -6,6 +6,8 @@
|
||||
|
||||
// for spherical geometry, density is set automatically to cover the whole sphere
|
||||
|
||||
#include "rogueviz.h"
|
||||
|
||||
namespace hr {
|
||||
|
||||
namespace sunflower {
|
||||
|
Loading…
Reference in New Issue
Block a user