AlphaModifier.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project name : Buccaneer Bay *
  23. * *
  24. * File name : AlphaModifier.h *
  25. * *
  26. * Programmer : Mike Lytle *
  27. * *
  28. * Start date : 11/1/1999 *
  29. * *
  30. * Last update : 11/1/1999 *
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef ALPHA_MODIFIER_H
  36. #define ALPHA_MODIFIER_H
  37. #include <max.h>
  38. #include "iparamm2.h"
  39. #include "istdplug.h"
  40. #include "meshadj.h"
  41. #include "modstack.h"
  42. #include "macrorec.h"
  43. #include "resource.h"
  44. #include "dllmain.h"
  45. #define ALPHA_MODIFIER_CLASSID Class_ID(0x518970b3, 0x37d73373)
  46. extern ClassDesc* Get_Alpha_Desc();
  47. #define ALPHA_VERTEX_CHANNEL 10
  48. class AlphaModifierClass : public Modifier
  49. {
  50. public:
  51. // Global parameter block
  52. IParamBlock2 *pblock;
  53. //Constructor/Destructor
  54. AlphaModifierClass();
  55. ~AlphaModifierClass() {}
  56. void DeleteThis() { delete this;}
  57. // Plugin identification
  58. void GetClassName(TSTR& s) { s= TSTR(Get_String(IDS_ALPHA_MODIFIER_CLASS));}
  59. virtual Class_ID ClassID() { return ALPHA_MODIFIER_CLASSID;}
  60. TCHAR *GetObjectName() { return Get_String(IDS_ALPHA_MODIFIER_CLASS);}
  61. // Defines the behavior for this modifier
  62. // This is currently setup to be basic geometry
  63. // modification of deformable objects
  64. ChannelMask ChannelsUsed() {return PART_GEOM|PART_TOPO|PART_SELECT|PART_SUBSEL_TYPE;}
  65. ChannelMask ChannelsChanged() {return PART_GEOM|PART_TOPO|PART_SELECT|PART_SUBSEL_TYPE;}
  66. Class_ID InputType() { return triObjectClassID;}
  67. BOOL ChangeTopology() {return FALSE;}
  68. // Calculate the local validity from the parameters
  69. Interval LocalValidity(TimeValue t);
  70. Interval GetValidity(TimeValue t);
  71. // Object modification and notification of change
  72. void ModifyObject(TimeValue t, ModContext &mc, ObjectState *os, INode *node);
  73. void NotifyInputChanged(Interval changeInt, PartID partID, RefMessage message, ModContext *mc);
  74. // Reference support
  75. int NumRefs() { return 1;}
  76. RefTargetHandle GetReference(int i);
  77. void SetReference(int i, RefTargetHandle rtarg);
  78. RefTargetHandle Clone(RemapDir& remap = NoRemap());
  79. RefResult NotifyRefChanged( Interval changeInt,RefTargetHandle hTarget, PartID& partID, RefMessage message);
  80. // SubAnim support
  81. int NumSubs() { return 0;}
  82. Animatable* SubAnim(int i);
  83. TSTR SubAnimName(int i);
  84. // Direct paramblock access
  85. int NumParamBlocks() {return 1;}
  86. IParamBlock2* GetParamBlock(int i) { return pblock;}
  87. IParamBlock2* GetParamBlockByID(BlockID id) {return (pblock->ID() == id) ? pblock : NULL;}
  88. int GetParamBlockIndex(int id) {return id;}
  89. // Does not use createmouse callbacks
  90. CreateMouseCallBack* GetCreateMouseCallBack() {return NULL;}
  91. // Load and unload our UI
  92. void BeginEditParams(IObjParam *ip, ULONG flags,Animatable *prev);
  93. void EndEditParams(IObjParam *ip, ULONG flags,Animatable *next);
  94. void InvalidateUI();
  95. // Message saved from window messages.
  96. int Message;
  97. // Selected vertices.
  98. BitArray SelectedVertices;
  99. };
  100. /*===========================================================================*\
  101. | Dialog Processor
  102. \*===========================================================================*/
  103. class AlphaModDlgProc : public ParamMap2UserDlgProc
  104. {
  105. public:
  106. AlphaModifierClass *AlphaModifier;
  107. AlphaModDlgProc() {}
  108. AlphaModDlgProc(AlphaModifierClass *alpha_m) {AlphaModifier = alpha_m;}
  109. BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
  110. void DeleteThis() {}
  111. void SetThing(ReferenceTarget *m) {AlphaModifier = (AlphaModifierClass*)m;}
  112. };
  113. #endif //ALPHA_MODIFIER_H