From 50d340de00ac23c0a75ad613ad3aa64f0f28fb57 Mon Sep 17 00:00:00 2001 From: johndoe123 Date: Fri, 1 Aug 2014 23:43:37 +0200 Subject: ILLUSIONS: Rename file scriptman,* to scriptstack.* and remove unneccessary includes of it --- engines/illusions/abortablethread.cpp | 1 - engines/illusions/actor.cpp | 1 - engines/illusions/bbdou/bbdou_inventory.cpp | 1 - engines/illusions/bbdou/bbdou_specialcode.cpp | 2 +- engines/illusions/illusions.cpp | 1 - engines/illusions/illusions_bbdou.cpp | 4 +- engines/illusions/illusions_duckman.cpp | 2 +- engines/illusions/module.mk | 2 +- engines/illusions/scriptman.cpp | 79 --------------------------- engines/illusions/scriptman.h | 61 --------------------- engines/illusions/scriptopcodes_bbdou.cpp | 2 +- engines/illusions/scriptopcodes_duckman.cpp | 2 +- engines/illusions/scriptresource.cpp | 1 - engines/illusions/scriptstack.cpp | 67 +++++++++++++++++++++++ engines/illusions/scriptstack.h | 43 +++++++++++++++ engines/illusions/scriptthread.cpp | 1 - engines/illusions/sequenceopcodes.cpp | 1 - engines/illusions/talkthread.cpp | 1 - engines/illusions/talkthread_duckman.cpp | 1 - engines/illusions/timerthread.cpp | 1 - 20 files changed, 116 insertions(+), 158 deletions(-) delete mode 100644 engines/illusions/scriptman.cpp delete mode 100644 engines/illusions/scriptman.h create mode 100644 engines/illusions/scriptstack.cpp create mode 100644 engines/illusions/scriptstack.h (limited to 'engines') diff --git a/engines/illusions/abortablethread.cpp b/engines/illusions/abortablethread.cpp index 5f46ca8423..15c8f6c82b 100644 --- a/engines/illusions/abortablethread.cpp +++ b/engines/illusions/abortablethread.cpp @@ -23,7 +23,6 @@ #include "illusions/illusions.h" #include "illusions/abortablethread.h" #include "illusions/input.h" -#include "illusions/scriptman.h" #include "illusions/time.h" namespace Illusions { diff --git a/engines/illusions/actor.cpp b/engines/illusions/actor.cpp index e2b5e9194a..b524c02e5c 100644 --- a/engines/illusions/actor.cpp +++ b/engines/illusions/actor.cpp @@ -28,7 +28,6 @@ #include "illusions/fixedpoint.h" #include "illusions/input.h" #include "illusions/screen.h" -#include "illusions/scriptman.h" #include "illusions/scriptopcodes.h" #include "illusions/sequenceopcodes.h" #include "illusions/talkthread.h" diff --git a/engines/illusions/bbdou/bbdou_inventory.cpp b/engines/illusions/bbdou/bbdou_inventory.cpp index 3c4e37cc9b..5fdda628ca 100644 --- a/engines/illusions/bbdou/bbdou_inventory.cpp +++ b/engines/illusions/bbdou/bbdou_inventory.cpp @@ -28,7 +28,6 @@ #include "illusions/camera.h" #include "illusions/dictionary.h" #include "illusions/input.h" -#include "illusions/scriptman.h" namespace Illusions { diff --git a/engines/illusions/bbdou/bbdou_specialcode.cpp b/engines/illusions/bbdou/bbdou_specialcode.cpp index eba37a8b88..5d98784219 100644 --- a/engines/illusions/bbdou/bbdou_specialcode.cpp +++ b/engines/illusions/bbdou/bbdou_specialcode.cpp @@ -29,7 +29,7 @@ #include "illusions/camera.h" #include "illusions/dictionary.h" #include "illusions/input.h" -#include "illusions/scriptman.h" +#include "illusions/scriptstack.h" #include "illusions/scriptopcodes.h" namespace Illusions { diff --git a/engines/illusions/illusions.cpp b/engines/illusions/illusions.cpp index 993da5bad4..c51eb8707d 100644 --- a/engines/illusions/illusions.cpp +++ b/engines/illusions/illusions.cpp @@ -34,7 +34,6 @@ #include "illusions/screen.h" #include "illusions/screentext.h" #include "illusions/scriptresource.h" -#include "illusions/scriptman.h" #include "illusions/sound.h" #include "illusions/soundresource.h" #include "illusions/specialcode.h" diff --git a/engines/illusions/illusions_bbdou.cpp b/engines/illusions/illusions_bbdou.cpp index 41a6be6c8c..e98d0c1ff2 100644 --- a/engines/illusions/illusions_bbdou.cpp +++ b/engines/illusions/illusions_bbdou.cpp @@ -33,9 +33,9 @@ #include "illusions/resourcesystem.h" #include "illusions/screen.h" #include "illusions/screentext.h" +#include "illusions/scriptstack.h" #include "illusions/scriptopcodes_bbdou.h" #include "illusions/scriptresource.h" -#include "illusions/scriptman.h" #include "illusions/sound.h" #include "illusions/soundresource.h" #include "illusions/specialcode.h" @@ -205,7 +205,6 @@ Common::Error IllusionsEngine_BBDOU::run() { _screen = new Screen(this, 640, 480, 16); _screenText = new ScreenText(this); _input = new Input(); - _scriptMan = new ScriptMan(this); _actorItems = new ActorItems(this); _backgroundItems = new BackgroundItems(this); _camera = new Camera(this); @@ -263,7 +262,6 @@ Common::Error IllusionsEngine_BBDOU::run() { delete _camera; delete _backgroundItems; delete _actorItems; - delete _scriptMan; delete _input; delete _screenText; delete _screen; diff --git a/engines/illusions/illusions_duckman.cpp b/engines/illusions/illusions_duckman.cpp index aee847e39f..5d845a40db 100644 --- a/engines/illusions/illusions_duckman.cpp +++ b/engines/illusions/illusions_duckman.cpp @@ -36,7 +36,7 @@ #include "illusions/screentext.h" #include "illusions/scriptopcodes_duckman.h" #include "illusions/scriptresource.h" -#include "illusions/scriptman.h" +#include "illusions/scriptstack.h" #include "illusions/sound.h" #include "illusions/soundresource.h" #include "illusions/specialcode.h" diff --git a/engines/illusions/module.mk b/engines/illusions/module.mk index 1bdec55592..ec52049239 100644 --- a/engines/illusions/module.mk +++ b/engines/illusions/module.mk @@ -26,7 +26,7 @@ MODULE_OBJS := \ resourcesystem.o \ screen.o \ screentext.o \ - scriptman.o \ + scriptstack.o \ scriptopcodes.o \ scriptopcodes_bbdou.o \ scriptopcodes_duckman.o \ diff --git a/engines/illusions/scriptman.cpp b/engines/illusions/scriptman.cpp deleted file mode 100644 index ef4f462250..0000000000 --- a/engines/illusions/scriptman.cpp +++ /dev/null @@ -1,79 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#include "illusions/illusions.h" -#include "illusions/scriptman.h" -#include "illusions/actor.h" -#include "illusions/camera.h" -#include "illusions/scriptopcodes.h" - -namespace Illusions { - -// ScriptStack - -ScriptStack::ScriptStack() { - clear(); -} - -void ScriptStack::clear() { - for (uint i = 0; i < 256; ++i) - _stack[i] = (int16)0xEEEE; - _stackPos = 256; -} - -void ScriptStack::push(int16 value) { - --_stackPos; - if (_stackPos > 0) - _stack[_stackPos] = value; -} - -int16 ScriptStack::pop() { - int16 value = 0; - if (_stackPos < 256) { - value = _stack[_stackPos]; - _stack[_stackPos] = (int16)0xEEEE; - ++_stackPos; - } - return value; -} - -int16 ScriptStack::peek() { - int16 value = 0; - if (_stackPos < 256) - value = _stack[_stackPos]; - return value; -} - -int16 *ScriptStack::topPtr() { - return &_stack[_stackPos]; -} - -// ScriptMan - -ScriptMan::ScriptMan(IllusionsEngine_BBDOU *vm) - : _vm(vm) { -} - -ScriptMan::~ScriptMan() { -} - -} // End of namespace Illusions diff --git a/engines/illusions/scriptman.h b/engines/illusions/scriptman.h deleted file mode 100644 index d296d807bd..0000000000 --- a/engines/illusions/scriptman.h +++ /dev/null @@ -1,61 +0,0 @@ -/* ScummVM - Graphic Adventure Engine - * - * ScummVM is the legal property of its developers, whose names - * are too numerous to list here. Please refer to the COPYRIGHT - * file distributed with this source distribution. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - * - */ - -#ifndef ILLUSIONS_SCRIPTMAN_H -#define ILLUSIONS_SCRIPTMAN_H - -#include "illusions/illusions_bbdou.h" -#include "illusions/scriptresource.h" -#include "illusions/thread.h" -#include "common/algorithm.h" -#include "common/stack.h" - -namespace Illusions { - -class IllusionsEngine_BBDOU; - -class ScriptStack { -public: - ScriptStack(); - void clear(); - void push(int16 value); - int16 pop(); - int16 peek(); - int16 *topPtr(); -protected: - int _stackPos; - int16 _stack[256]; -}; - -class ScriptMan { -public: - ScriptMan(IllusionsEngine_BBDOU *vm); - ~ScriptMan(); -public: - - IllusionsEngine_BBDOU *_vm; - -}; - -} // End of namespace Illusions - -#endif // ILLUSIONS_SCRIPTMAN_H diff --git a/engines/illusions/scriptopcodes_bbdou.cpp b/engines/illusions/scriptopcodes_bbdou.cpp index 32350cd69e..e152c34074 100644 --- a/engines/illusions/scriptopcodes_bbdou.cpp +++ b/engines/illusions/scriptopcodes_bbdou.cpp @@ -27,7 +27,7 @@ #include "illusions/dictionary.h" #include "illusions/input.h" #include "illusions/screen.h" -#include "illusions/scriptman.h" +#include "illusions/scriptstack.h" #include "illusions/scriptresource.h" #include "illusions/scriptthread.h" #include "illusions/sound.h" diff --git a/engines/illusions/scriptopcodes_duckman.cpp b/engines/illusions/scriptopcodes_duckman.cpp index 541ad18e11..8dd6af1155 100644 --- a/engines/illusions/scriptopcodes_duckman.cpp +++ b/engines/illusions/scriptopcodes_duckman.cpp @@ -27,7 +27,7 @@ #include "illusions/dictionary.h" #include "illusions/input.h" #include "illusions/screen.h" -#include "illusions/scriptman.h" +#include "illusions/scriptstack.h" #include "illusions/scriptresource.h" #include "illusions/scriptthread.h" #include "illusions/sound.h" diff --git a/engines/illusions/scriptresource.cpp b/engines/illusions/scriptresource.cpp index 18a258aa6c..71c8b89dc5 100644 --- a/engines/illusions/scriptresource.cpp +++ b/engines/illusions/scriptresource.cpp @@ -22,7 +22,6 @@ #include "illusions/illusions.h" #include "illusions/scriptresource.h" -#include "illusions/scriptman.h" namespace Illusions { diff --git a/engines/illusions/scriptstack.cpp b/engines/illusions/scriptstack.cpp new file mode 100644 index 0000000000..36cd3cb8e5 --- /dev/null +++ b/engines/illusions/scriptstack.cpp @@ -0,0 +1,67 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#include "illusions/illusions.h" +#include "illusions/scriptstack.h" + +namespace Illusions { + +// ScriptStack + +ScriptStack::ScriptStack() { + clear(); +} + +void ScriptStack::clear() { + for (uint i = 0; i < 256; ++i) + _stack[i] = (int16)0xEEEE; + _stackPos = 256; +} + +void ScriptStack::push(int16 value) { + --_stackPos; + if (_stackPos > 0) + _stack[_stackPos] = value; +} + +int16 ScriptStack::pop() { + int16 value = 0; + if (_stackPos < 256) { + value = _stack[_stackPos]; + _stack[_stackPos] = (int16)0xEEEE; + ++_stackPos; + } + return value; +} + +int16 ScriptStack::peek() { + int16 value = 0; + if (_stackPos < 256) + value = _stack[_stackPos]; + return value; +} + +int16 *ScriptStack::topPtr() { + return &_stack[_stackPos]; +} + +} // End of namespace Illusions diff --git a/engines/illusions/scriptstack.h b/engines/illusions/scriptstack.h new file mode 100644 index 0000000000..b738102888 --- /dev/null +++ b/engines/illusions/scriptstack.h @@ -0,0 +1,43 @@ +/* ScummVM - Graphic Adventure Engine + * + * ScummVM is the legal property of its developers, whose names + * are too numerous to list here. Please refer to the COPYRIGHT + * file distributed with this source distribution. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + * + */ + +#ifndef ILLUSIONS_SCRIPTSTACK_H +#define ILLUSIONS_SCRIPTSTACK_H + +namespace Illusions { + +class ScriptStack { +public: + ScriptStack(); + void clear(); + void push(int16 value); + int16 pop(); + int16 peek(); + int16 *topPtr(); +protected: + int _stackPos; + int16 _stack[256]; +}; + +} // End of namespace Illusions + +#endif // ILLUSIONS_SCRIPTSTACK_H diff --git a/engines/illusions/scriptthread.cpp b/engines/illusions/scriptthread.cpp index ba072e9407..a820289183 100644 --- a/engines/illusions/scriptthread.cpp +++ b/engines/illusions/scriptthread.cpp @@ -22,7 +22,6 @@ #include "illusions/illusions.h" #include "illusions/scriptthread.h" -#include "illusions/scriptman.h" #include "illusions/scriptopcodes.h" namespace Illusions { diff --git a/engines/illusions/sequenceopcodes.cpp b/engines/illusions/sequenceopcodes.cpp index 5ef5158951..ef76c782e6 100644 --- a/engines/illusions/sequenceopcodes.cpp +++ b/engines/illusions/sequenceopcodes.cpp @@ -26,7 +26,6 @@ #include "illusions/actorresource.h" #include "illusions/dictionary.h" #include "illusions/screen.h" -#include "illusions/scriptman.h" #include "illusions/scriptopcodes.h" #include "illusions/sound.h" diff --git a/engines/illusions/talkthread.cpp b/engines/illusions/talkthread.cpp index 783e9d2361..7d97588d8c 100644 --- a/engines/illusions/talkthread.cpp +++ b/engines/illusions/talkthread.cpp @@ -25,7 +25,6 @@ #include "illusions/actor.h" #include "illusions/dictionary.h" #include "illusions/input.h" -#include "illusions/scriptman.h" #include "illusions/sound.h" #include "illusions/talkresource.h" #include "illusions/time.h" diff --git a/engines/illusions/talkthread_duckman.cpp b/engines/illusions/talkthread_duckman.cpp index 788126810b..6807c9869c 100644 --- a/engines/illusions/talkthread_duckman.cpp +++ b/engines/illusions/talkthread_duckman.cpp @@ -26,7 +26,6 @@ #include "illusions/dictionary.h" #include "illusions/input.h" #include "illusions/screentext.h" -#include "illusions/scriptman.h" #include "illusions/sound.h" #include "illusions/talkresource.h" #include "illusions/time.h" diff --git a/engines/illusions/timerthread.cpp b/engines/illusions/timerthread.cpp index 8cd5ea2e1c..95b30fec24 100644 --- a/engines/illusions/timerthread.cpp +++ b/engines/illusions/timerthread.cpp @@ -23,7 +23,6 @@ #include "illusions/illusions.h" #include "illusions/timerthread.h" #include "illusions/input.h" -#include "illusions/scriptman.h" #include "illusions/time.h" namespace Illusions { -- cgit v1.2.3