summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/libunix.cc
Commit message (Collapse)AuthorAgeFilesLines
* Make colour-swapping work in webtiles (#8271)Neil Moore2014-07-311-5/+0
| | | | | For now this affects all watchers, but it would probably make more sense to make it a client-side option instead.
* Chance function(void) to function()reaverb2014-05-241-7/+7
|
* Don't send WebTiles message or flush for delay(0).Pekka Lampila2014-03-031-2/+5
|
* Drop some useless parentheses around comparisons.Adam Borowski2014-01-101-2/+2
|
* libunix: drop now-unneeded "#pragma GCC diagnostic" junkSamuel Bronson2013-12-311-4/+0
|
* Drop double newlines where they seem to serve no purpose.Adam Borowski2013-12-211-2/+0
| | | | | Sometimes, they're there to emphasize a break between two sections of code, which is good. In a majority of cases, though, they're just inconsistent.
* Start using -Wredundant-decls; fix all the instances I getSamuel Bronson2013-12-121-0/+5
| | | | | That is, unless you count the ones in ncurses' headers, which I can't do anything except suppress.
* Fixed use of arrows and other special keys in OS X versions of webtiles.Kyle Fox2013-12-061-1/+1
| | | | | The code was written assuming wint_t's are unsigned and therefore positive if not 0. This is not necessarily true for all environments.
* Correct a comment.Adam Borowski2013-11-291-1/+1
|
* Drop unnecessary parentheses from return statements.Adam Borowski2013-11-151-3/+3
|
* Don't waste electricity for mapstat infinite loops.Adam Borowski2013-10-031-0/+2
| | | | A hard limit of 60 seconds of CPU time per level.
* More padding fixes for ternary operatorChris Oelmueller2013-08-031-1/+1
|
* Avoid a constness warning.Neil Moore2013-06-061-1/+2
| | | | | For some nonsensical reason, tigetstr takes a char * instead of a const char *.
* Expand the kbs comment.Adam Borowski2013-05-261-2/+6
|
* Fix ctrl-h on terminals where that is the same as backspace (hhkb)Neil Moore2013-05-251-0/+9
| | | | | | | | | | If the terminfo "kbs" (key_backspace) attribute is ctrl-h, curses will treat any occurence of ctrl-h as KEY_BACKSPACE. Work around that by converting back to CK_BKSP == 0x8 (ctrl-h) if kbs is set ctrl-h. However, on sane terminals where backspace generates ctrl-?, don't smash the two. Fixes #7013.
* Combine WebTiles messages and send them togetherPekka Lampila2013-05-011-0/+1
| | | | | | Idea being avoiding lag caused by TCP ACK etc. Crawl process provides messages like always, but also sends a special flush message to the WebTiles server that causes them to actually be delivered.
* Show the text prompt cursor in WebTilesPekka Lampila2013-03-151-0/+7
|
* Fix a non-JSON message I missed.Florian Diebold2012-11-141-1/+1
|
* Make inline functions static.Adam Borowski2012-08-091-1/+1
| | | | | | | | | This avoids unnecessary non-inlined copies. Also, we had a few large functions that had no reason for inlining, let's have them be regular ones. I also made "static inline" always use the same order, for easier grepping.
* Drop a bunch of parentheses from return statements.Adam Borowski2012-08-081-1/+1
| | | | | This is incomplete, partially because of me getting bored, partially because of doubts about the point of leaving simple addition/etc in parentheses.
* Drop parentheses around scalar values in "return".Adam Borowski2012-07-051-15/+15
|
* Remove a good deal of header inclusion.Adam Borowski2012-05-231-1/+0
| | | | | | | | | These accumulate but never get removed; no wonder compilation times keep rising. The includes.sh script has lots of false negatives (and positives...), and can't check .h files which cause the biggest slowdown, it'd be nice to run multidelta on those somehow.
* Simplify and improve the startup menu layout (#5602).Raphael Langella2012-04-291-0/+5
| | | | | | | Logic is unified between console and tiles. We now use the full available size instead of leaving the last line for some reason. It should be relatively easy to make it respect tile_menu_icons = false, although I'm not sure it's worth bothering.
* Unbreak builds against curses variants without KEY_RESIZE.Neil Moore2012-04-231-2/+5
|
* Ignore ncurses KEY_RESIZE.Neil Moore2012-04-231-2/+3
| | | | | We already handle the SIGWINCH elsewhere. This prevents an "Unknown command" message every time the terminal size changes.
* Remove another few unused functions.Adam Borowski2012-04-181-4/+8
| | | | | | Also, instead of inc_max_mp() which does a bunch of stuff like adding notes (suppressed), healing you, etc, just increase max_mp directly. It's used only during player creation.
* Make a gcc-4.7 warning happy.Adam Borowski2012-04-171-2/+2
|
* Do not crash when the terminal window is resized.Neil Moore2012-04-141-0/+2
| | | | | | | | | | | | | Apparently initscr() isn't enough to set LINES and COLS: we have to call refresh() as well on a SIGWINCH. Furthermore, if the resize decreased the message window size, we could end up drawing too many lines (from msgwin.show()) before the message window's lines vector is resized. Since we can't do the resize from show() (it is const), handle only the last height() lines. Likewise for message_window::place_cursor(). Fixes #5544.
* In DGL, give games stuck for 60s CPU time the finger (the Nethack level 7 one).Adam Borowski2012-03-051-0/+5
| | | | | | There's a new crop of infinite loop bugs, they're hard to debug in DGL due to permissions (only Napkin can attach gdb) so backtraces would be nice, and taking 100% CPU on a public server is very detrimental to players.
* Hackily hush a spurious warning if hardening is on.Adam Borowski2012-03-011-2/+8
| | | | | Ubuntu and now Debian enable it by default for package builds (but not regular gcc use), which causes spam.
* Fix the "bad file descriptor" crash in webtiles.Florian Diebold2012-02-251-4/+0
|
* Disable death and delays during fsim.Adam Borowski2011-12-141-0/+3
| | | | | | | If you somehow die, fsim would hang on a non-displayed prompt; delays would make a single run take a week spent in sleep(). Note that fsim is currently completely broken by UCC changes.
* Consistently use a space after flow control statements.Adam Borowski2011-12-021-2/+2
|
* Webtiles JS Modularization, part II.Florian Diebold2011-10-291-1/+1
| | | | | | | This organizes the game-specific javascript into proper modules, and converts all messages from Crawl to JS objects. This means that the game javascript is now loaded asynchronically, which should fix the browser hang when starting a game.
* Make Webtiles output happen in parallel to the console display, and make the ↵Florian Diebold2011-10-151-0/+60
| | | | | | | | | | | | | | | | | | server record ttyrecs. Crawl compiled with WEBTILES=y should now be playable normally (i.e. indistinguishable from one compiled without WEBTILES) when run from a terminal. (This is not yet completely the case.) The Webtiles data is written on a Unix-domain datagram socket; the Crawl parameter -webtiles-socket determines a path on which the Crawl process receives control messages. The Webtiles server then runs Crawl in a pseudo-terminal and records its console output into a ttyrec file. The goal of all this is of course to be able to watch Webtiles games from ssh, and later the reverse.
* Remove an obsolete comment.Adam Borowski2011-10-041-1/+0
|
* Combine common parts of lib*.hAdam Borowski2011-09-081-37/+20
| | | | | Having different prototypes for different ports without a good reason is bad. After unification, it's easier to have, for example, two ports at once.
* Get rid of strlwr().Adam Borowski2011-09-071-11/+0
| | | | | | Besides being non-standard and present only on some platforms, it cannot be extended to Unicode as some characters expand or contract while being upper/lowercased.
* Get rid of a nasty hack around improper includes.Adam Borowski2011-09-071-9/+7
| | | | | Why the original coder did that instead of actually including the system headers is beyond me.
* Gut and parcel out most of stuff.ccAdam Borowski2011-06-041-1/+0
|
* Call a clua function "ready()" whenever Crawl is waiting for a new command.Adam Borowski2011-05-231-0/+1
| | | | | | | | | Note that it is easy to get into an infinite loop using it. This is nothing new as improper use of sendkeys() or while(1) could already cause that, but I'm afraid that making it _easier_ to accidentally cause such damage might be a bad idea. If so, we can #ifndef DGAMELAUNCH it.
* Fix DGL compilation.Florian Diebold2011-05-011-5/+0
|
* Get rid of itoa().Adam Borowski2011-05-011-40/+0
| | | | Even worse, it had two redundant implementations.
* Handle SIGHUP in tiles and on Windows.Adam Borowski2011-05-011-111/+0
| | | | (Ok, ok, on Windows it's a ConsoleHandler but does basically the same).
* Don't rely on undocumented behaviour of ncursesw.Adam Borowski2011-04-021-13/+26
| | | | | The API doesn't provide a way to giveback a function key, so let's do our own giveback buffer.
* Fix display corruption in some cases.Adam Borowski2011-04-021-0/+2
|
* Merge branch 'unicode'.Adam Borowski2011-04-011-200/+66
|\ | | | | | | | | There are some issues left, like incorrect wrapping in some cases, but we can fix them later.
| * Working commands on Unix console.Adam Borowski2011-03-311-27/+24
| |
| * Get rid of remaining uses of putch().Adam Borowski2011-03-311-8/+0
| | | | | | | | One was actually wrong, too -- mangling redefined explosions.
| * Use system's locale in all ports, from the very start.Adam Borowski2011-03-311-2/+0
| |