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
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation; either version 2
10  * of the License, or (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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20  *
21  */
22 
23 #include "sword1/console.h"
24 #include "sword1/sword1.h"
25 #include "sword1/sound.h"
26 #include "common/config-manager.h"
27 #include "common/str.h"
28 
29 namespace Sword1 {
30 
SwordConsole(SwordEngine * vm)31 SwordConsole::SwordConsole(SwordEngine *vm) : GUI::Debugger(), _vm(vm) {
32 	assert(_vm);
33 	if (scumm_stricmp(ConfMan.get("gameid").c_str(), "sword1mac") == 0 || scumm_stricmp(ConfMan.get("gameid").c_str(), "sword1macdemo") == 0)
34 		registerCmd("speechEndianness",    WRAP_METHOD(SwordConsole, Cmd_SpeechEndianness));
35 }
36 
~SwordConsole()37 SwordConsole::~SwordConsole() {
38 }
39 
Cmd_SpeechEndianness(int argc,const char ** argv)40 bool SwordConsole::Cmd_SpeechEndianness(int argc, const char **argv) {
41 	if (argc == 1) {
42 		debugPrintf("Using %s speech\n", _vm->_sound->_bigEndianSpeech ? "be" : "le");
43 		return true;
44 	}
45 	if (argc == 2) {
46 		if (scumm_stricmp(argv[1], "le") == 0) {
47 			_vm->_sound->_bigEndianSpeech = false;
48 			return false;
49 		} else if (scumm_stricmp(argv[1], "be") == 0) {
50 			_vm->_sound->_bigEndianSpeech = true;
51 			return false;
52 		}
53 	}
54 	debugPrintf("Usage: %s [le | be]\n", argv[0]);
55 	return true;
56 }
57 
58 } // End of namespace Sword
59