Fixed warnings about unknown commands in scene files
parent
652dc6081d
commit
181a404930
|
@ -81,6 +81,9 @@
|
|||
|
||||
#include <iomanip>
|
||||
|
||||
#include <boost/regex.hpp>
|
||||
|
||||
|
||||
template<> CRobotMain* CSingleton<CRobotMain>::m_instance = nullptr;
|
||||
|
||||
|
||||
|
@ -4050,9 +4053,14 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject)
|
|||
continue;
|
||||
}
|
||||
|
||||
if (Cmd(line, "Title")) continue; // Ignore
|
||||
if (Cmd(line, "Resume")) continue; // Ignore
|
||||
if (Cmd(line, "ScriptName")) continue; // Ignore
|
||||
static const boost::regex titleCmdRe("Title\\.[A-Z]");
|
||||
static const boost::regex resumeCmdRe("Resume\\.[A-Z]");
|
||||
static const boost::regex scriptNameCmdRe("ScriptName\.[A-Z]");
|
||||
|
||||
if (boost::regex_match(GetCmd(line), titleCmdRe)) continue; // Ignore
|
||||
if (boost::regex_match(GetCmd(line), resumeCmdRe)) continue; // Ignore
|
||||
if (boost::regex_match(GetCmd(line), scriptNameCmdRe)) continue; // Ignore
|
||||
|
||||
|
||||
if (Cmd(line, "ScriptFile") && !resetObject)
|
||||
{
|
||||
|
|
|
@ -35,6 +35,16 @@ char* SkipSpace(char *line)
|
|||
return line;
|
||||
}
|
||||
|
||||
std::string GetCmd(char* line)
|
||||
{
|
||||
line = SkipSpace(line);
|
||||
|
||||
int len = 0;
|
||||
for(char* x = line; *x != 0 && *x != ' ' && *x != '\t' && *x != '\n'; x++, len++);
|
||||
|
||||
return std::string(line, len);
|
||||
}
|
||||
|
||||
// Checks if a line contains a command.
|
||||
|
||||
bool Cmd(char *line, const char *token)
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
// Procedures.
|
||||
|
||||
extern std::string GetCmd(char* line);
|
||||
extern bool Cmd(char *line, const char *token);
|
||||
extern char* SearchOp(char *line, const char *op);
|
||||
|
||||
|
|
Loading…
Reference in New Issue