1 #include "pch.h"
2 #include "CGame.h"
3 #include "CHud.h"
4 #include "CGui.h"
5 #include "common/CScene.h"
6 #include "../vdrift/pathmanager.h"
7 
8 
CGui(App * app1)9 CGui::CGui(App* app1)
10 	: app(app1), bGI(0)
11 	,mGui(0), gcom(0), popup(0)
12 	//  gui
13 	,carList(0), btRplPl(0)
14 	,btNewGameCar(0)
15 	//  hud
16 	,valCountdownTime(0)
17 	,cmbGraphs(0), valGraphsType(0)
18 	//  view
19 	,bRkmh(0),bRmph(0)
20 	//  car
21 	, bRsimEasy(0), bRsimNorm(0), bRsimHard(0), bReloadSim(true)
22 	,valRplNumViewports(0)
23 	,viewBox(0), viewCar(0)
24 	,graphV(0), graphVel(0),graphVGrid(0)
25 	,graphS(0), graphSSS(0),graphSGrid(0)
26 	//  setup
27 	, iTireSet(0)
28 	,bchAbs(0),bchTcs(0)
29 	//  replay
30 	,imgCar(0),carDesc(0)
31 	,cmbBoost(0), cmbFlip(0), cmbDamage(0), cmbRewind(0)
32 	,valLocPlayers(0)
33 	,txCarSpeed(0),txCarType(0),txCarYear(0), barCarSpeed(0)
34 	,txCarAuthor(0),txTrackAuthor(0)
35 	,valRplPerc(0), valRplCur(0), valRplLen(0)
36 	,slRplPos(0), rplList(0)
37 	,valRplName(0),valRplInfo(0)
38 	,valRplName2(0),valRplInfo2(0)
39 	,edRplName(0), edRplDesc(0)
40 	,rbRplCur(0), rbRplAll(0)
41 	, bRplBack(0),bRplFwd(0)
42 	,bConvertRpl(0),iConvCur(0),iConvAll(0),iConvFiles(0),iConvPathCur(0),iConvPathAll(0)
43 	, mThrConvert(),txtConvert(0), totalConv(0),totalConvCur(0),totalConvNew(0)
44 	//  gui multiplayer
45 	,netGuiMutex(), netGameInfo()
46 	,bUpdChat(false), iChatMove(0)
47 	,bRebuildPlayerList(0), bRebuildGameList(0), bUpdateGameInfo(0)
48 	,bStartGame(0), bStartedGame(0)
49 	,tabsNet(0)
50 	,panNetServer(0), panNetGame(0), panNetTrack(0)
51 	,listServers(0), listPlayers(0)
52 	,edNetChat(0), liNetEnd(0)
53 	,btnNetRefresh(0), btnNetJoin(0), btnNetCreate(0), btnNetDirect(0)
54 	,btnNetReady(0), btnNetLeave(0)
55 	,valNetGameInfo(0), valNetPassword(0), valTrkNet(0)
56 	,edNetGameName(0), edNetChatMsg(0), edNetPassword(0)
57 	,edNetNick(0), edNetServerIP(0), edNetServerPort(0), edNetLocalPort(0)
58 	,iColLock(0),iColHost(0),iColPort(0)
59 	//  chs
60 	,liChamps(0),liStages(0), liChalls(0)
61 	,txtCh(0),valCh(0), panCh(0)
62 	,edChampStage(0),edChampEnd(0)
63 	,edChallStage(0),edChallEnd(0)
64 	, pChall(0)
65 	,edChInfo(0), edChDesc(0)
66 	,btStTut(0),  tabTut(0),  imgTut(0)
67 	,btStChamp(0),tabChamp(0),imgChamp(0)
68 	,btStChall(0),tabChall(0),imgChall(0), btChRestart(0)
69 	,btChampStage(0), btChallStage(0), valStageNum(0)
70 	,imgChampStage(0),imgChallStage(0), imgChampEndCup(0)
71 	,imgChallFail(0),imgChallCup(0)
72 	,txChallEndC(0),txChallEndF(0),txChampEndF(0)
73 	, iChSnd(0)
74 	//  other
75 	,edPerfTest(0),edTweakCol(0)
76 	,tabTweak(0),tabEdCar(0)
77 	,txtTweakPath(0)
78 	,edTweakTireSet(0),txtTweakTire(0)
79 	,liTwkTiresUser(0),liTwkTiresOrig(0)
80 	, idTwkSurf(-1), liTwkSurfaces(0)
81 	,txtTweakPathCol(0)
82 	, loadReadme(1)
83 	, iCurCar(0)
84 	,edHintTitle(0), edHintText(0), iHintCur(0), iHints(17)
85 	//  input
86 	,mBindingAction(NULL), mBindingSender(NULL)
87 	,tabInput(0)
88 	,txtInpDetail(0), panInputDetail(0)
89 	,edInputIncrease(0), chOneAxis(0)
90 {
91 	pSet = app1->pSet;
92 	sc = app1->scn->sc;
93 	pGame = app1->pGame;
94 	hud = app1->hud;
95 	data = app1->scn->data;
96 
97 	int i,c;
98 	for (i=0; i < 3; ++i)
99 	{	txtChP[i]=0;  valChP[i]=0;  }
100 
101 	for (i=0; i < iCarSt; ++i)
102 	{	txCarStTxt[i]=0;  txCarStVals[i]=0;  barCarSt[i]=0;  }
103 
104 	sListCar = "";
105 
106 	for (i=0; i < ciEdCar; ++i)
107 		edCar[i] = 0;
108 }
109 
110 
~CGui()111 CGui::~CGui()
112 {
113 	if (mThrConvert.joinable())
114 		mThrConvert.join();
115 }
116