mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2026-01-29 17:38:16 +03:00
Remove clamp in favor of SDL_clamp
For the same reasons as I removed VVV_min/max in favor of SDL_min/max in
aa7b63fa5f, I'm doing the same thing here.
This commit is contained in:
@@ -2306,8 +2306,8 @@ void editorinput(void)
|
||||
break;
|
||||
}
|
||||
|
||||
ed.levx = clamp(help.Int(coord_x) - 1, 0, cl.mapwidth - 1);
|
||||
ed.levy = clamp(help.Int(coord_y) - 1, 0, cl.mapheight - 1);
|
||||
ed.levx = SDL_clamp(help.Int(coord_x) - 1, 0, cl.mapwidth - 1);
|
||||
ed.levy = SDL_clamp(help.Int(coord_y) - 1, 0, cl.mapheight - 1);
|
||||
graphics.backgrounddrawn = false;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -521,10 +521,10 @@ void Graphics::do_print(
|
||||
int position = 0;
|
||||
std::string::const_iterator iter = text.begin();
|
||||
|
||||
r = clamp(r, 0, 255);
|
||||
g = clamp(g, 0, 255);
|
||||
b = clamp(b, 0, 255);
|
||||
a = clamp(a, 0, 255);
|
||||
r = SDL_clamp(r, 0, 255);
|
||||
g = SDL_clamp(g, 0, 255);
|
||||
b = SDL_clamp(b, 0, 255);
|
||||
a = SDL_clamp(a, 0, 255);
|
||||
|
||||
ct.colour = getRGBA(r, g, b, a);
|
||||
|
||||
|
||||
@@ -356,7 +356,7 @@ static void slidermodeinput(void)
|
||||
{
|
||||
*user_changing_volume += USER_VOLUME_STEP;
|
||||
}
|
||||
*user_changing_volume = clamp(*user_changing_volume, 0, USER_VOLUME_MAX);
|
||||
*user_changing_volume = SDL_clamp(*user_changing_volume, 0, USER_VOLUME_MAX);
|
||||
}
|
||||
|
||||
static void menuactionpress(void)
|
||||
|
||||
@@ -13,11 +13,6 @@ float inline fRandom(void)
|
||||
return ( float(rand()) / float(RAND_MAX)) ;
|
||||
}
|
||||
|
||||
inline int clamp(int x, int a, int b)
|
||||
{
|
||||
return x < a ? a : (x > b ? b : x);
|
||||
}
|
||||
|
||||
struct point
|
||||
{
|
||||
int x;
|
||||
|
||||
@@ -78,7 +78,7 @@ static void volumesliderrender(void)
|
||||
num_positions = slider_length - symbol_length + 1;
|
||||
|
||||
offset = num_positions * (*volume_ptr) / USER_VOLUME_MAX;
|
||||
offset = clamp(offset, 0, slider_length - symbol_length);
|
||||
offset = SDL_clamp(offset, 0, slider_length - symbol_length);
|
||||
|
||||
/* SDL_strlcpy null-terminates, which would end the string in the middle of
|
||||
* it, which we don't want!
|
||||
|
||||
Reference in New Issue
Block a user