summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-02 11:22:14 +0000
committerdshaligram <dshaligram@c06c8d41-db1a-0410-9941-cceddc491573>2007-12-02 11:22:14 +0000
commit1b295e9069c68d4eb0ce96b3155aeaf31ddf02eb (patch)
tree3d6061af13fcf2e056a38d2f42b511e3d55f40e7
parente367869da9f95861d50de188f92adb853f7a5c9f (diff)
downloadcrawl-ref-1b295e9069c68d4eb0ce96b3155aeaf31ddf02eb.tar.gz
crawl-ref-1b295e9069c68d4eb0ce96b3155aeaf31ddf02eb.zip
Trunk->0.3 merge (2964-2965): Fixed MinGW makefile, cleaned up data file lookup.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.3@2966 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/INSTALL47
-rw-r--r--crawl-ref/docs/crawl_options.txt4
-rw-r--r--crawl-ref/init.txt4
-rw-r--r--crawl-ref/source/files.cc16
-rw-r--r--crawl-ref/source/makefile.mgw2
5 files changed, 63 insertions, 10 deletions
diff --git a/crawl-ref/INSTALL b/crawl-ref/INSTALL
index 32a4304674..df5f4b78b9 100644
--- a/crawl-ref/INSTALL
+++ b/crawl-ref/INSTALL
@@ -1,6 +1,6 @@
Install instructions for Dungeon Crawl Stone Soup (DCSS)
--------------------------------------------------------
-(Last updated on 20071030 for Dungeon Crawl Stone Soup 0.3.)
+(Last updated on 20071202 for Dungeon Crawl Stone Soup 0.3.3.)
Building Dungeon Crawl Stone Soup
---------------------------------
@@ -78,7 +78,9 @@ MAKEFILE=makefile.mgw to build with MinGW for Windows (# is used for
comments in makefiles).
Consult the operating-system specific sections for detailed
-information on building Crawl.
+information on building Crawl. When you're done building Crawl, look
+at the section "Data files" for important information on what files
+Crawl needs as it starts up.
Building on Unix (Linux, *BSD, Solaris, etc.)
@@ -216,7 +218,7 @@ binary will run on 9x), or build a DOS binary.
* cd to the the Crawl source directory.
* Build Crawl by running
- mingw32-make MAKEFILE=makefile.mgw
+ mingw32-make MAKEFILE=makefile.mgw install
* If you want regular expression support, you can edit AppHdr.h and
uncomment this line:
@@ -225,12 +227,12 @@ binary will run on 9x), or build a DOS binary.
- find the one in the Windows-specific section. Also see the section
below on obtaining the pcre library to link against.
-* If you have flex and bison, edit makefile.mgw and set DOYACC := y.
-
* If you enabled REGEX_PCRE, add -lpcre to the LIB line in makefile.mgw as:
LIB = -lpcre -static -lwinmm -L$(LUASRC) -l$(LUALIB) -L$(SQLSRC) -l$(SQLLIB)
and build Crawl to include regex support.
+* If you have flex and bison, edit makefile.mgw and set DOYACC := y.
+
* When you're done, you should have crawl.exe under a "rel"
subdirectory.
@@ -281,6 +283,41 @@ Building for DOS (djgpp)
* When the build is done, crawl.exe should be in the source directory.
*****************************************************************************
+Data files
+----------
+
+Crawl looks for several data files when starting up. They include:
+
+* Special level and vault layout (dat/*.des) files.
+* Core Lua code (dat/clua/*.lua).
+* Descriptions for monsters and game features (dat/descript/*.txt).
+* Monster dialogue files (dat/*.txt).
+
+All these files are in the source tree under source/dat.
+
+Crawl will also look for documentation files when players invoke the
+help system. These files are available under the docs directory.
+
+Your built Crawl binary must be able to find these files, or it will
+not start.
+
+If Crawl is built without an explicit DATA_DIR_PATH (this is the most
+common setup), it will search for its data files under the current
+directory, and if it can't find them there, one level above the
+current directory. In short, it uses these search paths: ., ./dat,
+./docs, .., ../dat, ../docs.
+
+If Crawl is built with an explicit DATA_DIR_PATH (for multiuser
+installs on Unix), it will look for its startup files strictly under
+that directory: $DIR, $DIR/dat, $DIR/docs.
+
+As Crawl loads its startup files, it will convert them to a binary
+format (so that future startups will be faster) and store these binary
+files in the saves directory. These binary files (with extensions .db,
+.dsc, .idx, .lk) can be safely deleted as long as there is no running
+Crawl, and they will be regenerated the next time Crawl starts.
+
+*****************************************************************************
The level compiler
------------------
diff --git a/crawl-ref/docs/crawl_options.txt b/crawl-ref/docs/crawl_options.txt
index 7ff415d19c..6a9306f424 100644
--- a/crawl-ref/docs/crawl_options.txt
+++ b/crawl-ref/docs/crawl_options.txt
@@ -723,9 +723,9 @@ stash_tracking = (all | explicit | dropped)
stash_filter = <list of numbers>
This option allows filtering certain classes of items when searching
- stashes. For example,
+ stashes. For example,
stash_filter = 14, 4:21
- filters corpses (14) as well as food of the subtype chunks (4:21).
+ filters corpses (14) as well as food of the subtype chunks (4:21).
annotate_item_class = false
This only works if stash.lua has been sourced already in init.txt.
diff --git a/crawl-ref/init.txt b/crawl-ref/init.txt
index d3058c3b07..3dbe21e4d2 100644
--- a/crawl-ref/init.txt
+++ b/crawl-ref/init.txt
@@ -136,8 +136,8 @@ stab_brand = hi:blue
# The following options are not default. Uncommenting activates them.
#
-# stop_travel = Something appears
-# stop_travel = god:wrath finds you
+# travel_stop_message = Something appears
+# travel_stop_message = god:wrath finds you
# runrest_ignore_message = prayer ends
# runrest_ignore_message = You feel.*sick
# runrest_ignore_poison = 4:100
diff --git a/crawl-ref/source/files.cc b/crawl-ref/source/files.cc
index 48885321ad..85141bc82c 100644
--- a/crawl-ref/source/files.cc
+++ b/crawl-ref/source/files.cc
@@ -47,7 +47,6 @@
#ifdef __MINGW32__
#include <io.h>
-#include <sys/types.h>
#endif
#include <sys/types.h>
@@ -91,6 +90,12 @@
#include "tutorial.h"
#include "view.h"
+#ifndef HAVE_STAT
+#if defined(UNIX) || defined(__MINGW32__) || defined(DOS)
+#define HAVE_STAT
+#endif
+#endif
+
void save_level(int level_saved, level_area_type lt,
branch_type where_were_you);
@@ -286,11 +291,17 @@ void check_newer(const std::string &target,
static bool file_exists(const std::string &name)
{
+#ifdef HAVE_STAT
+ struct stat st;
+ const int err = ::stat(name.c_str(), &st);
+ return (!err);
+#else
FILE *f = fopen(name.c_str(), "r");
const bool exists = !!f;
if (f)
fclose(f);
return (exists);
+#endif
}
// Low-tech existence check.
@@ -367,8 +378,11 @@ std::string datafile_path(std::string basename,
const std::string prefixes[] = {
std::string("dat") + FILE_SEPARATOR,
std::string("docs") + FILE_SEPARATOR,
+#ifndef DATA_DIR_PATH
std::string("..") + FILE_SEPARATOR + "docs" + FILE_SEPARATOR,
+ std::string("..") + FILE_SEPARATOR + "dat" + FILE_SEPARATOR,
std::string("..") + FILE_SEPARATOR,
+#endif
std::string(".") + FILE_SEPARATOR,
"",
};
diff --git a/crawl-ref/source/makefile.mgw b/crawl-ref/source/makefile.mgw
index 58a48d662d..623b94c46c 100644
--- a/crawl-ref/source/makefile.mgw
+++ b/crawl-ref/source/makefile.mgw
@@ -126,9 +126,11 @@ ifneq ($(OPATH),$(INSTALLDIR))
endif
mkdir $(INSTALLDIR)\dat 2>nul || echo "" >nul
mkdir $(INSTALLDIR)\dat\clua 2>null || echo "">nul
+ mkdir $(INSTALLDIR)\dat\descript 2>null || echo "">nul
copy /y dat\*.des $(INSTALLDIR)\dat
copy /y dat\*.txt $(INSTALLDIR)\dat
copy /y dat\clua\*.lua $(INSTALLDIR)\dat\clua
+ copy /y dat\descript\*.txt $(INSTALLDIR)\dat\descript
copy /y ..\init.txt $(INSTALLDIR)
clean: