BOOL XsiExp::ReadConfig() { TSTR filename = GetCfgFilename(); FILE* cfgStream; cfgStream = fopen(filename, "rb"); if (!cfgStream) { return FALSE; } // First item is a file version int fileVersion = _getw(cfgStream); if (fileVersion > CFG_VERSION) { // Unknown version fclose(cfgStream); return FALSE; } SetIncludeAnim(fgetc(cfgStream)); SetIncludeVertexColors(fgetc(cfgStream)); SetAlwaysSample(fgetc(cfgStream)); SetMeshFrameStep(_getw(cfgStream)); SetKeyFrameStep(_getw(cfgStream)); SetPrecision(_getw(cfgStream)); fclose(cfgStream); return TRUE; }
void BitmapIO_PNG::WriteCfg() { TCHAR filename[MAX_PATH]; GetCfgFilename(filename); //-- Find out buffer size DWORD size = EvaluateConfigure(); if (!size) return; //-- Allocate Temp Buffer BYTE *buf = (BYTE *)LocalAlloc(LPTR,size); if (!buf) return; //-- Get Data Block and Write it if (SaveConfigure(buf)) { File file(filename, _T("wb")); if (file.stream) { fwrite(buf,1,size,file.stream); } } LocalFree(buf); }
void XsiExp::WriteConfig() { TSTR filename = GetCfgFilename(); FILE* cfgStream; cfgStream = fopen(filename, "wb"); if (!cfgStream) { return; } // Write CFG version _putw(CFG_VERSION, cfgStream); fputc(GetIncludeAnim(), cfgStream); fputc(GetIncludeVertexColors(), cfgStream); fputc(GetAlwaysSample(), cfgStream); _putw(GetMeshFrameStep(), cfgStream); _putw(GetKeyFrameStep(), cfgStream); _putw(GetPrecision(), cfgStream); fclose(cfgStream); }
void BatchExporter::WriteConfig() { TSTR filename = GetCfgFilename(); FILE* cfgStream; cfgStream = fopen(filename, "w+"); if (!cfgStream) return; fputs(rbefile, cfgStream ); fclose(cfgStream); }
void BatchExporter::ReadConfig() { TSTR filename = GetCfgFilename(); FILE* cfgStream; cfgStream = fopen(filename, "r"); if (!cfgStream) return; fgets(rbefile, MAX_PATH , cfgStream ); fclose(cfgStream); }
void BitmapIO_BMP::WriteCfg() { TCHAR filename[MAX_PATH]; GetCfgFilename(filename); BMPParams tbuf; tbuf = mParams; tbuf.saved = false; File file(filename, _T("wb")); if (file.stream) { fwrite(&tbuf,1,sizeof(BMPParams),file.stream); } }
void AscOut::WriteConfig() { TSTR filename = GetCfgFilename(); FILE* cfgStream; cfgStream = fopen(filename, "wb"); if (!cfgStream) return; // Write CFG version _putw(CFG_VERSION, cfgStream); _putw(GetPrecision(), cfgStream); fclose(cfgStream); }
BOOL BitmapIO_PNG::ReadCfg() { TCHAR filename[MAX_PATH]; GetCfgFilename(filename); //-- Open Configuration File File file(filename, _T("rb")); if (!file.stream) return (FALSE); fseek(file.stream,0,SEEK_END); DWORD size = (DWORD)ftell(file.stream); if (size) { fseek(file.stream,0,SEEK_SET); //-- Allocate Temp Buffer BYTE *buf = (BYTE *)LocalAlloc(LPTR,size); if (!buf) return (FALSE); //-- Read Data Block and Set it BOOL res = FALSE; if (fread(buf,1,size,file.stream) == size) res = LoadConfigure(buf); if(!res) InitUserData(&cfg); LocalFree(buf); return (res); } return (FALSE); }
BOOL AscOut::ReadConfig() { TSTR filename = GetCfgFilename(); FILE* cfgStream; cfgStream = fopen(filename, "rb"); if (!cfgStream) return FALSE; // First item is a file version int fileVersion = _getw(cfgStream); if (fileVersion > CFG_VERSION) { // Unknown version fclose(cfgStream); return FALSE; } SetPrecision(_getw(cfgStream)); fclose(cfgStream); return TRUE; }