Subversion Repositories spk

Rev

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

Rev 52 Rev 88
Line 4... Line 4...
4
// debug logging
4
// debug logging
5
#include "Logging/Log.h"
5
#include "Logging/Log.h"
6
 
6
 
7
// old style compression (needed to convert old formats)
7
// old style compression (needed to convert old formats)
8
#include "../../HiP/HiP.h"
8
#include "../../HiP/HiP.h"
-
 
9
 
-
 
10
#include "TextDB.h"
9
 
11
 
10
//TODO: remove this
12
//TODO: remove this
11
unsigned char *LineByLineRead ( unsigned char *data, const Utils::String &end, Utils::String *readData )
13
unsigned char *LineByLineRead ( unsigned char *data, const Utils::String &end, Utils::String *readData )
12
{
14
{
13
	Utils::String line;
15
	Utils::String line;
Line 171... Line 173...
171
			return ret;
173
			return ret;
172
		}
174
		}
173
		CLEANSPLIT(split, max)
175
		CLEANSPLIT(split, max)
174
	}
176
	}
175
	return m_sScriptType;
177
	return m_sScriptType;
-
 
178
}
-
 
179
 
-
 
180
bool CSpkFile::readWares(int iLang, CLinkList<SWareEntry> &list, const Utils::String &empWares)
-
 
181
{
-
 
182
	if ( CBaseFile::readWares(iLang, list, empWares) ) {
-
 
183
		for(CListNode<SWares> *node = m_lWares.Front(); node; node = node->next()) {
-
 
184
 
-
 
185
			SWareEntry *ware = new SWareEntry;
-
 
186
 
-
 
187
			for(CListNode<SWaresText> *textNode = node->Data()->lText.Front(); textNode; textNode = textNode->next()) {
-
 
188
				ware->name = textNode->Data()->sName;
-
 
189
				ware->description = textNode->Data()->sDesc;
-
 
190
				if ( textNode->Data()->iLang == iLang )	{
-
 
191
					break;
-
 
192
				}
-
 
193
			}
-
 
194
 
-
 
195
			if ( ware->name.empty() ) {
-
 
196
				ware->name = _pTextDB->get(iLang, node->Data()->iTextPage, node->Data()->iTextID);
-
 
197
			}
-
 
198
			if ( ware->description.empty() ) {
-
 
199
				ware->description = _pTextDB->get(iLang, node->Data()->iTextPage, node->Data()->iDescID);
-
 
200
			}
-
 
201
 
-
 
202
			ware->id = node->Data()->sID;
-
 
203
			ware->relval = node->Data()->iPrice;
-
 
204
			ware->position = node->Data()->iPosID;
-
 
205
			ware->type = Ware_Custom;
-
 
206
			ware->notority = node->Data()->iNotority;
-
 
207
 
-
 
208
			list.push_back(ware);
-
 
209
		}
-
 
210
 
-
 
211
		return true;
-
 
212
	}
-
 
213
 
-
 
214
	return false;
176
}
215
}
177
 
216
 
178
bool CSpkFile::WriteHeader(CFileIO &file, int valueheader, int valueComprLen)
217
bool CSpkFile::WriteHeader(CFileIO &file, int valueheader, int valueComprLen)
179
{
218
{
180
	return file.write("SPKCycrow;%.2f;%d;%d\n", FILEVERSION, valueheader, valueComprLen);
219
	return file.write("SPKCycrow;%.2f;%d;%d\n", FILEVERSION, valueheader, valueComprLen);