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.

162 lines
4.4 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: mdlviewer.h
  12. // last modified: Apr 28 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_MDLVIEWER
  26. #define INCLUDED_MDLVIEWER
  27. #ifndef INCLUDED_MXWINDOW
  28. #include "mxWindow.h"
  29. #endif
  30. #define IDC_FILE_LOADMODEL 1001
  31. #define IDC_FILE_LOADBACKGROUNDTEX 1002
  32. #define IDC_FILE_LOADGROUNDTEX 1003
  33. #define IDC_FILE_UNLOADGROUNDTEX 1004
  34. #define IDC_FILE_CLOSEPAKFILE 1007
  35. #define IDC_FILE_RECENTMODELS1 1008
  36. #define IDC_FILE_RECENTMODELS2 1009
  37. #define IDC_FILE_RECENTMODELS3 1010
  38. #define IDC_FILE_RECENTMODELS4 1011
  39. #define IDC_FILE_RECENTMODELS5 1012
  40. #define IDC_FILE_RECENTMODELS6 1013
  41. #define IDC_FILE_RECENTMODELS7 1014
  42. #define IDC_FILE_RECENTMODELS8 1015
  43. #define IDC_FILE_EXIT 1016
  44. #define IDC_FILE_REFRESH 1017
  45. #define IDC_FILE_LOADMERGEDMODEL 1018
  46. #define IDC_FILE_UNLOADMERGEDMODEL 1019
  47. #define IDC_FILE_LOADMODEL_STEAM 1020
  48. #define IDC_FILE_LOADMERGEDMODEL_STEAM 1021
  49. #define IDC_FLUSH_SHADERS 1022
  50. #define IDC_OPTIONS_COLORBACKGROUND 1101
  51. #define IDC_OPTIONS_COLORGROUND 1102
  52. #define IDC_OPTIONS_COLORLIGHT 1103
  53. #define IDC_OPTIONS_COLORAMBIENT 1104
  54. #define IDC_OPTIONS_CENTERVIEW 1105
  55. #define IDC_OPTIONS_CENTERVERTS 1106
  56. #define IDC_OPTIONS_MAKESCREENSHOT 1107
  57. #define IDC_OPTIONS_DUMP 1108
  58. #define IDC_OPTIONS_VIEWMODEL 1109
  59. #define IDC_OPTIONS_SYNCHLMVCAMERA 1110
  60. #define IDC_OPTIONS_LINKHLMV 1111
  61. #define IDC_OPTIONS_UNLINKHLMV 1112
  62. #define IDC_VIEW_FILEASSOCIATIONS 1201
  63. #define IDC_VIEW_ACTIVITIES 1202
  64. #define IDC_VIEW_HIDDEN 1203
  65. #define IDC_HELP_GOTOHOMEPAGE 1301
  66. #define IDC_HELP_ABOUT 1302
  67. // Keyboard accelerators (not items on any menu...checkboxes on Render tab)
  68. #define IDC_ACCEL_WIREFRAME 1401
  69. #define IDC_ACCEL_ATTACHMENTS 1402
  70. #define IDC_ACCEL_GROUND 1403
  71. #define IDC_ACCEL_HITBOXES 1404
  72. #define IDC_ACCEL_BONES 1405
  73. #define IDC_ACCEL_BACKGROUND 1406
  74. #define IDC_ACCEL_MOVEMENT 1407
  75. #define IDC_ACCEL_NORMALS 1408
  76. #define IDC_ACCEL_TANGENTS 1409
  77. #define IDC_ACCEL_SHADOW 1410
  78. #define IDC_FILE_UNLOADMERGEDMODEL1 1414
  79. #define IDC_FILE_UNLOADMERGEDMODEL2 1415
  80. #define IDC_FILE_UNLOADMERGEDMODEL3 1416
  81. #define IDC_FILE_UNLOADMERGEDMODEL4 1417
  82. #define IDC_FILE_UNLOADMERGEDMODEL5 1418
  83. #define IDC_FILE_UNLOADMERGEDMODEL6 1419
  84. #define IDC_FILE_UNLOADMERGEDMODEL7 1420
  85. #define IDC_FILE_UNLOADMERGEDMODEL8 1421
  86. #define IDC_FILE_UNLOADMERGEDMODEL9 1422
  87. #define IDC_FILE_UNLOADMERGEDMODEL10 1423
  88. #define IDC_FILE_UNLOADMERGEDMODEL11 1424
  89. #define IDC_FILE_UNLOADMERGEDMODEL12 1425
  90. #define IDC_FILE_UNLOADALLMERGEDMODELS 1430
  91. class mxMenuBar;
  92. class MatSysWindow;
  93. class ControlPanel;
  94. class mxMenu;
  95. enum { Action, Size, Timer, Idle, Show, Hide,
  96. MouseUp, MouseDown, MouseMove, MouseDrag,
  97. KeyUp, KeyDown
  98. };
  99. class MDLViewer : public mxWindow
  100. {
  101. mxMenuBar *mb;
  102. MatSysWindow *d_MatSysWindow;
  103. ControlPanel *d_cpl;
  104. mxMenu *menuOptions;
  105. mxMenu *menuView;
  106. void loadRecentFiles ();
  107. void saveRecentFiles ();
  108. void initRecentFiles ();
  109. public:
  110. // CREATORS
  111. MDLViewer ();
  112. ~MDLViewer ();
  113. // MANIPULATORS
  114. virtual int handleEvent (mxEvent *event);
  115. void SendModelTransformToLinkedHlmv();
  116. void SendLightRotToLinkedHlmv();
  117. void redraw ();
  118. void handleIpcCommand( char *szCommand );
  119. void Refresh( void );
  120. void LoadModelFile( const char *pszFile, int slot = -1 );
  121. void SaveScreenShot( const char *pszFile );
  122. void DumpText( const char *pszFile );
  123. // ACCESSORS
  124. mxMenuBar *getMenuBar () const { return mb; }
  125. MatSysWindow *getMatSysWindow () const { return d_MatSysWindow; }
  126. int GetCurrentHitboxSet( void );
  127. private:
  128. const char* SteamGetOpenFilename();
  129. };
  130. extern MDLViewer *g_MDLViewer;
  131. extern char g_appTitle[];
  132. #endif // INCLUDED_MDLVIEWER