From 9b9c7205bf7c2fb6b80204a5d376d0fe2121780a Mon Sep 17 00:00:00 2001 From: danij Date: Sun, 29 Jan 2012 19:51:40 +0000 Subject: [PATCH] Automap|Added: Console variable map-line-width - scale factor for lines Also added map-line-opacity as an alias for the older map-alpha-lines --- doomsday/plugins/common/include/hu_automap.h | 1 - doomsday/plugins/common/src/hu_automap.c | 8 ++++++-- doomsday/plugins/common/src/hu_menu.c | 6 +++++- doomsday/plugins/jdoom/data/conhelp.txt | 7 +++++-- doomsday/plugins/jdoom/include/d_config.h | 1 + doomsday/plugins/jdoom/src/d_main.c | 1 + doomsday/plugins/jdoom64/data/conhelp.txt | 7 +++++-- doomsday/plugins/jdoom64/include/d_config.h | 1 + doomsday/plugins/jdoom64/src/d_main.c | 1 + doomsday/plugins/jheretic/data/conhelp.txt | 7 +++++-- doomsday/plugins/jheretic/include/h_config.h | 1 + doomsday/plugins/jheretic/src/h_main.c | 1 + doomsday/plugins/jhexen/data/conhelp.txt | 7 +++++-- doomsday/plugins/jhexen/include/x_config.h | 1 + doomsday/plugins/jhexen/src/h2_main.c | 1 + 15 files changed, 39 insertions(+), 12 deletions(-) diff --git a/doomsday/plugins/common/include/hu_automap.h b/doomsday/plugins/common/include/hu_automap.h index e9f087df94..9a135046e5 100644 --- a/doomsday/plugins/common/include/hu_automap.h +++ b/doomsday/plugins/common/include/hu_automap.h @@ -32,7 +32,6 @@ #include "hu_lib.h" #define MAX_MAP_POINTS (10) -#define AM_LINE_WIDTH (1.1f) ///< In fixed 320x200 pixels /// To be called to register the console commands and variables of this module. void UIAutomap_Register(void); diff --git a/doomsday/plugins/common/src/hu_automap.c b/doomsday/plugins/common/src/hu_automap.c index 57da4b984b..49799ef901 100644 --- a/doomsday/plugins/common/src/hu_automap.c +++ b/doomsday/plugins/common/src/hu_automap.c @@ -94,7 +94,6 @@ void UIAutomap_Register(void) { cvartemplate_t cvars[] = { { "map-opacity", 0, CVT_FLOAT, &cfg.automapOpacity, 0, 1 }, - { "map-alpha-lines", 0, CVT_FLOAT, &cfg.automapLineAlpha, 0, 1 }, #if __JDOOM__ || __JHERETIC__ || __JDOOM64__ { "map-babykeys", 0, CVT_BYTE, &cfg.automapBabyKeys, 0, 1 }, #endif @@ -102,6 +101,8 @@ void UIAutomap_Register(void) { "map-background-g", 0, CVT_FLOAT, &cfg.automapBack[1], 0, 1 }, { "map-background-b", 0, CVT_FLOAT, &cfg.automapBack[2], 0, 1 }, { "map-customcolors", 0, CVT_INT, &cfg.automapCustomColors, 0, 1 }, + { "map-line-opacity", 0, CVT_FLOAT, &cfg.automapLineAlpha, 0, 1 }, + { "map-line-width", 0, CVT_FLOAT, &cfg.automapLineWidth, .1f, 2 }, { "map-mobj-r", 0, CVT_FLOAT, &cfg.automapMobj[0], 0, 1 }, { "map-mobj-g", 0, CVT_FLOAT, &cfg.automapMobj[1], 0, 1 }, { "map-mobj-b", 0, CVT_FLOAT, &cfg.automapMobj[2], 0, 1 }, @@ -126,6 +127,9 @@ void UIAutomap_Register(void) { "map-zoom-speed", 0, CVT_FLOAT, &cfg.automapZoomSpeed, 0, 1 }, { "map-open-timer", CVF_NO_MAX, CVT_FLOAT, &cfg.automapOpenSeconds, 0, 0 }, { "rend-dev-freeze-map", CVF_NO_ARCHIVE, CVT_BYTE, &freezeMapRLs, 0, 1 }, + + // Aliases for old names: + { "map-alpha-lines", 0, CVT_FLOAT, &cfg.automapLineAlpha, 0, 1 }, { NULL } }; Con_AddVariableList(cvars); @@ -1420,7 +1424,7 @@ void UIAutomap_Drawer(uiwidget_t* obj, const Point2Raw* offset) DGL_Translatef(-vx, -vy, 0); oldLineWidth = DGL_GetFloat(DGL_LINE_WIDTH); - DGL_SetFloat(DGL_LINE_WIDTH, AM_LINE_WIDTH * aspectScale); + DGL_SetFloat(DGL_LINE_WIDTH, MAX_OF(.5f, cfg.automapLineWidth * aspectScale)); /*#if _DEBUG { // Draw the rectangle described by the visible bounds. diff --git a/doomsday/plugins/common/src/hu_menu.c b/doomsday/plugins/common/src/hu_menu.c index 24beb63b46..d140386c29 100644 --- a/doomsday/plugins/common/src/hu_menu.c +++ b/doomsday/plugins/common/src/hu_menu.c @@ -913,7 +913,8 @@ static mn_object_t WeaponMenuObjects[] = { }; mndata_slider_t sld_map_opacity = { 0, 1, 0, 0.1f, true, "map-opacity" }; -mndata_slider_t sld_map_lineopacity = { 0, 1, 0, 0.1f, true, "map-alpha-lines" }; +mndata_slider_t sld_map_lineopacity = { 0, 1, 0, 0.1f, true, "map-line-opacity" }; +mndata_slider_t sld_map_linewidth = { .1f, 2, 0, 0.1f, true, "map-line-width" }; mndata_slider_t sld_map_doorglow = { 0, 200, 0, 5, true, "map-door-glow" }; mndata_listitem_t lstit_map_statusbar[] = { @@ -961,6 +962,7 @@ mndata_colorbox_t cbox_map_background_color = { mndata_text_t txt_map_opacity = { "Background Opacity" }; mndata_text_t txt_map_line_opacity = { "Line Opacity" }; +mndata_text_t txt_map_line_width = { "Line Width" }; mndata_text_t txt_map_hud_display = { "HUD Display" }; mndata_text_t txt_map_door_colors = { "Door Colors" }; mndata_text_t txt_map_door_glow = { "Door Glow" }; @@ -979,6 +981,8 @@ mn_object_t AutomapMenuObjects[] = { { MN_SLIDER, 0, 0, 'o', MENU_FONT1, MENU_COLOR1, MNSlider_UpdateGeometry, MNSlider_Drawer, { Hu_MenuCvarSlider, NULL, NULL, NULL, NULL, Hu_MenuDefaultFocusAction }, MNSlider_CommandResponder, NULL, NULL, &sld_map_opacity }, { MN_TEXT, 0, 0, 0, MENU_FONT1, MENU_COLOR1, MNText_UpdateGeometry, MNText_Drawer, { NULL }, NULL, NULL, NULL, &txt_map_line_opacity }, { MN_SLIDER, 0, 0, 'l', MENU_FONT1, MENU_COLOR1, MNSlider_UpdateGeometry, MNSlider_Drawer, { Hu_MenuCvarSlider, NULL, NULL, NULL, NULL, Hu_MenuDefaultFocusAction }, MNSlider_CommandResponder, NULL, NULL, &sld_map_lineopacity }, + { MN_TEXT, 0, 0, 0, MENU_FONT1, MENU_COLOR1, MNText_UpdateGeometry, MNText_Drawer, { NULL }, NULL, NULL, NULL, &txt_map_line_width }, + { MN_SLIDER, 0, 0, 0, MENU_FONT1, MENU_COLOR1, MNSlider_UpdateGeometry, MNSlider_Drawer, { Hu_MenuCvarSlider, NULL, NULL, NULL, NULL, Hu_MenuDefaultFocusAction }, MNSlider_CommandResponder, NULL, NULL, &sld_map_linewidth }, { MN_TEXT, 0, 0, 0, MENU_FONT1, MENU_COLOR1, MNText_UpdateGeometry, MNText_Drawer, { NULL }, NULL, NULL, NULL, &txt_map_hud_display }, { MN_LISTINLINE, 0, 0, 'h', MENU_FONT1, MENU_COLOR3, MNListInline_UpdateGeometry, MNListInline_Drawer, { Hu_MenuCvarList, NULL, NULL, NULL, NULL, Hu_MenuDefaultFocusAction }, MNListInline_CommandResponder, NULL, NULL, &lst_map_statusbar }, { MN_TEXT, 0, 0, 0, MENU_FONT1, MENU_COLOR1, MNText_UpdateGeometry, MNText_Drawer, { NULL }, NULL, NULL, NULL, &txt_map_door_colors }, diff --git a/doomsday/plugins/jdoom/data/conhelp.txt b/doomsday/plugins/jdoom/data/conhelp.txt index 8184e064b3..f714e70c58 100644 --- a/doomsday/plugins/jdoom/data/conhelp.txt +++ b/doomsday/plugins/jdoom/data/conhelp.txt @@ -455,8 +455,11 @@ desc = Chat macro 9. [chat-macro9] desc = Chat macro 10. -[map-alpha-lines] -desc = Alpha level of automap lines. +[map-line-opacity] +desc = Opacity of automap lines (default: .7). + +[map-line-width] +desc = Scale factor for automap lines (default: 1.1). [map-babykeys] desc = 1=Show keys in automap (easy skill mode only). diff --git a/doomsday/plugins/jdoom/include/d_config.h b/doomsday/plugins/jdoom/include/d_config.h index 3566cdab4c..b113a5f115 100644 --- a/doomsday/plugins/jdoom/include/d_config.h +++ b/doomsday/plugins/jdoom/include/d_config.h @@ -179,6 +179,7 @@ typedef struct jdoom_config_s { float automapBack[3]; float automapOpacity; float automapLineAlpha; + float automapLineWidth; ///< In fixed 320x200 pixels. byte automapRotate; int automapHudDisplay; int automapCustomColors; diff --git a/doomsday/plugins/jdoom/src/d_main.c b/doomsday/plugins/jdoom/src/d_main.c index 5fe5fd0577..ed80452ef5 100644 --- a/doomsday/plugins/jdoom/src/d_main.c +++ b/doomsday/plugins/jdoom/src/d_main.c @@ -362,6 +362,7 @@ void D_PreInit(void) cfg.automapBack[2] = 0.f; cfg.automapOpacity = .7f; cfg.automapLineAlpha = .7f; + cfg.automapLineWidth = 1.1f; cfg.automapShowDoors = true; cfg.automapDoorGlow = 8; cfg.automapHudDisplay = 2; diff --git a/doomsday/plugins/jdoom64/data/conhelp.txt b/doomsday/plugins/jdoom64/data/conhelp.txt index 58d5d50f63..7930dff91a 100644 --- a/doomsday/plugins/jdoom64/data/conhelp.txt +++ b/doomsday/plugins/jdoom64/data/conhelp.txt @@ -457,8 +457,11 @@ desc = Chat macro 9. [chat-macro9] desc = Chat macro 10. -[map-alpha-lines] -desc = Alpha level of automap lines. +[map-line-opacity] +desc = Opacity of automap lines (default: .7). + +[map-line-width] +desc = Scale factor for automap lines (default: 1.1). [map-babykeys] desc = 1=Show keys in automap (easy skill mode only). diff --git a/doomsday/plugins/jdoom64/include/d_config.h b/doomsday/plugins/jdoom64/include/d_config.h index 7d2818abcf..1bf0166722 100644 --- a/doomsday/plugins/jdoom64/include/d_config.h +++ b/doomsday/plugins/jdoom64/include/d_config.h @@ -174,6 +174,7 @@ typedef struct jdoom64_config_s { float automapBack[3]; float automapOpacity; float automapLineAlpha; + float automapLineWidth; ///< In fixed 320x200 pixels. byte automapRotate; int automapHudDisplay; int automapCustomColors; diff --git a/doomsday/plugins/jdoom64/src/d_main.c b/doomsday/plugins/jdoom64/src/d_main.c index cca99f546a..f02db7c1e9 100644 --- a/doomsday/plugins/jdoom64/src/d_main.c +++ b/doomsday/plugins/jdoom64/src/d_main.c @@ -298,6 +298,7 @@ void D_PreInit(void) cfg.automapBack[2] = 0.f; cfg.automapOpacity = .7f; cfg.automapLineAlpha = .7f; + cfg.automapLineWidth = 1.1f; cfg.automapShowDoors = true; cfg.automapDoorGlow = 8; cfg.automapHudDisplay = 2; diff --git a/doomsday/plugins/jheretic/data/conhelp.txt b/doomsday/plugins/jheretic/data/conhelp.txt index f85e9fce34..31d07b7b1b 100644 --- a/doomsday/plugins/jheretic/data/conhelp.txt +++ b/doomsday/plugins/jheretic/data/conhelp.txt @@ -485,8 +485,11 @@ desc = Chat macro 9. [chat-macro9] desc = Chat macro 10. -[map-alpha-lines] -desc = Alpha level of automap lines. +[map-line-opacity] +desc = Opacity of automap lines (default: .7). + +[map-line-width] +desc = Scale factor for automap lines (default: 1.1). [map-babykeys] desc = 1=Show keys in automap (easy skill mode only). diff --git a/doomsday/plugins/jheretic/include/h_config.h b/doomsday/plugins/jheretic/include/h_config.h index e83d52e14e..0987a538f5 100644 --- a/doomsday/plugins/jheretic/include/h_config.h +++ b/doomsday/plugins/jheretic/include/h_config.h @@ -176,6 +176,7 @@ typedef struct jheretic_config_s { float automapBack[3]; float automapOpacity; float automapLineAlpha; + float automapLineWidth; ///< In fixed 320x200 pixels. byte automapRotate; int automapHudDisplay; int automapCustomColors; diff --git a/doomsday/plugins/jheretic/src/h_main.c b/doomsday/plugins/jheretic/src/h_main.c index d274ed53ac..639dd03f6f 100644 --- a/doomsday/plugins/jheretic/src/h_main.c +++ b/doomsday/plugins/jheretic/src/h_main.c @@ -303,6 +303,7 @@ void H_PreInit(void) cfg.automapBack[2] = 1.0f; cfg.automapOpacity = 1.0f; cfg.automapLineAlpha = 1.0f; + cfg.automapLineWidth = 1.1f; cfg.automapShowDoors = true; cfg.automapDoorGlow = 8; cfg.automapHudDisplay = 2; diff --git a/doomsday/plugins/jhexen/data/conhelp.txt b/doomsday/plugins/jhexen/data/conhelp.txt index b5532da425..035f8b4c89 100644 --- a/doomsday/plugins/jhexen/data/conhelp.txt +++ b/doomsday/plugins/jhexen/data/conhelp.txt @@ -569,8 +569,11 @@ desc = Chat macro 9. [chat-macro9] desc = Chat macro 10. -[map-alpha-lines] -desc = Alpha level of automap lines. +[map-line-opacity] +desc = Opacity of automap lines (default: .7). + +[map-line-width] +desc = Scale factor for automap lines (default: 1.1). [map-babykeys] desc = 1=Show keys in automap (easy skill mode only). diff --git a/doomsday/plugins/jhexen/include/x_config.h b/doomsday/plugins/jhexen/include/x_config.h index 643f7d3a2b..b41f7e8447 100644 --- a/doomsday/plugins/jhexen/include/x_config.h +++ b/doomsday/plugins/jhexen/include/x_config.h @@ -130,6 +130,7 @@ typedef struct { float automapBack[3]; float automapOpacity; float automapLineAlpha; + float automapLineWidth; ///< In fixed 320x200 pixels. byte automapRotate; byte automapHudDisplay; int automapCustomColors; diff --git a/doomsday/plugins/jhexen/src/h2_main.c b/doomsday/plugins/jhexen/src/h2_main.c index f95e45de4c..76dbafee12 100644 --- a/doomsday/plugins/jhexen/src/h2_main.c +++ b/doomsday/plugins/jhexen/src/h2_main.c @@ -294,6 +294,7 @@ void X_PreInit(void) cfg.automapBack[2] = 1.0f; cfg.automapOpacity = 1.0f; cfg.automapLineAlpha = 1.0f; + cfg.automapLineWidth = 1.1f; cfg.automapShowDoors = true; cfg.automapDoorGlow = 8; cfg.automapHudDisplay = 2;