Beispiel #1
0
int DoSet (Parser *p)
{
    Value v;
    int r;

    DynamicBuffer buf;
    DBufInit(&buf);

    r = ParseIdentifier(p, &buf);
    if (r) return r;

    /* Allow optional equals-sign:  SET var = value */
    if (ParseNonSpaceChar(p, &r, 1) == '=') {
	ParseNonSpaceChar(p, &r, 0);
    }

    r = EvaluateExpr(p, &v);
    if (r) {
	DBufFree(&buf);
	return r;
    }

    if (*DBufValue(&buf) == '$') r = SetSysVar(DBufValue(&buf)+1, &v);
    else r = SetVar(DBufValue(&buf), &v);
    DBufFree(&buf);
    return r;
}
Beispiel #2
0
/**
 * Stand all the moving actors at their saved positions.
 * Not called from the foreground.
 */
static void SortMAProcess(CORO_PARAM, const void *) {
	CORO_BEGIN_CONTEXT;
		int i;
		int viaActor;
	CORO_END_CONTEXT(_ctx);


	CORO_BEGIN_CODE(_ctx);

	// Disable via actor for the stands
	_ctx->viaActor = SysVar(ISV_DIVERT_ACTOR);
	SetSysVar(ISV_DIVERT_ACTOR, 0);

	RestoreAuxScales(rsd->SavedMoverInfo);

	for (_ctx->i = 0; _ctx->i < MAX_MOVERS; _ctx->i++) {
		if (rsd->SavedMoverInfo[_ctx->i].bActive) {
			CORO_INVOKE_ARGS(Stand, (CORO_SUBCTX, rsd->SavedMoverInfo[_ctx->i].actorID,
				rsd->SavedMoverInfo[_ctx->i].objX, rsd->SavedMoverInfo[_ctx->i].objY,
				rsd->SavedMoverInfo[_ctx->i].hLastfilm));

			if (rsd->SavedMoverInfo[_ctx->i].bHidden)
				HideMover(GetMover(rsd->SavedMoverInfo[_ctx->i].actorID));
		}

		ActorPalette(rsd->SavedMoverInfo[_ctx->i].actorID,
			rsd->SavedMoverInfo[_ctx->i].startColour, rsd->SavedMoverInfo[_ctx->i].paletteLength);

		if (rsd->SavedMoverInfo[_ctx->i].brightness != BOGUS_BRIGHTNESS)
			ActorBrightness(rsd->SavedMoverInfo[_ctx->i].actorID, rsd->SavedMoverInfo[_ctx->i].brightness);
	}

	// Restore via actor
	SetSysVar(ISV_DIVERT_ACTOR, _ctx->viaActor);

	bNotDoneYet = false;

	CORO_END_CODE;
}
Beispiel #3
0
void PrimeScene() {
	SetNoBlocking(false);
	SetSysVar(SYS_SceneFxDimFactor, SysVar(SYS_DefaultFxDimFactor));

	RestartCursor();	// Restart the cursor
	if (!TinselV2)
		EnableTags();		// Next scene with tags enabled

	g_scheduler->createProcess(PID_SCROLL, ScrollProcess, NULL, 0);
	g_scheduler->createProcess(PID_SCROLL, EffectPolyProcess, NULL, 0);

#ifdef DEBUG
	if (ShowPosition)
		g_scheduler->createProcess(PID_POSITION, CursorPositionProcess, NULL, 0);
#endif

	g_scheduler->createProcess(PID_TAG, TagProcess, NULL, 0);
	g_scheduler->createProcess(PID_TAG, PointProcess, NULL, 0);

	// init the current background
	PrimeBackground();
}
Beispiel #4
0
/**
 * Wrap up the last scene.
 */
void EndScene() {
	if (SceneHandle != 0) {
		UnlockScene(SceneHandle);
		SceneHandle = 0;
	}

	KillInventory();	// Close down any open inventory

	DropPolygons();		// No polygons
	DropScroll();	// No no-scrolls
	DropBackground();	// No background
	DropMovers();		// No moving actors
	DropCursor();		// No cursor
	DropActors();		// No actor reels running
	FreeAllTokens();	// No-one has tokens
	FreeMostInterpretContexts();	// Only master script still interpreting

	if (TinselV2) {
		SetSysVar(ISV_DIVERT_ACTOR, 0);
		SetSysVar(ISV_GHOST_ACTOR, 0);
		SetSysVar(SV_MinimumXoffset, 0);
		SetSysVar(SV_MaximumXoffset, 0);
		SetSysVar(SV_MinimumYoffset, 0);
		SetSysVar(SV_MaximumYoffset, 0);
		ResetFontHandles();
		NoSoundReels();
	}

	_vm->_sound->stopAllSamples();		// Kill off any still-running sample
	//_vm->_mixer->stopAll();

	// init the palette manager
	ResetPalAllocator();

	// init the object manager
	KillAllObjects();

	// kill all destructable process
	g_scheduler->killMatchingProcess(PID_DESTROY, PID_DESTROY);
}
Beispiel #5
0
/**
 * Sets the no blocking flag. Note that for convenience, the systemVars array
 * entry is used even for Tinsel 1, which originally used a separate variable.
 */
void SetNoBlocking(bool flag) {
	SetSysVar(ISV_NO_BLOCKING, flag);
}