annotate Engine/Tables/StorylineTextTable.cpp @ 2499:68cdef6879a0

engine folder
author Ritor1
date Fri, 19 Sep 2014 02:57:42 +0600
parents
children
rev   line source
2499
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
1 #define _CRTDBG_MAP_ALLOC
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
2 #include <stdlib.h>
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
3 #include <crtdbg.h>
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
4
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
5 #define _CRT_SECURE_NO_WARNINGS
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
6 #include <stdlib.h>
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
7 #include <string.h>
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
8
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
9 #include "../LOD.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
10 #include "../texts.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
11 #include "StorylineTextTable.h"
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
12
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
13 char *pHistoryTXT_Raw;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
14 struct StorylineText *pStorylineText;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
15
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
16 //----- (00453E6D) --------------------------------------------------------
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
17 void StorylineText::Initialize()
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
18 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
19 char* test_string;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
20
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
21 free(pHistoryTXT_Raw);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
22 pHistoryTXT_Raw = (char *)pEvents_LOD->LoadRaw("history.txt", 0);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
23 strtok(pHistoryTXT_Raw, "\r");
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
24
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
25 StoreLine[0].pText=nullptr;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
26 StoreLine[0].pPageTitle=nullptr;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
27 StoreLine[0].uTime=0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
28 StoreLine[0].f_9=0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
29 StoreLine[0].f_A=0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
30 StoreLine[0].f_B=0;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
31
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
32 for (int i=0;i<28;++i)
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
33 {
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
34 test_string = strtok(NULL, "\r") + 1;
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
35 auto tokens = Tokenize(test_string, '\t');
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
36
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
37 StoreLine[i+1].pText = RemoveQuotes(tokens[1]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
38 StoreLine[i+1].uTime = atoi(tokens[2]); //strange but in text here string not digit
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
39 StoreLine[i+1].pPageTitle = RemoveQuotes(tokens[3]);
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
40 }
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
41
68cdef6879a0 engine folder
Ritor1
parents:
diff changeset
42 }