Browse Source

Fix all of those stupid PlasmaMax purecalls on exit

Adam Johnson 14 years ago
parent
commit
c76c39b277
  1. 4
      Sources/Tools/MaxComponent/plAnimCompProc.h
  2. 49
      Sources/Tools/MaxComponent/plCameraComponent.cpp
  3. 52
      Sources/Tools/MaxComponent/plCameraComponents.cpp
  4. 129
      Sources/Tools/MaxComponent/plClickDragComponent.cpp
  5. 119
      Sources/Tools/MaxComponent/plNavigableComponents.cpp
  6. 248
      Sources/Tools/MaxComponent/plParticleComponents.cpp
  7. 3
      Sources/Tools/MaxComponent/plParticleComponents.h
  8. 85
      Sources/Tools/MaxComponent/plResponderAnim.cpp
  9. 132
      Sources/Tools/MaxComponent/plResponderComponent.cpp
  10. 639
      Sources/Tools/MaxComponent/plResponderLink.cpp
  11. 37
      Sources/Tools/MaxComponent/plResponderMtl.cpp
  12. 50
      Sources/Tools/MaxComponent/plResponderWait.cpp
  13. 5
      Sources/Tools/MaxPlasmaMtls/Layers/plDynamicEnvLayerBitmapPB.cpp
  14. 5
      Sources/Tools/MaxPlasmaMtls/Layers/plDynamicTextLayerBitmapPB.cpp
  15. 6
      Sources/Tools/MaxPlasmaMtls/Layers/plLayerTex.cpp
  16. 4
      Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBasicPB.cpp
  17. 1115
      Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBitmapPB.cpp
  18. 4
      Sources/Tools/MaxPlasmaMtls/Layers/plMAXCameraLayer.cpp
  19. 4
      Sources/Tools/MaxPlasmaMtls/Layers/plStaticEnvLayerBitmapPB.cpp
  20. 6
      Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp
  21. 59
      Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtlBasicPBDec.h
  22. 163
      Sources/Tools/MaxPlasmaMtls/Materials/plClothingMtlPBDec.h
  23. 111
      Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtlBasicPBDec.h
  24. 166
      Sources/Tools/MaxPlasmaMtls/Materials/plParticleMtlPBDec.h
  25. 6
      Sources/Tools/MaxPlasmaMtls/Materials/plPassAnimDlgProc.h
  26. 4
      Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlAnimPB.h
  27. 4
      Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBase.cpp
  28. 115
      Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBasicPBDec.h

4
Sources/Tools/MaxComponent/plAnimCompProc.h

@ -58,9 +58,9 @@ protected:
public: public:
plAnimCompProc(); plAnimCompProc();
void DeleteThis() {} virtual void DeleteThis() {}
BOOL DlgProc(TimeValue t, IParamMap2* pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); virtual BOOL DlgProc(TimeValue t, IParamMap2* pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
bool GetCompAndNode(IParamBlock2* pb, plComponentBase*& comp, plMaxNode*& node); bool GetCompAndNode(IParamBlock2* pb, plComponentBase*& comp, plMaxNode*& node);
}; };

49
Sources/Tools/MaxComponent/plCameraComponent.cpp

@ -58,8 +58,29 @@ enum
kSmooth, kSmooth,
}; };
class plCameraCmdComponentProc; class plCameraCmdComponentProc : public ParamMap2UserDlgProc
extern plCameraCmdComponentProc gCameraCmdComponentProc; {
public:
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
return false;
}
void DeleteThis() {}
protected:
void IEnableControls(IParamMap2 *map, int type)
{
}
void IAddComboItem(HWND hCombo, const char *name, int id)
{
}
void ISetComboSel(HWND hCombo, int type)
{
}
};
static plCameraCmdComponentProc gCameraCmdComponentProc;
enum enum
{ {
@ -136,27 +157,3 @@ hsBool plCameraCmdComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
return true; return true;
} }
class plCameraCmdComponentProc : public ParamMap2UserDlgProc
{
public:
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
return false;
}
void DeleteThis() {}
protected:
void IEnableControls(IParamMap2 *map, int type)
{
}
void IAddComboItem(HWND hCombo, const char *name, int id)
{
}
void ISetComboSel(HWND hCombo, int type)
{
}
};
static plCameraCmdComponentProc gCameraCmdComponentProc;

52
Sources/Tools/MaxComponent/plCameraComponents.cpp

@ -2453,8 +2453,29 @@ enum
kSmooth, kSmooth,
}; };
class plCameraCmdComponentProc; class plCameraCmdComponentProc : public ParamMap2UserDlgProc
extern plCameraCmdComponentProc gCameraCmdComponentProc; {
public:
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
return false;
}
void DeleteThis() {}
protected:
void IEnableControls(IParamMap2 *map, int type)
{
}
void IAddComboItem(HWND hCombo, const char *name, int id)
{
}
void ISetComboSel(HWND hCombo, int type)
{
}
};
static plCameraCmdComponentProc gCameraCmdComponentProc;
enum enum
{ {
@ -2531,30 +2552,3 @@ hsBool plCameraCmdComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
{ {
return true; return true;
} }
class plCameraCmdComponentProc : public ParamMap2UserDlgProc
{
public:
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
return false;
}
void DeleteThis() {}
protected:
void IEnableControls(IParamMap2 *map, int type)
{
}
void IAddComboItem(HWND hCombo, const char *name, int id)
{
}
void ISetComboSel(HWND hCombo, int type)
{
}
};
static plCameraCmdComponentProc gCameraCmdComponentProc;

129
Sources/Tools/MaxComponent/plClickDragComponent.cpp

@ -89,8 +89,69 @@ enum
}; };
class plClickDragComponentProc; #include "plNoteTrackDlgComp.h"
extern plClickDragComponentProc gClickDragComponentProc;
class plClickDragComponentProc : public ParamMap2UserDlgProc
{
protected:
plComponentNoteTrackDlg fNoteTrackDlgX;
plComponentNoteTrackDlg fNoteTrackDlgY;
IParamBlock2 *fPB;
public:
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
fPB = map->GetParamBlock();
fNoteTrackDlgX.Init(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIMX),
nil,
kClickDragAnimX,
-1,
fPB,
fPB->GetOwner());
fNoteTrackDlgX.Load();
EnableWindow(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIMX), true);
fNoteTrackDlgY.Init(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIM_Y),
nil,
kClickDragAnimY,
-1,
fPB,
fPB->GetOwner());
fNoteTrackDlgY.Load();
EnableWindow(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIM_Y), true);
return TRUE;
case WM_COMMAND:
if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_CLICK_DRAG_ANIMX)
{
fNoteTrackDlgX.AnimChanged();
return TRUE;
}
if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_CLICK_DRAG_ANIM_Y)
{
fNoteTrackDlgY.AnimChanged();
return TRUE;
}
break;
}
return false;
}
void DeleteThis()
{
fNoteTrackDlgX.DeleteCache();
fNoteTrackDlgY.DeleteCache();
}
};
static plClickDragComponentProc gClickDragComponentProc;
ParamBlockDesc2 gClickDragBlock ParamBlockDesc2 gClickDragBlock
( (
@ -539,67 +600,3 @@ hsBool plClickDragComponent::DeInit( plMaxNode *node, plErrorMsg *pErrMsg )
fAxisKeys.clear(); fAxisKeys.clear();
return plActivatorBaseComponent::DeInit( node, pErrMsg ); return plActivatorBaseComponent::DeInit( node, pErrMsg );
} }
#include "plNoteTrackDlgComp.h"
class plClickDragComponentProc : public ParamMap2UserDlgProc
{
protected:
plComponentNoteTrackDlg fNoteTrackDlgX;
plComponentNoteTrackDlg fNoteTrackDlgY;
IParamBlock2 *fPB;
public:
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
fPB = map->GetParamBlock();
fNoteTrackDlgX.Init(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIMX),
nil,
kClickDragAnimX,
-1,
fPB,
fPB->GetOwner());
fNoteTrackDlgX.Load();
EnableWindow(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIMX), true);
fNoteTrackDlgY.Init(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIM_Y),
nil,
kClickDragAnimY,
-1,
fPB,
fPB->GetOwner());
fNoteTrackDlgY.Load();
EnableWindow(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIM_Y), true);
return TRUE;
case WM_COMMAND:
if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_CLICK_DRAG_ANIMX)
{
fNoteTrackDlgX.AnimChanged();
return TRUE;
}
if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_CLICK_DRAG_ANIM_Y)
{
fNoteTrackDlgY.AnimChanged();
return TRUE;
}
break;
}
return false;
}
void DeleteThis()
{
fNoteTrackDlgX.DeleteCache();
fNoteTrackDlgY.DeleteCache();
}
};
static plClickDragComponentProc gClickDragComponentProc;

119
Sources/Tools/MaxComponent/plNavigableComponents.cpp

@ -56,9 +56,6 @@ void DummyCodeIncludeFuncNavigablesRegion() {}
CLASS_DESC(plAvLadderComponent, gAvLadderComponentDesc, "(ex)Ladder Component", "(ex)LadderComp", COMP_TYPE_PHYS_TERRAINS, NAV_LADDER_CID) CLASS_DESC(plAvLadderComponent, gAvLadderComponentDesc, "(ex)Ladder Component", "(ex)LadderComp", COMP_TYPE_PHYS_TERRAINS, NAV_LADDER_CID)
class plAvLadderComponentProc;
extern plAvLadderComponentProc gAvLadderComponentProc;
enum kAvLadderFields enum kAvLadderFields
{ {
kTypeCombo, kTypeCombo,
@ -70,6 +67,63 @@ enum kAvLadderFields
kLadderNode, kLadderNode,
}; };
class plAvLadderComponentProc : public ParamMap2UserDlgProc
{
public:
enum kLadderTypesEnums
{
kReallyBig,
kFourFeet,
kTwoFeet,
};
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
{
HWND hLadder = GetDlgItem(hWnd,IDC_COMP_NAV_LADDER_COMBO);
ComboBox_AddString(hLadder, "Big");
ComboBox_AddString(hLadder, "4 feet");
ComboBox_AddString(hLadder, "2 feet");
int type = map->GetParamBlock()->GetInt(kTypeCombo);
ComboBox_SetCurSel(hLadder, type);
}
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_COMP_NAV_LADDER_COMBO && HIWORD(wParam) == CBN_SELCHANGE)
{
//Util fcn found in plEventGroupRefs files in MaxMain
HWND hLadder = GetDlgItem(hWnd,IDC_COMP_NAV_LADDER_COMBO);
int idx = ComboBox_GetCurSel(hLadder);
map->GetParamBlock()->SetValue(kTypeCombo, 0, idx);
/*
if (idx == kReallyBig)
{
map->Enable(kLoopsInt, TRUE);
// map->Invalidate(kLoopsInt);
}
else
{
map->Enable(kLoopsInt, TRUE);
// map->Invalidate(kLoopsInt);
}
*/
return TRUE;
}
break;
}
return FALSE;
}
void DeleteThis() {}
};
static plAvLadderComponentProc gAvLadderComponentProc;
ParamBlockDesc2 gAvLadderComponentBlock ParamBlockDesc2 gAvLadderComponentBlock
( (
plComponent::kBlkComp, _T("(ex)Ladder Component"), 0, &gAvLadderComponentDesc, P_AUTO_CONSTRUCT + P_AUTO_UI, plComponent::kRefComp, plComponent::kBlkComp, _T("(ex)Ladder Component"), 0, &gAvLadderComponentDesc, P_AUTO_CONSTRUCT + P_AUTO_UI, plComponent::kRefComp,
@ -219,62 +273,3 @@ hsBool plAvLadderComponent::DeInit(plMaxNode *node, plErrorMsg *pErrMsg)
fKeys.Reset(); fKeys.Reset();
return true; return true;
} }
class plAvLadderComponentProc : public ParamMap2UserDlgProc
{
public:
enum kLadderTypesEnums
{
kReallyBig,
kFourFeet,
kTwoFeet,
};
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
{
HWND hLadder = GetDlgItem(hWnd,IDC_COMP_NAV_LADDER_COMBO);
ComboBox_AddString(hLadder, "Big");
ComboBox_AddString(hLadder, "4 feet");
ComboBox_AddString(hLadder, "2 feet");
int type = map->GetParamBlock()->GetInt(kTypeCombo);
ComboBox_SetCurSel(hLadder, type);
}
return TRUE;
case WM_COMMAND:
if (LOWORD(wParam) == IDC_COMP_NAV_LADDER_COMBO && HIWORD(wParam) == CBN_SELCHANGE)
{
//Util fcn found in plEventGroupRefs files in MaxMain
HWND hLadder = GetDlgItem(hWnd,IDC_COMP_NAV_LADDER_COMBO);
int idx = ComboBox_GetCurSel(hLadder);
map->GetParamBlock()->SetValue(kTypeCombo, 0, idx);
/*
if (idx == kReallyBig)
{
map->Enable(kLoopsInt, TRUE);
// map->Invalidate(kLoopsInt);
}
else
{
map->Enable(kLoopsInt, TRUE);
// map->Invalidate(kLoopsInt);
}
*/
return TRUE;
}
break;
}
return FALSE;
}
void DeleteThis() {}
};
static plAvLadderComponentProc gAvLadderComponentProc;

248
Sources/Tools/MaxComponent/plParticleComponents.cpp

@ -618,6 +618,130 @@ void plParticleCoreComponent::SetParticleStats(plParticleMtl *mtl)
fUserInput.fOrientation = pb->GetInt(plParticleMtl::kOrientation); fUserInput.fOrientation = pb->GetInt(plParticleMtl::kOrientation);
} }
class ParticleCompDlgProc : public ParamMap2UserDlgProc
{
protected:
void EnableDynGenParams(IParamMap2 *pm, bool enabled)
{
pm->Enable(plParticleComponent::kConeAngle, enabled);
pm->Enable(plParticleComponent::kVelocityMin, enabled);
pm->Enable(plParticleComponent::kVelocityMax, enabled);
pm->Enable(plParticleComponent::kLifeMin, enabled);
pm->Enable(plParticleComponent::kLifeMax, enabled);
pm->Enable(plParticleComponent::kImmortal, enabled);
pm->Enable(plParticleComponent::kPPS, enabled);
pm->Enable(plParticleComponent::kGravity, enabled);
pm->Enable(plParticleComponent::kPreSim, enabled);
pm->Enable(plParticleComponent::kDrag, enabled);
}
public:
ParticleCompDlgProc() {}
~ParticleCompDlgProc() {}
void IValidateSpinners(TimeValue t, IParamBlock2 *pb, IParamMap2 *map, UInt32 id)
{
UInt32 minIndex, maxIndex;
hsBool adjustMin;
switch(id)
{
case IDC_COMP_PARTICLE_VELMIN:
case IDC_COMP_PARTICLE_VELMIN_SPIN:
minIndex = plParticleCoreComponent::kVelocityMin; maxIndex = plParticleCoreComponent::kVelocityMax; adjustMin = false;
break;
case IDC_COMP_PARTICLE_VELMAX:
case IDC_COMP_PARTICLE_VELMAX_SPIN:
minIndex = plParticleCoreComponent::kVelocityMin; maxIndex = plParticleCoreComponent::kVelocityMax; adjustMin = true;
break;
case IDC_COMP_PARTICLE_LIFEMIN:
case IDC_COMP_PARTICLE_LIFEMIN_SPIN:
minIndex = plParticleCoreComponent::kLifeMin; maxIndex = plParticleCoreComponent::kLifeMax; adjustMin = false;
break;
case IDC_COMP_PARTICLE_LIFEMAX:
case IDC_COMP_PARTICLE_LIFEMAX_SPIN:
minIndex = plParticleCoreComponent::kLifeMin; maxIndex = plParticleCoreComponent::kLifeMax; adjustMin = true;
break;
default:
return;
}
float min, max;
min = pb->GetFloat(minIndex, t);
max = pb->GetFloat(maxIndex, t);
if (min > max)
{
if (adjustMin)
pb->SetValue(minIndex, t, max);
else
pb->SetValue(maxIndex, t, min);
map->Invalidate(minIndex);
map->Invalidate(maxIndex);
}
}
virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
int id = LOWORD(wParam);
int code = HIWORD(wParam);
IParamBlock2 *pb = map->GetParamBlock();
HWND cbox = NULL;
int selection;
switch (msg)
{
case WM_INITDIALOG:
int j;
for (j = 0; j < plParticleCoreComponent::kGenNumOptions; j++)
{
cbox = GetDlgItem(hWnd, IDC_GEN_TYPE);
SendMessage(cbox, CB_ADDSTRING, 0, (LPARAM)plParticleCoreComponent::GenStrings[j]);
}
selection = pb->GetInt(plParticleCoreComponent::kGenType);
SendMessage(cbox, CB_SETCURSEL, selection, 0);
EnableDynGenParams(map, selection != plParticleCoreComponent::kGenOnePerVertex);
CheckDlgButton(hWnd, IDC_TRACKVIEW_SHOW, plParticleComponent::fAllowUnhide ? BST_CHECKED : BST_UNCHECKED);
return TRUE;
case WM_COMMAND:
if (id == IDC_GEN_TYPE)
{
selection = SendMessage(GetDlgItem(hWnd, id), CB_GETCURSEL, 0, 0);
pb->SetValue(plParticleCoreComponent::kGenType, t, selection);
EnableDynGenParams(map, selection != plParticleCoreComponent::kGenOnePerVertex);
return TRUE;
}
else if (id == IDC_COMP_PARTICLE_VELMIN || id == IDC_COMP_PARTICLE_VELMAX ||
id == IDC_COMP_PARTICLE_LIFEMIN || id == IDC_COMP_PARTICLE_LIFEMAX)
{
IValidateSpinners(t, pb, map, id);
return TRUE;
}
else if (id == IDC_TRACKVIEW_SHOW && code == BN_CLICKED)
{
plParticleComponent::fAllowUnhide = (IsDlgButtonChecked(hWnd, IDC_TRACKVIEW_SHOW) == BST_CHECKED);
plComponentShow::Update();
return TRUE;
}
break;
case CC_SPINNER_CHANGE:
if (id == IDC_COMP_PARTICLE_VELMIN_SPIN || id == IDC_COMP_PARTICLE_VELMAX_SPIN ||
id == IDC_COMP_PARTICLE_LIFEMIN_SPIN || id == IDC_COMP_PARTICLE_LIFEMAX_SPIN)
{
IValidateSpinners(t, pb, map, id);
return TRUE;
}
break;
}
return FALSE;
}
virtual void DeleteThis() {}
};
static ParticleCompDlgProc gParticleCompDlgProc;
CLASS_DESC(plParticleComponent, gParticleDesc, "Particle System", "ParticleSystem", COMP_TYPE_PARTICLE, PARTICLE_SYSTEM_COMPONENT_CLASS_ID) CLASS_DESC(plParticleComponent, gParticleDesc, "Particle System", "ParticleSystem", COMP_TYPE_PARTICLE, PARTICLE_SYSTEM_COMPONENT_CLASS_ID)
ParamBlockDesc2 gParticleBk ParamBlockDesc2 gParticleBk
@ -778,130 +902,6 @@ hsBool plParticleComponent::GetParamVals(plMaxNode *pNode)
return true; return true;
} }
class ParticleCompDlgProc : public ParamMap2UserDlgProc
{
protected:
void EnableDynGenParams(IParamMap2 *pm, bool enabled)
{
pm->Enable(plParticleComponent::kConeAngle, enabled);
pm->Enable(plParticleComponent::kVelocityMin, enabled);
pm->Enable(plParticleComponent::kVelocityMax, enabled);
pm->Enable(plParticleComponent::kLifeMin, enabled);
pm->Enable(plParticleComponent::kLifeMax, enabled);
pm->Enable(plParticleComponent::kImmortal, enabled);
pm->Enable(plParticleComponent::kPPS, enabled);
pm->Enable(plParticleComponent::kGravity, enabled);
pm->Enable(plParticleComponent::kPreSim, enabled);
pm->Enable(plParticleComponent::kDrag, enabled);
}
public:
ParticleCompDlgProc() {}
~ParticleCompDlgProc() {}
void IValidateSpinners(TimeValue t, IParamBlock2 *pb, IParamMap2 *map, UInt32 id)
{
UInt32 minIndex, maxIndex;
hsBool adjustMin;
switch(id)
{
case IDC_COMP_PARTICLE_VELMIN:
case IDC_COMP_PARTICLE_VELMIN_SPIN:
minIndex = plParticleCoreComponent::kVelocityMin; maxIndex = plParticleCoreComponent::kVelocityMax; adjustMin = false;
break;
case IDC_COMP_PARTICLE_VELMAX:
case IDC_COMP_PARTICLE_VELMAX_SPIN:
minIndex = plParticleCoreComponent::kVelocityMin; maxIndex = plParticleCoreComponent::kVelocityMax; adjustMin = true;
break;
case IDC_COMP_PARTICLE_LIFEMIN:
case IDC_COMP_PARTICLE_LIFEMIN_SPIN:
minIndex = plParticleCoreComponent::kLifeMin; maxIndex = plParticleCoreComponent::kLifeMax; adjustMin = false;
break;
case IDC_COMP_PARTICLE_LIFEMAX:
case IDC_COMP_PARTICLE_LIFEMAX_SPIN:
minIndex = plParticleCoreComponent::kLifeMin; maxIndex = plParticleCoreComponent::kLifeMax; adjustMin = true;
break;
default:
return;
}
float min, max;
min = pb->GetFloat(minIndex, t);
max = pb->GetFloat(maxIndex, t);
if (min > max)
{
if (adjustMin)
pb->SetValue(minIndex, t, max);
else
pb->SetValue(maxIndex, t, min);
map->Invalidate(minIndex);
map->Invalidate(maxIndex);
}
}
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
int id = LOWORD(wParam);
int code = HIWORD(wParam);
IParamBlock2 *pb = map->GetParamBlock();
HWND cbox = NULL;
int selection;
switch (msg)
{
case WM_INITDIALOG:
int j;
for (j = 0; j < plParticleCoreComponent::kGenNumOptions; j++)
{
cbox = GetDlgItem(hWnd, IDC_GEN_TYPE);
SendMessage(cbox, CB_ADDSTRING, 0, (LPARAM)plParticleCoreComponent::GenStrings[j]);
}
selection = pb->GetInt(plParticleCoreComponent::kGenType);
SendMessage(cbox, CB_SETCURSEL, selection, 0);
EnableDynGenParams(map, selection != plParticleCoreComponent::kGenOnePerVertex);
CheckDlgButton(hWnd, IDC_TRACKVIEW_SHOW, plParticleComponent::fAllowUnhide ? BST_CHECKED : BST_UNCHECKED);
return TRUE;
case WM_COMMAND:
if (id == IDC_GEN_TYPE)
{
selection = SendMessage(GetDlgItem(hWnd, id), CB_GETCURSEL, 0, 0);
pb->SetValue(plParticleCoreComponent::kGenType, t, selection);
EnableDynGenParams(map, selection != plParticleCoreComponent::kGenOnePerVertex);
return TRUE;
}
else if (id == IDC_COMP_PARTICLE_VELMIN || id == IDC_COMP_PARTICLE_VELMAX ||
id == IDC_COMP_PARTICLE_LIFEMIN || id == IDC_COMP_PARTICLE_LIFEMAX)
{
IValidateSpinners(t, pb, map, id);
return TRUE;
}
else if (id == IDC_TRACKVIEW_SHOW && code == BN_CLICKED)
{
plParticleComponent::fAllowUnhide = (IsDlgButtonChecked(hWnd, IDC_TRACKVIEW_SHOW) == BST_CHECKED);
plComponentShow::Update();
return TRUE;
}
break;
case CC_SPINNER_CHANGE:
if (id == IDC_COMP_PARTICLE_VELMIN_SPIN || id == IDC_COMP_PARTICLE_VELMAX_SPIN ||
id == IDC_COMP_PARTICLE_LIFEMIN_SPIN || id == IDC_COMP_PARTICLE_LIFEMAX_SPIN)
{
IValidateSpinners(t, pb, map, id);
return TRUE;
}
break;
}
return FALSE;
}
void DeleteThis() {}
};
static ParticleCompDlgProc gParticleCompDlgProc;
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// //
// Particle Effects Base class // Particle Effects Base class

