nd Function Reference
ndGenInstance
-
Function name
-
ndGenInstance
-
Syntax
-
NDD_INSTANCE *ndGenInstance(NDD_INSTANCE *parent, u16 type, u16 prio, int
gid);
-
Explanation
-
Creates and links an instance structure.
-
Parameters
-
NDD_INSTANCE *parent;
-
Parent instance pointer.
-
u16 type;
-
Instance type.
-
u16 prio;
-
Priority code. This affects the order of evaluation of display instances.
-
The specifiable range varies depending on the type.
-
int gid;
-
Instance group ID.
-
Return value
-
NDD_INSTANCE *;
-
The created instance pointer.
-
Note
-
Creates the instance. The characteristics depend on the type.

Return to nd Function Reference Index
ndChangePriority
-
Function name
-
ndChangePriority
-
Syntax
-
u16 ndChangePriority(NDD_INSTANCE *isp, u16 newprio);
-
Explanation
-
Changes the priority of one instance.
-
Parameters
-
NDD_INSTANCE *isp;
-
Instance pointer.
-
u16 newprio;
-
New priority value.
-
Return value
-
u16;
-
Old priority value.
-
Note
-
Links to the most significant specified priority.

Return to nd Function Reference Index
ndChangeParent
-
Function name
-
ndChangeParent
-
Syntax
-
NDD_INSTANCE ndChangeParent(NDD_INSTANCE *isp, NDD_INSTANCE *newparent);
-
Explanation
-
Changes the parent of the instance.
-
Parameters
-
NDD_INSTANCE *isp;
-
Target's instance pointer.
-
NDD_INSTANCE *newparent;
-
New parent instance pointer.
-
Return value
-
NDD_INSTANCE *;
-
Parent instance up until now.
-
Note
-
newparent must not be NULL.

Return to nd Function Reference Index
ndDeleteInstanceGID
-
Function name
-
ndDeleteInstanceGID
-
Syntax
-
void ndDeleteInstanceGID(NDD_INSTANCE *isp, int type, int gid, int mask);
-
Explanation
-
Deletes the instance, matching the parameters specified by type, gid,
and mask.
The instance that is deleted is the one that hits [GID] & mask ==
gid with [TYPE] == type. However, when -1 is specified for type, type is
not checked.
All children of isp are evaluated. If a parent is hit upon in the search,
all of its children are deleted.
-
Parameters
-
NDD_INSTANCE *isp;
-
int type;
-
int gid;
-
int mask;
-
Note
-
This function cannot be used inside an instance callback.

Return to nd Function Reference Index
ndInit
-
Function name
-
ndInit
-
Syntax
-
void ndInit(void);
-
Explanation
-
Initializes the module.
-
Note
-
This function must be called before using the overall 'nd' API. The current
scene is prepared. Even if the scene is not set, the base for displaying
the object is prepared.

Return to nd Function Reference Index
ndEntryAnimation
-
Function name
-
ndEntryAnimation
-
Syntax
-
NDD_INSTANCE *ndEntryAnimation(NDD_INSTANCE *parent, int animno, int id,
NDD_INSTANCE *tarinst);
-
Explanation
-
Creates one timekeeper instance and the number of channels' worth of animation
instances from the animation reference table.
-
Parameters
-
NDD_INSTANCE *parent;
-
Parent instance pointer.
-
int animno;
-
Animation number.
-
int id;
-
Instance ID.
-
NDD_INSTANCE *tarinst;
-
Instance pointer attaching the animation.
-
Return value
-
NDD_INSTANCE *;
Animation timekeeper instance pointer.
-
Note
-
Cannot be used inside an instance callback.

Return to nd Function Reference Index
ndEntryAnimationRaw
-
Function name
-
ndEntryAnimationRaw
-
Syntax
-
NDD_INSTANCE *ndEntryAnimationRaw(NDD_INSTANCE *parent, NDR_ANIM *anp,
int gid, NDD_INSTANCE *tarinst);
-
Explanation
-
Creates one timekeeper instance and the number of channels' worth of animation
instances from the animation reference table.
-
Parameters
-
NDD_INSTANCE *parent;
-
Parent instance pointer.
-
NDR_ANIM *anp;
-
Pointer to the animation reference table.
-
int gid;
-
Instance group ID.
-
NDD_INSTANCE *tarinst;
-
Instance pointer attaching the animation.
-
Return value
-
NDD_INSTANCE *;
Animation timekeeper instance pointer.
-
Note
-
Cannot be used inside an instance callback.

