Move clamp() to screen.c.
This commit is contained in:
parent
cf84a5d661
commit
cd0ca2eb17
|
@ -108,6 +108,12 @@ screen_redraw(UxnScreen *p, Uint32 *pixels)
|
||||||
p->fg.changed = p->bg.changed = 0;
|
p->fg.changed = p->bg.changed = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
clamp(int val, int min, int max)
|
||||||
|
{
|
||||||
|
return (val >= min) ? (val <= max) ? val : max : min;
|
||||||
|
}
|
||||||
|
|
||||||
/* IO */
|
/* IO */
|
||||||
|
|
||||||
Uint8
|
Uint8
|
||||||
|
|
|
@ -34,3 +34,4 @@ void screen_redraw(UxnScreen *p, Uint32 *pixels);
|
||||||
|
|
||||||
Uint8 screen_dei(Device *d, Uint8 port);
|
Uint8 screen_dei(Device *d, Uint8 port);
|
||||||
void screen_deo(Device *d, Uint8 port);
|
void screen_deo(Device *d, Uint8 port);
|
||||||
|
int clamp(int val, int min, int max);
|
||||||
|
|
|
@ -46,12 +46,6 @@ static Device *devscreen, *devmouse, *devctrl, *devaudio0;
|
||||||
static Uint8 zoom = 1;
|
static Uint8 zoom = 1;
|
||||||
static Uint32 stdin_event, audio0_event;
|
static Uint32 stdin_event, audio0_event;
|
||||||
|
|
||||||
static int
|
|
||||||
clamp(int val, int min, int max)
|
|
||||||
{
|
|
||||||
return (val >= min) ? (val <= max) ? val : max : min;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
error(char *msg, const char *err)
|
error(char *msg, const char *err)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue