annotate StorylineTextTable.cpp @ 2489:ceda74e07201

.
author Ritor1
date Thu, 11 Sep 2014 17:30:59 +0600
parents f4af3b203f65
children
rev   line source
2415
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2369
diff changeset
1 #define _CRTDBG_MAP_ALLOC
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2369
diff changeset
2 #include <stdlib.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2369
diff changeset
3 #include <crtdbg.h>
f4af3b203f65 LOD.cpp cleaned and search memory corrupt
Ritor1
parents: 2369
diff changeset
4
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
5 #define _CRT_SECURE_NO_WARNINGS
233
0df4136b6aac store_line
Gloval
parents:
diff changeset
6 #include <stdlib.h>
0df4136b6aac store_line
Gloval
parents:
diff changeset
7 #include <string.h>
0df4136b6aac store_line
Gloval
parents:
diff changeset
8
0df4136b6aac store_line
Gloval
parents:
diff changeset
9 #include "LOD.h"
0df4136b6aac store_line
Gloval
parents:
diff changeset
10 #include "texts.h"
0df4136b6aac store_line
Gloval
parents:
diff changeset
11 #include "StorylineTextTable.h"
0df4136b6aac store_line
Gloval
parents:
diff changeset
12
0df4136b6aac store_line
Gloval
parents:
diff changeset
13 char *pHistoryTXT_Raw;
0df4136b6aac store_line
Gloval
parents:
diff changeset
14 struct StorylineText *pStorylineText;
0df4136b6aac store_line
Gloval
parents:
diff changeset
15
0df4136b6aac store_line
Gloval
parents:
diff changeset
16 //----- (00453E6D) --------------------------------------------------------
0df4136b6aac store_line
Gloval
parents:
diff changeset
17 void StorylineText::Initialize()
2283
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
18 {
233
0df4136b6aac store_line
Gloval
parents:
diff changeset
19 char* test_string;
0df4136b6aac store_line
Gloval
parents:
diff changeset
20
2369
bddcaf5d5db2 removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents: 2283
diff changeset
21 free(pHistoryTXT_Raw);
237
2799737f8a74 more text parsers refactor
Gloval
parents: 233
diff changeset
22 pHistoryTXT_Raw = (char *)pEvents_LOD->LoadRaw("history.txt", 0);
2799737f8a74 more text parsers refactor
Gloval
parents: 233
diff changeset
23 strtok(pHistoryTXT_Raw, "\r");
2799737f8a74 more text parsers refactor
Gloval
parents: 233
diff changeset
24
338
1c681ad45653 history changes
zipi
parents: 329
diff changeset
25 StoreLine[0].pText=nullptr;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
26 StoreLine[0].pPageTitle=nullptr;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
27 StoreLine[0].uTime=0;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
28 StoreLine[0].f_9=0;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
29 StoreLine[0].f_A=0;
1c681ad45653 history changes
zipi
parents: 329
diff changeset
30 StoreLine[0].f_B=0;
2283
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
31
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
32 for (int i=0;i<28;++i)
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
33 {
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
34 test_string = strtok(NULL, "\r") + 1;
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
35 auto tokens = Tokenize(test_string, '\t');
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
36
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
37 StoreLine[i+1].pText = RemoveQuotes(tokens[1]);
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
38 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
39 StoreLine[i+1].pPageTitle = RemoveQuotes(tokens[3]);
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
40 }
338
1c681ad45653 history changes
zipi
parents: 329
diff changeset
41
2283
53d4e8539ca1 StorylineText::Initialize using tokenizer
Grumpy7
parents: 2253
diff changeset
42 }