- removed all Doom specific dependencies from cmdlib.cpp/h.

This meant moving CleanseString and ParseHex elsewhere and removing the I_Error call from ScanDirectory.
This commit is contained in:
Christoph Oelckers 2019-08-20 20:10:54 +02:00
commit 3cfda930ea
10 changed files with 100 additions and 106 deletions

View file

@ -1259,4 +1259,37 @@ void FScriptPosition::Message (int severity, const char *message, ...) const
color, type, FileName.GetChars(), ScriptLine, color, composed.GetChars());
}
//==========================================================================
//
// ParseHex
//
//==========================================================================
int ParseHex(const char* hex, FScriptPosition* sc)
{
const char* str;
int num;
num = 0;
str = hex;
while (*str)
{
num <<= 4;
if (*str >= '0' && *str <= '9')
num += *str - '0';
else if (*str >= 'a' && *str <= 'f')
num += 10 + *str - 'a';
else if (*str >= 'A' && *str <= 'F')
num += 10 + *str - 'A';
else {
sc->Message(MSG_WARNING, "Bad hex number: %s", hex);
return 0;
}
str++;
}
return num;
}