Return to nd Function Reference Index
ndEntryObject
-
Function name
-
ndEntryObject
-
Syntax
-
NDD_INSTANCE *ndEntryObject(NDD_INSTANCE *parent, int objno, int shapeno,
int animno, int gid, int flag);
-
Explanation
-
Creates one instance from the object reference table.
-
Parameters
-
NDD_INSTANCE *parent;
-
Parent instance pointer. If NULL, hangs down from object root.
-
int objno;
-
Index of the object reference table.
-
int shapeno;
-
Offset of the shape reference table. The object reference table "shape"
and the list at the position calaculated by adding the numeric value specified
here is registered in the shape held by the object. The shape maintained
by the object is registered from the "shape" of the object reference table
and the list of positions obtained by adding the numeric values specified
by "shape".
-
int animno;
-
Offset of the animation reference table. To pass animation simultaneously,
pass the animation of the table derived from adding this value to the values
of NDR_OBJ.geom_anim.
-
int gid;
-
The instance ID base value. "gid" specified by NDR_OBJ is added to this
value and the sum is registered in the created object instance structure.
-
int flag;
-
Bit-assigned creation flag. Effective when the bit is 1.
-
bit 0 ... Set together with NDR_OBJ animation link.
-
bit 1 ... Evaluates by tracing link toward end of the parent-child relationship.
-
Return value
-
NDD_INSTANCE *;
Pointer to top parent among the created instances.
-
Notes
-
ndEntryObjectRaw is called internally.
-
Cannot be used inside an instance callback.

Return to nd Function Reference Index
ndEntryObjectRaw
-
Function name
-
ndEntryObjectRaw
-
Syntax
-
NDD_INSTANCE *ndEntryObjectRaw(NDD_INSTANCE *parent, NDR_OBJ *rop, int
gid);
-
Explanation
-
Creates one instance from the object reference table. The link is not followed,
and the animation instance is not created.
-
Parameters
-
NDD_INSTANCE *parent;
-
Parent instance pointer. If NULL, hangs down from object root.
-
NDR_OBJ *rop;
-
Pointer to the object reference table.
-
int gid;
-
Instance ID base value. "gid" specified by NDR_OBJ is added to this value
and the sum is registered in the created object instance structure.
-
Return value
-
NDD_INSTANCE *;
Created instance pointer.
-
Note
-
Cannot be used inside an instance callback.

Return to nd Function Reference Index
ndAttachAnimation
-
Function name
-
ndAttachAnimation
-
Syntax
-
void ndAttachAnimation(NDD_INSTANCE *parent, NDD_INSTANCE *isp, int objno,
int animno, int gid, int flag)
-
Explanation
-
References the animation link in the object reference table and attaches
the animation to the existing object instance.
-
Parameters
-
NDD_INSTANCE *parent;
-
Parent instance pointer. If NULL, hangs down from animation root.
-
NDD_INSTANCE *isp;
-
Pointer of object instance attaching the animation.
-
int objno;
-
Object number on the global resource list.
-
int animno;
-
Offset of the animation reference table. To pass animation simultaneously,
pass the animation of the table derived from adding this value to the values
of NDR_OBJ.geom_anim.
-
int gid;
-
The instance ID base value. "gid" specified by NDR_OBJ is added to this
value and the sum is registered in the created object instance structure.
-
int flag;
-
Bit-assigned creation flag. Effective when the bit is 1.
-
bit 0 ... Unused.
-
bit 1 ... Evaluates by tracing link toward end of the parent-child relationship.
-
Return value
-
NDD_INSTANCE *;
-
Pointer to the top parent among the created instances.
-
Note
-
The object instance passed by "isp" is handled as an object that was created
according to the NDR_OBJ structure list specified by objno.
-
Cannot be used inside an instance callback.

