FPMatNav.cpp 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program 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. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /**********************************************************************
  19. *<
  20. FILE: FPMatNav.cpp
  21. DESCRIPTION: Function published access for material navigator messages
  22. CREATED BY: Michael Russo
  23. HISTORY: 02-08-2002 Created
  24. *> Copyright (c) 2000, All Rights Reserved.
  25. **********************************************************************/
  26. #if defined W3D_GMAXDEV
  27. #include "Max.h"
  28. #include "GMaxMtlDlg.h"
  29. #include "GameMtlForm.h"
  30. #include "GameMtl.h"
  31. #include "resource.h"
  32. extern GMaxMtlDlg * GMaxMaterialDialog;
  33. extern GameMtlActionCB* Game_Mtl_ActionCB;
  34. //============================================================================================
  35. FPMatNav fpMatNav(FPMATNAV_INTERFACE, _T("MaterialNavNotify"), 0, NULL, FP_CORE,
  36. IFPMatNav::idLaunch, _T("Launch"), 0, TYPE_VOID, 0, 0,
  37. IFPMatNav::idSetMultiMaterialTabBySlot, _T("SetMultiMaterialTabBySlot"), 0, TYPE_VOID, 0, 3,
  38. _T("slot"), 0, TYPE_INT,
  39. _T("SubMtlTexIndex"), 0, TYPE_INT,
  40. _T("Element"), 0, TYPE_INT,
  41. IFPMatNav::idSetMaterialTabBySlot, _T("SetMaterialTabBySlot"), 0, TYPE_VOID, 0, 2,
  42. _T("slot"), 0, TYPE_INT,
  43. _T("Element"), 0, TYPE_INT,
  44. IFPMatNav::idSetMultiMaterialBySlot, _T("SetMultiMaterialBySlot"), 0, TYPE_VOID, 0, 2,
  45. _T("slot"), 0, TYPE_INT,
  46. _T("Element"), 0, TYPE_INT,
  47. IFPMatNav::idSetMaterialBySlot, _T("SetMaterialBySlot"), 0, TYPE_VOID, 0, 1,
  48. _T("slot"), 0, TYPE_INT,
  49. end
  50. );
  51. IFPMatNav *FPMatNav::m_pIFPMatNavCallback = NULL;
  52. //============================================================================================
  53. void FPMatNav::Launch(){
  54. if( m_pIFPMatNavCallback ) {
  55. m_pIFPMatNavCallback->Launch();
  56. }
  57. }
  58. //============================================================================================
  59. void FPMatNav::SetMultiMaterialTabBySlot( int iSlot, int iSubMtlTexIndex, int iElement ){
  60. if( m_pIFPMatNavCallback ) {
  61. m_pIFPMatNavCallback->SetMultiMaterialTabBySlot(iSlot, iSubMtlTexIndex, iElement);
  62. }
  63. }
  64. //============================================================================================
  65. void FPMatNav::SetMaterialTabBySlot( int iSlot, int iElement ){
  66. if( m_pIFPMatNavCallback ) {
  67. m_pIFPMatNavCallback->SetMaterialTabBySlot(iSlot, iElement);
  68. }
  69. }
  70. //============================================================================================
  71. void FPMatNav::SetMultiMaterialBySlot( int iSlot, int iIndex ){
  72. if( m_pIFPMatNavCallback ) {
  73. m_pIFPMatNavCallback->SetMultiMaterialBySlot(iSlot, iIndex);
  74. }
  75. }
  76. //============================================================================================
  77. void FPMatNav::SetMaterialBySlot(int iSlot ){
  78. if( m_pIFPMatNavCallback ) {
  79. m_pIFPMatNavCallback->SetMaterialBySlot(iSlot);
  80. }else{
  81. if(NULL == GMaxMaterialDialog){
  82. Game_Mtl_ActionCB->ExecuteAction(IDA_GAMEMTL_DODLG);
  83. }
  84. //Retry
  85. if( NULL != GMaxMaterialDialog && m_pIFPMatNavCallback ) {
  86. m_pIFPMatNavCallback->SetMaterialBySlot(iSlot);
  87. }
  88. }
  89. }
  90. #endif