pub struct SpriteLighting<'a> {
pub kv6col: u32,
pub lightmode: u32,
pub lights: &'a [LightSrc],
}Expand description
Sprite lighting + colour state — the subset of voxlap’s
vx5 global that updatereflects reads. Built once per
frame from Engine state and passed to draw_sprite.
All fields mirror voxlap names:
kv6col↔vx5.kv6collightmode↔vx5.lightmodelights↔vx5.lightsrc[0..vx5.numlights]
The vx5.fogcol/ofogdist fog plumbing is deferred — sprite
fog stays off for now, matching the oracle path
(vx5.fogcol < 0 ⇒ ofogdist == -1 in voxlap C, no fog).
Fields§
§kv6col: u32Material colour. R==G==B triggers the cheaper nolighta path
in update_reflects; arbitrary RGB takes the per-channel
nolightb path; lightmode≥2 ignores the R==G==B fast path
and always does per-channel modulation.
lightmode: u320 / 1 → directional surface tint (lightmode<2 paths).
2 → per-light shadow-side modulation against lights.
lights: &'a [LightSrc]Active point lights — voxlap’s vx5.lightsrc[..vx5.numlights].
Empty for lightmode<2; populated for lightmode≥2.
Implementations§
Source§impl<'a> SpriteLighting<'a>
impl<'a> SpriteLighting<'a>
Sourcepub fn from_engine(engine: &'a Engine) -> Self
pub fn from_engine(engine: &'a Engine) -> Self
Snapshot the lighting + colour subset of an Engine.
Use this once per frame in the host so the sprite render
reflects engine setters made between frames.
Source§impl SpriteLighting<'static>
impl SpriteLighting<'static>
Sourcepub fn default_oracle() -> Self
pub fn default_oracle() -> Self
Default oracle config — grey kv6col, lightmode 0, no
lights. Used by roxlap-oracle so the four sprite golden
hashes stay byte-stable: this is the exact state voxlap C’s
oracle has when it calls drawsprite.
Trait Implementations§
Source§impl<'a> Clone for SpriteLighting<'a>
impl<'a> Clone for SpriteLighting<'a>
Source§fn clone(&self) -> SpriteLighting<'a>
fn clone(&self) -> SpriteLighting<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for SpriteLighting<'a>
impl<'a> Debug for SpriteLighting<'a>
impl<'a> Copy for SpriteLighting<'a>
Auto Trait Implementations§
impl<'a> Freeze for SpriteLighting<'a>
impl<'a> RefUnwindSafe for SpriteLighting<'a>
impl<'a> Send for SpriteLighting<'a>
impl<'a> Sync for SpriteLighting<'a>
impl<'a> Unpin for SpriteLighting<'a>
impl<'a> UnsafeUnpin for SpriteLighting<'a>
impl<'a> UnwindSafe for SpriteLighting<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more