Skip to Content
The Alchemy Project

src/field/script_commands_camera.c

The script commands that move the camera and wait for it. More…

Included by script_commands.c.

Functions

NameDescription
voidfdCameraMoveWithinMapBounds (FIXED requestedX, FIXED requestedY, FIXED requestedZ, Sint32 pan)The script command "camera move to": sends the camera to the requested axes, 16.16 pixels (-1 keeps that axis), kept far enough inside the map that the screen never shows past its edge.
voidfdCameraMoveToActorById (Sint32 actorId, Sint32 pan)The script command "camera move to actor": fdCameraMoveWithinMapBounds to the actor's x and z.
voidfdCameraMoveToActor (Sint32 actorId, Sint32 pan)As fdCameraMoveToActorById, to the actor's height too.
voidfdCameraWaitForArrival (void)The script command "camera wait for move": waits (at most 600 ticks) for the camera to arrive, then 2 ticks more.
ACTOR *fdCameraGetActor (void)The script command "get camera": returns the camera's own actor, which the view centres on.
voidfdCameraFollow (ACTOR *target, Sint32 keepCurrentPos)Unused: makes the camera follow target; unless keepCurrentPos is set it jumps there at once.

Description

The script commands that move the camera and wait for it. Part of script_commands.c.

Functions in detail

fdCameraMoveWithinMapBounds

void fdCameraMoveWithinMapBounds(FIXED requestedX, FIXED requestedY, FIXED requestedZ, Sint32 pan)

The script command "camera move to": sends the camera to the requested axes, 16.16 pixels (-1 keeps that axis), kept far enough inside the map that the screen never shows past its edge. With pan 0 the camera cuts there at once; otherwise it pans there at its own speed.

References fdMapGridCenterOnFollowedPointStub(), Sint32, syHeapSlotAllocateEWRAM() and sySynch().

Referenced by fdActorDescendInWhirlwind(), fdCameraMoveToActor(), fdCameraMoveToActorById(), fdCameraMoveToFX(), fdEntrancePlayArrival(), fdPsynergyCyclone(), fdPsynergyEndSand(), fdPsynergyRetreat(), fdPsynergySand(), scAirsRockInsideShebaLearnsReveal(), scAquaRockInsidePiersLearnsParch(), scEasternAlhafraShipBriggsIsCaught(), scGaiaRockInsideFelixLearnsSand(), scInit(), scShrineOfTheSeaGodDjinniFleesEast(), scShrineOfTheSeaGodDjinniFleesSouth(), scShrineOfTheSeaGodDjinniHopsOntoLedge(), scShrineOfTheSeaGodDjinniRunsWest(), scShrineOfTheSeaGodRiseOnWater(), scShrineOfTheSeaGodSinkWithWater(), scShrineOfTheSeaGodThrowRopeAgain(), scShrineOfTheSeaGodUseSeaGodsTear() and scWorldMapJitterTransitionCamera().

Definition at line 8 of file script_commands_camera.c.

fdCameraMoveToActorById

void fdCameraMoveToActorById(Sint32 actorId, Sint32 pan)

The script command "camera move to actor": fdCameraMoveWithinMapBounds to the actor's x and z.

References fdActorLookup(), fdCameraMoveWithinMapBounds() and Sint32.

Referenced by scAirsRockBlowGust(), scAirsRockInsideBlowGust(), scAirsRockInsideWakeEntranceStatue(), scAirsRockInsideWakeHallStatue(), scAlhafraRoomsMeetAlex(), scAnemosInnerSanctumPressRoundSwitch(), scGabombaCatacombsGabombaBestowsPower(), scGarohWerewolvesRevealThemselves(), scInit(), scIzumoStopThePartyToThankThem(), scMarsLighthouseHallWatchBlazeReachFlame(), scShamanVillageCaveEddyFlees(), scVenusLighthouseEntranceSoldiersAmbushParty() and scVenusLighthouseEntranceWakeUp().

Definition at line 88 of file script_commands_camera.c.

fdCameraMoveToActor

void fdCameraMoveToActor(Sint32 actorId, Sint32 pan)

As fdCameraMoveToActorById, to the actor's height too.

References fdActorLookup(), fdCameraMoveWithinMapBounds() and Sint32.

Referenced by scMagmaRockKnockLeaderOffWall() and scScriptCameraMoveToActor().

Definition at line 97 of file script_commands_camera.c.

fdCameraWaitForArrival

void fdCameraWaitForArrival(void)

The script command "camera wait for move": waits (at most 600 ticks) for the camera to arrive, then 2 ticks more.

References fdActorWaitForMoveStub(), fdScriptWait() and syHeapSlotAllocateEWRAM().

