DialogTextures.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. /*
  2. ===========================================================================
  3. Doom 3 GPL Source Code
  4. Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
  6. Doom 3 Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #ifndef __DIALOGTEXTURES_H
  21. #define __DIALOGTEXTURES_H
  22. // DialogTextures.h : header file
  23. //
  24. #include <afxtempl.h>
  25. #include "GLWidget.h"
  26. /////////////////////////////////////////////////////////////////////////////
  27. // CDialogTextures dialog
  28. class CDialogTextures : public CDialog
  29. {
  30. // Construction
  31. public:
  32. enum { NONE, TEXTURES, MATERIALS, MODELS, SCRIPTS, SOUNDS, SOUNDPARENT, GUIS, PARTICLES, FX,NUMIDS };
  33. static const char *TypeNames[NUMIDS];
  34. CDialogTextures(CWnd* pParent = NULL); // standard constructor
  35. void OnCancel();
  36. void CollapseEditor();
  37. void SelectCurrentItem(bool collapse, const char *name, int id);
  38. // Dialog Data
  39. //{{AFX_DATA(CDialogTextures)
  40. enum { IDD = IDD_DIALOG_TEXTURELIST };
  41. CButton m_chkHideRoot;
  42. CButton m_btnRefresh;
  43. CButton m_btnLoad;
  44. idGLWidget m_wndPreview;
  45. CTreeCtrl m_treeTextures;
  46. //}}AFX_DATA
  47. CImageList m_image;
  48. idGLDrawable m_testDrawable;
  49. idGLDrawableMaterial m_drawMaterial;
  50. idGLDrawableModel m_drawModel;
  51. const idMaterial *editMaterial;
  52. idStr editGui;
  53. idStr currentFile;
  54. idStr mediaName;
  55. bool setTexture;
  56. bool ignoreCollapse;
  57. int mode;
  58. // Overrides
  59. // ClassWizard generated virtual function overrides
  60. //{{AFX_VIRTUAL(CDialogTextures)
  61. protected:
  62. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  63. virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
  64. //}}AFX_VIRTUAL
  65. // Implementation
  66. protected:
  67. void addStrList(const char *root, const idStrList &list, int id);
  68. void addScripts(bool rootItems);
  69. void addModels(bool rootItems);
  70. void addMaterials(bool rootItems);
  71. void addSounds(bool rootItems);
  72. void addGuis(bool rootItems);
  73. void addParticles(bool rootItems);
  74. void BuildTree();
  75. void CollapseChildren(HTREEITEM parent);
  76. const char *buildItemName(HTREEITEM item, const char *rootName);
  77. bool loadTree( HTREEITEM item, const idStr &name, CWaitDlg *dlg );
  78. HTREEITEM findItem(const char *name, HTREEITEM item, HTREEITEM *foundItem);
  79. // Generated message map functions
  80. //{{AFX_MSG(CDialogTextures)
  81. virtual void OnOK();
  82. virtual BOOL OnInitDialog();
  83. afx_msg void OnLoad();
  84. afx_msg void OnRefresh();
  85. afx_msg void OnClickTreeTextures(NMHDR* pNMHDR, LRESULT* pResult);
  86. afx_msg void OnSelchangedTreeTextures(NMHDR* pNMHDR, LRESULT* pResult);
  87. afx_msg void OnDblclkTreeTextures(NMHDR* pNMHDR, LRESULT* pResult);
  88. afx_msg void OnPreview();
  89. afx_msg void OnMaterialEdit();
  90. afx_msg void OnMaterialInfo();
  91. afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
  92. afx_msg void OnSize(UINT nType, int cx, int cy);
  93. afx_msg void OnCheckHideroot();
  94. //}}AFX_MSG
  95. DECLARE_MESSAGE_MAP()
  96. idHashTable<HTREEITEM> quickTree;
  97. idStr itemName;
  98. public:
  99. virtual BOOL PreTranslateMessage(MSG* pMsg);
  100. afx_msg void OnSetFocus(CWnd* pOldWnd);
  101. afx_msg void OnNMRclickTreeTextures(NMHDR *pNMHDR, LRESULT *pResult);
  102. };
  103. //{{AFX_INSERT_LOCATION}}
  104. // Microsoft Developer Studio will insert additional declarations immediately before the previous line.
  105. #endif // !defined(AFX_DIALOGTEXTURES_H__F3F3F984_E47E_11D1_B61B_00AA00A410FC__INCLUDED_)