3
Sources/Tools/MaxComponent/plParticleComponents.h

@ -71,9 +71,6 @@ public:
fXTiles(1), fYTiles(1), fHSize(1), fVSize(1), fImmortal(false) {} fXTiles(1), fYTiles(1), fHSize(1), fVSize(1), fImmortal(false) {}
}; };
class ParticleCompDlgProc;
extern ParticleCompDlgProc gParticleCompDlgProc;
class plParticleCoreComponent : public plComponent class plParticleCoreComponent : public plComponent
{ {
protected: protected:

85
Sources/Tools/MaxComponent/plResponderAnim.cpp

@ -60,33 +60,6 @@ enum
kRespAnimObjectType, kRespAnimObjectType,
}; };
class plResponderAnimProc;
extern plResponderAnimProc gResponderAnimProc;
ParamBlockDesc2 gResponderAnimBlock
(
kResponderAnimBlk, _T("animCmd"), 0, NULL, P_AUTO_UI,
IDD_COMP_RESPOND_ANIM, IDS_COMP_CMD_PARAMS, 0, 0, &gResponderAnimProc,
kRespAnimComp, _T("comp"), TYPE_REFTARG, 0, 0,
end,
kRespAnimObject, _T("object"), TYPE_REFTARG, 0, 0,
end,
kRespAnimLoop, _T("loop"), TYPE_STRING, 0, 0,
end,
kRespAnimType, _T("type"), TYPE_INT, 0, 0,
end,
kRespAnimObjectType, _T("objType"), TYPE_INT, 0, 0,
end,
end
);
enum AnimObjectType enum AnimObjectType
{ {
kNodePB, // Use the node in the PB kNodePB, // Use the node in the PB
@ -99,11 +72,6 @@ plResponderCmdAnim& plResponderCmdAnim::Instance()
return theInstance; return theInstance;
} }
ParamBlockDesc2 *plResponderCmdAnim::GetDesc()
{
return &gResponderAnimBlock;
}
// Use the old types, for backwards compatibility // Use the old types, for backwards compatibility
enum enum
{ {
@ -291,17 +259,6 @@ static bool IsSoundMsg(int type)
return false; return false;
} }
IParamBlock2 *plResponderCmdAnim::CreatePB(int idx)
{
int type = IndexToOldType(idx);
// Create the paramblock and save it's type
IParamBlock2 *pb = CreateParameterBlock2(&gResponderAnimBlock, nil);
pb->SetValue(kRespAnimType, 0, type);
return pb;
}
plComponentBase *plResponderCmdAnim::GetComponent(IParamBlock2 *pb) plComponentBase *plResponderCmdAnim::GetComponent(IParamBlock2 *pb)
{ {
plMaxNode *node = (plMaxNode*)pb->GetReferenceTarget(kRespAnimComp); plMaxNode *node = (plMaxNode*)pb->GetReferenceTarget(kRespAnimComp);
@ -563,7 +520,7 @@ class plResponderAnimProc : public plAnimCompProc
{ {
public: public:
plResponderAnimProc(); plResponderAnimProc();
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); virtual BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
protected: protected:
virtual void IPickComponent(IParamBlock2* pb); virtual void IPickComponent(IParamBlock2* pb);
@ -673,6 +630,46 @@ void plResponderAnimProc::IPickComponent(IParamBlock2* pb)
plPick::NodeRefKludge(pb, kRespAnimComp, &cids, true, false); plPick::NodeRefKludge(pb, kRespAnimComp, &cids, true, false);
} }
ParamBlockDesc2 gResponderAnimBlock
(
kResponderAnimBlk, _T("animCmd"), 0, NULL, P_AUTO_UI,
IDD_COMP_RESPOND_ANIM, IDS_COMP_CMD_PARAMS, 0, 0, &gResponderAnimProc,
kRespAnimComp, _T("comp"), TYPE_REFTARG, 0, 0,
end,
kRespAnimObject, _T("object"), TYPE_REFTARG, 0, 0,
end,
kRespAnimLoop, _T("loop"), TYPE_STRING, 0, 0,
end,
kRespAnimType, _T("type"), TYPE_INT, 0, 0,
end,
kRespAnimObjectType, _T("objType"), TYPE_INT, 0, 0,
end,
end
);
ParamBlockDesc2 *plResponderCmdAnim::GetDesc()
{
return &gResponderAnimBlock;
}
IParamBlock2 *plResponderCmdAnim::CreatePB(int idx)
{
int type = IndexToOldType(idx);
// Create the paramblock and save it's type
IParamBlock2 *pb = CreateParameterBlock2(&gResponderAnimBlock, nil);
pb->SetValue(kRespAnimType, 0, type);
return pb;
}
#include "plPickNodeBase.h" #include "plPickNodeBase.h"
static const char* kResponderNodeName = "(Responder Node)"; static const char* kResponderNodeName = "(Responder Node)";

132
Sources/Tools/MaxComponent/plResponderComponent.cpp

@ -59,6 +59,68 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
IParamBlock2 *CreateWaitBlk(); IParamBlock2 *CreateWaitBlk();
class plResponderProc : public ParamMap2UserDlgProc
{
protected:
HWND fhDlg;
IParamBlock2 *fPB;
IParamBlock2 *fStatePB;
int fCurState;
plResponderComponent *fComp;
IParamMap2 *fCmdMap;
IParamMap2 *fWaitMap;
int fCmdIdx;
typedef std::map<int, const char*> NameID;
NameID fNames;
HMENU fhMenu;
typedef std::pair<plResponderCmd*, int> CmdID;
typedef std::map<int, CmdID> MenuCmd;
MenuCmd fMenuCmds;
HWND fhList;
bool fIgnoreNextDrop;
public:
plResponderProc();
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
void DeleteThis() { IRemoveCmdRollups(); }
protected:
void ICreateMenu();
void IAddMenuItem(HMENU hMenu, int id);
void ICmdRightClick(HWND hCmdList);
// Add and remove command rollups
void ICreateCmdRollups();
void IRemoveCmdRollups();
IParamMap2 *ICreateMap(IParamBlock2 *pb); // Helper
const char* GetCommandName(int cmdIdx);
void LoadList();
BOOL DragListProc(HWND hWnd, DRAGLISTINFO *info);
void IDrawComboItem(DRAWITEMSTRUCT *dis);
void LoadState();
void AddCommand();
void RemoveCurCommand();
void MoveCommand(int oldIdx, int newIdx);
// Takes a freshly created state PB and adds it as a new state, then returns its index
int AddState(IParamBlock2 *pb);
};
static plResponderProc gResponderComponentProc;
int ResponderGetActivatorCount(plComponentBase *comp) int ResponderGetActivatorCount(plComponentBase *comp)
{ {
if (comp->ClassID() == RESPONDER_CID) if (comp->ClassID() == RESPONDER_CID)
@ -93,8 +155,6 @@ plKey Responder::GetKey(plComponentBase *comp, plMaxNodeBase *node)
CLASS_DESC(plResponderComponent, gResponderDesc, "Responder", "Responder", COMP_TYPE_LOGIC, RESPONDER_CID) CLASS_DESC(plResponderComponent, gResponderDesc, "Responder", "Responder", COMP_TYPE_LOGIC, RESPONDER_CID)
class plResponderProc;
extern plResponderProc gResponderComponentProc;
// When one of our parameters that is a ref changes, send out the component ref // When one of our parameters that is a ref changes, send out the component ref
// changed message. Normally, messages from component refs are ignored since // changed message. Normally, messages from component refs are ignored since
@ -494,8 +554,6 @@ void plResponderComponent::IFixOldPB()
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#define CUSTOM_DRAW
enum enum
{ {
kStateName, kStateName,
@ -505,70 +563,6 @@ enum
kStateCopy, kStateCopy,
}; };
class plResponderProc : public ParamMap2UserDlgProc
{
protected:
HWND fhDlg;
IParamBlock2 *fPB;
IParamBlock2 *fStatePB;
int fCurState;
plResponderComponent *fComp;
IParamMap2 *fCmdMap;
IParamMap2 *fWaitMap;
int fCmdIdx;
typedef std::map<int, const char*> NameID;
NameID fNames;
HMENU fhMenu;
typedef std::pair<plResponderCmd*, int> CmdID;
typedef std::map<int, CmdID> MenuCmd;
MenuCmd fMenuCmds;
HWND fhList;
bool fIgnoreNextDrop;
public:
plResponderProc();
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
void DeleteThis() { IRemoveCmdRollups(); }
protected:
void ICreateMenu();
void IAddMenuItem(HMENU hMenu, int id);
void ICmdRightClick(HWND hCmdList);
// Add and remove command rollups
void ICreateCmdRollups();
void IRemoveCmdRollups();
IParamMap2 *ICreateMap(IParamBlock2 *pb); // Helper
const char* GetCommandName(int cmdIdx);
void LoadList();
BOOL DragListProc(HWND hWnd, DRAGLISTINFO *info);
#ifdef CUSTOM_DRAW
void IDrawComboItem(DRAWITEMSTRUCT *dis);
#endif
void LoadState();
void AddCommand();
void RemoveCurCommand();
void MoveCommand(int oldIdx, int newIdx);
// Takes a freshly created state PB and adds it as a new state, then returns its index
int AddState(IParamBlock2 *pb);
};
static plResponderProc gResponderComponentProc;
void plResponderProc::IAddMenuItem(HMENU hMenu, int id) void plResponderProc::IAddMenuItem(HMENU hMenu, int id)
{ {
AppendMenu(hMenu, MF_STRING, id+1, fNames[id]); AppendMenu(hMenu, MF_STRING, id+1, fNames[id]);
@ -861,7 +855,6 @@ BOOL plResponderProc::DragListProc(HWND hWnd, DRAGLISTINFO *info)
return FALSE; return FALSE;
} }
#ifdef CUSTOM_DRAW
void plResponderProc::IDrawComboItem(DRAWITEMSTRUCT *dis) void plResponderProc::IDrawComboItem(DRAWITEMSTRUCT *dis)
{ {
if (dis->itemID == -1) // empty item if (dis->itemID == -1) // empty item
@ -916,7 +909,6 @@ void plResponderProc::IDrawComboItem(DRAWITEMSTRUCT *dis)
if (dis->itemState & ODS_FOCUS) if (dis->itemState & ODS_FOCUS)
DrawFocusRect(dis->hDC, &dis->rcItem); DrawFocusRect(dis->hDC, &dis->rcItem);
} }
#endif
void plResponderProc::LoadState() void plResponderProc::LoadState()
{ {

639
Sources/Tools/MaxComponent/plResponderLink.cpp

@ -66,9 +66,59 @@ enum
#define kDefaultLinkInAnimName "LinkOut" #define kDefaultLinkInAnimName "LinkOut"
class plResponderLinkProc; class plResponderLinkProc : public ParamMap2UserDlgProc
extern plResponderLinkProc gResponderLinkProc; {
protected:
void ILoadLinkingRulesCombo(HWND hWnd, IParamBlock2* pb);
void ILoadAgeFilenamesCombo(HWND hWnd, IParamBlock2 *pb);
void ILoadParentAgeFilenamesCombo(HWND hWnd, IParamBlock2 *pb);
public:
virtual BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
ILoadLinkingRulesCombo(hWnd, pm->GetParamBlock());
ILoadAgeFilenamesCombo(hWnd, pm->GetParamBlock());
ILoadParentAgeFilenamesCombo(hWnd, pm->GetParamBlock());
return TRUE;
case WM_COMMAND:
if (HIWORD(wParam) == CBN_SELCHANGE)
{
int sel = ComboBox_GetCurSel((HWND)lParam);
if (sel != CB_ERR)
{
if (LOWORD(wParam) == IDC_LINKINGRULE)
{
int data = ComboBox_GetItemData((HWND)lParam, sel);
pm->GetParamBlock()->SetValue(kLinkingRule, 0, data);
return TRUE;
}
else if (LOWORD(wParam) == IDC_LINKAGEFILENAME)
{
char buf[256];
SendMessage((HWND)lParam, CB_GETLBTEXT, sel, (LPARAM)buf);
pm->GetParamBlock()->SetValue(kLinkAgeFilename, 0, buf);
return TRUE;
}
else if (LOWORD(wParam) == IDC_PARENTAGEFILENAME)
{
char buf[256];
SendMessage((HWND)lParam, CB_GETLBTEXT, sel, (LPARAM)buf);
pm->GetParamBlock()->SetValue(kLinkParentAgeFilename, 0, buf);
return TRUE;
}
}
}
break;
}
return FALSE;
}
virtual void DeleteThis() {}
};
static plResponderLinkProc gResponderLinkProc;
ParamBlockDesc2 gResponderLinkBlock ParamBlockDesc2 gResponderLinkBlock
( (
@ -200,60 +250,6 @@ plMessage *plResponderCmdLink::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, I
return msg; return msg;
} }
class plResponderLinkProc : public ParamMap2UserDlgProc
{
protected:
void ILoadLinkingRulesCombo(HWND hWnd, IParamBlock2* pb);
void ILoadAgeFilenamesCombo(HWND hWnd, IParamBlock2 *pb);
void ILoadParentAgeFilenamesCombo(HWND hWnd, IParamBlock2 *pb);
public:
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
ILoadLinkingRulesCombo(hWnd, pm->GetParamBlock());
ILoadAgeFilenamesCombo(hWnd, pm->GetParamBlock());
ILoadParentAgeFilenamesCombo(hWnd, pm->GetParamBlock());
return TRUE;
case WM_COMMAND:
if (HIWORD(wParam) == CBN_SELCHANGE)
{
int sel = ComboBox_GetCurSel((HWND)lParam);
if (sel != CB_ERR)
{
if (LOWORD(wParam) == IDC_LINKINGRULE)
{
int data = ComboBox_GetItemData((HWND)lParam, sel);
pm->GetParamBlock()->SetValue(kLinkingRule, 0, data);
return TRUE;
}
else if (LOWORD(wParam) == IDC_LINKAGEFILENAME)
{
char buf[256];
SendMessage((HWND)lParam, CB_GETLBTEXT, sel, (LPARAM)buf);
pm->GetParamBlock()->SetValue(kLinkAgeFilename, 0, buf);
return TRUE;
}
else if (LOWORD(wParam) == IDC_PARENTAGEFILENAME)
{
char buf[256];
SendMessage((HWND)lParam, CB_GETLBTEXT, sel, (LPARAM)buf);
pm->GetParamBlock()->SetValue(kLinkParentAgeFilename, 0, buf);
return TRUE;
}
}
}
break;
}
return FALSE;
}
void DeleteThis() {}
};
static plResponderLinkProc gResponderLinkProc;
static int ComboBox_AddStringData(HWND hCombo, const char* str, int data) static int ComboBox_AddStringData(HWND hCombo, const char* str, int data)
{ {
int idx = ComboBox_AddString(hCombo, str); int idx = ComboBox_AddString(hCombo, str);
@ -369,6 +365,7 @@ void plResponderLinkProc::ILoadParentAgeFilenamesCombo(HWND hWnd, IParamBlock2 *
// Needed for message creation // Needed for message creation
#include "plModifier/plResponderModifier.h" #include "plModifier/plResponderModifier.h"
#include "plResponderGetComp.h"
enum enum
{ {
@ -377,8 +374,56 @@ enum
kEnableResponder, kEnableResponder,
}; };
class plResponderEnableProc; class plResponderEnableProc : public ParamMap2UserDlgProc
extern plResponderEnableProc gResponderEnableProc; {
protected:
void IUpdateButton(HWND hWnd, IParamBlock2 *pb)
{
HWND hComp = GetDlgItem(hWnd, IDC_RESPONDER_BUTTON);
plComponentBase *comp = plResponderGetComp::Instance().GetSavedComp(pb, kEnableNode, kEnableResponder);
if (comp)
SetWindowText(hComp, comp->GetINode()->GetName());
else
SetWindowText(hComp, "(none)");
}
public:
virtual BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
{
IParamBlock2 *pb = pm->GetParamBlock();
IUpdateButton(hWnd, pb);
}
return TRUE;
case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_BUTTON)
{
IParamBlock2 *pb = pm->GetParamBlock();
// If the responder component is hosed, remove it so the plResponderGetComp won't get bogus info
if (!plResponderGetComp::Instance().GetSavedComp(pb, kEnableNode, kEnableResponder))
{
ReferenceTarget *empty = nil;
pb->SetValue(kEnableResponder, 0, empty);
}
plResponderGetComp::ClassIDs cids;
cids.push_back(RESPONDER_CID);
plResponderGetComp::Instance().GetComp(pb, kEnableNode, kEnableResponder, &cids);
IUpdateButton(hWnd, pb);
}
break;
}
return FALSE;
}
virtual void DeleteThis() {}
};
static plResponderEnableProc gResponderEnableProc;
ParamBlockDesc2 gResponderEnableBlock ParamBlockDesc2 gResponderEnableBlock
( (
@ -411,8 +456,6 @@ ParamBlockDesc2 *plResponderCmdEnable::GetDesc()
return &gResponderEnableBlock; return &gResponderEnableBlock;
} }
#include "plResponderGetComp.h"
const char *plResponderCmdEnable::GetInstanceName(IParamBlock2 *pb) const char *plResponderCmdEnable::GetInstanceName(IParamBlock2 *pb)
{ {
static char name[256]; static char name[256];
@ -441,57 +484,6 @@ plMessage *plResponderCmdEnable::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg,
return msg; return msg;
} }
class plResponderEnableProc : public ParamMap2UserDlgProc
{
protected:
void IUpdateButton(HWND hWnd, IParamBlock2 *pb)
{
HWND hComp = GetDlgItem(hWnd, IDC_RESPONDER_BUTTON);
plComponentBase *comp = plResponderGetComp::Instance().GetSavedComp(pb, kEnableNode, kEnableResponder);
if (comp)
SetWindowText(hComp, comp->GetINode()->GetName());
else
SetWindowText(hComp, "(none)");
}
public:
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
{
IParamBlock2 *pb = pm->GetParamBlock();
IUpdateButton(hWnd, pb);
}
return TRUE;
case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_BUTTON)
{
IParamBlock2 *pb = pm->GetParamBlock();
// If the responder component is hosed, remove it so the plResponderGetComp won't get bogus info
if (!plResponderGetComp::Instance().GetSavedComp(pb, kEnableNode, kEnableResponder))
{
ReferenceTarget *empty = nil;
pb->SetValue(kEnableResponder, 0, empty);
}
plResponderGetComp::ClassIDs cids;
cids.push_back(RESPONDER_CID);
plResponderGetComp::Instance().GetComp(pb, kEnableNode, kEnableResponder, &cids);
IUpdateButton(hWnd, pb);
}
break;
}
return FALSE;
}
void DeleteThis() {}
};
static plResponderEnableProc gResponderEnableProc;
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
@ -562,14 +554,56 @@ plMessage *plResponderCmdPhysEnable::CreateMsg(plMaxNode* node, plErrorMsg *pErr
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
#include "plMessage/plOneShotMsg.h"
#include "plOneShotComponent.h"
enum enum
{ {
kOneShotComp, kOneShotComp,
kOneShotNode, kOneShotNode,
}; };
class plResponderOneShotProc; class plResponderOneShotProc : public ParamMap2UserDlgProc
extern plResponderOneShotProc gResponderOneShotProc; {
protected:
plResponderCompNode fCompNode;
public:
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
{
IParamBlock2 *pb = pm->GetParamBlock();
plResponderCompNode::ClassIDs cids;
cids.push_back(ONESHOTCLASS_ID);
fCompNode.Init(pb, kOneShotComp, kOneShotNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids);
fCompNode.InitDlg(hWnd);
}
return TRUE;
case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_COMP)
{
fCompNode.CompButtonPress(hWnd);
return TRUE;
}
else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_NODE)
{
fCompNode.NodeButtonPress(hWnd);
return TRUE;
}
break;
}
return FALSE;
}
void DeleteThis() {}
};
static plResponderOneShotProc gResponderOneShotProc;
ParamBlockDesc2 gResponderOneShotBlock ParamBlockDesc2 gResponderOneShotBlock
( (
@ -607,9 +641,6 @@ const char *plResponderCmdOneShot::GetInstanceName(IParamBlock2 *pb)
return name; return name;
} }
#include "plMessage/plOneShotMsg.h"
#include "plOneShotComponent.h"
plMessage *plResponderCmdOneShot::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb) plMessage *plResponderCmdOneShot::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb)
{ {
plResponderCompNode compNode; plResponderCompNode compNode;
@ -643,48 +674,6 @@ void plResponderCmdOneShot::CreateWait(plMaxNode* node, plErrorMsg* pErrMsg, IPa
oneShotMsg->fCallbacks->AddCallback(waitInfo.point, waitInfo.receiver, waitInfo.callbackUser); oneShotMsg->fCallbacks->AddCallback(waitInfo.point, waitInfo.receiver, waitInfo.callbackUser);
} }
class plResponderOneShotProc : public ParamMap2UserDlgProc
{
protected:
plResponderCompNode fCompNode;
public:
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
{
IParamBlock2 *pb = pm->GetParamBlock();
plResponderCompNode::ClassIDs cids;
cids.push_back(ONESHOTCLASS_ID);
fCompNode.Init(pb, kOneShotComp, kOneShotNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids);
fCompNode.InitDlg(hWnd);
}
return TRUE;
case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_COMP)
{
fCompNode.CompButtonPress(hWnd);
return TRUE;
}
else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_NODE)
{
fCompNode.NodeButtonPress(hWnd);
return TRUE;
}
break;
}
return FALSE;
}
void DeleteThis() {}
};
static plResponderOneShotProc gResponderOneShotProc;
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
@ -721,12 +710,47 @@ plMessage *plResponderCmdNotify::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg,
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
#include "plCameraComponents.h" #include "plCameraComponents.h"
#include "plPickNode.h"
class plResponderActivatorEnableProc;
extern plResponderActivatorEnableProc gResponderActivatorEnableProc;
enum { kActivatorComp, kActivatorEnable }; enum { kActivatorComp, kActivatorEnable };
class plResponderActivatorEnableProc : public ParamMap2UserDlgProc
{
protected:
void IUpdateButton(IParamBlock2 *pb, HWND hWnd)
{
INode *node = pb->GetINode(kActivatorComp);
if (node)
SetDlgItemText(hWnd, IDC_RESPONDER_BUTTON, node->GetName());
else
SetDlgItemText(hWnd, IDC_RESPONDER_BUTTON, "(none)");
}
public:
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
IUpdateButton(pm->GetParamBlock(), hWnd);
return TRUE;
case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_BUTTON)
{
if (plPick::DetectorEnable(pm->GetParamBlock(), kActivatorComp, true))
IUpdateButton(pm->GetParamBlock(), hWnd);
return TRUE;
}
break;
}
return FALSE;
}
void DeleteThis() {}
};
static plResponderActivatorEnableProc gResponderActivatorEnableProc;
ParamBlockDesc2 gResponderActivatorEnableBlock ParamBlockDesc2 gResponderActivatorEnableBlock
( (
kResponderActivatorEnableBlk, _T("detectorEnable"), 0, NULL, P_AUTO_UI, kResponderActivatorEnableBlk, _T("detectorEnable"), 0, NULL, P_AUTO_UI,
@ -835,19 +859,18 @@ plMessage *plResponderCmdDetectorEnable::CreateMsg(plMaxNode* node, plErrorMsg *
return msg; return msg;
} }
#include "plPickNode.h" ///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
class plResponderActivatorEnableProc : public ParamMap2UserDlgProc #include "plMessage/plExcludeRegionMsg.h"
#include "plExcludeRegionComponent.h"
enum { kXRegionComp, kXRegionType, kXRegionNode };
class plResponderXRegionProc : public ParamMap2UserDlgProc
{ {
protected: protected:
void IUpdateButton(IParamBlock2 *pb, HWND hWnd) plResponderCompNode fCompNode;
{
INode *node = pb->GetINode(kActivatorComp);
if (node)
SetDlgItemText(hWnd, IDC_RESPONDER_BUTTON, node->GetName());
else
SetDlgItemText(hWnd, IDC_RESPONDER_BUTTON, "(none)");
}
public: public:
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
@ -855,14 +878,25 @@ public:
switch (msg) switch (msg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
IUpdateButton(pm->GetParamBlock(), hWnd); {
IParamBlock2 *pb = pm->GetParamBlock();
plResponderCompNode::ClassIDs cids;
cids.push_back(XREGION_CID);
fCompNode.Init(pb, kXRegionComp, kXRegionNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids);
fCompNode.InitDlg(hWnd);
}
return TRUE; return TRUE;
case WM_COMMAND: case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_BUTTON) if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_COMP)
{ {
if (plPick::DetectorEnable(pm->GetParamBlock(), kActivatorComp, true)) fCompNode.CompButtonPress(hWnd);
IUpdateButton(pm->GetParamBlock(), hWnd); return TRUE;
}
else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_NODE)
{
fCompNode.NodeButtonPress(hWnd);
return TRUE; return TRUE;
} }
break; break;
@ -872,15 +906,7 @@ public:
} }
void DeleteThis() {} void DeleteThis() {}
}; };
static plResponderActivatorEnableProc gResponderActivatorEnableProc; static plResponderXRegionProc gResponderXRegionProc;
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
class plResponderXRegionProc;
extern plResponderXRegionProc gResponderXRegionProc;
enum { kXRegionComp, kXRegionType, kXRegionNode };
ParamBlockDesc2 gResponderXRegionBlock ParamBlockDesc2 gResponderXRegionBlock
( (
@ -963,9 +989,6 @@ const char *plResponderCmdXRegion::GetInstanceName(IParamBlock2 *pb)
return name; return name;
} }
#include "plMessage/plExcludeRegionMsg.h"
#include "plExcludeRegionComponent.h"
plMessage *plResponderCmdXRegion::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb) plMessage *plResponderCmdXRegion::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb)
{ {
plResponderCompNode compNode; plResponderCompNode compNode;
@ -1000,53 +1023,9 @@ plMessage *plResponderCmdXRegion::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg
throw "No exclude region component specified"; throw "No exclude region component specified";
} }
class plResponderXRegionProc : public ParamMap2UserDlgProc
{
protected:
plResponderCompNode fCompNode;
public:
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
{
IParamBlock2 *pb = pm->GetParamBlock();
plResponderCompNode::ClassIDs cids;
cids.push_back(XREGION_CID);
fCompNode.Init(pb, kXRegionComp, kXRegionNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids);
fCompNode.InitDlg(hWnd);
}
return TRUE;
case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_COMP)
{
fCompNode.CompButtonPress(hWnd);
return TRUE;
}
else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_NODE)
{
fCompNode.NodeButtonPress(hWnd);
return TRUE;
}
break;
}
return FALSE;
}
void DeleteThis() {}
};
static plResponderXRegionProc gResponderXRegionProc;
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
class plResponderCameraTransitionProc;
extern plResponderCameraTransitionProc gResponderCameraTransitionProc;
enum enum
{ kCameraObj, { kCameraObj,
kPopCamera, kPopCamera,
@ -1149,9 +1128,6 @@ plMessage *plResponderCmdCamTransition::CreateMsg(plMaxNode* node, plErrorMsg *p
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
class plResponderCameraForceProc;
extern plResponderCameraForceProc gResponderCameraForceProc;
enum enum
{ {
kCamForce, kCamForce,
@ -1420,9 +1396,46 @@ plMessage *plResponderCmdVisibility::CreateMsg(plMaxNode* node, plErrorMsg *pErr
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
enum { kSubWorldNode, kSubWorldType }; enum { kSubWorldNode, kSubWorldType };
enum
{
kRespondSubWorldEnter,
kRespondSubWorldExit,
};
class plResponderSubWorldProc : public ParamMap2UserDlgProc
{
public:
virtual BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
{
IParamBlock2 *pb = pm->GetParamBlock();
int type = pb->GetInt(kSubWorldType);
HWND nButton = GetDlgItem(hWnd, IDC_NODE_BUTTON);
//HWND sEnterText = GetDlgItem(hWnd, IDC_SUBWORLD_ENTER);
HWND sExitText = GetDlgItem(hWnd, IDC_SUBWORLD_EXIT);
BOOL isEnter = (type == kRespondSubWorldEnter) ? TRUE : FALSE;
ShowWindow(nButton, (isEnter) ? SW_SHOW : SW_HIDE);
//ShowWindow(sEnterText,(isEnter) ? SW_SHOW : SW_HIDE);
ShowWindow(sExitText, (isEnter) ? SW_HIDE : SW_SHOW);
}
return TRUE;
case WM_COMMAND:
break;
}
return FALSE;
}
virtual void DeleteThis() {}
};
class plResponderSubWorldProc; static plResponderSubWorldProc gResponderSubWorldProc;
extern plResponderSubWorldProc gResponderSubWorldProc;
ParamBlockDesc2 gResponderSubWorldBlock ParamBlockDesc2 gResponderSubWorldBlock
( (
@ -1440,12 +1453,6 @@ ParamBlockDesc2 gResponderSubWorldBlock
end end
); );
enum
{
kRespondSubWorldEnter,
kRespondSubWorldExit,
};
plResponderCmdSubWorld& plResponderCmdSubWorld::Instance() plResponderCmdSubWorld& plResponderCmdSubWorld::Instance()
{ {
static plResponderCmdSubWorld theInstance; static plResponderCmdSubWorld theInstance;
@ -1532,54 +1539,45 @@ plMessage *plResponderCmdSubWorld::CreateMsg(plMaxNode* node, plErrorMsg *pErrMs
return swMsg; return swMsg;
} }
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
class plResponderSubWorldProc : public ParamMap2UserDlgProc #include "pfMessage/plArmatureEffectMsg.h"
#include "plAvatar/plArmatureEffects.h"
enum
{
kSurface,
};
class plResponderFootSurfaceProc : public ParamMap2UserDlgProc
{ {
public: public:
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
IParamBlock2 *pb = pm->GetParamBlock();
HWND hCB = GetDlgItem(hWnd, IDC_COMP_RESPOND_FOOT_SURFACE);
int i;
switch (msg) switch (msg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
{ for (i = 0; i < plArmatureEffectsMgr::kMaxSurface; i++)
IParamBlock2 *pb = pm->GetParamBlock(); ComboBox_AddString(hCB, plArmatureEffectsMgr::SurfaceStrings[i]);
int type = pb->GetInt(kSubWorldType);
HWND nButton = GetDlgItem(hWnd, IDC_NODE_BUTTON);
//HWND sEnterText = GetDlgItem(hWnd, IDC_SUBWORLD_ENTER);
HWND sExitText = GetDlgItem(hWnd, IDC_SUBWORLD_EXIT);
BOOL isEnter = (type == kRespondSubWorldEnter) ? TRUE : FALSE; ComboBox_SetCurSel(hCB, pb->GetInt(ParamID(kSurface)));
ShowWindow(nButton, (isEnter) ? SW_SHOW : SW_HIDE);
//ShowWindow(sEnterText,(isEnter) ? SW_SHOW : SW_HIDE);
ShowWindow(sExitText, (isEnter) ? SW_HIDE : SW_SHOW);
}
return TRUE; return TRUE;
case WM_COMMAND: case WM_COMMAND:
break; if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_RESPOND_FOOT_SURFACE)
pb->SetValue(ParamID(kSurface), 0, ComboBox_GetCurSel(hCB));
} }
return FALSE; return FALSE;
} }
void DeleteThis() {} void DeleteThis() {}
}; };
static plResponderFootSurfaceProc gResponderFootSurfaceProc;
static plResponderSubWorldProc gResponderSubWorldProc;
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
#include "pfMessage/plArmatureEffectMsg.h"
#include "plAvatar/plArmatureEffects.h"
class plResponderFootSurfaceProc;
extern plResponderFootSurfaceProc gResponderFootSurfaceProc;
enum
{
kSurface,
};
ParamBlockDesc2 gResponderFootSurfaceBlock ParamBlockDesc2 gResponderFootSurfaceBlock
( (
@ -1623,44 +1621,52 @@ plMessage *plResponderCmdFootSurface::CreateMsg(plMaxNode* node, plErrorMsg *pEr
return msg; return msg;
} }
class plResponderFootSurfaceProc : public ParamMap2UserDlgProc ///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
#include "plMultistageBehComponent.h"
enum { kMultistageComp, kMultistageNode };
class plResponderMultistageProc : public ParamMap2UserDlgProc
{ {
protected:
plResponderCompNode fCompNode;
public: public:
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) virtual BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
IParamBlock2 *pb = pm->GetParamBlock();
HWND hCB = GetDlgItem(hWnd, IDC_COMP_RESPOND_FOOT_SURFACE);
int i;
switch (msg) switch (msg)
{ {
case WM_INITDIALOG: case WM_INITDIALOG:
for (i = 0; i < plArmatureEffectsMgr::kMaxSurface; i++) {
ComboBox_AddString(hCB, plArmatureEffectsMgr::SurfaceStrings[i]); IParamBlock2 *pb = pm->GetParamBlock();
ComboBox_SetCurSel(hCB, pb->GetInt(ParamID(kSurface)));
plResponderCompNode::ClassIDs cids;
cids.push_back(MULTISTAGE_BEH_CID);
fCompNode.Init(pb, kMultistageComp, kMultistageNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids);
fCompNode.InitDlg(hWnd);
}
return TRUE; return TRUE;
case WM_COMMAND: case WM_COMMAND:
if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_RESPOND_FOOT_SURFACE) if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_COMP)
pb->SetValue(ParamID(kSurface), 0, ComboBox_GetCurSel(hCB)); {
fCompNode.CompButtonPress(hWnd);
return TRUE;
}
else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_NODE)
{
fCompNode.NodeButtonPress(hWnd);
return TRUE;
}
break;
} }
return FALSE; return FALSE;
} }
void DeleteThis() {} virtual void DeleteThis() {}
}; };
static plResponderFootSurfaceProc gResponderFootSurfaceProc; static plResponderMultistageProc gResponderMultistageProc;
///////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////
#include "plMultistageBehComponent.h"
class plResponderMultistageProc;
extern plResponderMultistageProc gResponderMultistageProc;
enum { kMultistageComp, kMultistageNode };
ParamBlockDesc2 gResponderMultistageBlock ParamBlockDesc2 gResponderMultistageBlock
( (
@ -1722,44 +1728,3 @@ plMessage *plResponderCmdMultistage::CreateMsg(plMaxNode* node, plErrorMsg *pErr
else else
throw "No Multistage component specified"; throw "No Multistage component specified";
} }
class plResponderMultistageProc : public ParamMap2UserDlgProc
{
protected:
plResponderCompNode fCompNode;
public:
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg)
{
case WM_INITDIALOG:
{
IParamBlock2 *pb = pm->GetParamBlock();
plResponderCompNode::ClassIDs cids;
cids.push_back(MULTISTAGE_BEH_CID);
fCompNode.Init(pb, kMultistageComp, kMultistageNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids);
fCompNode.InitDlg(hWnd);
}
return TRUE;
case WM_COMMAND:
if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_COMP)
{
fCompNode.CompButtonPress(hWnd);
return TRUE;
}
else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_NODE)
{
fCompNode.NodeButtonPress(hWnd);
return TRUE;
}
break;
}
return FALSE;
}
void DeleteThis() {}
};
static plResponderMultistageProc gResponderMultistageProc;

