Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

261 lines
5.6 KiB

  1. //========= Copyright � 1996-2005, Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. //
  9. // Half-Life Model Viewer (c) 1999 by Mete Ciragan
  10. //
  11. // file: ViewerSettings.h
  12. // last modified: May 29 1999, Mete Ciragan
  13. // copyright: The programs and associated files contained in this
  14. // distribution were developed by Mete Ciragan. The programs
  15. // are not in the public domain, but they are freely
  16. // distributable without licensing fees. These programs are
  17. // provided without guarantee or warrantee expressed or
  18. // implied.
  19. //
  20. // version: 1.2
  21. //
  22. // email: [email protected]
  23. // web: http://www.swissquake.ch/chumbalum-soft/
  24. //
  25. #ifndef INCLUDED_VIEWERSETTINGS
  26. #define INCLUDED_VIEWERSETTINGS
  27. #include "mathlib/vector.h"
  28. #include "rubikon/param_types.h"
  29. #include "utlvector.h"
  30. enum // render modes
  31. {
  32. RM_WIREFRAME = 0,
  33. // RM_FLATSHADED,
  34. RM_SMOOTHSHADED,
  35. RM_TEXTURED,
  36. RM_BONEWEIGHTS,
  37. RM_SHOWBADVERTEXDATA,
  38. RM_TEXCOORDS,
  39. RM_SHOWCOLOCATED,
  40. };
  41. enum //draw model pass modes. Useful for rendering hitboxes on top of submodels, for example
  42. {
  43. PASS_DEFAULT = 0, // draw geometry, hitboxes, bones, etc. Any selected options
  44. PASS_MODELONLY, // draw only geometry, skip rendering hitboxes and so on
  45. PASS_EXTRASONLY // draw only extras
  46. };
  47. #define HLMV_MAX_MERGED_MODELS 12
  48. enum HitboxEditMode
  49. {
  50. HITBOX_EDIT_ROTATION = 0,
  51. HITBOX_EDIT_BBMIN,
  52. HITBOX_EDIT_BBMAX,
  53. };
  54. enum qccompilestatus
  55. {
  56. QCSTATUS_UNKNOWN = 0,
  57. QCSTATUS_NOLOGFILE,
  58. QCSTATUS_COMPILING,
  59. QCSTATUS_ERROR,
  60. QCSTATUS_COMPLETE_WITH_WARNING,
  61. QCSTATUS_COMPLETE
  62. };
  63. struct qcpathrecord_t
  64. {
  65. char szAbsPath[1024];
  66. char szPrettyPath[1024];
  67. char szLogFilePath[1024];
  68. char szCWDPath[1024];
  69. char szMostRecentWarningOrError[1024];
  70. char szModelPath[1024];
  71. qccompilestatus status;
  72. void InitFromAbsPath( const char* szInputAbsPath )
  73. {
  74. V_strcpy_safe( szAbsPath, szInputAbsPath );
  75. V_FileBase( szInputAbsPath, szPrettyPath, sizeof(szPrettyPath) );
  76. V_strcpy_safe( szLogFilePath, szInputAbsPath );
  77. V_SetExtension( szLogFilePath, ".log", sizeof(szLogFilePath) );
  78. V_strcpy_safe( szCWDPath, szInputAbsPath );
  79. V_StripFilename( szCWDPath );
  80. }
  81. bool DoesAbsPathMatch( const char* szOther )
  82. {
  83. return ( !V_strcmp( szAbsPath, szOther ) );
  84. }
  85. qcpathrecord_t()
  86. {
  87. szAbsPath[0] = '\0';
  88. szPrettyPath[0] = '\0';
  89. szLogFilePath[0] = '\0';
  90. szCWDPath[0] = '\0';
  91. szMostRecentWarningOrError[0] = '\0';
  92. szModelPath[0] = '\0';
  93. status = QCSTATUS_UNKNOWN;
  94. }
  95. };
  96. #define MAX_NUM_QCPATH_RECORDS 64
  97. extern CUtlVector< qcpathrecord_t > g_QCPathRecords;
  98. struct ViewerSettings
  99. {
  100. char registrysubkey[ 64 ];
  101. int application_mode; // 0 expression, 1 choreo
  102. bool showHitBoxes;
  103. int showHitBoxSet;
  104. int showHitBoxNumber;
  105. bool showBones;
  106. bool showAttachments;
  107. bool showPhysicsModel;
  108. bool showPhysicsPreview;
  109. bool showSequenceBoxes;
  110. bool enableIK;
  111. bool enableTargetIK;
  112. bool showNormals;
  113. bool showTangentFrame;
  114. bool overlayWireframe;
  115. bool enableNormalMapping;
  116. bool enableDisplacementMapping;
  117. bool enableParallaxMapping;
  118. bool enableSpecular;
  119. bool showIllumPosition;
  120. bool playSounds;
  121. // Current attachment we're editing. -1 if none.
  122. int m_iEditAttachment;
  123. bool showLightingCenter;
  124. int highlightPhysicsBone;
  125. int highlightHitbox;
  126. int highlightBone;
  127. QAngle lightrot; // light rotation
  128. float lColor[4]; // directional color
  129. float aColor[4]; // ambient color
  130. // external
  131. // model
  132. float fov; // horizontal field of view
  133. // render
  134. int renderMode;
  135. bool showBackground;
  136. bool showGround;
  137. bool showTexture;
  138. bool showMovement;
  139. bool showShadow;
  140. bool showOrbitCircle;
  141. bool allowOrbitYaw;
  142. int texture;
  143. int skin;
  144. int materialIndex;
  145. bool showOriginAxis;
  146. float originAxisLength;
  147. // animation
  148. float speedScale;
  149. bool blendSequenceChanges;
  150. bool animateWeapons;
  151. // softbodies
  152. bool simulateSoftbodies;
  153. // bodyparts and bonecontrollers
  154. //int submodels[32];
  155. //float controllers[8];
  156. // fullscreen
  157. int xpos, ypos;
  158. int width, height;
  159. bool cds;
  160. // colors
  161. float bgColor[4]; // background color
  162. float gColor[4];
  163. // misc
  164. bool pause;
  165. bool rotating;
  166. bool mousedown;
  167. HitboxEditMode hitboxEditMode;
  168. bool showBoneNames;
  169. // only used for fullscreen mode
  170. // char modelFile[256];
  171. //char backgroundTexFile[256];
  172. //char groundTexFile[256];
  173. int lod;
  174. bool autoLOD;
  175. bool softwareSkin;
  176. bool overbright;
  177. int thumbnailsize;
  178. int thumbnailsizeanim;
  179. int speechapiindex;
  180. int cclanguageid; // Close captioning language id (see sentence.h enum)
  181. bool showHidden;
  182. bool showActivities;
  183. bool showSequenceIndices;
  184. bool sortSequences;
  185. bool dotaMode;
  186. bool faceposerToolsDriveMouth;
  187. char mergeModelFile[HLMV_MAX_MERGED_MODELS][256];
  188. bool secondaryLights;
  189. RnDebugDrawOptions_t softbodyDrawOptions;
  190. ViewerSettings();
  191. };
  192. extern ViewerSettings g_viewerSettings;
  193. class StudioModel;
  194. void InitViewerSettings ( const char *subkey );
  195. bool LoadViewerSettings (const char *filename, StudioModel *pModel );
  196. bool SaveViewerSettings (const char *filename, StudioModel *pModel );
  197. bool LoadViewerRootSettings( void );
  198. bool SaveViewerRootSettings( void );
  199. bool SaveCompileQCPathSettings( void );
  200. bool LoadCompileQCPathSettings( void );
  201. // For saving/loading "global" settings
  202. bool LoadViewerSettingsInt( char const *keyname, int *value );
  203. bool SaveViewerSettingsInt ( const char *keyname, int value );
  204. struct debug_vert_weight_t
  205. {
  206. int index;
  207. float flweight;
  208. };
  209. extern int g_BoneWeightInspectVert;
  210. extern debug_vert_weight_t g_BoneWeightInspectResults[3];
  211. #endif // INCLUDED_VIEWERSETTINGS