Small statement macros both games use for positions, velocities and bounds. More...
Go to the source code of this file.
Macros | |
| #define | SET_VECTOR(v, x, y, z) |
| Sets the x, y and z of a three-part vector: a position about to be projected, a per-frame step, a camera point or a scale. | |
| #define | SET_POSITION(p, px, py, pz) |
| Sets the position or the velocity of a particle, a piece of debris or an object in one statement. | |
| #define | SET_VELOCITY(p, vx, vy, vz) |
| #define | CLAMP(v, low, high) |
| Keeps v within low to high, the low bound tested first. | |
| #define | ABS(v) |
| The magnitude of v. v is read twice. | |
Small statement macros both games use for positions, velocities and bounds.
The multi-part ones are comma expressions or a plain block, not do { } while (0): a do-while (0) compiles differently at some of their sites (see AGENTS.md, S2).
Definition in file macros.h.
| #define SET_VECTOR | ( | v, | |
| x, | |||
| y, | |||
| z ) |
Sets the x, y and z of a three-part vector: a position about to be projected, a per-frame step, a camera point or a scale.
Definition at line 12 of file macros.h.
Referenced by AltinPeak_StartSpitting(), BabiLighthouse_LandWithParticles(), Battle_RunEncounter(), BattleEffect_SpawnBurstParticleField(), BattleFx_RunBreak(), BattleFx_RunCybele(), BattleFx_RunDeathPlunge(), BattleFx_RunDjinnBeams(), BattleFx_RunDjinnHeal(), BattleFx_RunDjinniEntrance(), BattleFx_RunFrost(), BattleFx_RunHaunt(), BattleFx_RunHealingMotes(), BattleFx_RunMoteFountain(), BattleFx_RunOrbitingSkulls(), BattleFx_RunOrbitingSpirals(), BattleFx_RunParticleStreams(), BattleFx_RunQuake(), BattleFx_RunSleep(), BattleFx_RunSparkEmitter(), BattleFx_RunStatBoost(), BattleFx_RunStatReduction(), BattleFx_RunSwirlingStars(), BattleFx_RunTargetBursts(), BattleFx_RunTargetMotes(), BattleFx_RunThor(), BattleMotion_ProjectPosition(), BattlePres_SetupTransitionScene(), BattlePres_SetupTransitionSceneAtDepth(), Camera_InitDefaultTransform(), Camera_ResetSceneDefaults(), ColossoLogRollingStage_SpawnRandomSceneEffect(), ColossoRiver_SpawnRandomEffect(), ColossoWall_SpawnRandomSceneEffect(), Effect_ConfigureSpawnedParticle(), Effect_UpdateParticlePosition(), Event_JumpToNextPillar(), Event_RollLongLog(), Event_WatchThePuppies(), Imil_SwayAndSpark(), KolimaForestBend_RollLog(), KolimaForestTree_UpdateOrbitSpark(), LuckyDice_Run(), Lunpa_KickUpLeaderDust(), Map_InitializePerspectiveScene(), MercuryLighthouseEntrance_Initialize(), Motion_SetTargetPositionFromMagnitudeAngle(), Object_UpdateAllThumb(), Palette_Transform(), Render_PlaceProjectedSprite(), SceneEffect_SpawnRandomizedBurst(), SolSanctumStatue_RunSealOpenedSequence(), VaultCave_OffsetActorRadially(), VenusLighthouse_LandWithRadialDust(), WorldMap_BuildScanlineTable(), WorldMap_UpdateView(), and Xian_TalkToKungFuStudent().
| #define SET_POSITION | ( | p, | |
| px, | |||
| py, | |||
| pz ) |
Sets the position or the velocity of a particle, a piece of debris or an object in one statement.
Definition at line 16 of file macros.h.
Referenced by AltinPeak_AdvanceLog(), AltinPeak_TurnLogLeft(), AltinPeak_TurnLogRight(), Battle_GetWorkEntryPair(), BattleEffect_RunFallbackObjectTransition(), BattleFx_GetPositionAboveActor(), BattleFx_RunAnnihilation(), BattleFx_RunAstralBlast(), BattleFx_RunBeamSequence(), BattleFx_RunBurstScene(), BattleFx_RunCastingImpact(), BattleFx_RunCybele(), BattleFx_RunDjinnHeal(), BattleFx_RunDjinniEntrance(), BattleFx_RunDrain(), BattleFx_RunFire(), BattleFx_RunFrost(), BattleFx_RunFroth(), BattleFx_RunGaia(), BattleFx_RunGatheringLights(), BattleFx_RunGround(), BattleFx_RunHealingMotes(), BattleFx_RunLobbedShells(), BattleFx_RunMoteFountain(), BattleFx_RunParticleStreams(), BattleFx_RunProcne(), BattleFx_RunProjectileVolley(), BattleFx_RunRay(), BattleFx_RunRingAndSparkScene(), BattleFx_RunShiningStar(), BattleFx_RunSparkEmitter(), BattleFx_RunStatBoost(), BattleFx_RunStreakVolley(), BattleFx_RunSwirlingStars(), BattleFx_RunTargetBursts(), BattleFx_RunTargetMotes(), BattleFx_RunTargetStrike(), BattleFx_RunVolcano(), BattleFx_SteerLiftedTarget(), BattleFx_SteerPushedTarget(), Camera_FollowActor(), Camera_FollowLeaderInBounds(), Camera_FollowObject(), Camera_MoveWithinMapBounds(), Event_JumpAcrossRoofGap(), Event_PushBlock(), Field_ClimbDown(), Field_ClimbUp(), Field_TryJumpForward(), FieldFx_RunCatch(), FieldFx_RunDouse(), FieldFx_RunFrost(), GomaCaveEntrance_LeapStump(), Kalay_PushTunnelBlock(), MercuryLighthouseAerie_JumpToPlatform(), Object_SetMoveTarget(), Object_UpdateAll(), Object_UpdateAllMotion(), Object_UpdateAllThumb(), Object_Wander(), ObjectMotion_SetPositionWithTerrain(), ObjectTable_ResetForObject(), and ScriptObject_WanderNearHome().
| #define SET_VELOCITY | ( | p, | |
| vx, | |||
| vy, | |||
| vz ) |
Definition at line 18 of file macros.h.
Referenced by AltinPeak_SpawnDebris(), BattleFx_RunAnnihilation(), BattleFx_RunBeamSequence(), BattleFx_RunBurstScene(), BattleFx_RunCastingImpact(), BattleFx_RunCybele(), BattleFx_RunDjinnHeal(), BattleFx_RunDjinniEntrance(), BattleFx_RunDragonCloud(), BattleFx_RunDrain(), BattleFx_RunEruption(), BattleFx_RunFire(), BattleFx_RunFroth(), BattleFx_RunGaia(), BattleFx_RunGatheringLights(), BattleFx_RunGround(), BattleFx_RunLobbedShells(), BattleFx_RunMoteFountain(), BattleFx_RunParticleStreams(), BattleFx_RunRingAndSparkScene(), BattleFx_RunRushingStrike(), BattleFx_RunStreakVolley(), BattleFx_RunSwirlingStars(), BattleFx_RunTargetStrike(), BattleFx_SteerPushedTarget(), Effect_SpawnRisingDustBurst(), EffectStep_AdvanceWithGravity3D(), Event_CenterStatueMoved(), Event_FinalsBegin(), EventObject_Initialize(), LuckyDice_Run(), Object_MoveByKeys(), Object_SetPositionAndResetMotion(), Object_UpdateAllThumb(), ObjectMotion_SetHorizontalPositionWithTerrain(), ObjectMotion_SetPositionWithTerrain(), Scene_TalkToActor(), SolSanctumEruption_StepEmbers(), SolSanctumEruption_ThrowEruptionRing(), TolbiShipInteriors_ResetActor(), TolbiShipMast_ShrinkAndStopActor(), TolbiShipMast_StopDriftingActor(), Vale_HaveJennaStopTheAlephDetour(), and VenusLighthouseAerie_StopActorMotion().
| #define CLAMP | ( | v, | |
| low, | |||
| high ) |
Keeps v within low to high, the low bound tested first.
A plain block, so it cannot stand before an else.
Definition at line 23 of file macros.h.
Referenced by BattleCommand_BuildPlan(), BattleEnemy_AdjustLevel(), BattleFx_BuildWindowEdgeTable(), BattleFx_DrawClippedCanvasLine(), BattleFx_RunCastingImpact(), BattleFx_RunDjinnHeal(), BattleFx_RunDjinniEntrance(), BattleFx_RunEruption(), BattleFx_RunFire(), BattleFx_RunFroth(), BattleFx_RunGaia(), BattleFx_RunHealingMotes(), BattleFx_RunParticleStreams(), BattleFx_RunRingAndSparkScene(), BattleFx_RunStatBoost(), BattleFx_RunSwirlingStars(), Color_ScaleComponents(), DjinnMenu_ShowOwnerStatus(), Encounter_SelectEnemyGroup(), Event_ShowMessageAtPosition(), Graphics_UpdatePhasePalette(), Map_SetCameraCenter(), Map_UpdateLayerScroll(), Owner_LevelUp(), PaletteGlow_Update(), UiWork_StepChannelScript(), and UnitCalc().
| #define ABS | ( | v | ) |
The magnitude of v. v is read twice.
Definition at line 32 of file macros.h.
Referenced by AltinPeak_RideLog(), BattleFx_DrawClippedCanvasLine(), BattleFx_RunProjectileVolley(), Map_SetWindowCellTile(), and ReelGame_DrawCanvasLine().