37
Sources/Tools/MaxComponent/plResponderMtl.cpp

@ -72,8 +72,23 @@ enum MtlNodeType
kNodeResponder // Use the node the responder is attached to kNodeResponder // Use the node the responder is attached to
}; };
class plResponderMtlProc; #include "plAnimCompProc.h"
extern plResponderMtlProc gResponderMtlProc;
class plResponderMtlProc : public plMtlAnimProc
{
public:
plResponderMtlProc();
protected:
virtual void IOnInitDlg(HWND hWnd, IParamBlock2* pb);
virtual void ILoadUser(HWND hWnd, IParamBlock2* pb);
virtual bool IUserCommand(HWND hWnd, IParamBlock2* pb, int cmd, int resID);
virtual void IPickNode(IParamBlock2* pb);
virtual void ISetNodeButtonText(HWND hWnd, IParamBlock2* pb);
};
static plResponderMtlProc gResponderMtlProc;
ParamBlockDesc2 gResponderMtlBlock ParamBlockDesc2 gResponderMtlBlock
( (
@ -461,24 +476,6 @@ void plResponderCmdMtl::CreateWait(plMaxNode* node, plErrorMsg* pErrMsg, IParamB
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
#include "plAnimCompProc.h"
class plResponderMtlProc : public plMtlAnimProc
{
public:
plResponderMtlProc();
protected:
virtual void IOnInitDlg(HWND hWnd, IParamBlock2* pb);
virtual void ILoadUser(HWND hWnd, IParamBlock2* pb);
virtual bool IUserCommand(HWND hWnd, IParamBlock2* pb, int cmd, int resID);
virtual void IPickNode(IParamBlock2* pb);
virtual void ISetNodeButtonText(HWND hWnd, IParamBlock2* pb);
};
static plResponderMtlProc gResponderMtlProc;
plResponderMtlProc::plResponderMtlProc() plResponderMtlProc::plResponderMtlProc()
{ {
fMtlButtonID = IDC_MTL_BUTTON; fMtlButtonID = IDC_MTL_BUTTON;

50
Sources/Tools/MaxComponent/plResponderWait.cpp

@ -32,8 +32,29 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plResponderLink.h" #include "plResponderLink.h"
class plResponderWaitProc; class plResponderWaitProc : public ParamMap2UserDlgProc
extern plResponderWaitProc gResponderWaitProc; {
protected:
IParamBlock2 *fStatePB;
IParamBlock2 *fWaitPB;
int fCurCmd;
HWND fhDlg;
HWND fhList;
public:
void Init(IParamBlock2 *curStatePB, int curCmd, HWND hList) { fStatePB = curStatePB; fCurCmd = curCmd; fhList = hList; }
virtual BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
virtual void DeleteThis() {}
protected:
void LoadWho(bool setDefault=false);
void LoadPoint(bool force=false);
IParamBlock2 *GetCmdParams(int cmdIdx);
};
static plResponderWaitProc gResponderWaitProc;
enum enum
{ {
@ -111,30 +132,7 @@ const char* ResponderWait::GetWaitPoint(IParamBlock2* waitPB)
return point; return point;
} }
class plResponderWaitProc : public ParamMap2UserDlgProc /////////////////////////////////////////////////////////////////////////////
{
protected:
IParamBlock2 *fStatePB;
IParamBlock2 *fWaitPB;
int fCurCmd;
HWND fhDlg;
HWND fhList;
public:
void Init(IParamBlock2 *curStatePB, int curCmd, HWND hList) { fStatePB = curStatePB; fCurCmd = curCmd; fhList = hList; }
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam);
void DeleteThis() {}
protected:
void LoadWho(bool setDefault=false);
void LoadPoint(bool force=false);
IParamBlock2 *GetCmdParams(int cmdIdx);
};
static plResponderWaitProc gResponderWaitProc;
void ResponderWait::InitDlg(IParamBlock2 *curStatePB, int curCmd, HWND hList) void ResponderWait::InitDlg(IParamBlock2 *curStatePB, int curCmd, HWND hList)
{ {

5
Sources/Tools/MaxPlasmaMtls/Layers/plDynamicEnvLayerBitmapPB.cpp

@ -99,6 +99,7 @@ class PickAnchorNode : public PickObjectProc
class DELBitmapDlgProc : public ParamMap2UserDlgProc class DELBitmapDlgProc : public ParamMap2UserDlgProc
{ {
public:
PickAnchorNode fPickAnchorCallback; PickAnchorNode fPickAnchorCallback;
/// Called to update the controls of the dialog /// Called to update the controls of the dialog
@ -149,7 +150,7 @@ class DELBitmapDlgProc : public ParamMap2UserDlgProc
} }
/// Main message proc /// Main message proc
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
switch (msg) switch (msg)
{ {
@ -183,7 +184,7 @@ class DELBitmapDlgProc : public ParamMap2UserDlgProc
return FALSE; return FALSE;
} }
void DeleteThis() {}; virtual void DeleteThis() {};
}; };
static DELBitmapDlgProc gDELBitmapDlgProc; static DELBitmapDlgProc gDELBitmapDlgProc;

5
Sources/Tools/MaxPlasmaMtls/Layers/plDynamicTextLayerBitmapPB.cpp

@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
class DTLBitmapDlgProc : public ParamMap2UserDlgProc class DTLBitmapDlgProc : public ParamMap2UserDlgProc
{ {
public:
/// Called to update the controls of the dialog /// Called to update the controls of the dialog
virtual void Update( TimeValue t, Interval &valid, IParamMap2 *map ) virtual void Update( TimeValue t, Interval &valid, IParamMap2 *map )
{ {
@ -69,7 +70,7 @@ class DTLBitmapDlgProc : public ParamMap2UserDlgProc
} }
/// Main message proc /// Main message proc
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
switch (msg) switch (msg)
@ -136,7 +137,7 @@ class DTLBitmapDlgProc : public ParamMap2UserDlgProc
return FALSE; return FALSE;
} }
void DeleteThis() {}; virtual void DeleteThis() {};
protected: protected:
/// Clamp texture sizes to a power of 2 /// Clamp texture sizes to a power of 2

6
Sources/Tools/MaxPlasmaMtls/Layers/plLayerTex.cpp

@ -173,7 +173,7 @@ BOOL plLayerTex::SetDlgThing(ParamDlg* dlg)
int plLayerTex::NumRefs() int plLayerTex::NumRefs()
{ {
return 3; return 2;
} }
//From ReferenceMaker //From ReferenceMaker
@ -211,7 +211,7 @@ void plLayerTex::SetReference(int i, RefTargetHandle rtarg)
int plLayerTex::NumParamBlocks() int plLayerTex::NumParamBlocks()
{ {
return 2; return 1;
} }
IParamBlock2* plLayerTex::GetParamBlock(int i) IParamBlock2* plLayerTex::GetParamBlock(int i)
@ -248,7 +248,7 @@ RefTargetHandle plLayerTex::Clone(RemapDir &remap)
int plLayerTex::NumSubs() int plLayerTex::NumSubs()
{ {
return 3; return 2;
} }
Animatable* plLayerTex::SubAnim(int i) Animatable* plLayerTex::SubAnim(int i)

4
Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBasicPB.cpp

@ -64,7 +64,7 @@ static const char *kUsageTypes[] =
class BasicDlgProc : public ParamMap2UserDlgProc class BasicDlgProc : public ParamMap2UserDlgProc
{ {
public: public:
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
IParamBlock2 *pb = map->GetParamBlock(); IParamBlock2 *pb = map->GetParamBlock();
@ -101,6 +101,6 @@ public:
return false; return false;
} }
void DeleteThis() {}; virtual void DeleteThis() {};
}; };
static BasicDlgProc gBasicDlgProc; static BasicDlgProc gBasicDlgProc;

1115
Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBitmapPB.cpp

File diff suppressed because it is too large Load Diff

4
Sources/Tools/MaxPlasmaMtls/Layers/plMAXCameraLayer.cpp

@ -68,7 +68,7 @@ public:
virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap) { UpdateDisplay(pmap); } virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap) { UpdateDisplay(pmap); }
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
int id = LOWORD(wParam); int id = LOWORD(wParam);
int code = HIWORD(wParam); int code = HIWORD(wParam);
@ -103,7 +103,7 @@ public:
} }
return FALSE; return FALSE;
} }
void DeleteThis() {} virtual void DeleteThis() {}
}; };
static MAXCameraLayerDlgProc gMAXCameraLayerDlgProc; static MAXCameraLayerDlgProc gMAXCameraLayerDlgProc;

