annotate StorylineTextTable.cpp @ 2342:d7f4dac06dc0

Adding Registry.h/.cpp to project
author Grumpy7
date Sun, 06 Apr 2014 12:57:04 +0200
parents 53d4e8539ca1
children bddcaf5d5db2
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
237
2799737f8a74 more text parsers refactor
Gloval
parents: 233
diff changeset
17 if ( pHistoryTXT_Raw )
1583
75fafd8ced59 Allocator (CMemory) bye-bye
Nomad
parents: 1165
diff changeset
18 free(pHistoryTXT_Raw);
237
2799737f8a74 more text parsers refactor
Gloval
parents: 233
diff changeset
19 pHistoryTXT_Raw = NULL;
2799737f8a74 more text parsers refactor
Gloval
parents: 233
diff changeset
20 pHistoryTXT_Raw = (char *)pEvents_LOD->LoadRaw("history.txt", 0);
2799737f8a74 more text parsers refactor
Gloval
parents: 233
diff changeset
21 strtok(pHistoryTXT_Raw, "\r");
2799737f8a74 more text parsers refactor
Gloval
parents: 233
diff changeset
22
338
1c681ad45653 history changes
zipi
parents: 329
diff changeset
23 StoreLine[0].pText=nullptr;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
24 StoreLine[0].pPageTitle=nullptr;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
25 StoreLine[0].uTime=0;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
26 StoreLine[0].f_9=0;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
27 StoreLine[0].f_A=0;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
28 StoreLine[0].f_B=0;
2283
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
29
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
30 for (int i=0;i<28;++i)
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
31 {
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
32 test_string = strtok(NULL, "\r") + 1;
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
33 auto tokens = Tokenize(test_string, '\t');
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
34
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
35 StoreLine[i+1].pText = RemoveQuotes(tokens[1]);
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
36 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
37 StoreLine[i+1].pPageTitle = RemoveQuotes(tokens[3]);
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
38 }
338
1c681ad45653 history changes
zipi
parents: 329
diff changeset
39
2283
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
40 }