mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
TINSEL: Add EnablePointing() & DisablePointing() to pdisplay.h; turn DisablePointing from a coroutine into a plain function
svn-id: r45782
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
#include "tinsel/music.h"
|
||||
#include "tinsel/palette.h"
|
||||
#include "tinsel/pcode.h"
|
||||
#include "tinsel/pdisplay.h"
|
||||
#include "tinsel/pid.h"
|
||||
#include "tinsel/polygons.h"
|
||||
#include "tinsel/savescn.h"
|
||||
@@ -74,14 +75,6 @@ extern int volMaster;
|
||||
#endif
|
||||
|
||||
|
||||
//----------------- EXTERNAL FUNCTIONS ---------------------
|
||||
|
||||
// Tag functions in PDISPLAY.C
|
||||
extern void EnableTags();
|
||||
extern void DisableTags();
|
||||
extern void DisablePointing(CORO_PARAM);
|
||||
extern void EnablePointing();
|
||||
|
||||
//----------------- LOCAL DEFINES --------------------
|
||||
|
||||
#define HOPPER_FILENAME "hopper"
|
||||
@@ -3825,7 +3818,7 @@ void PopUpInventory(int invno) {
|
||||
|
||||
DisableTags(); // Tags disabled during inventory
|
||||
if (TinselV2)
|
||||
DisablePointing(nullContext); // Pointing disabled during inventory
|
||||
DisablePointing(); // Pointing disabled during inventory
|
||||
|
||||
if (invno == INV_CONV) { // Conversation window?
|
||||
if (TinselV2)
|
||||
|
||||
@@ -626,7 +626,7 @@ void PolygonEvent(CORO_PARAM, HPOLYGON hPoly, TINSEL_EVENT tEvent, int actor, bo
|
||||
AttachInterpret(_ctx->to.pic, _ctx->pProc);
|
||||
|
||||
if (bWait)
|
||||
CORO_INVOKE_2(WaitInterpret,_ctx->pProc, result);
|
||||
CORO_INVOKE_2(WaitInterpret, _ctx->pProc, result);
|
||||
}
|
||||
|
||||
CORO_END_CODE;
|
||||
|
||||
+14
-20
@@ -252,37 +252,31 @@ void CursorPositionProcess(CORO_PARAM, const void *) {
|
||||
/**
|
||||
* While inventory/menu is open.
|
||||
*/
|
||||
void DisablePointing(CORO_PARAM) {
|
||||
CORO_BEGIN_CONTEXT;
|
||||
int i;
|
||||
HPOLYGON hPoly; // Polygon handle
|
||||
CORO_END_CONTEXT(_ctx);
|
||||
|
||||
CORO_BEGIN_CODE(_ctx);
|
||||
void DisablePointing() {
|
||||
int i;
|
||||
HPOLYGON hPoly; // Polygon handle
|
||||
|
||||
bPointingActive = false;
|
||||
|
||||
for (_ctx->i = 0; _ctx->i < MAX_POLY; _ctx->i++) {
|
||||
_ctx->hPoly = GetPolyHandle(_ctx->i);
|
||||
for (i = 0; i < MAX_POLY; i++) {
|
||||
hPoly = GetPolyHandle(i);
|
||||
|
||||
if (_ctx->hPoly != NOPOLY && PolyType(_ctx->hPoly) == TAG && PolyIsPointedTo(_ctx->hPoly)) {
|
||||
SetPolyPointedTo(_ctx->hPoly, false);
|
||||
SetPolyTagWanted(_ctx->hPoly, false, false, 0);
|
||||
CORO_INVOKE_ARGS(PolygonEvent, (CORO_SUBCTX, _ctx->hPoly, UNPOINT, 0, false, 0));
|
||||
if (hPoly != NOPOLY && PolyType(hPoly) == TAG && PolyIsPointedTo(hPoly)) {
|
||||
SetPolyPointedTo(hPoly, false);
|
||||
SetPolyTagWanted(hPoly, false, false, 0);
|
||||
PolygonEvent(nullContext, hPoly, UNPOINT, 0, false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// For each tagged actor
|
||||
for (_ctx->i = 0; (_ctx->i = NextTaggedActor(_ctx->i)) != 0; ) {
|
||||
if (ActorIsPointedTo(_ctx->i)) {
|
||||
SetActorPointedTo(_ctx->i, false);
|
||||
SetActorTagWanted(_ctx->i, false, false, 0);
|
||||
for (i = 0; (i = NextTaggedActor(i)) != 0; ) {
|
||||
if (ActorIsPointedTo(i)) {
|
||||
SetActorPointedTo(i, false);
|
||||
SetActorTagWanted(i, false, false, 0);
|
||||
|
||||
CORO_INVOKE_ARGS(ActorEvent, (CORO_SUBCTX, _ctx->i, UNPOINT, false, 0));
|
||||
ActorEvent(nullContext, i, UNPOINT, false, 0);
|
||||
}
|
||||
}
|
||||
|
||||
CORO_END_CODE;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -32,6 +32,9 @@ namespace Tinsel {
|
||||
void EnableTags();
|
||||
void DisableTags();
|
||||
|
||||
void DisablePointing();
|
||||
void EnablePointing();
|
||||
|
||||
} // End of namespace Tinsel
|
||||
|
||||
#endif /* TINSEL_PDISPLAY_H */
|
||||
|
||||
Reference in New Issue
Block a user