From aced667f48c29a160aa4e5c0a8df037092b28189 Mon Sep 17 00:00:00 2001 From: Michael Sevakis Date: Mon, 18 Sep 2017 06:00:05 -0400 Subject: Undo hacks to meant to get around string formatting limitations The new vuprintf makes unnecessary workarounds due to formatting limitations. I checked grep output for whatever appeared to fit but it's possible I missed some instances because they weren't so obvious. Also, this means sound settings can dynamically work with any number of decimals rather than the current assumption of one or two. Add an ipow() function to help and take advantage of dynamic field width and precision. Consolidate string formatting of sound settings. Change-Id: I46caf534859dfd1916cd440cd25e5206b192fcd8 --- apps/plugins/doom/wi_stuff.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'apps/plugins/doom/wi_stuff.c') diff --git a/apps/plugins/doom/wi_stuff.c b/apps/plugins/doom/wi_stuff.c index 7c7831d084..b73839f55b 100644 --- a/apps/plugins/doom/wi_stuff.c +++ b/apps/plugins/doom/wi_stuff.c @@ -397,8 +397,7 @@ void WI_unloadData(void); void WI_levelNameLump(int epis, int map, char* buf, int bsize) { if (gamemode == commercial) { - snprintf(buf, bsize,"CWILV%s%d",(map/10>0?"":"0"), map); //ANOTHER ROCKHACK "CWILV%2.2d" - //snprintf(buf,bsize, "CWILV%2.2d", map); + snprintf(buf,bsize, "CWILV%2.2d", map); } else { snprintf(buf,bsize, "WILV%d%d", epis, map); } @@ -1829,8 +1828,7 @@ void WI_loadData(void) if (wbs->epsd != 1 || j != 8) { // animations - snprintf(name, sizeof(name),"WIA%d%s%d%s%d", wbs->epsd, (j/10>0?"":"0"), j,(i/10>0?"":"0"), i); //ANOTHER ROCKHACK - //snprintf(name, sizeof(name),"WIA%d%.2d%.2d", wbs->epsd, j, i); + snprintf(name, sizeof(name),"WIA%d%.2d%.2d", wbs->epsd, j, i); a->p[i] = W_CacheLumpName(name); } else @@ -1872,8 +1870,7 @@ void WI_unloadData(void) // MONDO HACK! if (wbs->epsd != 1 || j != 8) { // animations - snprintf(name, sizeof(name),"WIA%d%s%d%s%d", wbs->epsd, (j/10>0?"":"0"), j,(i/10>0?"":"0"), i); //ANOTHER ROCKHACK - //snprintf(name,sizeof(name), "WIA%d%.2d%.2d", wbs->epsd, j, i); + snprintf(name,sizeof(name), "WIA%d%.2d%.2d", wbs->epsd, j, i); W_UnlockLumpName(name); } } -- cgit v1.2.3