ScummVM API documentation
snail.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22/*
23 * This code is based on original Soltys source code
24 * Copyright (c) 1994-1995 Janusz B. Wisniewski and L.K. Avalon
25 */
26
27#ifndef CGE_COMMANDHANDLER_H
28#define CGE_COMMANDHANDLER_H
29
30#include "cge/cge.h"
31
32namespace CGE {
33
34#define kCommandFrameRate 80
35#define kCommandFrameDelay (1000 / kCommandFrameRate)
36#define kDressed 3
37
38enum CommandType {
39 kCmdLabel, kCmdPause, kCmdWait, kCmdLevel, kCmdHide,
40 kCmdSay, kCmdInf, kCmdTime, kCmdCave, kCmdKill,
41 kCmdRSeq, kCmdSeq, kCmdSend, kCmdSwap, kCmdKeep,
42 kCmdGive, kCmdIf, kCmdGame, kCmdSetX0, kCmdSetY0,
43 kCmdSlave, kCmdSetXY, kCmdRelX, kCmdRelY, kCmdRelZ,
44 kCmdSetX, kCmdSetY, kCmdSetZ, kCmdTrans, kCmdPort,
45 kCmdNext, kCmdNNext, kCmdTNext, kCmdRNNext, kCmdRTNext,
46 kCmdRMNear, kCmdRmTake, kCmdFlag, kCmdSetRef, kCmdBackPt,
47 kCmdFlash, kCmdLight, kCmdSetVBarrier, kCmdSetHBarrier, kCmdWalk,
48 kCmdReach, kCmdCover, kCmdUncover, kCmdClear, kCmdTalk,
49 kCmdMouse, kCmdSound, kCmdCount, kCmdExec, kCmdStep,
50 kCmdZTrim, kCmdGhost
51};
52
54public:
55 struct Command {
56 CommandType _commandType;
57 int _ref;
58 int _val;
59 void *_spritePtr;
60 CallbackType _cbType;
61 } *_commandList;
62 static const char *_commandText[];
63 bool _talkEnable;
64
65 CommandHandler(CGEEngine *vm, bool turbo);
67 void runCommand();
68 void addCommand(CommandType com, int ref, int val, void *ptr);
69 void addCallback(CommandType com, int ref, int val, CallbackType cbType);
70 void insertCommand(CommandType com, int ref, int val, void *ptr);
71 bool idle();
72 void reset();
73private:
74 CGEEngine *_vm;
75 bool _turbo;
76 uint8 _head;
77 uint8 _tail;
78 bool _busy;
79 bool _textDelay;
80 uint32 _timerExpiry;
81};
82
83} // End of namespace CGE
84
85#endif
Definition: cge.h:150
Definition: snail.h:53
Definition: snail.h:55