Team Fortress 2 Source Code as on 22/4/2020
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.

156 lines
3.5 KiB

  1. //========= Copyright 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. enum // render modes
  29. {
  30. RM_WIREFRAME = 0,
  31. // RM_FLATSHADED,
  32. RM_SMOOTHSHADED,
  33. RM_TEXTURED,
  34. RM_BONEWEIGHTS,
  35. RM_SHOWBADVERTEXDATA,
  36. RM_TEXCOORDS,
  37. };
  38. #define HLMV_MAX_MERGED_MODELS 12
  39. struct ViewerSettings
  40. {
  41. char registrysubkey[ 64 ];
  42. int application_mode; // 0 expression, 1 choreo
  43. bool showHitBoxes;
  44. bool showBones;
  45. bool showAttachments;
  46. bool showPhysicsModel;
  47. bool showPhysicsPreview;
  48. bool showSequenceBoxes;
  49. bool enableIK;
  50. bool enableTargetIK;
  51. bool showNormals;
  52. bool showTangentFrame;
  53. bool overlayWireframe;
  54. bool enableNormalMapping;
  55. bool enableParallaxMapping;
  56. bool enableSpecular;
  57. bool showIllumPosition;
  58. bool playSounds;
  59. // Current attachment we're editing. -1 if none.
  60. int m_iEditAttachment;
  61. bool showLightingCenter;
  62. int highlightPhysicsBone;
  63. int highlightHitbox;
  64. int highlightBone;
  65. QAngle lightrot; // light rotation
  66. float lColor[4]; // directional color
  67. float aColor[4]; // ambient color
  68. // external
  69. // model
  70. float fov; // horizontal field of view
  71. // render
  72. int renderMode;
  73. bool showBackground;
  74. bool showGround;
  75. bool showTexture;
  76. bool showMovement;
  77. bool showShadow;
  78. int texture;
  79. int skin;
  80. int materialIndex;
  81. bool showOriginAxis;
  82. float originAxisLength;
  83. // animation
  84. float speedScale;
  85. bool blendSequenceChanges;
  86. bool animateWeapons;
  87. // bodyparts and bonecontrollers
  88. //int submodels[32];
  89. //float controllers[8];
  90. // fullscreen
  91. int xpos, ypos;
  92. int width, height;
  93. bool cds;
  94. // colors
  95. float bgColor[4]; // background color
  96. float gColor[4];
  97. // misc
  98. bool pause;
  99. bool rotating;
  100. bool mousedown;
  101. // only used for fullscreen mode
  102. // char modelFile[256];
  103. //char backgroundTexFile[256];
  104. //char groundTexFile[256];
  105. int lod;
  106. bool autoLOD;
  107. bool softwareSkin;
  108. bool overbright;
  109. int thumbnailsize;
  110. int thumbnailsizeanim;
  111. int speechapiindex;
  112. int cclanguageid; // Close captioning language id (see sentence.h enum)
  113. bool showHidden;
  114. bool showActivities;
  115. bool faceposerToolsDriveMouth;
  116. char mergeModelFile[HLMV_MAX_MERGED_MODELS][256];
  117. ViewerSettings();
  118. };
  119. extern ViewerSettings g_viewerSettings;
  120. class StudioModel;
  121. void InitViewerSettings ( const char *subkey );
  122. bool LoadViewerSettings (const char *filename, StudioModel *pModel );
  123. bool SaveViewerSettings (const char *filename, StudioModel *pModel );
  124. bool LoadViewerRootSettings( void );
  125. bool SaveViewerRootSettings( void );
  126. // For saving/loading "global" settings
  127. bool LoadViewerSettingsInt( char const *keyname, int *value );
  128. bool SaveViewerSettingsInt ( const char *keyname, int value );
  129. #endif // INCLUDED_VIEWERSETTINGS