/*
* Copyright 2004 Perforce Software. All rights reserved.
*
* Developed by Data Shades Ltd.
*/
#include "MaxHost.h"
#include "MaxUtils.h"
#include "Translate.h"
#include "..\libp4gt\version.h"
#include "debug.h"
TCHAR *MaxHost::GetName()
{
return _T("P4GT-3dsmax");
}
TCHAR *MaxHost::GetDesc()
{
return _T("P4GT - 3ds max.");
}
TCHAR *MaxHost::GetVersion()
{
return _T(P4GT_VERSION);
}
TCHAR *MaxHost::GetHostVersion()
{
static TCHAR buff[MAX_HOST_VERSION];
float version = ( float )( Max_Get3DSMAXVersion() >> 16 ) / 1000;
_stprintf( buff, _T("3ds max version: %.1f"), version );
return buff;
}
int MaxHost::GetNumDocs()
{
return 1;
}
bool MaxHost::GetCurrDocPath( UniStrBuf &buff )
{
UniStrBuf *path = Max_GetCurFilePath();
if ( _tcsicmp(path->Text(),_T(""))==0 ) {
return false;
}
else {
// Translate::ToWinChar( path->Text(), &buff );
buff.Set( path );
currDocPath = buff;
return true;
}
return true;
}
bool MaxHost::IsCurrDocDirty()
{
if ( Max_IsSaveRequired() ) {
return true;
}
else {
return false;
}
}
void MaxHost::LoadDoc( StrPtr *path )
{
UniStrBuf buff;
// Translate::FromWinChar( path->Text(), &buff );
buff.Set( path );
Max_FileReset( TRUE );
Max_LoadFromFile( &buff );
currDocPath = buff;
// Views do not automatically updated when loading file
// GetCOREInterface()->ForceCompleteRedraw();
}
void MaxHost::LoadDoc( LPTSTR *path )
{
UniStrBuf buff;
Translate::FromWinChar( (TCHAR *)path, &buff );
Max_FileReset( TRUE );
Max_LoadFromFile( &buff );
currDocPath = buff;
// Views do not automatically updated when loading file
// GetCOREInterface()->ForceCompleteRedraw();
}
void MaxHost::SaveCurrDoc()
{
Max_SaveToFile( Max_GetCurFilePath() );
}
void MaxHost::ReloadCurrDoc()
{
Max_FileReset( TRUE );
Max_LoadFromFile( &currDocPath );
}
bool MaxHost::HasMultiDocs()
{
return false;
}
# |
Change |
User |
Description |
Committed |
|
#1
|
10140 |
Matt Attaway |
Initial release of the P4GT source code. |
|
|