forked from len0rd/rockbox
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
This commit is contained in:
parent
5c9688961e
commit
aced667f48
13 changed files with 110 additions and 142 deletions
|
@ -311,14 +311,14 @@ void HU_Init(void)
|
|||
{
|
||||
snprintf(buffer, sizeof(buffer), "DIG%d",j-48);
|
||||
R_SetPatchNum(hu_font2 +i, buffer);
|
||||
snprintf(buffer, sizeof(buffer), "STCFN%s%d", (j/10>0?"0":"00"), j); //NOTE ROCKHACK: "STCFN%.3d"
|
||||
snprintf(buffer, sizeof(buffer), "STCFN%.3d", j);
|
||||
R_SetPatchNum(&hu_font[i], buffer);
|
||||
}
|
||||
else if ('A'<=j && j<='Z')
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "DIG%c",j);
|
||||
R_SetPatchNum(hu_font2 +i, buffer);
|
||||
snprintf(buffer, sizeof(buffer), "STCFN%s%d", (j/10>0?"0":"00"), j); //NOTE ROCKHACK: "STCFN%.3d"
|
||||
snprintf(buffer, sizeof(buffer), "STCFN%.3d", j);
|
||||
R_SetPatchNum(&hu_font[i], buffer);
|
||||
}
|
||||
else if (j=='-')
|
||||
|
@ -348,14 +348,14 @@ void HU_Init(void)
|
|||
}
|
||||
else if (j<97)
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "STCFN%s%d", (j/10>0?"0":"00"), j); //NOTE ROCKHACK: "STCFN%.3d"
|
||||
snprintf(buffer, sizeof(buffer), "STCFN%.3d", j);
|
||||
R_SetPatchNum(hu_font2 +i, buffer);
|
||||
R_SetPatchNum(&hu_font[i], buffer);
|
||||
//jff 2/23/98 make all font chars defined, useful or not
|
||||
}
|
||||
else if (j>122)
|
||||
{
|
||||
snprintf(buffer, sizeof(buffer), "STBR%d", j); //NOTE: "STBR%.3d"
|
||||
snprintf(buffer, sizeof(buffer), "STBR%.3d", j);
|
||||
R_SetPatchNum(hu_font2 +i, buffer);
|
||||
R_SetPatchNum(&hu_font[i], buffer);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue