summaryrefslogtreecommitdiff
path: root/utils/hlmv/viewersettings.h
blob: 9fd8a34dd54673237a3825b3a8062ebf34f1ae52 (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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//
//=============================================================================//
//
//                 Half-Life Model Viewer (c) 1999 by Mete Ciragan
//
// file:           ViewerSettings.h
// last modified:  May 29 1999, Mete Ciragan
// copyright:      The programs and associated files contained in this
//                 distribution were developed by Mete Ciragan. The programs
//                 are not in the public domain, but they are freely
//                 distributable without licensing fees. These programs are
//                 provided without guarantee or warrantee expressed or
//                 implied.
//
// version:        1.2
//
// email:          [email protected]
// web:            http://www.swissquake.ch/chumbalum-soft/
//
#ifndef INCLUDED_VIEWERSETTINGS
#define INCLUDED_VIEWERSETTINGS

#include "mathlib/vector.h"

enum // render modes
{
	RM_WIREFRAME = 0,
//	RM_FLATSHADED,
	RM_SMOOTHSHADED,
	RM_TEXTURED,
	RM_BONEWEIGHTS,
	RM_SHOWBADVERTEXDATA,
	RM_TEXCOORDS,
};

#define HLMV_MAX_MERGED_MODELS 12

struct ViewerSettings
{
	char	registrysubkey[ 64 ];
	int		application_mode;	// 0 expression, 1 choreo

	bool showHitBoxes;
	bool showBones;
	bool showAttachments;
	bool showPhysicsModel;
	bool showPhysicsPreview;
	bool showSequenceBoxes;
	bool enableIK;
	bool enableTargetIK;
	bool showNormals;
	bool showTangentFrame;
	bool overlayWireframe;
	bool enableNormalMapping;
	bool enableParallaxMapping;
	bool enableSpecular;
	bool showIllumPosition;
	bool playSounds;

	// Current attachment we're editing. -1 if none.
	int m_iEditAttachment;
	bool showLightingCenter;
	int  highlightPhysicsBone;
	int  highlightHitbox;
	int  highlightBone;
	QAngle lightrot;	// light rotation
	float lColor[4];	// directional color
	float aColor[4];	// ambient color

	// external

	// model 
	float  fov;		// horizontal field of view

	// render
	int renderMode;
	bool showBackground;
	bool showGround;
	bool showTexture;
	bool showMovement;
	bool showShadow;
	int texture;
	int skin;
	int materialIndex;
	bool showOriginAxis;
	float originAxisLength;

	// animation
	float speedScale;
	bool blendSequenceChanges;
	bool animateWeapons;

	// bodyparts and bonecontrollers
	//int submodels[32];
	//float controllers[8];

	// fullscreen
	int xpos, ypos;
	int width, height;
	bool cds;

	// colors
	float bgColor[4];	// background color
	float gColor[4];

	// misc
	bool pause;
	bool rotating;
	bool mousedown;

	// only used for fullscreen mode
	// char modelFile[256];
	//char backgroundTexFile[256];
	//char groundTexFile[256];

	int lod;
	bool autoLOD;
	bool softwareSkin;
	bool overbright;

	int	thumbnailsize;
	int thumbnailsizeanim;

	int	speechapiindex;
	int cclanguageid; // Close captioning language id (see sentence.h enum)

	bool showHidden;
	bool showActivities;

	bool faceposerToolsDriveMouth;

	char mergeModelFile[HLMV_MAX_MERGED_MODELS][256];

	ViewerSettings();

};

extern ViewerSettings g_viewerSettings;
class StudioModel;

void InitViewerSettings ( const char *subkey );
bool LoadViewerSettings (const char *filename, StudioModel *pModel );
bool SaveViewerSettings (const char *filename, StudioModel *pModel );
bool LoadViewerRootSettings( void );
bool SaveViewerRootSettings( void );

// For saving/loading "global" settings
bool LoadViewerSettingsInt( char const *keyname, int *value );
bool SaveViewerSettingsInt ( const char *keyname, int value );


#endif // INCLUDED_VIEWERSETTINGS