Return to nd Function Reference Index
ndEntryDeformVtx
-
Function name
-
ndEntryDeformVtx
-
Syntax
-
NDD_INSTANCE *ndEntryDeformVtx(NDD_INSTANCE *isp, NDR_DEFORM *dmfp, int
ofs, int gid);
-
Explanation
-
Passes the vertex deform instance.
-
Parameters
-
NDD_INSTANCE *isp;
-
Parameters
-
NDR_DEFORM *dmfp;
-
Pointer to the vertex deform structure.
-
int ofs;
-
Offset for when the raw vertex data list is referenced.
-
int gid;
-
Instance group ID.
-
Return value
-
NDD_INSTANCE *;
-
Pointer of the created vertex deform instance.
-
Note
-
This instance must be a child of the parent deform_root_instp.

Return to nd Function Reference Index
ndEntryDeformVtxcol
-
Function name
-
ndEntryDeformVtxcol
-
Syntax
-
NDD_INSTANCE *ndEntryDeformVtxcol(NDD_INSTANCE *isp, NDR_DEFORM *dmfp,
int ofs, int gid);
-
Explanation
-
Passes the vertex color deform instance.
-
Parameters
-
NDD_INSTANCE *isp;
-
Pointer to the active vertex instance.
-
NDR_DEFORM *dmfp;
-
Pointer to the vertex color deform structure.
-
int ofs;
-
Offset for when the raw vertex color data list is referenced.
-
int gid;
-
Instance group ID.
-
Return value
-
NDD_INSTANCE *;
-
Pointer of the created vertex color deform instance.
-
Note
-
This instance must be a child of the parent deform_root_instp. The system
function malloc() is used internally to reserve three memory sites. Since
the callback at the end is set, the memory reserved by malloc() is released
within the callback routine.

Return to nd Function Reference Index
ndEntryDeformVtxnv
-
Function name
-
ndEntryDeformVtxnv
-
Syntax
-
NDD_INSTANCE *ndEntryDeformVtxnv(NDD_INSTANCE *isp, NDR_DEFORM *dmfp, int
ofs, int gid);
-
Explanation
-
Passes the vertex normal deform instance.
-
Parameters
-
NDD_INSTANCE *isp;
-
Pointer to the active vertex instance.
-
NDR_DEFORM *dmfp;
-
Pointer to the vertex normal deform structure.
-
int ofs;
-
Offset for when the raw vertex normal data list is referenced.
-
int gid;
-
Instance group ID.
-
Return value
-
NDD_INSTANCE *;
-
Pointer of the created vertex normal deform instance.
-
Note
-
This instance must be a child of the parent deform_root_instp. The system
function malloc() is used internally to reserve three memory sites. Since
the callback at the end is set, the memory reserved by malloc() is released
within the callback routine.

Return to nd Function Reference Index
ndEntryDeformVtxst 
-
Function name
-
ndEntryDeformVtxst
-
Syntax
-
NDD_INSTANCE *ndEntryDeformVtxst(NDD_INSTANCE *isp, NDR_DEFORM *dmfp, int
ofs, int gid);
-
Explanation
-
Makes an entry of the vertex texture coordinate deform instance.
-
Parameter
-
NDD_INSTANCE *isp;
-
Pointer for the active vertex instance
-
NDR_DEFORM *dmfp;
-
Pointer for the vertex texture coordinate deform structure
-
int ofs;
-
Offset when referring to the raw vertex texture coordinate data list
-
int gid;
-
Instance group ID
-
Retrun value
-
NDD_INSTANCE *;
-
Pointer for the created vertex texture coordinate deform instance
-
Note
-
This instance is linked to the exclusive parent (deform_root_instp). Three (3) memories
are reserved inside using the system function malloc(). Also, a call back
for terminating is set, and the memory reserved by malloc() is released
inside the call back routine.

