MCPcopy Create free account
hub / github.com/diasurgical/devilution / gmenu_slider_set

Function gmenu_slider_set

Source/gmenu.cpp:377–387  ·  view source on GitHub ↗

* @brief Set the TMenuItem slider position based on the given value */

Source from the content-addressed store, hash-verified

375 * @brief Set the TMenuItem slider position based on the given value
376 */
377void gmenu_slider_set(TMenuItem *pItem, int min, int max, int value)
378{
379 int nSteps;
380
381 /// ASSERT: assertassert(pItem, "gmenu.cpp", 445);
382 nSteps = (int)(pItem->dwFlags & 0xFFF000) >> 12;
383 if (nSteps < 2)
384 nSteps = 2;
385 pItem->dwFlags &= 0xFFFFF000;
386 pItem->dwFlags |= ((max - min - 1) / 2 + (value - min) * nSteps) / (max - min);
387}
388
389/**
390 * @brief Get the current value for the slider

Callers 2

gamemenu_get_gammaFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected