diff options
author | Marisa-Chan | 2013-12-24 15:05:23 +0700 |
---|---|---|
committer | Marisa-Chan | 2013-12-24 15:05:23 +0700 |
commit | fd325d49f9103408f7d2fc10cc99dae7fab9a0a1 (patch) | |
tree | 538a5021853eafd9df8c7d83b6dc0b8773083b44 /engines/zvision/control.cpp | |
parent | 621818836e6a1100bbed2dbc1520a1005f1ad9ed (diff) | |
download | scummvm-rg350-fd325d49f9103408f7d2fc10cc99dae7fab9a0a1.tar.gz scummvm-rg350-fd325d49f9103408f7d2fc10cc99dae7fab9a0a1.tar.bz2 scummvm-rg350-fd325d49f9103408f7d2fc10cc99dae7fab9a0a1.zip |
ZVISION: Add splitter function into controls class.
Diffstat (limited to 'engines/zvision/control.cpp')
-rw-r--r-- | engines/zvision/control.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/engines/zvision/control.cpp b/engines/zvision/control.cpp index 0346228681..ef2e90f8ce 100644 --- a/engines/zvision/control.cpp +++ b/engines/zvision/control.cpp @@ -103,4 +103,28 @@ void Control::parseTiltControl(ZVision *engine, Common::SeekableReadStream &stre renderTable->generateRenderTable(); } +void Control::getParams(Common::String &input_str, Common::String ¶meter, Common::String &values) { + const char *chrs = input_str.c_str(); + uint lbr; + + for (lbr = 0; lbr < input_str.size(); lbr++) + if (chrs[lbr] == '(') + break; + + if (lbr >= input_str.size()) + return; + + uint rbr; + + for (rbr = lbr + 1; rbr < input_str.size(); rbr++) + if (chrs[rbr] == ')') + break; + + if (rbr >= input_str.size()) + return; + + parameter = Common::String(chrs, chrs + lbr); + values = Common::String(chrs + lbr + 1, chrs + rbr); +} + } // End of namespace ZVision |