Return to nd Function Reference Index
ndEntryDeformShape 
-
Function name
-
ndEntryDeformShape
-
Syntax
-
NDD_INSTANCE *ndEntryDeformShape(NDD_INSTANCE *isp, int ofs_rawvtx, int
ofs_rawvtxcol, int ofs_rawvtxnv, int ofs_rawvtxst, int gid, int flag);
-
Explanation
-
Takes the shape being referenced by the object instance and substitutes
it for the modulated vertex information.
-
Parameters
-
NDD_INSTANCE *isp;
-
Pointer to the object instance of the modulation target.
-
int ofs_rawvtx;
-
int ofs_rawvtxcol;
-
int ofs_rawvtxnv;
-
int ofs_rawvtxst;
-
Offset for when each data list is referenced.
-
int gid;
-
Instance group ID.
-
int flag;
-
Bit-assigned creation flag. Effective when the bit is 1.
-
bit 0 ... Passes the vertex deform.
-
bit 1 ... Passes the vertex color deform.
-
bit 2 ... Passes the vertex normal deform.
-
bit 3 ... Makes an entry of the vertex texture coordinate deform.
-
Return value
-
NDD_INSTANCE *;
-
The created active vertex instance's pointer.
-
Note
-
The upper instance of ndEntryDeformVtx(), ndEntryDeformVtxnv(), ndEntryDeformVtxcol(),
and ndEntryDeformVtxst() are created. Inside the function, the creation
of each deform instance is evaluated while watching the parameter flag.
It has two Vtx buffers in order to adjust to the asynchronous construction
of Gfx. The system function malloc() is used internally to reserve three
memory sites.
-
Since the callback at the end is set, the memory reserved by malloc() is
released within the callback routine.

Return to nd Function Reference Index
ndAttachDeform 
-
Function name
-
ndAttachDeform
-
Syntax
-
void ndAttachDeform(NDD_INSTANCE *isp, int rawvtxno, int rawvtxcolno, int
rawvtxnvno, int rawvtxstno, int gid, int flag);
-
Explanation
-
Passes the deform if it is prepared for the hierarchical object instance.
-
Parameters
-
NDD_INSTANCE *isp;
-
Pointer of the object instance that becomes the target for creation of
the active vertex instance.
-
int rawvtxno;
-
int rawvtxcolno;
-
int rawvtxnvno;
-
int rawvtxstno;
-
Offset for when each data list is referenced.
-
int gid;
-
Instance group ID.
-
int flag;
-
Bit-assigned creation flag. Effective when the bit is 1.
-
bit 0 ... Unused.
-
bit 1 ... Evaluates by tracing link toward the end of the parent-child relationship.
-
bit 2 ... Passes the vertex deform.
-
bit 3 ... Passes the vertex color deform.
-
bit 4 ... Passes the vertex normal deform.
-
bit 5 ... Makes an entry of the vertex texture coordinate deform.
-
Return value
-
Note

Return to nd Function Reference Index
ndSetupScene 
-
Function name
-
ndSetupScene
-
Function name
-
void ndSetupScene(NDD_RESINFO *rip, int gid, int flag);
-
Explanation
-
Constructs the scene from the scene reference table.
-
Parameters
-
NDD_RESINFO *rip;
-
Resouce Information
-
int gid;
-
Group ID at the time the object instance was registered.
-
int flag;
-
Flag for creating the flags that set the creation conditions. The following
are effective when each bit is 1:
-
bit 0 ... Set together with the NDR_OBJ animation link.
-
bit 1 ... Evaluates by tracing link toward the end of the parent-child relaionship.
-
bit 2 ... Passes the vertex deform.
-
bit 3 ... Passes the vertex color deform.
-
bit 4 ... Passes the vertex normal deform
-
bit 5 ... Makes an entry of the vertex texture coordinate deform.
-
Note
-
Refer to rip->resinfo->scene for the scene data structure used for making
settings.

Return to nd Function Reference Index
ndSetScreen
-
Function name
-
ndSetScreen
-
Syntax
-
void ndSetScreen(int top, int bottom, int left, int right);
-
Explanation
-
Sets the width and height of the screen display area.
-
Parameters
-
int top;
-
int bottom;
-
int left;
-
int right;
-
The display range in units of pixels.
-
Note

