This commit is contained in:
parent
cb4922cb43
commit
57211b9df3
17 changed files with 478 additions and 740 deletions
|
@ -2,7 +2,7 @@
|
|||
/*** Generic Face Compilation Storage ***/
|
||||
/****************************************/
|
||||
// Contains tri data with texture data
|
||||
// Will quad later
|
||||
|
||||
|
||||
#include <ginio.h>
|
||||
#include <gintex.h>
|
||||
|
@ -100,15 +100,8 @@ CFace F;
|
|||
|
||||
for (int i=0; i<3; i++)
|
||||
{
|
||||
F.pts[i] = T.p[i];
|
||||
F.vis[i] = T.vis[i];
|
||||
F.uvs[i] = uv.p[i];
|
||||
F.vtx[i] = P[T.p[i]];
|
||||
// Limit UV's
|
||||
if (F.uvs[i].u < 0.f) F.uvs[i].u=0.f;
|
||||
if (F.uvs[i].u > 1.f) F.uvs[i].u=1.f;
|
||||
if (F.uvs[i].v < 0.f) F.uvs[i].v=0.f;
|
||||
if (F.uvs[i].v > 1.f) F.uvs[i].v=1.f;
|
||||
}
|
||||
F.TPageFlag=0;
|
||||
F.TexName=Tex;
|
||||
|
@ -119,15 +112,21 @@ CFace &NF=AddFace(F,ProcessTexFlag);
|
|||
}
|
||||
|
||||
//***************************************************************************
|
||||
// All AddFace's lead to here!
|
||||
CFace &CFaceStore::AddFace(CFace &F,bool ProcessTexFlag)
|
||||
{
|
||||
int ListSize=FaceList.size();
|
||||
FaceList.resize(ListSize+1);
|
||||
|
||||
// Process Vtx's
|
||||
// Process Vtx's (for Quad)
|
||||
for (int i=0; i<3; i++)
|
||||
{
|
||||
F.pts[i]=AddVtx(F.vtx[i]);
|
||||
F.pts[i]=AddVtx(VtxList,F.vtx[i]);
|
||||
// Limit UV's
|
||||
if (F.uvs[i].u < 0.f) F.uvs[i].u=0.f;
|
||||
if (F.uvs[i].u > 1.f) F.uvs[i].u=1.f;
|
||||
if (F.uvs[i].v < 0.f) F.uvs[i].v=0.f;
|
||||
if (F.uvs[i].v > 1.f) F.uvs[i].v=1.f;
|
||||
}
|
||||
|
||||
if (ProcessTexFlag && F.Mat==-1)
|
||||
|
@ -163,38 +162,15 @@ int ListSize=Faces.GetFaceCount();
|
|||
}
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
/*
|
||||
CFace &CFaceStore::AddFace(sTriFace &Face,int ID)
|
||||
{
|
||||
int ListSize = FaceList.size();
|
||||
FaceList.resize(ListSize+1);
|
||||
CFace &F = FaceList[ListSize];
|
||||
|
||||
for (int i=0; i<3; i++)
|
||||
{
|
||||
F.pts[i] = Face.pts[i];
|
||||
F.uvs[i] = Face.uvs[i];
|
||||
F.vtx[i] = Face.vtx[i];
|
||||
// Limit UV's
|
||||
if (F.uvs[i].u < 0.f) F.uvs[i].u=0.f;
|
||||
if (F.uvs[i].u > 1.f) F.uvs[i].u=1.f;
|
||||
if (F.uvs[i].v < 0.f) F.uvs[i].v=0.f;
|
||||
if (F.uvs[i].v > 1.f) F.uvs[i].v=1.f;
|
||||
}
|
||||
|
||||
F.Mat = Face.Mat;
|
||||
F.Normal = crossProduct( F.vtx[0], F.vtx[1], F.vtx[2] );
|
||||
F.Avail = true;
|
||||
F.ID=ID;
|
||||
return(F);
|
||||
}
|
||||
*/
|
||||
//***************************************************************************
|
||||
//*** Texture Stuff *********************************************************
|
||||
//***************************************************************************
|
||||
int CFaceStore::AddTex(GString const &TexName)
|
||||
{
|
||||
if (!TexGrab)
|
||||
{
|
||||
GObject::Error(ERR_FATAL,"TexGrab Not Defined!!\n");
|
||||
}
|
||||
static GString LastTex;
|
||||
static int LastIdx=-1;
|
||||
vector<FileInfo> const &TexList=TexGrab->GetTexInfoList();
|
||||
|
@ -220,109 +196,21 @@ GString Filename=TexName;
|
|||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CFaceStore::ProcessTextures()
|
||||
void CFaceStore::Process(vector<sTri> &OutTriList,vector<sQuad> &OutQuadList,vector<sVtx> &OutVtxList)
|
||||
{
|
||||
// Set Texgrab Defaults
|
||||
TexGrab->ShrinkToFit(true);
|
||||
TexGrab->NoSort();
|
||||
BBox.XMin=+30000;
|
||||
BBox.YMin=+30000;
|
||||
BBox.XMax=-30000;
|
||||
BBox.YMax=-30000;
|
||||
|
||||
TexGrab->AnimatedHeadersOnly(true);
|
||||
TexGrab->DontOutputBoxes(true);
|
||||
TexGrab->AllowRotate(true);
|
||||
TexGrab->Process();
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CFaceStore::Process()
|
||||
{
|
||||
Quad();
|
||||
BuildOutTriLists();
|
||||
BuildOutTriList(OutTriList,OutVtxList);
|
||||
BuildOutQuadList(OutQuadList,OutVtxList);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
//***************************************************************************
|
||||
//***************************************************************************
|
||||
void CFaceStore::Quad()
|
||||
{
|
||||
int FaceCount=FaceList.size();
|
||||
|
||||
for (int i=0; i<FaceCount; i++)
|
||||
{
|
||||
TriFaceList.push_back(FaceList[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
//***************************************************************************
|
||||
//***************************************************************************
|
||||
/*
|
||||
void CFaceStore::SetupUV(CFace const &In, sTri &Out)
|
||||
{
|
||||
vector<sTexOutInfo> &TexInfo=TexGrab->GetTexInfo();
|
||||
sTexOutInfo &ThisTex=TexInfo[In.Mat];
|
||||
ASSERT(In.Mat<TexInfo.size());
|
||||
|
||||
// Uses orig tex size to make sure mapping is corrent on 'shrunk' textures :o)
|
||||
int W = ThisTex.OrigW - 1;
|
||||
int H = ThisTex.OrigH - 1;
|
||||
int XOfs=0,YOfs=0;
|
||||
|
||||
int uv0[2];
|
||||
int uv1[2];
|
||||
int uv2[2];
|
||||
|
||||
if (ThisTex.Rotated)
|
||||
{
|
||||
// uv0[0] = (ThisTex.u + H) - round(In.uvs[0].v * H);
|
||||
// uv0[1] = (ThisTex.v + W) - round(In.uvs[0].u * W);
|
||||
// uv1[0] = (ThisTex.u + H) - round(In.uvs[1].v * H);
|
||||
// uv1[1] = (ThisTex.v + W) - round(In.uvs[1].u * W);
|
||||
// uv2[0] = (ThisTex.u + H) - round(In.uvs[2].v * H);
|
||||
// uv2[1] = (ThisTex.v + W) - round(In.uvs[2].u * W);
|
||||
|
||||
uv0[0] = (ThisTex.u ) - round(In.uvs[0].v * H);
|
||||
uv0[1] = (ThisTex.v ) - round(In.uvs[0].u * W);
|
||||
uv1[0] = (ThisTex.u ) - round(In.uvs[1].v * H);
|
||||
uv1[1] = (ThisTex.v ) - round(In.uvs[1].u * W);
|
||||
uv2[0] = (ThisTex.u ) - round(In.uvs[2].v * H);
|
||||
uv2[1] = (ThisTex.v ) - round(In.uvs[2].u * W);
|
||||
|
||||
XOfs=H-((ThisTex.OrigW-ThisTex.h));
|
||||
YOfs= +((ThisTex.OrigH-ThisTex.w)-W);
|
||||
ASSERT(!"");
|
||||
}
|
||||
else
|
||||
{
|
||||
W=ThisTex.w-1;
|
||||
H=ThisTex.h-1;
|
||||
// Out.uv0[0] = (ThisTex.u)+ round(In.uvs[0].u * W);
|
||||
// Out.uv0[1] = (ThisTex.v + H) - round(In.uvs[0].v * H);
|
||||
// Out.uv1[0] = (ThisTex.u)+ round(In.uvs[1].u * W);
|
||||
// Out.uv1[1] = (ThisTex.v + H) - round(In.uvs[1].v * H);
|
||||
// Out.uv2[0] = (ThisTex.u)+ round(In.uvs[2].u * W);
|
||||
// Out.uv2[1] = (ThisTex.v + H) - round(In.uvs[2].v * H);
|
||||
|
||||
uv0[0] = (ThisTex.u) + round(In.uvs[0].u * W);
|
||||
uv0[1] = (ThisTex.v) - round(In.uvs[0].v * H);
|
||||
uv1[0] = (ThisTex.u) + round(In.uvs[1].u * W);
|
||||
uv1[1] = (ThisTex.v) - round(In.uvs[1].v * H);
|
||||
uv2[0] = (ThisTex.u) + round(In.uvs[2].u * W);
|
||||
uv2[1] = (ThisTex.v) - round(In.uvs[2].v * H);
|
||||
|
||||
XOfs=(ThisTex.OrigW-ThisTex.w);
|
||||
YOfs=(ThisTex.OrigH-ThisTex.h)-H;
|
||||
XOfs=0;
|
||||
YOfs=0;
|
||||
}
|
||||
|
||||
Out.uv0[0]=uv0[0]-XOfs; Out.uv0[1]=uv0[1]-YOfs;
|
||||
Out.uv1[0]=uv1[0]-XOfs; Out.uv1[1]=uv1[1]-YOfs;
|
||||
Out.uv2[0]=uv2[0]-XOfs; Out.uv2[1]=uv2[1]-YOfs;
|
||||
|
||||
Out.TPage=ThisTex.Tpage;
|
||||
Out.Clut=ThisTex.Clut;
|
||||
}
|
||||
*/
|
||||
void CFaceStore::SetupUV(CFace const &In, sTri &Out)
|
||||
{
|
||||
vector<sTexOutInfo> &TexInfo=TexGrab->GetTexInfo();
|
||||
|
@ -347,18 +235,8 @@ int H = ThisTex.h - 1;
|
|||
}
|
||||
else
|
||||
{
|
||||
// W=ThisTex.OrigW-1;
|
||||
// H=ThisTex.OrigH-1;
|
||||
if (ThisTex.w!=ThisTex.OrigW) printf("WW");
|
||||
if (ThisTex.h!=ThisTex.OrigH) printf("HH");
|
||||
/*
|
||||
uv0[0] = (ThisTex.u)+ round(In.uvs[0].u * W);
|
||||
uv0[1] = (ThisTex.v + H) - round(In.uvs[0].v * H);
|
||||
uv1[0] = (ThisTex.u)+ round(In.uvs[1].u * W);
|
||||
uv1[1] = (ThisTex.v + H) - round(In.uvs[1].v * H);
|
||||
uv2[0] = (ThisTex.u)+ round(In.uvs[2].u * W);
|
||||
uv2[1] = (ThisTex.v + H) - round(In.uvs[2].v * H);
|
||||
*/
|
||||
int U=ThisTex.u;
|
||||
int V=ThisTex.v+H;
|
||||
|
||||
|
@ -369,10 +247,6 @@ int V=ThisTex.v+H;
|
|||
uv2[0] = U + round(In.uvs[2].u * W);
|
||||
uv2[1] = V - round(In.uvs[2].v * H);
|
||||
|
||||
// XOfs=(ThisTex.OrigW-ThisTex.w);
|
||||
// XOfs=ThisTex.XOfs;
|
||||
// YOfs=H-(ThisTex.OrigH-ThisTex.h);
|
||||
// YOfs=H;
|
||||
}
|
||||
|
||||
Out.uv0[0]=(uv0[0]-XOfs); Out.uv0[1]=(uv0[1]-YOfs);
|
||||
|
@ -391,7 +265,6 @@ int V=ThisTex.v+H;
|
|||
Out.TPage|=In.TPageFlag<<5;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
@ -401,6 +274,10 @@ void CFaceStore::SetupUV(CFace const &In, sQuad &Out)
|
|||
{
|
||||
vector<sTexOutInfo> &TexInfo=TexGrab->GetTexInfo();
|
||||
sTexOutInfo &ThisTex=TexInfo[In.Mat];
|
||||
ASSERT(In.Mat<TexInfo.size());
|
||||
|
||||
int uv0[2],uv1[2],uv2[2],uv3[2];
|
||||
int XOfs=0,YOfs=0;
|
||||
|
||||
int W = ThisTex.w - 1;
|
||||
int H = ThisTex.h - 1;
|
||||
|
@ -413,29 +290,49 @@ int H = ThisTex.h - 1;
|
|||
Out.uv1[1] = (ThisTex.v + W) - round(In.uvs[1].u * W);
|
||||
Out.uv2[0] = (ThisTex.u + H) - round(In.uvs[2].v * H);
|
||||
Out.uv2[1] = (ThisTex.v + W) - round(In.uvs[2].u * W);
|
||||
Out.uv3[0] = (ThisTex.u + H) - round(In.uvs[3].v * H);
|
||||
Out.uv3[1] = (ThisTex.v + W) - round(In.uvs[3].u * W);
|
||||
ASSERT(0==1);
|
||||
}
|
||||
else
|
||||
{
|
||||
Out.uv0[0] = (ThisTex.u)+ round(In.uvs[0].u * W);
|
||||
Out.uv0[1] = (ThisTex.v + H) - round(In.uvs[0].v * H);
|
||||
Out.uv1[0] = (ThisTex.u)+ round(In.uvs[1].u * W);
|
||||
Out.uv1[1] = (ThisTex.v + H) - round(In.uvs[1].v * H);
|
||||
Out.uv2[0] = (ThisTex.u)+ round(In.uvs[2].u * W);
|
||||
Out.uv2[1] = (ThisTex.v + H) - round(In.uvs[2].v * H);
|
||||
Out.uv3[0] = (ThisTex.u)+ round(In.uvs[3].u * W);
|
||||
Out.uv3[1] = (ThisTex.v + H) - round(In.uvs[3].v * H);
|
||||
if (ThisTex.w!=ThisTex.OrigW) printf("WW");
|
||||
if (ThisTex.h!=ThisTex.OrigH) printf("HH");
|
||||
int U=ThisTex.u;
|
||||
int V=ThisTex.v+H;
|
||||
|
||||
uv0[0] = U + round(In.uvs[0].u * W);
|
||||
uv0[1] = V - round(In.uvs[0].v * H);
|
||||
uv1[0] = U + round(In.uvs[1].u * W);
|
||||
uv1[1] = V - round(In.uvs[1].v * H);
|
||||
uv2[0] = U + round(In.uvs[2].u * W);
|
||||
uv2[1] = V - round(In.uvs[2].v * H);
|
||||
uv3[0] = U + round(In.uvs[3].u * W);
|
||||
uv3[1] = V - round(In.uvs[3].v * H);
|
||||
|
||||
}
|
||||
|
||||
Out.uv0[0]=(uv0[0]-XOfs); Out.uv0[1]=(uv0[1]-YOfs);
|
||||
Out.uv1[0]=(uv1[0]-XOfs); Out.uv1[1]=(uv1[1]-YOfs);
|
||||
Out.uv2[0]=(uv2[0]-XOfs); Out.uv2[1]=(uv2[1]-YOfs);
|
||||
Out.uv3[0]=(uv3[0]-XOfs); Out.uv3[1]=(uv3[1]-YOfs);
|
||||
|
||||
Out.TPage=ThisTex.Tpage;
|
||||
Out.Clut=ThisTex.Clut;
|
||||
Out.PolyCode=GPU_PolyFT3Code;
|
||||
|
||||
if (In.TPageFlag)
|
||||
{
|
||||
Out.PolyCode|=GPUCode_SemiTrans;
|
||||
if (In.TPageFlag!=1)
|
||||
{
|
||||
Out.TPage|=In.TPageFlag<<5;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
int CFaceStore::AddVtx(Vector3 &InVtx)
|
||||
int CFaceStore::AddVtx(vector<sVtx> &OutVtxList,Vector3 &InVtx)
|
||||
{
|
||||
int ListSize=OutVtxList.size();
|
||||
sVtx ThisVtx;
|
||||
|
@ -454,20 +351,46 @@ sVtx ThisVtx;
|
|||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CFaceStore::BuildOutTriLists()
|
||||
int CFaceStore::AddVtx(vector<sVtx> &OutVtxList,sVtx &ThisVtx)
|
||||
{
|
||||
int ListSize=OutVtxList.size();
|
||||
|
||||
for (int i=0; i<ListSize; i++)
|
||||
{
|
||||
if (OutVtxList[i]==ThisVtx) return(i);
|
||||
}
|
||||
|
||||
OutVtxList.push_back(ThisVtx);
|
||||
return(ListSize);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CFaceStore::ParseVtx4BBox(sVtx &ThisVtx)
|
||||
{
|
||||
if (BBox.XMin>+ThisVtx.vx) BBox.XMin=+ThisVtx.vx;
|
||||
if (BBox.XMax<+ThisVtx.vx) BBox.XMax=+ThisVtx.vx;
|
||||
if (BBox.YMin>-ThisVtx.vy) BBox.YMin=-ThisVtx.vy;
|
||||
if (BBox.YMax<-ThisVtx.vy) BBox.YMax=-ThisVtx.vy;
|
||||
}
|
||||
//***************************************************************************
|
||||
void CFaceStore::BuildOutTriList(vector<sTri> &OutTriList,vector<sVtx> &OutVtxList)
|
||||
{
|
||||
int FaceCount=TriFaceList.size();
|
||||
|
||||
OutTriList.resize(FaceCount);
|
||||
int ListSize=OutTriList.size();
|
||||
OutTriList.resize(ListSize+FaceCount);
|
||||
|
||||
for (int i=0; i<FaceCount; i++)
|
||||
{
|
||||
CFace &InFace=TriFaceList[i];
|
||||
sTri &OutFace=OutTriList[i];
|
||||
sTri &OutFace=OutTriList[ListSize+i];
|
||||
|
||||
OutFace.P0=InFace.pts[0];
|
||||
OutFace.P1=InFace.pts[1];
|
||||
OutFace.P2=InFace.pts[2];
|
||||
OutFace.P0=AddVtx(OutVtxList,InFace.vtx[0]);
|
||||
OutFace.P1=AddVtx(OutVtxList,InFace.vtx[1]);
|
||||
OutFace.P2=AddVtx(OutVtxList,InFace.vtx[2]);
|
||||
|
||||
ParseVtx4BBox(OutVtxList[OutFace.P0]);
|
||||
ParseVtx4BBox(OutVtxList[OutFace.P1]);
|
||||
ParseVtx4BBox(OutVtxList[OutFace.P2]);
|
||||
// Materials and other shit
|
||||
SetupUV(InFace,OutFace);
|
||||
}
|
||||
|
@ -475,25 +398,30 @@ int FaceCount=TriFaceList.size();
|
|||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CFaceStore::BuildOutQuadList()
|
||||
void CFaceStore::BuildOutQuadList(vector<sQuad> &OutQuadList,vector<sVtx> &OutVtxList)
|
||||
{
|
||||
/*
|
||||
int FaceCount=QuadFaceList.size();
|
||||
OutQuadList.resize(FaceCount);
|
||||
int ListSize=OutQuadList.size();
|
||||
OutQuadList.resize(ListSize+FaceCount);
|
||||
|
||||
for (int i=0; i<FaceCount; i++)
|
||||
{
|
||||
CFace &InFace=QuadFaceList[i];
|
||||
sQuad &OutFace=OutQuadList[i];
|
||||
sQuad &OutFace=OutQuadList[ListSize+i];
|
||||
|
||||
OutFace.P0=AddVtx(InFace.vtx[0]*Scale);
|
||||
OutFace.P1=AddVtx(InFace.vtx[1]*Scale);
|
||||
OutFace.P2=AddVtx(InFace.vtx[2]*Scale);
|
||||
OutFace.P3=AddVtx(InFace.vtx[3]*Scale);
|
||||
OutFace.P0=AddVtx(OutVtxList,InFace.vtx[0]);
|
||||
OutFace.P1=AddVtx(OutVtxList,InFace.vtx[1]);
|
||||
OutFace.P2=AddVtx(OutVtxList,InFace.vtx[2]);
|
||||
OutFace.P3=AddVtx(OutVtxList,InFace.vtx[3]);
|
||||
|
||||
ParseVtx4BBox(OutVtxList[OutFace.P0]);
|
||||
ParseVtx4BBox(OutVtxList[OutFace.P1]);
|
||||
ParseVtx4BBox(OutVtxList[OutFace.P2]);
|
||||
ParseVtx4BBox(OutVtxList[OutFace.P3]);
|
||||
|
||||
// Materials and other shit
|
||||
SetupUV(InFace,OutFace);
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
|
@ -547,22 +475,17 @@ int Pos=ftell(File);
|
|||
//***************************************************************************
|
||||
//***************************************************************************
|
||||
//***************************************************************************
|
||||
#if 0 // quadding stuff
|
||||
bool CFaceStore::CanConnect( int f0, int f1 )
|
||||
{
|
||||
CFace &F0 = FaceList[f0];
|
||||
CFace &F1 = FaceList[f1];
|
||||
|
||||
// check ID's match (used for nodes, weights)
|
||||
if (F0.ID!=F1.ID) return false;
|
||||
|
||||
// check materials match
|
||||
if (F0.Mat != F1.Mat) return false;
|
||||
|
||||
// check normals
|
||||
float dp = dotProduct( F0.Normal, F1.Normal );
|
||||
if (dp < 0.98f)
|
||||
return false;
|
||||
if (dp < 0.98f) return false;
|
||||
|
||||
// check pnt connections
|
||||
bool found = false;
|
||||
|
@ -629,7 +552,7 @@ int CFaceStore::CountFacesAttached ( int f )
|
|||
|
||||
for (int i=0; i<c; i++)
|
||||
{
|
||||
if (FaceList[i].avail && i!=f)
|
||||
if (FaceList[i].Avail && i!=f)
|
||||
{
|
||||
if (CanConnect(f, i))
|
||||
{
|
||||
|
@ -649,7 +572,7 @@ void CFaceStore::FollowFace( int id, CFace &F )
|
|||
int c = FaceList.size();
|
||||
for (int i=0; i<c; i++)
|
||||
{
|
||||
if (FaceList[i].avail && id != i && CanConnect(id, i))
|
||||
if (FaceList[i].Avail && id != i && CanConnect(id, i))
|
||||
{
|
||||
int fec = CountFacesAttached( i );
|
||||
if (fec < minC)
|
||||
|
@ -716,7 +639,7 @@ void CFaceStore::FollowFace( int id, CFace &F )
|
|||
F.pts[ptc] = nf.pts[unc];
|
||||
F.vtx[ptc] = nf.vtx[unc];
|
||||
F.uvs[ptc] = nf.uvs[unc];
|
||||
nf.avail = false;
|
||||
nf.Avail = false;
|
||||
|
||||
if (minC && MaxStrip>F.pts.size()) FollowFace( minF, F );
|
||||
}
|
||||
|
@ -730,7 +653,7 @@ int c = FaceList.size();
|
|||
|
||||
for (int i=0; i<c; i++)
|
||||
{
|
||||
if (FaceList[i].avail)
|
||||
if (FaceList[i].Avail)
|
||||
{
|
||||
int fec = CountFacesAttached( i );
|
||||
if (fec < minC)
|
||||
|
@ -748,9 +671,8 @@ int c = FaceList.size();
|
|||
F.pts = FaceList[minF].pts;
|
||||
F.uvs = FaceList[minF].uvs;
|
||||
F.vtx = FaceList[minF].vtx;
|
||||
FaceList[minF].avail = false;
|
||||
FaceList[minF].Avail = false;
|
||||
F.Normal= FaceList[minF].Normal;
|
||||
F.ID= FaceList[minF].ID;
|
||||
|
||||
if (minC && MaxStrip>F.pts.size()) FollowFace( minF, F );
|
||||
|
||||
|
@ -760,142 +682,28 @@ int c = FaceList.size();
|
|||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
void CFaceStore::QuadGetPnts(CFace &F,int *Join0,int *Join1,int *Pnt)
|
||||
void CFaceStore::Quad()
|
||||
{
|
||||
if (!F.vis[0])
|
||||
{
|
||||
*Join0= F.pts[0];
|
||||
*Join1= F.pts[1];
|
||||
*Pnt= 2;
|
||||
}
|
||||
else
|
||||
if (!F.vis[1])
|
||||
{
|
||||
*Join0= F.pts[1];
|
||||
*Join1= F.pts[2];
|
||||
*Pnt= 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
*Join0= F.pts[2];
|
||||
*Join1= F.pts[0];
|
||||
*Pnt= 1;
|
||||
}
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
int CFaceStore::QuadGetAttached(int FaceNo)
|
||||
{
|
||||
CFace ThisFace=FaceList[FaceNo];
|
||||
int Vis=ThisFace.vis[0]+ThisFace.vis[1]+ThisFace.vis[2];
|
||||
if (Vis==7) return(0); // Pure Tri
|
||||
int FaceCount=FaceList.size();
|
||||
int J00,J01,P0;
|
||||
int J10,J11,P1;
|
||||
|
||||
QuadGetPnts(ThisFace,&J00,&J01,&P0);
|
||||
|
||||
for (int Loop=FaceNo+1;Loop<FaceCount;Loop++)
|
||||
{
|
||||
CFace &cFace=FaceList[Loop];
|
||||
if (cFace.avail)
|
||||
{
|
||||
if (ThisFace.Normal.x==cFace.Normal.x &&
|
||||
ThisFace.Normal.y==cFace.Normal.y &&
|
||||
ThisFace.Normal.z==cFace.Normal.z)
|
||||
{
|
||||
if (ThisFace.Mat==cFace.Mat && ThisFace.ID==cFace.ID)
|
||||
{
|
||||
QuadGetPnts(cFace,&J10,&J11,&P1);
|
||||
if ((J00==J10 && J01==J11) || (J00==J11 && J01==J10)) return(Loop);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CFaceStore::OrderPnts( CFace &F ,int unc)
|
||||
{
|
||||
int idx;
|
||||
if (!F.vis[0]) idx=2;
|
||||
if (!F.vis[1]) idx=0;
|
||||
if (!F.vis[2]) idx=1;
|
||||
|
||||
{
|
||||
vector<int>::iterator pb, pe, pm;
|
||||
vector<sUV>::iterator ub, ue, um;
|
||||
vector<Vector3>::iterator vb, ve, vm;
|
||||
pb = F.pts.begin(); pe = F.pts.end();
|
||||
ub = F.uvs.begin(); ue = F.uvs.end();
|
||||
vb = F.vtx.begin(); ve = F.vtx.end();
|
||||
|
||||
pm = pb + idx;
|
||||
um = ub + idx;
|
||||
vm = vb + idx;
|
||||
|
||||
rotate(pb, pm, pe);
|
||||
rotate(ub, um, ue);
|
||||
rotate(vb, vm, ve);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CFaceStore::Quad(vector<CFace> &TriList,vector<CFace> &QuadList)
|
||||
{
|
||||
int FaceCount=FaceList.size();
|
||||
|
||||
if (MaxStrip==4)
|
||||
{
|
||||
//vector<CFace> ThisTriList;
|
||||
for (int Loop=0;Loop<FaceCount;Loop++)
|
||||
{
|
||||
if (FaceList[Loop].avail)
|
||||
{
|
||||
int Att=QuadGetAttached(Loop);
|
||||
if (Att)
|
||||
{
|
||||
CFace &F=FaceList[Loop];
|
||||
CFace &NF=FaceList[Att];
|
||||
int J0,J1,P;
|
||||
QuadGetPnts(NF,&J0,&J1,&P);
|
||||
FaceList[Loop].avail=FaceList[Att].avail=false;
|
||||
OrderPnts(F,P);
|
||||
F.pts.push_back(NF.pts[P]);
|
||||
F.vtx.push_back(NF.vtx[P]);
|
||||
F.uvs.push_back(NF.uvs[P]);
|
||||
QuadList.push_back(F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Strip remaining tris
|
||||
// for (Loop=0;Loop<FaceCount;Loop++)
|
||||
// {
|
||||
// if (FaceList[Loop].avail) ThisTriList.push_back(FaceList[Loop]);
|
||||
// }
|
||||
|
||||
bool strips = true;
|
||||
while (strips)
|
||||
{
|
||||
{
|
||||
CFace f;
|
||||
strips = GetFace( f );
|
||||
if (strips)
|
||||
{
|
||||
{
|
||||
if (f.pts.size() == 3)
|
||||
TriList.push_back(f);
|
||||
TriFaceList.push_back(f);
|
||||
else
|
||||
QuadList.push_back(f);
|
||||
}
|
||||
QuadFaceList.push_back(f);
|
||||
}
|
||||
// printf("Quaded %i extra\n",ThisTriList.size()-TriList.size());
|
||||
}
|
||||
}
|
||||
else
|
||||
{ // No quadding, copy direct
|
||||
for (int Loop=0;Loop<FaceCount;Loop++) TriList.push_back(FaceList[Loop]);
|
||||
}
|
||||
{ // No quadding, copy direct
|
||||
int FaceCount=FaceList.size();
|
||||
for (int Loop=0;Loop<FaceCount;Loop++) TriFaceList.push_back(FaceList[Loop]);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -23,16 +23,17 @@ struct sFaceTexList
|
|||
};
|
||||
*/
|
||||
//***************************************************************************
|
||||
/*
|
||||
class CFace
|
||||
{
|
||||
public:
|
||||
// int PntCount;
|
||||
int PntCount;
|
||||
int Mat;
|
||||
Vector3 vtx[4];
|
||||
int pts[4];
|
||||
int idx[4];
|
||||
// int idx[4];
|
||||
sUV uvs[4];
|
||||
int vis[4];
|
||||
// int vis[4];
|
||||
Vector3 Normal;
|
||||
bool Avail;
|
||||
// int ID;
|
||||
|
@ -40,8 +41,8 @@ public:
|
|||
int TPageFlag;
|
||||
|
||||
};
|
||||
*/
|
||||
|
||||
/*
|
||||
class CFace
|
||||
{
|
||||
public:
|
||||
|
@ -49,25 +50,20 @@ public:
|
|||
{
|
||||
vtx.resize(3);
|
||||
pts.resize(3);
|
||||
idx.resize(3);
|
||||
uvs.resize(3);
|
||||
vis.resize(3);
|
||||
}
|
||||
|
||||
// int PntCount;
|
||||
int Mat;
|
||||
vector<Vector3> vtx;
|
||||
vector<int> pts;
|
||||
vector<int> idx;
|
||||
vector<sUV> uvs;
|
||||
vector<int> vis;
|
||||
Vector3 Normal;
|
||||
bool Avail;
|
||||
int ID;
|
||||
GString TexName;
|
||||
int TPageFlag;
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
//***************************************************************************
|
||||
#ifndef sTriFace
|
||||
struct sTriFace
|
||||
|
@ -85,8 +81,8 @@ class CFaceStore
|
|||
{
|
||||
|
||||
public:
|
||||
CFaceStore() {MaxStrip = 3;TexGrab=&FaceStoreTexGrab;}
|
||||
CFaceStore(int Max) {MaxStrip=Max;TexGrab=&FaceStoreTexGrab;}
|
||||
CFaceStore() {MaxStrip = 3;TexGrab=0;}
|
||||
CFaceStore(int Max) {MaxStrip=Max;TexGrab=0;}
|
||||
~CFaceStore(){};
|
||||
|
||||
void SetTPageFlag(CFace &F,int MatFlag);
|
||||
|
@ -100,25 +96,7 @@ public:
|
|||
void SetTexGrab(CTexGrab &NewGrab) {TexGrab=&NewGrab;}
|
||||
int AddTex(GString const &TexName);
|
||||
|
||||
void SetTexOut(GString &Name,int TPBase,int TPW,int TPH) {TexGrab->SetOutFile(Name); TexGrab->SetTPage(TPBase,TPW,TPH);}
|
||||
void SetTexInclude(GString &Name) {TexGrab->SetIncFile(Name);}
|
||||
void SetTexDebug(bool f) {TexGrab->SetDebug(f);}
|
||||
void SetTexDebugOut(GString &Name) {TexGrab->SetDebugOut(Name);}
|
||||
void SetTexShrinkToFit(bool f) {TexGrab->ShrinkToFit(f);}
|
||||
void SetTexNoSort() {TexGrab->NoSort();}
|
||||
void SetTexAnimatedHeadersOnly(bool f) {TexGrab->AnimatedHeadersOnly(f);}
|
||||
void SetTexDontOutputBoxes(bool f) {TexGrab->DontOutputBoxes(f);}
|
||||
void SetTexAllowRotate(bool f) {TexGrab->AllowRotate(f);}
|
||||
|
||||
CTexGrab &GetTexGrab() {return(FaceStoreTexGrab);}
|
||||
vector<sTexOutInfo> &GetTexInfo() {return(TexGrab->GetTexInfo());}
|
||||
|
||||
void ProcessTextures();
|
||||
void Process();
|
||||
|
||||
int WriteTriList(FILE *File) {return(WriteTriList(File,OutTriList));}
|
||||
int WriteQuadList(FILE *File) {return(WriteQuadList(File,OutQuadList));}
|
||||
int WriteVtxList(FILE *File) {return(WriteVtxList(File,OutVtxList));}
|
||||
void Process(vector<sTri> &OutTriList,vector<sQuad> &OutQuadList,vector<sVtx> &OutVtxList);
|
||||
|
||||
int WriteTriList(FILE *File,vector<sTri> &List);
|
||||
int WriteQuadList(FILE *File,vector<sQuad> &List);
|
||||
|
@ -133,49 +111,43 @@ public:
|
|||
|
||||
vector<CFace> const &GetQuadFaceList() {return(QuadFaceList);}
|
||||
int GetQuadFaceCount() {return(QuadFaceList.size());}
|
||||
|
||||
vector<sVtx> const &GetVtxList() {return(OutVtxList);}
|
||||
int GetVtxCount() {return(OutVtxList.size());}
|
||||
int AddVtx(Vector3 &Vtx);
|
||||
static int AddVtx(vector<sVtx> &OutVtxList,Vector3 &Vtx);
|
||||
static int AddVtx(vector<sVtx> &OutVtxList,sVtx &ThisVtx);
|
||||
void ParseVtx4BBox(sVtx &Vtx);
|
||||
|
||||
void setMaxStripLength(int v) {MaxStrip = v;}
|
||||
|
||||
CFace& operator []( int nIndex ) {return(FaceList[nIndex]);}
|
||||
|
||||
vector<sTri> GetOutTriList() {return(OutTriList);}
|
||||
vector<sQuad> GetOutQuadList() {return(OutQuadList);}
|
||||
|
||||
sBBox &GetBBox() {return(BBox);}
|
||||
private:
|
||||
void Quad();
|
||||
void SetupUV(CFace const &In, sTri &Out);
|
||||
void SetupUV(CFace const &In, sQuad &Out);
|
||||
|
||||
void BuildOutTriLists();
|
||||
void BuildOutQuadList();
|
||||
void BuildOutTriList(vector<sTri> &OutTriList,vector<sVtx> &OutVtxList);
|
||||
void BuildOutQuadList(vector<sQuad> &OutQuadList,vector<sVtx> &OutVtxList);
|
||||
|
||||
// int QuadGetAttached(int FaceNo);
|
||||
// void QuadGetPnts(CFace &F,int *Join0,int *Join1,int *Pnt);
|
||||
// void QuadGetUVs(CFace &F,int *Join0,int *Join1,int *Pnt);
|
||||
// void OrderPnts( CFace &F ,int unc);
|
||||
int QuadGetAttached(int FaceNo);
|
||||
void QuadGetPnts(CFace &F,int *Join0,int *Join1,int *Pnt);
|
||||
void QuadGetUVs(CFace &F,int *Join0,int *Join1,int *Pnt);
|
||||
void OrderPnts( CFace &F ,int unc);
|
||||
|
||||
// bool CanConnect( int f0, int f1 );
|
||||
// int CountFacesAttached ( int f );
|
||||
// void FollowFace( int id, CFace &F );
|
||||
// int GetUnconnectedPoint( int f0, int f1, int &f0p0, int &f0p1 );
|
||||
// bool GetFace( CFace & F );
|
||||
bool CanConnect( int f0, int f1 );
|
||||
int CountFacesAttached ( int f );
|
||||
void FollowFace( int id, CFace &F );
|
||||
int GetUnconnectedPoint( int f0, int f1, int &f0p0, int &f0p1 );
|
||||
bool GetFace( CFace & F );
|
||||
|
||||
int MaxStrip;
|
||||
|
||||
vector<CFace> FaceList;
|
||||
// vector<sFaceTexList> TexList;
|
||||
CTexGrab FaceStoreTexGrab,*TexGrab;
|
||||
CTexGrab *TexGrab;
|
||||
|
||||
vector<CFace> TriFaceList;
|
||||
vector<CFace> QuadFaceList;
|
||||
|
||||
vector<sTri> OutTriList;
|
||||
vector<sQuad> OutQuadList;
|
||||
vector<sVtx> OutVtxList;
|
||||
vector<sVtx> VtxList;
|
||||
sBBox BBox;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -15,6 +15,7 @@ CMkLevel Level;
|
|||
int TPBase=-1,TPW=-1,TPH=-1;
|
||||
GString IncDir;
|
||||
int PakW=0,PakH=0;
|
||||
bool LocalGeom=false;
|
||||
|
||||
//***************************************************************************
|
||||
char * CycleCommands(char *String,int Num)
|
||||
|
@ -52,10 +53,10 @@ int Count;
|
|||
TextPtr+=strlen(TextPtr)+1;
|
||||
TPH=atol(TextPtr);
|
||||
break;
|
||||
case 'm':
|
||||
TpStr= CheckFileString(String);
|
||||
Level.AddModel(TpStr);
|
||||
break;
|
||||
// case 'm':
|
||||
// TpStr= CheckFileString(String);
|
||||
// Level.AddModel(TpStr);
|
||||
// break;
|
||||
case 'i':
|
||||
IncDir= CheckFileString(String);
|
||||
IncDir.Upper();
|
||||
|
@ -64,6 +65,9 @@ int Count;
|
|||
case 'q':
|
||||
StripLength=4;
|
||||
break;
|
||||
case 'l':
|
||||
LocalGeom=true;
|
||||
break;
|
||||
case 'p':
|
||||
TpStr= CheckFileString(String);
|
||||
TextPtr=Text;
|
||||
|
@ -100,9 +104,10 @@ void Usage(char *ErrStr)
|
|||
printf(" -o:[FILE] Set output File (AND Dir)\n");
|
||||
printf(" -s:nn Set Scaling value\n");
|
||||
printf(" -t:p,w,h Set TPage No,Width,Height\n");
|
||||
printf(" -m: Add Model\n");
|
||||
// printf(" -m: Add Model\n");
|
||||
printf(" -d: Enable Debug output\n");
|
||||
printf(" -q: Enable Quadding\n");
|
||||
printf(" -l: Enable Local Geom\n");
|
||||
GObject::Error(ERR_FATAL,ErrStr);
|
||||
}
|
||||
|
||||
|
@ -118,7 +123,7 @@ std::vector<GString> const &Files = MyFiles.GetFileInfoVector();
|
|||
if (Files.size()>1) Usage("Too many Levels specified\n");
|
||||
|
||||
Level.SetAppDir(argv[0]);
|
||||
Level.Init(Files[0],OutStr,IncDir,TPBase,TPW,TPH,PakW,PakH);
|
||||
Level.Init(Files[0],OutStr,IncDir,TPBase,TPW,TPH,PakW,PakH,LocalGeom);
|
||||
Level.Load();
|
||||
Level.Process();
|
||||
Level.Write();
|
||||
|
|
|
@ -58,6 +58,21 @@ sExpLayerTile BlankTile={0,0};
|
|||
//sExpLayerTile BlankTile2d={-1,-1};
|
||||
//sExpLayerTile BlankTile3d={0,0};
|
||||
|
||||
Vector3 DefVtxTable[8]=
|
||||
{
|
||||
Vector3(+0.5f,+1.0f,-4.0f),
|
||||
Vector3(-0.5f,+1.0f,-4.0f),
|
||||
Vector3(+0.5f, 0.0f,-4.0f),
|
||||
Vector3(-0.5f, 0.0f,-4.0f),
|
||||
|
||||
Vector3(+0.5f,+1.0f,+4.0f),
|
||||
Vector3(-0.5f,+1.0f,+4.0f),
|
||||
Vector3(+0.5f, 0.0f,+4.0f),
|
||||
Vector3(-0.5f, 0.0f,+4.0f),
|
||||
};
|
||||
#define DefVtxTableSize sizeof(DefVtxTable)/sizeof(Vector3)
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
CMkLevel::CMkLevel()
|
||||
{
|
||||
|
@ -66,6 +81,7 @@ CMkLevel::CMkLevel()
|
|||
AddTile2d(BlankTile);
|
||||
AddTile3d(BlankTile);
|
||||
OutElem3d.resize(1);
|
||||
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
|
@ -88,7 +104,7 @@ GFName Path=AppPath;
|
|||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CMkLevel::Init(const char *Filename,const char *OutFilename,const char *IncDir,int TPBase,int TPW,int TPH,int _PakW,int _PakH)
|
||||
void CMkLevel::Init(const char *Filename,const char *OutFilename,const char *IncDir,int TPBase,int TPW,int TPH,int _PakW,int _PakH,bool _LocalGeom)
|
||||
{
|
||||
// Setup filenames and paths
|
||||
GFName Path;
|
||||
|
@ -142,130 +158,55 @@ GFName Path;
|
|||
FlatFace[1].uv[1][0]=1; FlatFace[1].uv[1][1]=1;
|
||||
FlatFace[1].uv[2][0]=0; FlatFace[1].uv[2][1]=1;
|
||||
FlatFace[1].Flags=0;
|
||||
// Setup Pak Info
|
||||
|
||||
// Setup Extra Info
|
||||
PakW=_PakW;
|
||||
PakH=_PakH;
|
||||
LocalGeom=_LocalGeom;
|
||||
AddDefVtx(OutVtxList);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
//***************************************************************************
|
||||
int CMkLevel::AddModel(GString &Filename)
|
||||
void CMkLevel::AddDefVtx(vector<sVtx> &VtxList)
|
||||
{
|
||||
/*
|
||||
GFName Path=Filename;
|
||||
sMkLevelModel ThisModel;
|
||||
int Idx;
|
||||
CScene Scene;
|
||||
|
||||
ThisModel.Name=GFName(Filename).File();
|
||||
Idx=ModelList.Find(ThisModel);
|
||||
|
||||
if (Idx!=-1)
|
||||
CFaceStore F;
|
||||
for (int i=0; i<DefVtxTableSize; i++)
|
||||
{
|
||||
return(Idx);
|
||||
F.AddVtx(VtxList,DefVtxTable[i]);
|
||||
}
|
||||
Idx=ModelList.size();
|
||||
|
||||
Path.File("");
|
||||
Path.Ext("");
|
||||
GString RootPath=Path.FullName();
|
||||
// Load Model and add
|
||||
int TriStart=ModelFaceList.GetFaceCount();;
|
||||
Scene.Load(Filename);
|
||||
BuildModel(Scene,RootPath,0);
|
||||
ThisModel.TriStart=TriStart;
|
||||
ThisModel.TriCount=ModelFaceList.GetFaceCount()-TriStart;
|
||||
|
||||
ModelList.Add(ThisModel);
|
||||
return(Idx);
|
||||
*/
|
||||
return(0);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CMkLevel::BuildModel(CScene &Scene,GString &RootPath,int Node)
|
||||
{
|
||||
CNode &ThisNode=Scene.GetNode(Node);
|
||||
vector<sGinTri> const &NodeTriList = ThisNode.GetTris();
|
||||
vector<Vector3> const &NodeVtxList = ThisNode.GetPts();
|
||||
vector<int> const &NodeMatList = ThisNode.GetTriMaterial();
|
||||
vector<sUVTri> const &NodeUVList = ThisNode.GetUVTris();
|
||||
vector<GString> const &SceneTexList= Scene.GetTexList();
|
||||
vector<int> const &SceneUsedMatList=Scene.GetUsedMaterialIdx();
|
||||
vector<Material> const &SceneMaterials=Scene.GetMaterials();
|
||||
|
||||
int TriCount=NodeTriList.size();
|
||||
|
||||
for (int T=0; T<TriCount; T++)
|
||||
{
|
||||
int Mat=SceneUsedMatList[NodeMatList[T]];
|
||||
if (Mat>SceneTexList.size()) GObject::Error(ERR_FATAL,"Crap Material ID, wanted %i, only have %i\n",Mat,SceneTexList.size());
|
||||
GString TexName=RootPath+SceneTexList[Mat];
|
||||
|
||||
CFace &F=ModelFaceList.AddFace( NodeVtxList, NodeTriList[T], NodeUVList[T], TexName,SceneMaterials[Mat].Flags,false);
|
||||
}
|
||||
|
||||
int ChildCount=ThisNode.GetPruneChildCount();
|
||||
for (int Loop=0;Loop<ChildCount ; Loop++) BuildModel(Scene,RootPath,ThisNode.PruneChildList[Loop]);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
int CMkLevel::AddModel(const char *Name,int TriStart,int TriCount)
|
||||
{
|
||||
/*
|
||||
sMkLevelModel ThisModel;
|
||||
int Idx;
|
||||
int ModelID;
|
||||
|
||||
ThisModel.Name=Name;
|
||||
Idx=ModelList.Find(ThisModel);
|
||||
if (Idx!=-1)
|
||||
{
|
||||
return(Idx);
|
||||
}
|
||||
Idx=ModelList.size();
|
||||
ThisModel.TriStart=ModelFaceList.GetFaceCount();
|
||||
ThisModel.TriCount=TriCount;
|
||||
ThisModel.Name=Name;
|
||||
ThisModel.TriStart=TriStart;
|
||||
ThisModel.TriCount=TriCount;
|
||||
|
||||
ModelID=ModelList.Add(ThisModel);
|
||||
return(ModelID);
|
||||
}
|
||||
|
||||
// Add tri data
|
||||
for (int i=0;i<TriCount; i++)
|
||||
{
|
||||
sExpTri &ThisTri=InTriList[TriStart+i];
|
||||
CFace F;
|
||||
//***************************************************************************
|
||||
void CMkLevel::PreProcessModels()
|
||||
{
|
||||
int i,ListSize=ModelList.size();
|
||||
|
||||
ExpTri2Face(ThisTri,F);
|
||||
ModelFaceList.SetTPageFlag(F,ThisTri.Flags);
|
||||
ModelFaceList.AddFace(F,false);
|
||||
}
|
||||
|
||||
ModelList.Add(ThisModel);
|
||||
return(Idx);
|
||||
*/
|
||||
return(0);
|
||||
for (i=0; i<ListSize; i++)
|
||||
{
|
||||
sMkLevelModel &ThisModel=ModelList[i];
|
||||
ThisModel.ElemID=Create3dElem(ThisModel.TriCount,ThisModel.TriStart,false); // always all models as global for the moment
|
||||
}
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CMkLevel::ProcessModels()
|
||||
{
|
||||
/*
|
||||
int i,ListSize;
|
||||
int TriStart=OutFaceList.GetFaceCount();
|
||||
|
||||
// Add faces
|
||||
ListSize=ModelFaceList.GetFaceCount();
|
||||
for (i=0; i<ListSize; i++)
|
||||
{
|
||||
OutFaceList.AddFace(ModelFaceList[i],true);
|
||||
}
|
||||
|
||||
// Update models
|
||||
ListSize=ModelList.size();
|
||||
for (i=0; i<ListSize; i++)
|
||||
{
|
||||
// printf("%s = %i %i\n",ModelList[i].Name,ModelList[i].TriStart,ModelList[i].TriCount);
|
||||
ModelList[i].TriStart+=TriStart;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
|
@ -307,11 +248,7 @@ GString FilePath;
|
|||
{
|
||||
GString InName=InPath;
|
||||
InName+=TexPtr;
|
||||
// sprintf(FullName,"%s",InName);
|
||||
_fullpath( FullName, InName, 1024);
|
||||
// GFName::makeabsolute(InPath,InName,FullName);
|
||||
// InName=FullName;
|
||||
// _fullpath( FullName, FullName, 1024);
|
||||
List.push_back(GString(FullName));
|
||||
TexPtr+=strlen(TexPtr)+1;
|
||||
}
|
||||
|
@ -433,12 +370,20 @@ void CMkLevel::Process()
|
|||
{
|
||||
printf("PreProcess Layers\n");
|
||||
PreProcessLayers();
|
||||
printf("Process Models\n");
|
||||
ProcessModels();
|
||||
printf("PreProcess ElemBanks\n");
|
||||
PreProcessElemBank2d();
|
||||
PreProcessElemBank3d();
|
||||
printf("PreProcess Models\n");
|
||||
PreProcessModels();
|
||||
printf("Process Textures\n");
|
||||
TexGrab.Process();
|
||||
printf("Process ElemBanks\n");
|
||||
ProcessElemBanks();
|
||||
ProcessElemBank2d();
|
||||
ProcessElemBank3d();
|
||||
printf("Process Layers\n");
|
||||
ProcessLayers();
|
||||
printf("Process Models\n");
|
||||
ProcessModels();
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
|
@ -486,22 +431,11 @@ int TileIdx=(TileID<<2) | (InTile.Flags & PC_TILE_FLAG_MIRROR_XY);
|
|||
return(TileIdx);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CMkLevel::ProcessElemBanks()
|
||||
{
|
||||
PreProcessElemBank2d();
|
||||
PreProcessElemBank3d();
|
||||
TexGrab.Process();
|
||||
ProcessElemBank2d();
|
||||
ProcessElemBank3d();
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CMkLevel::PreProcessElemBank2d()
|
||||
{
|
||||
int i,ListSize=UsedTile2dList.size();
|
||||
|
||||
// UsedTile2dList[0].Tile=-1;
|
||||
// Extract Tex data from list
|
||||
for (i=1; i<ListSize; i++)
|
||||
{ // Skip blank
|
||||
|
@ -540,35 +474,47 @@ int i,ListSize=UsedTile3dList.size();
|
|||
}
|
||||
|
||||
//***************************************************************************
|
||||
int MaxElemTri=0,MaxElemQuad=0;
|
||||
void CMkLevel::ProcessElemBank3d()
|
||||
{
|
||||
int i,ListSize=UsedTile3dList.size();
|
||||
int MaxElemTri=0,MaxElemQuad=0;
|
||||
//int i,ListSize=UsedTile3dList.size(); <--- UsedTile3dList is tiles only!!
|
||||
int i,ListSize=OutElem3d.size();
|
||||
|
||||
for (i=0; i<ListSize; i++)
|
||||
{
|
||||
sOutElem3d &ThisElem=OutElem3d[i];
|
||||
CFaceStore &ThisList=ThisElem.FaceStore;
|
||||
ProcessElem3d(OutElem3d[i]);
|
||||
}
|
||||
printf("Max Elem Tri =%i\tMax Elem Quad =%i\n",MaxElemTri,MaxElemQuad);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CMkLevel::ProcessElem3d(sOutElem3d &ThisElem)
|
||||
{
|
||||
CFaceStore &ThisList=ThisElem.FaceStore;
|
||||
|
||||
ThisList.setMaxStripLength(StripLength);
|
||||
ThisElem.Elem3d.TriStart=OutTriList.size();
|
||||
ThisElem.Elem3d.QuadStart=OutQuadList.size();
|
||||
ThisList.Process(OutTriList,OutQuadList,OutVtxList);
|
||||
if (!ThisElem.LocalGeom)
|
||||
{ // Global Geom
|
||||
ThisList.Process(OutTriList,OutQuadList,OutVtxList);
|
||||
}
|
||||
else
|
||||
{ // Local Geom
|
||||
AddDefVtx(ThisElem.LocalVtxList);
|
||||
ThisList.Process(OutTriList,OutQuadList,ThisElem.LocalVtxList);
|
||||
int v,VtxListSize=ThisElem.LocalVtxList.size();
|
||||
for (v=0; v<VtxListSize; v++)
|
||||
{
|
||||
u16 Idx=CFaceStore::AddVtx(OutVtxList,ThisElem.LocalVtxList[v]);
|
||||
ThisElem.LocalVtxIdxList.push_back(Idx);
|
||||
}
|
||||
}
|
||||
|
||||
ThisElem.Elem3d.TriCount=ThisList.GetTriFaceCount();
|
||||
ThisElem.Elem3d.QuadCount=ThisList.GetQuadFaceCount();
|
||||
if (MaxElemTri<ThisElem.Elem3d.TriCount) MaxElemTri=ThisElem.Elem3d.TriCount;
|
||||
if (MaxElemQuad<ThisElem.Elem3d.QuadCount) MaxElemQuad=ThisElem.Elem3d.QuadCount;
|
||||
}
|
||||
printf("Max Tile Tri =%i\tMax Tile Quad =%i\n",MaxElemTri,MaxElemQuad);
|
||||
for (i=0; i<ListSize; i++)
|
||||
{
|
||||
sOutElem3d &ThisElem=OutElem3d[i];
|
||||
CFaceStore &ThisList=ThisElem.FaceStore;
|
||||
for (int c=i; c<ListSize; c++)
|
||||
{
|
||||
sOutElem3d &CheckElem=OutElem3d[c];
|
||||
CFaceStore &CheckList=CheckElem.FaceStore;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
|
@ -636,80 +582,107 @@ int ListSize=LayerList.size();
|
|||
//***************************************************************************
|
||||
int CMkLevel::Create3dTile(int Tile,int Flags)
|
||||
{
|
||||
sExpTile &SrcTile=InTileList[Tile];
|
||||
CFace F;
|
||||
int i,ListSize,p;
|
||||
CList<sExpTri> SortList;
|
||||
CList<float> ZPosList;
|
||||
int TileID=OutElem3d.size();
|
||||
|
||||
sExpTile &SrcTile=InTileList[Tile];
|
||||
int ElemID;
|
||||
if (SrcTile.TriCount)
|
||||
{
|
||||
for (i=0; i<SrcTile.TriCount; i++)
|
||||
{
|
||||
int ListPos;
|
||||
sExpTri &ThisTri=InTriList[SrcTile.TriStart+i];
|
||||
float ThisZPos;
|
||||
|
||||
ThisZPos=ThisTri.vtx[0].z;
|
||||
if (ThisZPos<ThisTri.vtx[1].z) ThisZPos=ThisTri.vtx[1].z;
|
||||
if (ThisZPos<ThisTri.vtx[2].z) ThisZPos=ThisTri.vtx[2].z;
|
||||
|
||||
ListSize=SortList.size();
|
||||
for (ListPos=0; ListPos<ListSize; ListPos++)
|
||||
{
|
||||
if (ZPosList[ListPos]>ThisZPos) break;
|
||||
}
|
||||
SortList.insert(ListPos,ThisTri);
|
||||
ZPosList.insert(ListPos,ThisZPos);
|
||||
}
|
||||
ElemID=Create3dElem(SrcTile.TriCount,SrcTile.TriStart,LocalGeom);
|
||||
}
|
||||
else
|
||||
{
|
||||
int TexID=Create2dTile(Tile,0);
|
||||
ElemID=Create2dElem(Tile,LocalGeom);
|
||||
}
|
||||
|
||||
for (i=0; i<2; i++)
|
||||
{
|
||||
FlatFace[i].Flags=0;
|
||||
FlatFace[i].TexID=TexID;
|
||||
SortList.push_back(FlatFace[i]);
|
||||
}
|
||||
return(ElemID);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
int CMkLevel::Create3dElem(int TriCount,int TriStart,bool Local)
|
||||
{
|
||||
CFace F;
|
||||
int i,ListSize;
|
||||
CList<sExpTri> SortList;
|
||||
CList<float> ZPosList;
|
||||
int ElemID=OutElem3d.size();
|
||||
OutElem3d.resize(ElemID+1);
|
||||
|
||||
sOutElem3d &ThisElem=OutElem3d[ElemID];
|
||||
CFaceStore &FaceList=ThisElem.FaceStore;
|
||||
FaceList.SetTexGrab(TexGrab);
|
||||
ThisElem.LocalGeom=Local;
|
||||
|
||||
for (i=0; i<TriCount; i++)
|
||||
{
|
||||
int ListPos;
|
||||
sExpTri &ThisTri=InTriList[TriStart+i];
|
||||
float ThisZPos;
|
||||
|
||||
ThisZPos=ThisTri.vtx[0].z;
|
||||
if (ThisZPos<ThisTri.vtx[1].z) ThisZPos=ThisTri.vtx[1].z;
|
||||
if (ThisZPos<ThisTri.vtx[2].z) ThisZPos=ThisTri.vtx[2].z;
|
||||
|
||||
ListSize=SortList.size();
|
||||
for (ListPos=0; ListPos<ListSize; ListPos++)
|
||||
{
|
||||
if (ZPosList[ListPos]>ThisZPos) break;
|
||||
}
|
||||
SortList.insert(ListPos,ThisTri);
|
||||
ZPosList.insert(ListPos,ThisZPos);
|
||||
}
|
||||
|
||||
// Add sorted list to main list
|
||||
OutElem3d.resize(TileID+1);
|
||||
CFaceStore &FaceList=OutElem3d[TileID].FaceStore;
|
||||
FaceList.SetTexGrab(TexGrab);
|
||||
|
||||
ListSize=SortList.size();
|
||||
for (i=0; i<ListSize; i++)
|
||||
for (i=0; i<TriCount; i++)
|
||||
{
|
||||
sExpTri &ThisTri=SortList[i];
|
||||
CFace F;
|
||||
bool SwapPnt=false;
|
||||
|
||||
if (SrcTile.TriCount)
|
||||
{
|
||||
F.TexName=InTexNameList[ThisTri.TexID];
|
||||
F.Mat=-1;
|
||||
}
|
||||
else
|
||||
{
|
||||
F.Mat=ThisTri.TexID;
|
||||
}
|
||||
F.TexName=InTexNameList[ThisTri.TexID];
|
||||
F.Mat=-1;
|
||||
|
||||
for (p=0; p<3; p++)
|
||||
for (int p=0; p<3; p++)
|
||||
{
|
||||
F.vtx[p]=ThisTri.vtx[p];
|
||||
F.vtx[p].y=F.vtx[p].y;
|
||||
F.uvs[p].u=ThisTri.uv[p][0];
|
||||
F.uvs[p].v=ThisTri.uv[p][1];
|
||||
}
|
||||
FaceList.SetTPageFlag(F,ThisTri.Flags);
|
||||
FaceList.AddFace(F,true);
|
||||
}
|
||||
return(ElemID);
|
||||
}
|
||||
|
||||
return(TileID);
|
||||
//***************************************************************************
|
||||
int CMkLevel::Create2dElem(int Tile,bool Local)
|
||||
{
|
||||
CFace F;
|
||||
int i;
|
||||
int TexID=Create2dTile(Tile,0);
|
||||
int ElemID=OutElem3d.size();
|
||||
OutElem3d.resize(ElemID+1);
|
||||
|
||||
sOutElem3d &ThisElem=OutElem3d[ElemID];
|
||||
CFaceStore &FaceList=ThisElem.FaceStore;
|
||||
FaceList.SetTexGrab(TexGrab);
|
||||
ThisElem.LocalGeom=Local;
|
||||
|
||||
for (i=0; i<2; i++)
|
||||
{
|
||||
sExpTri &ThisTri=FlatFace[i];
|
||||
CFace F;
|
||||
|
||||
F.Mat=TexID;
|
||||
|
||||
for (int p=0; p<3; p++)
|
||||
{
|
||||
F.vtx[p]=ThisTri.vtx[p];
|
||||
F.uvs[p].u=ThisTri.uv[p][0];
|
||||
F.uvs[p].v=ThisTri.uv[p][1];
|
||||
}
|
||||
FaceList.SetTPageFlag(F,0);
|
||||
FaceList.AddFace(F,true);
|
||||
}
|
||||
return(ElemID);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -976,6 +949,7 @@ int i,ListSize;
|
|||
|
||||
//***************************************************************************
|
||||
int ZMin=9999,ZMax=0;
|
||||
int SnapCount[8]={0,0,0,0,0,0,0,0};
|
||||
int CMkLevel::WriteTriList()
|
||||
{
|
||||
int ThisPos=ftell(File);
|
||||
|
@ -993,6 +967,9 @@ int ZOfs=+4*Scale;
|
|||
Z[1]=OutVtxList[T.P1].vz+ZOfs;
|
||||
Z[2]=OutVtxList[T.P2].vz+ZOfs;
|
||||
|
||||
if (T.P0<8) SnapCount[T.P0]++;
|
||||
if (T.P1<8) SnapCount[T.P1]++;
|
||||
if (T.P2<8) SnapCount[T.P2]++;
|
||||
for (int p=0; p<3; p++)
|
||||
{
|
||||
if (ZMin>Z[p]) ZMin=Z[p];
|
||||
|
@ -1012,6 +989,7 @@ int ZOfs=+4*Scale;
|
|||
fwrite(&T,1,sizeof(sTri),File);
|
||||
}
|
||||
printf("%i Tris\t(%i Bytes)\n",ListSize,ListSize*sizeof(sTri));
|
||||
// printf("\n"); for (i=0; i<8;i++) printf("Snapped Vtx %i=%i \n",i,SnapCount[i]); printf("\n");
|
||||
return(ThisPos);
|
||||
}
|
||||
|
||||
|
@ -1034,6 +1012,10 @@ int ZOfs=+4*Scale;
|
|||
Z[2]=OutVtxList[Q.P2].vz+ZOfs;
|
||||
Z[3]=OutVtxList[Q.P3].vz+ZOfs;
|
||||
|
||||
if (Q.P0<8) SnapCount[Q.P0]++;
|
||||
if (Q.P1<8) SnapCount[Q.P1]++;
|
||||
if (Q.P2<8) SnapCount[Q.P2]++;
|
||||
if (Q.P3<8) SnapCount[Q.P3]++;
|
||||
for (int p=0; p<4; p++)
|
||||
{
|
||||
if (ZMin>Z[p]) ZMin=Z[p];
|
||||
|
@ -1053,10 +1035,13 @@ int ZOfs=+4*Scale;
|
|||
fwrite(&Q,1,sizeof(sQuad),File);
|
||||
}
|
||||
printf("%i Quads\t(%i Bytes)\n",ListSize,ListSize*sizeof(sQuad));
|
||||
// printf("\n"); for (i=0; i<8;i++) printf("Snapped Vtx %i=%i \n",i,SnapCount[i]); printf("\n");
|
||||
return(ThisPos);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
sVtx Min={+100,+100,+100};
|
||||
sVtx Max={-100,-100,-100};
|
||||
int CMkLevel::WriteVtxList()
|
||||
{
|
||||
int i,ListSize=OutVtxList.size();
|
||||
|
@ -1070,10 +1055,20 @@ int Pos=ftell(File);
|
|||
Out.vx=+In.vx;
|
||||
Out.vy=-In.vy+(Scale/2); // Offset it so the origin is centre centre
|
||||
Out.vz=+In.vz;
|
||||
Min.vx=__min(Min.vx,Out.vx);
|
||||
Min.vy=__min(Min.vy,Out.vy);
|
||||
Min.vz=__min(Min.vz,Out.vz);
|
||||
Max.vx=__max(Max.vx,Out.vx);
|
||||
Max.vy=__max(Max.vy,Out.vy);
|
||||
Max.vz=__max(Max.vz,Out.vz);
|
||||
fwrite(&Out,1,sizeof(sVtx),File);
|
||||
// if (abs(Out.vz)==400) printf("%i %i %i\n",Out.vx,Out.vy,Out.vz);
|
||||
}
|
||||
printf("%i Vtx\t(%i Bytes)\n",ListSize,ListSize*sizeof(sVtx));
|
||||
|
||||
printf("Min %i %i %i\n",Min.vx,Min.vy,Min.vz);
|
||||
printf("Max %i %i %i\n",Max.vx,Max.vy,Max.vz);
|
||||
|
||||
return(Pos);
|
||||
}
|
||||
|
||||
|
@ -1106,7 +1101,7 @@ int ThingStart=ftell(File);
|
|||
LevelHdr.TriggerList=WriteThings(LAYER_TYPE_TRIGGER);
|
||||
LevelHdr.FXList=WriteThings(LAYER_TYPE_FX);
|
||||
LevelHdr.HazardList=WriteThings(LAYER_TYPE_HAZARD);
|
||||
// LevelHdr.ModelList=(sModel*)WriteModelList();
|
||||
LevelHdr.ModelList=(sModel*)WriteModelList();
|
||||
printf("Things =\t(%i Bytes)\n",ftell(File)-ThingStart);
|
||||
|
||||
|
||||
|
@ -1152,7 +1147,6 @@ char *LayerName=GetLayerName(Type,LAYER_SUBTYPE_NONE);
|
|||
//***************************************************************************
|
||||
int CMkLevel::WriteModelList()
|
||||
{
|
||||
/*
|
||||
int i,ListSize=ModelList.size();
|
||||
int Ofs=ftell(File);
|
||||
|
||||
|
@ -1160,50 +1154,18 @@ int Ofs=ftell(File);
|
|||
{
|
||||
sModel Out;
|
||||
sMkLevelModel &ThisModel=ModelList[i];
|
||||
sOutElem3d &ThisElem=OutElem3d[ThisModel.ElemID];
|
||||
sBBox &ElemBBox=ThisElem.FaceStore.GetBBox();
|
||||
Out.ElemID=ThisModel.ElemID;
|
||||
Out.BBox=ElemBBox;
|
||||
|
||||
Out.TriCount=ThisModel.TriCount;
|
||||
Out.TriStart=ThisModel.TriStart;
|
||||
CalcModelBBox(ThisModel,Out.BBox);
|
||||
printf("Writing Model %s (%i/%i) (%i Tris) (BBox %i,%i->%i,%i)\n",ThisModel.Name,i+1,ListSize,Out.TriCount,Out.BBox.XMin,Out.BBox.YMin,Out.BBox.XMax,Out.BBox.YMax);
|
||||
printf("Writing Model %s (%i) (%i %i) (BBox %i,%i->%i,%i)\n",ThisModel.Name,Out.ElemID,ThisElem.Elem3d.TriCount,ThisElem.Elem3d.QuadCount,Out.BBox.XMin,Out.BBox.YMin,Out.BBox.XMax,Out.BBox.YMax);
|
||||
fwrite(&Out,1,sizeof(sModel),File);
|
||||
}
|
||||
|
||||
return(Ofs);
|
||||
*/
|
||||
return(0);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
/*
|
||||
void CMkLevel::CalcModelBBox(sMkLevelModel &ThisModel,sBBox &BBox)
|
||||
{
|
||||
vector<sTri> &TriList=OutFaceList.GetOutTriList();
|
||||
vector<sVtx> const &VtxList=OutFaceList.GetVtxList();
|
||||
int Vtx[3];
|
||||
|
||||
BBox.XMin=+32000;
|
||||
BBox.XMax=-32000;
|
||||
BBox.YMin=+32000;
|
||||
BBox.YMax=-32000;
|
||||
|
||||
for (int T=0; T<ThisModel.TriCount; T++)
|
||||
{
|
||||
sTri &ThisTri=TriList[T+ThisModel.TriStart];
|
||||
Vtx[0]=ThisTri.P0;
|
||||
Vtx[1]=ThisTri.P1;
|
||||
Vtx[2]=ThisTri.P2;
|
||||
|
||||
for (int V=0; V<3; V++)
|
||||
{
|
||||
sVtx const &ThisVtx=VtxList[Vtx[V]];
|
||||
if (BBox.XMin>+ThisVtx.vx) BBox.XMin=+ThisVtx.vx;
|
||||
if (BBox.XMax<+ThisVtx.vx) BBox.XMax=+ThisVtx.vx;
|
||||
if (BBox.YMin>-ThisVtx.vy) BBox.YMin=-ThisVtx.vy;
|
||||
if (BBox.YMax<-ThisVtx.vy) BBox.YMax=-ThisVtx.vy;
|
||||
}
|
||||
}
|
||||
}
|
||||
*/
|
||||
//***************************************************************************
|
||||
//*** Inf File **************************************************************
|
||||
//***************************************************************************
|
||||
|
|
|
@ -26,16 +26,6 @@ struct sMkLevelTex
|
|||
bool operator ==(sMkLevelTex const &v1) {return(Tile==v1.Tile && Flags==v1.Flags);}
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
struct sMkLevelModel
|
||||
{
|
||||
GString Name;
|
||||
int TriStart;
|
||||
int TriCount;
|
||||
|
||||
bool operator ==(sMkLevelModel const &v1) {return(Name==v1.Name);}
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
struct sInfItem
|
||||
{
|
||||
|
@ -67,8 +57,21 @@ bool operator ==(sUsedTile3d const &v1) {return(Tile==v1.Tile);}
|
|||
|
||||
struct sOutElem3d
|
||||
{
|
||||
sElem3d Elem3d;
|
||||
CFaceStore FaceStore;
|
||||
bool LocalGeom;
|
||||
sElem3d Elem3d;
|
||||
CFaceStore FaceStore;
|
||||
vector<sVtx> LocalVtxList;
|
||||
CList<u16> LocalVtxIdxList;
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
struct sMkLevelModel
|
||||
{
|
||||
GString Name;
|
||||
int TriStart,TriCount;
|
||||
u16 ElemID;
|
||||
|
||||
bool operator ==(sMkLevelModel const &v1) {return(Name==v1.Name);}
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
|
@ -81,10 +84,9 @@ public:
|
|||
~CMkLevel();
|
||||
|
||||
void SetAppDir(const char *Path);
|
||||
void Init(const char *InFilename,const char *OutFilename,const char *IncDir,int TPBase,int TPW,int TPH,int PakW,int PakH);
|
||||
void Init(const char *InFilename,const char *OutFilename,const char *IncDir,int TPBase,int TPW,int TPH,int PakW,int PakH,bool LocalGeom);
|
||||
|
||||
void LoadModels();
|
||||
int AddModel(GString &Filename);
|
||||
int AddModel(const char *Name,int TriStart,int TriCount);
|
||||
|
||||
void Load();
|
||||
|
@ -111,6 +113,10 @@ public:
|
|||
void GetPakWH(int &W,int &H) {W=PakW; H=PakH;}
|
||||
protected:
|
||||
void BuildModel(CScene &ThisScene,GString &RootPath,int Node);
|
||||
|
||||
int Create3dElem(int TriCount,int TriStart,bool Local);
|
||||
int Create2dElem(int Tile,bool Local);
|
||||
|
||||
CMkLevelLayer *FindLayer(int Type,int SubType);
|
||||
void LoadStrList(CList<GString> &List,char *TexPtr,int Count);
|
||||
|
||||
|
@ -118,15 +124,20 @@ protected:
|
|||
void LoadLayers(sExpFileHdr *FileHdr);
|
||||
void LoadLayer(sExpLayerHdr *LayerHdr);
|
||||
|
||||
void AddDefVtx(vector<sVtx> &VtxList);
|
||||
|
||||
void PreProcessLayers();
|
||||
void ProcessElemBanks();
|
||||
void PreProcessElemBank2d();
|
||||
void ProcessElemBank2d();
|
||||
void PreProcessElemBank3d();
|
||||
void ProcessElemBank3d();
|
||||
void ProcessElem3d(sOutElem3d &ThisElem);
|
||||
|
||||
void ProcessLayers();
|
||||
void SetUpTileUV(sElem2d &Out, sTexOutInfo &Info);
|
||||
|
||||
void PreProcessModels();
|
||||
void ProcessModels();
|
||||
|
||||
void WriteLevel();
|
||||
|
@ -138,7 +149,6 @@ protected:
|
|||
int WriteQuadList();
|
||||
int WriteVtxList();
|
||||
void WriteElemBanks();
|
||||
void CalcModelBBox(sMkLevelModel &ThisModel,sBBox &BBox);
|
||||
void BuildTiles();
|
||||
|
||||
void WriteIncFile();
|
||||
|
@ -161,8 +171,6 @@ protected:
|
|||
CList<GString> InSetNameList;
|
||||
CList<GString> InTexNameList;
|
||||
|
||||
|
||||
// CFaceStore OutFaceList;
|
||||
CList<sElem2d> OutElem2d;
|
||||
CList<sOutElem3d> OutElem3d;
|
||||
|
||||
|
@ -184,6 +192,7 @@ protected:
|
|||
CList<sInfItem> InfList;
|
||||
|
||||
int PakW,PakH;
|
||||
bool LocalGeom;
|
||||
|
||||
vector<sTri> OutTriList;
|
||||
vector<sQuad> OutQuadList;
|
||||
|
|
|
@ -25,7 +25,7 @@ void CFXFallingTile::init(DVECTOR const &_Pos)
|
|||
CFX::init();
|
||||
sLevelHdr *LevelHdr=CLevel::getLevelHdr();
|
||||
|
||||
TileBank3d=LevelHdr->TileBank3d;
|
||||
ElemBank3d=LevelHdr->ElemBank3d;
|
||||
TriList=LevelHdr->TriList;
|
||||
QuadList=LevelHdr->QuadList;
|
||||
VtxList=LevelHdr->VtxList;
|
||||
|
@ -77,7 +77,7 @@ VECTOR ThisRenderPos;
|
|||
gte_SetRotMatrix(&Mtx);
|
||||
CMX_SetTransMtxXY(&ThisRenderPos);
|
||||
|
||||
sTile3d *ThisTile=&TileBank3d[Tile];
|
||||
sElem3d *ThisTile=&ElemBank3d[Tile];
|
||||
int TriCount=ThisTile->TriCount;
|
||||
sTri *TList=&TriList[ThisTile->TriStart];
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@ protected:
|
|||
u16 Tile;
|
||||
DVECTOR Velocity;
|
||||
|
||||
sTile3d *TileBank3d;
|
||||
sElem3d *ElemBank3d;
|
||||
sTri *TriList;
|
||||
sQuad *QuadList;
|
||||
sVtx *VtxList;
|
||||
|
|
|
@ -773,18 +773,19 @@ u8 V=Node->V;
|
|||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
sModel *CModelGfx::ModelTable;
|
||||
sElem3d *CModelGfx::ModelElemBank;
|
||||
sTri *CModelGfx::ModelTriList;
|
||||
sQuad *CModelGfx::ModelQuadList;
|
||||
sVtx *CModelGfx::ModelVtxList;
|
||||
|
||||
/*****************************************************************************/
|
||||
void CModelGfx::SetData(sModel *Table,sTri *TList,sQuad *QList,sVtx *VList)
|
||||
void CModelGfx::SetData(sLevelHdr *LevelHdr)
|
||||
{
|
||||
ModelTable=Table;
|
||||
ModelTriList=TList;
|
||||
ModelQuadList=QList;
|
||||
ModelVtxList=VList;
|
||||
|
||||
ModelTable=LevelHdr->ModelList;
|
||||
ModelElemBank=LevelHdr->ElemBank3d;
|
||||
ModelTriList=LevelHdr->TriList;
|
||||
ModelQuadList=LevelHdr->QuadList;
|
||||
ModelVtxList=LevelHdr->VtxList;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -794,19 +795,21 @@ void CModelGfx::SetModel(int Type)
|
|||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
static const int MXO=0;
|
||||
static const int MYO=-8;
|
||||
void CModelGfx::Render(DVECTOR &Pos,SVECTOR *Angle,VECTOR *Scale)
|
||||
{
|
||||
#define BLOCK_MULT 16
|
||||
sElem3d *Elem=&ModelElemBank[Model->ElemID];
|
||||
u8 *PrimPtr=GetPrimPtr();
|
||||
POLY_FT3 *TPrimPtr=(POLY_FT3*)PrimPtr;
|
||||
sVtx *P0,*P1,*P2;
|
||||
u32 T0,T1,T2;
|
||||
s32 ClipZ;
|
||||
sOT *ThisOT;
|
||||
DVECTOR MapXY;
|
||||
VECTOR RenderPos;
|
||||
int TriCount=Model->TriCount;
|
||||
sTri *TList=&ModelTriList[Model->TriStart];
|
||||
int TriCount=Elem->TriCount;
|
||||
sTri *TList=&ModelTriList[Elem->TriStart];
|
||||
MATRIX Mtx;
|
||||
|
||||
// If has scale && angle then need to use PSX scale matrix, otherwise, force values
|
||||
|
@ -830,14 +833,8 @@ sTri *TList=&ModelTriList[Model->TriStart];
|
|||
}
|
||||
}
|
||||
|
||||
MapXY.vx=Pos.vx>>4;
|
||||
MapXY.vy=Pos.vy>>4;
|
||||
|
||||
int ShiftX=(Pos.vx & 15);
|
||||
int ShiftY=(Pos.vy & 15);
|
||||
|
||||
RenderPos.vx=INGAME_SCREENOFS_X+((MapXY.vx*16)+ShiftX);
|
||||
RenderPos.vy=INGAME_SCREENOFS_Y+((MapXY.vy*16)+ShiftY);
|
||||
RenderPos.vx=(INGAME_SCREENOFS_X+MXO)+Pos.vx;
|
||||
RenderPos.vy=(INGAME_SCREENOFS_Y+MYO)+Pos.vy;
|
||||
|
||||
gte_SetRotMatrix(&Mtx);
|
||||
CMX_SetTransMtxXY(&RenderPos);
|
||||
|
@ -857,35 +854,13 @@ int ShiftY=(Pos.vy & 15);
|
|||
*(u32*)&TPrimPtr->u0=T0; // Set UV0
|
||||
*(u32*)&TPrimPtr->u1=T1; // Set UV1
|
||||
*(u16*)&TPrimPtr->u2=T2; // Set UV2
|
||||
/*
|
||||
if (TList->OTOfs>ActorOT)
|
||||
{
|
||||
ThisOT=OtPtr+(ActorOT+1);
|
||||
}
|
||||
else
|
||||
{
|
||||
ThisOT=OtPtr+(ActorOT-1);
|
||||
}
|
||||
*/
|
||||
ThisOT=OtPtr+TList->OTOfs;
|
||||
|
||||
|
||||
TList++;
|
||||
addPrim(ThisOT,TPrimPtr);
|
||||
gte_stsxy3_ft3(TPrimPtr);
|
||||
TPrimPtr++;
|
||||
|
||||
/* Models are not clipped
|
||||
gte_nclip_b();
|
||||
gte_stsxy3_ft3(TPrimPtr);
|
||||
gte_stopz(&ClipZ);
|
||||
if (ClipZ<=0)
|
||||
{
|
||||
addPrim(ThisOT,TPrimPtr);
|
||||
TPrimPtr++;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
SetPrimPtr((u8*)TPrimPtr);
|
||||
|
||||
}
|
||||
|
|
|
@ -174,7 +174,7 @@ public:
|
|||
CModelGfx(){};
|
||||
virtual ~CModelGfx(){};
|
||||
|
||||
static void SetData(sModel *Table,sTri *TList,sQuad *QList,sVtx *VList);
|
||||
static void SetData(sLevelHdr *LevelHdr);
|
||||
void SetModel(int Type);
|
||||
|
||||
void Render(DVECTOR &Pos,SVECTOR *Angle=0,VECTOR *Scale=0);
|
||||
|
@ -183,9 +183,11 @@ static void SetData(sModel *Table,sTri *TList,sQuad *QList,sVtx *VList);
|
|||
protected:
|
||||
|
||||
static sModel *ModelTable;
|
||||
static sElem3d *ModelElemBank;
|
||||
static sTri *ModelTriList;
|
||||
static sQuad *ModelQuadList;
|
||||
static sVtx *ModelVtxList;
|
||||
|
||||
sModel *Model;
|
||||
};
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ CLayerTile::CLayerTile(sLevelHdr *LevelHdr,sLayerHdr *Hdr)
|
|||
MapHeight=LayerHdr->Height;
|
||||
|
||||
// printf("%i %i\n",MapWidth,MapHeight);
|
||||
TileBank2d=LevelHdr->TileBank2d;
|
||||
ElemBank2d=LevelHdr->ElemBank2d;
|
||||
Map=(sTileMapElem*)MakePtr(Hdr,sizeof(sLayerHdr));
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ sOT *ThisOT=OtPtr+LayerOT;
|
|||
MapRow++;
|
||||
if (ThisTile)
|
||||
{
|
||||
sTile2d *Tile=&TileBank2d[ThisTile];
|
||||
sElem2d *Tile=&ElemBank2d[ThisTile];
|
||||
POLY_FT4 *Ft4=(POLY_FT4*)PrimPtr;
|
||||
setPolyFT4(Ft4);
|
||||
setShadeTex(Ft4,1);
|
||||
|
@ -151,7 +151,7 @@ sOT *ThisOT=OtPtr+LayerOT;
|
|||
int ThisTile=*MapRow++;
|
||||
if (ThisTile)
|
||||
{
|
||||
/**/ sTile2d *Tile=&TileBank2d[ThisTile];
|
||||
/**/ sElem2d *Tile=&ElemBank2d[ThisTile];
|
||||
TSPRT_16 *SprPtr=(TSPRT_16*)PrimPtr;
|
||||
setTSprt16(SprPtr);
|
||||
setTSetShadeTex(SprPtr,1);
|
||||
|
|
|
@ -49,7 +49,7 @@ virtual sTileMapElem *getMapPtr(int _x,int _y) {return(&Map[(_x>>4)+((_y>>4)*M
|
|||
protected:
|
||||
|
||||
sLayerHdr *LayerHdr;
|
||||
sTile2d *TileBank2d;
|
||||
sElem2d *ElemBank2d;
|
||||
|
||||
int MapWidth,MapHeight,MapXYShift;
|
||||
int RenderW,RenderH;
|
||||
|
|
|
@ -21,23 +21,22 @@ static FontBank *Font;
|
|||
|
||||
static const int BLOCK_SIZE =16;
|
||||
static const int SCREEN_TILE_ADJ_U =2;
|
||||
static const int SCREEN_TILE_ADJ_D =2;
|
||||
static const int SCREEN_TILE_ADJ_D =1;
|
||||
static const int SCREEN_TILE_ADJ_L =2;
|
||||
static const int SCREEN_TILE_ADJ_R =3;
|
||||
|
||||
static const int SCREEN_TILE3D_WIDTH =(INGAME_SCREENW/BLOCK_SIZE)+SCREEN_TILE_ADJ_L+SCREEN_TILE_ADJ_R;
|
||||
static const int SCREEN_TILE3D_HEIGHT =(INGAME_SCREENH/BLOCK_SIZE)+SCREEN_TILE_ADJ_U+SCREEN_TILE_ADJ_D;
|
||||
static const int RENDER_X_PIX_OFS =8;
|
||||
static const int RENDER_Y_PIX_OFS =16;
|
||||
|
||||
static const int RENDER_X_OFS =INGAME_SCREENOFS_X-(SCREEN_TILE_ADJ_L*BLOCK_SIZE)+RENDER_X_PIX_OFS;
|
||||
static const int RENDER_Y_OFS =INGAME_SCREENOFS_Y-(SCREEN_TILE_ADJ_U*BLOCK_SIZE)+RENDER_Y_PIX_OFS;
|
||||
static const int RENDER_X_OFS =INGAME_SCREENOFS_X-(SCREEN_TILE_ADJ_L*BLOCK_SIZE)+INGAME_RENDER_OFS_X;
|
||||
static const int RENDER_Y_OFS =INGAME_SCREENOFS_Y-(SCREEN_TILE_ADJ_U*BLOCK_SIZE)+INGAME_RENDER_OFS_Y;
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
CLayerTile3d::CLayerTile3d(sLevelHdr *LevelHdr,sLayerHdr *Hdr) : CLayerTile(LevelHdr,Hdr)
|
||||
{
|
||||
TileBank3d=LevelHdr->TileBank3d;
|
||||
ElemBank3d=LevelHdr->ElemBank3d;
|
||||
TriList=LevelHdr->TriList;
|
||||
QuadList=LevelHdr->QuadList;
|
||||
VtxList=LevelHdr->VtxList;
|
||||
|
@ -112,6 +111,29 @@ void CLayerTile3d::think(DVECTOR &MapPos)
|
|||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
#define CMX_SetRotMatrixXY( r0 ) __asm__ ( \
|
||||
"lw $12, 0( %0 );" \
|
||||
"lw $13, 4( %0 );" \
|
||||
"ctc2 $12, $0;" \
|
||||
"ctc2 $13, $2;" \
|
||||
: \
|
||||
: "r"( r0 ) \
|
||||
: "$12", "$13")
|
||||
|
||||
struct sFlipTable
|
||||
{
|
||||
s16 Mtx[4];
|
||||
s32 ClipCode;
|
||||
};
|
||||
|
||||
sFlipTable FlipTable[4]=
|
||||
{
|
||||
{{+4096,0,+4096,0},0<<31}, //00 <0
|
||||
{{-4096,0,+4096,0},1<<31}, //01 >0
|
||||
{{+4096,0,-4096,0},1<<31}, //10 >0
|
||||
{{-4096,0,-4096,0},0<<31} //11 <0
|
||||
};
|
||||
|
||||
void CLayerTile3d::render()
|
||||
{
|
||||
sTileMapElem *MapPtr=GetMapPos();
|
||||
|
@ -134,14 +156,19 @@ VECTOR BlkPos;
|
|||
|
||||
for (int X=0; X<RenderW; X++)
|
||||
{
|
||||
sTile3d *Tile=&TileBank3d[MapRow->Tile];
|
||||
int TriCount=Tile->TriCount;
|
||||
sTri *TList=&TriList[Tile->TriStart];
|
||||
u16 Tile=MapRow->Tile;
|
||||
u16 TileIdx=Tile>>2;
|
||||
u16 Flip=Tile&3;
|
||||
sFlipTable *FTab=&FlipTable[Flip];
|
||||
sElem3d *Elem=&ElemBank3d[TileIdx];
|
||||
int TriCount=Elem->TriCount;
|
||||
sTri *TList=&TriList[Elem->TriStart];
|
||||
|
||||
P0=&VtxList[TList->P0]; P1=&VtxList[TList->P1]; P2=&VtxList[TList->P2];
|
||||
while (TriCount--) // Blank tiles rejected here (as no tri-count)
|
||||
{
|
||||
CMX_SetTransMtxXY(&BlkPos);
|
||||
CMX_SetRotMatrixXY(&FTab->Mtx);
|
||||
gte_ldv3(P0,P1,P2);
|
||||
setlen(TPrimPtr, GPU_PolyFT3Tag);
|
||||
TPrimPtr->code=TList->PolyCode;
|
||||
|
@ -157,11 +184,12 @@ VECTOR BlkPos;
|
|||
|
||||
ThisOT=OtPtr+TList->OTOfs;
|
||||
TList++;
|
||||
P0=&VtxList[TList->P0]; P1=&VtxList[TList->P1]; P2=&VtxList[TList->P2];
|
||||
P0=&VtxList[TList->P0]; P1=&VtxList[TList->P1]; P2=&VtxList[TList->P2]; // Pre-fetch next Tri
|
||||
gte_nclip_b();
|
||||
gte_stsxy3_ft3(TPrimPtr);
|
||||
gte_stopz(&ClipZ);
|
||||
if (ClipZ<=0)
|
||||
ClipZ^=FTab->ClipCode;
|
||||
if (ClipZ<0)
|
||||
{
|
||||
addPrim(ThisOT,TPrimPtr);
|
||||
TPrimPtr++;
|
||||
|
|
|
@ -13,31 +13,14 @@ class CLayerTile3d : public CLayerTile
|
|||
public:
|
||||
CLayerTile3d(sLevelHdr *LevelHdr,sLayerHdr *Hdr);
|
||||
~CLayerTile3d();
|
||||
/*
|
||||
enum
|
||||
{
|
||||
TILE3D_WIDTH =16,
|
||||
TILE3D_HEIGHT =16,
|
||||
BLOCK_MULT =16,
|
||||
SCREEN_TILE_ADJ_UP =1,
|
||||
SCREEN_TILE_ADJ_LEFT =3,
|
||||
SCREEN_TILE3D_WIDTH =40,
|
||||
SCREEN_TILE3D_HEIGHT =18,
|
||||
RENDER_X_PIX_OFS =-8,
|
||||
RENDER_Y_PIX_OFS =0,
|
||||
|
||||
RENDER_X_OFS =-(BLOCK_MULT*15)-(SCREEN_TILE_ADJ_LEFT*BLOCK_MULT)+RENDER_X_PIX_OFS,
|
||||
RENDER_Y_OFS =-(BLOCK_MULT*7)-(SCREEN_TILE_ADJ_UP*BLOCK_MULT)+RENDER_Y_PIX_OFS,
|
||||
|
||||
};
|
||||
*/
|
||||
void init(DVECTOR &MapPos,int Shift);
|
||||
void shutdown();
|
||||
void think(DVECTOR &MapPos);
|
||||
void render();
|
||||
|
||||
protected:
|
||||
sTile3d *TileBank3d;
|
||||
sElem3d *ElemBank3d;
|
||||
sTri *TriList;
|
||||
sQuad *QuadList;
|
||||
sVtx *VtxList;
|
||||
|
|
|
@ -203,14 +203,14 @@ sLvlTab *lvlTab=&LvlTable[LevelNo];
|
|||
DisplayLoadingScreen(lvlTab);
|
||||
|
||||
LevelHdr=(sLevelHdr*)CFileIO::loadFile(lvlTab->LevelFilename,"Level");
|
||||
LevelHdr->TileBank2d=(sTile2d*) MakePtr(LevelHdr,(int)LevelHdr->TileBank2d);
|
||||
LevelHdr->TileBank3d=(sTile3d*) MakePtr(LevelHdr,(int)LevelHdr->TileBank3d);
|
||||
LevelHdr->ElemBank2d=(sElem2d*) MakePtr(LevelHdr,(int)LevelHdr->ElemBank2d);
|
||||
LevelHdr->ElemBank3d=(sElem3d*) MakePtr(LevelHdr,(int)LevelHdr->ElemBank3d);
|
||||
LevelHdr->TriList=(sTri*) MakePtr(LevelHdr,(int)LevelHdr->TriList);
|
||||
LevelHdr->QuadList=(sQuad*) MakePtr(LevelHdr,(int)LevelHdr->QuadList);
|
||||
LevelHdr->VtxList=(sVtx*) MakePtr(LevelHdr,(int)LevelHdr->VtxList);
|
||||
LevelHdr->ModelList=(sModel*) MakePtr(LevelHdr,(int)LevelHdr->ModelList);
|
||||
|
||||
CModelGfx::SetData(LevelHdr->ModelList,LevelHdr->TriList,LevelHdr->QuadList,LevelHdr->VtxList);
|
||||
CModelGfx::SetData(LevelHdr);//LevelHdr->ModelList,LevelHdr->TriList,LevelHdr->QuadList,LevelHdr->VtxList);
|
||||
m_levelTPage=TPLoadTex(lvlTab->TexFilename);
|
||||
|
||||
s_playerSpawnPos.vx=LevelHdr->PlayerStartX*16;
|
||||
|
|
|
@ -8,13 +8,15 @@
|
|||
#include "system\global.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
#define GEOM_SCREEN_H 350
|
||||
#define GEOM_SCREEN_H (350)
|
||||
|
||||
#define INGAME_SCREENW 512
|
||||
#define INGAME_SCREENH 256
|
||||
#define INGAME_SCREENW (512)
|
||||
#define INGAME_SCREENH (256)
|
||||
|
||||
#define INGAME_SCREENOFS_X -(INGAME_SCREENW/2)
|
||||
#define INGAME_SCREENOFS_Y -(INGAME_SCREENH/2)
|
||||
#define INGAME_RENDER_OFS_X (8)
|
||||
#define INGAME_RENDER_OFS_Y (4)
|
||||
#define INGAME_SCREENOFS_X (-INGAME_SCREENW/2)
|
||||
#define INGAME_SCREENOFS_Y (-INGAME_SCREENH/2)
|
||||
|
||||
/*****************************************************************************/
|
||||
typedef void (*VbFuncType)(void);
|
||||
|
|
Binary file not shown.
|
@ -132,24 +132,13 @@ struct sQuad
|
|||
//*** Game Types and Headers ************************************************
|
||||
//***************************************************************************
|
||||
// Tiles
|
||||
//typedef u16 sTileMapElem;
|
||||
|
||||
struct sTileMapElem
|
||||
{
|
||||
u16 Tile;
|
||||
// u16 LightIdx;
|
||||
};
|
||||
/*
|
||||
struct sTile
|
||||
{
|
||||
// 2d Tile
|
||||
u8 u0,v0; // 2
|
||||
u16 Clut; // 2
|
||||
u16 TPage; // 2
|
||||
u16 Pad; // :o( need this? // 2
|
||||
}; // 8
|
||||
*/
|
||||
struct sTile2d
|
||||
|
||||
struct sElem2d
|
||||
{
|
||||
// 2d Tile
|
||||
u8 u0,v0; // 2
|
||||
|
@ -158,14 +147,17 @@ struct sTile2d
|
|||
u16 Pad; // :o( need this? // 2
|
||||
}; // 8
|
||||
|
||||
struct sTile3d
|
||||
struct sElem3d
|
||||
{
|
||||
// 3d Tile
|
||||
// 3d Elem (tile/model)
|
||||
u16 TriStart;
|
||||
u16 TriCount;
|
||||
u16 QuadStart;
|
||||
u16 QuadCount;
|
||||
}; // 8
|
||||
u16 VtxStart;
|
||||
u16 VtxCount;
|
||||
}; // 12
|
||||
|
||||
//***************************************************************************
|
||||
// Layers
|
||||
struct sLayerHdr
|
||||
|
@ -209,8 +201,8 @@ struct sLayerShadeHdr
|
|||
//---------------------------------------------------------------------------
|
||||
struct sModel
|
||||
{
|
||||
u16 TriCount;
|
||||
u16 TriStart;
|
||||
u16 ElemID;
|
||||
u16 Pad;
|
||||
sBBox BBox;
|
||||
};
|
||||
|
||||
|
@ -218,26 +210,26 @@ struct sModel
|
|||
// Header
|
||||
struct sLevelHdr
|
||||
{
|
||||
u32 BackLayer;
|
||||
u32 MidLayer;
|
||||
u32 ActionLayer;
|
||||
u32 ForeLayer;
|
||||
u32 CollisionLayer;
|
||||
u32 ActorList;
|
||||
u32 ItemList;
|
||||
u32 PlatformList;
|
||||
u32 TriggerList;
|
||||
u32 FXList;
|
||||
u32 HazardList;
|
||||
u32 BackLayer;
|
||||
u32 MidLayer;
|
||||
u32 ActionLayer;
|
||||
u32 ForeLayer;
|
||||
u32 CollisionLayer;
|
||||
u32 ActorList;
|
||||
u32 ItemList;
|
||||
u32 PlatformList;
|
||||
u32 TriggerList;
|
||||
u32 FXList;
|
||||
u32 HazardList;
|
||||
|
||||
u16 PlayerStartX,PlayerStartY;
|
||||
u16 PlayerStartX,PlayerStartY;
|
||||
|
||||
sTile2d *TileBank2d;
|
||||
sTile3d *TileBank3d;
|
||||
sTri *TriList;
|
||||
sQuad *QuadList;
|
||||
sVtx *VtxList;
|
||||
sModel *ModelList;
|
||||
sElem2d *ElemBank2d;
|
||||
sElem3d *ElemBank3d;
|
||||
sTri *TriList;
|
||||
sQuad *QuadList;
|
||||
sVtx *VtxList;
|
||||
sModel *ModelList;
|
||||
};
|
||||
|
||||
//***************************************************************************
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue