John Zaitseff
2853dcb25a
Add a simple shell script to bootstrap the auto-generated files
2011-07-25 13:20:05 +10:00
John Zaitseff
00f33dc1cc
Add more files (generated by gnulib) to ignore by default
2011-07-23 17:25:37 +10:00
John Zaitseff
fd55a09493
Add support for the Gnulib portability library
...
In particular, the gnulib-tool utility now maintains lib/Makefile.am, as
well as many files in the m4 and lib directories. The file
m4/gnulib-cache.m4 allows the Gnulib files to be refreshed. See
http://www.gnu.org/software/gnulib/ .
2011-07-23 17:19:07 +10:00
John Zaitseff
dcad9487bb
Add files to m4/Makefile.am that should be distributed
2011-07-23 11:44:02 +10:00
John Zaitseff
961e989bd7
Replace the WCENTER(x) macro with WCENTER; refactor newtxwin() to suit
2011-07-23 10:16:03 +10:00
John Zaitseff
a5feeb2635
Add a call to turn the cursor on--just in case
2011-07-23 10:04:09 +10:00
John Zaitseff
fc60a9fef1
Rework the handling of character renditions
...
Rather than querying use_color each and every time a rendition is used,
do it once in init_screen(), assigning the renditions to global
variables.
2011-07-23 09:47:13 +10:00
John Zaitseff
5f2298b07f
Add copyright information to the README file
2011-07-22 22:27:35 +10:00
John Zaitseff
1a336621c4
Include a simple README that, at least, covers the basics!
2011-07-22 22:16:24 +10:00
John Zaitseff
d47f52792a
Some polishing of the manual page
2011-07-22 21:48:40 +10:00
John Zaitseff
015fb631a1
Complete the manual page for Star Traders
...
Troff macros are such fun! :-)
2011-07-22 20:29:34 +10:00
John Zaitseff
17aafcbeb5
Include the word "window" with the requirement for an 80x24 display
2011-07-22 20:28:08 +10:00
John Zaitseff
d375aa57c6
Ignore auxiliary build files by default: depcomp, install-sh and missing
2011-07-22 14:21:40 +10:00
John Zaitseff
bbd43c4f8b
Add some more checks for the C compiler/environment
2011-07-22 14:19:05 +10:00
John Zaitseff
6704c358ce
Make compiler quieter about signed and unsigned comparisons
2011-07-22 13:07:14 +10:00
John Zaitseff
27167f0e6f
Finish moving all comments from source files to headers
...
At this point, the source code of Star Traders is essentially ready for
its 7.0 release!
2011-07-22 13:05:06 +10:00
John Zaitseff
b3e58af2eb
Be consistent in naming all "long int" variables that way
2011-07-22 12:59:05 +10:00
John Zaitseff
e50ce0e12b
Add more comments to process_move()
2011-07-22 12:43:21 +10:00
John Zaitseff
df2608d2d4
Make module-specific internal functions static
2011-07-22 12:31:54 +10:00
John Zaitseff
65a9dacbfc
Change the "--no-encrypt" command line option to "--dont-encrypt"
...
Some versions of getopt_long() show ALL options if an ambiguous
abbreviation was supplied (such as "--no"), and we don't really want
players to discover this option by accident, do we? :-)
2011-07-22 12:20:58 +10:00
John Zaitseff
c18f913710
Document the --max-turn command line option
...
Do NOT document the --no-encrypt option: we don't want people to know
about it!
2011-07-22 12:16:09 +10:00
John Zaitseff
ac55800e90
Continue moving comments from source files to headers
...
Also refactor some code, primarily in process_move(), to reduce the level
of indentation.
2011-07-22 12:11:19 +10:00
John Zaitseff
37195a1c57
Refactor some code in init_game()
...
Move parts of the code out of init_game() to internal functions
ask_number_players(), ask_game_number() and ask_player_names(). Also
move comments out to game.h as appropriate.
2011-07-22 10:49:26 +10:00
John Zaitseff
4b4efd7851
Replace the global variable localeconv_info with lconvinfo
...
In general, verbosity is not really to be encouraged...
2011-07-22 10:23:58 +10:00
John Zaitseff
9ef1181c05
Revert a previous change: we know how large is the window we opened!
2011-07-22 10:08:43 +10:00
John Zaitseff
78cac96e4a
Change handling of setlocale(LC_NUMERIC) in load_game() and save_game()
...
Changing just the LC_NUMERIC part of the locale DOES work, if you read
the manual page carefully! In particular, TWO calls need to be made, the
first with parameter NULL to get the current locale. In addition, the
result MUST be copied to a new string, as it may be (and is!) overwritten
by the next call to setlocale().
2011-07-21 22:44:45 +10:00
John Zaitseff
71486357c1
Bug fix: restore locale settings correctly
...
For some reason, changing the locale to "C" for LC_NUMERIC, then
restoring just that part of the locale to the old user-supplied
one does not work. Simply reinstating the whole locale using
setlocale(LC_ALL, ""), however, DOES work, so do that.
2011-07-21 22:22:50 +10:00
John Zaitseff
c5500e1bb3
Document and clean up fileio.c: functions load_game() and save_game()
2011-07-21 22:18:14 +10:00
John Zaitseff
1ac4d28c21
Document and clean up functions in intf.c
...
Document gettxline(), gettxstr() (formerly gettxstring()), gettxdouble()
and gettxlong().
2011-07-21 21:40:54 +10:00
John Zaitseff
1408a2ab3d
Allow a second default key, ";" as well as "=", to help touch-typists!
2011-07-21 13:16:42 +10:00
John Zaitseff
ee992fa02a
Move printing a prompt into answer_yesno(); document wait_for_key()
2011-07-21 13:10:51 +10:00
John Zaitseff
eac09fecb5
Move function descriptions to the intf.h header file
...
Also change the types of character rendition (attributes) variables from
int to chtype; add restrict where suitable and rewrite parts of the
functions to use getattrs().
2011-07-21 12:29:13 +10:00
John Zaitseff
1a44ff6513
Replace "tv.tv_sec * tv.tv_usec" with "tv.tv_sec + tv.tv_usec"
...
This allows the lower bits of seed to hopefully contain something useful
instead of just zeros!
2011-07-20 23:19:12 +10:00
John Zaitseff
a9f52e89be
Move function comments from source to header files where they belong
2011-07-20 22:41:56 +10:00
John Zaitseff
6a6c31035a
Correct a subtle off-by-one error in copying in l_strfmon()
...
The bug in l_strfmon() is that bufsize is NOT the length of the string,
hence do not include the usual "+ 1" for the NUL byte. Also correct some
comparisons between signed and unsigned integers.
2011-07-20 21:47:20 +10:00
John Zaitseff
b3f1820418
Add the restrict keyword where appropriate
2011-07-20 21:18:49 +10:00
John Zaitseff
6ee474e438
Minor code cleanups
2011-07-20 21:18:28 +10:00
John Zaitseff
9f02f8e77f
Rename character renditions (attributes) to something more regular
2011-07-20 17:01:25 +10:00
John Zaitseff
6a9af29c31
Rearrange some lines in intf.h; add additional comments
2011-07-20 16:12:02 +10:00
John Zaitseff
46c7a55203
Remove LINE_OFFSET and COL_OFFSET; rename COL_CENTER to WCENTER
2011-07-20 15:53:53 +10:00
John Zaitseff
cbff5193d9
Include microseconds as well as seconds for the random number seed
2011-07-20 12:42:10 +10:00
John Zaitseff
c1b284e977
Specify X/Open Curses instead of SysV Curses in the error string
2011-07-20 12:01:03 +10:00
John Zaitseff
f5ca777b37
Ignore character returned by wgetch() in wait_for_key()
2011-07-20 12:00:21 +10:00
John Zaitseff
c6007be5aa
Move background setting and box drawing into newtxwin()
...
Setting the background and drawing a box is almost always the first thing
done after window creation.
2011-07-20 11:41:46 +10:00
John Zaitseff
ee259b8a83
Add a few more function comments
2011-07-20 10:50:18 +10:00
John Zaitseff
da7477dc28
Compensate for the POSIX locale not having a currency symbol
...
The function l_strfmon() will insert MOD_POSIX_CURRENCY_SYMBOL in the
appropriate place when used with the POSIX ("C") locale.
2011-07-20 10:44:44 +10:00
John Zaitseff
e56247b1b4
Bug fix: company share prices CAN be zero, if company does not exist
2011-07-19 23:31:20 +10:00
John Zaitseff
ee37b4d210
Add the --no-encrypt command-line option
2011-07-19 23:24:17 +10:00
John Zaitseff
cdb98dbedb
Make slight corrections to the help text
2011-07-19 23:19:08 +10:00
John Zaitseff
d47848850f
Clean up help.c and help.h: remove superfluous lines, add comments
2011-07-19 23:07:26 +10:00