Browse Source

documentation cleanup: gmenu

pull/2758/head
BC Ko 5 years ago committed by Anders Jenbo
parent
commit
e4e368948b
  1. 9
      Source/gmenu.cpp
  2. 12
      Source/gmenu.h

9
Source/gmenu.cpp

@ -347,9 +347,6 @@ void gmenu_enable(TMenuItem *pMenuItem, bool enable)
pMenuItem->dwFlags &= ~GMENU_ENABLED;
}
/**
* @brief Set the TMenuItem slider position based on the given value
*/
void gmenu_slider_set(TMenuItem *pItem, int min, int max, int value)
{
assert(pItem);
@ -358,9 +355,6 @@ void gmenu_slider_set(TMenuItem *pItem, int min, int max, int value)
pItem->dwFlags |= ((max - min - 1) / 2 + (value - min) * nSteps) / (max - min);
}
/**
* @brief Get the current value for the slider
*/
int gmenu_slider_get(TMenuItem *pItem, int min, int max)
{
uint16_t step = pItem->dwFlags & 0xFFF;
@ -368,9 +362,6 @@ int gmenu_slider_get(TMenuItem *pItem, int min, int max)
return min + (step * (max - min) + (steps - 1) / 2) / steps;
}
/**
* @brief Set the number of steps for the slider
*/
void gmenu_slider_steps(TMenuItem *pItem, int steps)
{
pItem->dwFlags &= 0xFF000FFF;

12
Source/gmenu.h

@ -32,8 +32,20 @@ bool gmenu_presskeys(int vkey);
bool gmenu_on_mouse_move();
bool gmenu_left_mouse(bool isDown);
void gmenu_enable(TMenuItem *pMenuItem, bool enable);
/**
* @brief Set the TMenuItem slider position based on the given value
*/
void gmenu_slider_set(TMenuItem *pItem, int min, int max, int value);
/**
* @brief Get the current value for the slider
*/
int gmenu_slider_get(TMenuItem *pItem, int min, int max);
/**
* @brief Set the number of steps for the slider
*/
void gmenu_slider_steps(TMenuItem *pItem, int steps);
} // namespace devilution

Loading…
Cancel
Save