aboutsummaryrefslogtreecommitdiff
path: root/examples/n00bdemo/smd.h
diff options
context:
space:
mode:
authorJohn Wilbert M. Villamor <lameguy64@gmail.com>2019-04-06 10:11:07 +0800
committerJohn Wilbert M. Villamor <lameguy64@gmail.com>2019-04-06 10:11:07 +0800
commitf3e040230772f978540a71aea43dfde200992922 (patch)
treebd8ca31b72dd01e24980b073854e263589530f56 /examples/n00bdemo/smd.h
downloadpsn00bsdk-f3e040230772f978540a71aea43dfde200992922.tar.gz
First commit
Diffstat (limited to 'examples/n00bdemo/smd.h')
-rw-r--r--examples/n00bdemo/smd.h68
1 files changed, 68 insertions, 0 deletions
diff --git a/examples/n00bdemo/smd.h b/examples/n00bdemo/smd.h
new file mode 100644
index 0000000..29c2812
--- /dev/null
+++ b/examples/n00bdemo/smd.h
@@ -0,0 +1,68 @@
+#ifndef _SMD_H
+#define _SMD_H
+
+typedef struct {
+ int *ot;
+ short otlen;
+ unsigned char zdiv,zoff;
+} SC_OT;
+
+typedef struct {
+ char id[3];
+ unsigned char version;
+ unsigned short flags;
+ unsigned short n_verts;
+ unsigned short n_norms;
+ unsigned short n_prims;
+ SVECTOR *p_verts;
+ SVECTOR *p_norms;
+ void *p_prims;
+} SMD;
+
+typedef struct {
+ unsigned char type:2;
+ unsigned char l_type:2;
+ unsigned char c_type:1;
+ unsigned char texture:1;
+ unsigned char blend:2;
+ unsigned char zoff:4;
+ unsigned char nocull:1;
+ unsigned char mask:1;
+ unsigned char texwin:2;
+ unsigned char texoff:2;
+ unsigned char reserved:6;
+ unsigned char len;
+} SMD_PRI_TYPE;
+
+typedef struct {
+ SMD_PRI_TYPE prim_id;
+ unsigned short v0,v1,v2,v3; // Vertex indices
+ unsigned short n0,n1,n2,n3; // Normal indices
+ unsigned char r0,g0,b0,code; // RGB0
+ unsigned char r1,g1,b1,p0; // RGB1
+ unsigned char r2,g2,b2,p1; // RGB2
+ unsigned char r3,g3,b3,p2; // RGB3
+ unsigned char tu0,tv0;
+ unsigned char tu1,tv1;
+ unsigned char tu2,tv2;
+ unsigned char tu3,tv3;
+ unsigned short tpage,clut;
+} SMD_PRIM;
+
+
+int OpenSMD(void *smd);
+SMD_PRIM *ReadSMD(SMD_PRIM *pri);
+
+void scSetClipRect(int x0, int y0, int x1, int y1);
+
+SMD *smdInitData(void *data);
+void smdSetBaseTPage(unsigned short tpage);
+
+char *smdSortModel(SC_OT *ot, char* pribuff, SMD *smd);
+char *smdSortModelFlat(unsigned int *ot, char* pribuff, SMD *smd);
+
+void smdSetCelTex(unsigned short tpage, unsigned short clut);
+void smdSetCelParam(int udiv, int vdiv, unsigned int col);
+char *smdSortModelCel(SC_OT *ot, char* pribuff, SMD *smd);
+
+#endif \ No newline at end of file