mirror of
https://github.com/rvtr/TwlIPL_commit-99.git
synced 2025-10-31 06:21:11 -04:00
458 lines
18 KiB
C
Executable File
458 lines
18 KiB
C
Executable File
/*---------------------------------------------------------------------------*
|
||
Project: NITRO-System - include - nnsys - g3d
|
||
File: kernel.h
|
||
|
||
Copyright 2004-2008 Nintendo. All rights reserved.
|
||
|
||
These coded instructions, statements, and computer programs contain
|
||
proprietary information of Nintendo of America Inc. and/or Nintendo
|
||
Company Ltd., and are protected by Federal copyright law. They may
|
||
not be disclosed to third parties or copied or duplicated in any form,
|
||
in whole or in part, without the prior written consent of Nintendo.
|
||
|
||
$Revision: 172 $
|
||
*---------------------------------------------------------------------------*/
|
||
|
||
//
|
||
// AUTHOR: Kenji Nishida
|
||
//
|
||
|
||
#ifndef NNSG3D_KERNEL_H_
|
||
#define NNSG3D_KERNEL_H_
|
||
|
||
#include <nnsys/g3d/config.h>
|
||
#include <nnsys/g3d/binres/res_struct.h>
|
||
#include <nnsys/g3d/binres/res_struct_accessor_anm.h>
|
||
|
||
#ifdef __cplusplus
|
||
extern "C" {
|
||
#endif
|
||
|
||
////////////////////////////////////////////////////////////////////////////////
|
||
//
|
||
// <20>\‘¢‘Ì’è‹`‹y‚Ñtypedef
|
||
//
|
||
|
||
#define NNS_G3D_SIZE_MAT_MAX_MAX 256
|
||
#define NNS_G3D_SIZE_JNT_MAX_MAX 256
|
||
#define NNS_G3D_SIZE_SHP_MAX_MAX 256
|
||
|
||
#if (NNS_G3D_SIZE_MAT_MAX <= 0 || NNS_G3D_SIZE_MAT_MAX > NNS_G3D_SIZE_MAT_MAX_MAX)
|
||
#error NNS_G3D_SIZE_MAT_MAX range error.
|
||
#endif
|
||
|
||
#if (NNS_G3D_SIZE_JNT_MAX <= 0 || NNS_G3D_SIZE_JNT_MAX > NNS_G3D_SIZE_JNT_MAX_MAX)
|
||
#error NNS_G3D_SIZE_JNT_MAX range error.
|
||
#endif
|
||
|
||
#if (NNS_G3D_SIZE_SHP_MAX <= 0 || NNS_G3D_SIZE_SHP_MAX > NNS_G3D_SIZE_SHP_MAX_MAX)
|
||
#error NNS_G3D_SIZE_SHP_MAX range error.
|
||
#endif
|
||
|
||
#if (NNS_G3D_SIZE_MAT_MAX % 32 != 0)
|
||
#error NNS_G3D_SIZE_MAT_MAX must be a multiple of 32.
|
||
#endif
|
||
|
||
#if (NNS_G3D_SIZE_JNT_MAX % 32 != 0)
|
||
#error NNS_G3D_SIZE_JNT_MAX must be a multiple of 32.
|
||
#endif
|
||
|
||
#if (NNS_G3D_SIZE_SHP_MAX % 32 != 0)
|
||
#error NNS_G3D_SIZE_SHP_MAX must be a multiple of 32.
|
||
#endif
|
||
|
||
typedef u32 NNSG3dTexKey; // compatible with NNSGfdTexKey
|
||
typedef u32 NNSG3dPlttKey; // compatible with NNSGfdPlttKey
|
||
|
||
|
||
/*---------------------------------------------------------------------------*
|
||
NNSG3dAnmObj
|
||
|
||
NNSG3dRenderObj‚ÉŽQ<C5BD>Æ‚³‚ê‚é<E2809A>\‘¢‘Ì<E28098>Bƒ<42>ƒ‚ƒŠ‚ÌŠm•Û<E280A2>E‰ð•ú‚̓†<C692>[ƒU<C692>[‚ªŽ©‚ç<E2809A>s‚¤
|
||
•K—v‚ª‚ ‚è‚Ü‚·<E2809A>B<EFBFBD>‰Šú‰»‚ÍNNS_G3dAnmObjInitŠÖ<C5A0>”‚Å<E2809A>s‚¢‚Ü‚·<E2809A>B
|
||
‚±‚Ì<E2809A>\‘¢‘Ì‚Ì–ðŠ„‚Í<E2809A>A
|
||
<20>EƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“ƒŠƒ\<5C>[ƒX‚Æ‚»‚ê‚ð<E2809A>ˆ—<CB86>‚·‚éŠÖ<C5A0>”‚̃yƒA‚ðŽw’肵<E2809A>A
|
||
<20>EƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“ƒŠƒ\<5C>[ƒX‚ƃ‚ƒfƒ‹ƒŠƒ\<5C>[ƒX‚ÌŠÖ˜A•t‚¯‚ð<E2809A>s‚¢<E2809A>A
|
||
<20>EƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“‚ÌŒ»<C592>݂̃tƒŒ<C692>[ƒ€‚ð•ÛŽ<C39B>‚·‚邱‚Ƃł·<E2809A>B
|
||
|
||
frame: ‚ǂ̃tƒŒ<C692>[ƒ€‚ð<E2809A>Ä<EFBFBD>¶‚·‚é‚©Žw’è‚·‚é<E2809A>B
|
||
ratio: ƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“ƒuƒŒƒ“ƒhŠÖ<C5A0>”‚ªŽg—p‚·‚é<E2809A>B
|
||
resAnm: ŒÂ<C592>X‚̃Aƒjƒ<6A><C692>[ƒVƒ‡ƒ“ƒŠƒ\<5C>[ƒX‚ւ̃|ƒCƒ“ƒ^
|
||
funcAnm: resAnm‚Ìframe”Ԗڂ̃tƒŒ<C692>[ƒ€‚ð<E2809A>Ä<EFBFBD>¶‚·‚éŠÖ<C5A0>”‚ւ̃|ƒCƒ“ƒ^
|
||
next: NNS_G3dRenderObjBindAnmObj, NNS_G3dRenderObjReleaseAnmObj‚Å
|
||
<20>ݒ肳‚ê‚é<E2809A>B
|
||
resTex: ƒeƒNƒXƒ`ƒƒƒŠƒ\<5C>[ƒX‚ւ̃|ƒCƒ“ƒ^<5E>BƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“‚ª•K—v‚Æ‚·‚é<E2809A>ê<EFBFBD>‡‚Ì‚Ý
|
||
<20>ݒ肳‚ê‚é<E2809A>B
|
||
priority: NNSG3dRenderObj‚É“o˜^‚³‚ê‚é<E2809A>Û‚Ì—D<E28094>æ<EFBFBD>‡ˆÊ
|
||
numMapData: ƒ‚ƒfƒ‹ƒŠƒ\<5C>[ƒX‚ƃAƒjƒ<6A>ƒŠƒ\<5C>[ƒX‚̃Cƒ“ƒfƒbƒNƒX‚̑Ήž‚ð‚Æ‚éƒe<C692>[ƒuƒ‹
|
||
‚̃Gƒ“ƒgƒŠ‚Ì<E2809A>”
|
||
*---------------------------------------------------------------------------*/
|
||
typedef struct NNSG3dAnmObj_
|
||
{
|
||
fx32 frame;
|
||
fx32 ratio;
|
||
void* resAnm; // ƒŠƒ\<5C>[ƒXƒtƒ@ƒCƒ‹“àƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“ƒf<C692>[ƒ^ƒuƒ<75>ƒbƒN‚ւ̃|ƒCƒ“ƒ^
|
||
void* funcAnm; // ŠeƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“‚ÌŠÖ<C5A0>”ƒ|ƒCƒ“ƒ^‚ɃLƒƒƒXƒg‚³‚ê‚é<E2809A>BƒfƒtƒHƒ‹ƒg‚ª“ü‚邪•Ï<E280A2>X‚Å‚«‚é
|
||
struct NNSG3dAnmObj_* next;
|
||
const NNSG3dResTex* resTex; // ƒeƒNƒXƒ`ƒƒƒuƒ<75>ƒbƒN‚Ì<E2809A>î•ñ‚ª•K—v‚È<E2809A>ê<EFBFBD>‡(ƒeƒNƒXƒ`ƒƒƒpƒ^<5E>[ƒ“ƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“‚Ì‚Ý)
|
||
u8 priority;
|
||
u8 numMapData;
|
||
u16 mapData[1]; // numMapDataŒÂ‚Ì”z—ñ‚ɂȂé(NNSG3dAnmObjMapData)
|
||
}
|
||
NNSG3dAnmObj;
|
||
|
||
//
|
||
// NNSG3dAnmObj‚É•K—v‚ȃ<C388>ƒ‚ƒŠ‚̃TƒCƒY‚̓‚ƒfƒ‹ƒŠƒ\<5C>[ƒX‚ƃAƒjƒ<6A><C692>[ƒVƒ‡ƒ“‚̃JƒeƒSƒŠ‚©‚猈’肳‚ê‚é<E2809A>B
|
||
// ƒ}ƒeƒŠƒAƒ‹ƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“‚Ì<E2809A>ê<EFBFBD>‡‚Í<E2809A>AˆÈ‰º‚̃}ƒNƒ<4E>‚ðŽg—p‚·‚é<E2809A>B
|
||
// –{“–‚Ísizeof(NNSG3dAnmObj) + sizeof(u16) * (pMdl->info.numMat - 1)
|
||
// ‚¾‚ª4ƒoƒCƒg‹«ŠE‚É‚·‚é
|
||
//
|
||
#define NNS_G3D_ANMOBJ_SIZE_MATANM(pMdl) ((sizeof(NNSG3dAnmObj) + sizeof(u16) * pMdl->info.numMat) & ~3)
|
||
|
||
//
|
||
// NNSG3dAnmObj‚É•K—v‚ȃ<C388>ƒ‚ƒŠ‚̃TƒCƒY‚̓‚ƒfƒ‹ƒŠƒ\<5C>[ƒX‚ƃAƒjƒ<6A><C692>[ƒVƒ‡ƒ“‚̃JƒeƒSƒŠ‚©‚猈’肳‚ê‚é<E2809A>B
|
||
// ƒWƒ‡ƒCƒ“ƒgƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“‚ƃrƒWƒrƒŠƒeƒBƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“‚Ì<E2809A>ê<EFBFBD>‡‚Í<E2809A>AˆÈ‰º‚̃}ƒNƒ<4E>‚ðŽg—p‚·‚é<E2809A>B
|
||
// –{“–‚Ísizeof(NNSG3dAnmObj) + sizeof(u16) * (pMdl->info.numNode - 1)
|
||
// ‚¾‚ª4ƒoƒCƒg‹«ŠE‚É‚·‚é
|
||
//
|
||
#define NNS_G3D_ANMOBJ_SIZE_JNTANM(pMdl) ((sizeof(NNSG3dAnmObj) + sizeof(u16) * pMdl->info.numNode) & ~3)
|
||
#define NNS_G3D_ANMOBJ_SIZE_VISANM(pMdl) ((sizeof(NNSG3dAnmObj) + sizeof(u16) * pMdl->info.numNode) & ~3)
|
||
|
||
/*---------------------------------------------------------------------------*
|
||
NNSG3dAnmObjMapData
|
||
|
||
NNSG3dAnmObj‚ÌmapData”z—ñ‚ÉŠi”[‚³‚ê‚éƒf<C692>[ƒ^‚Ì‚½‚߂̃†<C692>[ƒeƒBƒŠƒeƒB“I‚È
|
||
—ñ‹“Œ^<5E>B
|
||
*---------------------------------------------------------------------------*/
|
||
typedef enum
|
||
{
|
||
NNS_G3D_ANMOBJ_MAPDATA_EXIST = 0x0100,
|
||
NNS_G3D_ANMOBJ_MAPDATA_DISABLED = 0x0200,
|
||
NNS_G3D_ANMOBJ_MAPDATA_DATAFIELD = 0x00ff
|
||
}
|
||
NNSG3dAnmObjMapData;
|
||
|
||
|
||
/*---------------------------------------------------------------------------*
|
||
ƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“ƒuƒŒƒ“ƒhŠÖ<C5A0>”‚Ìtypedef
|
||
*---------------------------------------------------------------------------*/
|
||
// anm.h‚Å’è‹`
|
||
struct NNSG3dMatAnmResult_;
|
||
struct NNSG3dJntAnmResult_;
|
||
struct NNSG3dVisAnmResult_;
|
||
|
||
|
||
// ƒ}ƒeƒŠƒAƒ‹ƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“ƒuƒŒƒ“ƒhŠÖ<C5A0>”
|
||
typedef BOOL (*NNSG3dFuncAnmBlendMat)(struct NNSG3dMatAnmResult_*,
|
||
const NNSG3dAnmObj*,
|
||
u32);
|
||
|
||
// ƒWƒ‡ƒCƒ“ƒgƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“ƒuƒŒƒ“ƒhŠÖ<C5A0>”
|
||
typedef BOOL (*NNSG3dFuncAnmBlendJnt)(struct NNSG3dJntAnmResult_*,
|
||
const NNSG3dAnmObj*,
|
||
u32);
|
||
|
||
// ƒrƒWƒrƒŠƒeƒBƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“ƒuƒŒƒ“ƒhŠÖ<C5A0>”
|
||
typedef BOOL (*NNSG3dFuncAnmBlendVis)(struct NNSG3dVisAnmResult_*,
|
||
const NNSG3dAnmObj*,
|
||
u32);
|
||
|
||
|
||
/*---------------------------------------------------------------------------*
|
||
NNSG3dRenderObjFlag
|
||
|
||
NNSG3dRenderObj‚ªŽ<C2AA>‚ƒtƒ‰ƒO‚Å<E2809A>ANNS_G3dDraw‚Ì“®<E2809C>ì‚ðƒJƒXƒ^ƒ}ƒCƒY‚Å‚«‚é<E2809A>B
|
||
|
||
NNS_G3D_RENDEROBJ_FLAG_RECORD
|
||
NNS_G3dDraw‚ÌŽÀ<C5BD>sŽž‚É<E2809A>ArecJntAnm, recMatAnm‚ɃWƒ‡ƒCƒ“ƒg‚âƒ}ƒeƒŠƒAƒ‹‚Ì
|
||
ŒvŽZŒ‹‰Ê‚ðƒXƒgƒA‚µ‚Ü‚·<E2809A>BŽÀ<C5BD>s<EFBFBD>I—¹Žž‚É‚±‚̃tƒ‰ƒO‚ÍƒŠƒZƒbƒg‚³‚ê‚Ü‚·<E2809A>B
|
||
‚±‚̃tƒ‰ƒO‚ªƒŠƒZƒbƒg‚³‚ê‚Ä‚¢‚Ä<E2809A>ArecJntAnm, recMatAnm‚ªNULL‚Å–³‚¢<E2809A>ê<EFBFBD>‡‚Í
|
||
recJntAnm, recMatAnm“à‚ÌŒvŽZŒ‹‰Ê‚ª‚»‚̂܂܎g—p‚³‚ê‚Ü‚·<E2809A>B
|
||
NNS_G3D_RENDEROBJ_FLAG_NOGECMD
|
||
NNS_G3dDraw‚ÌŽÀ<C5BD>sŽž‚É<E2809A>AƒWƒIƒ<49>ƒgƒŠƒRƒ}ƒ“ƒh‚ð‘—<E28098>M‚µ‚Ü‚¹‚ñ<E2809A>B
|
||
NNS_G3D_RENDEROBJ_FLAG_SKIP_SBC_DRAW
|
||
NNS_G3dDraw‚ÌŽÀ<C5BD>sŽž‚É<E2809A>ASBC‚Ì•`‰æŒnƒRƒ}ƒ“ƒh‚ÌŽÀ<C5BD>s‚ðƒXƒLƒbƒv‚µ‚Ü‚·<E2809A>B
|
||
NNS_G3D_RENDEROBJ_FLAG_SKIP_SBC_MTXCALC
|
||
NNS_G3dDraw‚ÌŽÀ<C5BD>sŽž‚É<E2809A>ASBC‚Ì<E2809A>s—ñŒvŽZŒnƒRƒ}ƒ“ƒh‚ÌŽÀ<C5BD>s‚ðƒXƒLƒbƒv‚µ‚Ü‚·<E2809A>B
|
||
|
||
NNS_G3D_RENDEROBJ_FLAG_HINT_OBSOLETE
|
||
G3D“à•”‚ŃZƒbƒg<C692>^ƒŠƒZƒbƒg‚³‚ê‚éƒtƒ‰ƒO‚ÅhintXXXAnmExist‚ª<E2809A>³‚µ‚‚È‚¢<E2809A>ó‘Ô
|
||
‚Ì<E2809A>ê<EFBFBD>‡ƒZƒbƒg‚³‚ê‚Ü‚·(NNS_G3dRenderObjRemoveAnmObj‚³‚ꂽ‚Æ‚«ƒZƒbƒg)
|
||
|
||
NNS_G3D_RENDEROBJ_FLAG_SKIP_SBC_DRAW‚ÆNNS_G3D_RENDEROBJ_FLAG_SKIP_SBC_MTXCALC‚Í
|
||
g3dcvtr‚Å-sƒIƒvƒVƒ‡ƒ“‚ð‚‚¯‚ăRƒ“ƒo<C692>[ƒg‚µ‚½ƒ‚ƒfƒ‹‚ɑ΂µ‚Ä—LŒø‚Å‚·<E2809A>B
|
||
*---------------------------------------------------------------------------*/
|
||
typedef enum
|
||
{
|
||
NNS_G3D_RENDEROBJ_FLAG_RECORD = 0x00000001,
|
||
NNS_G3D_RENDEROBJ_FLAG_NOGECMD = 0x00000002,
|
||
NNS_G3D_RENDEROBJ_FLAG_SKIP_SBC_DRAW = 0x00000004,
|
||
NNS_G3D_RENDEROBJ_FLAG_SKIP_SBC_MTXCALC = 0x00000008,
|
||
NNS_G3D_RENDEROBJ_FLAG_HINT_OBSOLETE = 0x00000010
|
||
}
|
||
NNSG3dRenderObjFlag;
|
||
|
||
|
||
/*---------------------------------------------------------------------------*
|
||
NNSG3dSbcCallBackFunc
|
||
|
||
NNSG3dRS“à‚ÉŠi”[‚³‚ê‚éƒR<C692>[ƒ‹ƒoƒbƒNŠÖ<C5A0>”‚ւ̃|ƒCƒ“ƒ^
|
||
*---------------------------------------------------------------------------*/
|
||
struct NNSG3dRS_;
|
||
typedef void (*NNSG3dSbcCallBackFunc)(struct NNSG3dRS_*);
|
||
|
||
|
||
/*---------------------------------------------------------------------------*
|
||
NNSG3dSbcCallBackTiming
|
||
|
||
SBC–½—ß“à‚Å‹N“®‚·‚éƒR<C692>[ƒ‹ƒoƒbƒN‚̃^ƒCƒ~ƒ“ƒO‚ð3Ží—Þ‚©‚çŽw’è‚Å‚«‚é<E2809A>B
|
||
*---------------------------------------------------------------------------*/
|
||
typedef enum
|
||
{
|
||
NNS_G3D_SBC_CALLBACK_TIMING_NONE = 0x00,
|
||
NNS_G3D_SBC_CALLBACK_TIMING_A = 0x01,
|
||
NNS_G3D_SBC_CALLBACK_TIMING_B = 0x02,
|
||
NNS_G3D_SBC_CALLBACK_TIMING_C = 0x03
|
||
}
|
||
NNSG3dSbcCallBackTiming;
|
||
|
||
#define NNS_G3D_SBC_CALLBACK_TIMING_ASSERT(x) \
|
||
NNS_G3D_ASSERT(x == NNS_G3D_SBC_CALLBACK_TIMING_NONE || \
|
||
x == NNS_G3D_SBC_CALLBACK_TIMING_A || \
|
||
x == NNS_G3D_SBC_CALLBACK_TIMING_B || \
|
||
x == NNS_G3D_SBC_CALLBACK_TIMING_C)
|
||
|
||
/*---------------------------------------------------------------------------*
|
||
NNSG3dRenderObj
|
||
|
||
<20>\‘¢‘̂̃<C38C>ƒ“ƒo“™‚Í<E2809A>í‚ɕω»‚·‚é‰Â”\<5C>«‚ª‚ ‚é
|
||
*---------------------------------------------------------------------------*/
|
||
typedef struct NNSG3dRenderObj_
|
||
{
|
||
u32 flag; // NNSG3dRenderObjFlag
|
||
|
||
// NOTICE:
|
||
// NNS_G3dDraw“à‚Å‚ÍNNSG3dResMdl‚Ì’†–¡‚ð<E2809A>‘‚«Š·‚¦‚邱‚Ƃ͂ ‚è‚Ü‚¹‚ñ<E2809A>B
|
||
// (ƒR<C692>[ƒ‹ƒoƒbƒN‚ðŽg‚Á‚½<E2809A>ê<EFBFBD>‡“™‚Í<E2809A>œ‚)
|
||
NNSG3dResMdl* resMdl;
|
||
NNSG3dAnmObj* anmMat;
|
||
NNSG3dFuncAnmBlendMat funcBlendMat;
|
||
NNSG3dAnmObj* anmJnt;
|
||
NNSG3dFuncAnmBlendJnt funcBlendJnt;
|
||
NNSG3dAnmObj* anmVis;
|
||
NNSG3dFuncAnmBlendVis funcBlendVis;
|
||
|
||
// ƒR<C692>[ƒ‹ƒoƒbƒN—p<E28094>î•ñ
|
||
NNSG3dSbcCallBackFunc cbFunc; // NULL‚È‚ç‚΃R<C692>[ƒ‹ƒoƒbƒN‚͂Ȃ¢<E2809A>B
|
||
u8 cbCmd; // ’âŽ~ˆÊ’u‚ðƒRƒ}ƒ“ƒh‚ÅŽw’è<E28099>BNNS_G3D_SBC_*****(res_struct.h‚Å’è‹`)
|
||
u8 cbTiming; // NNSG3dSbcCallBackTiming(sbc.h‚Å’è‹`)
|
||
u16 dummy_;
|
||
|
||
// ƒŒƒ“ƒ_ƒŠƒ“ƒOŠJŽn’¼‘O‚ɌĂ΂ê‚é<E2809A>Bˆê”Ê“I‚ÉNNS_G3dRS‚Ì
|
||
// ƒR<C692>[ƒ‹ƒoƒbƒNƒxƒNƒ^‚ð<E2809A>Ý’è‚·‚邽‚߂Ɏg‚í‚ê‚é<E2809A>B
|
||
NNSG3dSbcCallBackFunc cbInitFunc;
|
||
|
||
// ƒ†<C692>[ƒU<C692>[‚ªŠÇ—<C387>‚·‚é—̈æ‚ւ̃|ƒCƒ“ƒ^
|
||
// ‚ ‚ç‚©‚¶‚߃|ƒCƒ“ƒ^‚ð<E2809A>ݒ肵‚Ä‚¨‚¯‚΃R<C692>[ƒ‹ƒoƒbƒN‚ł̎g—p‚ª‰Â”\.
|
||
void* ptrUser;
|
||
|
||
//
|
||
// ƒfƒtƒHƒ‹ƒg‚Å‚ÍresMdl“à‚ÉŠi”[‚³‚ê‚Ä‚¢‚éSBC‚ðŽg—p‚·‚邪<E2809A>A
|
||
// ptrUserSbc‚Ƀ|ƒCƒ“ƒ^‚ðŠi”[‚·‚邱‚Ƃɂæ‚Á‚Ä<E2809A>Aƒ†<C692>[ƒU<C692>[’è‹`‚ÌSBC‚ª
|
||
// Žg—p‚³‚ê‚邿‚¤‚ɂȂé<E2809A>B
|
||
//
|
||
// Example:
|
||
// ƒp<C692>[ƒeƒBƒNƒ‹ƒVƒXƒeƒ€“™‚Å<E2809A>A’P<E28099>ƒ‚ȃ‚ƒfƒ‹(1ƒ}ƒeƒŠƒAƒ‹1ƒVƒFƒCƒv)‚ð‚¢‚ë‚¢‚ë‚È
|
||
// <20>ê<EFBFBD>Š‚É<E2809A>o‚µ‚½‚¢‚悤‚È<E2809A>ê<EFBFBD>‡<EFBFBD>AŽŸ‚̂悤‚ÈSBCƒR<C692>[ƒh‚ð<E2809A>ì<EFBFBD>¬‚µ‚ăR<C692>[ƒh‚ւ̃|ƒCƒ“ƒ^‚ð
|
||
// ptrUserSbc‚É‘ã“ü‚µ‚Ä‚¨‚‚ÆŒø—¦‚ª‚æ‚¢<E2809A>B
|
||
//
|
||
// MAT[000] 0
|
||
// MTX 0
|
||
// SHP 0
|
||
// MTX 1
|
||
// SHP 0
|
||
// ....
|
||
// MTX n
|
||
// SHP 0
|
||
// RET
|
||
//
|
||
// ‚ ‚ç‚©‚¶‚ß<E2809A>s—ñ‚Í<E2809A>s—ñƒXƒ^ƒbƒN‚ɃZƒbƒg‚µ‚Ä‚¨‚•K—v‚ª‚ ‚é<E2809A>B
|
||
// ‚Ü‚½<E2809A>Aƒ}ƒeƒŠƒAƒ‹‚ðƒVƒFƒCƒv–ˆ‚É<E2809A>‚µ‚¸‚•ς¦‚½‚¢<E2809A>ê<EFBFBD>‡‚Í<E2809A>A
|
||
// ƒR<C692>[ƒ‹ƒoƒbƒN‚Å•Ï<E280A2>X‚·‚é‚Ì‚ª‚æ‚¢‚¾‚낤<E2809A>B
|
||
//
|
||
u8* ptrUserSbc;
|
||
|
||
//
|
||
// ŒvŽZŒ‹‰Ê‚̃oƒbƒtƒ@ƒŠƒ“ƒO—̈æ‚ւ̃|ƒCƒ“ƒ^
|
||
// ƒWƒ‡ƒCƒ“ƒg<C692>Eƒ}ƒeƒŠƒAƒ‹‚ÌŒvŽZŒ‹‰Ê‚ð•¡<E280A2>”ƒtƒŒ<C692>[ƒ€<C692>^•¡<E280A2>”‘̂̃‚ƒfƒ‹
|
||
// ‚ÅŽg‚¢‚܂킵‚½‚¢<E2809A>ê<EFBFBD>‡‚Í<E2809A>ArecJntAnm/recMatAnm‚Ƀoƒbƒtƒ@‚ðƒZƒbƒg‚·‚é<E2809A>B
|
||
//
|
||
// flag‚ÌNNS_G3D_RENDEROBJ_FLAG_RECORD‚ªON‚̂Ƃ«<E2809A>A
|
||
// recJntAnm, recMatAnm‚ÅNULL‚łȂ¢‚à‚̂ɂ‚¢‚Ä<E2809A>A
|
||
// ‚»‚ꂼ‚êƒ}ƒeƒŠƒAƒ‹<C692>EƒWƒ‡ƒCƒ“ƒg‚ÌŒvŽZŒ‹‰Ê‚ª‹L˜^‚³‚ê‚Ä‚¢‚<E2809A>B
|
||
//
|
||
// flag‚ÌNNS_G3D_RENDEROBJ_FLAG_RECORD‚ªOFF‚̂Ƃ«<E2809A>A
|
||
// recJntAnm, recMatAnm‚ªNULL‚łȂ¢‚à‚̂ɂ‚¢‚Ä<E2809A>A
|
||
// ‚»‚ꂼ‚êƒ}ƒeƒŠƒAƒ‹<C692>EƒWƒ‡ƒCƒ“ƒg‚ÌŒvŽZŒ‹‰Ê‚Æ‚µ‚Ä—˜—p‚µ‚Ä‚¢‚<E2809A>B
|
||
//
|
||
// ƒ†<C692>[ƒU<C692>[‚Í
|
||
// recJntAnm‚ɂ‚¢‚Ä‚Í<E2809A>A
|
||
// sizeof(NNSG3dJntAnmResult) * resMdl->info.numNodeƒoƒCƒg
|
||
// recMatAnm‚ɂ‚¢‚Ä‚Í<E2809A>A
|
||
// sizeof(NNSG3dMatAnmResult) * resMdl->info.numMatƒoƒCƒg
|
||
// ‚̗̈æ‚ðŠm•Û‚µ‚Ä‚¨‚©‚È‚‚Ă͂Ȃç‚È‚¢<E2809A>B
|
||
//
|
||
struct NNSG3dJntAnmResult_* recJntAnm;
|
||
struct NNSG3dMatAnmResult_* recMatAnm;
|
||
|
||
//
|
||
// ƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“‚ª’ljÁ‚³‚ꂽ‚Æ‚«<E2809A>AmatID/nodeID‚ɑ΂µ‚Ä’è‹`‚³‚ê‚Ä‚¢‚邯
|
||
// bit‚ª1‚ɂȂé<E2809A>BŠeID‚Í<E2809A>Å‘å‚Å‚à256ŒÂ‚܂łȂ̂Å<E2809A>A8ƒ<38><C692>[ƒh‚¸‚‚ŊǗ<C387>‚Å‚«‚é<E2809A>B
|
||
// ‚½‚¾‚µ<E2809A>AƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“‚ª<E2809A>í<EFBFBD>œ‚³‚ꂽ<E2809A>ê<EFBFBD>‡‚É‚àbit‚Í1‚̂܂܂ł ‚é<E2809A>B
|
||
// SBC‚̃Cƒ“ƒ^ƒvƒŠƒ^‚Í‚±‚̃tƒB<C692>[ƒ‹ƒh‚ðƒ`ƒFƒbƒN‚µ‚Ä<E2809A>A
|
||
// NNSG3dFuncBlendMatXXX‚ðƒR<C692>[ƒ‹‚·‚é‚©‚Ç‚¤‚©‚ðŒˆ’è‚·‚é<E2809A>B
|
||
// ’<>ˆÓ‚·‚ׂ«‚Ȃ̂Í<E2809A>Abit‚ª0‚̂Ƃ«‚Í<E2809A>A‚»‚ÌmatID/nodeID‚ÉŠÖŒW‚µ‚½
|
||
// ƒAƒjƒ<6A><C692>[ƒVƒ‡ƒ“‚ª‚È‚¢<E2809A>A‚Æ‚¢‚¤‚±‚Æ‚¾‚¯‚ªŠmŽÀ‚Å‚ ‚邱‚Ƃł ‚é<E2809A>B
|
||
//
|
||
u32 hintMatAnmExist[NNS_G3D_SIZE_MAT_MAX / 32];
|
||
u32 hintJntAnmExist[NNS_G3D_SIZE_JNT_MAX / 32];
|
||
u32 hintVisAnmExist[NNS_G3D_SIZE_JNT_MAX / 32];
|
||
}
|
||
NNSG3dRenderObj;
|
||
|
||
// NNSG3dJntAnmResultŒvŽZŒ‹‰Ê‚ðƒoƒbƒtƒ@ƒŠƒ“ƒO‚·‚é<E2809A>Û‚É
|
||
// Žg—p‚·‚éƒoƒbƒtƒ@‚̃TƒCƒYŒvŽZƒ}ƒNƒ<4E>
|
||
#define NNS_G3D_RENDEROBJ_JNTBUFFER_SIZE(numJnt) \
|
||
((u32)(sizeof(NNSG3dJntAnmResult) * (numJnt)))
|
||
|
||
// NNSG3dMatAnmResultŒvŽZŒ‹‰Ê‚ðƒoƒbƒtƒ@ƒŠƒ“ƒO‚·‚é<E2809A>Û‚É
|
||
// Žg—p‚·‚éƒoƒbƒtƒ@‚̃TƒCƒYŒvŽZƒ}ƒNƒ<4E>
|
||
#define NNS_G3D_RENDEROBJ_MATBUFFER_SIZE(numMat) \
|
||
((u32)(sizeof(NNSG3dMatAnmResult) * (numMat)))
|
||
|
||
|
||
|
||
|
||
|
||
////////////////////////////////////////////////////////////////////////////////
|
||
//
|
||
// ŠÖ<C5A0>”‚Ì<E2809A>錾
|
||
//
|
||
|
||
//
|
||
// inline functions for NNSG3dAnmObj
|
||
//
|
||
NNS_G3D_INLINE void NNS_G3dAnmObjSetFrame(NNSG3dAnmObj* pAnmObj, fx32 frame);
|
||
NNS_G3D_INLINE void NNS_G3dAnmObjSetBlendRatio(NNSG3dAnmObj* pAnmObj, fx32 ratio);
|
||
NNS_G3D_INLINE fx32 NNS_G3dAnmObjGetNumFrame(const NNSG3dAnmObj* pAnmObj);
|
||
|
||
|
||
//
|
||
// non-inline functions for NNSG3dAnmObj
|
||
//
|
||
u32 NNS_G3dAnmObjCalcSizeRequired(const void* pAnm, const NNSG3dResMdl* pMdl);
|
||
void NNS_G3dAnmObjInit(NNSG3dAnmObj* pAnmObj,
|
||
void* pResAnm,
|
||
const NNSG3dResMdl* pResMdl,
|
||
const NNSG3dResTex* pResTex);
|
||
void NNS_G3dAnmObjEnableID(NNSG3dAnmObj* pAnmObj, int id);
|
||
void NNS_G3dAnmObjDisableID(NNSG3dAnmObj* pAnmObj, int id);
|
||
|
||
|
||
//
|
||
// inline functions for NNSG3dRenderObj
|
||
//
|
||
NNS_G3D_INLINE void NNS_G3dRenderObjSetFlag(NNSG3dRenderObj* pRenderObj, NNSG3dRenderObjFlag flag);
|
||
NNS_G3D_INLINE void NNS_G3dRenderObjResetFlag(NNSG3dRenderObj* pRenderObj, NNSG3dRenderObjFlag flag);
|
||
NNS_G3D_INLINE BOOL NNS_G3dRenderObjTestFlag(const NNSG3dRenderObj* pRenderObj, NNSG3dRenderObjFlag flag);
|
||
NNS_G3D_INLINE u8* NNS_G3dRenderObjSetUserSbc(NNSG3dRenderObj* pRenderObj, u8* sbc);
|
||
NNS_G3D_INLINE void NNS_G3dRenderObjSetJntAnmBuffer(NNSG3dRenderObj* pRenderObj, struct NNSG3dJntAnmResult_* buf);
|
||
NNS_G3D_INLINE void NNS_G3dRenderObjSetMatAnmBuffer(NNSG3dRenderObj* pRenderObj, struct NNSG3dMatAnmResult_* buf);
|
||
|
||
NNS_G3D_INLINE struct NNSG3dJntAnmResult_* NNS_G3dRenderObjReleaseJntAnmBuffer(NNSG3dRenderObj* pRenderObj);
|
||
NNS_G3D_INLINE struct NNSG3dMatAnmResult_* NNS_G3dRenderObjReleaseMatAnmBuffer(NNSG3dRenderObj* pRenderObj);
|
||
NNS_G3D_INLINE void* NNS_G3dRenderObjSetUserPtr(NNSG3dRenderObj* pRenderObj, void* ptr);
|
||
|
||
NNS_G3D_INLINE NNSG3dResMdl* NNS_G3dRenderObjGetResMdl(NNSG3dRenderObj* pRenderObj);
|
||
NNS_G3D_INLINE void NNS_G3dRenderObjSetBlendFuncMat(NNSG3dRenderObj* pRenderObj, NNSG3dFuncAnmBlendMat func);
|
||
NNS_G3D_INLINE void NNS_G3dRenderObjSetBlendFuncJnt(NNSG3dRenderObj* pRenderObj, NNSG3dFuncAnmBlendJnt func);
|
||
NNS_G3D_INLINE void NNS_G3dRenderObjSetBlendFuncVis(NNSG3dRenderObj* pRenderObj, NNSG3dFuncAnmBlendVis func);
|
||
|
||
|
||
//
|
||
// non-inline functions for NNSG3dRenderObj
|
||
//
|
||
void NNS_G3dRenderObjInit(NNSG3dRenderObj* pRenderObj, NNSG3dResMdl* pResMdl);
|
||
void NNS_G3dRenderObjAddAnmObj(NNSG3dRenderObj* pRenderObj, NNSG3dAnmObj* pAnmObj);
|
||
void NNS_G3dRenderObjRemoveAnmObj(NNSG3dRenderObj* pRenderObj, NNSG3dAnmObj* pAnmObj);
|
||
void NNS_G3dRenderObjSetCallBack(NNSG3dRenderObj* pRenderObj,
|
||
NNSG3dSbcCallBackFunc func,
|
||
u8*,
|
||
u8 cmd,
|
||
NNSG3dSbcCallBackTiming timing);
|
||
void NNS_G3dRenderObjResetCallBack(NNSG3dRenderObj* pRenderObj);
|
||
void NNS_G3dRenderObjSetInitFunc(NNSG3dRenderObj* pRenderObj, NNSG3dSbcCallBackFunc func);
|
||
|
||
|
||
//
|
||
// non-inline functions for Model/Texture binding
|
||
//
|
||
|
||
// Texture Key
|
||
u32 NNS_G3dTexGetRequiredSize(const NNSG3dResTex* pTex);
|
||
u32 NNS_G3dTex4x4GetRequiredSize(const NNSG3dResTex* pTex);
|
||
void NNS_G3dTexSetTexKey(NNSG3dResTex* pTex,
|
||
NNSG3dTexKey texKey,
|
||
NNSG3dTexKey tex4x4Key);
|
||
void NNS_G3dTexLoad(NNSG3dResTex* pTex, BOOL exec_begin_end);
|
||
void NNS_G3dTexReleaseTexKey(NNSG3dResTex* pTex,
|
||
NNSG3dTexKey* texKey,
|
||
NNSG3dTexKey* tex4x4Key);
|
||
|
||
// Palette Key
|
||
u32 NNS_G3dPlttGetRequiredSize(const NNSG3dResTex* pTex);
|
||
void NNS_G3dPlttSetPlttKey(NNSG3dResTex* pTex, NNSG3dPlttKey plttKey);
|
||
void NNS_G3dPlttLoad(NNSG3dResTex* pTex, BOOL exec_begin_end);
|
||
NNSG3dPlttKey NNS_G3dPlttReleasePlttKey(NNSG3dResTex* pTex);
|
||
|
||
// Model -> Texture binding
|
||
BOOL NNS_G3dBindMdlTex(NNSG3dResMdl* pMdl, const NNSG3dResTex* pTex);
|
||
BOOL NNS_G3dBindMdlTexEx(NNSG3dResMdl* pMdl,
|
||
const NNSG3dResTex* pTex,
|
||
const NNSG3dResName* pResName);
|
||
BOOL NNS_G3dForceBindMdlTex(NNSG3dResMdl* pMdl,
|
||
const NNSG3dResTex* pTex,
|
||
u32 texToMatListIdx,
|
||
u32 texIdx);
|
||
|
||
void NNS_G3dReleaseMdlTex(NNSG3dResMdl* pMdl);
|
||
BOOL NNS_G3dReleaseMdlTexEx(NNSG3dResMdl* pMdl, const NNSG3dResName* pResName);
|
||
|
||
// Model -> Palette binding
|
||
BOOL NNS_G3dBindMdlPltt(NNSG3dResMdl* pMdl, const NNSG3dResTex* pTex);
|
||
BOOL NNS_G3dBindMdlPlttEx(NNSG3dResMdl* pMdl,
|
||
const NNSG3dResTex* pTex,
|
||
const NNSG3dResName* pResName);
|
||
BOOL NNS_G3dForceBindMdlPltt(NNSG3dResMdl* pMdl,
|
||
const NNSG3dResTex* pTex,
|
||
u32 plttToMatListIdx,
|
||
u32 plttIdx);
|
||
void NNS_G3dReleaseMdlPltt(NNSG3dResMdl* pMdl);
|
||
BOOL NNS_G3dReleaseMdlPlttEx(NNSG3dResMdl* pMdl, const NNSG3dResName* pResName);
|
||
|
||
BOOL NNS_G3dBindMdlSet(NNSG3dResMdlSet* pMdlSet, const NNSG3dResTex* pTex);
|
||
void NNS_G3dReleaseMdlSet(NNSG3dResMdlSet* pMdlSet);
|
||
|
||
|
||
//
|
||
// Misc inline functions
|
||
//
|
||
|
||
#ifdef __cplusplus
|
||
}
|
||
#endif
|
||
|
||
#include <nnsys/g3d/kernel_inline.h>
|
||
|
||
#endif
|