Return to nd Function Reference Index
ndResInit 
-
Function name
-
ndResInit
-
Syntax
-
void ndResInit(int olplim, int slplim, int alplim, int rvlplim, int rvclplim,
int rvnlplim, int rvslplim);
-
Explanation
-
Initializes the resource module.
-
Parameters
-
int olplim;
-
int slplim;
-
int alplim;
-
int rvlplim;
-
int rvclplim;
-
int rvnlplim;
-
int rvslplim;
-
The list management pointer and the maximum number for each data class.
-
Note
The pointer list is reserved by the system
function malloc().

Return to nd Function Reference Index
ndResEntry 
-
Function name
-
ndResEntry
-
Syntax
-
NDD_RESINFO *ndResEntry(NDR_RESINFO *rrp, int usemask);
-
Explanation
-
Adds the specified resource to the global resource list.
-
Parameters
-
NDR_RESINFO *rrp;
-
Pointer to the resource information structure for reference use.
-
int usemask;
-
Specifies in bits the data type to be passed from the rrp contents.
-
Return value
-
NDR_RESINFO *drp;
-
Pointer to the resource information structure.
-
Note

Return to nd Function Reference Index
ndResRelease 
-
Function name
-
ndResRelease
-
Syntax
-
void ndResRelease(NDD_RESINFO *drp);
-
Explanation
-
Releases the specified resource from the global list.
-
Parameters
-
NDD_RESINFO *drp;
-
Pointer to the resource information structure.
-
Return value
-
Note
-
The argument drp is released.
-
Only the resource that was just passed can be released.

Return to nd Function Reference Index
ndDeleteInstance
-
Function name
-
ndDeleteInstance
-
Syntax
-
void ndDeleteInstance(NDD_INSTANCE *isp);
-
Explanation
-
Delete instance and matching the parameters.
-
Note
-
The function cannot be used inside an instance callback.

Return to nd Function Reference Index
ndGetInstanceTRXPointer
-
Function name
-
ndGetInstanceTRXPointer
-
Syntax
-
TRX *ndGetInstanceTRXPointer(NDD_INSTANCE *isp);
-
Explanation
-
Return transform buffer pointer from instance pointer.
-
Parameter
-
NDD_INSTANCE *isp;
-
Instance pointer
-
Note
-
Depending on data type, the position of TRX is varied.

Return to nd Function Reference Index
ndSetupIdentTRX
-
Function name
-
ndSetupIdentTRX
-
Syntax
-
void ndSetupIdentTRX(TRX *p)
-
Explanation
-
Return matrix
-
Parameter
-
TRX *p;
-
Pointer of transform matrix
-
Note
-
Assign 9 parameters of 0,0,0, 0,0,0, 1,1,1 and returns matrix corresponding
to Parallel translation, rotation, enlargement and reduction.

Return to nd Function Reference Index
ndProgressAnimTime
-
Function name
-
ndProgressAnimTime
-
Syntax
-
int ndProgressAnimTime(NDD_INST_ANIMTK *ntkp);
-
Explanation
-
Time advance process for timekeeper.
-
Parameters
-
NDD_INST_ANIMTK *ntkp
-
The animation timekeeper instance pointer.
-
Return value
-
int;
-
Execution result. At present, 1 must be returned.
-
Note
-
Called by ndEvalInstance

Return to nd Function Reference Index
ndSetAnimChannel
-
Function name
-
ndSetAnimChannel
-
Syntax
-
int ndSetAnimChannel(NDD_INST_ANIM *niap);
-
Explanation
-
Key frame animation channel process.
-
Parameters
-
NDD_INST_ANIM *niap;
-
Animation instance pointer.
-
Return value
-
int;
-
Execution result.
-
Note
-
Called by ndEvalInstance.

Return to nd Function Reference Index
ndReloadDynamicVertex 
-
Function name
-
ndReloadDynamicVertex
-
Syntax
-
void ndReloadDynamicVertex(NDD_INST_DYNAMICVTX *nidp);
-
Explanation
-
References the modulation tables of the various deform instances and assembles
Vtx.
-
Parameters
-
NDD_INST_DYNAMICVTX *nidp;
-
The active vertex instance's internal structure pointer.
-
Return value
-
Note
-
Since it depends in part on the drawing driver, two Vtx tables are prepared
for making settings.

