Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

TriTextured

Struct TriTextured 

Source
#[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: u32

OT linkage.

§tex_window: u32

GP0(E2) texture-window command.

§color_cmd: u32

0x24000000 | tint header.

§v0: u32

Vertex 0 position.

§uv0_clut: u32

(u0, v0, clut) packed.

§v1: u32

Vertex 1 position.

§uv1_tpage: u32

(u1, v1, tpage) packed.

§v2: u32

Vertex 2 position.

§uv2: u32

(u2, v2, 0) packed.

Implementations§

Source§

impl TriTextured

Source

pub const WORDS: u8 = 8

Data-word count.

Source

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.

Source

pub const fn with_material( verts: [(i16, i16); 3], uvs: [(u8, u8); 3], material: TextureMaterial, ) -> Self

Build a textured triangle using a TextureMaterial.

Source

pub const fn with_material_packet_texcoords( verts: [(i16, i16); 3], uvs: [(u8, u8); 3], material: TextureMaterial, ) -> Self

👎Deprecated:

identical to with_material

The same packet as Self::with_material, which it forwards to.

Source

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.

Source

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

Source§

fn clone(&self) -> TriTextured

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TriTextured

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl GpuPacket for TriTextured

Source§

const WORDS: u8 = TriTextured::WORDS

Payload words after the tag.
Source§

impl Hash for TriTextured

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given [Hasher]. Read more
1.3.0§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given [Hasher]. Read more
Source§

impl PartialEq for TriTextured

Source§

fn eq(&self, other: &TriTextured) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for TriTextured

Source§

impl Eq for TriTextured

Source§

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 T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.