4
Sources/Tools/MaxPlasmaMtls/Layers/plStaticEnvLayerBitmapPB.cpp

@ -195,7 +195,7 @@ public:
} }
/// Main message proc /// Main message proc
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
static ICustButton* bmSelectBtn; static ICustButton* bmSelectBtn;
long buttons[ 6 ] = { IDC_FRONT_NAME, IDC_BACK_NAME, IDC_LEFT_NAME, IDC_RIGHT_NAME, IDC_TOP_NAME, IDC_BOTTOM_NAME }; long buttons[ 6 ] = { IDC_FRONT_NAME, IDC_BACK_NAME, IDC_LEFT_NAME, IDC_RIGHT_NAME, IDC_TOP_NAME, IDC_BOTTOM_NAME };
@ -264,7 +264,7 @@ public:
return FALSE; return FALSE;
} }
void DeleteThis() {}; virtual void DeleteThis() {};
BOOL IDoSelectBaseFilename( IParamMap2 *map, TimeValue t, HWND hWnd ) BOOL IDoSelectBaseFilename( IParamMap2 *map, TimeValue t, HWND hWnd )
{ {

6
Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp

@ -83,11 +83,11 @@ protected:
HWND fhWnd; HWND fhWnd;
public: public:
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
void DeleteThis() { IDeleteSegMap(); } virtual void DeleteThis() { IDeleteSegMap(); }
void SetThing(ReferenceTarget *m); void SetThing(ReferenceTarget *m);
void Update( TimeValue t, Interval &valid, IParamMap2 *pmap ); virtual void Update( TimeValue t, Interval &valid, IParamMap2 *pmap );
protected: protected:
// Set all the controls to their stored value // Set all the controls to their stored value

59
Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtlBasicPBDec.h

@ -28,8 +28,33 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "../resource.h" #include "../resource.h"
#include "iparamm2.h" #include "iparamm2.h"
class BumpBasicDlgProc; class BumpBasicDlgProc : public ParamMap2UserDlgProc
extern BumpBasicDlgProc gBumpBasicDlgProc; {
#if 1
protected:
public:
BumpBasicDlgProc() {}
~BumpBasicDlgProc() { }
#endif
public:
virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
IParamBlock2 *pb = map->GetParamBlock();
switch (msg)
{
case WM_INITDIALOG:
{
}
return TRUE;
}
return FALSE;
}
virtual void DeleteThis() {}
};
static BumpBasicDlgProc gBumpBasicDlgProc;
static ParamBlockDesc2 gBumpBasicPB static ParamBlockDesc2 gBumpBasicPB
( (
@ -60,33 +85,3 @@ static ParamBlockDesc2 gBumpBasicPB
end end
); );
ParamBlockDesc2 *GetBumpBasicPB() { return &gBumpBasicPB; } ParamBlockDesc2 *GetBumpBasicPB() { return &gBumpBasicPB; }
class BumpBasicDlgProc : public ParamMap2UserDlgProc
{
#if 1
protected:
public:
BumpBasicDlgProc() {}
~BumpBasicDlgProc() { }
#endif
public:
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
IParamBlock2 *pb = map->GetParamBlock();
switch (msg)
{
case WM_INITDIALOG:
{
}
return TRUE;
}
return FALSE;
}
void DeleteThis() {}
};
static BumpBasicDlgProc gBumpBasicDlgProc;