Return to nd Function Reference Index
ndDeformVertex
-
Function name
-
ndDeformVertex
-
Syntax
-
void ndDeformVertex(NDD_INST_DEFORM_VTX *nidvp);
-
Explanation
-
Deforms the vertex.
-
Parameters
-
NDD_INST_DEFORM_VTX *nidvp;
-
The vertex deform instance's internal structure pointer.
-
Return value
-
Note

Return to nd Function Reference Index
ndDeformVertexNv
-
Function name
-
ndDeformVertexNv
-
Syntax
-
void ndDeformVertexNv(NDD_INST_DEFORM_VTXNV *nidcp);
-
Explanation
-
Defroms the vertex normal.
-
Parameters
-
NDD_INST_DEFORM_VTXNV *nidcp;
-
The vertex normal deform instance's internal structure pointer.
-
Return value
-
Note

Return to nd Function Reference Index
ndDeformVertexColor
-
Function name
-
ndDeformVertexColor
-
Syntax
-
void ndDeformVertexColor(NDD_INST_DEFORM_VTXCOL *nidcp);
-
Explanation
-
Deformas the vertex color.
-
Parameters
-
NDD_INST_DEFORM_VTXCOL *nidcp;
-
The vertex color deform instance's internal structure pointer.
-
Return value
-
Note

Return to nd Function Reference Index
ndDeformVertexSt 
-
Function name
-
ndDeformVertexSt
-
Syntax
-
void ndDeformVertexSt(NDD_INST_DEFORM_VTXST *nidcp);
-
Explanation
-
Deforms the vertex normal.
-
Parameters
-
NDD_INST_DEFORM_VTXNV *nidcp;
-
Vertex texture deform instance's internal structure pointer
-
Return value
-
Note

Return to nd Function Reference Index
ndMakeCameraMatrix
-
Funtion name
-
ndMakeCameraMatrix
-
Syntax
-
void ndMakeCameraMatrix(float mf[4][4])
-
Explanation
-
Create Camera matrix(LookAt) from Camera informatin.
-
Note
-
It is not the matrix related to Perspective or PROJECTION_VIEW.

Return to nd Function Reference Index
ndMultiTrx
-
Function name
-
ndMultiTrx
-
Syntax
-
void ndMultiTrx(float mf[4][4], TRX *trxp, u32 order);
-
Explanation
-
Evaluates TRX structure and creates 4x4 matrix.
-
Parameters
-
float mf[4][4];
-
Buffer storing matrix to be created.
-
TRX *trxp;
-
Transform data structure of matrix.
-
u32 order;
-
Rotation component order.
-
Note
-
Created 4x4 Matrix is stored in buffer of instance work, and used for displaying.

Return to nd Function Reference Index
ndEvalInstanceOne 
-
Function name
-
ndEvalInstanceOne
-
Syntax
-
int ndEvalInstanceOne(NDD_INSTANCE *isp, float mf[4][4], float cmf[4][4],
int forceupd);
-
Explanation
-
Frame evaluation for instance specified by isp.
-
Parameters
-
NDD_INSTANCE *isp;
-
Instance pointer.
-
float mf[4][4];
-
Model view matrix.
-
float cmf[4][4];
-
Model view matrix updated by the instance.
-
int forceupd;
-
Flag for forcing matrix creation. FOrced by 1.
-
Return value
-
int;
-
Matrix update flag. When the "forceudp" argument value and its own matrix
are updated, 1 returns the "or" value.
-
Note
-
mf is used for the basic model view matrix. Even if the matrix is not evaluated,
mf is returned to cmf.

Return to nd Function Reference Index
ndEvalInstance
-
Function name
-
ndEvalInstance
-
Syntax
-
void ndEvalInstance(NDD_INSTANCE *isp, float mf[4][4], int forceupd);
-
Explantation
-
Frame evaluation is performed on every instances under the instance specified
by isp.
-
Parameters
-
NDD_INSTANCE *isp;
-
Instance pointer.
-
float mf[4][4];
-
Model view matrix.
-
int forceupd;
-
Flag for forcing matrix creation. Forced by 1.
-
Note
-
mf is used for the basic model view matrix.
-
Since the callback at the end and 64 bytes buffer is prepared in local,
it may create hudge stack.

