From 05345016f1c62fbd02e3eb8302f1798ccdb425e9 Mon Sep 17 00:00:00 2001 From: peterb12 Date: Tue, 17 Apr 2007 15:00:59 +0000 Subject: First cut at db/flat text file based descriptions. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1331 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/describe.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/describe.cc') diff --git a/crawl-ref/source/describe.cc b/crawl-ref/source/describe.cc index a7ea81c9e2..6b5612148a 100644 --- a/crawl-ref/source/describe.cc +++ b/crawl-ref/source/describe.cc @@ -20,6 +20,7 @@ #include "AppHdr.h" #include "describe.h" +#include "database.h" #include #include @@ -109,6 +110,15 @@ static void print_description( const std::string &d ) continue; } + // Handle real line breaks. No substitutions necessary, just update + // the counts. + nextLine = d.find('\n', currentPos); + if (nextLine >= currentPos && nextLine < currentPos + lineWidth) { + cprintf("%s", (d.substr(currentPos, nextLine - currentPos)).c_str()); + currentPos = nextLine +1; + continue; + } + if (nextLine == std::string::npos) nlSearch = false; // there are no newlines, don't search again. } @@ -4608,7 +4618,7 @@ void describe_monsters(int class_described, unsigned char which_mons) // than what we have today. // // -peterb 4/14/07 - description += mons_longDesc(menv[which_mons].type); + description += (std::string)getLongDescription(ptr_monam(&mons, DESC_PLAIN)); // Now that the player has examined it, he knows it's a mimic. if (mons_is_mimic(mons.type)) -- cgit v1.2.3-54-g00ecf