aboutsummaryrefslogtreecommitdiff
path: root/engines/illusions/thread.h
diff options
context:
space:
mode:
authorjohndoe1232014-03-13 10:05:22 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commitd2b036fa5b22f7a4802443b5b72adb6d444893c3 (patch)
tree6a0b4167b87630cb69526b0a3884ba8e9034ccf6 /engines/illusions/thread.h
parent4211f8ffcd74563c7f7a17c34cc14ebc7bdeee59 (diff)
downloadscummvm-rg350-d2b036fa5b22f7a4802443b5b72adb6d444893c3.tar.gz
scummvm-rg350-d2b036fa5b22f7a4802443b5b72adb6d444893c3.tar.bz2
scummvm-rg350-d2b036fa5b22f7a4802443b5b72adb6d444893c3.zip
ILLUSIONS: Start with thread classes
Diffstat (limited to 'engines/illusions/thread.h')
-rw-r--r--engines/illusions/thread.h75
1 files changed, 75 insertions, 0 deletions
diff --git a/engines/illusions/thread.h b/engines/illusions/thread.h
new file mode 100644
index 0000000000..27d4c41657
--- /dev/null
+++ b/engines/illusions/thread.h
@@ -0,0 +1,75 @@
+/* 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_THREAD_H
+#define ILLUSIONS_THREAD_H
+
+#include "common/list.h"
+
+namespace Illusions {
+
+class IllusionsEngine;
+
+class Thread {
+public:
+ Thread(IllusionsEngine *vm);
+ virtual ~Thread();
+ virtual int onUpdate() = 0;
+ virtual void onSuspend() = 0;
+ virtual void onNotify() = 0;
+ virtual void onPause() = 0;
+ virtual void onResume() = 0;
+ virtual void onTerminated() = 0;
+ void pause();
+ void resume();
+ void suspend();
+ void notify();
+ int update();
+ void terminate();
+public:
+ IllusionsEngine *_vm;
+ //field_0 dw
+ int _pauseCtr;
+ bool _terminated;
+ //field_6 dw
+ uint _type;
+ uint32 _threadId;
+ uint32 _callingThreadId;
+ uint32 _tag;
+ uint _notifyFlags;
+};
+
+class ThreadList {
+public:
+ ThreadList(IllusionsEngine *vm);
+ void startThread(Thread *thread);
+ void updateThreads();
+protected:
+ typedef Common::List<Thread*> List;
+ typedef List::iterator Iterator;
+ IllusionsEngine *_vm;
+ List _threads;
+};
+
+} // End of namespace Illusions
+
+#endif // ILLUSIONS_THREAD_H