// Hyperbolic Rogue // Copyright (C) 2011 Zeno Rogue // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // as published by the Free Software Foundation; either version 2 // of the License, or (at your option) any later version. // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifdef LOCAL #define CDATA #endif #define VER "8.3j" #define VERNUM 8310 #define VERNUM_HEX 0x8310 #define ISANDROID 0 #define ISMOBILE 0 #define ISIOS 0 #include #include #ifndef MAC #undef main #endif #include #include #include #include #include #include using namespace std; FILE *debugfile; int debugflags; const char *scorefile = "hyperrogue.log"; const char *conffile = "hyperrogue.ini"; string levelfile = "hyperrogue.lev"; string picfile = "hyperrogue.pic"; const char *loadlevel = NULL; const char *musicfile = ""; #ifdef LINUX #include void moreStack() { const rlim_t kStackSize = 1 << 28; // 28; struct rlimit rl; int result; result = getrlimit(RLIMIT_STACK, &rl); if(result == 0) { if(rl.rlim_cur < kStackSize) { // rl.rlim_cur = 1 << 19; // kStackSize; result = setrlimit(RLIMIT_STACK, &rl); if (result != 0) { fprintf(stderr, "setrlimit returned result = %d\n", result); } } } } #endif string s0; void addMessage(string s, char spamtype = 0); int clWidth, clHeight, clFont; string commandline; #include "hyperpoint.cpp" #include "patterns.cpp" #include "heptagon.cpp" #include "classes.cpp" #include "language.cpp" #ifdef STEAM #define NOLICENSE #endif #include "hyper.h" #include "cell.cpp" #include "flags.cpp" #include "yendor.cpp" #include "complex.cpp" #include "game.cpp" #include "landgen.cpp" #include "orbs.cpp" #include "system.cpp" // #include "patterngen.cpp" #include "geometry.cpp" #include "polygons.cpp" #ifndef MOBILE #include "mapeditor.cpp" #endif #include "netgen.cpp" #include "graph.cpp" #include "achievement.cpp" #include int main(int argc, char **argv) { #ifdef LINUX moreStack(); #endif printf("HyperRogue by Zeno Rogue , version " VER "\n"); #ifndef NOLICENSE printf("released under GNU General Public License version 2 and thus\n"); printf("comes with absolutely no warranty; see COPYING for details\n"); #endif // printf("cell size = %d\n", int(sizeof(cell))); srand(time(NULL)); shrand(time(NULL)); #ifdef FHS char sbuf[640], cbuf[640]; if(getenv("HOME")) { snprintf(sbuf, 640, "%s/.%s", getenv("HOME"), scorefile); scorefile = sbuf; snprintf(cbuf, 640, "%s/.%s", getenv("HOME"), conffile); conffile = cbuf; } #endif for(int i=1; i