This commit is contained in:
parent
a6710337c0
commit
cb772db46a
30 changed files with 197 additions and 108 deletions
|
@ -1,3 +1,2 @@
|
|||
Idle
|
||||
Bite
|
||||
Bounce
|
||||
Wobble
|
|
@ -0,0 +1 @@
|
|||
idle
|
|
@ -0,0 +1 @@
|
|||
idle
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -82,7 +82,21 @@ inline bool uvaprox( sUV &uv0, sUV &uv1 )
|
|||
}
|
||||
|
||||
//***************************************************************************
|
||||
CFace &CFaceStore::AddFace(vector<Vector3> const &P, const sGinTri &T, const sUVTri &uv,GString const &Tex,int ID,bool ProcessTexFlag )
|
||||
void CFaceStore::SetTPageFlag(CFace &F,int MatFlag)
|
||||
{
|
||||
int Trans=0;
|
||||
|
||||
switch (MatFlag>>3)
|
||||
{
|
||||
// case 0: Trans=2; break; /* Subtractive */
|
||||
case 1: Trans=1; break; /* Additive */
|
||||
}
|
||||
// Trans=1;
|
||||
F.TPageFlag=Trans<<5;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
CFace &CFaceStore::AddFace(vector<Vector3> const &P, const sGinTri &T, const sUVTri &uv,GString const &Tex,int MatFlag,bool ProcessTexFlag )
|
||||
{
|
||||
//int ListSize = FaceList.size();
|
||||
// FaceList.resize(ListSize+1);
|
||||
|
@ -101,9 +115,10 @@ CFace 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;
|
||||
F.Mat = -1;
|
||||
SetTPageFlag(F,MatFlag);
|
||||
return(AddFace(F,ProcessTexFlag));
|
||||
}
|
||||
|
||||
|
@ -153,6 +168,7 @@ int ListSize=Faces.GetFaceCount();
|
|||
}
|
||||
|
||||
//***************************************************************************
|
||||
/*
|
||||
CFace &CFaceStore::AddFace(sTriFace &Face,int ID)
|
||||
{
|
||||
int ListSize = FaceList.size();
|
||||
|
@ -177,7 +193,7 @@ CFace &F = FaceList[ListSize];
|
|||
F.ID=ID;
|
||||
return(F);
|
||||
}
|
||||
|
||||
*/
|
||||
//***************************************************************************
|
||||
//*** Texture Stuff *********************************************************
|
||||
//***************************************************************************
|
||||
|
@ -367,8 +383,15 @@ int V=ThisTex.v+H;
|
|||
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.TPage=ThisTex.Tpage | In.TPageFlag;
|
||||
Out.Clut=ThisTex.Clut;
|
||||
Out.PolyCode=GPU_PolyFT3Code;
|
||||
|
||||
if (In.TPageFlag)
|
||||
{
|
||||
Out.PolyCode|=GPUCode_SemiTrans;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -35,8 +35,10 @@ public:
|
|||
int vis[4];
|
||||
Vector3 Normal;
|
||||
bool Avail;
|
||||
int ID;
|
||||
// int ID;
|
||||
GString TexName;
|
||||
int TPageFlag;
|
||||
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -71,6 +73,7 @@ public:
|
|||
struct sTriFace
|
||||
{
|
||||
int Mat;
|
||||
int Flags;
|
||||
Vector3 vtx[3];
|
||||
int pts[3];
|
||||
sUV uvs[3];
|
||||
|
@ -86,7 +89,8 @@ public:
|
|||
CFaceStore(int Max) {MaxStrip=Max;TexGrab=&FaceStoreTexGrab;}
|
||||
~CFaceStore(){};
|
||||
|
||||
CFace &AddFace(vector<Vector3> const &P, const sGinTri &T, const sUVTri &uv,GString const &Tex,int ID=0,bool ProcessTexFlag=false);
|
||||
void SetTPageFlag(CFace &F,int MatFlag);
|
||||
CFace &AddFace(vector<Vector3> const &P, const sGinTri &T, const sUVTri &uv,GString const &Tex,int MatFlag=0,bool ProcessTexFlag=false);
|
||||
CFace &AddFace(CFace &F,bool TexFlag=true);
|
||||
void AddFaces(vector<CFace>&Faces,bool TexFlag=true);
|
||||
void AddFaces(CFaceStore &Faces,bool TexFlag=true);
|
||||
|
|
|
@ -99,7 +99,7 @@ GFName Path=Filename;
|
|||
Create2dTexture(TexCache,Path.File(),Node);
|
||||
Build2dDrawList(TexCache,DrawList[ElemType2d]);
|
||||
BlankFlag=false;
|
||||
if (!ValidFlag) SetInvalid();
|
||||
// if (!ValidFlag) SetInvalid();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
@ -245,6 +245,7 @@ std::vector<int> const &NodeTriMat=ThisNode.GetTriMaterial();
|
|||
|
||||
std::vector<GString> const &SceneTexList=ThisScene.GetTexList();
|
||||
std::vector<int> const &SceneUsedMatList=ThisScene.GetUsedMaterialIdx();
|
||||
std::vector<Material> const &SceneMatList=ThisScene.GetMaterials();
|
||||
int TexCount=SceneTexList.size();
|
||||
|
||||
int TriCount=NodeTriList.size();
|
||||
|
@ -257,7 +258,7 @@ int ListSize=TriList.size();
|
|||
sUVTri const &ThisUV=NodeUVList[T];
|
||||
sTriFace &Tri=TriList[ListSize+T];
|
||||
int ThisMat=NodeTriMat[T];
|
||||
int TexID;
|
||||
int TexID,TexFlags;
|
||||
|
||||
|
||||
// Sort Textures - Only add the ones that are used :o)
|
||||
|
@ -269,10 +270,12 @@ int ListSize=TriList.size();
|
|||
AfxMessageBox(mexstr,MB_OK | MB_ICONEXCLAMATION);
|
||||
TexID=0;
|
||||
}
|
||||
else
|
||||
// else
|
||||
{
|
||||
TexFlags=SceneMatList[TexID].Flags;
|
||||
GString ThisName;
|
||||
GString TexName=SceneTexList[TexID];
|
||||
|
||||
ThisName=SetPath+TexName;
|
||||
TRACE2("%i !%s!\n",TexID,ThisName);
|
||||
TexID=TexCache.ProcessTexture(ThisName);
|
||||
|
@ -293,6 +296,7 @@ Matrix4x4 TransMtx;
|
|||
Tri.uvs[p].u=ThisUV.p[p].u;
|
||||
Tri.uvs[p].v=ThisUV.p[p].v;
|
||||
Tri.Mat=TexID;
|
||||
Tri.Flags=TexFlags;
|
||||
}
|
||||
}
|
||||
for (int Child=0; Child<ChildCount; Child++) Build3dElem(TexCache,ThisScene,ThisNode.PruneChildList[Child]);
|
||||
|
@ -470,7 +474,7 @@ void CElem::Purge()
|
|||
for (int i=0; i<ElemTypeMax; i++)
|
||||
glDeleteLists(DrawList[i],1);
|
||||
CleanUp();
|
||||
TriList.clear();
|
||||
// TriList.clear();
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -17,14 +17,20 @@
|
|||
#include "MapEdit.h"
|
||||
#include "GUIElemList.h"
|
||||
|
||||
/*****************************************************************************/
|
||||
struct sTriFace
|
||||
{
|
||||
int Mat;
|
||||
int Flags;
|
||||
Vector3 vtx[3];
|
||||
int pts[3];
|
||||
sUV uvs[3];
|
||||
};
|
||||
|
||||
enum TRI_FLAGS
|
||||
{
|
||||
TRI_FLAGS_TRANS_ADD=1<<0,
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -74,6 +74,7 @@ struct sExpTri
|
|||
int TexID;
|
||||
Vector3 vtx[3];
|
||||
float uv[3][2];
|
||||
int Flags;
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
|
|
@ -37,26 +37,26 @@ Class25=CMapEditDoc
|
|||
Class26=CMapEditView
|
||||
|
||||
ResourceCount=21
|
||||
Resource1=IDR_MAINFRAME (English (U.S.))
|
||||
Resource1=IDD_LAYER_COLLISION
|
||||
Resource2=IDR_MAPEDITYPE (English (U.S.))
|
||||
Resource3=IDD_ABOUTBOX (English (U.S.))
|
||||
Resource4=IDD_ELEMLIST
|
||||
Resource5=IDD_LAYER_LIST
|
||||
Resource6=IDD_TOOLBAR
|
||||
Resource7=IDD_NEWMAP
|
||||
Resource8=IDD_ADDLAYER
|
||||
Resource9=IDD_LAYER_TRIGGER
|
||||
Resource10=IDD_LAYER_THING_POS
|
||||
Resource11=IDD_LAYER_SHADE
|
||||
Resource12=IDD_LAYER_COLLISION
|
||||
Resource13=IDD_MULTIBAR (English (U.S.))
|
||||
Resource14=IDD_LAYER_ACTOR
|
||||
Resource15=IDD_LAYER_THING
|
||||
Resource16=IDD_RESIZE
|
||||
Resource17=IDD_LAYER_PLATFORM
|
||||
Resource18=IDD_TILEBANK
|
||||
Resource19=IDD_LAYER_FX
|
||||
Resource20=IDR_TOOLBAR (English (U.S.))
|
||||
Resource3=IDD_ELEMLIST
|
||||
Resource4=IDD_MULTIBAR (English (U.S.))
|
||||
Resource5=IDD_LAYER_THING
|
||||
Resource6=IDR_TOOLBAR (English (U.S.))
|
||||
Resource7=IDD_LAYER_PLATFORM
|
||||
Resource8=IDD_LAYER_TRIGGER
|
||||
Resource9=IDD_TILEBANK
|
||||
Resource10=IDD_NEWMAP
|
||||
Resource11=IDR_MAINFRAME (English (U.S.))
|
||||
Resource12=IDD_ABOUTBOX (English (U.S.))
|
||||
Resource13=IDD_LAYER_ACTOR
|
||||
Resource14=IDD_LAYER_LIST
|
||||
Resource15=IDD_RESIZE
|
||||
Resource16=IDD_LAYER_THING_POS
|
||||
Resource17=IDD_ADDLAYER
|
||||
Resource18=IDD_LAYER_FX
|
||||
Resource19=IDD_TOOLBAR
|
||||
Resource20=IDD_LAYER_SHADE
|
||||
Resource21=IDD_LAYER_HAZARD
|
||||
|
||||
[CLS:CChildFrame]
|
||||
|
|
|
@ -54,6 +54,8 @@ int i,ListSize=ThingList.size();
|
|||
OutThing.Pos.Y=ThisThing.XY[0].y;
|
||||
OutThing.Width=ThisThing.Data.Trigger.TriggerWidth;
|
||||
OutThing.Height=ThisThing.Data.Trigger.TriggerHeight;
|
||||
OutThing.TargetPos.X=ThisThing.Data.Trigger.TriggerTargetX;
|
||||
OutThing.TargetPos.Y=ThisThing.Data.Trigger.TriggerTargetY;
|
||||
fwrite(&OutThing,sizeof(sThingTrigger),1,File);
|
||||
}
|
||||
|
||||
|
|
|
@ -156,6 +156,7 @@ 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();
|
||||
|
||||
|
@ -165,7 +166,9 @@ int TriCount=NodeTriList.size();
|
|||
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];
|
||||
|
||||
ModelFaceList.AddFace( NodeVtxList, NodeTriList[T], NodeUVList[T], TexName,0,false);
|
||||
|
||||
CFace &F=ModelFaceList.AddFace( NodeVtxList, NodeTriList[T], NodeUVList[T], TexName,SceneMaterials[Mat].Flags,false);
|
||||
// ModelFaceList.SetTPageFlag(F,SceneMaterials[Mat].Flags);
|
||||
}
|
||||
|
||||
int ChildCount=ThisNode.GetPruneChildCount();
|
||||
|
@ -197,6 +200,7 @@ int Idx;
|
|||
CFace F;
|
||||
|
||||
ExpTri2Face(ThisTri,F);
|
||||
ModelFaceList.SetTPageFlag(F,ThisTri.Flags);
|
||||
ModelFaceList.AddFace(F,false);
|
||||
}
|
||||
|
||||
|
@ -299,8 +303,9 @@ u8 *TilePtr=(u8*) &ByteHdr[FileHdr->TileOfs];
|
|||
sExpTile &InTile=InTileList[i];
|
||||
|
||||
InTile=*ThisTilePtr;
|
||||
InTile.RGB=(u8*)malloc(RGBSize);
|
||||
memcpy(InTile.RGB,TilePtr+sizeof(sExpTile),RGBSize);
|
||||
// InTile.RGB=(u8*)malloc(RGBSize);
|
||||
// memcpy(InTile.RGB,TilePtr+sizeof(sExpTile),RGBSize);
|
||||
InTile.RGB=0;
|
||||
TilePtr+=RGBSize+sizeof(sExpTile);
|
||||
}
|
||||
|
||||
|
@ -533,6 +538,7 @@ void CMkLevel::ExpTri2Face(sExpTri &ThisTri,CFace &F,bool ImportTex)
|
|||
F.uvs[p].v=ThisTri.uv[p][1];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
//***************************************************************************
|
||||
CMkLevelLayer *CMkLevel::FindLayer(int Type,int SubType)
|
||||
|
@ -648,8 +654,7 @@ int TileID=OutTile3dList.size();
|
|||
F.uvs[0]=F.uvs[1];
|
||||
F.uvs[1]=TmpUV;
|
||||
}
|
||||
|
||||
|
||||
OutFaceList.SetTPageFlag(F,ThisTri.Flags);
|
||||
OutFaceList.AddFace(F,true);
|
||||
}
|
||||
|
||||
|
@ -663,66 +668,64 @@ int TileID=OutTile3dList.size();
|
|||
int CMkLevel::Create2dTex(int Tile,int Flags)
|
||||
{
|
||||
sExpTile &SrcTile=InTileList[Tile];
|
||||
int Idx;
|
||||
sMkLevelTex InTex;
|
||||
//sMkLevelTex InTex;
|
||||
|
||||
InTex.Set=SrcTile.Set;
|
||||
InTex.Flags=Flags;
|
||||
InTex.XOfs=SrcTile.XOfs;
|
||||
InTex.YOfs=SrcTile.YOfs;
|
||||
InTex.RGB=SrcTile.RGB;
|
||||
|
||||
Idx=Tex2dList.Find(InTex);
|
||||
if (Idx!=-1) return(Idx);
|
||||
// InTex.RGB=SrcTile.RGB;
|
||||
|
||||
// Try and find RGB data match
|
||||
Idx=FindRGBMatch(InTex);
|
||||
if (Idx!=-1) return(Idx);
|
||||
// not working
|
||||
// Idx=FindRGBMatch(InTex);
|
||||
// if (Idx!=-1) return(Idx);
|
||||
|
||||
// Must be new, add it
|
||||
BuildTileTex(InTex);
|
||||
Tex2dList.push_back(InTex);
|
||||
return(InTex.TexID);
|
||||
// InTex.Set=SrcTile.Set;
|
||||
// InTex.Flags=Flags;
|
||||
// InTex.XOfs=SrcTile.XOfs;
|
||||
// InTex.YOfs=SrcTile.YOfs;
|
||||
|
||||
int TexID=BuildTileTex(SrcTile,Flags);
|
||||
// Tex2dList.push_back(InTex);
|
||||
return(TexID);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
int CMkLevel::BuildTileTex(sMkLevelTex &InTex)
|
||||
int CMkLevel::BuildTileTex(sExpTile &SrcTile,int Flags)
|
||||
{
|
||||
Frame &InFrame=BmpList[InTex.Set];
|
||||
Frame &InFrame=BmpList[SrcTile.Set];
|
||||
Frame ThisFrame;
|
||||
Rect ThisRect;
|
||||
GString Name=GFName(InSetNameList[InTex.Set]).File();
|
||||
GString Name=GFName(InSetNameList[SrcTile.Set]).File();
|
||||
GString TexName;
|
||||
int BmpW=InFrame.GetWidth();
|
||||
int BmpH=InFrame.GetHeight();
|
||||
|
||||
int TexID;
|
||||
TexGrab.ShrinkToFit(false);
|
||||
TexGrab.AllowRotate(false);
|
||||
|
||||
if (InTex.XOfs*16>BmpW)
|
||||
if (SrcTile.XOfs*16>BmpW)
|
||||
{
|
||||
printf("AARGH!!! %s(%i) wants X=%i,tile is only %i Wide\n",Name,InTex.Set,InTex.XOfs*16,BmpW);
|
||||
InTex.XOfs=0;
|
||||
printf("AARGH!!! %s(%i) wants X=%i,tile is only %i Wide\n",Name,SrcTile.Set,SrcTile.XOfs*16,BmpW);
|
||||
SrcTile.XOfs=0;
|
||||
}
|
||||
if (InTex.YOfs*16>BmpH)
|
||||
if (SrcTile.YOfs*16>BmpH)
|
||||
{
|
||||
printf("AARGH!!! %s(%i) wants Y=%i,tile is only %i High\n",Name,InTex.Set,InTex.YOfs*16,BmpH);
|
||||
InTex.YOfs=0;
|
||||
printf("AARGH!!! %s(%i) wants Y=%i,tile is only %i High\n",Name,SrcTile.Set,SrcTile.YOfs*16,BmpH);
|
||||
SrcTile.YOfs=0;
|
||||
}
|
||||
|
||||
MakeTexName(InTex,TexName);
|
||||
MakeTexName(SrcTile,Flags,TexName);
|
||||
|
||||
ThisRect.X=InTex.XOfs*16;
|
||||
ThisRect.Y=InTex.YOfs*16;
|
||||
ThisRect.X=SrcTile.XOfs*16;
|
||||
ThisRect.Y=SrcTile.YOfs*16;
|
||||
ThisRect.W=16;
|
||||
ThisRect.H=16;
|
||||
|
||||
ThisFrame.Grab(InFrame,ThisRect);
|
||||
|
||||
if (InTex.Flags& PC_TILE_FLAG_MIRROR_X) ThisFrame.FlipX();
|
||||
if (InTex.Flags & PC_TILE_FLAG_MIRROR_Y) ThisFrame.FlipY();
|
||||
if (Flags& PC_TILE_FLAG_MIRROR_X) ThisFrame.FlipX();
|
||||
if (Flags & PC_TILE_FLAG_MIRROR_Y) ThisFrame.FlipY();
|
||||
|
||||
InTex.TexID=TexGrab.AddMemFrame(TexName,ThisFrame);
|
||||
TexID=TexGrab.AddMemFrame(TexName,ThisFrame);
|
||||
|
||||
#ifdef _DEBUG
|
||||
if (0)
|
||||
|
@ -735,26 +738,28 @@ int BmpH=InFrame.GetHeight();
|
|||
}
|
||||
}
|
||||
#endif
|
||||
return(InTex.TexID);
|
||||
return(TexID);
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
void CMkLevel::MakeTexName(sMkLevelTex &InTex,GString &OutStr)
|
||||
void CMkLevel::MakeTexName(sExpTile &SrcTile,int Flags,GString &OutStr)
|
||||
{
|
||||
char NewName[256];
|
||||
GString Name=GFName(InSetNameList[InTex.Set]).File();
|
||||
GString Name=GFName(InSetNameList[SrcTile.Set]).File();
|
||||
|
||||
sprintf(NewName,"%s_%02d_%02d_%01d_",Name,InTex.XOfs,InTex.YOfs,InTex.Flags&PC_TILE_FLAG_MIRROR_XY);
|
||||
sprintf(NewName,"%s_%02d_%02d_%01d_",Name,SrcTile.XOfs,SrcTile.YOfs,Flags&PC_TILE_FLAG_MIRROR_XY);
|
||||
OutStr=NewName;
|
||||
}
|
||||
|
||||
//***************************************************************************
|
||||
/*
|
||||
int CMkLevel::FindRGBMatch(sMkLevelTex &ThisTex)
|
||||
{
|
||||
int i,ListSize=Tex2dList.size();
|
||||
int Size=TileW*TileH;
|
||||
u8 *RGBPtr=ThisTex.RGB;
|
||||
|
||||
if (!RGBPtr) printf("HA HA\n");
|
||||
// Create Checksum for this tile
|
||||
ThisTex.RChk=0;
|
||||
ThisTex.GChk=0;
|
||||
|
@ -765,6 +770,7 @@ u8 *RGBPtr=ThisTex.RGB;
|
|||
ThisTex.GChk+=*RGBPtr++;
|
||||
ThisTex.BChk+=*RGBPtr++;
|
||||
}
|
||||
|
||||
// Check all others for match
|
||||
for (i=0; i<ListSize; i++)
|
||||
{
|
||||
|
@ -773,15 +779,32 @@ u8 *RGBPtr=ThisTex.RGB;
|
|||
{
|
||||
// Checksum first
|
||||
if (ThisTex.RChk==ChkTex.RChk && ThisTex.GChk==ChkTex.GChk && ThisTex.BChk==ChkTex.BChk)
|
||||
{
|
||||
if (ThisTex.Flags==ChkTex.Flags)
|
||||
{
|
||||
if (IsRGBSame(ThisTex,ChkTex)) return(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return(-1);
|
||||
}
|
||||
|
||||
*/
|
||||
//***************************************************************************
|
||||
/*
|
||||
bool CMkLevel::IsRGBSame(const sMkLevelTex &Tex0,const sMkLevelTex &Tex1)
|
||||
{
|
||||
int Size=TileW*TileH*3;
|
||||
int H=TileH;
|
||||
u8 *RGB0=Tex0.RGB;
|
||||
u8 *RGB1=Tex1.RGB;
|
||||
|
||||
int Res=memcmp(RGB0,RGB1,Size);
|
||||
|
||||
return(Res==0);
|
||||
}
|
||||
*/
|
||||
/*
|
||||
bool CMkLevel::IsRGBSame(const sMkLevelTex &Tex0,const sMkLevelTex &Tex1)
|
||||
{
|
||||
int W=TileW;
|
||||
|
@ -818,6 +841,7 @@ u8 *RGB1=Tex1.RGB;
|
|||
return(true);
|
||||
}
|
||||
|
||||
*/
|
||||
//***************************************************************************
|
||||
//*** Write *****************************************************************
|
||||
//***************************************************************************
|
||||
|
@ -879,36 +903,49 @@ int i,ListSize;
|
|||
|
||||
|
||||
//***************************************************************************
|
||||
int ZMin=9999,ZMax=0;
|
||||
int CMkLevel::WriteTriList()
|
||||
{
|
||||
vector<sTri> &TriList=OutFaceList.GetOutTriList();
|
||||
vector<sVtx> const &VtxList=OutFaceList.GetVtxList();
|
||||
int ThisPos=ftell(File);
|
||||
int i,ListSize=TriList.size();
|
||||
int ZOfs=+4*Scale;
|
||||
|
||||
for (i=0;i<ListSize;i++)
|
||||
{
|
||||
sTri &T=TriList[i];
|
||||
int Z[3];
|
||||
int OtOfs=0;
|
||||
int Z[3];
|
||||
|
||||
// Calc OtOfs
|
||||
Z[0]=abs(VtxList[T.P0].vz);
|
||||
Z[1]=abs(VtxList[T.P1].vz);
|
||||
Z[2]=abs(VtxList[T.P2].vz);
|
||||
Z[0]=VtxList[T.P0].vz+ZOfs;
|
||||
Z[1]=VtxList[T.P1].vz+ZOfs;
|
||||
Z[2]=VtxList[T.P2].vz+ZOfs;
|
||||
|
||||
for (int p=0; p<3; p++)
|
||||
{
|
||||
if (OtOfs<Z[p]) OtOfs=Z[p];
|
||||
if (ZMin>Z[p]) ZMin=Z[p];
|
||||
if (ZMax<Z[p]) ZMax=Z[p];
|
||||
OtOfs+=Z[p]*Z[p];
|
||||
}
|
||||
OtOfs/=4;
|
||||
OtOfs=(int)sqrt(OtOfs/3);
|
||||
|
||||
OtOfs/=8;
|
||||
// printf("%i\n",OtOfs);
|
||||
if (MinOT>OtOfs) MinOT=OtOfs;
|
||||
if (MaxOT<OtOfs) MaxOT=OtOfs;
|
||||
if (OtOfs>15) OtOfs=15;
|
||||
if (OtOfs<0) OtOfs=0;
|
||||
|
||||
// if (OtOfs>15) OtOfs=15;
|
||||
T.OTOfs=OtOfs;
|
||||
|
||||
// Write It
|
||||
fwrite(&T,1,sizeof(sTri),File);
|
||||
}
|
||||
printf("Tri %i\n",ListSize);
|
||||
printf("ZMin %i ZMax %i\n",ZMin,ZMax);
|
||||
|
||||
return(ThisPos);
|
||||
|
||||
|
|
|
@ -123,6 +123,14 @@ SOURCE=.\Layers\MkLevelLayerFX.h
|
|||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Layers\MkLevelLayerHazard.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Layers\MkLevelLayerHazard.h
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Layers\MkLevelLayerItem.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
|
|
@ -17,13 +17,14 @@
|
|||
using namespace std;
|
||||
|
||||
//***************************************************************************
|
||||
/*
|
||||
struct sMkLevelTex
|
||||
{
|
||||
int Set;
|
||||
int XOfs,YOfs;
|
||||
u8 *RGB;
|
||||
// u8 *RGB;
|
||||
int Flags;
|
||||
int RChk,GChk,BChk;
|
||||
// int RChk,GChk,BChk;
|
||||
int TexID;
|
||||
|
||||
bool operator ==(sMkLevelTex const &v1)
|
||||
|
@ -35,7 +36,7 @@ bool operator ==(sMkLevelTex const &v1)
|
|||
return(true);
|
||||
}
|
||||
};
|
||||
|
||||
*/
|
||||
//***************************************************************************
|
||||
struct sMkLevelModel
|
||||
{
|
||||
|
@ -72,10 +73,10 @@ public:
|
|||
|
||||
int Create2dTex(int Tile,int Flags);
|
||||
int Create3dTile(sExpLayerTile &ThisTile);
|
||||
int FindRGBMatch(sMkLevelTex &ThisTex);
|
||||
bool IsRGBSame(const sMkLevelTex &Tile0,const sMkLevelTex &Tile1);
|
||||
void MakeTexName(sMkLevelTex &InTex,GString &OutStr);
|
||||
int BuildTileTex(sMkLevelTex &InTex);
|
||||
// int FindRGBMatch(sMkLevelTex &ThisTex);
|
||||
// bool IsRGBSame(const sMkLevelTex &Tile0,const sMkLevelTex &Tile1);
|
||||
void MakeTexName(sExpTile &SrcTile,int Flags,GString &OutStr);
|
||||
int BuildTileTex(sExpTile &SrcTile,int Flags);
|
||||
|
||||
char *GetConfigStr(const char *Grp,const char *Key) {return(Config.GetStr(Grp,Key));}
|
||||
CIni &GetConfig() {return(Config);}
|
||||
|
@ -137,7 +138,7 @@ protected:
|
|||
|
||||
CList<sExpLayerTile> Tile2dList;
|
||||
CList<sExpLayerTile> Tile3dList;
|
||||
CList<sMkLevelTex> Tex2dList;
|
||||
// CList<sMkLevelTex> Tex2dList;
|
||||
CTexGrab TexGrab;
|
||||
CList<Frame> BmpList;
|
||||
|
||||
|
|
|
@ -138,8 +138,6 @@ levels/CHAPTER06_LEVEL05.Tex
|
|||
|
||||
levels/FMA_SHADYSHOALS.Lvl
|
||||
levels/FMA_SHADYSHOALS.Tex
|
||||
LEVELS/FMA_SHADYEXTERIOR.Lvl
|
||||
LEVELS/FMA_SHADYEXTERIOR.Tex
|
||||
|
||||
actors/SPONGEBOB.SBK
|
||||
actors/SPONGEBOB_CORALBLOWER.SBK
|
||||
|
@ -149,6 +147,8 @@ actors/SPONGEBOB_NET.SBK
|
|||
actors/BARNACLEBOY.SBK
|
||||
actors/KRUSTY.SBK
|
||||
actors/SQUIDWARD.SBK
|
||||
actors/GARY.SBK
|
||||
actors/SANDY.SBK
|
||||
|
||||
actors/ANENOME.SBK
|
||||
actors/BABYOCTOPUS.SBK
|
||||
|
@ -169,5 +169,3 @@ actors/SKELETALFISH.SBK
|
|||
actors/SPIDERCRAB.SBK
|
||||
actors/SPIKEYANENOME.SBK
|
||||
actors/STOMPER.SBK
|
||||
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ LEVELS_CHAPTER03 := LEVEL01 LEVEL02 LEVEL03 LEVEL04
|
|||
LEVELS_CHAPTER04 := LEVEL01 LEVEL02 LEVEL03 LEVEL04
|
||||
LEVELS_CHAPTER05 := LEVEL01 LEVEL02 LEVEL03 LEVEL04
|
||||
LEVELS_CHAPTER06 := LEVEL01 LEVEL02 LEVEL03 LEVEL04 LEVEL05
|
||||
LEVELS_FMA := SHADYSHOALS SHADYEXTERIOR
|
||||
LEVELS_FMA := SHADYSHOALS
|
||||
|
||||
LEVELS_MAKEFILES := $(foreach CHAPTER,$(LEVELS_CHAPTERS),$(foreach LEVEL,$(LEVELS_$(CHAPTER)),$(LEVELS_MAKEFILE_DIR)/$(CHAPTER)_$(LEVEL).mak))
|
||||
|
||||
|
@ -108,8 +108,8 @@ ACTOR_MAKEFILE_DIR := $(TEMP_BUILD_DIR)/actor
|
|||
ACTOR_DIRS_TO_MAKE := $(ACTOR_MAKEFILE_DIR) $(ACTOR_OUT_DIR)
|
||||
|
||||
ACTOR_SPONGEBOB := SpongeBob SpongeBob_CoralBlower SpongeBob_JellyLauncher SpongeBob_Net
|
||||
ACTOR_NPC := BarnacleBoy Krusty Squidward
|
||||
# BarnacleBoy Gary Krusty MermaidMan Patrick Plankton Sandy Squidward
|
||||
ACTOR_NPC := BarnacleBoy Krusty Squidward Gary Sandy
|
||||
# MermaidMan Patrick Plankton
|
||||
|
||||
ACTOR_ENEMY := Anenome BabyOctopus Ballblob Caterpillar clam Dustdevil Eyeball \
|
||||
Flamingskull FlyingDutchman Ghost HermitCrab IronDogFish Lrgjellyfish \
|
||||
|
|
|
@ -49,10 +49,10 @@ void CNpcBallBlobEnemy::processMovement( int _frames )
|
|||
|
||||
if ( !m_animPlaying && m_frame != 0 )
|
||||
{
|
||||
m_animNo = ANIM_BALLBLOB_WOBBLE;
|
||||
m_animNo = ANIM_BALLBLOB_IDLE;
|
||||
m_frame = 0;
|
||||
}
|
||||
else if ( m_animNo == ANIM_BALLBLOB_BOUNCE )
|
||||
else if ( m_animNo == ANIM_BALLBLOB_IDLE )
|
||||
{
|
||||
moveX = 0;
|
||||
moveY = 0;
|
||||
|
@ -85,14 +85,14 @@ void CNpcBallBlobEnemy::processMovement( int _frames )
|
|||
{
|
||||
m_velocity.vy = -m_velocity.vy;
|
||||
m_animPlaying = true;
|
||||
m_animNo = ANIM_BALLBLOB_BOUNCE;
|
||||
m_animNo = ANIM_BALLBLOB_IDLE;
|
||||
m_frame = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_velocity.vy = -( 5 << 8 );
|
||||
m_animPlaying = true;
|
||||
m_animNo = ANIM_BALLBLOB_BOUNCE;
|
||||
m_animNo = ANIM_BALLBLOB_IDLE;
|
||||
m_frame = 0;
|
||||
}
|
||||
|
||||
|
@ -105,10 +105,10 @@ void CNpcBallBlobEnemy::processMovement( int _frames )
|
|||
|
||||
if ( m_npcPath.thinkFlat( Pos, &pathComplete, &waypointXDist, &waypointYDist, &waypointHeading ) )
|
||||
{
|
||||
if ( m_animNo != ANIM_BALLBLOB_BOUNCE )
|
||||
if ( m_animNo != ANIM_BALLBLOB_IDLE)
|
||||
{
|
||||
m_animPlaying = true;
|
||||
m_animNo = ANIM_BALLBLOB_WOBBLE;
|
||||
m_animNo = ANIM_BALLBLOB_IDLE;
|
||||
m_frame = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -904,7 +904,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
|
||||
{ // NPC_BALL_BLOB
|
||||
ACTORS_BALLBLOB_SBK,
|
||||
ANIM_BALLBLOB_WOBBLE,
|
||||
ANIM_BALLBLOB_IDLE,
|
||||
NPC_SENSOR_NONE,
|
||||
NPC_MOVEMENT_STATIC,
|
||||
NPC_CLOSE_NONE,
|
||||
|
@ -915,7 +915,7 @@ CNpcEnemy::NPC_DATA CNpcEnemy::m_data[NPC_UNIT_TYPE_MAX] =
|
|||
DETECT_ALL_COLLISION,
|
||||
DAMAGE__BURN_ENEMY,
|
||||
16,
|
||||
ANIM_BALLBLOB_WOBBLE,
|
||||
ANIM_BALLBLOB_IDLE,
|
||||
NPC_SHOT_GENERIC,
|
||||
0,
|
||||
0,
|
||||
|
|
|
@ -743,9 +743,9 @@ int ShiftY=(Pos.vy & 15);
|
|||
{
|
||||
P0=&ModelVtxList[TList->P0]; P1=&ModelVtxList[TList->P1]; P2=&ModelVtxList[TList->P2];
|
||||
gte_ldv3(P0,P1,P2);
|
||||
setPolyFT3(TPrimPtr);
|
||||
setShadeTex(TPrimPtr,1);
|
||||
setlen(TPrimPtr, GPU_PolyFT3Tag);
|
||||
TPrimPtr->code=TList->PolyCode;
|
||||
setRGB0(TPrimPtr,128,128,128);
|
||||
gte_rtpt_b();
|
||||
|
||||
T0=*(u32*)&TList->uv0; // Get UV0 & TPage
|
||||
|
|
|
@ -135,9 +135,9 @@ VECTOR BlkPos;
|
|||
P0=&VtxList[TList->P0]; P1=&VtxList[TList->P1]; P2=&VtxList[TList->P2];
|
||||
CMX_SetTransMtxXY(&BlkPos);
|
||||
gte_ldv3(P0,P1,P2);
|
||||
setPolyFT3(TPrimPtr);
|
||||
setShadeTex(TPrimPtr,1);
|
||||
setlen(TPrimPtr, GPU_PolyFT3Tag);
|
||||
TPrimPtr->code=TList->PolyCode;
|
||||
setRGB0(TPrimPtr,128,128,128);
|
||||
gte_rtpt_b();
|
||||
|
||||
T0=*(u32*)&TList->uv0; // Get UV0 & TPage
|
||||
|
|
Binary file not shown.
|
@ -87,7 +87,9 @@ struct sTri
|
|||
u16 TPage; // 2
|
||||
u8 uv2[2]; // 2
|
||||
u16 P2; // 2
|
||||
u32 OTOfs; // 4
|
||||
u16 OTOfs; // 2
|
||||
u8 PolyCode; // 1
|
||||
u8 Pad; // 1
|
||||
}; // 20
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
|
@ -103,7 +105,9 @@ struct sQuad
|
|||
u16 TPage; // 2
|
||||
u8 uv2[2]; // 2
|
||||
u8 uv3[2]; // 2
|
||||
u32 OTOfs; // 4
|
||||
u16 OTOfs; // 2
|
||||
u8 PolyCode; // 1
|
||||
u8 Pad; // 1
|
||||
}; // 24
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue