Browse code

Move clamp() to screen.c.

Andrew Alderwick authored on 20/01/2022 01:24:13
Showing 3 changed files
... ...
@@ -108,6 +108,12 @@ screen_redraw(UxnScreen *p, Uint32 *pixels)
108 108
 	p->fg.changed = p->bg.changed = 0;
109 109
 }
110 110
 
111
+int
112
+clamp(int val, int min, int max)
113
+{
114
+	return (val >= min) ? (val <= max) ? val : max : min;
115
+}
116
+
111 117
 /* IO */
112 118
 
113 119
 Uint8
... ...
@@ -34,3 +34,4 @@ void screen_redraw(UxnScreen *p, Uint32 *pixels);
34 34
 
35 35
 Uint8 screen_dei(Device *d, Uint8 port);
36 36
 void screen_deo(Device *d, Uint8 port);
37
+int clamp(int val, int min, int max);
... ...
@@ -46,12 +46,6 @@ static Device *devscreen, *devmouse, *devctrl, *devaudio0;
46 46
 static Uint8 zoom = 1;
47 47
 static Uint32 stdin_event, audio0_event;
48 48
 
49
-static int
50
-clamp(int val, int min, int max)
51
-{
52
-	return (val >= min) ? (val <= max) ? val : max : min;
53
-}
54
-
55 49
 static int
56 50
 error(char *msg, const char *err)
57 51
 {