fairland: Move qprint() and NUMTRIES
qprint() was carelessly added at the end of the file in Empire 2, where it's under the "Write a script for placing capitals" headline. Move it to a more sensible place. NUMTRIES was added behind the global variables in Empire 2. Move it before them, and reformat its comment. Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
parent
d8db5b7308
commit
200059b65b
1 changed files with 17 additions and 14 deletions
|
@ -129,6 +129,11 @@
|
|||
#include "version.h"
|
||||
#include "xy.h"
|
||||
|
||||
/*
|
||||
* Number of retries when growing land fails
|
||||
*/
|
||||
#define NUMTRIES 10
|
||||
|
||||
/* do not change these defines */
|
||||
#define LANDMIN 1 /* plate altitude for normal land */
|
||||
#define PLATMIN 36 /* plate altitude for plateau */
|
||||
|
@ -300,8 +305,6 @@ static unsigned short *distance;
|
|||
static int *bfs_queue;
|
||||
static int bfs_queue_head, bfs_queue_tail;
|
||||
|
||||
#define NUMTRIES 10 /* keep trying to grow this many times */
|
||||
|
||||
static const char *numletter =
|
||||
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
|
||||
|
||||
|
@ -453,6 +456,18 @@ print_vars(void)
|
|||
printf("World dimensions: %dx%d\n", WORLD_X, WORLD_Y);
|
||||
}
|
||||
|
||||
static void
|
||||
qprint(const char *const fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (!quiet) {
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stdout, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
help(char *complaint)
|
||||
{
|
||||
|
@ -1664,15 +1679,3 @@ write_newcap_script(void)
|
|||
fclose(script);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
qprint(const char *const fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
|
||||
if (!quiet) {
|
||||
va_start(ap, fmt);
|
||||
vfprintf(stdout, fmt, ap);
|
||||
va_end(ap);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue