Alchemy
Loading...
Searching...
No Matches

macros.h File Reference

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.

Detailed Description

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.

Macro Definition Documentation

◆ SET_VECTOR

#define SET_VECTOR ( v,
x,
y,
z )
Value:
((v)[0] = (x), (v)[1] = (y), (v)[2] = (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().

◆ SET_POSITION

#define SET_POSITION ( p,
px,
py,
pz )
Value:
((p)->x = (px), (p)->y = (py), (p)->z = (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().

◆ SET_VELOCITY

◆ CLAMP

◆ ABS

#define ABS ( v)
Value:
((v) < 0 ? -(v) : (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().