Mercurial > mm7
annotate StorylineTextTable.cpp @ 2382:8c00bd4573a8
sub_407A1C - fixing wrongly identified structure variable
author | zipi |
---|---|
date | Sun, 22 Jun 2014 13:58:46 +0100 |
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 | 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 | |
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 | 18 pHistoryTXT_Raw = (char *)pEvents_LOD->LoadRaw("history.txt", 0); |
19 strtok(pHistoryTXT_Raw, "\r"); | |
20 | |
338 | 21 StoreLine[0].pText=nullptr; |
22 StoreLine[0].pPageTitle=nullptr; | |
23 StoreLine[0].uTime=0; | |
24 StoreLine[0].f_9=0; | |
25 StoreLine[0].f_A=0; | |
26 StoreLine[0].f_B=0; | |
2283 | 27 |
28 for (int i=0;i<28;++i) | |
29 { | |
30 test_string = strtok(NULL, "\r") + 1; | |
31 auto tokens = Tokenize(test_string, '\t'); | |
32 | |
33 StoreLine[i+1].pText = RemoveQuotes(tokens[1]); | |
34 StoreLine[i+1].uTime = atoi(tokens[2]); //strange but in text here string not digit | |
35 StoreLine[i+1].pPageTitle = RemoveQuotes(tokens[3]); | |
36 } | |
338 | 37 |
2283 | 38 } |