Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Main
Synchronet
Compare Revisions
75756ade0f759be31287d247736be1f65c593357...1a4345654513c363b41a316116e90fcee7fbe622
Commits (1)
Use xp_timer() instead of msclock()
· 1a434565
Deucе
authored
Feb 12, 2022
I'm not really happy about rounding floats in time-critical bits, but there you go.
1a434565
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
src/conio/mouse.c
src/conio/mouse.c
+5
-4
No files found.
src/conio/mouse.c
View file @
1a434565
...
...
@@ -31,6 +31,7 @@
* Note: If this box doesn't appear square, then you need to fix your tabs. *
****************************************************************************/
#include <math.h>
#include <stdlib.h>
#include <string.h>
...
...
@@ -41,7 +42,7 @@
#include "ciolib.h"
#define MSEC_CLOCK()
(msclock()*MSCLOCKS_PER_SEC/
1000)
#define MSEC_CLOCK()
llroundl(xp_timer()*
1000)
enum
{
MOUSE_NOSTATE
...
...
@@ -62,7 +63,7 @@ struct in_mouse_event {
int
y
;
int
x_res
;
int
y_res
;
c
lo
ck_t
ts
;
lo
ng
long
ts
;
void
*
nextevent
;
};
...
...
@@ -91,7 +92,7 @@ struct mouse_state {
int
button_y
[
5
];
int
button_x_res
[
5
];
/* Start X/Y position of the current state */
int
button_y_res
[
5
];
c
lo
ck_t
timeout
[
5
];
/* Button event timeouts (timespecs ie: time of expiry) */
lo
ng
long
timeout
[
5
];
/* Button event timeouts (timespecs ie: time of expiry) */
int
curx
;
/* Current X position */
int
cury
;
/* Current Y position */
int
curx_res
;
/* Current X position */
...
...
@@ -265,7 +266,7 @@ void ciolib_mouse_thread(void *data)
int
timeout_button
=
0
;
int
but
;
int
delay
;
c
lo
ck_t
ttime
=
0
;
lo
ng
long
ttime
=
0
;
SetThreadName
(
"Mouse"
);
init_mouse
();
...
...