Referenced by scAirsRockBlowGust(), scAirsRockInsideBlowGust(), scAirsRockInsideRideWhirlwind(), scAirsRockInsideWakeEntranceStatue(), scAirsRockInsideWakeHallStatue(), scAirsRockRideWhirlwind(), scAirsRockWhirlwindClearsFog(), scAirsRockWhirlwindClearsWall(), scAirsRockWhirlwindOpensTheTop(), scAlhafraFindGoldCoins(), scAlhafraMadransArrive(), scAlhafranCaveChauchaAndEoleoVisit(), scAlhafraRoomsMeetAlex(), scAlhafraRoomsOverhearCrossboneIsleTale(), scAncientLemuriaMeetTheLemurians(), scAnemosInnerSanctumLightSymbol(), scAnemosInnerSanctumPressRoundSwitch(), scAnkohlRuinsStartGreatFaceSliding(), scApojiiIslandsDouseAquaStone(), scAquaRockDouseSummitWaterStone(), scAquaRockInsideSteamRoomStreamDrains(), scAquaRockInsideUseAquariusStone(), scAttekaInletHammaShowsTheWings(), scChampaCliffCavesFightAvimander(), scChampaCliffCavesObabaForgesTrident(), scChampaCliffCavesObabaMournsSalamander(), scChampaFeizhiArrives(), scChampaMeetAlex(), scChampaSailorsSpotFelix(), scContigoTheReunion(), scDehkanPlateauCannonCracksLastPillar(), scDehkanPlateauCannonCracksPillars(), scDehkanPlateauCannonFleesEast(), scDehkanPlateauCannonFleesOverCracks(), scDehkanPlateauCannonLeapsAway(), scDehkanPlateauCannonPoundsStake(), scEasternAlhafraBriggsStealsShip(), scEasternAlhafraMayorFindsShipGone(), scEasternAlhafraOverhearWorkers(), scEasternAlhafraShipBriggsIsCaught(), scEasternAlhafraShipMayorArrives(), scEasternAlhafraWorkersSeeBlockGone(), scEasternAlhafraWorkersTellMayor(), scGabombaStatueChamberAkafubuReachesChamber(), scGabombaStatueCogsTurnBack(), scGabombaStatueFocusEnergies(), scGabombaStatueHearTheOffering(), scGabombaStatueSawEnergyFlow(), scGabombaStatueSeeHowItWorks(), scGaiaRockInsideMeetSusa() and 106 more.

Definition at line 108 of file script_commands_camera.c.

fdCameraGetActor

ACTOR *fdCameraGetActor(void)

The script command "get camera": returns the camera's own actor, which the view centres on.

References syHeapSlotAllocateEWRAM().

Referenced by scAirsRockInsideRideWhirlwind(), scAirsRockRideWhirlwind(), scAttekaInletHammaShowsTheWings(), scAttekaInletHammetsMessengerArrives(), scDehkanPlateauCannonCracksLastPillar(), scDehkanPlateauCannonCracksPillars(), scDehkanPlateauCannonFleesOverCracks(), scDehkanPlateauCannonPoundsStake(), scDehkanPlateauJoltCamera(), scDehkanPlateauStepOnCrack(), scJupiterLighthouseBeaconIsLit(), scKandoreanTempleFindTheRopeOnTheFloor(), scKandoreanTempleMeetPoi(), scKandoreanTempleReceiveLash(), scKandoreanTempleTestTheStudents(), scKibomboCeremonyStarts(), scKibomboDeadEndByTheStatue(), scKibomboGabombaNotPleased(), scKibomboMeetPiers(), scKibomboOpenCeremonyScene(), scKibomboPiersJoinsParty(), scKibomboPresentJewelToGabomba(), scLemurianShipDeckHoldOnToTiller(), scLemurianShipDeckTakeTheTiller(), scMarsLighthouseAerieLightBeacon(), scMarsLighthouseAerieWatchGoldenSunRise(), scProxGiveThanksForBeacon(), scProxMoldHidesInSnow(), scProxSearchForParents(), scScriptCameraGetActor(), scShamanVillageMeetMoapa(), scShamanVillageShowShamansRod(), scShrineOfTheSeaGodDjinniFleesEast(), scShrineOfTheSeaGodDjinniFleesSouth(), scShrineOfTheSeaGodDjinniHopsOntoLedge(), scShrineOfTheSeaGodDjinniRunsNorth(), scShrineOfTheSeaGodDjinniRunsWest(), scShrineOfTheSeaGodLashRope(), scShrineOfTheSeaGodLiftWithWater(), scShrineOfTheSeaGodLowerWater(), scShrineOfTheSeaGodLowerWithWater(), scShrineOfTheSeaGodStartDjinniDash(), scYallamShowSongGame() and scYampiDesertTravelersLookUp().

Definition at line 118 of file script_commands_camera.c.

fdCameraFollow

void fdCameraFollow(ACTOR *target, Sint32 keepCurrentPos)

Unused: makes the camera follow target; unless keepCurrentPos is set it jumps there at once.

References fdActorStartCameraStub(), Sint32 and syHeapSlotAllocateEWRAM().

Definition at line 127 of file script_commands_camera.c.