#[repr(C, align(4))]pub struct TriTextured {
pub tag: u32,
pub tex_window: u32,
pub color_cmd: u32,
pub v0: u32,
pub uv0_clut: u32,
pub v1: u32,
pub uv1_tpage: u32,
pub v2: u32,
pub uv2: u32,
}Expand description
Textured triangle with a single flat tint. 9 words (tag + 8 data).
The first data word is GP0(E2) texture-window state, followed by vertex + UV pairs; CLUT rides in vertex 0’s UV high word, tpage in vertex 1’s UV high word (PSX-SPX convention for GP0 0x24). Emitting E2 per triangle keeps windowed world materials from leaking state to model triangles when the ordering table interleaves both.
Fields§
§tag: u32OT linkage.
tex_window: u32GP0(E2) texture-window command.
color_cmd: u320x24000000 | tint header.
v0: u32Vertex 0 position.
uv0_clut: u32(u0, v0, clut) packed.
v1: u32Vertex 1 position.
uv1_tpage: u32(u1, v1, tpage) packed.
v2: u32Vertex 2 position.
uv2: u32(u2, v2, 0) packed.
Implementations§
Source§impl TriTextured
impl TriTextured
Sourcepub const fn new(
verts: [(i16, i16); 3],
uvs: [(u8, u8); 3],
clut: u16,
tpage: u16,
tint: (u8, u8, u8),
) -> Self
pub const fn new( verts: [(i16, i16); 3], uvs: [(u8, u8); 3], clut: u16, tpage: u16, tint: (u8, u8, u8), ) -> Self
Build a textured triangle. tint = (128, 128, 128) leaves
texels unmodulated.
Sourcepub const fn with_material(
verts: [(i16, i16); 3],
uvs: [(u8, u8); 3],
material: TextureMaterial,
) -> Self
pub const fn with_material( verts: [(i16, i16); 3], uvs: [(u8, u8); 3], material: TextureMaterial, ) -> Self
Build a textured triangle using a TextureMaterial.
Sourcepub const fn with_material_packet_texcoords(
verts: [(i16, i16); 3],
uvs: [(u8, u8); 3],
material: TextureMaterial,
) -> Self
👎Deprecated: identical to with_material
pub const fn with_material_packet_texcoords( verts: [(i16, i16); 3], uvs: [(u8, u8); 3], material: TextureMaterial, ) -> Self
identical to with_material
The same packet as Self::with_material, which it forwards to.
Sourcepub const fn with_material_packed_uv_words(
verts: [(i16, i16); 3],
uv_words: [u16; 3],
material: TextureMaterial,
) -> Self
pub const fn with_material_packed_uv_words( verts: [(i16, i16); 3], uv_words: [u16; 3], material: TextureMaterial, ) -> Self
Build a textured triangle from UV words that already contain
the low (u, v) bytes in packet layout. The material still
supplies CLUT, tpage, tint, blend, and texture-window state.
Sourcepub const fn with_packet_material_packed_uv_words(
verts: [(i16, i16); 3],
uv_words: [u16; 3],
material: TexturedPacketMaterial,
) -> Self
pub const fn with_packet_material_packed_uv_words( verts: [(i16, i16); 3], uv_words: [u16; 3], material: TexturedPacketMaterial, ) -> Self
Build a textured triangle from UV words and prepacked material words.
Trait Implementations§
Source§impl Clone for TriTextured
impl Clone for TriTextured
Source§fn clone(&self) -> TriTextured
fn clone(&self) -> TriTextured
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TriTextured
impl Debug for TriTextured
Source§impl GpuPacket for TriTextured
impl GpuPacket for TriTextured
Source§impl Hash for TriTextured
impl Hash for TriTextured
Source§impl PartialEq for TriTextured
impl PartialEq for TriTextured
impl Copy for TriTextured
impl Eq for TriTextured
impl StructuralPartialEq for TriTextured
Auto Trait Implementations§
impl Freeze for TriTextured
impl RefUnwindSafe for TriTextured
impl Send for TriTextured
impl Sync for TriTextured
impl Unpin for TriTextured
impl UnsafeUnpin for TriTextured
impl UnwindSafe for TriTextured
Blanket Implementations§
§impl<T> Any for Twhere
T: 'static + ?Sized,
impl<T> Any for Twhere
T: 'static + ?Sized,
§impl<T> Borrow<T> for Twhere
T: ?Sized,
impl<T> Borrow<T> for Twhere
T: ?Sized,
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)