int MREAData::LoadTextures() { /* Get texture decompress pass to loadtxtr delete files. */ u32 i=0; char Dir[2048]={0}; char buff[2048]={0}; // TxtrHeader txtr; string CurTexture; GetWindowText(GetDlgItem(hwndMain,ID_txtFolders),Dir,2048); for(i=0; i<m_materialInfo.TextureCount; ++i) { CurTexture=Dir; CurTexture+="\\"+TextureNames[i]; memset(buff,0,2048); if(TextureNames[i].c_str()[0] == '1'){ decompFile(CurTexture.c_str(),buff); }else{ sprintf(buff,"%s",CurTexture.c_str()); } LoadTXTR(std::string(buff), &m_materialInfo.TexturesIDs[i]);//Should be loaded? //DeleteFile(buff); } return 0; }
void bgTask(CKODEKDlg *that) { /* In reality ACTION_DECOMPRESS must wait for DECOMPRESS_FILENAME to finish */ dlg = that;//for easy modular functions switch (what()) { //case START: break; case ACTION_COMPRESS: compFile(); break; case ACTION_DECOMPRESS: decompFile(); break; case ACTION_STREAM: stream(); break; //case END: break; //case TERM: break; //case ERRORBOX: break; case DECOMPRESS_FILENAME: decompFileName(); break; } }
int LoadFile(char* File){ HANDLE hFind; WIN32_FIND_DATA ffd; BOOL bFound = TRUE; string filestr; int TreeCount=0; char Dir[2048]={0}; char buff[2048]={0}; int i=0; int Decomp=0; char ext[5]={0}; //Call the deconstructot XD JUST IN CASE You know //SendMessage(lstFiles.thishwnd(), LB_GETTEXT, (WPARAM)lstFiles.GetListIndex(), (LPARAM)buff); if(File[0]=='1'){//We need to decomp this Decomp=1; } OutputDebugString(File); OutputDebugString("\n"); filestr=strCurDir+"\\"+File; if(filestr.size()==0){ MessageBox(0,"OH SHIT MAN","ERROR",MB_OK); } if(Decomp==1){ memset(buff,0,2048); decompFile(filestr.c_str(),buff); filestr=buff; } switch(FileType){ case 0: xRot=-90; yRot=0; zRot=0; xCamera=0.0f; yCamera=0;//-0.8f; zCamera=-5.0;//-2.6f; //MREA.~MREAData(); //CMDL.~cmdlContainment(); CMDL.DeleteMe(); CMDL.Read((char*)filestr.c_str()); break; case 1://Not supported yet TXTR xRot=0; yRot=0; zRot=0; xCamera=0.0f; yCamera=0;//-0.8f; zCamera=-5.0;//-2.6f; glDeleteTextures(1,&g_textureID); LoadsTXTR((char*)filestr.c_str()); break; case 2://Not supported yet xRot=-90; yRot=0; zRot=0; xCamera=0.0f; yCamera=0;//-0.8f; zCamera=-5.0;//-2.6f; ReadCINF((char*)filestr.c_str()); break; case 3: xRot=-90; yRot=0; zRot=0; xCamera=0.0f; yCamera=0;//-0.8f; zCamera=-10.0;//-2.6f; CMDL.~cmdlContainment(); MREA.~MREAData(); MREA.Read((char*)filestr.c_str()); break; } sprintf(buff,"X Axis rotation:\n%f",xRot); SetWindowText(GetDlgItem(hwndMain,ID_XAX_ROT),buff); sprintf(buff,"Y Axis rotation:\n%f",yRot); SetWindowText(GetDlgItem(hwndMain,ID_YAX_ROT),buff); sprintf(buff,"Z Axis rotation:\n%f",zRot); SetWindowText(GetDlgItem(hwndMain,ID_ZAX_ROT),buff); DrawGLScene(); InvalidateRect(hwndGL,0,1); //Delete decomped file if(Decomp==1){ DeleteFile(filestr.c_str()); Decomp=0; } return 0; }