Example #1
0
void ManageViewScreen::UpdateAll()
{
    UpdateCOR();
    UpdatePan();
    UpdateZoom();
    UpdateRotations();
}
Example #2
0
void Game_Map::Update(bool only_parallel) {
	if (GetNeedRefresh() != Refresh_None) Refresh();
	Parallax::Update();
	if (animation) {
		animation->Update();
		if (animation->IsDone()) {
			animation.reset();
		}
	}

	for (Game_CommonEvent& ev : common_events) {
		ev.UpdateParallel();
	}

	for (Game_Event& ev : events) {
		ev.UpdateParallel();
	}

	if (only_parallel)
		return;

	for (Game_Event& ev : events) {
		ev.CheckEventTriggers();
	}

	Main_Data::game_player->Update(!first_frame);
	UpdatePan();
	GetInterpreter().Update();

	for (Game_Event& ev : events) {
		ev.Update();
	}

	for (Game_CommonEvent& ev : common_events) {
		ev.Update();
	}

	for (auto& vehicle: vehicles) {
		if (vehicle->GetMapId() == location.map_id) {
			vehicle->Update(!first_frame);
		}
	}

	free_interpreters.clear();

	first_frame = false;
}
Example #3
0
void Game_Map::Update() {
	if (GetNeedRefresh()) Refresh();
	UpdateScroll();
	UpdatePan();
	UpdateParallax();

	for (tEventHash::iterator i = events.begin();
		i != events.end(); ++i) {
		i->second->Update();
	}

	for (tCommonEventHash::iterator i = common_events.begin();
		i != common_events.end(); ++i) {
		i->second->Update();
	}

	for (int i = 0; i < 3; ++i)
		vehicles[i]->Update();
}
Example #4
0
void Game_Map::Update(bool is_preupdate) {
	if (GetNeedRefresh() != Refresh_None) Refresh();
	Parallax::Update();
	if (animation) {
		animation->Update();
		if (animation->IsDone()) {
			animation.reset();
		}
	}

	for (Game_Event& ev : events) {
		ev.SetProcessed(false);
	}
	if (!is_preupdate) {
		Main_Data::game_player->SetProcessed(false);
		for (auto& vehicle: vehicles) {
			if (vehicle->IsInCurrentMap()) {
				vehicle->SetProcessed(false);
			}
		}
	}

	for (Game_CommonEvent& ev : common_events) {
		ev.Update();
	}

	for (Game_Event& ev : events) {
		ev.Update();
	}

	if (is_preupdate) {
		return;
	}

	Main_Data::game_player->Update();
	UpdatePan();

	for (auto& vehicle: vehicles) {
		if (vehicle->GetMapId() == location.map_id) {
			vehicle->Update();
		}
	}

	Main_Data::game_party->UpdateTimers();
	Main_Data::game_screen->Update();

	auto& interp = GetInterpreter();

	// Run any event loaded from last frame.
	interp.Update(true);
	while (!interp.IsRunning() && !interp.ReachedLoopLimit()) {
		// This logic is probably one big loop in RPG_RT. We have to replicate
		// it here because once we stop executing from this we should not
		// clear anymore waiting flags.
		if (interp.IsImmediateCall() && interp.GetLoopCount() > 0) {
			break;
		}
		Game_CommonEvent* run_ce = nullptr;

		for (auto& ce: common_events) {
			if (ce.IsWaitingForegroundExecution()) {
				run_ce = &ce;
				break;
			}
		}
		if (run_ce) {
			interp.Setup(run_ce, 0);
			interp.Update(false);
			if (interp.IsRunning()) {
				break;
			}
			continue;
		}

		Game_Event* run_ev = nullptr;
		for (auto& ev: events) {
			if (ev.IsWaitingForegroundExecution()) {
				run_ev = &ev;
				break;
			}
		}
		if (run_ev) {
			if (run_ev->IsActive()) {
				interp.Setup(run_ev);
			}
			run_ev->ClearWaitingForegroundExecution();
			if (run_ev->IsActive()) {
				interp.Update(false);
			}
			if (interp.IsRunning()) {
				break;
			}
			continue;
		}
		break;
	}

	free_interpreters.clear();
}