This commit is contained in:
parent
8f8f03e2ed
commit
3c2bcb6c01
12 changed files with 1236 additions and 15 deletions
102
Utils/Libs/DaveLib/DaveLib.cpp
Normal file
102
Utils/Libs/DaveLib/DaveLib.cpp
Normal file
|
@ -0,0 +1,102 @@
|
||||||
|
/*************************/
|
||||||
|
/*** Dave Lib Routines ***/
|
||||||
|
/*************************/
|
||||||
|
|
||||||
|
#include <ginio.h>
|
||||||
|
#include <gintex.h>
|
||||||
|
#include "stdio.h"
|
||||||
|
#include <math.h>
|
||||||
|
#include <repread.h>
|
||||||
|
#include <misc.hpp>
|
||||||
|
#include <conio.h>
|
||||||
|
#include <iostream.h>
|
||||||
|
#include <vector>
|
||||||
|
#include <gfname.hpp>
|
||||||
|
#include "psxtypes.h"
|
||||||
|
#include "FaceStore.h"
|
||||||
|
|
||||||
|
#include "..\..\..\tools\data\include\dStructs.h"
|
||||||
|
|
||||||
|
#include "DaveLib.h"
|
||||||
|
|
||||||
|
GString OutStr,IncludeFile;
|
||||||
|
bool DebugOn= false;
|
||||||
|
float Scale=1.0;
|
||||||
|
int StripLength=3;
|
||||||
|
|
||||||
|
FileCycle MyFiles;
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void DebugStr() {if (DebugOn) std::cout<<endl;}
|
||||||
|
void DebugStr(char *Txt) {if (DebugOn) std::cout<<Txt<<endl;}
|
||||||
|
void DebugStr(char *Txt,int Param) {if (DebugOn) std::cout<<Txt<<" "<<Param<<endl;}
|
||||||
|
void DebugStr2(char *Txt,int Param) {if (DebugOn) std::cout<<Txt<<" "<<Param<<" ";}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
int round(float f)
|
||||||
|
{
|
||||||
|
if (f<0)
|
||||||
|
{
|
||||||
|
return (int)(f-0.5f);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return (int)(f+0.5f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void alignFile( FILE *f, int align )
|
||||||
|
{
|
||||||
|
long fp = ftell(f);
|
||||||
|
if (fp&(align-1))
|
||||||
|
{
|
||||||
|
char buffer[] = "*********************************";
|
||||||
|
int s = align - (fp & (align-1));
|
||||||
|
fwrite(buffer, s, 1, f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
GString CheckFileString(const char * Str)
|
||||||
|
{
|
||||||
|
GString RetStr;
|
||||||
|
|
||||||
|
if (strlen(Str)>3 && (Str[0]=='-' || Str[0]=='/') && (Str[2]==':' || Str[2]==':'))
|
||||||
|
RetStr=&Str[3];
|
||||||
|
else
|
||||||
|
GObject::Error(ERR_FATAL,"Problem with cmd line option %s",Str);
|
||||||
|
|
||||||
|
return(RetStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
bool CheckPlusMinus(const char * Str)
|
||||||
|
{
|
||||||
|
if (strlen(Str)==3 && (Str[0]=='-' || Str[0]=='/') && (Str[2]=='-' || Str[2]=='+'))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
else
|
||||||
|
GObject::Error(ERR_FATAL,"Problem with cmd line option %s",Str);
|
||||||
|
|
||||||
|
return(Str[2]=='+');
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
int ZeroAndCountCommas(char * Str)
|
||||||
|
{
|
||||||
|
int Len=strlen(Str);
|
||||||
|
int NumOfCommas=0;
|
||||||
|
|
||||||
|
for (int f=0;f<Len;f++)
|
||||||
|
{
|
||||||
|
if (Str[f]==',')
|
||||||
|
{
|
||||||
|
NumOfCommas++;
|
||||||
|
Str[f]=0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return(NumOfCommas);
|
||||||
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ RSC=rc.exe
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
MTL=midl.exe
|
MTL=midl.exe
|
||||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||||
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\glib" /I "..\ginlib" /I "..\maths" /I "..\texgrab" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /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 @@ LIB32=link.exe -lib
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
MTL=midl.exe
|
MTL=midl.exe
|
||||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||||
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /I "..\glib" /I "..\ginlib" /I "..\maths" /I "..\texgrab" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /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
|
||||||
|
@ -84,11 +84,35 @@ LIB32=link.exe -lib
|
||||||
# Name "DaveLib - Win32 Debug"
|
# Name "DaveLib - Win32 Debug"
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\DaveLib.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\DaveLib.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\facestore.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\facestore.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\List.h
|
SOURCE=.\List.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\list2d.cpp
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=.\list2d.h
|
SOURCE=.\list2d.h
|
||||||
# End Source File
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=.\PsxTypes.h
|
||||||
|
# End Source File
|
||||||
# End Target
|
# End Target
|
||||||
# End Project
|
# End Project
|
||||||
|
|
69
Utils/Libs/DaveLib/DaveLib.h
Normal file
69
Utils/Libs/DaveLib/DaveLib.h
Normal file
|
@ -0,0 +1,69 @@
|
||||||
|
/*************************/
|
||||||
|
/*** Dave Lib Routines ***/
|
||||||
|
/*************************/
|
||||||
|
|
||||||
|
#ifndef __DAVE_LIB_HEADER__
|
||||||
|
#define __DAVE_LIB_HEADER__
|
||||||
|
|
||||||
|
#include "stdio.h"
|
||||||
|
#include <misc.hpp>
|
||||||
|
#include <gfname.hpp>
|
||||||
|
#include "psxtypes.h"
|
||||||
|
#include "FaceStore.h"
|
||||||
|
#include "..\..\..\tools\data\include\dStructs.h"
|
||||||
|
|
||||||
|
#include "psxtypes.h"
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
const float ONE_DEGREE = 0.0174532925199432957692369076848861271344f;
|
||||||
|
const float INV_ONE_DEGREE = 1/ONE_DEGREE;
|
||||||
|
|
||||||
|
inline float DEG2RAD (float dval) {return(dval*ONE_DEGREE);}
|
||||||
|
inline float RAD2DEG (float dval) {return(dval*(INV_ONE_DEGREE));}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
class FileCycle : protected FileCycler
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
void AddFile(const char * Name)
|
||||||
|
{
|
||||||
|
DoCycle(Name,false);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<GString> const & GetFileInfoVector(void) const {return(AllFileInfos);}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void FileCallback(char const * FName,int FileNum)
|
||||||
|
{
|
||||||
|
AllFileInfos.resize(AllFileInfos.size()+1);
|
||||||
|
AllFileInfos[AllFileInfos.size()-1]=GString(FName);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::vector<GString> AllFileInfos;
|
||||||
|
|
||||||
|
} ;
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
GString CheckFileString(const char * Str);
|
||||||
|
bool CheckPlusMinus(const char * Str);
|
||||||
|
int ZeroAndCountCommas(char * Str);
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
extern GString OutStr,IncludeFile;
|
||||||
|
extern bool DebugOn;
|
||||||
|
extern FileCycle MyFiles;
|
||||||
|
extern float Scale;
|
||||||
|
extern int StripLength;
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void DebugStr2(char *Txt,int Param);
|
||||||
|
void DebugStr(char *Txt,int Param);
|
||||||
|
void DebugStr(char *Txt);
|
||||||
|
void DebugStr();
|
||||||
|
|
||||||
|
int round(float f);
|
||||||
|
|
||||||
|
void alignFile( FILE *f, int align );
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
#endif
|
63
Utils/Libs/DaveLib/PsxTypes.h
Normal file
63
Utils/Libs/DaveLib/PsxTypes.h
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
/*****************/
|
||||||
|
/*** Psx Types ***/
|
||||||
|
/*****************/
|
||||||
|
|
||||||
|
#ifndef __PSX_TYPES_HEADER__
|
||||||
|
#define __PSX_TYPES_HEADER__
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
typedef signed char s8;
|
||||||
|
typedef signed short s16;
|
||||||
|
typedef signed long s32;
|
||||||
|
//typedef long long s64;
|
||||||
|
|
||||||
|
typedef unsigned char u8;
|
||||||
|
typedef unsigned short u16;
|
||||||
|
typedef unsigned long u32;
|
||||||
|
//typedef unsigned long long u64;
|
||||||
|
|
||||||
|
typedef s8 S8;
|
||||||
|
typedef s16 S16;
|
||||||
|
typedef s32 S32;
|
||||||
|
//typedef s64 S64;
|
||||||
|
|
||||||
|
typedef u8 U8;
|
||||||
|
typedef u16 U16;
|
||||||
|
typedef u32 U32;
|
||||||
|
//typedef u64 U64;
|
||||||
|
|
||||||
|
typedef unsigned char u_char;
|
||||||
|
typedef unsigned short u_short;
|
||||||
|
typedef unsigned long u_long;
|
||||||
|
typedef u_char u8;
|
||||||
|
typedef u_short u16;
|
||||||
|
typedef u_long u32;
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
|
||||||
|
#define NO_PROTOTYPE 1
|
||||||
|
#include "..\..\..\tools\psyq\include\libgte.h"
|
||||||
|
|
||||||
|
#define GPU_PolyF3Tag (4)
|
||||||
|
#define GPU_PolyF3Code (0x20)
|
||||||
|
#define GPU_PolyF4Tag (5)
|
||||||
|
#define GPU_PolyF4Code (0x28)
|
||||||
|
#define GPU_PolyFT3Tag (7)
|
||||||
|
#define GPU_PolyFT3Code (0x24)
|
||||||
|
#define GPU_PolyFT4Tag (9)
|
||||||
|
#define GPU_PolyFT4Code (0x2c)
|
||||||
|
#define GPU_PolyG4Tag (8)
|
||||||
|
#define GPU_PolyG4Code (0x38)
|
||||||
|
#define GPU_PolyGT3Tag (9)
|
||||||
|
#define GPU_PolyGT3Code (0x34)
|
||||||
|
#define GPU_PolyGT4Tag (12)
|
||||||
|
#define GPU_PolyGT4Code (0x3c)
|
||||||
|
|
||||||
|
#define GPUCode_ShadeTex (1<<0) // Setting this **DISABLES** texture shading.
|
||||||
|
#define GPUCode_SemiTrans (1<<1) // Setting this enables semi-transparent mode
|
||||||
|
#define GPUCode_Textured (1<<2)
|
||||||
|
#define GPUCode_Quad (1<<3)
|
||||||
|
#define GPUCode_Gouraud (1<<4)
|
||||||
|
#define GPUCode_Global (1<<5)
|
||||||
|
|
||||||
|
#endif
|
812
Utils/Libs/DaveLib/facestore.cpp
Normal file
812
Utils/Libs/DaveLib/facestore.cpp
Normal file
|
@ -0,0 +1,812 @@
|
||||||
|
/****************************************/
|
||||||
|
/*** Generic Face Compilation Storage ***/
|
||||||
|
/****************************************/
|
||||||
|
// Contains tri data with texture data
|
||||||
|
// Will quad later
|
||||||
|
|
||||||
|
#include <ginio.h>
|
||||||
|
#include <gintex.h>
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
|
#include "FaceStore.h"
|
||||||
|
#include "TexGrab.h"
|
||||||
|
#include "DaveLib.h"
|
||||||
|
#include "PsxTypes.h"
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
//vector<GString> CFaceStore::TexList;
|
||||||
|
//CTexGrab CFaceStore::FaceStoreTexGrab;
|
||||||
|
//CTexGrab *CFaceStore::TexGrab=&FaceStoreTexGrab;
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
Vector3 normalise(Vector3 &v)
|
||||||
|
{
|
||||||
|
float sqmag = v.x * v.x + v.y * v.y + v.z * v.z;
|
||||||
|
if (sqmag > 0.001f)
|
||||||
|
{
|
||||||
|
float mag = (float)sqrt( sqmag );
|
||||||
|
Vector3 out;
|
||||||
|
|
||||||
|
out.x = v.x / mag;
|
||||||
|
out.y = v.y / mag;
|
||||||
|
out.z = v.z / mag;
|
||||||
|
|
||||||
|
return out;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
Vector3 crossProduct( Vector3 &v0, Vector3 &v1, Vector3 &v2 )
|
||||||
|
{
|
||||||
|
Vector3 dv1, dv2;
|
||||||
|
Vector3 out;
|
||||||
|
|
||||||
|
dv1.x = v1.x - v0.x;
|
||||||
|
dv1.y = v1.y - v0.y;
|
||||||
|
dv1.z = v1.z - v0.z;
|
||||||
|
|
||||||
|
dv2.x = v2.x - v0.x;
|
||||||
|
dv2.y = v2.y - v0.y;
|
||||||
|
dv2.z = v2.z - v0.z;
|
||||||
|
|
||||||
|
out.x = (dv1.z * dv2.y) - (dv1.y * dv2.z);
|
||||||
|
out.y = (dv1.x * dv2.z) - (dv1.z * dv2.x);
|
||||||
|
out.z = (dv1.y * dv2.x) - (dv1.x * dv2.y);
|
||||||
|
|
||||||
|
out = normalise(out);
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
inline float dotProduct( Vector3 &v0, Vector3 &v1 )
|
||||||
|
{
|
||||||
|
float dp = v0.x * v1.x + v0.y * v1.y + v0.z * v1.z;
|
||||||
|
return dp;
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
inline bool aprox( float x, float y )
|
||||||
|
{
|
||||||
|
if (fabs(x-y)<0.03)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
inline bool uvaprox( sUV &uv0, sUV &uv1 )
|
||||||
|
{
|
||||||
|
return (aprox(uv0.u, uv1.u) && aprox(uv0.v, uv1.v));
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
CFace &CFaceStore::AddFace(vector<Vector3> const &P, const sGinTri &T, const sUVTri &uv,GString const &Tex,int ID)
|
||||||
|
{
|
||||||
|
//int ListSize = FaceList.size();
|
||||||
|
// FaceList.resize(ListSize+1);
|
||||||
|
//CFace &F = FaceList[ListSize];
|
||||||
|
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.TexName=Tex;
|
||||||
|
// F.Mat = AddTex(Tex);
|
||||||
|
// F.Normal = crossProduct( F.vtx[0], F.vtx[1], F.vtx[2] );
|
||||||
|
// F.Avail = true;
|
||||||
|
// F.ID=ID;
|
||||||
|
|
||||||
|
return(AddFace(F));
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
CFace &CFaceStore::AddFace(CFace &Face)
|
||||||
|
{
|
||||||
|
int ListSize=FaceList.size();
|
||||||
|
FaceList.resize(ListSize+1);
|
||||||
|
CFace &F = FaceList[ListSize];
|
||||||
|
F=Face;
|
||||||
|
|
||||||
|
// Process Vtx's
|
||||||
|
for (int i=0; i<3; i++)
|
||||||
|
{
|
||||||
|
F.pts[i]=AddVtx(F.vtx[i]*Scale);
|
||||||
|
}
|
||||||
|
|
||||||
|
F.Mat=AddTex(Face.TexName);
|
||||||
|
F.Normal = crossProduct( F.vtx[0], F.vtx[1], F.vtx[2] );
|
||||||
|
F.Avail = true;
|
||||||
|
return(F);
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void CFaceStore::AddFaces(vector<CFace> &Faces)
|
||||||
|
{
|
||||||
|
int ListSize=Faces.size();
|
||||||
|
|
||||||
|
for (int i=0 ;i<ListSize ;i++)
|
||||||
|
{
|
||||||
|
AddFace(Faces[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void CFaceStore::AddFaces(CFaceStore &Faces)
|
||||||
|
{
|
||||||
|
int ListSize=Faces.GetFaceCount();
|
||||||
|
|
||||||
|
for (int i=0 ;i<ListSize ;i++)
|
||||||
|
{
|
||||||
|
AddFace(Faces[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
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=0;
|
||||||
|
return(F);
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
//*** Texture Stuff *********************************************************
|
||||||
|
//***************************************************************************
|
||||||
|
int CFaceStore::AddTex(GString const &TexName)
|
||||||
|
{
|
||||||
|
int ListSize=TexList.size();
|
||||||
|
GString UpperName=TexName;
|
||||||
|
UpperName.Upper();
|
||||||
|
|
||||||
|
for (int i=0; i<ListSize; i++)
|
||||||
|
{
|
||||||
|
if (TexList[i].Name==UpperName) return(TexList[i].TexGrabId);
|
||||||
|
}
|
||||||
|
|
||||||
|
TexList.resize(ListSize+1);
|
||||||
|
sFaceTexList &New=TexList[ListSize];
|
||||||
|
|
||||||
|
New.Name=UpperName;
|
||||||
|
|
||||||
|
// printf("Add Tex %s\n",TexName);
|
||||||
|
New.TexGrabId=TexGrab->AddFile(UpperName);
|
||||||
|
|
||||||
|
return(New.TexGrabId);
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void CFaceStore::SetTexBasePath(GString &Path)
|
||||||
|
{
|
||||||
|
TexBasePath=Path;
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void CFaceStore::SetTexOut(GString &Name,int TPBase,int TPW,int TPH)
|
||||||
|
{
|
||||||
|
char File[256];
|
||||||
|
sprintf(File,"%s",Name);
|
||||||
|
TexGrab->SetOutFile(File);
|
||||||
|
TexGrab->SetTPage(TPBase,TPW,TPH);
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void CFaceStore::SetTexDebugOut(GString &Name)
|
||||||
|
{
|
||||||
|
char File[256];
|
||||||
|
sprintf(File,"%s",Name);
|
||||||
|
TexGrab->SetDebugOut(File);
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void CFaceStore::ProcessTextures()
|
||||||
|
{
|
||||||
|
// Set Texgrab Defaults
|
||||||
|
TexGrab->ShrinkToFit(true);
|
||||||
|
TexGrab->NoSort();
|
||||||
|
|
||||||
|
TexGrab->AnimatedHeadersOnly(true);
|
||||||
|
TexGrab->DontOutputBoxes(true);
|
||||||
|
TexGrab->AllowRotate(true);
|
||||||
|
TexGrab->Process();
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void CFaceStore::Process()
|
||||||
|
{
|
||||||
|
Quad();
|
||||||
|
BuildOutTriLists();
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
//***************************************************************************
|
||||||
|
//***************************************************************************
|
||||||
|
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];
|
||||||
|
// printf("Setup UV %s\n",ThisTex.Name);
|
||||||
|
|
||||||
|
int W = ThisTex.w - 1;
|
||||||
|
int H = ThisTex.h - 1;
|
||||||
|
|
||||||
|
if (ThisTex.Rotated)
|
||||||
|
{
|
||||||
|
Out.uv0[0] = (ThisTex.u + H) - round(In.uvs[0].v * H);
|
||||||
|
Out.uv0[1] = (ThisTex.v + W) - round(In.uvs[0].u * W);
|
||||||
|
Out.uv1[0] = (ThisTex.u + H) - round(In.uvs[1].v * H);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
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.TPage=ThisTex.Tpage;
|
||||||
|
Out.Clut=ThisTex.Clut;
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void CFaceStore::SetupUV(CFace const &In, sQuad &Out)
|
||||||
|
{
|
||||||
|
vector<sTexOutInfo> &TexInfo=TexGrab->GetTexInfo();
|
||||||
|
sTexOutInfo &ThisTex=TexInfo[In.Mat];
|
||||||
|
|
||||||
|
int W = ThisTex.w - 1;
|
||||||
|
int H = ThisTex.h - 1;
|
||||||
|
|
||||||
|
if (ThisTex.Rotated)
|
||||||
|
{
|
||||||
|
Out.uv0[0] = (ThisTex.u + H) - round(In.uvs[0].v * H);
|
||||||
|
Out.uv0[1] = (ThisTex.v + W) - round(In.uvs[0].u * W);
|
||||||
|
Out.uv1[0] = (ThisTex.u + H) - round(In.uvs[1].v * H);
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
Out.TPage=ThisTex.Tpage;
|
||||||
|
Out.Clut=ThisTex.Clut;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
int CFaceStore::AddVtx(Vector3 &InVtx)
|
||||||
|
{
|
||||||
|
int ListSize=OutVtxList.size();
|
||||||
|
sVtx ThisVtx;
|
||||||
|
|
||||||
|
ThisVtx.vx=round(InVtx.x);
|
||||||
|
ThisVtx.vy=round(InVtx.y);
|
||||||
|
ThisVtx.vz=round(InVtx.z);
|
||||||
|
|
||||||
|
for (int i=0; i<ListSize; i++)
|
||||||
|
{
|
||||||
|
if (OutVtxList[i]==ThisVtx) return(i);
|
||||||
|
}
|
||||||
|
|
||||||
|
OutVtxList.push_back(ThisVtx);
|
||||||
|
return(ListSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void CFaceStore::BuildOutTriLists()
|
||||||
|
{
|
||||||
|
int FaceCount=TriFaceList.size();
|
||||||
|
|
||||||
|
OutTriList.resize(FaceCount);
|
||||||
|
|
||||||
|
for (int i=0; i<FaceCount; i++)
|
||||||
|
{
|
||||||
|
CFace &InFace=TriFaceList[i];
|
||||||
|
sTri &OutFace=OutTriList[i];
|
||||||
|
|
||||||
|
OutFace.P0=InFace.pts[0];
|
||||||
|
OutFace.P1=InFace.pts[1];
|
||||||
|
OutFace.P2=InFace.pts[2];
|
||||||
|
|
||||||
|
// Materials and other shit
|
||||||
|
SetupUV(InFace,OutFace);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void CFaceStore::BuildOutQuadList()
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
int FaceCount=QuadFaceList.size();
|
||||||
|
OutQuadList.resize(FaceCount);
|
||||||
|
for (int i=0; i<FaceCount; i++)
|
||||||
|
{
|
||||||
|
CFace &InFace=QuadFaceList[i];
|
||||||
|
sQuad &OutFace=OutQuadList[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);
|
||||||
|
|
||||||
|
// Materials and other shit
|
||||||
|
SetupUV(InFace,OutFace);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
//***************************************************************************
|
||||||
|
//***************************************************************************
|
||||||
|
int CFaceStore::WriteTriList(FILE *File)
|
||||||
|
{
|
||||||
|
int ListSize=OutTriList.size();
|
||||||
|
int Pos=ftell(File);
|
||||||
|
|
||||||
|
for (int i=0; i<ListSize; i++)
|
||||||
|
{
|
||||||
|
sTri ThisTri=OutTriList[i];
|
||||||
|
fwrite(&ThisTri,1,sizeof(sTri),File);
|
||||||
|
}
|
||||||
|
return(Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
int CFaceStore::WriteQuadList(FILE *File)
|
||||||
|
{
|
||||||
|
int ListSize=OutQuadList.size();
|
||||||
|
int Pos=ftell(File);
|
||||||
|
|
||||||
|
for (int i=0; i<ListSize; i++)
|
||||||
|
{
|
||||||
|
sQuad &ThisQuad=OutQuadList[i];
|
||||||
|
fwrite(&ThisQuad,1,sizeof(sQuad),File);
|
||||||
|
}
|
||||||
|
return(Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
int CFaceStore::WriteVtxList(FILE *File,sVtx *Mul)
|
||||||
|
{
|
||||||
|
int ListSize=OutVtxList.size();
|
||||||
|
int Pos=ftell(File);
|
||||||
|
|
||||||
|
for (int i=0; i<ListSize; i++)
|
||||||
|
{
|
||||||
|
sVtx ThisVtx=OutVtxList[i];
|
||||||
|
if (Mul)
|
||||||
|
{
|
||||||
|
ThisVtx.vx*=Mul->vx;
|
||||||
|
ThisVtx.vy*=Mul->vy;
|
||||||
|
ThisVtx.vz*=Mul->vz;
|
||||||
|
}
|
||||||
|
fwrite(&ThisVtx,1,sizeof(sVtx),File);
|
||||||
|
}
|
||||||
|
return(Pos);
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
//***************************************************************************
|
||||||
|
//***************************************************************************
|
||||||
|
//***************************************************************************
|
||||||
|
//***************************************************************************
|
||||||
|
//***************************************************************************
|
||||||
|
//***************************************************************************
|
||||||
|
#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;
|
||||||
|
|
||||||
|
// check pnt connections
|
||||||
|
bool found = false;
|
||||||
|
int chkp00 ;
|
||||||
|
int chkp01 ;
|
||||||
|
int chkp10 ;
|
||||||
|
int chkp11 ;
|
||||||
|
for (int i=0; i<3 && !found; i++)
|
||||||
|
{
|
||||||
|
int npi = (i + 1)%3;
|
||||||
|
for (int j=0; j<3 && !found; j++)
|
||||||
|
{
|
||||||
|
int npj = (j + 1)%3;
|
||||||
|
if (F0.pts[i] == F1.pts[npj] && F0.pts[npi] == F1.pts[j])
|
||||||
|
{
|
||||||
|
chkp00 = i;
|
||||||
|
chkp01 = npi;
|
||||||
|
chkp10 = j;
|
||||||
|
chkp11 = npj;
|
||||||
|
found = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (found)
|
||||||
|
{
|
||||||
|
// check uv
|
||||||
|
return (uvaprox(F0.uvs[chkp00], F1.uvs[chkp11]) && uvaprox(F0.uvs[chkp01], F1.uvs[chkp10]));
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
int CFaceStore::GetUnconnectedPoint(int f0, int f1, int &f0p0, int &f0p1 )
|
||||||
|
{
|
||||||
|
CFace &F0 = FaceList[f0];
|
||||||
|
CFace &F1 = FaceList[f1];
|
||||||
|
|
||||||
|
for (int i=0; i<3; i++)
|
||||||
|
{
|
||||||
|
int npi = (i + 1)%3;
|
||||||
|
for (int j=0; j<3; j++)
|
||||||
|
{
|
||||||
|
int npj = (j + 1)%3;
|
||||||
|
if (F0.pts[i] == F1.pts[npj] && F0.pts[npi] == F1.pts[j])
|
||||||
|
{
|
||||||
|
int cp = (j+2) % 3;
|
||||||
|
f0p0 = F0.pts[i];
|
||||||
|
f0p1 = F0.pts[npi];
|
||||||
|
return cp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
int CFaceStore::CountFacesAttached ( int f )
|
||||||
|
{
|
||||||
|
int count = 0;
|
||||||
|
int c = FaceList.size();
|
||||||
|
|
||||||
|
for (int i=0; i<c; i++)
|
||||||
|
{
|
||||||
|
if (FaceList[i].avail && i!=f)
|
||||||
|
{
|
||||||
|
if (CanConnect(f, i))
|
||||||
|
{
|
||||||
|
count ++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
void CFaceStore::FollowFace( int id, CFace &F )
|
||||||
|
{
|
||||||
|
int minF = -1;
|
||||||
|
int minC = 9999;
|
||||||
|
int c = FaceList.size();
|
||||||
|
for (int i=0; i<c; i++)
|
||||||
|
{
|
||||||
|
if (FaceList[i].avail && id != i && CanConnect(id, i))
|
||||||
|
{
|
||||||
|
int fec = CountFacesAttached( i );
|
||||||
|
if (fec < minC)
|
||||||
|
{
|
||||||
|
minF = i;
|
||||||
|
minC = fec;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
CFace &nf = FaceList[minF];
|
||||||
|
|
||||||
|
int ptc = F.pts.size();
|
||||||
|
int v0, v1;
|
||||||
|
int unc = GetUnconnectedPoint( id, minF, v0, v1);
|
||||||
|
|
||||||
|
for (int j=0; j<ptc; j++) if (F.pts[j] == v1) break;
|
||||||
|
|
||||||
|
|
||||||
|
if (j != (ptc-1))
|
||||||
|
{
|
||||||
|
int idx = (j+1)%ptc;
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
|
||||||
|
for (j=0; j<ptc; j++) if (F.pts[j] == v0) break;
|
||||||
|
|
||||||
|
if (j != (ptc-2))
|
||||||
|
{
|
||||||
|
int idx = (j+1)%ptc;
|
||||||
|
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()-1;
|
||||||
|
ub = F.uvs.begin(); ue = F.uvs.end()-1;
|
||||||
|
vb = F.vtx.begin(); ve = F.vtx.end()-1;
|
||||||
|
|
||||||
|
pm = pb + idx;
|
||||||
|
um = ub + idx;
|
||||||
|
vm = vb + idx;
|
||||||
|
|
||||||
|
rotate(pb, pm, pe);
|
||||||
|
rotate(ub, um, ue);
|
||||||
|
rotate(vb, vm, ve);
|
||||||
|
}
|
||||||
|
|
||||||
|
F.pts.resize(ptc+1);
|
||||||
|
F.vtx.resize(ptc+1);
|
||||||
|
F.uvs.resize(ptc+1);
|
||||||
|
|
||||||
|
F.pts[ptc] = nf.pts[unc];
|
||||||
|
F.vtx[ptc] = nf.vtx[unc];
|
||||||
|
F.uvs[ptc] = nf.uvs[unc];
|
||||||
|
nf.avail = false;
|
||||||
|
|
||||||
|
if (minC && MaxStrip>F.pts.size()) FollowFace( minF, F );
|
||||||
|
}
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
bool CFaceStore::GetFace( CFace &F )
|
||||||
|
{
|
||||||
|
int minF = -1;
|
||||||
|
int minC = 9999;
|
||||||
|
int c = FaceList.size();
|
||||||
|
|
||||||
|
for (int i=0; i<c; i++)
|
||||||
|
{
|
||||||
|
if (FaceList[i].avail)
|
||||||
|
{
|
||||||
|
int fec = CountFacesAttached( i );
|
||||||
|
if (fec < minC)
|
||||||
|
{
|
||||||
|
minF = i;
|
||||||
|
minC = fec;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (minF == -1)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
F.Mat = FaceList[minF].Mat;
|
||||||
|
F.pts = FaceList[minF].pts;
|
||||||
|
F.uvs = FaceList[minF].uvs;
|
||||||
|
F.vtx = FaceList[minF].vtx;
|
||||||
|
FaceList[minF].avail = false;
|
||||||
|
F.Normal= FaceList[minF].Normal;
|
||||||
|
F.ID= FaceList[minF].ID;
|
||||||
|
|
||||||
|
if (minC && MaxStrip>F.pts.size()) FollowFace( minF, F );
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
/*****************************************************************************/
|
||||||
|
void CFaceStore::QuadGetPnts(CFace &F,int *Join0,int *Join1,int *Pnt)
|
||||||
|
{
|
||||||
|
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);
|
||||||
|
else
|
||||||
|
QuadList.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]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
151
Utils/Libs/DaveLib/facestore.h
Normal file
151
Utils/Libs/DaveLib/facestore.h
Normal file
|
@ -0,0 +1,151 @@
|
||||||
|
/****************************************/
|
||||||
|
/*** Generic Face Compilation Storage ***/
|
||||||
|
/****************************************/
|
||||||
|
|
||||||
|
#ifndef __FACESTORE_HEADER__
|
||||||
|
#define __FACESTORE_HEADER__
|
||||||
|
|
||||||
|
#include <ginio.h>
|
||||||
|
#include <gintex.h>
|
||||||
|
#include <Vector>
|
||||||
|
#include <TexGrab.h>
|
||||||
|
|
||||||
|
#include "..\..\..\tools\data\include\dStructs.h"
|
||||||
|
|
||||||
|
using namespace std;
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
struct sFaceTexList
|
||||||
|
{
|
||||||
|
GString Name;
|
||||||
|
int TexGrabId;
|
||||||
|
};
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
class CFace
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CFace()
|
||||||
|
{
|
||||||
|
vtx.resize(3);
|
||||||
|
pts.resize(3);
|
||||||
|
idx.resize(3);
|
||||||
|
uvs.resize(3);
|
||||||
|
vis.resize(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
#ifndef sTriFace
|
||||||
|
struct sTriFace
|
||||||
|
{
|
||||||
|
int Mat;
|
||||||
|
Vector3 vtx[3];
|
||||||
|
int pts[3];
|
||||||
|
sUV uvs[3];
|
||||||
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//***************************************************************************
|
||||||
|
class CFaceStore
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
CFaceStore() {MaxStrip = 3;TexGrab=&FaceStoreTexGrab;}
|
||||||
|
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);
|
||||||
|
CFace &AddFace(CFace &F);
|
||||||
|
void AddFaces(vector<CFace>&Faces);
|
||||||
|
void AddFaces(CFaceStore &Faces);
|
||||||
|
|
||||||
|
CFace &AddFace(sTriFace &Face,int ID=0);
|
||||||
|
|
||||||
|
void SetTexGrab(CTexGrab &NewGrab) {TexGrab=&NewGrab;}
|
||||||
|
int AddTex(GString const &TexName);
|
||||||
|
void SetTexBasePath(GString &Path);
|
||||||
|
void SetTexOut(GString &Name,int TPBase,int TPW,int TPH);
|
||||||
|
void SetTexInclude(GString &Name) {TexGrab->SetIncFile(Name);}
|
||||||
|
void SetTexDebug(bool f) {TexGrab->SetDebug(f);}
|
||||||
|
void SetTexDebugOut(GString &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);
|
||||||
|
int WriteQuadList(FILE *File);
|
||||||
|
int WriteVtxList(FILE *File,sVtx *Mul=0);
|
||||||
|
|
||||||
|
|
||||||
|
vector<CFace> const &GetFaceList() {return(FaceList);}
|
||||||
|
int GetFaceCount() {return(FaceList.size());}
|
||||||
|
|
||||||
|
vector<CFace> const &GetTriFaceList() {return(TriFaceList);}
|
||||||
|
int GetTriFaceCount() {return(TriFaceList.size());}
|
||||||
|
|
||||||
|
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);
|
||||||
|
|
||||||
|
void setMaxStripLength(int v) {MaxStrip = v;}
|
||||||
|
|
||||||
|
CFace& operator []( int nIndex ) {return(FaceList[nIndex]);}
|
||||||
|
|
||||||
|
private:
|
||||||
|
void Quad();
|
||||||
|
void SetupUV(CFace const &In, sTri &Out);
|
||||||
|
void SetupUV(CFace const &In, sQuad &Out);
|
||||||
|
|
||||||
|
void BuildOutTriLists();
|
||||||
|
void BuildOutQuadList();
|
||||||
|
|
||||||
|
// 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 );
|
||||||
|
|
||||||
|
int MaxStrip;
|
||||||
|
|
||||||
|
vector<CFace> FaceList;
|
||||||
|
vector<sFaceTexList> TexList;
|
||||||
|
CTexGrab FaceStoreTexGrab,*TexGrab;
|
||||||
|
GString TexBasePath;
|
||||||
|
|
||||||
|
vector<CFace> TriFaceList;
|
||||||
|
vector<CFace> QuadFaceList;
|
||||||
|
|
||||||
|
vector<sTri> OutTriList;
|
||||||
|
vector<sQuad> OutQuadList;
|
||||||
|
vector<sVtx> OutVtxList;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif
|
|
@ -43,7 +43,7 @@ RSC=rc.exe
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
|
||||||
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\libs\glib" /I "..\libs\maths" /I "..\libs\davelib" /I "..\libs\ginlib" /I "..\libs\psxlib" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
|
# ADD CPP /nologo /MD /W3 /GX /O2 /I "..\libs\glib" /I "..\libs\maths" /I "..\libs\davelib" /I "..\libs\ginlib" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
|
||||||
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
|
||||||
# ADD BASE RSC /l 0x809 /d "NDEBUG" /d "_AFXDLL"
|
# ADD BASE RSC /l 0x809 /d "NDEBUG" /d "_AFXDLL"
|
||||||
|
@ -69,7 +69,7 @@ LINK32=link.exe
|
||||||
# PROP Ignore_Export_Lib 0
|
# PROP Ignore_Export_Lib 0
|
||||||
# PROP Target_Dir ""
|
# PROP Target_Dir ""
|
||||||
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
|
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /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" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /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" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c
|
||||||
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||||
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
|
||||||
# ADD BASE RSC /l 0x809 /d "_DEBUG" /d "_AFXDLL"
|
# ADD BASE RSC /l 0x809 /d "_DEBUG" /d "_AFXDLL"
|
||||||
|
|
|
@ -7,7 +7,7 @@
|
||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
#include <iostream.h>
|
#include <iostream.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <PsxLib.h>
|
#include <DaveLib.h>
|
||||||
#include <FaceStore.h>
|
#include <FaceStore.h>
|
||||||
|
|
||||||
#include "MkActor3d.h"
|
#include "MkActor3d.h"
|
||||||
|
|
|
@ -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 /MD /W3 /GX /O2 /I "..\libs\glib" /I "..\libs\maths" /I "..\libs\davelib" /I "..\libs\ginlib" /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
|
||||||
|
@ -50,7 +50,7 @@ BSC32=bscmake.exe
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glib.lib ginlib.lib psxlib.lib texgrab.lib maths.lib psxlib.lib /nologo /subsystem:console /machine:I386 /out:"..\..\tools\data\bin\MkActor3d.exe" /libpath:"..\libs\psxlib\release" /libpath:"..\libs\ginlib\release" /libpath:"..\libs\glib\release" /libpath:"..\libs\davelib\release" /libpath:"..\libs\texgrab\release" /libpath:"..\libs\maths\release"
|
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glib.lib ginlib.lib texgrab.lib maths.lib /nologo /subsystem:console /machine:I386 /out:"..\..\tools\data\bin\MkActor3d.exe" /libpath:"..\libs\psxlib\release" /libpath:"..\libs\ginlib\release" /libpath:"..\libs\glib\release" /libpath:"..\libs\davelib\release" /libpath:"..\libs\texgrab\release" /libpath:"..\libs\maths\release"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "MkActor3d - Win32 Debug"
|
!ELSEIF "$(CFG)" == "MkActor3d - Win32 Debug"
|
||||||
|
|
||||||
|
@ -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 /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 CPP /nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "..\libs\glib" /I "..\libs\maths" /I "..\libs\davelib" /I "..\libs\ginlib" /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
|
||||||
|
@ -74,7 +74,7 @@ BSC32=bscmake.exe
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glib.lib ginlib.lib psxlib.lib texgrab.lib maths.lib psxlib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\libs\psxlib\debug" /libpath:"..\libs\ginlib\debug" /libpath:"..\libs\glib\debug" /libpath:"..\libs\davelib\debug" /libpath:"..\libs\texgrab\debug" /libpath:"..\libs\maths\debug"
|
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glib.lib ginlib.lib texgrab.lib maths.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\libs\psxlib\debug" /libpath:"..\libs\ginlib\debug" /libpath:"..\libs\glib\debug" /libpath:"..\libs\davelib\debug" /libpath:"..\libs\texgrab\debug" /libpath:"..\libs\maths\debug"
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
#include <List.h>
|
#include <List.h>
|
||||||
#include <FaceStore.h>
|
#include <FaceStore.h>
|
||||||
|
|
||||||
#include "..\mapedit\ExportPSXHdr.h"
|
#include "..\mapedit\ExportHdr.h"
|
||||||
|
|
||||||
struct sGinSkel
|
struct sGinSkel
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include <conio.h>
|
#include <conio.h>
|
||||||
#include <iostream.h>
|
#include <iostream.h>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <PsxLib.h>
|
#include <DaveLib.h>
|
||||||
#include <FaceStore.h>
|
#include <FaceStore.h>
|
||||||
|
|
||||||
#include "MkAnim3d.h"
|
#include "MkAnim3d.h"
|
||||||
|
|
|
@ -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 /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 CPP /nologo /G5 /MD /W3 /GX /O2 /I "..\libs\glib" /I "..\libs\maths" /I "..\libs\davelib" /I "..\libs\ginlib" /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
|
||||||
|
@ -50,7 +50,7 @@ BSC32=bscmake.exe
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glib.lib ginlib.lib psxlib.lib texgrab.lib maths.lib psxlib.lib /nologo /subsystem:console /machine:I386 /out:"..\..\tools\data\bin\MkAnim3d.exe" /libpath:"..\libs\psxlib\release" /libpath:"..\libs\ginlib\release" /libpath:"..\libs\glib\release" /libpath:"..\libs\davelib\release" /libpath:"..\libs\texgrab\release" /libpath:"..\libs\maths\release"
|
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glib.lib ginlib.lib texgrab.lib maths.lib /nologo /subsystem:console /machine:I386 /out:"..\..\tools\data\bin\MkAnim3d.exe" /libpath:"..\libs\psxlib\release" /libpath:"..\libs\ginlib\release" /libpath:"..\libs\glib\release" /libpath:"..\libs\davelib\release" /libpath:"..\libs\texgrab\release" /libpath:"..\libs\maths\release"
|
||||||
|
|
||||||
!ELSEIF "$(CFG)" == "MkAnim3d - Win32 Debug"
|
!ELSEIF "$(CFG)" == "MkAnim3d - Win32 Debug"
|
||||||
|
|
||||||
|
@ -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 /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 CPP /nologo /MDd /W3 /Gm /Gi /GX /ZI /Od /I "..\libs\glib" /I "..\libs\maths" /I "..\libs\davelib" /I "..\libs\ginlib" /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
|
||||||
|
@ -74,7 +74,7 @@ BSC32=bscmake.exe
|
||||||
# ADD BSC32 /nologo
|
# ADD BSC32 /nologo
|
||||||
LINK32=link.exe
|
LINK32=link.exe
|
||||||
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
|
||||||
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glib.lib ginlib.lib psxlib.lib texgrab.lib maths.lib psxlib.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\libs\psxlib\debug" /libpath:"..\libs\ginlib\debug" /libpath:"..\libs\glib\debug" /libpath:"..\libs\davelib\debug" /libpath:"..\libs\texgrab\debug" /libpath:"..\libs\maths\debug"
|
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib glib.lib ginlib.lib texgrab.lib maths.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\libs\psxlib\debug" /libpath:"..\libs\ginlib\debug" /libpath:"..\libs\glib\debug" /libpath:"..\libs\davelib\debug" /libpath:"..\libs\texgrab\debug" /libpath:"..\libs\maths\debug"
|
||||||
|
|
||||||
!ENDIF
|
!ENDIF
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue