From da0ba41903bf50c3a6cb2923ca943386cd984f8c Mon Sep 17 00:00:00 2001 From: Einar Johan Trøan Sømåen Date: Sun, 29 Jul 2012 14:56:39 +0200 Subject: WINTERMUTE: Remove more unused utils. --- engines/wintermute/utils/utils.cpp | 72 -------------------------------------- 1 file changed, 72 deletions(-) (limited to 'engines/wintermute/utils/utils.cpp') diff --git a/engines/wintermute/utils/utils.cpp b/engines/wintermute/utils/utils.cpp index 05aa34f95f..6571147a80 100644 --- a/engines/wintermute/utils/utils.cpp +++ b/engines/wintermute/utils/utils.cpp @@ -91,18 +91,6 @@ char *BaseUtils::setString(char **string, const char *value) { return *string; } -////////////////////////////////////////////////////////////////////////// -int BaseUtils::strNumEntries(const char *str, const char delim) { - int numEntries = 1; - for (uint32 i = 0; i < strlen(str); i++) { - if (str[i] == delim) { - numEntries++; - } - } - return numEntries; -} - - ////////////////////////////////////////////////////////////////////////// char *BaseUtils::strEntry(int entry, const char *str, const char delim) { int numEntries = 0; @@ -157,66 +145,6 @@ float BaseUtils::randomAngle(float from, float to) { return normalizeAngle(randomFloat(from, to)); } -////////////////////////////////////////////////////////////////////////// -bool BaseUtils::matchesPattern(const char *pattern, const char *string) { - char stringc, patternc; - - for (;; ++string) { - stringc = toupper(*string); - patternc = toupper(*pattern++); - - switch (patternc) { - case 0: - return (stringc == 0); - - case '?': - if (stringc == 0) { - return false; - } - break; - - case '*': - if (!*pattern) { - return true; - } - - if (*pattern == '.') { - char *dot; - if (pattern[1] == '*' && pattern[2] == 0) { - return true; - } - dot = (char *)strchr(string, '.'); - if (pattern[1] == 0) { - return (dot == NULL || dot[1] == 0); - } - if (dot != NULL) { - string = dot; - if (strpbrk(pattern, "*?[") == NULL && strchr(string + 1, '.') == NULL) { - return(scumm_stricmp(pattern + 1, string + 1) == 0); - } - } - } - - while (*string) - if (BaseUtils::matchesPattern(pattern, string++)) { - return true; - } - return false; - - default: - if (patternc != stringc) { - if (patternc == '.' && stringc == 0) { - return(BaseUtils::matchesPattern(pattern, string)); - } else { - return false; - } - } - break; - } - } -} - - ////////////////////////////////////////////////////////////////////////// void BaseUtils::RGBtoHSL(uint32 rgbColor, byte *outH, byte *outS, byte *outL) { float varR = (RGBCOLGetR(rgbColor) / 255.0f); -- cgit v1.2.3