From 3e9f25081da92c0b4ce62fcaf6fe5fc1725a96f9 Mon Sep 17 00:00:00 2001 From: terminx Date: Thu, 23 May 2013 18:27:24 +0000 Subject: [PATCH] Add a simple indicator of progress when loading a large def (like the HRP)... print one period to the startup window per 50 passes of the main loop in defsparser() git-svn-id: https://svn.eduke32.com/eduke32@3801 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/defs.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/polymer/eduke32/build/src/defs.c b/polymer/eduke32/build/src/defs.c index fde50a450..d07c5a0e7 100644 --- a/polymer/eduke32/build/src/defs.c +++ b/polymer/eduke32/build/src/defs.c @@ -196,6 +196,7 @@ static int32_t defsparser(scriptfile *script) { int32_t tokn; char *cmdtokptr; + static uint32_t iter = 0; static const tokenlist basetokens[] = { @@ -259,6 +260,14 @@ static int32_t defsparser(scriptfile *script) while (1) { + if (++iter >= 50) + { + flushlogwindow = 1; + initprintf("."); + flushlogwindow = 0; + iter = 0; + } + if (quitevent) return 0; tokn = getatoken(script,basetokens,sizeof(basetokens)/sizeof(tokenlist)); cmdtokptr = script->ltextptr; @@ -2097,6 +2106,7 @@ static int32_t defsparser(scriptfile *script) initprintf("Unknown token.\n"); break; } } + return 0; } @@ -2130,6 +2140,8 @@ int32_t loaddefinitionsfile(const char *fn) if (!script) return -1; + initprintf("\n"); + return 0; }