Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@aoeixsz4
Copy link

@aoeixsz4 aoeixsz4 commented Jul 3, 2021

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

win/tty/wintty.c Outdated
} else {
#ifdef UNIX
#ifdef REALTIME_ON_BOTL
fd_set read_set;

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

Copy link
Author

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>

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah right

@nhcopier nhcopier deleted the branch NetHack:NetHack-3.7 January 27, 2022 16:20
@nhcopier nhcopier closed this Jan 27, 2022
@nhmall nhmall reopened this Jan 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.