mirror of
https://git.zap.org.au/git/trader.git
synced 2025-02-02 15:08:13 -05:00
Add some more definitions, especially for the Curses library
This commit is contained in:
parent
9453cfc402
commit
ee94d86b57
@ -39,6 +39,9 @@
|
|||||||
* Constants and type declarations *
|
* Constants and type declarations *
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
|
#define MIN_COLUMNS (80) /* Minimum number of columns in terminal */
|
||||||
|
#define MIN_LINES (24) /* Minimum number of lines in terminal */
|
||||||
|
|
||||||
#define MAX_X (38) /* Map dimensions MAP_X x MAP_Y */
|
#define MAX_X (38) /* Map dimensions MAP_X x MAP_Y */
|
||||||
#define MAX_Y (12)
|
#define MAX_Y (12)
|
||||||
#define STAR_RATIO (0.10) /* 10% of map should be stars */
|
#define STAR_RATIO (0.10) /* 10% of map should be stars */
|
||||||
|
@ -70,6 +70,13 @@
|
|||||||
* Miscellaneous definitions *
|
* Miscellaneous definitions *
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
|
// Visibility of the cursor in Curses
|
||||||
|
#define CURS_INVISIBLE (0)
|
||||||
|
#define CURS_NORMAL (1)
|
||||||
|
#define CURS_VISIBLE (1)
|
||||||
|
#define CURS_VERYVISIBLE (2)
|
||||||
|
|
||||||
|
|
||||||
// For future use in internationalisation
|
// For future use in internationalisation
|
||||||
#ifndef _
|
#ifndef _
|
||||||
# define _(x) (x)
|
# define _(x) (x)
|
||||||
|
@ -62,6 +62,7 @@ int main (int argc, char *argv[])
|
|||||||
// Testing...
|
// Testing...
|
||||||
initscr();
|
initscr();
|
||||||
noecho();
|
noecho();
|
||||||
|
curs_set(CURS_INVISIBLE);
|
||||||
timeout(-1);
|
timeout(-1);
|
||||||
keypad(stdscr, true);
|
keypad(stdscr, true);
|
||||||
raw();
|
raw();
|
||||||
@ -76,6 +77,8 @@ int main (int argc, char *argv[])
|
|||||||
|
|
||||||
printw(_("Type some keys (^C to exit):\n\n"));
|
printw(_("Type some keys (^C to exit):\n\n"));
|
||||||
|
|
||||||
|
curs_set(CURS_VERYVISIBLE);
|
||||||
|
|
||||||
int c = 0;
|
int c = 0;
|
||||||
while ((c = getch()) != 3) {
|
while ((c = getch()) != 3) {
|
||||||
if ((c >= 0) && (c < 32)) {
|
if ((c >= 0) && (c < 32)) {
|
||||||
|
@ -35,7 +35,8 @@
|
|||||||
* Global definitions *
|
* Global definitions *
|
||||||
************************************************************************/
|
************************************************************************/
|
||||||
|
|
||||||
#define GAME_FILE_API_VERSION "7.0" /* For game loads and saves */
|
#define GAME_FILE_HEADER "Star Traders Saved Game"
|
||||||
|
#define GAME_FILE_API_VERSION "7.0" /* For game loads and saves */
|
||||||
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
|
Loading…
x
Reference in New Issue
Block a user