provide some debug developer controls - part 1

This commit is contained in:
nhmall
2018-05-10 10:05:29 -04:00
parent 4dd535cbd2
commit 702154529f
6 changed files with 108 additions and 16 deletions

View File

@@ -331,9 +331,14 @@ _CrtSetReportFile(_CRT_ASSERT, _CRTDBG_FILE_STDERR);*/
Strcpy(hackdir, HACKDIR);
#endif
if (argc > 1) {
if (argcheck(argc, argv, ARG_VERSION))
if (argcheck(argc, argv, ARG_VERSION) == 2)
nethack_exit(EXIT_SUCCESS);
if (argcheck(argc, argv, ARG_DEBUG) == 1) {
argc--;
argv++;
}
if (!strncmp(argv[1], "-d", 2) && argv[1][2] != 'e') {
/* avoid matching "-dec" for DECgraphics; since the man page
* says -d directory, hope nobody's using -desomething_else

View File

@@ -111,9 +111,14 @@ char *argv[];
dir = nh_getenv("HACKDIR");
if (argc > 1) {
if (argcheck(argc, argv, ARG_VERSION))
if (argcheck(argc, argv, ARG_VERSION) == 2)
exit(EXIT_SUCCESS);
if (argcheck(argc, argv, ARG_DEBUG) == 1) {
argc--;
argv++;
}
if (!strncmp(argv[1], "-d", 2) && argv[1][2] != 'e') {
/* avoid matching "-dec" for DECgraphics; since the man page
* says -d directory, hope nobody's using -desomething_else

View File

@@ -252,8 +252,6 @@ cell_t undefined_cell;
static boolean buffer_flipping_initialized = FALSE;
boolean do_immediate_flips = FALSE;
static void check_buffer_size(int width, int height);
static cell_t * buffer_get_cell(console_buffer_t * buffer, int x, int y);
@@ -370,7 +368,7 @@ static void buffer_fill_to_end(console_buffer_t * buffer, cell_t * src,
while (dst != sentinel)
*dst++ = clear_cell;
if (do_immediate_flips && buffer == &back_buffer)
if (iflags.debug.immediateflips && buffer == &back_buffer)
back_buffer_flip();
}
@@ -379,7 +377,7 @@ static void back_buffer_write(cell_t * cell, int x, int y)
cell_t * dst = buffer_get_cell(&back_buffer, x, y);
*dst = *cell;
if (do_immediate_flips)
if (iflags.debug.immediateflips)
back_buffer_flip();
}
@@ -393,7 +391,7 @@ static void back_buffer_clear_to_end_of_line(int x, int y)
while (cell != sentinel)
*cell++ = clear_cell;
if (do_immediate_flips)
if (iflags.debug.immediateflips)
back_buffer_flip();
}