From 3f1a49b567aac10fe8a195f7a2b8e07603470a72 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 22 Apr 2014 19:47:58 -0400 Subject: MADS: Implemented Conversation::read method --- engines/mads/user_interface.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'engines/mads/user_interface.cpp') diff --git a/engines/mads/user_interface.cpp b/engines/mads/user_interface.cpp index 346ad2d688..493804c923 100644 --- a/engines/mads/user_interface.cpp +++ b/engines/mads/user_interface.cpp @@ -258,6 +258,18 @@ void Conversation::set(int quoteId, ...) { va_end(va); } +bool Conversation::read(int quoteId) { + uint16 flags = _vm->_game->globals()[_globalId]; + + for (uint idx = 0; idx < _quotes.size(); ++idx) { + if (_quotes[idx] == quoteId) { + return flags & (1 << idx); + } + } + + return false; +} + void Conversation::write(int quoteId, bool flag) { for (uint idx = 0; idx < _quotes.size(); ++idx) { if (_quotes[idx] == quoteId) { -- cgit v1.2.3