163
Sources/Tools/MaxPlasmaMtls/Materials/plClothingMtlPBDec.h

@ -121,87 +121,6 @@ public:
} }
}; };
class ClothingBasicDlgProc;
extern ClothingBasicDlgProc gClothingBasicDlgProc;
static ParamBlockDesc2 gClothingMtlPB
(
plClothingMtl::kBlkBasic, _T("Clothing"), IDS_PASS_BASIC, GetClothingMtlDesc(),
P_AUTO_CONSTRUCT + P_AUTO_UI + P_CALLSETS_ON_LOAD, plClothingMtl::kRefBasic,
// UI
IDD_CLOTHING, IDS_PASS_BASIC, 0, 0, &gClothingBasicDlgProc,
plClothingMtl::kTileset, _T("tileset"), TYPE_INT, 0, 0,
p_default, 0,
end,
plClothingMtl::kTexmap, _T("texmap"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kDescription, _T("ItemDescription"), TYPE_STRING, 0, 0,
p_ui, TYPE_EDITBOX, IDC_CLOTHING_DESCRIPTION,
end,
plClothingMtl::kThumbnail, _T("Thumbnail"), TYPE_TEXMAP, 0, 0,
end,
plClothingMtl::kLayer, _T("Layer"), TYPE_INT, 0, 0,
p_default, plClothingElement::kLayerTint1,
end,
plClothingMtl::kTexmapSkin, _T("SkinLayer"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmap2, _T("TintLayer2"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kDefault, _T("Default"), TYPE_BOOL, 0, 0,
p_ui, TYPE_SINGLECHEKBOX, IDC_CLOTHING_DEFAULT,
p_default, 0,
end,
plClothingMtl::kCustomTextSpecs, _T("TextSpecs"), TYPE_STRING, 0, 0,
end,
plClothingMtl::kTexmapBase, _T("BaseLayer"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmapSkinBlend1, _T("SkinBlend(1)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmapSkinBlend2, _T("SkinBlend(2)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmapSkinBlend3, _T("SkinBlend(3)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmapSkinBlend4, _T("SkinBlend(4)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmapSkinBlend5, _T("SkinBlend(5)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmapSkinBlend6, _T("SkinBlend(6)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kDefaultTint1, _T("DefaultTint1"), TYPE_RGBA, 0, 0,
p_ui, TYPE_COLORSWATCH, IDC_CLOTHING_TINT1,
p_default, Color(1,1,1),
end,
plClothingMtl::kDefaultTint2, _T("DefaultTint2"), TYPE_RGBA, 0, 0,
p_ui, TYPE_COLORSWATCH, IDC_CLOTHING_TINT2,
p_default, Color(1,1,1),
end,
plClothingMtl::kForcedAcc, _T("ForcedAcc"), TYPE_STRING, 0, 0,
p_ui, TYPE_EDITBOX, IDC_CLOTHING_FORCED_ACC,
end,
end
);
class ClothingBasicDlgProc : public ParamMap2UserDlgProc class ClothingBasicDlgProc : public ParamMap2UserDlgProc
{ {
protected: protected:
@ -283,7 +202,7 @@ public:
virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap) { UpdateDisplay(pmap); } virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap) { UpdateDisplay(pmap); }
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
// Check if it is for our edit box // Check if it is for our edit box
if (fCustomText.ProcessMsg(map, hWnd, msg, wParam, lParam)) if (fCustomText.ProcessMsg(map, hWnd, msg, wParam, lParam))
@ -427,6 +346,84 @@ public:
return FALSE; return FALSE;
} }
void DeleteThis() {} virtual void DeleteThis() {}
}; };
static ClothingBasicDlgProc gClothingBasicDlgProc; static ClothingBasicDlgProc gClothingBasicDlgProc;
static ParamBlockDesc2 gClothingMtlPB
(
plClothingMtl::kBlkBasic, _T("Clothing"), IDS_PASS_BASIC, GetClothingMtlDesc(),
P_AUTO_CONSTRUCT + P_AUTO_UI + P_CALLSETS_ON_LOAD, plClothingMtl::kRefBasic,
// UI
IDD_CLOTHING, IDS_PASS_BASIC, 0, 0, &gClothingBasicDlgProc,
plClothingMtl::kTileset, _T("tileset"), TYPE_INT, 0, 0,
p_default, 0,
end,
plClothingMtl::kTexmap, _T("texmap"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kDescription, _T("ItemDescription"), TYPE_STRING, 0, 0,
p_ui, TYPE_EDITBOX, IDC_CLOTHING_DESCRIPTION,
end,
plClothingMtl::kThumbnail, _T("Thumbnail"), TYPE_TEXMAP, 0, 0,
end,
plClothingMtl::kLayer, _T("Layer"), TYPE_INT, 0, 0,
p_default, plClothingElement::kLayerTint1,
end,
plClothingMtl::kTexmapSkin, _T("SkinLayer"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmap2, _T("TintLayer2"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kDefault, _T("Default"), TYPE_BOOL, 0, 0,
p_ui, TYPE_SINGLECHEKBOX, IDC_CLOTHING_DEFAULT,
p_default, 0,
end,
plClothingMtl::kCustomTextSpecs, _T("TextSpecs"), TYPE_STRING, 0, 0,
end,
plClothingMtl::kTexmapBase, _T("BaseLayer"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmapSkinBlend1, _T("SkinBlend(1)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmapSkinBlend2, _T("SkinBlend(2)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmapSkinBlend3, _T("SkinBlend(3)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmapSkinBlend4, _T("SkinBlend(4)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmapSkinBlend5, _T("SkinBlend(5)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kTexmapSkinBlend6, _T("SkinBlend(6)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0,
end,
plClothingMtl::kDefaultTint1, _T("DefaultTint1"), TYPE_RGBA, 0, 0,
p_ui, TYPE_COLORSWATCH, IDC_CLOTHING_TINT1,
p_default, Color(1,1,1),
end,
plClothingMtl::kDefaultTint2, _T("DefaultTint2"), TYPE_RGBA, 0, 0,
p_ui, TYPE_COLORSWATCH, IDC_CLOTHING_TINT2,
p_default, Color(1,1,1),
end,
plClothingMtl::kForcedAcc, _T("ForcedAcc"), TYPE_STRING, 0, 0,
p_ui, TYPE_EDITBOX, IDC_CLOTHING_FORCED_ACC,
end,
end
);

111
Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtlBasicPBDec.h

@ -31,8 +31,59 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
class DecalBasicPBAccessor; class DecalBasicPBAccessor;
extern DecalBasicPBAccessor basicAccessor; extern DecalBasicPBAccessor basicAccessor;
class DecalBasicDlgProc; class DecalBasicDlgProc : public ParamMap2UserDlgProc
extern DecalBasicDlgProc gDecalBasicDlgProc; {
protected:
HIMAGELIST hLockButtons;
void LoadLockButtons()
{
static bool loaded = false;
if (loaded)
return;
loaded = true;
HINSTANCE hInst = hInstance;
hLockButtons = ImageList_Create(16, 15, TRUE, 2, 0);
HBITMAP hBitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_BUTTONS));
HBITMAP hMask = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_MASKBUTTONS));
ImageList_Add(hLockButtons, hBitmap, hMask);
DeleteObject(hBitmap);
DeleteObject(hMask);
}
void ISetLock(HWND hButton)
{
LoadLockButtons();
ICustButton *iBut = GetICustButton(hButton);
iBut->SetImage(hLockButtons,0,1,0,1,16,15);
iBut->SetType(CBT_CHECK);
ReleaseICustButton(iBut);
}
public:
DecalBasicDlgProc() : hLockButtons(NULL) {}
~DecalBasicDlgProc() { if (hLockButtons) ImageList_Destroy(hLockButtons); }
public:
virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
IParamBlock2 *pb = map->GetParamBlock();
switch (msg)
{
case WM_INITDIALOG:
{
ISetLock(GetDlgItem(hWnd, IDC_LOCK_AD));
ISetLock(GetDlgItem(hWnd, IDC_LOCK_COLORS));
}
return TRUE;
}
return FALSE;
}
virtual void DeleteThis() {}
};
static DecalBasicDlgProc gDecalBasicDlgProc;
static ParamBlockDesc2 gDecalBasicPB static ParamBlockDesc2 gDecalBasicPB
( (
@ -178,59 +229,3 @@ public:
} }
}; };
static DecalBasicPBAccessor basicAccessor; static DecalBasicPBAccessor basicAccessor;
class DecalBasicDlgProc : public ParamMap2UserDlgProc
{
#if 1
protected:
HIMAGELIST hLockButtons;
void LoadLockButtons()
{
static bool loaded = false;
if (loaded)
return;
loaded = true;
HINSTANCE hInst = hInstance;
hLockButtons = ImageList_Create(16, 15, TRUE, 2, 0);
HBITMAP hBitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_BUTTONS));
HBITMAP hMask = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_MASKBUTTONS));
ImageList_Add(hLockButtons, hBitmap, hMask);
DeleteObject(hBitmap);
DeleteObject(hMask);
}
void ISetLock(HWND hButton)
{
LoadLockButtons();
ICustButton *iBut = GetICustButton(hButton);
iBut->SetImage(hLockButtons,0,1,0,1,16,15);
iBut->SetType(CBT_CHECK);
ReleaseICustButton(iBut);
}
public:
DecalBasicDlgProc() : hLockButtons(NULL) {}
~DecalBasicDlgProc() { if (hLockButtons) ImageList_Destroy(hLockButtons); }
#endif
public:
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
IParamBlock2 *pb = map->GetParamBlock();
switch (msg)
{
case WM_INITDIALOG:
{
ISetLock(GetDlgItem(hWnd, IDC_LOCK_AD));
ISetLock(GetDlgItem(hWnd, IDC_LOCK_COLORS));
}
return TRUE;
}
return FALSE;
}
void DeleteThis() {}
};
static DecalBasicDlgProc gDecalBasicDlgProc;

