diff options
author | Strangerke | 2011-09-05 21:21:42 +0200 |
---|---|---|
committer | Strangerke | 2011-09-05 21:21:42 +0200 |
commit | 27328f254639a0db8a4d8c26afcfc8b605adf353 (patch) | |
tree | 40d20eb43a58ea5cad6d32dbdf0aee042fcb9271 /engines | |
parent | 76f410958a6682406264032c401b80f322749950 (diff) | |
download | scummvm-rg350-27328f254639a0db8a4d8c26afcfc8b605adf353.tar.gz scummvm-rg350-27328f254639a0db8a4d8c26afcfc8b605adf353.tar.bz2 scummvm-rg350-27328f254639a0db8a4d8c26afcfc8b605adf353.zip |
CGE: Little cleanup of vmenu
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge/vmenu.cpp | 45 | ||||
-rw-r--r-- | engines/cge/vmenu.h | 7 |
2 files changed, 26 insertions, 26 deletions
diff --git a/engines/cge/vmenu.cpp b/engines/cge/vmenu.cpp index c8a21160bf..1497d5823c 100644 --- a/engines/cge/vmenu.cpp +++ b/engines/cge/vmenu.cpp @@ -59,29 +59,6 @@ MenuBar::MenuBar(CGEEngine *vm, uint16 w) : Talk(vm), _vm(vm) { _flags._bDel = true; } -static char *g_vmgt; - -char *VMGather(Choice *list) { - Choice *cp; - int len = 0, h = 0; - - for (cp = list; cp->_text; cp++) { - len += strlen(cp->_text); - h++; - } - g_vmgt = new char[len + h]; - if (g_vmgt) { - *g_vmgt = '\0'; - for (cp = list; cp->_text; cp++) { - if (*g_vmgt) - strcat(g_vmgt, "|"); - strcat(g_vmgt, cp->_text); - h++; - } - } - return g_vmgt; -} - Vmenu *Vmenu::_addr = NULL; int Vmenu::_recent = -1; @@ -90,7 +67,7 @@ Vmenu::Vmenu(CGEEngine *vm, Choice *list, int x, int y) Choice *cp; _addr = this; - delete[] g_vmgt; + delete[] _vmgt; _items = 0; for (cp = list; cp->_text; cp++) _items++; @@ -142,4 +119,24 @@ void Vmenu::touch(uint16 mask, int x, int y) { } } +char *Vmenu::VMGather(Choice *list) { + Choice *cp; + int len = 0, h = 0; + + for (cp = list; cp->_text; cp++) { + len += strlen(cp->_text); + h++; + } + _vmgt = new char[len + h]; + if (_vmgt) { + *_vmgt = '\0'; + for (cp = list; cp->_text; cp++) { + if (*_vmgt) + strcat(_vmgt, "|"); + strcat(_vmgt, cp->_text); + h++; + } + } + return _vmgt; +} } // End of namespace CGE diff --git a/engines/cge/vmenu.h b/engines/cge/vmenu.h index 30fcb53f4b..b8740a9e93 100644 --- a/engines/cge/vmenu.h +++ b/engines/cge/vmenu.h @@ -53,8 +53,6 @@ private: class Vmenu : public Talk { - uint16 _items; - Choice *_menu; public: static Vmenu *_addr; static int _recent; @@ -63,7 +61,12 @@ public: ~Vmenu(); virtual void touch(uint16 mask, int x, int y); private: + char *_vmgt; CGEEngine *_vm; + uint16 _items; + Choice *_menu; + + char *VMGather(Choice *list); }; } // End of namespace CGE |