Subversion Repositories spk

Rev

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

Rev 1 Rev 19
Line 50... Line 50...
50
			m_pInfo->UpdateStatus(IMPORTSHIP_NONE);
50
			m_pInfo->UpdateStatus(IMPORTSHIP_NONE);
51
			m_lModels = NULL;
51
			m_lModels = NULL;
52
			m_iStatus = IMPORTSHIP_SCENE;
52
			m_iStatus = IMPORTSHIP_SCENE;
53
		}
53
		}
54
 
54
 
-
 
55
		String ^getErrorString() { return m_sError; }
55
		CXspFile *GetShip() { return m_pShip; }
56
		CXspFile *GetShip() { return m_pShip; }
56
 
57
 
57
		void StartImport()
58
		void StartImport()
58
		{
59
		{
59
			m_pShip = new CXspFile;
60
			m_pShip = new CXspFile;
Line 62... Line 63...
62
				m_bError = false;
63
				m_bError = false;
63
			else
64
			else
64
			{
65
			{
65
				delete m_pShip;
66
				delete m_pShip;
66
				m_bError = true;
67
				m_bError = true;
-
 
68
				m_sError = "Unable to open the cat file: " + m_sCatFile;
67
				this->Close();
69
				this->Close();
68
			}
70
			}
69
 
71
 
70
			m_iStatus = IMPORTSHIP_SCENE;
72
			m_iStatus = IMPORTSHIP_SCENE;
71
			this->backgroundWorker1->RunWorkerAsync();
73
			this->backgroundWorker1->RunWorkerAsync();
Line 84... Line 86...
84
				data.RemoveChar('\r');
86
				data.RemoveChar('\r');
85
				while(data.Right(1) == ";")
87
				while(data.Right(1) == ";")
86
					data.Truncate((int)data.Length() - 1);
88
					data.Truncate((int)data.Length() - 1);
87
 
89
 
88
				m_bError = !m_pShip->StartExtractShip(m_pCatFile, data, m_pInfo);
90
				m_bError = !m_pShip->StartExtractShip(m_pCatFile, data, m_pInfo);
-
 
91
				if ( m_bError ) {
-
 
92
					m_sError = "Unable to extract scene file";
-
 
93
				}
89
 
94
 
90
				m_iStatus = IMPORTSHIP_EXTRACTSCENE;
95
				m_iStatus = IMPORTSHIP_EXTRACTSCENE;
91
			}
96
			}
92
			else if ( m_iStatus == IMPORTSHIP_EXTRACTSCENE )
97
			else if ( m_iStatus == IMPORTSHIP_EXTRACTSCENE )
93
			{
98
			{
94
				m_lModels = m_pShip->ReadSceneModels();
99
				m_lModels = m_pShip->ReadSceneModels();
95
				if ( !m_lModels )
100
				if ( !m_lModels ) {
96
					m_bError = true;
101
					m_bError = true;
-
 
102
					m_sError = "Unable to read the scene file to extract model data";
-
 
103
				}
97
				++m_iStatus;
104
				++m_iStatus;
98
			}
105
			}
99
			else if ( m_iStatus == IMPORTSHIP_PACK )
106
			else if ( m_iStatus == IMPORTSHIP_PACK )
100
			{
107
			{
101
				m_pShip->PackAllFiles();
108
				m_pShip->PackAllFiles();
102
				m_iStatus = IMPORTSHIP_DONE;
109
				m_iStatus = IMPORTSHIP_DONE;
103
			}
110
			}
104
			else if ( m_iStatus > IMPORTSHIP_EXTRACTSCENE )
111
			else if ( m_iStatus > IMPORTSHIP_EXTRACTSCENE )
105
			{
112
			{
106
				m_bError = !m_pShip->ProcessSceneFileSection(m_iStatus, m_pCatFile, m_lModels, m_pInfo);
113
				m_bError = !m_pShip->ProcessSceneFileSection(m_iStatus, m_pCatFile, m_lModels, m_pInfo);
-
 
114
				if ( m_bError ) {
-
 
115
					m_sError = "Unable to process scene file (Status=" + (long)m_iStatus;
-
 
116
				}
107
				++m_iStatus;
117
				++m_iStatus;
108
			}
118
			}
109
		}
119
		}
110
 
120
 
111
	protected:
121
	protected:
Line 173... Line 183...
173
		CPackages		*m_pPackages;
183
		CPackages		*m_pPackages;
174
		String			^m_sCatFile;
184
		String			^m_sCatFile;
175
		String			^m_sID;
185
		String			^m_sID;
176
		CXspFile		*m_pShip;
186
		CXspFile		*m_pShip;
177
		CCatFile		*m_pCatFile;
187
		CCatFile		*m_pCatFile;
-
 
188
		String			^m_sError;
178
 
189
 
179
#pragma region Windows Form Designer generated code
190
#pragma region Windows Form Designer generated code
180
		/// <summary>
191
		/// <summary>
181
		/// Required method for Designer support - do not modify
192
		/// Required method for Designer support - do not modify
182
		/// the contents of this method with the code editor.
193
		/// the contents of this method with the code editor.