Subversion Repositories spk

Rev

Rev 36 | Rev 170 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36 Rev 116
Line 4... Line 4...
4
namespace Creator {
4
namespace Creator {
5
ImportShip::ImportShip(String ^id, CVirtualFileSystem *pVfs)
5
ImportShip::ImportShip(String ^id, String ^shipName, CVirtualFileSystem *pVfs)
6
{
6
{
7
	InitializeComponent();
7
	InitializeComponent();
8
 
8
 
-
 
9
	if ( shipName && shipName->Length )
-
 
10
		this->Text = this->Text + ": " + shipName + " (" + id + ")";
-
 
11
	else
9
	this->Text = this->Text + " (" + id + ")";
12
		this->Text = this->Text + " (" + id + ")";
10
 
13
 
11
	this->button1->Visible = false;
14
	this->button1->Visible = false;
12
	this->pictureBox1->Visible = false;
15
	this->pictureBox1->Visible = false;
13
	this->pictureBox2->Visible = false;
16
	this->pictureBox2->Visible = false;
14
	this->pictureBox3->Visible = false;
17
	this->pictureBox3->Visible = false;
Line 27... Line 30...
27
 
30
 
28
	m_pInfo = new CProgressInfoDone;
31
	m_pInfo = new CProgressInfoDone;
29
	m_pInfo->UpdateStatus(IMPORTSHIP_NONE);
32
	m_pInfo->UpdateStatus(IMPORTSHIP_NONE);
30
	m_lModels = NULL;
33
	m_lModels = NULL;
31
	m_iStatus = IMPORTSHIP_SCENE;
34
	m_iStatus = IMPORTSHIP_SCENE;
-
 
35
 
-
 
36
	_sShipName = shipName;
32
}
37
}
33
 
38
 
34
void ImportShip::StartImport()
39
void ImportShip::StartImport()
35
{
40
{
36
	m_pShip = new CXspFile();
41
	m_pShip = new CXspFile();
-
 
42
	if ( _sShipName ) m_pShip->setName(_S(_sShipName));
37
	m_bError = false;
43
	m_bError = false;
38
	m_iStatus = IMPORTSHIP_SCENE;
44
	m_iStatus = IMPORTSHIP_SCENE;
39
	this->backgroundWorker1->RunWorkerAsync();
45
	this->backgroundWorker1->RunWorkerAsync();
40
}
46
}
41
 
47
 
42
void ImportShip::Import()
48
void ImportShip::Import()
43
{
49
{
44
	m_bError = false;
50
	m_bError = false;
45
	if ( m_iStatus <= IMPORTSHIP_SCENE )
51
	if ( m_iStatus <= IMPORTSHIP_SCENE )
46
	{
52
	{
Line 66... Line 72...
66
	}
72
	}
67
	else if ( m_iStatus == IMPORTSHIP_PACK )
73
	else if ( m_iStatus == IMPORTSHIP_PACK )
68
	{
74
	{
69
		m_pShip->PackAllFiles();
75
		m_pShip->PackAllFiles();
70
		m_iStatus = IMPORTSHIP_DONE;
76
		m_iStatus = IMPORTSHIP_DONE;
71
	}
77
	}
72
	else if ( m_iStatus > IMPORTSHIP_EXTRACTSCENE )
78
	else if ( m_iStatus > IMPORTSHIP_EXTRACTSCENE )
73
	{
79
	{
74
		m_bError = !m_pShip->processSceneFileSection(m_iStatus, m_pVfs, m_lModels, m_pInfo);
80
		m_bError = !m_pShip->processSceneFileSection(m_iStatus, m_pVfs, m_lModels, m_pInfo);
75
		if ( m_bError ) m_sError = "Unable to process scene file (Status=" + (long)m_iStatus;
81
		if ( m_bError ) m_sError = "Unable to process scene file (Status=" + (long)m_iStatus;
76
		++m_iStatus;
82
		++m_iStatus;
Line 106... Line 112...
106
	 if ( m_iStatus > IMPORTSHIP_PACK )
112
	 if ( m_iStatus > IMPORTSHIP_PACK )
107
		 this->pictureBox10->Visible = true;
113
		 this->pictureBox10->Visible = true;
108
 
114
 
109
	 if ( m_iStatus < IMPORTSHIP_DONE )
115
	 if ( m_iStatus < IMPORTSHIP_DONE )
110
		 this->backgroundWorker1->RunWorkerAsync();
116
		 this->backgroundWorker1->RunWorkerAsync();
111
	 else
117
	 else {
112
		 this->button1->Visible = true;
118
		 this->button1->Visible = true;
-
 
119
		 if ( _sShipName && _sShipName->Length ) m_pShip->setName(_S(_sShipName));
-
 
120
	 }
113
}
121
}
114
 
122
 
115
void ImportShip::_cleanUp()
123
void ImportShip::_cleanUp()
116
{
124
{
117
	delete m_pInfo;
125
	delete m_pInfo;