From 40baf6a7321fbe1ad3385f7b090abd3535b8bf29 Mon Sep 17 00:00:00 2001 From: ennewalker Date: Sat, 19 Apr 2008 01:41:37 +0000 Subject: [1941246] Cleaning up wininit.txt issues: Crawl no longer croaks when not finding the file. Deleted file from repository for the sake of convenience. Fixed default sizes so that &~ no longer wraps strangely. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@4353 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/libgui.cc | 34 ++++++++++++++++------------------ crawl-ref/source/tile2.cc | 1 - crawl-ref/wininit.txt | 30 ------------------------------ 3 files changed, 16 insertions(+), 49 deletions(-) delete mode 100644 crawl-ref/wininit.txt (limited to 'crawl-ref') diff --git a/crawl-ref/source/libgui.cc b/crawl-ref/source/libgui.cc index 75f71a3e21..a7a4734963 100644 --- a/crawl-ref/source/libgui.cc +++ b/crawl-ref/source/libgui.cc @@ -77,7 +77,7 @@ TileRegionClass *region_item = NULL; TileRegionClass *region_item2 = NULL; // Raw tile images -img_type TileImg, TileIsoImg; +img_type TileImg; img_type PlayerImg; img_type WallImg; @@ -96,15 +96,15 @@ static bool gui_smart_cursor = false; // Window prefs static int crt_x = 80; static int crt_y = 30; -static int map_px = 3; -static int msg_x = 80, msg_y = 8; -static int dngn_x = 17, dngn_y = 17; +static int map_px = 4; +static int msg_x = 77, msg_y = 10; +static int dngn_x = 19, dngn_y = 17; static int winox = 0, winoy = 0; #define MAX_PREF_CHAR 256 #ifdef USE_X11 #define UseDosChar false -static char font_name[MAX_PREF_CHAR+1] = "8x16"; +static char font_name[MAX_PREF_CHAR+1] = "8x13"; #endif #ifdef WIN32TILES @@ -116,12 +116,9 @@ static int dos_font_size = 16; static int font_size = 12; -#define PREF_MODE_TEXT 0 -#define PREF_MODE_TILE 1 -#define PREF_MODE_ISO 2 -#define PREF_MODE_NUM 3 -static const char *pref_mode_name[PREF_MODE_NUM] - = { "Text", "Tile", "Iso"}; +#define PREF_MODE_TILE 0 +#define PREF_MODE_NUM 1 +static const char *pref_mode_name[PREF_MODE_NUM] = { "Tile"}; typedef struct prefs { @@ -151,11 +148,11 @@ struct prefs pref_data[MAX_PREFS] = {"MSG Y ", "MsgY", 'I', &msg_y, 8, 20, 4}, {"WIN TOP ", "WindowTop", 'I', &winox, -100, 2000, 5}, {"WIN LEFT ", "WindowLeft",'I', &winoy, -100, 2000, 6}, - {"FONT ", "FontName", 'S', font_name, 0,0, 0}, - {"FONT SIZE", "FontSize", 'I', &font_size, 8,24, 7} + {"FONT ", "FontName", 'S', font_name, 0, 0, 0}, + {"FONT SIZE", "FontSize", 'I', &font_size, 8, 24, 7} #ifdef WIN32TILES - ,{"DOS FONT", "DosFontName", 'S', dos_font_name, 0,0, 1}, - {"DOS FONT SIZE", "DosFontSize", 'I', &dos_font_size, 8,24, 8} + ,{"DOS FONT", "DosFontName", 'S', dos_font_name, 0, 0, 1}, + {"DOS FONT SIZE", "DosFontSize", 'I', &dos_font_size, 8, 24, 8} #endif }; @@ -688,8 +685,6 @@ void libgui_shutdown() ImgDestroy(PlayerImg); if (WallImg) ImgDestroy(WallImg); - if (TileIsoImg) - ImgDestroy(TileIsoImg); // do this before delete win_main _libgui_save_prefs(); @@ -729,7 +724,7 @@ static void _libgui_load_prefs() } const char *baseTxt = "wininit.txt"; - std::string winTxtString = datafile_path(baseTxt, true, true); + std::string winTxtString = datafile_path(baseTxt, false, true); const char *winTxt = winTxtString.c_str()[0] == 0 ? baseTxt : winTxtString.c_str(); @@ -783,6 +778,9 @@ static void _libgui_save_prefs() int i, mode; FILE *fp; + if (!win_main) + return; + winox = win_main->ox; winoy = win_main->oy; #ifdef WIN32TILES diff --git a/crawl-ref/source/tile2.cc b/crawl-ref/source/tile2.cc index a2522d2f6f..5688f14d68 100644 --- a/crawl-ref/source/tile2.cc +++ b/crawl-ref/source/tile2.cc @@ -38,7 +38,6 @@ extern void TileDrawDungeonAux(); // Raw tile images extern img_type TileImg; -extern img_type TileIsoImg; extern img_type PlayerImg; extern img_type WallImg; extern img_type ScrBufImg; diff --git a/crawl-ref/wininit.txt b/crawl-ref/wininit.txt deleted file mode 100644 index 56465c2cc6..0000000000 --- a/crawl-ref/wininit.txt +++ /dev/null @@ -1,30 +0,0 @@ -Text:DngnX=19 -Text:DngnY=17 -Text:MapPx=4 -Text:MsgX=73 -Text:MsgY=10 -Text:WindowTop=54 -Text:WindowLeft=121 -Text:FontName=8x13 -Text:FontSize=19 - -Tile:DngnX=19 -Tile:DngnY=17 -Tile:MapPx=4 -Tile:MsgX=73 -Tile:MsgY=10 -Tile:WindowTop=64 -Tile:WindowLeft=273 -Tile:FontName=8x13 -Tile:FontSize=16 - -Iso:DngnX=17 -Iso:DngnY=17 -Iso:MapPx=1 -Iso:MsgX=40 -Iso:MsgY=8 -Iso:WindowTop=10 -Iso:WindowLeft=73 -Iso:FontName=8x16 -Iso:FontSize=24 - -- cgit v1.2.3-54-g00ecf