157 lines
4.7 KiB
C++
157 lines
4.7 KiB
C++
//ROMTEAM WorldEditor
|
|
////////////////////////////////////////////////////////////////////////////////////////
|
|
// File : EdThread.cpp : implementation file
|
|
// Author :
|
|
// Date :
|
|
// Description :
|
|
////////////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//ROMTEAM WorldEditor (Cristian Stegaru 11/97)
|
|
|
|
#include "stdafx.h"
|
|
#include "3DGe_res.h" // main symbols
|
|
#include "ACP_Base.h"
|
|
#include "incITF.h" // interface
|
|
#include "incGAM.h"
|
|
#include "3DInterf.hpp"
|
|
//ENDROMTEAM WorldEditor (Cristian Stegaru)
|
|
#include "EdThread.h"
|
|
|
|
//#include "MyDocument.h"
|
|
#include "ITView.h"
|
|
#include "EToolBar.h"
|
|
#include "ITFrame.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CEdThread
|
|
|
|
IMPLEMENT_DYNCREATE(CEdThread, CWinThread)
|
|
|
|
BOOL CEdThread::m_bAlreadyRunning = FALSE;
|
|
CEdThread::CEdThread()
|
|
{
|
|
m_pFrame = NULL;
|
|
m_pDocTemplate = NULL;
|
|
m_pLinkDll = NULL;
|
|
}
|
|
|
|
CEdThread::~CEdThread()
|
|
{
|
|
if (m_pFrame)
|
|
delete m_pFrame;
|
|
|
|
if (m_pDocTemplate)
|
|
delete m_pDocTemplate;
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Method : InitInstance
|
|
// Date : 97.11
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Description :
|
|
// Author : Cristian Stegaru
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Modification :
|
|
// Date :
|
|
// By :
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
BOOL CEdThread::InitInstance()
|
|
{
|
|
if (m_bAlreadyRunning)
|
|
return FALSE;
|
|
|
|
m_bAlreadyRunning = TRUE;
|
|
m_pDocTemplate = new CSingleDocTemplate(
|
|
IDR_INDEXED_TRIANGLE,
|
|
RUNTIME_CLASS(CDocument),
|
|
RUNTIME_CLASS(CIndexedTriangleFrame), // main SDI frame window
|
|
RUNTIME_CLASS(CIndexedTriangleView));
|
|
|
|
// if (NULL != pDocTemplate)
|
|
// pDocTemplate->OpenDocumentFile(NULL);
|
|
|
|
if (NULL != m_pDocTemplate)
|
|
{
|
|
CFrameWnd *pFrame = m_pDocTemplate->CreateNewFrame(NULL, NULL);
|
|
ASSERT(pFrame->IsKindOf (RUNTIME_CLASS (CIndexedTriangleFrame)));
|
|
m_pFrame = (CIndexedTriangleFrame *)pFrame;
|
|
ASSERT (m_pFrame);
|
|
m_pFrame->InitialUpdateFrame(NULL, TRUE);
|
|
}
|
|
|
|
return TRUE;
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Method : ExitInstance
|
|
// Date : 97.11
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Description :
|
|
// Author : Cristian Stegaru
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Modification :
|
|
// Date :
|
|
// By :
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
int CEdThread::ExitInstance()
|
|
{
|
|
m_bAlreadyRunning = FALSE;
|
|
return CWinThread::ExitInstance();
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Method : mfn_pGetITEditor ()
|
|
// Date : 97.11
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Description :
|
|
// Author : Cristian Stegaru
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Modification :
|
|
// Date :
|
|
// By :
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
CTriEdit* CEdThread::mfn_pGetITEditor ()
|
|
{
|
|
if (m_pFrame)
|
|
return m_pFrame->mfn_pGetITEditor ();
|
|
return NULL;
|
|
}
|
|
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Method : mfn_bCreateITObject
|
|
// Date : 97.11
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Description :
|
|
// Author : Cristian Stegaru
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
// Modification :
|
|
// Date :
|
|
// By :
|
|
//////////////////////////////////////////////////////////////////////////////////////////////////////
|
|
BOOL CEdThread::mfn_bCreateITObject (CTriEdit *pITEditor, CString csName)
|
|
{
|
|
if (m_pLinkDll)
|
|
{
|
|
m_pLinkDll->mfn_bCreateITObject (pITEditor, csName);
|
|
return TRUE;
|
|
}
|
|
return FALSE;
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CEdThread, CWinThread)
|
|
//{{AFX_MSG_MAP(CEdThread)
|
|
// NOTE - the ClassWizard will add and remove mapping macros here.
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CEdThread message handlers
|