This commit is contained in:
parent
8cbe787841
commit
bad8fa425e
9 changed files with 44 additions and 138 deletions
|
@ -190,7 +190,7 @@ CFace &F = FaceList[ListSize];
|
||||||
int CFaceStore::AddTex(GString const &TexName)
|
int CFaceStore::AddTex(GString const &TexName)
|
||||||
{
|
{
|
||||||
int ListSize=TexList.size();
|
int ListSize=TexList.size();
|
||||||
GString UpperName=TexName;
|
GString UpperName=TexBasePath+TexName;
|
||||||
UpperName.Upper();
|
UpperName.Upper();
|
||||||
|
|
||||||
for (int i=0; i<ListSize; i++)
|
for (int i=0; i<ListSize; i++)
|
||||||
|
@ -209,29 +209,6 @@ sFaceTexList &New=TexList[ListSize];
|
||||||
return(New.TexGrabId);
|
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()
|
void CFaceStore::ProcessTextures()
|
||||||
{
|
{
|
||||||
|
@ -272,7 +249,6 @@ void CFaceStore::SetupUV(CFace const &In, sTri &Out)
|
||||||
{
|
{
|
||||||
vector<sTexOutInfo> &TexInfo=TexGrab->GetTexInfo();
|
vector<sTexOutInfo> &TexInfo=TexGrab->GetTexInfo();
|
||||||
sTexOutInfo &ThisTex=TexInfo[In.Mat];
|
sTexOutInfo &ThisTex=TexInfo[In.Mat];
|
||||||
// printf("Setup UV %s\n",ThisTex.Name);
|
|
||||||
|
|
||||||
int W = ThisTex.w - 1;
|
int W = ThisTex.w - 1;
|
||||||
int H = ThisTex.h - 1;
|
int H = ThisTex.h - 1;
|
||||||
|
|
|
@ -73,18 +73,18 @@ public:
|
||||||
|
|
||||||
CFace &AddFace(sTriFace &Face,int ID=0);
|
CFace &AddFace(sTriFace &Face,int ID=0);
|
||||||
|
|
||||||
void SetTexGrab(CTexGrab &NewGrab) {TexGrab=&NewGrab;}
|
void SetTexGrab(CTexGrab &NewGrab) {TexGrab=&NewGrab;}
|
||||||
int AddTex(GString const &TexName);
|
int AddTex(GString const &TexName);
|
||||||
void SetTexBasePath(GString &Path);
|
void SetTexBasePath(GString &Path) {TexBasePath=Path;}
|
||||||
void SetTexOut(GString &Name,int TPBase,int TPW,int TPH);
|
void SetTexOut(GString &Name,int TPBase,int TPW,int TPH) {TexGrab->SetOutFile(Name); TexGrab->SetTPage(TPBase,TPW,TPH);}
|
||||||
void SetTexInclude(GString &Name) {TexGrab->SetIncFile(Name);}
|
void SetTexInclude(GString &Name) {TexGrab->SetIncFile(Name);}
|
||||||
void SetTexDebug(bool f) {TexGrab->SetDebug(f);}
|
void SetTexDebug(bool f) {TexGrab->SetDebug(f);}
|
||||||
void SetTexDebugOut(GString &Name);
|
void SetTexDebugOut(GString &Name) {TexGrab->SetDebugOut(Name);}
|
||||||
void SetTexShrinkToFit(bool f) {TexGrab->ShrinkToFit(f);}
|
void SetTexShrinkToFit(bool f) {TexGrab->ShrinkToFit(f);}
|
||||||
void SetTexNoSort() {TexGrab->NoSort();}
|
void SetTexNoSort() {TexGrab->NoSort();}
|
||||||
void SetTexAnimatedHeadersOnly(bool f) {TexGrab->AnimatedHeadersOnly(f);}
|
void SetTexAnimatedHeadersOnly(bool f) {TexGrab->AnimatedHeadersOnly(f);}
|
||||||
void SetTexDontOutputBoxes(bool f) {TexGrab->DontOutputBoxes(f);}
|
void SetTexDontOutputBoxes(bool f) {TexGrab->DontOutputBoxes(f);}
|
||||||
void SetTexAllowRotate(bool f) {TexGrab->AllowRotate(f);}
|
void SetTexAllowRotate(bool f) {TexGrab->AllowRotate(f);}
|
||||||
|
|
||||||
CTexGrab &GetTexGrab() {return(FaceStoreTexGrab);}
|
CTexGrab &GetTexGrab() {return(FaceStoreTexGrab);}
|
||||||
vector<sTexOutInfo> &GetTexInfo() {return(TexGrab->GetTexInfo());}
|
vector<sTexOutInfo> &GetTexInfo() {return(TexGrab->GetTexInfo());}
|
||||||
|
|
|
@ -21,9 +21,6 @@
|
||||||
#include <gfname.hpp>
|
#include <gfname.hpp>
|
||||||
#include <pcre.h>
|
#include <pcre.h>
|
||||||
|
|
||||||
//#include <ginio.h>
|
|
||||||
//#include <repread.h>
|
|
||||||
|
|
||||||
#include "sprset.h"
|
#include "sprset.h"
|
||||||
|
|
||||||
#include "AllFiles.h"
|
#include "AllFiles.h"
|
||||||
|
@ -58,66 +55,36 @@ void AllFiles::FileCallback(char const * FName,int FileNum)
|
||||||
GString Ext(FileName.Ext());
|
GString Ext(FileName.Ext());
|
||||||
|
|
||||||
Ext.Lower();
|
Ext.Lower();
|
||||||
/*
|
GFName Name(FName);
|
||||||
if (Ext=="gin")
|
|
||||||
{
|
|
||||||
vector<GString> NonSharedTextures;
|
|
||||||
|
|
||||||
CScene MyFile;
|
if (Name.File()[0]=='+')
|
||||||
MyFile.Load(FName);
|
ThisZeroColZero=true;
|
||||||
|
|
||||||
MyFile.GetNonSharedTextures(AllExternalSharedTextures,NonSharedTextures);
|
|
||||||
|
|
||||||
|
|
||||||
vector<GString> NewEntrys;
|
|
||||||
|
|
||||||
for (int f=0;f<NonSharedTextures.size();f++)
|
|
||||||
{
|
|
||||||
if (find(UniqueTexturesSoFar.begin(),UniqueTexturesSoFar.end(),NonSharedTextures[f]) == UniqueTexturesSoFar.end())
|
|
||||||
{
|
|
||||||
NewEntrys.push_back(NonSharedTextures[f]);
|
|
||||||
UniqueTexturesSoFar.push_back(NonSharedTextures[f]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
for (f=0;f<NewEntrys.size();f++)
|
|
||||||
FileCallback(NewEntrys[f],0);
|
|
||||||
|
|
||||||
if (DebugFlag) cout<<"Read gin file *"<<FName<<"*"<<endl;
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
*/ {
|
ThisZeroColZero=ZeroColZero;
|
||||||
GFName Name(FName);
|
|
||||||
|
|
||||||
if (Name.File()[0]=='+')
|
if (Name.File()[0]=='!')
|
||||||
ThisZeroColZero=true;
|
m_allocateAs16bit=true;
|
||||||
else
|
else
|
||||||
ThisZeroColZero=ZeroColZero;
|
m_allocateAs16bit=false;
|
||||||
|
|
||||||
if (Name.File()[0]=='!')
|
if (Name.File()[0] == '@')
|
||||||
m_allocateAs16bit=true;
|
{
|
||||||
else
|
ThisZeroColZero = true;
|
||||||
m_allocateAs16bit=false;
|
m_allocateAs16bit = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (Name.File()[0] == '@')
|
GString TheFile(FName);
|
||||||
{
|
TheFile.Lower();
|
||||||
ThisZeroColZero = true;
|
|
||||||
m_allocateAs16bit = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
GString TheFile(FName);
|
MyInfo.SetInfo(TheFile,CrossHair,ThisZeroColZero,MoveUVs,AllowRotate,ShrinkToFit,m_allocateAs16bit);
|
||||||
TheFile.Lower();
|
if (DebugFlag) cout<<"Add image file "<<TheFile<<endl;
|
||||||
|
|
||||||
MyInfo.SetInfo(TheFile,CrossHair,ThisZeroColZero,MoveUVs,AllowRotate,ShrinkToFit,m_allocateAs16bit);
|
if (ForceOffsets)
|
||||||
if (DebugFlag) cout<<"Add image file "<<TheFile<<endl;
|
MyInfo.SetForceOffsets(XOff,YOff);
|
||||||
|
|
||||||
if (ForceOffsets)
|
AllFileInfos.resize(AllFileInfos.size()+1);
|
||||||
MyInfo.SetForceOffsets(XOff,YOff);
|
AllFileInfos[AllFileInfos.size()-1]=MyInfo;
|
||||||
|
|
||||||
AllFileInfos.resize(AllFileInfos.size()+1);
|
|
||||||
AllFileInfos[AllFileInfos.size()-1]=MyInfo;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int AllFiles::AddMemFrame(char const * FName,Frame &Frame)
|
int AllFiles::AddMemFrame(char const * FName,Frame &Frame)
|
||||||
|
@ -182,24 +149,5 @@ void AllFiles::SortOrder()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
|
||||||
Function: void AllFiles::ReadRepFile(char const * Name)
|
|
||||||
Purpose: Read in rep file for shared textures
|
|
||||||
Params: Name of rep file
|
|
||||||
---------------------------------------------------------------------- */
|
|
||||||
void AllFiles::ReadRepFile(char const * Name)
|
|
||||||
{
|
|
||||||
/*
|
|
||||||
vector<RepItem> MyItems;
|
|
||||||
|
|
||||||
::readRepFile(Name,MyItems);
|
|
||||||
|
|
||||||
for (int f=0;f<MyItems.size();f++)
|
|
||||||
AllExternalSharedTextures.push_back(MyItems[f].m_texName);
|
|
||||||
|
|
||||||
if (DebugFlag) cout<<"Read report file "<<Name<<endl;
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/*===========================================================================
|
/*===========================================================================
|
||||||
end */
|
end */
|
||||||
|
|
|
@ -18,18 +18,6 @@
|
||||||
Includes
|
Includes
|
||||||
-------- */
|
-------- */
|
||||||
|
|
||||||
//#include <vector>
|
|
||||||
//#include <gtypes.h>
|
|
||||||
//#include <gstring.hpp>
|
|
||||||
//#include <misc.hpp>
|
|
||||||
//#include <gfname.hpp>
|
|
||||||
//#include <pcre.h>
|
|
||||||
|
|
||||||
//#include <ginio.h>
|
|
||||||
//#include <repread.h>
|
|
||||||
|
|
||||||
//#include "sprset.h"
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
/*----------------------------------------------------------------------
|
/*----------------------------------------------------------------------
|
||||||
|
@ -78,8 +66,6 @@ public:
|
||||||
void SortOrder();
|
void SortOrder();
|
||||||
int AddFile(const char * Name);
|
int AddFile(const char * Name);
|
||||||
int AddMemFrame(char const * FName,Frame &Frame);
|
int AddMemFrame(char const * FName,Frame &Frame);
|
||||||
void ReadRepFile(char const * Name);
|
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
vector<GString> UniqueTexturesSoFar;
|
vector<GString> UniqueTexturesSoFar;
|
||||||
|
|
|
@ -25,9 +25,6 @@
|
||||||
#include <gfname.hpp>
|
#include <gfname.hpp>
|
||||||
#include <pcre.h>
|
#include <pcre.h>
|
||||||
|
|
||||||
//#include <ginio.h>
|
|
||||||
//#include <repread.h>
|
|
||||||
|
|
||||||
#include "sprset.h"
|
#include "sprset.h"
|
||||||
#include "allfiles.h"
|
#include "allfiles.h"
|
||||||
|
|
||||||
|
@ -71,8 +68,6 @@ public:
|
||||||
void NoSort() {MyFiles.setNoSort();}
|
void NoSort() {MyFiles.setNoSort();}
|
||||||
void SetDebug(bool f) {DebugFlag=f;}
|
void SetDebug(bool f) {DebugFlag=f;}
|
||||||
|
|
||||||
void ReadRepFile(GString String) {MyFiles.ReadRepFile(String);}
|
|
||||||
|
|
||||||
void CrossHair(bool f) {MyFiles.SetCrossHair(f);}
|
void CrossHair(bool f) {MyFiles.SetCrossHair(f);}
|
||||||
void ZeroColZero(bool f) {MyFiles.SetZeroColZero(f);}
|
void ZeroColZero(bool f) {MyFiles.SetZeroColZero(f);}
|
||||||
void MoveUVs(bool f) {MyFiles.SetMoveUVs(f);}
|
void MoveUVs(bool f) {MyFiles.SetMoveUVs(f);}
|
||||||
|
|
|
@ -428,8 +428,8 @@ void CTileSet::Load2d(CCore *Core)
|
||||||
{
|
{
|
||||||
CTexCache &TexCache=Core->GetTexCache();
|
CTexCache &TexCache=Core->GetTexCache();
|
||||||
GString ColTest;
|
GString ColTest;
|
||||||
int TexID=TexCache.ProcessTexture(Filename,0);
|
int TexID=TexCache.ProcessTexture(Filename,0);
|
||||||
sTex &ThisTex=TexCache.GetTex(TexID);
|
sTex &ThisTex=TexCache.GetTex(TexID);
|
||||||
|
|
||||||
int Width=ThisTex.TexWidth/16;
|
int Width=ThisTex.TexWidth/16;
|
||||||
int Height=ThisTex.TexHeight/16;
|
int Height=ThisTex.TexHeight/16;
|
||||||
|
|
|
@ -203,6 +203,7 @@ int ListSize=Skel.size();
|
||||||
sGinSkel &ThisBone=Skel[i];
|
sGinSkel &ThisBone=Skel[i];
|
||||||
int VtxStart=FaceList.GetVtxCount();
|
int VtxStart=FaceList.GetVtxCount();
|
||||||
int FaceListSize=ThisBone.FaceList.GetFaceCount();
|
int FaceListSize=ThisBone.FaceList.GetFaceCount();
|
||||||
|
|
||||||
if (FaceListSize)
|
if (FaceListSize)
|
||||||
{
|
{
|
||||||
ThisBone.Bone.TriStart=FaceList.GetFaceCount();
|
ThisBone.Bone.TriStart=FaceList.GetFaceCount();
|
||||||
|
@ -234,15 +235,15 @@ int ListSize=Skel.size();
|
||||||
//***************************************************************************
|
//***************************************************************************
|
||||||
void CMkActor3d::Process()
|
void CMkActor3d::Process()
|
||||||
{
|
{
|
||||||
ProcessSkel(1,-1);
|
|
||||||
BuildSkelOut();
|
|
||||||
printf("Skel has %i bones\n",Skel.size());
|
|
||||||
|
|
||||||
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);
|
if (!IncludeFile.Empty()) FaceList.SetTexInclude(IncludeFile);
|
||||||
|
|
||||||
|
ProcessSkel(1,-1);
|
||||||
|
BuildSkelOut();
|
||||||
|
printf("Skel has %i bones\n",Skel.size());
|
||||||
|
|
||||||
int ListSize=ExtraTex.size();
|
int ListSize=ExtraTex.size();
|
||||||
for (int i=0; i<ListSize; i++)
|
for (int i=0; i<ListSize; i++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,7 +40,6 @@ private:
|
||||||
|
|
||||||
CFaceStore FaceList;
|
CFaceStore FaceList;
|
||||||
|
|
||||||
CTexGrab TexGrab;
|
|
||||||
sActor3dHdr FileHdr;
|
sActor3dHdr FileHdr;
|
||||||
FILE *File;
|
FILE *File;
|
||||||
|
|
||||||
|
|
|
@ -298,6 +298,7 @@ int ListSize=AnimList.size();
|
||||||
fprintf(File,",\n");
|
fprintf(File,",\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fprintf(File,"\tNUM_ANIM_%s",Name.File());
|
||||||
fprintf(File,"};\n");
|
fprintf(File,"};\n");
|
||||||
fprintf(File,"\n");
|
fprintf(File,"\n");
|
||||||
fprintf(File,"#endif\n");
|
fprintf(File,"#endif\n");
|
||||||
|
|
Loading…
Add table
Reference in a new issue