From 10b8741c8b995962f3bcc51276b38e01ca398422 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 9 Nov 2009 22:19:21 +0000 Subject: TINSEL: Simplifying PolyTinselProcess svn-id: r45783 --- engines/tinsel/events.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'engines') diff --git a/engines/tinsel/events.cpp b/engines/tinsel/events.cpp index a950dea7c2..9c01f15b2a 100644 --- a/engines/tinsel/events.cpp +++ b/engines/tinsel/events.cpp @@ -605,25 +605,27 @@ void PolyTinselProcess(CORO_PARAM, const void *param) { void PolygonEvent(CORO_PARAM, HPOLYGON hPoly, TINSEL_EVENT tEvent, int actor, bool bWait, int myEscape, bool *result) { CORO_BEGIN_CONTEXT; - PTP_INIT to; PPROCESS pProc; CORO_END_CONTEXT(_ctx); CORO_BEGIN_CODE(_ctx); - if (result) *result = false; - _ctx->to.hPoly = -1; - _ctx->to.event = tEvent; - _ctx->to.pic = InitInterpretContext(GS_POLYGON, + PTP_INIT to; + + if (result) + *result = false; + to.hPoly = -1; + to.event = tEvent; + to.pic = InitInterpretContext(GS_POLYGON, GetPolyScript(hPoly), tEvent, hPoly, // Polygon actor, // Actor NULL, // No Object myEscape); - if (_ctx->to.pic != NULL) { - _ctx->pProc = g_scheduler->createProcess(PID_TCODE, PolyTinselProcess, &_ctx->to, sizeof(_ctx->to)); - AttachInterpret(_ctx->to.pic, _ctx->pProc); + if (to.pic != NULL) { + _ctx->pProc = g_scheduler->createProcess(PID_TCODE, PolyTinselProcess, &to, sizeof(to)); + AttachInterpret(to.pic, _ctx->pProc); if (bWait) CORO_INVOKE_2(WaitInterpret, _ctx->pProc, result); -- cgit v1.2.3