This commit is contained in:
parent
81bc8b99ba
commit
6662d783ce
21 changed files with 435 additions and 236 deletions
|
@ -68,10 +68,10 @@ void MgcEigen::Tridiagonal3 (real** m_aafMat, real* m_afDiag,
|
||||||
if ( fM02 != 0.0 )
|
if ( fM02 != 0.0 )
|
||||||
{
|
{
|
||||||
real fLength = (real)sqrt(fM01*fM01+fM02*fM02);
|
real fLength = (real)sqrt(fM01*fM01+fM02*fM02);
|
||||||
real fInvLength = 1.0/fLength;
|
real fInvLength = 1.0f/fLength;
|
||||||
fM01 *= fInvLength;
|
fM01 *= fInvLength;
|
||||||
fM02 *= fInvLength;
|
fM02 *= fInvLength;
|
||||||
real fQ = 2.0*fM01*fM12+fM02*(fM22-fM11);
|
real fQ = 2.0f*fM01*fM12+fM02*(fM22-fM11);
|
||||||
m_afDiag[1] = fM11+fM02*fQ;
|
m_afDiag[1] = fM11+fM02*fQ;
|
||||||
m_afDiag[2] = fM22-fM02*fQ;
|
m_afDiag[2] = fM22-fM02*fQ;
|
||||||
m_afSubd[0] = fLength;
|
m_afSubd[0] = fLength;
|
||||||
|
@ -128,7 +128,7 @@ void MgcEigen::Tridiagonal4 (real** m_aafMat, real* m_afDiag,
|
||||||
|
|
||||||
// build column Q1
|
// build column Q1
|
||||||
fLength = (real)sqrt(fM01*fM01+fM02*fM02+fM03*fM03);
|
fLength = (real)sqrt(fM01*fM01+fM02*fM02+fM03*fM03);
|
||||||
fInvLength = 1.0/fLength;
|
fInvLength = 1.0f/fLength;
|
||||||
fQ11 = fM01*fInvLength;
|
fQ11 = fM01*fInvLength;
|
||||||
fQ21 = fM02*fInvLength;
|
fQ21 = fM02*fInvLength;
|
||||||
fQ31 = fM03*fInvLength;
|
fQ31 = fM03*fInvLength;
|
||||||
|
@ -149,7 +149,7 @@ void MgcEigen::Tridiagonal4 (real** m_aafMat, real* m_afDiag,
|
||||||
fLength = (real)sqrt(fQ13*fQ13+fQ23*fQ23+fQ33*fQ33);
|
fLength = (real)sqrt(fQ13*fQ13+fQ23*fQ23+fQ33*fQ33);
|
||||||
if ( fLength > 0.0 )
|
if ( fLength > 0.0 )
|
||||||
{
|
{
|
||||||
fInvLength = 1.0/fLength;
|
fInvLength = 1.0f/fLength;
|
||||||
fQ13 *= fInvLength;
|
fQ13 *= fInvLength;
|
||||||
fQ23 *= fInvLength;
|
fQ23 *= fInvLength;
|
||||||
fQ33 *= fInvLength;
|
fQ33 *= fInvLength;
|
||||||
|
@ -179,15 +179,15 @@ void MgcEigen::Tridiagonal4 (real** m_aafMat, real* m_afDiag,
|
||||||
fLength = fQ21*fQ21+fQ31*fQ31;
|
fLength = fQ21*fQ21+fQ31*fQ31;
|
||||||
if ( fLength > 0.0 )
|
if ( fLength > 0.0 )
|
||||||
{
|
{
|
||||||
fInvLength = 1.0/fLength;
|
fInvLength = 1.0f/fLength;
|
||||||
real fTmp = fQ11-1.0;
|
real fTmp = fQ11-1.0f;
|
||||||
fQ12 = -fQ21;
|
fQ12 = -fQ21;
|
||||||
fQ22 = 1.0+fTmp*fQ21*fQ21*fInvLength;
|
fQ22 = 1.0f+fTmp*fQ21*fQ21*fInvLength;
|
||||||
fQ32 = fTmp*fQ21*fQ31*fInvLength;
|
fQ32 = fTmp*fQ21*fQ31*fInvLength;
|
||||||
|
|
||||||
fQ13 = -fQ31;
|
fQ13 = -fQ31;
|
||||||
fQ23 = fQ32;
|
fQ23 = fQ32;
|
||||||
fQ33 = 1.0+fTmp*fQ31*fQ31*fInvLength;
|
fQ33 = 1.0f+fTmp*fQ31*fQ31*fInvLength;
|
||||||
|
|
||||||
fV0 = fQ12*fM11+fQ22*fM12+fQ32*fM13;
|
fV0 = fQ12*fM11+fQ22*fM12+fQ32*fM13;
|
||||||
fV1 = fQ12*fM12+fQ22*fM22+fQ32*fM23;
|
fV1 = fQ12*fM12+fQ22*fM22+fQ32*fM23;
|
||||||
|
@ -227,10 +227,10 @@ void MgcEigen::Tridiagonal4 (real** m_aafMat, real* m_afDiag,
|
||||||
if ( fM13 != 0.0 )
|
if ( fM13 != 0.0 )
|
||||||
{
|
{
|
||||||
fLength = (real)sqrt(fM12*fM12+fM13*fM13);
|
fLength = (real)sqrt(fM12*fM12+fM13*fM13);
|
||||||
fInvLength = 1.0/fLength;
|
fInvLength = 1.0f/fLength;
|
||||||
fM12 *= fInvLength;
|
fM12 *= fInvLength;
|
||||||
fM13 *= fInvLength;
|
fM13 *= fInvLength;
|
||||||
real fQ = 2.0*fM12*fM23+fM13*(fM33-fM22);
|
real fQ = 2.0f*fM12*fM23+fM13*(fM33-fM22);
|
||||||
|
|
||||||
m_afDiag[2] = fM22+fM13*fQ;
|
m_afDiag[2] = fM22+fM13*fQ;
|
||||||
m_afDiag[3] = fM33-fM13*fQ;
|
m_afDiag[3] = fM33-fM13*fQ;
|
||||||
|
@ -271,14 +271,14 @@ void MgcEigen::TridiagonalN (int iSize, real** m_aafMat,
|
||||||
if ( i3 > 0 )
|
if ( i3 > 0 )
|
||||||
{
|
{
|
||||||
for (i2 = 0; i2 <= i3; i2++)
|
for (i2 = 0; i2 <= i3; i2++)
|
||||||
fScale += abs(m_aafMat[i0][i2]);
|
fScale += (real)fabs(m_aafMat[i0][i2]);
|
||||||
if ( fScale == 0 )
|
if ( fScale == 0 )
|
||||||
{
|
{
|
||||||
m_afSubd[i0] = m_aafMat[i0][i3];
|
m_afSubd[i0] = m_aafMat[i0][i3];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
float fInvScale = 1.0/fScale;
|
float fInvScale = 1.0f/fScale;
|
||||||
for (i2 = 0; i2 <= i3; i2++)
|
for (i2 = 0; i2 <= i3; i2++)
|
||||||
{
|
{
|
||||||
m_aafMat[i0][i2] *= fInvScale;
|
m_aafMat[i0][i2] *= fInvScale;
|
||||||
|
@ -292,7 +292,7 @@ void MgcEigen::TridiagonalN (int iSize, real** m_aafMat,
|
||||||
fH -= fF*fG;
|
fH -= fF*fG;
|
||||||
m_aafMat[i0][i3] = fF-fG;
|
m_aafMat[i0][i3] = fF-fG;
|
||||||
fF = 0.0;
|
fF = 0.0;
|
||||||
float fInvH = 1.0/fH;
|
float fInvH = 1.0f/fH;
|
||||||
for (i1 = 0; i1 <= i3; i1++)
|
for (i1 = 0; i1 <= i3; i1++)
|
||||||
{
|
{
|
||||||
m_aafMat[i1][i0] = m_aafMat[i0][i1]*fInvH;
|
m_aafMat[i1][i0] = m_aafMat[i0][i1]*fInvH;
|
||||||
|
@ -304,7 +304,7 @@ void MgcEigen::TridiagonalN (int iSize, real** m_aafMat,
|
||||||
m_afSubd[i1] = fG*fInvH;
|
m_afSubd[i1] = fG*fInvH;
|
||||||
fF += m_afSubd[i1]*m_aafMat[i0][i1];
|
fF += m_afSubd[i1]*m_aafMat[i0][i1];
|
||||||
}
|
}
|
||||||
real fHalfFdivH = 0.5*fF*fInvH;
|
real fHalfFdivH = 0.5f*fF*fInvH;
|
||||||
for (i1 = 0; i1 <= i3; i1++)
|
for (i1 = 0; i1 <= i3; i1++)
|
||||||
{
|
{
|
||||||
fF = m_aafMat[i0][i1];
|
fF = m_aafMat[i0][i1];
|
||||||
|
@ -365,15 +365,14 @@ bool MgcEigen::QLAlgorithm (int iSize, real* m_afDiag, real* m_afSubd,
|
||||||
int i2;
|
int i2;
|
||||||
for (i2 = i0; i2 <= iSize-2; i2++)
|
for (i2 = i0; i2 <= iSize-2; i2++)
|
||||||
{
|
{
|
||||||
real fTmp =
|
real fTmp = (real) (fabs(m_afDiag[i2])+fabs(m_afDiag[i2+1]));
|
||||||
abs(m_afDiag[i2])+abs(m_afDiag[i2+1]);
|
if ( fabs(m_afSubd[i2]) + fTmp == fTmp )
|
||||||
if ( abs(m_afSubd[i2]) + fTmp == fTmp )
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ( i2 == i0 )
|
if ( i2 == i0 )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
real fG = (m_afDiag[i0+1]-m_afDiag[i0])/(2.0*m_afSubd[i0]);
|
real fG = (m_afDiag[i0+1]-m_afDiag[i0])/(2.0f*m_afSubd[i0]);
|
||||||
real fR = (real)sqrt(fG*fG+1.0);
|
real fR = (real)sqrt(fG*fG+1.0);
|
||||||
if ( fG < 0.0 )
|
if ( fG < 0.0 )
|
||||||
fG = m_afDiag[i2]-m_afDiag[i0]+m_afSubd[i0]/(fG-fR);
|
fG = m_afDiag[i2]-m_afDiag[i0]+m_afSubd[i0]/(fG-fR);
|
||||||
|
@ -384,12 +383,12 @@ bool MgcEigen::QLAlgorithm (int iSize, real* m_afDiag, real* m_afSubd,
|
||||||
{
|
{
|
||||||
real fF = fSin*m_afSubd[i3];
|
real fF = fSin*m_afSubd[i3];
|
||||||
real fB = fCos*m_afSubd[i3];
|
real fB = fCos*m_afSubd[i3];
|
||||||
if ( abs(fF) >= abs(fG) )
|
if ( fabs(fF) >= fabs(fG) )
|
||||||
{
|
{
|
||||||
fCos = fG/fF;
|
fCos = fG/fF;
|
||||||
fR = (real)sqrt(fCos*fCos+1.0);
|
fR = (real)sqrt(fCos*fCos+1.0);
|
||||||
m_afSubd[i3+1] = fF*fR;
|
m_afSubd[i3+1] = fF*fR;
|
||||||
fSin = 1.0/fR;
|
fSin = 1.0f/fR;
|
||||||
fCos *= fSin;
|
fCos *= fSin;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -397,11 +396,11 @@ bool MgcEigen::QLAlgorithm (int iSize, real* m_afDiag, real* m_afSubd,
|
||||||
fSin = fF/fG;
|
fSin = fF/fG;
|
||||||
fR = (real)sqrt(fSin*fSin+1.0);
|
fR = (real)sqrt(fSin*fSin+1.0);
|
||||||
m_afSubd[i3+1] = fG*fR;
|
m_afSubd[i3+1] = fG*fR;
|
||||||
fCos = 1.0/fR;
|
fCos = 1.0f/fR;
|
||||||
fSin *= fCos;
|
fSin *= fCos;
|
||||||
}
|
}
|
||||||
fG = m_afDiag[i3+1]-fP;
|
fG = m_afDiag[i3+1]-fP;
|
||||||
fR = (m_afDiag[i3]-fG)*fSin+2.0*fB*fCos;
|
fR = (m_afDiag[i3]-fG)*fSin+2.0f*fB*fCos;
|
||||||
fP = fSin*fR;
|
fP = fSin*fR;
|
||||||
m_afDiag[i3+1] = fG+fP;
|
m_afDiag[i3+1] = fG+fP;
|
||||||
fG = fCos*fR-fB;
|
fG = fCos*fR-fB;
|
||||||
|
|
|
@ -23,8 +23,7 @@
|
||||||
#include "LayerCollision.h"
|
#include "LayerCollision.h"
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
#include "ExportAGB.h"
|
#include "Export.h"
|
||||||
#include "ExportPSX.h"
|
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
@ -53,7 +52,7 @@ int ListSize=Layer.size();
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::Init()
|
void CCore::Init()
|
||||||
{
|
{
|
||||||
UpdateParamBar();
|
// UpdateParamBar();
|
||||||
// UpdateAll(NULL);
|
// UpdateAll(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -802,33 +801,15 @@ Vector3 ThisCam=Cam;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CCore::ExportAGB(char *Filename)
|
void CCore::Export(char *Filename)
|
||||||
{
|
|
||||||
int LayerCount=Layer.size();
|
|
||||||
char ExportName[256];
|
|
||||||
|
|
||||||
SetFileExt(Filename,ExportName,"c");
|
|
||||||
|
|
||||||
CExportAGB Exp(ExportName);
|
|
||||||
|
|
||||||
for (int i=0;i<LayerCount;i++)
|
|
||||||
{
|
|
||||||
Layer[i]->Export(this,Exp);
|
|
||||||
}
|
|
||||||
Exp.ExportTiles(this);
|
|
||||||
Exp.ExportPalette();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
|
||||||
void CCore::ExportPSX(char *Filename)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
int LayerCount=Layer.size();
|
int LayerCount=Layer.size();
|
||||||
char ExportName[256];
|
char ExportName[256];
|
||||||
|
|
||||||
SetFileExt(Filename,ExportName,"PME");
|
SetFileExt(Filename,ExportName,"MEX");
|
||||||
|
|
||||||
CExportPSX Exp(ExportName,LayerCount);
|
CExport Exp(ExportName,LayerCount);
|
||||||
|
|
||||||
for (int i=0;i<LayerCount;i++)
|
for (int i=0;i<LayerCount;i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -33,8 +33,7 @@ public:
|
||||||
void Render(CMapEditView *View,BOOL ForceRender=FALSE);
|
void Render(CMapEditView *View,BOOL ForceRender=FALSE);
|
||||||
void RenderLayers(CMapEditView *View);
|
void RenderLayers(CMapEditView *View);
|
||||||
void RenderTileView(CMapEditView *View);
|
void RenderTileView(CMapEditView *View);
|
||||||
void ExportAGB(char *Filename);
|
void Export(char *Filename);
|
||||||
void ExportPSX(char *Filename);
|
|
||||||
|
|
||||||
|
|
||||||
// Control
|
// Control
|
||||||
|
|
|
@ -5,48 +5,268 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include <Vector>
|
#include <Vector>
|
||||||
|
|
||||||
#include "Core.h"
|
#include "LayerTile.h"
|
||||||
#include "TileSet.h"
|
|
||||||
#include "Map.h"
|
#include "Map.h"
|
||||||
|
|
||||||
#include "Export.h"
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
|
#include "Core.h"
|
||||||
|
#include "TexCache.h"
|
||||||
|
#include "TileSet.h"
|
||||||
|
#include "Tile.h"
|
||||||
|
|
||||||
|
#include "Layer.h"
|
||||||
|
#include "LayerTile.h"
|
||||||
|
|
||||||
|
#include "Export.h"
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
CExport::CExport(char *_Filename)
|
CExport::CExport(char *Filename,int _LayerCount)
|
||||||
{
|
{
|
||||||
Filename=_Filename;
|
LayerCount=_LayerCount;
|
||||||
|
File=fopen(Filename,"wb");
|
||||||
|
|
||||||
|
// Write Dummy File Header
|
||||||
|
|
||||||
|
fwrite(&FileHdr,sizeof(sExpFileHdr),1,File);
|
||||||
|
for (int i=0;i<LayerCount; i++) fwrite(&LayerCount,sizeof(int),1,File);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
CExport::~CExport()
|
CExport::~CExport()
|
||||||
{
|
{
|
||||||
|
ASSERT(LayerCount==LayerOfs.size());
|
||||||
|
FileHdr.LayerCount=LayerCount;
|
||||||
|
// ReWrite Main Header
|
||||||
|
fseek(File,0,0);
|
||||||
|
fwrite(&FileHdr,sizeof(sExpFileHdr),1,File);
|
||||||
|
|
||||||
|
for (int i=0;i<LayerCount; i++)
|
||||||
|
{
|
||||||
|
TRACE1("LayerOfs %i\n",LayerOfs[i]);
|
||||||
|
fwrite(&LayerOfs[i],sizeof(int),1,File);
|
||||||
|
}
|
||||||
fclose(File);
|
fclose(File);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CExport::BuildColTable(CTile &ThisTile)
|
/*** Tile Map ****************************************************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CExport::ExportLayerTile(CCore *Core,char *LayerName,int SubType,CMap &Map)
|
||||||
{
|
{
|
||||||
u8 *RGB=ThisTile.GetGBTexRGB();
|
sExpLayerHdr LayerHdr;
|
||||||
int Width=ThisTile.GetGBTexW();
|
int Width=Map.GetWidth();
|
||||||
int Height=ThisTile.GetGBTexH();
|
int Height=Map.GetHeight();
|
||||||
|
int ThisFilePos=ftell(File);
|
||||||
|
sExpMapElem BlankElem={0,0,0};
|
||||||
|
|
||||||
int X,Y;
|
TRACE1("LayerTile Ofs %i\n",ThisFilePos);
|
||||||
ColTable.resize(Width);
|
LayerOfs.push_back(ThisFilePos);
|
||||||
|
|
||||||
for (X=0; X<Width; X++)
|
LayerHdr.Type=LAYER_TYPE_TILE;
|
||||||
|
LayerHdr.SubType=SubType;
|
||||||
|
LayerHdr.Width=Map.GetWidth();
|
||||||
|
LayerHdr.Height=Map.GetHeight();
|
||||||
|
fwrite(&LayerHdr,sizeof(sExpLayerHdr),1,File);
|
||||||
|
|
||||||
|
UsedTileList.Add(BlankElem); // Ensure blank tile is present
|
||||||
|
|
||||||
|
for (int Y=0; Y<Height; Y++)
|
||||||
{
|
{
|
||||||
for (Y=Height; Y ; Y--)
|
for (int X=0; X<Width; X++)
|
||||||
{
|
{
|
||||||
int Ofs=X+((Y-1)*Width);
|
sMapElem &MapElem=Map.Get(X,Y);
|
||||||
u8 R=RGB[(Ofs*3)+0];
|
sExpMapElem TileElem;
|
||||||
u8 G=RGB[(Ofs*3)+1];
|
|
||||||
u8 B=RGB[(Ofs*3)+2];
|
TileElem.Tile=MapElem.Tile;
|
||||||
if (R==255 && G==255 && B==255) break;
|
TileElem.Set=MapElem.Set;
|
||||||
|
TileElem.Flags=MapElem.Flags;
|
||||||
|
sExpLayerTile OutElem;
|
||||||
|
OutElem.Tile=UsedTileList.Add(TileElem);
|
||||||
|
OutElem.Flags=MapElem.Flags;
|
||||||
|
fwrite(&OutElem,sizeof(sExpLayerTile),1,File);
|
||||||
}
|
}
|
||||||
ColTable[X]=Y-1;
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*** Collision Layer *********************************************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CExport::ExportLayerCollision(CCore *Core,char *LayerName,int SubType,CMap &Map)
|
||||||
|
{
|
||||||
|
sExpLayerHdr LayerHdr;
|
||||||
|
int Width=Map.GetWidth();
|
||||||
|
int Height=Map.GetHeight();
|
||||||
|
int ThisFilePos=ftell(File);
|
||||||
|
u8 OutElem;
|
||||||
|
|
||||||
|
TRACE1("LayerCollision Ofs %i\n",ThisFilePos);
|
||||||
|
LayerOfs.push_back(ThisFilePos);
|
||||||
|
|
||||||
|
LayerHdr.Type=LAYER_TYPE_COLLISION;
|
||||||
|
LayerHdr.SubType=SubType;
|
||||||
|
LayerHdr.Width=Map.GetWidth();
|
||||||
|
LayerHdr.Height=Map.GetHeight();
|
||||||
|
fwrite(&LayerHdr,sizeof(sExpLayerHdr),1,File);
|
||||||
|
|
||||||
|
for (int Y=0; Y<Height; Y++)
|
||||||
|
{
|
||||||
|
for (int X=0; X<Width; X++)
|
||||||
|
{
|
||||||
|
sMapElem &MapElem=Map.Get(X,Y);
|
||||||
|
OutElem=0;
|
||||||
|
if (MapElem.Tile)
|
||||||
|
{
|
||||||
|
OutElem=((MapElem.Tile-1)*4)+1;
|
||||||
|
OutElem+=MapElem.Flags & TILE_FLAG_MIRROR_XY;
|
||||||
|
}
|
||||||
|
fwrite(&OutElem,sizeof(u8),1,File);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*** Tiles *******************************************************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CExport::ExportTiles(CCore *Core)
|
||||||
|
{
|
||||||
|
int ListSize,i;
|
||||||
|
|
||||||
|
// Write Tiles
|
||||||
|
ListSize=UsedTileList.size();
|
||||||
|
FileHdr.TileCount=ListSize;
|
||||||
|
FileHdr.TileOfs=ftell(File);
|
||||||
|
|
||||||
|
for (i=0; i<ListSize; i++)
|
||||||
|
{
|
||||||
|
sExpMapElem &ThisElem=UsedTileList[i];
|
||||||
|
CTile &ThisTile=Core->GetTile(ThisElem.Set,ThisElem.Tile);
|
||||||
|
sExpTile OutTile;
|
||||||
|
|
||||||
|
OutTile.Flags=ThisElem.Flags;
|
||||||
|
|
||||||
|
TRACE3("%i %i %i\n",ThisElem.Set,ThisElem.Tile,ThisElem.Flags);
|
||||||
|
ExportTile(Core,ThisTile,OutTile);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Write Tris
|
||||||
|
ListSize=TriList.size();
|
||||||
|
FileHdr.TriCount=ListSize;
|
||||||
|
FileHdr.TriOfs=ftell(File);
|
||||||
|
for (i=0; i<ListSize; i++)
|
||||||
|
{
|
||||||
|
fwrite(&TriList[i],sizeof(sTriFace),1,File);
|
||||||
|
}
|
||||||
|
TRACE1("TriCount=%i\n",ListSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CExport::ExportTile(CCore *Core,CTile &ThisTile,sExpTile &OutTile)
|
||||||
|
{
|
||||||
|
int RGBW=ThisTile.GetPCTexW();
|
||||||
|
int RGBH=ThisTile.GetPCTexH();
|
||||||
|
u8 *RGB=ThisTile.GetPCTexRGB();
|
||||||
|
|
||||||
|
OutTile.W=RGBW;
|
||||||
|
OutTile.H=RGBH;
|
||||||
|
|
||||||
|
if (ThisTile.IsTile3d())
|
||||||
|
{
|
||||||
|
ExportTile3d(Core,ThisTile,OutTile);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ExportTile2d(Core,ThisTile,OutTile);
|
||||||
|
}
|
||||||
|
|
||||||
|
fwrite(&OutTile,sizeof(sExpTile),1,File);
|
||||||
|
fwrite(RGB,RGBW*RGBH*3,1,File);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CExport::ExportTile2d(CCore *Core,CTile &ThisTile,sExpTile &OutTile)
|
||||||
|
{
|
||||||
|
CTexCache &TexCache=Core->GetTexCache();
|
||||||
|
|
||||||
|
OutTile.TriStart=-1;
|
||||||
|
OutTile.TriCount=0;
|
||||||
|
OutTile.XOfs=ThisTile.GetTexXOfs();
|
||||||
|
OutTile.YOfs=ThisTile.GetTexYOfs();
|
||||||
|
|
||||||
|
// Texture
|
||||||
|
int TexID=ThisTile.GetTexID();
|
||||||
|
if (TexID==-1) // Blank Tile
|
||||||
|
{
|
||||||
|
OutTile.TexId=-1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sExpTex OutTex;
|
||||||
|
sTex &ThisTex=TexCache.GetTex(TexID);
|
||||||
|
OutTex.Filename=ThisTex.Filename;
|
||||||
|
OutTile.TexId=TexList.Add(OutTex);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CExport::ExportTile3d(CCore *Core,CTile &ThisTile,sExpTile &OutTile)
|
||||||
|
{
|
||||||
|
CTexCache &TexCache=Core->GetTexCache();
|
||||||
|
std::vector<sTriFace> &TileTriList=ThisTile.GetTriList();
|
||||||
|
|
||||||
|
int TriCount=TileTriList.size();
|
||||||
|
|
||||||
|
OutTile.TriStart=TriList.size();
|
||||||
|
OutTile.TriCount=TriCount;
|
||||||
|
OutTile.XOfs=-1;
|
||||||
|
OutTile.YOfs=-1;
|
||||||
|
OutTile.TexId=-1;
|
||||||
|
|
||||||
|
for (int T=0; T<TriCount; T++)
|
||||||
|
{
|
||||||
|
sTriFace &TileTri=TileTriList[T];
|
||||||
|
sTriFace OutTri;
|
||||||
|
sExpTex OutTex;
|
||||||
|
|
||||||
|
for (int p=0; p<3; p++)
|
||||||
|
{
|
||||||
|
OutTri=TileTri;
|
||||||
|
// Texture
|
||||||
|
sTex &TriTex=TexCache.GetTex(TileTri.Mat);
|
||||||
|
OutTex.Filename=TriTex.Filename;
|
||||||
|
OutTri.Mat=TexList.Add(OutTex);
|
||||||
|
}
|
||||||
|
TriList.push_back(OutTri);
|
||||||
|
}
|
||||||
|
// return(TriCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*** Textures ****************************************************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
void CExport::ExportTexList(CCore *Core)
|
||||||
|
{
|
||||||
|
int TexCount=TexList.size();
|
||||||
|
|
||||||
|
FileHdr.TexCount=TexCount;
|
||||||
|
FileHdr.TexOfs=ftell(File);
|
||||||
|
|
||||||
|
for (int i=0; i<TexCount; i++)
|
||||||
|
{
|
||||||
|
sExpTex &ThisTex=TexList[i];
|
||||||
|
char TexFilename[256];
|
||||||
|
|
||||||
|
MakePathRel2App(ThisTex.Filename,TexFilename);
|
||||||
|
|
||||||
|
int Len=strlen(TexFilename);
|
||||||
|
fwrite(TexFilename,Len+1,1,File);
|
||||||
|
TRACE2("%i:\t%s\n",i,TexFilename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
|
|
@ -6,42 +6,51 @@
|
||||||
#define __EXPORT_HEADER__
|
#define __EXPORT_HEADER__
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
#include <Vector>
|
|
||||||
#include <GFName.hpp>
|
|
||||||
#include "mapedit.h"
|
#include "mapedit.h"
|
||||||
|
#include <Vector>
|
||||||
|
//#include "GinTex.h"
|
||||||
|
//#include "Tile.h"
|
||||||
|
|
||||||
#include "Quantize.h"
|
#include <List.h>
|
||||||
#include <list.h>
|
#include "ExportHdr.h"
|
||||||
|
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
class CCore;
|
class CCore;
|
||||||
class CMap;
|
class CMap;
|
||||||
|
|
||||||
class CTile;
|
class CTile;
|
||||||
|
|
||||||
class CExport
|
class CExport
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CExport(char *Filename);
|
CExport(char *Filename,int LayerCount);
|
||||||
~CExport();
|
~CExport();
|
||||||
|
|
||||||
virtual void ExportLayerTile(CCore *Core,char *LayerName,int SubType,CMap &Map)=0;
|
void ExportLayerTile(CCore *Core,char *LayerName,int SubType,CMap &Map);
|
||||||
virtual void ExportLayerCollision(CCore *Core,char *LayerName,int SubType,CMap &Map)=0;
|
void ExportLayerCollision(CCore *Core,char *LayerName,int SubType,CMap &Map);
|
||||||
|
|
||||||
virtual void ExportTiles(CCore *Core)=0;
|
void ExportTiles(CCore *Core);
|
||||||
|
void ExportTexList(CCore *Core);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void BuildColTable(CTile &ThisTile);
|
void ExportTile(CCore *Core,CTile &ThisTile,sExpTile &OutTile);
|
||||||
|
void ExportTile3d(CCore *Core,CTile &ThisTile,sExpTile &OutTile);
|
||||||
|
void ExportTile2d(CCore *Core,CTile &ThisTile,sExpTile &OutTile);
|
||||||
|
|
||||||
GFName Filename;
|
sExpFileHdr FileHdr;
|
||||||
|
|
||||||
|
int LayerCount;
|
||||||
|
CList<int> LayerOfs;
|
||||||
|
|
||||||
|
CList<sTriFace> TriList;
|
||||||
|
CList<sExpTex> TexList;
|
||||||
|
|
||||||
|
CList<sExpMapElem> UsedTileList;
|
||||||
|
|
||||||
|
// GString Filename;
|
||||||
FILE *File;
|
FILE *File;
|
||||||
int Count;
|
// int Count;
|
||||||
|
|
||||||
std::vector<int> ColTable;
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -14,9 +14,8 @@
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
struct sExpFileHdr
|
struct sExpFileHdr
|
||||||
{
|
{
|
||||||
int Version;
|
|
||||||
int TileCount;
|
int TileCount;
|
||||||
int TileW,TileH;
|
// int TileW,TileH;
|
||||||
int TileOfs;
|
int TileOfs;
|
||||||
int TriCount;
|
int TriCount;
|
||||||
int TriOfs;
|
int TriOfs;
|
||||||
|
@ -35,6 +34,7 @@ struct sExpTile // 2d 3d
|
||||||
int TexId; // n -1
|
int TexId; // n -1
|
||||||
int Flags;
|
int Flags;
|
||||||
int W,H;
|
int W,H;
|
||||||
|
u8 *RGB; // Used in MkLevel
|
||||||
};
|
};
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
|
@ -19,27 +19,27 @@ Class7=CMapEditView
|
||||||
|
|
||||||
ResourceCount=13
|
ResourceCount=13
|
||||||
Resource1=IDD_NEW_LAYER
|
Resource1=IDD_NEW_LAYER
|
||||||
Resource2=IDR_TOOLBAR (English (U.S.))
|
Resource2=IDR_MAPEDITYPE (English (U.S.))
|
||||||
Resource3=IDD_ABOUTBOX (English (U.S.))
|
Resource3=IDR_MAINFRAME (English (U.S.))
|
||||||
Resource4=IDD_DIALOGBAR (English (U.S.))
|
Resource4=IDD_DIALOGBAR (English (U.S.))
|
||||||
Resource5=IDD_MAPSIZE
|
Resource5=IDD_LAYER_LIST_DIALOG
|
||||||
Class8=CMultiBar
|
Class8=CMultiBar
|
||||||
Resource6=IDD_LAYERTILE_GUI
|
Resource6=IDD_ADDLAYER
|
||||||
Resource7=IDD_ADDLAYER
|
Resource7=IDD_NEWMAP
|
||||||
Class9=CLayerList
|
Class9=CLayerList
|
||||||
Class10=CMapSizeDlg
|
Class10=CMapSizeDlg
|
||||||
Resource8=IDR_MAINFRAME (English (U.S.))
|
Resource8=IDD_LAYERTILE_TOOLBAR
|
||||||
Class11=CGfxToolBar
|
Class11=CGfxToolBar
|
||||||
Class12=CLayerTileGUI
|
Class12=CLayerTileGUI
|
||||||
Resource9=IDD_LAYER_LIST_DIALOG
|
Resource9=IDD_MULTIBAR (English (U.S.))
|
||||||
Resource10=IDD_NEWMAP
|
Resource10=IDD_MAPSIZE
|
||||||
Class13=CNewMapGUI
|
Class13=CNewMapGUI
|
||||||
Class14=CProgressDlg
|
Class14=CProgressDlg
|
||||||
Resource11=IDD_MULTIBAR (English (U.S.))
|
Resource11=IDD_ABOUTBOX (English (U.S.))
|
||||||
Class15=CAddLayerDlg
|
Class15=CAddLayerDlg
|
||||||
Resource12=IDD_LAYERTILE_TOOLBAR
|
Resource12=IDD_LAYERTILE_GUI
|
||||||
Class16=CLayerTileToolbar
|
Class16=CLayerTileToolbar
|
||||||
Resource13=IDR_MAPEDITYPE (English (U.S.))
|
Resource13=IDR_TOOLBAR (English (U.S.))
|
||||||
|
|
||||||
[CLS:CChildFrame]
|
[CLS:CChildFrame]
|
||||||
Type=0
|
Type=0
|
||||||
|
@ -91,7 +91,7 @@ Type=0
|
||||||
BaseClass=CGLEnabledView
|
BaseClass=CGLEnabledView
|
||||||
HeaderFile=MapEditView.h
|
HeaderFile=MapEditView.h
|
||||||
ImplementationFile=MapEditView.cpp
|
ImplementationFile=MapEditView.cpp
|
||||||
LastObject=ID_EXPORT_PSX
|
LastObject=ID_EXPORT
|
||||||
Filter=C
|
Filter=C
|
||||||
VirtualFilter=VWC
|
VirtualFilter=VWC
|
||||||
|
|
||||||
|
@ -130,34 +130,33 @@ Class=?
|
||||||
Command1=ID_FILE_NEW
|
Command1=ID_FILE_NEW
|
||||||
Command2=ID_FILE_OPEN
|
Command2=ID_FILE_OPEN
|
||||||
Command3=ID_FILE_CLOSE
|
Command3=ID_FILE_CLOSE
|
||||||
Command4=ID_FILE_SAVEx
|
Command4=ID_FILE_SAVE
|
||||||
Command5=ID_FILE_SAVE_ASx
|
Command5=ID_FILE_SAVE_AS
|
||||||
Command6=ID_EXPORT_AGB
|
Command6=ID_EXPORT
|
||||||
Command7=ID_EXPORT_PSX
|
Command7=ID_FILE_MRU_FILE1
|
||||||
Command8=ID_FILE_MRU_FILE1
|
Command8=ID_APP_EXIT
|
||||||
Command9=ID_APP_EXIT
|
Command9=ID_EDIT_UNDO
|
||||||
Command10=ID_EDIT_UNDO
|
Command10=ID_EDIT_CUT
|
||||||
Command11=ID_EDIT_CUT
|
Command11=ID_EDIT_COPY
|
||||||
Command12=ID_EDIT_COPY
|
Command12=ID_EDIT_PASTE
|
||||||
Command13=ID_EDIT_PASTE
|
Command13=ID_VIEW_TOOLBAR
|
||||||
Command14=ID_VIEW_TOOLBAR
|
Command14=ID_VIEW_STATUS_BAR
|
||||||
Command15=ID_VIEW_STATUS_BAR
|
Command15=ID_MAP_SETSIZE
|
||||||
Command16=ID_MAP_SETSIZE
|
Command16=ID_TOGGLE_GRID
|
||||||
Command17=ID_TOGGLE_GRID
|
Command17=ID_ZOOM_IN
|
||||||
Command18=ID_ZOOM_IN
|
Command18=ID_ZOOM_OUT
|
||||||
Command19=ID_ZOOM_OUT
|
Command19=ID_MIRRORX
|
||||||
Command20=ID_MIRRORX
|
Command20=ID_MIRRORY
|
||||||
Command21=ID_MIRRORY
|
Command21=ID_ACTIVEBRUSH_LEFT
|
||||||
Command22=ID_ACTIVEBRUSH_LEFT
|
Command22=ID_ACTIVEBRUSH_RIGHT
|
||||||
Command23=ID_ACTIVEBRUSH_RIGHT
|
Command23=ID_TOGGLE_TILEVIEW
|
||||||
Command24=ID_TOGGLE_TILEVIEW
|
Command24=ID_2D_3D_TOGGLE
|
||||||
Command25=ID_2D_3D_TOGGLE
|
Command25=ID_WINDOW_NEW
|
||||||
Command26=ID_WINDOW_NEW
|
Command26=ID_WINDOW_CASCADE
|
||||||
Command27=ID_WINDOW_CASCADE
|
Command27=ID_WINDOW_TILE_HORZ
|
||||||
Command28=ID_WINDOW_TILE_HORZ
|
Command28=ID_WINDOW_ARRANGE
|
||||||
Command29=ID_WINDOW_ARRANGE
|
Command29=ID_APP_ABOUT
|
||||||
Command30=ID_APP_ABOUT
|
CommandCount=29
|
||||||
CommandCount=30
|
|
||||||
|
|
||||||
[ACL:IDR_MAINFRAME (English (U.S.))]
|
[ACL:IDR_MAINFRAME (English (U.S.))]
|
||||||
Type=1
|
Type=1
|
||||||
|
|
|
@ -135,31 +135,7 @@ SOURCE=.\Export.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\ExportAGB.cpp
|
SOURCE=.\ExportHdr.h
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\ExportAGB.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\ExportPSX.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\ExportPSX.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\ExportPSXHdr.h
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\Quantize.cpp
|
|
||||||
# End Source File
|
|
||||||
# Begin Source File
|
|
||||||
|
|
||||||
SOURCE=.\Quantize.h
|
|
||||||
# End Source File
|
# End Source File
|
||||||
# End Group
|
# End Group
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
|
@ -95,8 +95,7 @@ BEGIN
|
||||||
MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE
|
MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE
|
||||||
MENUITEM "Save &As...", ID_FILE_SAVE_AS
|
MENUITEM "Save &As...", ID_FILE_SAVE_AS
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Export AGB", ID_EXPORT_AGB
|
MENUITEM "Export ", ID_EXPORT
|
||||||
MENUITEM "Export PSX", ID_EXPORT_PSX
|
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
|
MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
|
||||||
MENUITEM SEPARATOR
|
MENUITEM SEPARATOR
|
||||||
|
@ -208,7 +207,7 @@ END
|
||||||
IDD_MULTIBAR DIALOGEX 0, 0, 156, 71
|
IDD_MULTIBAR DIALOGEX 0, 0, 156, 71
|
||||||
STYLE WS_CHILD
|
STYLE WS_CHILD
|
||||||
EXSTYLE WS_EX_TOOLWINDOW
|
EXSTYLE WS_EX_TOOLWINDOW
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
END
|
END
|
||||||
|
|
||||||
|
@ -504,7 +503,7 @@ END
|
||||||
IDD_ADDLAYER DIALOGEX 0, 0, 118, 90
|
IDD_ADDLAYER DIALOGEX 0, 0, 118, 90
|
||||||
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
|
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
|
||||||
CAPTION "Select Layer To Add."
|
CAPTION "Select Layer To Add."
|
||||||
FONT 8, "MS Sans Serif"
|
FONT 8, "MS Sans Serif", 0, 0, 0x1
|
||||||
BEGIN
|
BEGIN
|
||||||
DEFPUSHBUTTON "OK",IDOK,60,75,50,14
|
DEFPUSHBUTTON "OK",IDOK,60,75,50,14
|
||||||
PUSHBUTTON "Cancel",IDCANCEL,5,75,50,14
|
PUSHBUTTON "Cancel",IDCANCEL,5,75,50,14
|
||||||
|
|
|
@ -21,8 +21,7 @@ IMPLEMENT_DYNCREATE(CMapEditDoc, CDocument)
|
||||||
BEGIN_MESSAGE_MAP(CMapEditDoc, CDocument)
|
BEGIN_MESSAGE_MAP(CMapEditDoc, CDocument)
|
||||||
//{{AFX_MSG_MAP(CMapEditDoc)
|
//{{AFX_MSG_MAP(CMapEditDoc)
|
||||||
ON_UPDATE_COMMAND_UI(ID_INDICATOR_CURSORXY, OnStatusCursorXY)
|
ON_UPDATE_COMMAND_UI(ID_INDICATOR_CURSORXY, OnStatusCursorXY)
|
||||||
ON_COMMAND(ID_EXPORT_AGB, OnExportAgb)
|
ON_COMMAND(ID_EXPORT, OnExport)
|
||||||
ON_COMMAND(ID_EXPORT_PSX, OnExportPsx)
|
|
||||||
ON_COMMAND(ID_ZOOM_IN, OnZoomIn)
|
ON_COMMAND(ID_ZOOM_IN, OnZoomIn)
|
||||||
ON_COMMAND(ID_ZOOM_OUT, OnZoomOut)
|
ON_COMMAND(ID_ZOOM_OUT, OnZoomOut)
|
||||||
//}}AFX_MSG_MAP
|
//}}AFX_MSG_MAP
|
||||||
|
@ -237,32 +236,17 @@ void CMapEditDoc::DeleteLayer(int Layer)
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
void CMapEditDoc::OnExportAgb()
|
void CMapEditDoc::OnExport()
|
||||||
{
|
{
|
||||||
char BASED_CODE Filter[]= "AGB Data Type (*.c)|*.c|All Files (*.*)|*.*||";
|
char BASED_CODE Filter[]= "Export Data Type (*.MEX)|*.MEX|All Files (*.*)|*.*||";
|
||||||
CFileDialog Dlg(FALSE,"*.c",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,Filter);
|
CFileDialog Dlg(FALSE,"*.MEX",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,Filter);
|
||||||
|
|
||||||
if (Dlg.DoModal()!=IDOK) return;
|
if (Dlg.DoModal()!=IDOK) return;
|
||||||
|
|
||||||
char Filename[256];
|
char Filename[256];
|
||||||
sprintf(Filename,"%s",Dlg.GetPathName());
|
sprintf(Filename,"%s",Dlg.GetPathName());
|
||||||
|
|
||||||
|
Core.Export(Filename);
|
||||||
Core.ExportAGB(Filename);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*********************************************************************************/
|
|
||||||
void CMapEditDoc::OnExportPsx()
|
|
||||||
{
|
|
||||||
char BASED_CODE Filter[]= "PSX Data Type (*.PME)|*.Pme|All Files (*.*)|*.*||";
|
|
||||||
CFileDialog Dlg(FALSE,"*.pme",NULL,OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT,Filter);
|
|
||||||
|
|
||||||
if (Dlg.DoModal()!=IDOK) return;
|
|
||||||
|
|
||||||
char Filename[256];
|
|
||||||
sprintf(Filename,"%s",Dlg.GetPathName());
|
|
||||||
|
|
||||||
Core.ExportPSX(Filename);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*********************************************************************************/
|
/*********************************************************************************/
|
||||||
|
|
|
@ -79,8 +79,7 @@ protected:
|
||||||
protected:
|
protected:
|
||||||
//{{AFX_MSG(CMapEditDoc)
|
//{{AFX_MSG(CMapEditDoc)
|
||||||
afx_msg void OnStatusCursorXY(CCmdUI *pCmdUI);
|
afx_msg void OnStatusCursorXY(CCmdUI *pCmdUI);
|
||||||
afx_msg void OnExportAgb();
|
afx_msg void OnExport();
|
||||||
afx_msg void OnExportPsx();
|
|
||||||
afx_msg void OnZoomIn();
|
afx_msg void OnZoomIn();
|
||||||
afx_msg void OnZoomOut();
|
afx_msg void OnZoomOut();
|
||||||
//}}AFX_MSG
|
//}}AFX_MSG
|
||||||
|
|
|
@ -24,7 +24,7 @@ sTex Tex;
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
// Checks loaded files for dups, assumes all passed RGB is unique
|
// Checks loaded files for dups, assumes all passed RGB is unique
|
||||||
int CTexCache::ProcessTexture(char *Filename,int Flags,sRGBData *RGBData)
|
int CTexCache::ProcessTexture(const char *Filename,int Flags,sRGBData *RGBData)
|
||||||
{
|
{
|
||||||
int ListSize=TexList.size();
|
int ListSize=TexList.size();
|
||||||
|
|
||||||
|
|
|
@ -43,7 +43,7 @@ public:
|
||||||
int GetTexIdx(sTex &Tex) {return(TexList.Find(Tex));}
|
int GetTexIdx(sTex &Tex) {return(TexList.Find(Tex));}
|
||||||
int GetTexIdx(char *Filename,int Flags);
|
int GetTexIdx(char *Filename,int Flags);
|
||||||
|
|
||||||
int ProcessTexture(char *Path,int Flags,sRGBData *RGBData=0);
|
int ProcessTexture(const char *Filename,int Flags,sRGBData *RGBData=0);
|
||||||
void Purge();
|
void Purge();
|
||||||
|
|
||||||
bool LoadBMP(char *Filename,sRGBData &RGBData);
|
bool LoadBMP(char *Filename,sRGBData &RGBData);
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <gl\glu.h>
|
#include <gl\glu.h>
|
||||||
#include "GLEnabledView.h"
|
#include "GLEnabledView.h"
|
||||||
#include <Vector>
|
#include <Vector>
|
||||||
//#include <direct.h>
|
|
||||||
#include <GFName.hpp>
|
#include <GFName.hpp>
|
||||||
|
|
||||||
#include "Core.h"
|
#include "Core.h"
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
#include "LayerTileGui.h"
|
#include "LayerTileGui.h"
|
||||||
|
|
||||||
// Reserve slot 0 for collision :o)
|
// Reserve slot 0 for collision :o)
|
||||||
char *ColFName="Collision.bmp";
|
GString ColFName="Collision.bmp";
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** TileBank ****************************************************************/
|
/*** TileBank ****************************************************************/
|
||||||
|
@ -124,7 +124,7 @@ GString FilePath;
|
||||||
// New Style rel storage
|
// New Style rel storage
|
||||||
for (int i=0;i<ListSize;i++)
|
for (int i=0;i<ListSize;i++)
|
||||||
{
|
{
|
||||||
char c=1,FullName[256+64];
|
char c=1;//,FullName[256+64];
|
||||||
GString RelName;
|
GString RelName;
|
||||||
int Len=0;
|
int Len=0;
|
||||||
while (c)
|
while (c)
|
||||||
|
@ -132,14 +132,14 @@ GString FilePath;
|
||||||
File->Read(&c,1);
|
File->Read(&c,1);
|
||||||
RelName.Append(c);
|
RelName.Append(c);
|
||||||
}
|
}
|
||||||
RelName.Upper();
|
// RelName.Upper();
|
||||||
|
|
||||||
{ // Dodgy arse artist fix
|
{ // Dodgy arse artist fix
|
||||||
RelName=FixName(RelName);
|
// RelName=FixName(RelName);
|
||||||
}
|
}
|
||||||
|
|
||||||
RootPath.makeabsolute(FilePath,RelName,FullName);
|
// RootPath.makeabsolute(FilePath,RelName,FullName);
|
||||||
AddTileSet(FullName);
|
AddTileSet(RelName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,13 +398,14 @@ BOOL CTileBank::IsTileValid(int Set,int Tile)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
/*
|
||||||
BOOL CTileBank::IsTileValidGB(int Set,int Tile)
|
BOOL CTileBank::IsTileValidGB(int Set,int Tile)
|
||||||
{
|
{
|
||||||
if (Set<0 || Tile<0) return(FALSE);
|
if (Set<0 || Tile<0) return(FALSE);
|
||||||
|
|
||||||
return(TileSet[Set].IsTileValidGB(Tile));
|
return(TileSet[Set].IsTileValidGB(Tile));
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/*** TileSet *****************************************************************/
|
/*** TileSet *****************************************************************/
|
||||||
|
@ -412,7 +413,10 @@ BOOL CTileBank::IsTileValidGB(int Set,int Tile)
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
CTileSet::CTileSet(const char *_Filename,int Idx)
|
CTileSet::CTileSet(const char *_Filename,int Idx)
|
||||||
{
|
{
|
||||||
Filename=_Filename;
|
if (_Filename)
|
||||||
|
{
|
||||||
|
Filename=_Filename;
|
||||||
|
}
|
||||||
|
|
||||||
Loaded=FALSE;
|
Loaded=FALSE;
|
||||||
SetNumber=Idx;
|
SetNumber=Idx;
|
||||||
|
@ -450,8 +454,22 @@ GString Ext=Filename.Ext();
|
||||||
void CTileSet::Load2d(CCore *Core)
|
void CTileSet::Load2d(CCore *Core)
|
||||||
{
|
{
|
||||||
CTexCache &TexCache=Core->GetTexCache();
|
CTexCache &TexCache=Core->GetTexCache();
|
||||||
|
GString FullFilename;
|
||||||
|
GString ColTest;
|
||||||
|
ColTest=Filename.File();
|
||||||
|
ColTest.Append('.');
|
||||||
|
ColTest+=Filename.Ext();
|
||||||
|
|
||||||
int TexID=TexCache.ProcessTexture((char*)Filename.FullName(),0);
|
if (ColTest==ColFName)
|
||||||
|
{// Collision thing (sigh!)
|
||||||
|
FullFilename=Filename.FullName();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
MakeFullFilename(Filename.FullName(),FullFilename);
|
||||||
|
}
|
||||||
|
|
||||||
|
int TexID=TexCache.ProcessTexture(FullFilename,0);
|
||||||
sTex &ThisTex=TexCache.GetTex(TexID);
|
sTex &ThisTex=TexCache.GetTex(TexID);
|
||||||
|
|
||||||
int Width=ThisTex.TexWidth/16;
|
int Width=ThisTex.TexWidth/16;
|
||||||
|
@ -475,8 +493,11 @@ int Height=ThisTex.TexHeight/16;
|
||||||
void CTileSet::Load3d(CCore *Core)
|
void CTileSet::Load3d(CCore *Core)
|
||||||
{
|
{
|
||||||
CScene Scene;
|
CScene Scene;
|
||||||
|
GString FullFilename;
|
||||||
|
|
||||||
Scene.Load(Filename.FullName());
|
MakeFullFilename(Filename.FullName(),FullFilename);
|
||||||
|
|
||||||
|
Scene.Load(FullFilename);
|
||||||
|
|
||||||
CNode &ThisNode=Scene.GetSceneNode(0);
|
CNode &ThisNode=Scene.GetSceneNode(0);
|
||||||
int ChildCount=ThisNode.GetPruneChildCount();
|
int ChildCount=ThisNode.GetPruneChildCount();
|
||||||
|
@ -524,6 +545,7 @@ BOOL CTileSet::IsTileValid(int No)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
/*
|
||||||
BOOL CTileSet::IsTileValidGB(int No)
|
BOOL CTileSet::IsTileValidGB(int No)
|
||||||
{
|
{
|
||||||
// ASSERT(No<Tile.size());
|
// ASSERT(No<Tile.size());
|
||||||
|
@ -531,7 +553,7 @@ BOOL CTileSet::IsTileValidGB(int No)
|
||||||
|
|
||||||
return(Tile[No].IsValidGB());
|
return(Tile[No].IsValidGB());
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
void CTileSet::Render(CCore *Core,Vector3 &CamPos,CMap &LBrush,CMap &RBrush,BOOL Render3d)
|
void CTileSet::Render(CCore *Core,Vector3 &CamPos,CMap &LBrush,CMap &RBrush,BOOL Render3d)
|
||||||
{
|
{
|
||||||
|
|
|
@ -64,7 +64,7 @@ public:
|
||||||
void UpdateGUI(CCore *Core,BOOL IsTileView);
|
void UpdateGUI(CCore *Core,BOOL IsTileView);
|
||||||
|
|
||||||
BOOL IsTileValid(int Set,int Tile);
|
BOOL IsTileValid(int Set,int Tile);
|
||||||
BOOL IsTileValidGB(int Set,int Tile);
|
// BOOL IsTileValidGB(int Set,int Tile);
|
||||||
|
|
||||||
void SetCollision(bool f);
|
void SetCollision(bool f);
|
||||||
CTileSet &GetSet(int Set) {return(TileSet[Set]);}
|
CTileSet &GetSet(int Set) {return(TileSet[Set]);}
|
||||||
|
@ -109,11 +109,14 @@ public:
|
||||||
void Load2d(CCore *Core);
|
void Load2d(CCore *Core);
|
||||||
void Load3d(CCore *Core);
|
void Load3d(CCore *Core);
|
||||||
|
|
||||||
const char *GetDrive() {return(Filename.Drive());}
|
// const char *GetDrive() {return(Filename.Drive());}
|
||||||
const char *GetPath() {return(Filename.Dir());}
|
// const char *GetPath() {return(Filename.Dir());}
|
||||||
const char *GetName() {return(Filename.File());}
|
// const char *GetName() {return(Filename.File());}
|
||||||
const char *GetExt() {return(Filename.Ext());}
|
// const char *GetExt() {return(Filename.Ext());}
|
||||||
|
// const char *GetFilename() {return(Filename.FullName());}
|
||||||
|
|
||||||
const char *GetFilename() {return(Filename.FullName());}
|
const char *GetFilename() {return(Filename.FullName());}
|
||||||
|
const char *GetName() {return(Filename.File());}
|
||||||
|
|
||||||
CTile &GetTile(int No) {return(Tile[No]);}
|
CTile &GetTile(int No) {return(Tile[No]);}
|
||||||
void Purge();
|
void Purge();
|
||||||
|
@ -124,7 +127,7 @@ public:
|
||||||
void RenderGrid(Vector3 &CamPos);
|
void RenderGrid(Vector3 &CamPos);
|
||||||
int GetTileBrowserWidth() {return(TileBrowserWidth);}
|
int GetTileBrowserWidth() {return(TileBrowserWidth);}
|
||||||
BOOL IsTileValid(int No);
|
BOOL IsTileValid(int No);
|
||||||
BOOL IsTileValidGB(int No);
|
// BOOL IsTileValidGB(int No);
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -132,6 +135,7 @@ private:
|
||||||
CPoint GetTilePos(int ID);
|
CPoint GetTilePos(int ID);
|
||||||
|
|
||||||
GFName Filename;
|
GFName Filename;
|
||||||
|
|
||||||
int SetNumber;
|
int SetNumber;
|
||||||
CList<CTile> Tile;
|
CList<CTile> Tile;
|
||||||
BOOL Loaded;
|
BOOL Loaded;
|
||||||
|
|
|
@ -46,8 +46,7 @@
|
||||||
#define ID_ACTIVEBRUSH_RIGHT 32791
|
#define ID_ACTIVEBRUSH_RIGHT 32791
|
||||||
#define ID_MAP_SETSIZE 32792
|
#define ID_MAP_SETSIZE 32792
|
||||||
#define ID_2D_3D_TOGGLE 32794
|
#define ID_2D_3D_TOGGLE 32794
|
||||||
#define ID_EXPORT_AGB 32795
|
#define ID_EXPORT 32795
|
||||||
#define ID_EXPORT_PSX 32796
|
|
||||||
#define ID_ZOOM_IN 32797
|
#define ID_ZOOM_IN 32797
|
||||||
#define ID_ZOOM_OUT 32798
|
#define ID_ZOOM_OUT 32798
|
||||||
#define ID_INDICATOR_CURSORXY 59142
|
#define ID_INDICATOR_CURSORXY 59142
|
||||||
|
|
|
@ -3,12 +3,17 @@
|
||||||
/*************/
|
/*************/
|
||||||
|
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
#include "MapEdit.h"
|
||||||
|
#include "MapEditDoc.h"
|
||||||
|
|
||||||
#include <Vector3.h>
|
#include <Vector3.h>
|
||||||
#include <gl\gl.h>
|
#include <gl\gl.h>
|
||||||
#include <gl\glu.h>
|
#include <gl\glu.h>
|
||||||
#include "GLEnabledView.h"
|
#include "GLEnabledView.h"
|
||||||
|
|
||||||
|
#include <Misc.hpp>
|
||||||
|
#include <GFName.hpp>
|
||||||
|
|
||||||
#include "Utils.H"
|
#include "Utils.H"
|
||||||
|
|
||||||
/**************************************************************************************/
|
/**************************************************************************************/
|
||||||
|
@ -249,3 +254,27 @@ char Name[_MAX_FNAME];
|
||||||
sprintf(OutName,"%s%s%s.%s",Drive,Path,Name,Ext);
|
sprintf(OutName,"%s%s%s.%s",Drive,Path,Name,Ext);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**************************************************************************************/
|
||||||
|
void MakeFullFilename(const char* In,GString &Out)
|
||||||
|
{
|
||||||
|
GFName FName=theApp.GetCurrent()->GetPathName();
|
||||||
|
GString Path;
|
||||||
|
|
||||||
|
Path=FName.Drive();
|
||||||
|
Path+=FName.Dir();
|
||||||
|
Path.Append('\\');
|
||||||
|
|
||||||
|
Out=Path;
|
||||||
|
Out+=In;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**************************************************************************************/
|
||||||
|
void MakePathRel2App(const char* In,char *Out)
|
||||||
|
{
|
||||||
|
GString RootPath=theApp.GetCurrent()->GetPathName();
|
||||||
|
|
||||||
|
GFName::makerelative(RootPath,In,Out);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@ typedef u32 U32;
|
||||||
//typedef u64 U64;
|
//typedef u64 U64;
|
||||||
|
|
||||||
/**************************************************************************************/
|
/**************************************************************************************/
|
||||||
|
class GString;
|
||||||
void DbgMsg(const char * pszFmt,...);
|
void DbgMsg(const char * pszFmt,...);
|
||||||
|
|
||||||
void BuildGLBox(float XMin,float XMax,float YMin,float YMax,float ZMin,float ZMax);
|
void BuildGLBox(float XMin,float XMax,float YMin,float YMax,float ZMin,float ZMax);
|
||||||
|
@ -48,4 +49,7 @@ void BGR2RGB(int W,int H,u8 *Data);
|
||||||
|
|
||||||
void SetFileExt(char *InName,char *OutName,char *Ext);
|
void SetFileExt(char *InName,char *OutName,char *Ext);
|
||||||
|
|
||||||
|
void MakeFullFilename(const char *RelName,GString &Out);
|
||||||
|
void MakePathRel2App(const char* In,char *Out);
|
||||||
|
|
||||||
#endif
|
#endif
|
|
@ -36,6 +36,9 @@ int Count,i;
|
||||||
case 'o':
|
case 'o':
|
||||||
OutStr = CheckFileString(String);
|
OutStr = CheckFileString(String);
|
||||||
break;
|
break;
|
||||||
|
case 'i':
|
||||||
|
IncludeFile = CheckFileString(String);
|
||||||
|
break;
|
||||||
case 'd':
|
case 'd':
|
||||||
DebugOn =true;
|
DebugOn =true;
|
||||||
break;
|
break;
|
||||||
|
@ -102,7 +105,6 @@ GFName File=In;
|
||||||
Name=File.File();
|
Name=File.File();
|
||||||
// Create Out Filename from inFilename and outdir
|
// Create Out Filename from inFilename and outdir
|
||||||
OutFile=OutDir+File.File();
|
OutFile=OutDir+File.File();
|
||||||
// OutFile+=File.File();
|
|
||||||
|
|
||||||
TPageBase=TPBase;
|
TPageBase=TPBase;
|
||||||
TPageWidth=TPW ;
|
TPageWidth=TPW ;
|
||||||
|
@ -124,10 +126,6 @@ void CMkActor3d::BuildBoneOut(sBone &OutBone,CNode const &InNode,int ParentBo
|
||||||
OutBone.BoneSize.vx =round(InNode.Pos.x*Scale);
|
OutBone.BoneSize.vx =round(InNode.Pos.x*Scale);
|
||||||
OutBone.BoneSize.vy =round(InNode.Pos.y*Scale);
|
OutBone.BoneSize.vy =round(InNode.Pos.y*Scale);
|
||||||
OutBone.BoneSize.vz =round(InNode.Pos.z*Scale);
|
OutBone.BoneSize.vz =round(InNode.Pos.z*Scale);
|
||||||
OutBone.BoneAng.vx=round(InNode.Ang.x*4096);
|
|
||||||
OutBone.BoneAng.vy=round(InNode.Ang.y*4096);
|
|
||||||
OutBone.BoneAng.vz=round(InNode.Ang.z*4096);
|
|
||||||
OutBone.BoneAng.vw=round(InNode.Ang.w*4096);
|
|
||||||
OutBone.Parent=ParentBoneIdx;
|
OutBone.Parent=ParentBoneIdx;
|
||||||
OutBone.VtxCount=0;
|
OutBone.VtxCount=0;
|
||||||
OutBone.TriCount=0;
|
OutBone.TriCount=0;
|
||||||
|
@ -140,7 +138,7 @@ void CMkActor3d::ProcessSkel(int Idx,int ParentIdx)
|
||||||
CNode &ThisNode=Scene.GetNode(Idx);
|
CNode &ThisNode=Scene.GetNode(Idx);
|
||||||
CNode &ParentNode=Scene.GetNode(ThisNode.ParentIdx);
|
CNode &ParentNode=Scene.GetNode(ThisNode.ParentIdx);
|
||||||
vector<sGinTri> const &NodeTriList = ThisNode.GetTris();
|
vector<sGinTri> const &NodeTriList = ThisNode.GetTris();
|
||||||
vector<Vector3> const &NodeVtxList = ThisNode.GetRelPts();
|
vector<Vector3> const &NodeVtxList = ThisNode.GetPts();
|
||||||
vector<int> const &NodeMatList = ThisNode.GetTriMaterial();
|
vector<int> const &NodeMatList = ThisNode.GetTriMaterial();
|
||||||
vector<sUVTri> const &NodeUVList = ThisNode.GetUVTris();
|
vector<sUVTri> const &NodeUVList = ThisNode.GetUVTris();
|
||||||
vector<GString> const &SceneTexList= Scene.GetTexList();
|
vector<GString> const &SceneTexList= Scene.GetTexList();
|
||||||
|
@ -151,8 +149,6 @@ int ThisIdx=Skel.size();
|
||||||
sGinSkel &ParentBone=Skel[ParentIdx];
|
sGinSkel &ParentBone=Skel[ParentIdx];
|
||||||
vector<Vector3> VtxList;
|
vector<Vector3> VtxList;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!TriCount)
|
if (!TriCount)
|
||||||
{ // Its a Bone!!
|
{ // Its a Bone!!
|
||||||
sGinSkel ThisBone;
|
sGinSkel ThisBone;
|
||||||
|
@ -165,41 +161,23 @@ int WeightCount=ThisNode.Weights.size();
|
||||||
for (int i=0; i<WeightCount; i++)
|
for (int i=0; i<WeightCount; i++)
|
||||||
{
|
{
|
||||||
sGinWeight &ThisWeight=ThisNode.Weights[i];
|
sGinWeight &ThisWeight=ThisNode.Weights[i];
|
||||||
printf("%i %f %f %f\t\n",ThisWeight.VertNo,NodeVtxList[ThisWeight.VertNo].x,NodeVtxList[ThisWeight.VertNo].y,NodeVtxList[ThisWeight.VertNo].z);
|
// printf("%i %f %f %f\t\n",ThisWeight.VertNo,NodeVtxList[ThisWeight.VertNo].x,NodeVtxList[ThisWeight.VertNo].y,NodeVtxList[ThisWeight.VertNo].z);
|
||||||
ThisBone.FaceList.AddVtx((Vector3) NodeVtxList[ThisWeight.VertNo]);
|
// ThisBone.FaceList.AddVtx((Vector3) NodeVtxList[ThisWeight.VertNo]);
|
||||||
}
|
}
|
||||||
printf("%i\n",ThisBone.FaceList.GetVtxCount());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Skel.push_back(ThisBone);
|
Skel.push_back(ThisBone);
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{ // Model, attach to parent bone
|
{ // Model, attach to parent bone
|
||||||
// build TX Vtx List
|
// build TX Vtx List
|
||||||
|
|
||||||
int ListSize=NodeVtxList.size();
|
int ListSize=NodeVtxList.size();
|
||||||
VtxList.resize(ListSize);
|
VtxList.resize(ListSize);
|
||||||
Matrix4x4 Mtx=ThisNode.Mtx;
|
|
||||||
Matrix4x4 PMtx=ParentNode.Mtx;
|
Matrix4x4 PMtx=ParentNode.Mtx;
|
||||||
PMtx.Invert();
|
PMtx.Invert();
|
||||||
for (int i=0; i<ListSize; i++)
|
for (int i=0; i<ListSize; i++)
|
||||||
{
|
{
|
||||||
Vector3 Vtx=NodeVtxList[i];
|
VtxList[i]=PMtx*NodeVtxList[i];
|
||||||
Vtx=Mtx*Vtx;
|
|
||||||
Vtx=PMtx*Vtx;
|
|
||||||
VtxList[i]=Vtx;
|
|
||||||
}
|
|
||||||
|
|
||||||
int WeightCount=ParentNode.Weights.size();
|
|
||||||
if (WeightCount)
|
|
||||||
{
|
|
||||||
printf("%s %i\n",ParentNode.Name,WeightCount);
|
|
||||||
for (int i=0; i<WeightCount; i++)
|
|
||||||
{
|
|
||||||
sGinWeight &ThisWeight=ParentNode.Weights[i];
|
|
||||||
printf("%i %f %f %f\t\n",ThisWeight.VertNo,VtxList[ThisWeight.VertNo].x,VtxList[ThisWeight.VertNo].y,VtxList[ThisWeight.VertNo].z);
|
|
||||||
}
|
|
||||||
// printf("%i\n",ThisBone.FaceList.GetVtxCount());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int T=0; T<TriCount; T++)
|
for (int T=0; T<TriCount; T++)
|
||||||
|
@ -233,7 +211,6 @@ int ListSize=Skel.size();
|
||||||
for (int F=0; F<FaceListSize; F++)
|
for (int F=0; F<FaceListSize; F++)
|
||||||
{
|
{
|
||||||
FaceList.AddFace(ThisBone.FaceList[F]);
|
FaceList.AddFace(ThisBone.FaceList[F]);
|
||||||
// FaceList.ProcessVtx(ThisBone.FaceList[F]);
|
|
||||||
}
|
}
|
||||||
ThisBone.Bone.VtxCount=FaceList.GetVtxCount()-VtxStart;
|
ThisBone.Bone.VtxCount=FaceList.GetVtxCount()-VtxStart;
|
||||||
}
|
}
|
||||||
|
@ -250,8 +227,6 @@ int ListSize=Skel.size();
|
||||||
sBone &ThisBone=Skel[i].Bone;
|
sBone &ThisBone=Skel[i].Bone;
|
||||||
|
|
||||||
fwrite(&ThisBone, sizeof(sBone), 1, File);
|
fwrite(&ThisBone, sizeof(sBone), 1, File);
|
||||||
// printf("%i %i %i\n",i,ThisBone.TriStart,ThisBone.TriCount);
|
|
||||||
// printf("%i %i\n",i,ThisBone.VtxCount);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -266,6 +241,7 @@ void CMkActor3d::Process()
|
||||||
FaceList.SetTexBasePath(InPath);
|
FaceList.SetTexBasePath(InPath);
|
||||||
FaceList.SetTexOut(OutFile+".Tex",TPageBase,TPageWidth,TPageHeight);
|
FaceList.SetTexOut(OutFile+".Tex",TPageBase,TPageWidth,TPageHeight);
|
||||||
FaceList.SetTexDebugOut(OutFile+".Lbm");
|
FaceList.SetTexDebugOut(OutFile+".Lbm");
|
||||||
|
if (!IncludeFile.Empty()) FaceList.SetTexInclude(IncludeFile);
|
||||||
|
|
||||||
int ListSize=ExtraTex.size();
|
int ListSize=ExtraTex.size();
|
||||||
for (int i=0; i<ListSize; i++)
|
for (int i=0; i<ListSize; i++)
|
||||||
|
|
|
@ -66,7 +66,7 @@ LINK32=link.exe
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\libs\glib" /I "..\libs\maths" /I "..\libs\davelib" /I "..\libs\ginlib" /I "..\libs\psxlib" /I "..\libs\texgrab" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
# ADD CPP /nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "..\libs\glib" /I "..\libs\maths" /I "..\libs\davelib" /I "..\libs\ginlib" /I "..\libs\psxlib" /I "..\libs\texgrab" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
|
||||||
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||||
# ADD RSC /l 0x809 /d "_DEBUG"
|
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
|
|
|
@ -42,7 +42,7 @@ RSC=rc.exe
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\libs\glib" /I "..\libs\maths" /I "..\libs\davelib" /I "..\libs\ginlib" /I "..\libs\psxlib" /I "..\libs\texgrab" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
# ADD CPP /nologo /G5 /MD /W3 /GX /O2 /I "..\libs\glib" /I "..\libs\maths" /I "..\libs\davelib" /I "..\libs\ginlib" /I "..\libs\psxlib" /I "..\libs\texgrab" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||||
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
# ADD BASE RSC /l 0x809 /d "NDEBUG"
|
||||||
# ADD RSC /l 0x809 /d "NDEBUG"
|
# ADD RSC /l 0x809 /d "NDEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
|
@ -66,7 +66,7 @@ LINK32=link.exe
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\libs\glib" /I "..\libs\maths" /I "..\libs\davelib" /I "..\libs\ginlib" /I "..\libs\psxlib" /I "..\libs\texgrab" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
# ADD CPP /nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "..\libs\glib" /I "..\libs\maths" /I "..\libs\davelib" /I "..\libs\ginlib" /I "..\libs\psxlib" /I "..\libs\texgrab" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
|
||||||
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
# ADD BASE RSC /l 0x809 /d "_DEBUG"
|
||||||
# ADD RSC /l 0x809 /d "_DEBUG"
|
# ADD RSC /l 0x809 /d "_DEBUG"
|
||||||
BSC32=bscmake.exe
|
BSC32=bscmake.exe
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue