-
Notifications
You must be signed in to change notification settings - Fork 520
implement realtime/wallclock statusline timer #543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: NetHack-3.7
Are you sure you want to change the base?
Conversation
win/tty/wintty.c
Outdated
| } else { | ||
| #ifdef UNIX | ||
| #ifdef REALTIME_ON_BOTL | ||
| fd_set read_set; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think something like
struct pollfd pf;
pf.fd = 0;
pf.events = POLLIN;
for (;;) {
if (poll(&pf, 1, 1000)) {
tgetch stuff
} else {
update stats
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oooo u can give the poll thing a timer
got it
win/tty/wintty.c
Outdated
| #endif /* ?HANGUP_HANDLING */ | ||
|
|
||
| #ifdef REALTIME_ON_BOTL | ||
| #include <sys/select.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be guarded by #ifdef UNIX or so too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah right
this pr implements the ui clock developed by @bhaak in such a way that it can update independently of user input
for tty it uses pselect(), for curses they have their own timeout functionality
i am unsure about the portability of this, only tested on Ubuntu 20.04 with Linux kernel 5.8.0-59-generic