10 #include "../stdafx.h"
11 #include "../window_gui.h"
12 #include "../window_func.h"
13 #include "../strings_func.h"
14 #include "../zoom_func.h"
15 #include "slider_func.h"
17 #include "../safeguards.h"
27 static const int slider_width = 3;
30 const int ha = (r.bottom - r.top) / 5;
31 int wx1 = r.left, wx2 = r.right;
36 const std::vector<Point> wedge{
Point{wx1, r.bottom - ha},
Point{wx2, r.top + ha},
Point{wx2, r.bottom - ha} };
38 GfxDrawLine(wedge[0].x, wedge[0].y, wedge[2].x, wedge[2].y, light);
40 GfxDrawLine(wedge[0].x, wedge[0].y, wedge[1].x, wedge[1].y, shadow);
45 const int x = r.left + (value * (r.right - r.left - sw) / 127);
46 DrawFrameRect(x, r.top, x + sw, r.bottom, COLOUR_GREY, FR_NONE);
58 byte new_vol =
Clamp((pt.x - r.left) * 127 / (r.right - r.left), 0, 127);
62 if (new_vol > 124) new_vol = 127;
63 if (new_vol < 3) new_vol = 0;
64 if (new_vol != value) {