add PAUSE code to ansis

This commit is contained in:
Andrew Pamment 2018-05-27 13:07:07 +10:00
parent 22277f7393
commit efdd46f97a

View File

@ -349,8 +349,11 @@ void s_displayansi_pause(char *file, int pause) {
char ch;
int lines = 0;
char lastch = 0;
char buffer[9];
int len;
fptr = fopen(file, "r");
if (!fptr) {
return;
}
@ -358,6 +361,22 @@ void s_displayansi_pause(char *file, int pause) {
while (!feof(fptr) && c != 0x1a) {
if (c == '\n' && lastch != '\r') {
s_putchar('\r');
} else if (c == '@') {
memset(buffer, 0, 10);
len = fread(buffer, 1, 8, fptr);
if (len != 8 || strcmp(buffer, "@PAUSE@@") != 0) {
s_putchar('@');
s_putstring(buffer);
c = fgetc(fptr);
continue;
} else {
s_printf(get_string(185));
ch = s_getchar();
s_printf("\r\n");
c = fgetc(fptr);
continue;
}
}
s_putchar(c);