void CMainFrame::OnFileOpen() { LPCSTR psFullPathedFilename = InputLoadFileName("", // LPCSTR psInitialLoadName, "Load Model", // LPCSTR psCaption, Filename_PathOnly(Model_GetFullPrimaryFilename()), // "S:\\baseq3\\models\\test\\bonehier", // LPCSTR psInitialDir, Model_GetSupportedTypesFilter(true) // LPCSTR psFilter ); if (psFullPathedFilename) { GetActiveDocument()->OnOpenDocument(psFullPathedFilename); } }
void CMainFrame::OnViewScreenshotFile() { if (Model_Loaded()) { CWaitCursor wait; // slightly iffy here, I'm going to assume that the rendering context is still valid from last time. // I can't do much else because I need to supply DC shit that I don't have in order to issue an OnDraw // command to do it legally, so f**k it... // gbTextInhibit = AppVars.bCleanScreenShots; //true; { ModelList_Render( g_iScreenWidth, g_iScreenHeight ); // render to back buffer // generate a filename... // char sBaseName[MAX_PATH]; sprintf(sBaseName, Filename_WithoutPath(Filename_PathOnly(Model_GetFullPrimaryFilename()))); // // look for a numbered slot to snapshot to... // #define NUM_SAVE_SLOTS 1000 for (int iName=0; iName<NUM_SAVE_SLOTS; iName++) { char sFilename[MAX_PATH]; if (iName==NUM_SAVE_SLOTS) { ErrorBox(va("Couldn't find a free save slot! (tried %d slots)",NUM_SAVE_SLOTS)); } sprintf(sFilename, "c:\\%s_%03d.bmp",sBaseName,iName); if (!FileExists(sFilename)) { ScreenShot(sFilename,va("(C) Raven Software %s",GetYearAsString())); BMP_Free(); break; } } } gbTextInhibit = false; } else { ErrorBox("No model loaded to work out path from!\n\n( So duhhhh... why try to take a snapshot? )"); } m_splitter.Invalidate(false); }
void CMainFrame::OnModelSaveAs() { LPCSTR psFullPathedFilename = InputSaveFileName(va("%s",Filename_WithoutExt(Model_GetFullPrimaryFilename())), "Save Model", // LPCSTR psCaption, Filename_PathOnly(Model_GetFullPrimaryFilename()), // "S:\\baseq3\\models\\test\\bonehier", // LPCSTR psInitialDir, Model_GetSupportedTypesFilter(true), // LPCSTR psFilter ".glm" ); if (psFullPathedFilename) { Model_Save(psFullPathedFilename); } }
bool Anims_ReadFile_ANIMATION_CFG(ModelContainer_t *pContainer, LPCSTR psLocalFilename_GLA) { LPCSTR psFilename = va("%s%s/animation.cfg",gamedir,Filename_PathOnly(psLocalFilename_GLA)); FILE *fHandle = fopen(psFilename,"rt"); if (fHandle) { if (LoadAnimationCFG(psFilename, pContainer, fHandle)) { // } fclose(fHandle); } /* else { ErrorBox( va("Couldn't open file: %s\n", psFilename)); return false; } */ return !!(pContainer->SequenceList.size()); }
const char *CStringEdPackage::ExtractLanguageFromPath( const char *psFileName ) { return Filename_WithoutPath( Filename_PathOnly( psFileName ) ); }