Return to nd Function Reference Index
ndClearFB
-
Function name
-
ndClearFB
-
Syntax
-
Gfx *ndClearFB(Gfx *gp, u16 fill_depth, u16 fill_col);
-
Explanation
-
Parameters
-
Gfx *gp;
-
Display list pointer
-
u16 fill_depth;
-
The value filling the Z buffer.
-
u16 fill_col;
-
The value filling the color value.
-
Return value
-
Gfx *gp;
-
Dislay list pointer.
-
Note

Return to nd Function Reference Index
ndEvalLight
-
Function name
-
ndEvalLight
-
Syntax
-
int ndEvalLight(float *tarpos, NDD_LIGHT *lp, RGBAQUAD *color, s8 *nv);
-
Explanation
-
Parameters
-
float *tarpos;
-
Position of the target that is bathed in light. Three values x,y,z. If
NULL, calculate as the origin (0,0,0).
-
NDD_LIGHT *lp;
-
Pointer to light structure.
-
RGBQUAD *color;
-
Pointer to the RGBAQUAD structure storing the color value.
-
s8 *nv;
-
Pointer storing the light vector. Three values x,y,z(3 bytes) in S0.7 format.
-
Return value
-
int;
-
0 is returned when light is null on evaluation.
-
Note
-
The NDD_LIGHT structure has the following limitations: * The normal passed
by fnv must be normalized. * If NDC_LFLAG_ATTENUATION is set for flag,
valid value must be assigned for start and end. * NDC_LFLAG_CUTOFF is valid
only when NDC_LFLAG_HAVEPOS. These can be checked by sacrificing the execution
speed, but they are ignored since they are game-use managers. When the
return value "0" is returned, color and nv are not set.

Return to nd Function Reference Index
ndReloadLightReg
-
Function name
-
ndReloadLightReg
-
Syntax
-
Gfx *ndReloadLightReg(Gfx *gp, NDD_LIGHT *lp, u32 newcolor, s8 *newlvec);
-
Explanation
-
Parameters
-
Gfx *gp;
-
Display list pointer.
-
NDD_LIGHT *lp;
-
Pointer to the light structure.
-
u32 newcolor;
-
The newly set color value. It must be stored in 0xRRGGBB00 format from
the high-order bit. The lower 8 bits are handled internally as 0x00.
-
s8 *newlvec;
-
Pointer to the newly set vector. See the S0.7 format values xy,z (3 bytes).
NULL is not accepted.
-
Return value
-
Gfx *gp;
-
Display list pointer.
-
Note
-
References color, power and stored_nv is the NDD_LIGHT structure, defineds
the heap for require parts, and loads the RSP command into the buffer.
Since this function has been optimized for internal use, please know it
thorughly if the user is to be free to call it at will.

Return to nd Function Reference Index
ndSetupLightset
-
Function name
-
ndSetupLightset
-
Syntax
-
Gfx *ndSetupLightset(Gfx *gp, float *tarpos, NDD_LIGHTSET *lightset);
-
Explanation
-
Evaluates the initialized lightset passed by "lightset" together with the
object that becomes the target, and loads only the part that has changed
to the display list.
-
Parameters
-
Gfx *gp;
-
Display list pointer.
-
float *tarpos;
-
The position of the target that is bathed in the light. Three value x,y,z.
If NULL, calculate as the orgin (0,0,0).
-
NDD_LIGHTSET *lightset;
-
Pointer to the lightset structure.
-
Return value
-
Gfx *gp;
-
Display list pointer.
-
Note
-
The "tarpos" argument is passed to ndEvalLight() and evaluated. If the
result is NULL, it is replaced with the origin ~ and evaluated.

Return to nd Function Reference Index
ndInitLights
-
Function name
-
ndInitLights
-
Syntax
-
int ndInitLights( NDD_LIGHTSET *lightset );
-
Explanation
-
Resets the RDP's light settings, determines the number of lights, and allocates
the light number to each light structure.
-
Parameter
-
NDD_LIGHTSET *lightset;
-
Pointer to the lightset structure.
-
Return value
-
int;
-
Number of effective lights.
-
Note
-
References the _ENABLE bit of the flag of each light structure, calculates
the required number of lights, and allocates each light number. These are
the light numbers that are evaluated by the RSP. However, the user does
not have to pay any special attention to them. They are referenced and
used when resetting with the API function.

