1 /*
2  * OpenClonk, http://www.openclonk.org
3  *
4  * Copyright (c) 2005, Günther Brammer
5  * Copyright (c) 2010-2016, The OpenClonk Team and contributors
6  *
7  * Distributed under the terms of the ISC license; see accompanying file
8  * "COPYING" for details.
9  *
10  * "Clonk" is a registered trademark of Matthes Bender, used with permission.
11  * See accompanying file "TRADEMARK" for details.
12  *
13  * To redistribute this file separately, substitute the full license texts
14  * for the above references.
15  */
16 
17 // To be directly included by platform-specific implementations
18 
C4ConsoleGUI()19 C4ConsoleGUI::C4ConsoleGUI()
20 {
21 	state = new C4ConsoleGUI::State(this);
22 }
23 
~C4ConsoleGUI()24 C4ConsoleGUI::~C4ConsoleGUI() {delete state;}
25 
26 #define DEFINE_STANDARD_DLG_METHODS(cls)\
27 cls::cls()\
28 {\
29 	state = new cls::State(this);\
30 	Default();\
31 }\
32 \
33 cls::~cls()\
34 {\
35 	Clear();\
36 	delete state;\
37 }\
38 
DEFINE_STANDARD_DLG_METHODS(C4ToolsDlg)39 DEFINE_STANDARD_DLG_METHODS(C4ToolsDlg)
40 
41 void C4ToolsDlg::Clear()
42 {
43 	state->Clear();
44 	Console.ToolsDlgClose();
45 	Active = false;
46 }
47 
Default()48 void C4ToolsDlg::Default()
49 {
50 	Active = false;
51 	Tool = SelectedTool = C4TLS_Brush;
52 	Grade = C4TLS_GradeDefault;
53 	ModeIFT = true;
54 	SCopy("Earth",Material);
55 	SCopy("earth",Texture);
56 	ModeBack = false;
57 	SCopy("Tunnel", BackMaterial);
58 	SCopy("tunnel", BackTexture);
59 	state->Default();
60 }
61