Gfx GX Fn GXGetTexObjWidth - wowjinxy/libPorpoise GitHub Wiki
GXGetTexObjWidth
- Category:
Texture
- Matrix Status:
Implemented
- Matrix Notes: Getter returns texture width from object state.
- Matrix Link: Gfx-GX-API-Matrix
Official SDK (Reference)
- Manual page:
reference/man/gfx/gx/Texture/GXGetTexObjWidth.html
- SDK source:
reference/ACGC-PC-Port/src/static/dolphin/gx/GXTexture.c (GXGetTexObjWidth)
- SDK behavior:
- Returns width decoded from the texture object register image (
image0 width field + 1).
- No state mutation; pure accessor.
- SDK debug path asserts non-null texture object pointer.
libPorpoise Implementation
- Public API declaration:
include/dolphin/gx/GXGet.h
- Runtime implementation:
src/gx/pc_gx_texture.c (GXGetTexObjWidth)
- Behavior:
- Returns width from
TEXOBJ_WIDTH in PC texture object storage.
- No side effects.
SDK vs Porpoise Diff
- Signature parity:
- Manual documents
GXTexObj*; SDK source uses const GXTexObj*.
- Porpoise uses
GXTexObj*; call-site semantics are equivalent for reads.
- Behavioral parity:
- SDK: returns object width.
- Porpoise: returns object width.
- Known divergence:
- SDK has explicit debug assert on null pointer; Porpoise follows existing low-level getter convention (no assert in this accessor path).
Validation Checklist
Working Notes
- No runtime code change required in this pass.