platforms. We'll probably need to tweak this further.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@659 c06c8d41-db1a-0410-9941-cceddc491573
TOKBONNNPTP2CIEHMMR4QAJZTXYETS55OGGDA6FY6NIMNDYMWJDAC
#ifndef __LIBDOS_H__
#define __LIBDOS_H__
void init_libdos();
inline void enable_smart_cursor(bool ) { }
inline bool is_smart_cursor_enabled() { return (false); }
#endif
#ifndef __LIBDOS_H__
#define __LIBDOS_H__
void init_libdos();
inline void enable_smart_cursor(bool ) { }
inline bool is_smart_cursor_enabled() { return (false); }
void set_cursor_enabled(bool enabled);
bool is_cursor_enabled();
#endif
/*
* File: libdos.cc
* Summary: Functions for DOS support.
* Written by: Darshan Shaligram
*
* Added for Crawl Reference by $Author: nlanza $ on $Date: 2006-09-26T03:22:57.300929Z $
*/
// Every .cc must include AppHdr or bad things happen.
#include "AppHdr.h"
#include <termios.h>
void init_libdos()
{
struct termios charmode;
tcgetattr (0, &charmode);
// Ignore Ctrl-C
charmode.c_lflag &= ~ISIG;
tcsetattr (0, TCSANOW, &charmode);
}
/*
* File: libdos.cc
* Summary: Functions for DOS support.
* Written by: Darshan Shaligram
*
* Added for Crawl Reference by $Author: nlanza $ on $Date: 2006-09-26T03:22:57.300929Z $
*/
// Every .cc must include AppHdr or bad things happen.
#include "AppHdr.h"
#include <termios.h>
#include <conio.h>
static bool cursor_is_enabled = true;
void init_libdos()
{
struct termios charmode;
tcgetattr (0, &charmode);
// Ignore Ctrl-C
charmode.c_lflag &= ~ISIG;
tcsetattr (0, TCSANOW, &charmode);
}
void set_cursor_enabled(bool enabled)
{
cursor_is_enabled = enabled;
_setcursortype( enabled? _NORMALCURSOR : _NOCURSOR );
}
bool is_cursor_enabled()
{
return (cursor_is_enabled);
}
command_type cmd = get_next_cmd();
{
// Enable the cursor to read input. The cursor stays on while
// the command is being processed, so subsidiary prompts
// shouldn't need to turn it on explicitly.
cursor_control con(true);
command_type cmd = get_next_cmd();
// [dshaligram] If get_next_cmd encountered a Lua macro binding, your turn
// may be ended by the first invoke of the macro.
if (!you.turn_is_over && cmd != CMD_NEXT_CMD)
process_command( cmd );
// [dshaligram] If get_next_cmd encountered a Lua macro
// binding, your turn may be ended by the first invoke of the
// macro.
if (!you.turn_is_over && cmd != CMD_NEXT_CMD)
process_command( cmd );
}