summaryrefslogtreecommitdiff
path: root/hammer/runmap.cpp
blob: 446ec007440a75bb869c8049cb0596295f25b1e5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: The UI for simple map compiles.
//
//=============================================================================//

#include "stdafx.h"
#include "hammer.h"
#include "RunMap.h"

// memdbgon must be the last include file in a .cpp file!!!
#include <tier0/memdbgon.h>


static LPCTSTR pszSection = "Run Map";


CRunMap::CRunMap(CWnd* pParent /*=NULL*/)
	: CDialog(CRunMap::IDD, pParent)
{
	m_bSwitchMode = FALSE;

	//{{AFX_DATA_INIT(CRunMap)
	m_iVis = -1;
	m_bNoQuake = FALSE;
	m_strQuakeParms = _T("");
	m_iLight = -1;
	m_iQBSP = -1;
	m_bHDRLight = FALSE;
	//}}AFX_DATA_INIT

	// read from ini
	CWinApp *App = AfxGetApp();
	m_iQBSP = App->GetProfileInt(pszSection, "QBSP", 1);

	m_iVis = App->GetProfileInt(pszSection, "Vis", 1);
	m_iLight = App->GetProfileInt(pszSection, "Light", 1);
	m_bHDRLight = App->GetProfileInt(pszSection, "HDRLight", 0);
	m_bNoQuake = App->GetProfileInt(pszSection, "No Game", 0);
	m_strQuakeParms = App->GetProfileString(pszSection, "Game Parms", "");
}


void CRunMap::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CRunMap)
	DDX_Check(pDX, IDC_NOQUAKE, m_bNoQuake);
	DDX_Text(pDX, IDC_QUAKEPARMS, m_strQuakeParms);
	DDX_Radio(pDX, IDC_BSP0, m_iQBSP);
	DDX_Radio(pDX, IDC_VIS0, m_iVis);
	DDX_Radio(pDX, IDC_RAD0, m_iLight);
	DDX_Check(pDX, IDC_RAD_HDR, m_bHDRLight);
	//}}AFX_DATA_MAP
}


void CRunMap::SaveToIni(void)
{
	CWinApp *App = AfxGetApp();
	App->WriteProfileInt(pszSection, "QBSP", m_iQBSP);
	App->WriteProfileInt(pszSection, "Vis", m_iVis);
	App->WriteProfileInt(pszSection, "Light", m_iLight);
	App->WriteProfileInt(pszSection, "HDRLight", m_bHDRLight);
	App->WriteProfileInt(pszSection, "No Game", m_bNoQuake);
	App->WriteProfileString(pszSection, "Game Parms", m_strQuakeParms);
}


BEGIN_MESSAGE_MAP(CRunMap, CDialog)
	//{{AFX_MSG_MAP(CRunMap)
	ON_BN_CLICKED(IDC_EXPERT, OnExpert)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CRunMap message handlers

void CRunMap::OnExpert() 
{
	m_bSwitchMode = TRUE;
	EndDialog(IDOK);
}

BOOL CRunMap::OnInitDialog() 
{
	CDialog::OnInitDialog();
	return TRUE;
}