mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-24 17:10:36 +00:00
allow setting the resource dir; autoconf should move *.dat file to resource dir
This commit is contained in:
parent
61e249a3af
commit
bf83959b4a
@ -1,9 +1,9 @@
|
||||
bin_PROGRAMS = hyperrogue
|
||||
hyperroguedir = $(datadir)/hyperrogue
|
||||
hyperrogue_SOURCES = hyper.cpp savepng.cpp
|
||||
hyperrogue_CPPFLAGS = -DFONTDESTDIR=\"$(pkgdatadir)/DejaVuSans-Bold.ttf\" -DMUSICDESTDIR=\"$(pkgdatadir)/hyperrogue-music.txt\" -DSOUNDDESTDIR=\"$(pkgdatadir)/sounds/\"
|
||||
hyperrogue_CPPFLAGS = -DFONTDESTDIR=\"$(pkgdatadir)/DejaVuSans-Bold.ttf\" -DMUSICDESTDIR=\"$(pkgdatadir)/hyperrogue-music.txt\" -DSOUNDDESTDIR=\"$(pkgdatadir)/sounds/\" -DRESOURCEDESTDIR=\"$(pkgdatadir)/\"
|
||||
hyperrogue_CXXFLAGS = -O2 -std=c++11 ${AM_CXXFLAGS}
|
||||
dist_hyperrogue_DATA = hyperrogue-music.txt DejaVuSans-Bold.ttf
|
||||
dist_hyperrogue_DATA = hyperrogue-music.txt DejaVuSans-Bold.ttf solv-geodesics.dat shyp-geodesics.dat ssol-geodesics.dat honeycomb-435.dat honeycomb-534.dat honeycomb-535.dat
|
||||
|
||||
# docdir
|
||||
dist_doc_DATA = README.md
|
||||
|
@ -8,6 +8,14 @@
|
||||
#include "hyper.h"
|
||||
namespace hr {
|
||||
|
||||
#ifdef RESOURCEDESTDIR
|
||||
EX string rsrcdir = RESOURCEDESTDIR;
|
||||
#endif
|
||||
|
||||
#ifndef RESOURCEDESTDIR
|
||||
EX string rsrcdir = "";
|
||||
#endif
|
||||
|
||||
#if CAP_COMMANDLINE
|
||||
EX const char *scorefile = "hyperrogue.log";
|
||||
|
||||
@ -142,6 +150,7 @@ int arg::readCommon() {
|
||||
// first phase options
|
||||
|
||||
if(argis("-s")) { PHASE(1); shift(); scorefile = argcs(); }
|
||||
else if(argis("-rsrc")) { PHASE(1); shift(); rsrcdir = args(); }
|
||||
else if(argis("-nogui")) { PHASE(1); noGUI = true; }
|
||||
#ifndef EMSCRIPTEN
|
||||
else if(argis("-font")) { PHASE(1); shift(); fontpath = args(); }
|
||||
|
@ -85,7 +85,7 @@ EX namespace sn {
|
||||
void tabled_inverses::load() {
|
||||
if(loaded) return;
|
||||
FILE *f = fopen(fname.c_str(), "rb");
|
||||
// if(!f) f = fopen("/usr/lib/soltable.dat", "rb");
|
||||
if(!f) f = fopen((rsrcdir + fname).c_str(), "rb");
|
||||
if(!f) { addMessage(XLAT("geodesic table missing")); pmodel = mdPerspective; return; }
|
||||
ignore(fread(&PRECX, 4, 1, f));
|
||||
ignore(fread(&PRECY, 4, 1, f));
|
||||
|
Loading…
Reference in New Issue
Block a user