From 2fbafbf7494ffab7df3e840a144f1c2243ec01ef Mon Sep 17 00:00:00 2001 From: Travis Howell Date: Wed, 11 Oct 2006 14:03:40 +0000 Subject: Add opcode for Elvira 1 svn-id: r24277 --- engines/agos/agos.h | 3 ++- engines/agos/debug.h | 2 +- engines/agos/items.cpp | 15 +++++++++++++++ engines/agos/window.cpp | 6 +++--- 4 files changed, 21 insertions(+), 5 deletions(-) diff --git a/engines/agos/agos.h b/engines/agos/agos.h index 3eebb3af50..5e841da0ce 100644 --- a/engines/agos/agos.h +++ b/engines/agos/agos.h @@ -699,7 +699,7 @@ protected: void inventoryUp(WindowBlock *window); void inventoryDown(WindowBlock *window); - WindowBlock *openWindow(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint text_color); + WindowBlock *openWindow(uint x, uint y, uint w, uint h, uint flags, uint fillColor, uint textColor); uint getWindowNum(WindowBlock *window); void clearWindow(WindowBlock *window); void changeWindow(uint a); @@ -1083,6 +1083,7 @@ public: void oe1_findMaster(); void oe1_nextMaster(); void oe1_menu(); + void oe1_enableInput(); void oe1_setTime(); void oe1_ifTime(); void oe1_bitClear(); diff --git a/engines/agos/debug.h b/engines/agos/debug.h index 8d5dc9a367..5aafae15ee 100644 --- a/engines/agos/debug.h +++ b/engines/agos/debug.h @@ -350,7 +350,7 @@ static const char *const elvira1_opcodeNameTable[300] = { /* 256 */ "W|SYNC", "WI|DEF_OBJ", - NULL, + "|ENABLE_INPUT", "|SET_TIME", /* 260 */ "WJ|IF_TIME", diff --git a/engines/agos/items.cpp b/engines/agos/items.cpp index bb69e836cf..f41ac43f2f 100644 --- a/engines/agos/items.cpp +++ b/engines/agos/items.cpp @@ -315,6 +315,7 @@ void AGOSEngine::setupElvira1Opcodes(OpcodeProc *op) { op[256] = &AGOSEngine::o_sync; op[257] = &AGOSEngine::o_defObj; + op[258] = &AGOSEngine::oe1_enableInput; op[259] = &AGOSEngine::oe1_setTime; op[260] = &AGOSEngine::oe1_ifTime; op[261] = &AGOSEngine::o_here; @@ -2086,6 +2087,20 @@ void AGOSEngine::oe1_bitTest() { setScriptCondition((_variableArray[var] & (1 << bit)) != 0); } +void AGOSEngine::oe1_enableInput() { + // 258: enable input + _variableArray[500] = 0; + + for (int i = 120; i < 130; i++) + disableBox(i); + + // XXX + _lastHitArea = 0; + _verbHitArea = 0; + _hitAreaSubjectItem = NULL; + _hitAreaObjectItem = NULL; +} + void AGOSEngine::oe1_setTime() { // 259: set time time(&_timeStore); diff --git a/engines/agos/window.cpp b/engines/agos/window.cpp index e38a42d126..c863d59cdf 100644 --- a/engines/agos/window.cpp +++ b/engines/agos/window.cpp @@ -39,7 +39,7 @@ uint AGOSEngine::getWindowNum(WindowBlock *window) { return 0; } -WindowBlock *AGOSEngine::openWindow(uint x, uint y, uint w, uint h, uint flags, uint fill_color, uint text_color) { +WindowBlock *AGOSEngine::openWindow(uint x, uint y, uint w, uint h, uint flags, uint fillColor, uint textColor) { WindowBlock *window; window = _windowList; @@ -52,8 +52,8 @@ WindowBlock *AGOSEngine::openWindow(uint x, uint y, uint w, uint h, uint flags, window->width = w; window->height = h; window->flags = flags; - window->fill_color = fill_color; - window->text_color = text_color; + window->fill_color = fillColor; + window->text_color = textColor; window->textColumn = 0; window->textRow = 0; window->textColumnOffset = 0; -- cgit v1.2.3