summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-05 20:15:34 +0000
committerennewalker <ennewalker@c06c8d41-db1a-0410-9941-cceddc491573>2008-01-05 20:15:34 +0000
commit98222630689e0dc298ec7b42a50f788edab7b9c6 (patch)
tree62c7bef9d9a43aee81f808dadb969a0a20f63dce
parentd3a0d2d064372264abf84befe6bdfe3e16382346 (diff)
downloadcrawl-ref-98222630689e0dc298ec7b42a50f788edab7b9c6.tar.gz
crawl-ref-98222630689e0dc298ec7b42a50f788edab7b9c6.zip
Adding title screen for tiles (and title_screen option.)
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3206 c06c8d41-db1a-0410-9941-cceddc491573
-rw-r--r--crawl-ref/docs/crawl_options.txt5
-rw-r--r--crawl-ref/init.txt1
-rw-r--r--crawl-ref/source/externs.h1
-rw-r--r--crawl-ref/source/initfile.cc9
-rw-r--r--crawl-ref/source/makefile.x113
-rw-r--r--crawl-ref/source/makefile_tiles.mgw3
-rw-r--r--crawl-ref/source/newgame.cc8
-rw-r--r--crawl-ref/source/rltiles/makefile.mgw8
-rw-r--r--crawl-ref/source/rltiles/makefile.unix8
-rw-r--r--crawl-ref/source/rltiles/title.bmpbin0 -> 173570 bytes
-rw-r--r--crawl-ref/source/tile2.cc29
11 files changed, 59 insertions, 16 deletions
diff --git a/crawl-ref/docs/crawl_options.txt b/crawl-ref/docs/crawl_options.txt
index 9368dfd02d..8d8bf481e7 100644
--- a/crawl-ref/docs/crawl_options.txt
+++ b/crawl-ref/docs/crawl_options.txt
@@ -1222,10 +1222,13 @@ flush.message = false
4-o Tiles Options
---------------------
show_items = <glyphs>
- This options controls the order and presence of items in the tiles
+ This option controls the order and presence of items in the tiles
inventory. By default, its value is !?/%=([)X}+\_. The underscore
represents empty slots.
+title_screen = true
+ When this is set to true, the graphical title screen will be
+ displayed.
5- Character Dump.
===================
diff --git a/crawl-ref/init.txt b/crawl-ref/init.txt
index ce7a0e60af..9789a0020e 100644
--- a/crawl-ref/init.txt
+++ b/crawl-ref/init.txt
@@ -234,6 +234,7 @@ message_colour = lightcyan:LOW MAGIC WARNING
##### 4-t Tile related Options ##################
show_items = !?/%=([)X}+\_.
+# title_screen = false
##### 5- Dump File #################################################
#
diff --git a/crawl-ref/source/externs.h b/crawl-ref/source/externs.h
index bdaa02b36f..0cc1233bae 100644
--- a/crawl-ref/source/externs.h
+++ b/crawl-ref/source/externs.h
@@ -1757,6 +1757,7 @@ public:
#ifdef USE_TILE
char show_items[20];
+ bool title_screen;
#endif
#ifdef WIN32TILES
bool use_dos_char;
diff --git a/crawl-ref/source/initfile.cc b/crawl-ref/source/initfile.cc
index d2b5421992..443d744eee 100644
--- a/crawl-ref/source/initfile.cc
+++ b/crawl-ref/source/initfile.cc
@@ -748,6 +748,7 @@ void game_options::reset_options()
#ifdef USE_TILE
show_items[0] = '0';
+ title_screen = true;
#endif
#ifdef WIN32TILES
@@ -2618,14 +2619,18 @@ void game_options::read_option_line(const std::string &str, bool runscript)
}
#ifdef USE_TILE
- else if (key == "show_items" )
+ else if (key == "show_items")
{
strncpy(show_items, field.c_str(), 18);
}
+ else if (key == "title_screen")
+ {
+ title_screen = read_bool(field, title_screen);
+ }
#endif
#ifdef WIN32TILES
- else if (key == "use_dos_char" )
+ else if (key == "use_dos_char")
{
use_dos_char = read_bool( field, use_dos_char );
}
diff --git a/crawl-ref/source/makefile.x11 b/crawl-ref/source/makefile.x11
index 4eebd58053..248ae48d98 100644
--- a/crawl-ref/source/makefile.x11
+++ b/crawl-ref/source/makefile.x11
@@ -145,7 +145,8 @@ tilep-cmt.h
TILEFILES = \
tile.png \
player.png \
- wall2d.png
+ wall2d.png \
+ title.png
DESTTILEFILES = $(TILEFILES:%=dat/tiles/%)
EXTRA_DEPENDS += $(TILEHEADERS) $(DESTTILEFILES)
diff --git a/crawl-ref/source/makefile_tiles.mgw b/crawl-ref/source/makefile_tiles.mgw
index 67c517a81d..d016543627 100644
--- a/crawl-ref/source/makefile_tiles.mgw
+++ b/crawl-ref/source/makefile_tiles.mgw
@@ -76,7 +76,8 @@ tilep-cmt.h
TILEFILES = \
tile.bmp \
player.bmp \
-wall2d.bmp
+wall2d.bmp \
+title.bmp
DESTTILEFILES = $(TILEFILES:%=dat\tiles\\%)
ifeq ($(LEX),)
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index 3da0bd96f6..6cdcc8dbc5 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -95,6 +95,7 @@
#include "spl-util.h"
#include "state.h"
#include "stuff.h"
+#include "tiles.h"
#include "tutorial.h"
#include "version.h"
#include "view.h"
@@ -2060,10 +2061,15 @@ static void give_basic_spells(job_type which_job)
// eventually, this should be something more grand {dlb}
static void openingScreen(void)
{
+#ifdef USE_TILE
+ if (Options.title_screen)
+ TileDrawTitle();
+#endif
+
std::string msg =
"<yellow>Hello, welcome to " CRAWL " " VERSION "!</yellow>" EOL
"<brown>(c) Copyright 1997-2002 Linley Henzell, "
- "2002-2007 Crawl DevTeam" EOL
+ "2002-2008 Crawl DevTeam" EOL
"Please consult crawl_manual.txt for instructions and legal details."
"</brown>" EOL;
diff --git a/crawl-ref/source/rltiles/makefile.mgw b/crawl-ref/source/rltiles/makefile.mgw
index 9d1c86be79..040110d4e7 100644
--- a/crawl-ref/source/rltiles/makefile.mgw
+++ b/crawl-ref/source/rltiles/makefile.mgw
@@ -38,11 +38,15 @@ map.htm
ALLTOOLS = $(TOOLS) $(EXTRATOOLS)
-TILEBMP = \
+GENERATEDBMP = \
tile.bmp \
player.bmp \
wall2d.bmp
+TILEBMP = \
+$(GENERATEDBMP) \
+title.bmp
+
TILEPNG = $(TILEBMP:.bmp=.png)
##########################################################################
@@ -116,6 +120,6 @@ clean:
#pushd $(B2PSRC) && $(MAKE) -f makefile.mgw clean && popd
distclean: clean
- $(DELETE) $(TILEBMP)
+ $(DELETE) $(GENERATEDBMP)
$(DELETE) $(TILEPNG)
$(DELETE) $(HEADERS)
diff --git a/crawl-ref/source/rltiles/makefile.unix b/crawl-ref/source/rltiles/makefile.unix
index 663936f90a..1fb2efe23e 100644
--- a/crawl-ref/source/rltiles/makefile.unix
+++ b/crawl-ref/source/rltiles/makefile.unix
@@ -37,11 +37,15 @@ map.htm
ALLTOOLS = $(TOOLS) $(EXTRATOOLS)
-TILEBMP = \
+GENERATEDBMP = \
tile.bmp \
player.bmp \
wall2d.bmp
+TILEBMP = \
+$(GENERATEDBMP) \
+title.bmp
+
TILEPNG = $(TILEBMP:.bmp=.png)
##########################################################################
@@ -116,6 +120,6 @@ clean:
cd $(B2PSRC) && make -f makefile.lin clean && cd ..
distclean: clean
- $(DELETE) $(TILEBMP)
+ $(DELETE) $(GENERATEDBMP)
$(DELETE) $(TILEPNG)
$(DELETE) $(HEADERS)
diff --git a/crawl-ref/source/rltiles/title.bmp b/crawl-ref/source/rltiles/title.bmp
new file mode 100644
index 0000000000..2746a47aa1
--- /dev/null
+++ b/crawl-ref/source/rltiles/title.bmp
Binary files differ
diff --git a/crawl-ref/source/tile2.cc b/crawl-ref/source/tile2.cc
index ada84c255a..aa8b34a242 100644
--- a/crawl-ref/source/tile2.cc
+++ b/crawl-ref/source/tile2.cc
@@ -2692,15 +2692,26 @@ int TileMcacheFind(int mon_tile, int equ_tile, int draco)
void TileDrawTitle()
{
- int winx, winy, tx, ty, x, y;
img_type TitleImg = ImgLoadFileSimple("title");
+ if (!TitleImg)
+ return;
+
+ // We don't need an entirely separate region for the title, so
+ // just resize the tile region to fit the screen temporarily.
+ int old_mx = region_tile->mx;
+ int old_my = region_tile->my;
+ int old_dx = region_tile->dx;
+ int old_dy = region_tile->dy;
+ int winx = win_main->wx;
+ int winy = win_main->wy;
+ region_tile->resize(winx, winy, 1, 1);
+ region_tile->resize_backbuf();
img_type pBuf = region_tile->backbuf;
- if (!TitleImg || !pBuf) return;
- tx = ImgWidth(TitleImg);
- ty = ImgHeight(TitleImg);
- winx = ImgWidth(pBuf);
- winy = ImgHeight(pBuf);
+ int tx = ImgWidth(TitleImg);
+ int ty = ImgHeight(TitleImg);
+
+ int x, y;
if (tx > winx)
{
@@ -2726,6 +2737,12 @@ void TileDrawTitle()
region_tile->make_active();
region_tile->redraw();
ImgDestroy(TitleImg);
+
+ getch();
+ clrscr();
+
+ region_tile->resize(old_mx, old_my, old_dx, old_dy);
+ region_tile->resize_backbuf();
}
static void TilePutch(int c, img_type Dest, int dx, int dy)