annotate StorylineTextTable.cpp @ 2377:6eb63623cbe8

Слияние
author Ritor1
date Mon, 02 Jun 2014 12:31:28 +0600
parents bddcaf5d5db2
children f4af3b203f65
rev   line source
2253
aff7a7b072b7 adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents: 2153
diff changeset
1 #define _CRT_SECURE_NO_WARNINGS
233
0df4136b6aac store_line
Gloval
parents:
diff changeset
2 #include <stdlib.h>
0df4136b6aac store_line
Gloval
parents:
diff changeset
3 #include <string.h>
0df4136b6aac store_line
Gloval
parents:
diff changeset
4
0df4136b6aac store_line
Gloval
parents:
diff changeset
5 #include "LOD.h"
0df4136b6aac store_line
Gloval
parents:
diff changeset
6 #include "texts.h"
0df4136b6aac store_line
Gloval
parents:
diff changeset
7 #include "StorylineTextTable.h"
0df4136b6aac store_line
Gloval
parents:
diff changeset
8
0df4136b6aac store_line
Gloval
parents:
diff changeset
9 char *pHistoryTXT_Raw;
0df4136b6aac store_line
Gloval
parents:
diff changeset
10 struct StorylineText *pStorylineText;
0df4136b6aac store_line
Gloval
parents:
diff changeset
11
0df4136b6aac store_line
Gloval
parents:
diff changeset
12 //----- (00453E6D) --------------------------------------------------------
0df4136b6aac store_line
Gloval
parents:
diff changeset
13 void StorylineText::Initialize()
2283
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
14 {
233
0df4136b6aac store_line
Gloval
parents:
diff changeset
15 char* test_string;
0df4136b6aac store_line
Gloval
parents:
diff changeset
16
2369
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2283
diff changeset
17 free(pHistoryTXT_Raw);
237
2799737f8a74 more text parsers refactor
Gloval
parents: 233
diff changeset
18 pHistoryTXT_Raw = (char *)pEvents_LOD->LoadRaw("history.txt", 0);
2799737f8a74 more text parsers refactor
Gloval
parents: 233
diff changeset
19 strtok(pHistoryTXT_Raw, "\r");
2799737f8a74 more text parsers refactor
Gloval
parents: 233
diff changeset
20
338
1c681ad45653 history changes
zipi
parents: 329
diff changeset
21 StoreLine[0].pText=nullptr;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
22 StoreLine[0].pPageTitle=nullptr;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
23 StoreLine[0].uTime=0;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
24 StoreLine[0].f_9=0;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
25 StoreLine[0].f_A=0;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
26 StoreLine[0].f_B=0;
2283
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
27
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
28 for (int i=0;i<28;++i)
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
29 {
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
30 test_string = strtok(NULL, "\r") + 1;
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
31 auto tokens = Tokenize(test_string, '\t');
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
32
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
33 StoreLine[i+1].pText = RemoveQuotes(tokens[1]);
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
34 StoreLine[i+1].uTime = atoi(tokens[2]); //strange but in text here string not digit
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
35 StoreLine[i+1].pPageTitle = RemoveQuotes(tokens[3]);
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
36 }
338
1c681ad45653 history changes
zipi
parents: 329
diff changeset
37
2283
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
38 }