/**********************************/ /*** SpongeBob 3d Actor Creator ***/ /**********************************/ #include "stdio.h" #include #include #include #include #include #include #include "MkActor3d.h" using namespace std; //graphics/Characters/SpongeBob/SpongeBob.Gin -o:out/USA/data/Actors -t:24,1,1 -s:256 // -a:SBEyesAngry.bmp,SBEyesBlink.bmp,SBEyesDown.bmp,SBEyesfiece.bmp,SBEyesLeft.bmp,SBEyesSheepish.bmp,SBEyesUp.bmp,SBEyesWorried.bmp,SBEyesRight.bmp, SBmouth01.bmp,SBMouthGasp.bmp,SBMouthSheepishSBMouthSmile.bmp,SBMouthTerror.bmp,SBMouthWhistle //*************************************************************************** int TPBase=-1,TPWidth=-1,TPHeight=-1; std::vector ExtraTex; //*************************************************************************** char * CycleCommands(char *String,int Num) { char Text[256],*TextPtr; int Count,i; if (String[0]=='-' || String[0]=='/') { GString TpStr; switch (String[1]) { // Switches case 'o': OutStr = CheckFileString(String); break; case 'd': DebugOn =true; break; case 's': TpStr= CheckFileString(String); Scale=atof(TpStr); break; case 't': TpStr= CheckFileString(String); TextPtr=Text; strcpy(TextPtr,TpStr); Count=ZeroAndCountCommas(TextPtr); if (Count!=2) GObject::Error(ERR_FATAL,"Problem with option %s\n",String); TPBase=atol(TextPtr); TextPtr+=strlen(TextPtr)+1; TPWidth=atol(TextPtr); TextPtr+=strlen(TextPtr)+1; TPHeight=atol(TextPtr); break; case 'a': TpStr= CheckFileString(String); TextPtr=Text; strcpy(TextPtr,TpStr); Count=ZeroAndCountCommas(TextPtr); for (i=0; i const &NodeTriList = ThisNode.GetTris(); vector const &NodeVtxList = ThisNode.GetRelPts(); vector const &NodeMatList = ThisNode.GetTriMaterial(); vector const &NodeUVList = ThisNode.GetUVTris(); vector const &SceneTexList= Scene.GetTexList(); vector const &SceneUsedMatList=Scene.GetUsedMaterialIdx(); int TriCount=NodeTriList.size(); int ThisIdx=Skel.size(); sGinSkel &ParentBone=Skel[ParentIdx]; vector VtxList; if (!TriCount) { // Its a Bone!! sGinSkel ThisBone; BuildBoneOut(ThisBone.Bone,ThisNode,ParentIdx); int WeightCount=ThisNode.Weights.size(); if (WeightCount) { printf("%s %i\n",ThisNode.Name,WeightCount); for (int i=0; i>7)&0x003) { case 0: PixPerWord=4; break; case 1: PixPerWord=2; break; case 2: PixPerWord=1; break; default: GObject::Error(ERR_FATAL,"Unknown Pixel Depth"); break; }; X/=PixPerWord; W/=PixPerWord; Out.x=(TPage<<6)&0x7c0; Out.x+=X; Out.y=(TPage<<4)&0x100; Out.y+=Y; Out.w=W; Out.h=H; } //*************************************************************************** int CMkActor3d::WriteTexInfoList() { CTexGrab &TexGrab=FaceList.GetTexGrab(); std::vector &TexList=TexGrab.GetTexInfo(); int ListSize=TexList.size(); int Pos=ftell(File); for (int i=0; i [ .. ] [ switches.. ]\n"); printf("Switches:\n"); printf(" -o:[FILE] Set output Dir\n"); printf(" -s:nn Set Scaling value\n"); printf(" -t:p,w,h Set TPage No,Width,Height\n"); printf(" -d: Enable Debug output\n"); printf(" -q: Enable Quadding\n"); GObject::Error(ERR_FATAL,ErrStr); } //*************************************************************************** int main (int argc, char *argv[]) { CommandLine(argc,argv,CycleCommands); if (OutStr.Empty()) Usage("No Output File Set\n"); if (TPBase==-1) Usage("No TPage Set\n"); vector const &Files = MyFiles.GetFileInfoVector(); for (int Loop=0; Loop