166
Sources/Tools/MaxPlasmaMtls/Materials/plParticleMtlPBDec.h

@ -28,8 +28,87 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
class PartMtlPBAccessor; class PartMtlPBAccessor;
extern PartMtlPBAccessor partMtl_accessor; extern PartMtlPBAccessor partMtl_accessor;
class ParticleBasicDlgProc; class ParticleBasicDlgProc : public ParamMap2UserDlgProc
extern ParticleBasicDlgProc gParticleBasicDlgProc; {
public:
ParticleBasicDlgProc() {}
~ParticleBasicDlgProc() {}
void UpdateDisplay(IParamMap2 *pmap)
{
HWND hWnd = pmap->GetHWnd();
IParamBlock2 *pb = pmap->GetParamBlock();
HWND cbox = GetDlgItem(hWnd, IDC_PARTICLE_NORMAL);
plPlasmaMAXLayer *layer = (plPlasmaMAXLayer *)pb->GetTexmap(ParamID(plParticleMtl::kTexmap));
PBBitmap *pbbm;
ICustButton *bmSelectBtn;
SendMessage(cbox, CB_SETCURSEL, pb->GetInt(plParticleMtl::kNormal), 0);
pbbm = (layer == nil ? nil : layer->GetPBBitmap());
bmSelectBtn = GetICustButton(GetDlgItem(hWnd,IDC_PARTICLE_TEXTURE));
bmSelectBtn->SetText(pbbm ? (TCHAR*)pbbm->bi.Filename() : "(none)");
ReleaseICustButton(bmSelectBtn);
}
virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap) { UpdateDisplay(pmap); }
virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
int id = LOWORD(wParam);
int code = HIWORD(wParam);
IParamBlock2 *pb = map->GetParamBlock();
HWND cbox = NULL;
plPlasmaMAXLayer *layer = (plPlasmaMAXLayer *)pb->GetTexmap(ParamID(plParticleMtl::kTexmap));
switch (msg)
{
case WM_INITDIALOG:
int j;
for (j = 0; j < plParticleMtl::kNumNormalOptions; j++)
{
cbox = GetDlgItem(hWnd, IDC_PARTICLE_NORMAL);
SendMessage(cbox, CB_ADDSTRING, 0, (LPARAM)plParticleMtl::NormalStrings[j]);
}
UpdateDisplay(map);
return TRUE;
case WM_COMMAND:
if (id == IDC_PARTICLE_NORMAL)
{
pb->SetValue(plParticleMtl::kNormal, t, SendMessage(GetDlgItem(hWnd, id), CB_GETCURSEL, 0, 0));
return TRUE;
}
else if (id == IDC_PARTICLE_TEXTURE)
{
if (layer == nil)
return FALSE;
layer->HandleBitmapSelection();
UpdateDisplay(map);
return TRUE;
}
else if (id == IDC_PARTICLE_NOFILTER)
{
if (!layer)
return FALSE;
if( pb->GetInt(plParticleMtl::kNoFilter) )
{
layer->GetParamBlockByID( plLayerTex::kBlkBitmap )->SetValue(kBmpNoFilter, t, 1);
}
else
{
layer->GetParamBlockByID( plLayerTex::kBlkBitmap )->SetValue(kBmpNoFilter, t, 0);
}
return TRUE;
}
break;
}
return FALSE;
}
virtual void DeleteThis() {}
};
static ParticleBasicDlgProc gParticleBasicDlgProc;
#define PL_PARTICLE_MTL_MIN_TILES 1 #define PL_PARTICLE_MTL_MIN_TILES 1
#define PL_PARTICLE_MTL_MAX_TILES 16 #define PL_PARTICLE_MTL_MAX_TILES 16
@ -149,86 +228,3 @@ public:
} }
}; };
static PartMtlPBAccessor partMtl_accessor; static PartMtlPBAccessor partMtl_accessor;
class ParticleBasicDlgProc : public ParamMap2UserDlgProc
{
public:
ParticleBasicDlgProc() {}
~ParticleBasicDlgProc() {}
void UpdateDisplay(IParamMap2 *pmap)
{
HWND hWnd = pmap->GetHWnd();
IParamBlock2 *pb = pmap->GetParamBlock();
HWND cbox = GetDlgItem(hWnd, IDC_PARTICLE_NORMAL);
plPlasmaMAXLayer *layer = (plPlasmaMAXLayer *)pb->GetTexmap(ParamID(plParticleMtl::kTexmap));
PBBitmap *pbbm;
ICustButton *bmSelectBtn;
SendMessage(cbox, CB_SETCURSEL, pb->GetInt(plParticleMtl::kNormal), 0);
pbbm = (layer == nil ? nil : layer->GetPBBitmap());
bmSelectBtn = GetICustButton(GetDlgItem(hWnd,IDC_PARTICLE_TEXTURE));
bmSelectBtn->SetText(pbbm ? (TCHAR*)pbbm->bi.Filename() : "(none)");
ReleaseICustButton(bmSelectBtn);
}
virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap) { UpdateDisplay(pmap); }
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
int id = LOWORD(wParam);
int code = HIWORD(wParam);
IParamBlock2 *pb = map->GetParamBlock();
HWND cbox = NULL;
plPlasmaMAXLayer *layer = (plPlasmaMAXLayer *)pb->GetTexmap(ParamID(plParticleMtl::kTexmap));
switch (msg)
{
case WM_INITDIALOG:
int j;
for (j = 0; j < plParticleMtl::kNumNormalOptions; j++)
{
cbox = GetDlgItem(hWnd, IDC_PARTICLE_NORMAL);
SendMessage(cbox, CB_ADDSTRING, 0, (LPARAM)plParticleMtl::NormalStrings[j]);
}
UpdateDisplay(map);
return TRUE;
case WM_COMMAND:
if (id == IDC_PARTICLE_NORMAL)
{
pb->SetValue(plParticleMtl::kNormal, t, SendMessage(GetDlgItem(hWnd, id), CB_GETCURSEL, 0, 0));
return TRUE;
}
else if (id == IDC_PARTICLE_TEXTURE)
{
if (layer == nil)
return FALSE;
layer->HandleBitmapSelection();
UpdateDisplay(map);
return TRUE;
}
else if (id == IDC_PARTICLE_NOFILTER)
{
if (!layer)
return FALSE;
if( pb->GetInt(plParticleMtl::kNoFilter) )
{
layer->GetParamBlockByID( plLayerTex::kBlkBitmap )->SetValue(kBmpNoFilter, t, 1);
}
else
{
layer->GetParamBlockByID( plLayerTex::kBlkBitmap )->SetValue(kBmpNoFilter, t, 0);
}
return TRUE;
}
break;
}
return FALSE;
}
void DeleteThis() {}
};
static ParticleBasicDlgProc gParticleBasicDlgProc;

