1 /*
2 * ucmachine.cc - Interpreter for usecode.
3 *
4 * Copyright (C) 1999 Jeffrey S. Freedman
5 * Copyright (C) 2000-2013 The Exult Team
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 2 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, write to the Free Software
19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */
21
22 #ifdef HAVE_CONFIG_H
23 # include <config.h>
24 #endif
25
26 #include <cstring>
27 #include "ucmachine.h"
28 #include "keyring.h"
29 #include "conversation.h"
30
31
Usecode_machine()32 Usecode_machine::Usecode_machine() {
33 // Clear global flags.
34 std::memset(gflags, 0, sizeof(gflags));
35 conv = new Conversation;
36 keyring = new Keyring;
37 }
38
39 /*
40 * Delete.
41 */
42
~Usecode_machine()43 Usecode_machine::~Usecode_machine(
44 ) {
45 delete conv;
46 delete keyring;
47 }
48
init_conversation()49 void Usecode_machine::init_conversation() {
50 conv->init_faces();
51 }
52
get_num_faces_on_screen() const53 int Usecode_machine::get_num_faces_on_screen() const {
54 return conv->get_num_faces_on_screen();
55 }
56
57