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 | |
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')
-rw-r--r-- | engines/zvision/control.cpp | 24 | ||||
-rw-r--r-- | engines/zvision/control.h | 2 |
2 files changed, 26 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 diff --git a/engines/zvision/control.h b/engines/zvision/control.h index 65d76da5c4..93ad5f5df1 100644 --- a/engines/zvision/control.h +++ b/engines/zvision/control.h @@ -24,6 +24,7 @@ #define ZVISION_CONTROL_H #include "common/keyboard.h" +#include "common/str.h" namespace Common { @@ -102,6 +103,7 @@ protected: ZVision *_engine; uint32 _key; + void getParams(Common::String &input_str, Common::String ¶meter, Common::String &values); // Static member functions public: static void parseFlatControl(ZVision *engine); |