Mercurial > mm7
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 | 2 #include <stdlib.h> |
3 #include <string.h> | |
4 | |
5 #include "LOD.h" | |
6 #include "texts.h" | |
7 #include "StorylineTextTable.h" | |
8 | |
9 char *pHistoryTXT_Raw; | |
10 struct StorylineText *pStorylineText; | |
11 | |
12 //----- (00453E6D) -------------------------------------------------------- | |
13 void StorylineText::Initialize() | |
2283 | 14 { |
233 | 15 char* test_string; |
16 | |
237 | 17 if ( pHistoryTXT_Raw ) |
1583 | 18 free(pHistoryTXT_Raw); |
237 | 19 pHistoryTXT_Raw = NULL; |
20 pHistoryTXT_Raw = (char *)pEvents_LOD->LoadRaw("history.txt", 0); | |
21 strtok(pHistoryTXT_Raw, "\r"); | |
22 | |
338 | 23 StoreLine[0].pText=nullptr; |
24 StoreLine[0].pPageTitle=nullptr; | |
25 StoreLine[0].uTime=0; | |
26 StoreLine[0].f_9=0; | |
27 StoreLine[0].f_A=0; | |
28 StoreLine[0].f_B=0; | |
2283 | 29 |
30 for (int i=0;i<28;++i) | |
31 { | |
32 test_string = strtok(NULL, "\r") + 1; | |
33 auto tokens = Tokenize(test_string, '\t'); | |
34 | |
35 StoreLine[i+1].pText = RemoveQuotes(tokens[1]); | |
36 StoreLine[i+1].uTime = atoi(tokens[2]); //strange but in text here string not digit | |
37 StoreLine[i+1].pPageTitle = RemoveQuotes(tokens[3]); | |
38 } | |
338 | 39 |
2283 | 40 } |