6
Sources/Tools/MaxPlasmaMtls/Materials/plPassAnimDlgProc.h

@ -59,9 +59,9 @@ class plPassAnimDlgProc : public ParamMap2UserDlgProc, public plMtlChangeCallbac
plPassAnimDlgProc(); plPassAnimDlgProc();
virtual ~plPassAnimDlgProc(); virtual ~plPassAnimDlgProc();
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
void DeleteThis() {} virtual void DeleteThis() {}
void SetThing(ReferenceTarget *m); virtual void SetThing(ReferenceTarget *m);
virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap); virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap);
void SegmentListChanged( void ); void SegmentListChanged( void );

4
Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlAnimPB.h

@ -42,7 +42,7 @@ protected:
} }
public: public:
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{ {
switch (msg) switch (msg)
{ {
@ -79,7 +79,7 @@ public:
return FALSE; return FALSE;
} }
void DeleteThis() {} virtual void DeleteThis() {}
}; };
#endif #endif

4
Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBase.cpp

@ -391,8 +391,10 @@ RefTargetHandle plPassMtlBase::GetReference( int i )
{ {
if( i >= kRefNotetracks && i < kRefNotetracks + fNotetracks.GetCount() ) if( i >= kRefNotetracks && i < kRefNotetracks + fNotetracks.GetCount() )
return fNotetracks[ i - kRefNotetracks ]; return fNotetracks[ i - kRefNotetracks ];
else
hsAssert(false, "shit");
return NULL; return nil;
} }
//// SetReference //////////////////////////////////////////////////////////// //// SetReference ////////////////////////////////////////////////////////////

115
Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBasicPBDec.h

@ -31,8 +31,60 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
class PassBasicPBAccessor; class PassBasicPBAccessor;
extern PassBasicPBAccessor basicAccessor; extern PassBasicPBAccessor basicAccessor;
class PassBasicDlgProc; class PassBasicDlgProc : public ParamMap2UserDlgProc
extern PassBasicDlgProc gPassBasicDlgProc; {
protected:
HIMAGELIST hLockButtons;
void LoadLockButtons()
{
static bool loaded = false;
if (loaded)
return;
loaded = true;
HINSTANCE hInst = hInstance;
hLockButtons = ImageList_Create(16, 15, TRUE, 2, 0);
HBITMAP hBitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_BUTTONS));
HBITMAP hMask = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_MASKBUTTONS));
ImageList_Add(hLockButtons, hBitmap, hMask);
DeleteObject(hBitmap);
DeleteObject(hMask);
}
void ISetLock(HWND hButton)
{
LoadLockButtons();
ICustButton *iBut = GetICustButton(hButton);
iBut->SetImage(hLockButtons,0,1,0,1,16,15);
iBut->SetType(CBT_CHECK);
ReleaseICustButton(iBut);
}
public:
PassBasicDlgProc() : hLockButtons(NULL) {}
~PassBasicDlgProc() { if (hLockButtons) ImageList_Destroy(hLockButtons); }
virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
IParamBlock2 *pb = map->GetParamBlock();
switch (msg)
{
case WM_INITDIALOG:
{
ISetLock(GetDlgItem(hWnd, IDC_LOCK_AD));
ISetLock(GetDlgItem(hWnd, IDC_LOCK_COLORS));
}
return TRUE;
}
return FALSE;
}
virtual void DeleteThis() {}
};
static PassBasicDlgProc gPassBasicDlgProc;
static ParamBlockDesc2 gPassBasicPB static ParamBlockDesc2 gPassBasicPB
( (
@ -179,62 +231,3 @@ public:
} }
}; };
static PassBasicPBAccessor basicAccessor; static PassBasicPBAccessor basicAccessor;
class PassBasicDlgProc : public ParamMap2UserDlgProc
{
#if 1
protected:
HIMAGELIST hLockButtons;
void LoadLockButtons()
{
static bool loaded = false;
if (loaded)
return;
loaded = true;
HINSTANCE hInst = hInstance;
hLockButtons = ImageList_Create(16, 15, TRUE, 2, 0);
HBITMAP hBitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_BUTTONS));
HBITMAP hMask = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_MASKBUTTONS));
ImageList_Add(hLockButtons, hBitmap, hMask);
DeleteObject(hBitmap);
DeleteObject(hMask);
}
void ISetLock(HWND hButton)
{
LoadLockButtons();
ICustButton *iBut = GetICustButton(hButton);
iBut->SetImage(hLockButtons,0,1,0,1,16,15);
iBut->SetType(CBT_CHECK);
ReleaseICustButton(iBut);
}
public:
PassBasicDlgProc() : hLockButtons(NULL) {}
~PassBasicDlgProc() { if (hLockButtons) ImageList_Destroy(hLockButtons); }
#endif
public:
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
IParamBlock2 *pb = map->GetParamBlock();
switch (msg)
{
case WM_INITDIALOG:
{
ISetLock(GetDlgItem(hWnd, IDC_LOCK_AD));
ISetLock(GetDlgItem(hWnd, IDC_LOCK_COLORS));
}
return TRUE;
}
return FALSE;
}
void DeleteThis() {}
};
static PassBasicDlgProc gPassBasicDlgProc;

Loading…
Cancel
Save