Return to nd Function Reference Index
ndSetupObjectRegister
-
Function name
-
ndSetupObjectRegister
-
Syntax
-
Gfx *ndSetupObjectRegister( Gfx *gp, NDD_INST_OBJ *niop );
-
Explanation
-
References the object instance structure, and resets the registers specified
for resetting.
-
Parameters
-
Gfx *gp;
-
Pointer to the display list buffer.
-
NDD_INST_OBJ *niop;
-
Pointer to the object instance structure.
-
Return
-
Gfx *;
-
Gfx buffer pointer after updating.
-
Note
-
Called by ndDrawObjectInstance

Return to nd Function Reference Index
ndDrawShape
-
Function name
-
ndDrawShape
-
Syntax
-
Gfx *ndDrawShape( Gfx *gp, NDR_SHAPE *shp );
-
Explanation
-
Loads the Gfx structure into the drawing buffer in accordance with the
contents of the shape structure.
-
Parameters
-
Gfx *gp;
-
Pointer to the display list buffer.
-
NDR_SHAPE *shp;
-
Pointer to the shape structure for reference use.
-
Return value
-
Gfx *;
-
Gfx buffer pointer after updating.
-
Note
-
Called by ndDrawObjectInstance

Return to nd Function Reference Index
ndDrawObjectInstance
-
Function name
-
ndDrawObjectInstance
-
Syntax
-
int ndDrawObjectInstance( NDD_INST_OBJ *niop );
-
Explanation
-
Display one object.
-
Parameters
-
Gfx *gp;
-
Pointer to the display list buffer.
-
NDD_INST_OBJ *niop;
-
Pointer to the object instance structure.
-
Return value
-
Gfx *;
-
Gfx buffer pointer after updating
-
Note
-
Called by ndBuildInstanceGfx

Return to nd Function Reference Index
ndBuildInstanceGfxAtPrio
-
Function name
-
ndBuildInstanceGfxAtPrio
-
Syntax
-
Gfx *ndBuildInstanceGfxAtPrio(Gfx *gp, NDD_INSTANCE *isp, u16 start, u16
end);
-
Explanation
-
Draws instances of the specific priority after the specified instance pointer.
-
Parameters
-
Gfx *gp;
-
Display list pointer
-
NDD_INSTANCE *isp;
-
The instance pointer. if NULL is given, then everything that follows the
root of the object is evaluated.
-
u16 start;
-
The priority that is to be drawn. Start is included in the priority that
is to be drawn.
-
u16 end;
-
The priority that is not to be drawn. Please not end will not be drawn.
-
Return value
-
Gfx *;
-
Updated display list pointer.
-
Note
-
Please assign larger value(higher priority) to start.

Return to nd Function Reference Index
ndBuildSceneGfx
-
Funtion name
-
ndBuildSceneGfx
-
Syntax
-
Gfx *ndBuildSceneGfx(Gfx *gp, float mul[4][4]);
-
Explanation
-
Build up display list of scene part from the current scene strucutre.
-
Parameter
-
Gfx *gp;
-
Display list pointer.
-
float mul[4][4];
-
Camera matrix
-
Note
-
Matrix of camera 'mul' will be multiplied on projection matrix.

Return to nd Function Reference Index
ndBuildInstanceGfx
-
Funtion name
-
ndBuildInstanceGfx
-
Syntax
-
Gfx *ndBuildInstanceGfx(Gfx *gp, NDD_INSTANCE *isp);
-
Explanation
-
Build up display list of scene part from the current scene structure.
-
Parameters
-
Gfx *gp;
-
Display list pointer
-
NDD_INSTANCE *isp;
-
Instance pointer of an object. By assigning NULL, it will evaluate every
instance under the route of object.
-
Return value
-
Gfx *;
-
Updated display list pointer.
-
Note
-
ndBuildInstanceGfxAtPrio() is called internally by determining every priority.

Return to nd Function Reference Index
Copyright 1997-1999 NINTENDO Co., Ltd.
1998-1999 MONEGI CORPORATION
All rights reserved.