Add optional command line argument define.
This commit is contained in:
@@ -102,6 +102,23 @@ bool CommandLine::Parse(const Char* cmdLine)
|
||||
*(end - len) = 0; \
|
||||
end -= len; \
|
||||
}
|
||||
|
||||
#define PARSE_ARG_OPT_SWITCH(text, field) \
|
||||
pos = (Char*)StringUtils::FindIgnoreCase(buffer.Get(), TEXT(text)); \
|
||||
if (pos) \
|
||||
{ \
|
||||
len = ARRAY_COUNT(text) - 1; \
|
||||
if (ParseArg(pos + len, argStart, argEnd)) \
|
||||
Options.field = String::Empty; \
|
||||
else \
|
||||
{ \
|
||||
Options.field = String(argStart, static_cast<int32>(argEnd - argStart)); \
|
||||
len = static_cast<int32>((argEnd - pos) + 1); \
|
||||
Platform::MemoryCopy(pos, pos + len, (end - pos - len) * 2); \
|
||||
*(end - len) = 0; \
|
||||
end -= len; \
|
||||
} \
|
||||
}
|
||||
|
||||
PARSE_BOOL_SWITCH("-windowed ", Windowed);
|
||||
PARSE_BOOL_SWITCH("-fullscreen ", Fullscreen);
|
||||
|
||||
Reference in New Issue
Block a user