1
0
Fork 0
Commit Graph

53 Commits

Author SHA1 Message Date
John Zaitseff 1e2fc6ad5f Add SPDX licence identifiers to all source code files 2024-05-26 06:05:27 +10:00
John Zaitseff cc5ee96ceb Update the copyright year to 2024 2024-01-02 12:33:37 +11:00
John Zaitseff 1231c084b8 Update the copyright year to 2022 2022-08-01 04:46:15 +10:00
John Zaitseff 0d2462ef41 Update the copyright year to 2021 2021-01-07 17:07:55 +11:00
John Zaitseff 814ce71842 Update the copyright year to 2020 2020-01-02 08:37:36 +11:00
John Zaitseff fa0cb153ff Update copyright year to 2019 2019-01-05 08:10:28 +11:00
John Zaitseff 5caf1ef165 Keep the Intel C compiler quiet
By default, the Intel C compiler warns "enumerated type mixed with
another type" when compiling this code.  Explicit casts keep it quiet.
2018-08-06 13:59:25 +10:00
John Zaitseff f45986e88d Pedantically type-cast integer comparisons
The latest versions of the GNU Compiler Collection complain about signed
and unsigned integer comparisons when run with the "-Wextra" flag.  Keep
those compilers happy.
2018-07-27 18:33:14 +10:00
John Zaitseff abc9b77bd6 Change all relevant http references to https (secure HTTP) 2018-03-30 12:46:37 +11:00
John Zaitseff 8c6d009611 Update the copyright date to 2018 2018-03-30 11:38:29 +11:00
John Zaitseff 2f79514910 Update the copyright date to 2017 2017-05-14 06:29:44 +10:00
John Zaitseff 5edd10177c Ensure no label has to start with a new-line character 2016-04-16 07:39:51 +10:00
John Zaitseff a486cd15aa Update the copyright year to 2016 2016-01-05 09:25:51 +11:00
John Zaitseff 09e1db13b0 Allow right-hand column labels in the Exchange window to be wider
In particular, these column labels may now be more than 18 characters
long.  This will only work if the left-hand side is not too wide.
2015-08-26 21:26:39 +10:00
John Zaitseff f16f78a509 Update the copyright date to 2015 2015-08-18 07:27:22 +10:00
John Zaitseff 9450fed943 Update the copyright year to 2014 2014-05-22 11:05:51 +10:00
John Zaitseff c25ec91e99 Update the copyright year to 2013, and the version number to 7.5 2013-02-02 10:48:43 +11:00
John Zaitseff 674de34873 Adjust the Stock Exchange windows slightly by one line
The company listing is now one line shorter, and the menu of choices
window is one line longer.
2012-04-14 12:36:43 +10:00
John Zaitseff 36cc55ee7f Add more comments regarding the column width of various labels 2012-03-31 10:57:29 +11:00
John Zaitseff bc3e1a06a1 Update the copyright year to 2012 2012-03-15 02:36:23 +11:00
John Zaitseff 74aa3e84df Fix a couple of display bugs
Firstly, Ncurses addchstr() and family do not work, it seems, with
multibyte strings, so use addch() instead.  Secondly, PRINTABLE_MAP_VAL
returns a wchar_t wide character, not a byte-sized char.
2011-08-30 09:15:15 +10:00
John Zaitseff 1c2518a78b Minor clean-up: replace character constants with wide-char versions
Wide-char character constants is not strictly needed for most (all?)
modern C compilers, as ASCII maps to wchar_t directly (as long as
__STDC_ISO_10646__ is defined).  However, it doesn't hurt to be pedantic!
2011-08-25 21:34:41 +10:00
John Zaitseff 20473ae409 Use wide-character functions for input routines and most strings
Convert all input routines, and most internal strings, to use
wide-character functions.  All extended characters are supported,
including those having column widths of zero (eg, combining characters),
one (eg, normal Western characters) and two (eg, many East Asian
characters).  This was quite a major undertaking!
2011-08-25 13:19:31 +10:00
John Zaitseff b5b211313e Move chstrdup() to utils.c and rename it to xchstrdup()
The new name is for consistency with other XXXdup() functions used in
this program.
2011-08-20 15:17:09 +10:00
John Zaitseff 4d6f1478e6 Remove the superfluous argument to chstrdup()
This argument is not required: we KNOW that we have initialised chtype
arrays with an ending NUL!
2011-08-18 14:53:03 +10:00
John Zaitseff 6ef7c7b6da Allow localisation of company letters and map moves (choices) 2011-08-18 12:10:33 +10:00
John Zaitseff b674c05d56 Add many comments for translators; use pgettext() where appropriate 2011-08-17 19:13:05 +10:00
John Zaitseff 5f5c512e45 Highlight the word "one" 2011-08-17 13:26:11 +10:00
John Zaitseff 197de2804f Add calls to ngettext() where appropriate 2011-08-17 13:18:41 +10:00
John Zaitseff 6c1c272780 Place all output strings within gettext invocations 2011-08-16 21:03:41 +10:00
John Zaitseff cf30933614 Continue to rewrite the interface code to use the new interfaces 2011-08-16 18:48:56 +10:00
John Zaitseff 907a995b98 Refactor function names; "old_" functions will be removed
Rename prepstr, vprepstr, chbufdup, center, center2, center3 and attrpr
to mkchstr, vmkchstr, chstrdup, old_center, old_center2, old_center3 and
old_attrpr respectively.
2011-08-15 19:12:26 +10:00
John Zaitseff 5bb48fe35f Add wrapper functions xmalloc() and xstrdup() to do error handling 2011-08-13 08:50:34 +10:00
John Zaitseff 7d9bf097b9 Replace discrete calls to newtxwin() etc. with calls to txdlgbox() 2011-08-12 18:24:35 +10:00
John Zaitseff 040e1a5ad6 Rework the signal handler
Rework the signal handler to be somewhat more unsafe, but conceptually
cleaner, in operation.  It now ends the use of Curses, then reraises the
signal.  Remove almost all references to abort_game.
2011-08-09 23:20:56 +10:00
John Zaitseff bbdae69de4 Add a signal handler for SIGINT and SIGTERM
Add a signal handler for SIGINT and SIGTERM, as well as sprinklings of
checks to abort_game.  Although Ncurses DOES define handlers for SIGINT
and SIGTERM, they do not always seem to work correctly under many
operating systems.
2011-08-08 20:47:52 +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 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 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 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 9f02f8e77f Rename character renditions (attributes) to something more regular 2011-07-20 17:01:25 +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 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 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 fcffaa5860 Add checks for KEY_EXIT: same functionality as pressing CTRL-C 2011-07-19 19:22:20 +10:00
John Zaitseff ccbe7405f8 Replace "out of memory" errors with calls to err_exit_nomem() 2011-07-19 19:16:34 +10:00
John Zaitseff 8165785fc0 Handle rounding of input amounts a little better 2011-07-19 15:04:39 +10:00
John Zaitseff 7eafa205e7 Minor bug fix: the done variable must be initialised before use 2011-07-19 14:36:00 +10:00
John Zaitseff 625f265108 Allow the player to buy and sell shares
This function, trade_shares(), is the last function needed for Star
Traders: the game is now complete.

The current line count is 6667 lines of C code (src/*.[ch]), as compared
with 1657 lines in the CP/M-80 version, 1674 lines in CP/M-86, 4266 lines
in DOS (2225 in the main program) and 4580 lines in Windows 16-bit.
2011-07-19 14:21:32 +10:00
John Zaitseff 26436c08dd Rearrange the Stock Exchange display
The Stock Exchange display now mimics the Stock Portfolio page a little
more.  Also allow more keys to exit parts of the Stock Exchange.
2011-07-19 11:10:09 +10:00