Skip to content

Commit

Permalink
Automap|Added: Console variable map-line-width - scale factor for lines
Browse files Browse the repository at this point in the history
Also added map-line-opacity as an alias for the older map-alpha-lines
  • Loading branch information
danij-deng committed Jan 29, 2012
1 parent 7a3eb8a commit 9b9c720
Show file tree
Hide file tree
Showing 15 changed files with 39 additions and 12 deletions.
1 change: 0 additions & 1 deletion doomsday/plugins/common/include/hu_automap.h
Expand Up @@ -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);
Expand Down
8 changes: 6 additions & 2 deletions doomsday/plugins/common/src/hu_automap.c
Expand Up @@ -94,14 +94,15 @@ 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
{ "map-background-r", 0, CVT_FLOAT, &cfg.automapBack[0], 0, 1 },
{ "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 },
Expand All @@ -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);
Expand Down Expand Up @@ -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.
Expand Down
6 changes: 5 additions & 1 deletion doomsday/plugins/common/src/hu_menu.c
Expand Up @@ -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[] = {
Expand Down Expand Up @@ -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" };
Expand All @@ -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 },
Expand Down
7 changes: 5 additions & 2 deletions doomsday/plugins/jdoom/data/conhelp.txt
Expand Up @@ -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).
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom/include/d_config.h
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom/src/d_main.c
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions doomsday/plugins/jdoom64/data/conhelp.txt
Expand Up @@ -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).
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom64/include/d_config.h
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jdoom64/src/d_main.c
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions doomsday/plugins/jheretic/data/conhelp.txt
Expand Up @@ -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).
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jheretic/include/h_config.h
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jheretic/src/h_main.c
Expand Up @@ -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;
Expand Down
7 changes: 5 additions & 2 deletions doomsday/plugins/jhexen/data/conhelp.txt
Expand Up @@ -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).
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jhexen/include/x_config.h
Expand Up @@ -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;
Expand Down
1 change: 1 addition & 0 deletions doomsday/plugins/jhexen/src/h2_main.c
Expand Up @@ -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;
Expand Down

0 comments on commit 9b9c720

Please sign in to comment.