mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 10:37:41 -04:00
Fix all of those stupid PlasmaMax purecalls on exit
This commit is contained in:
@ -58,9 +58,9 @@ protected:
|
||||
|
||||
public:
|
||||
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);
|
||||
};
|
||||
|
@ -58,8 +58,29 @@ enum
|
||||
kSmooth,
|
||||
};
|
||||
|
||||
class plCameraCmdComponentProc;
|
||||
extern plCameraCmdComponentProc gCameraCmdComponentProc;
|
||||
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;
|
||||
|
||||
enum
|
||||
{
|
||||
@ -136,27 +157,3 @@ hsBool plCameraCmdComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
|
||||
{
|
||||
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;
|
||||
|
@ -2453,8 +2453,29 @@ enum
|
||||
kSmooth,
|
||||
};
|
||||
|
||||
class plCameraCmdComponentProc;
|
||||
extern plCameraCmdComponentProc gCameraCmdComponentProc;
|
||||
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;
|
||||
|
||||
enum
|
||||
{
|
||||
@ -2531,30 +2552,3 @@ hsBool plCameraCmdComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
|
||||
{
|
||||
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;
|
||||
|
||||
|
||||
|
||||
|
@ -89,8 +89,69 @@ enum
|
||||
};
|
||||
|
||||
|
||||
class plClickDragComponentProc;
|
||||
extern plClickDragComponentProc gClickDragComponentProc;
|
||||
#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;
|
||||
|
||||
ParamBlockDesc2 gClickDragBlock
|
||||
(
|
||||
@ -539,67 +600,3 @@ hsBool plClickDragComponent::DeInit( plMaxNode *node, plErrorMsg *pErrMsg )
|
||||
fAxisKeys.clear();
|
||||
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;
|
||||
|
@ -56,9 +56,6 @@ void DummyCodeIncludeFuncNavigablesRegion() {}
|
||||
|
||||
CLASS_DESC(plAvLadderComponent, gAvLadderComponentDesc, "(ex)Ladder Component", "(ex)LadderComp", COMP_TYPE_PHYS_TERRAINS, NAV_LADDER_CID)
|
||||
|
||||
class plAvLadderComponentProc;
|
||||
extern plAvLadderComponentProc gAvLadderComponentProc;
|
||||
|
||||
enum kAvLadderFields
|
||||
{
|
||||
kTypeCombo,
|
||||
@ -70,6 +67,63 @@ enum kAvLadderFields
|
||||
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
|
||||
(
|
||||
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();
|
||||
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;
|
||||
|
||||
|
||||
|
@ -618,6 +618,130 @@ void plParticleCoreComponent::SetParticleStats(plParticleMtl *mtl)
|
||||
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)
|
||||
|
||||
ParamBlockDesc2 gParticleBk
|
||||
@ -778,130 +902,6 @@ hsBool plParticleComponent::GetParamVals(plMaxNode *pNode)
|
||||
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
|
||||
|
@ -71,9 +71,6 @@ public:
|
||||
fXTiles(1), fYTiles(1), fHSize(1), fVSize(1), fImmortal(false) {}
|
||||
};
|
||||
|
||||
class ParticleCompDlgProc;
|
||||
extern ParticleCompDlgProc gParticleCompDlgProc;
|
||||
|
||||
class plParticleCoreComponent : public plComponent
|
||||
{
|
||||
protected:
|
||||
|
@ -60,33 +60,6 @@ enum
|
||||
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
|
||||
{
|
||||
kNodePB, // Use the node in the PB
|
||||
@ -99,11 +72,6 @@ plResponderCmdAnim& plResponderCmdAnim::Instance()
|
||||
return theInstance;
|
||||
}
|
||||
|
||||
ParamBlockDesc2 *plResponderCmdAnim::GetDesc()
|
||||
{
|
||||
return &gResponderAnimBlock;
|
||||
}
|
||||
|
||||
// Use the old types, for backwards compatibility
|
||||
enum
|
||||
{
|
||||
@ -291,17 +259,6 @@ static bool IsSoundMsg(int type)
|
||||
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)
|
||||
{
|
||||
plMaxNode *node = (plMaxNode*)pb->GetReferenceTarget(kRespAnimComp);
|
||||
@ -563,7 +520,7 @@ class plResponderAnimProc : public plAnimCompProc
|
||||
{
|
||||
public:
|
||||
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:
|
||||
virtual void IPickComponent(IParamBlock2* pb);
|
||||
@ -673,6 +630,46 @@ void plResponderAnimProc::IPickComponent(IParamBlock2* pb)
|
||||
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"
|
||||
|
||||
static const char* kResponderNodeName = "(Responder Node)";
|
||||
|
@ -59,6 +59,68 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
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)
|
||||
{
|
||||
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 plResponderProc;
|
||||
extern plResponderProc gResponderComponentProc;
|
||||
|
||||
// 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
|
||||
@ -494,8 +554,6 @@ void plResponderComponent::IFixOldPB()
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define CUSTOM_DRAW
|
||||
|
||||
enum
|
||||
{
|
||||
kStateName,
|
||||
@ -505,70 +563,6 @@ enum
|
||||
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)
|
||||
{
|
||||
AppendMenu(hMenu, MF_STRING, id+1, fNames[id]);
|
||||
@ -861,7 +855,6 @@ BOOL plResponderProc::DragListProc(HWND hWnd, DRAGLISTINFO *info)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
#ifdef CUSTOM_DRAW
|
||||
void plResponderProc::IDrawComboItem(DRAWITEMSTRUCT *dis)
|
||||
{
|
||||
if (dis->itemID == -1) // empty item
|
||||
@ -916,7 +909,6 @@ void plResponderProc::IDrawComboItem(DRAWITEMSTRUCT *dis)
|
||||
if (dis->itemState & ODS_FOCUS)
|
||||
DrawFocusRect(dis->hDC, &dis->rcItem);
|
||||
}
|
||||
#endif
|
||||
|
||||
void plResponderProc::LoadState()
|
||||
{
|
||||
|
@ -66,9 +66,59 @@ enum
|
||||
|
||||
#define kDefaultLinkInAnimName "LinkOut"
|
||||
|
||||
class plResponderLinkProc;
|
||||
extern plResponderLinkProc gResponderLinkProc;
|
||||
class plResponderLinkProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
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
|
||||
(
|
||||
@ -200,60 +250,6 @@ plMessage *plResponderCmdLink::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, I
|
||||
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)
|
||||
{
|
||||
int idx = ComboBox_AddString(hCombo, str);
|
||||
@ -369,6 +365,7 @@ void plResponderLinkProc::ILoadParentAgeFilenamesCombo(HWND hWnd, IParamBlock2 *
|
||||
|
||||
// Needed for message creation
|
||||
#include "plModifier/plResponderModifier.h"
|
||||
#include "plResponderGetComp.h"
|
||||
|
||||
enum
|
||||
{
|
||||
@ -377,70 +374,6 @@ enum
|
||||
kEnableResponder,
|
||||
};
|
||||
|
||||
class plResponderEnableProc;
|
||||
extern plResponderEnableProc gResponderEnableProc;
|
||||
|
||||
ParamBlockDesc2 gResponderEnableBlock
|
||||
(
|
||||
kResponderEnableMsgBlk, _T("enableCmd"), 0, NULL, P_AUTO_UI,
|
||||
|
||||
IDD_COMP_RESPOND_ENABLE, IDS_COMP_CMD_PARAMS, 0, 0, &gResponderEnableProc,
|
||||
|
||||
kEnable, _T("enable"), TYPE_BOOL, 0, 0,
|
||||
p_ui, TYPE_SINGLECHEKBOX, IDC_ENABLE_CHECK,
|
||||
p_default, TRUE,
|
||||
end,
|
||||
|
||||
kEnableNode, _T("node"), TYPE_REFTARG, 0, 0,
|
||||
end,
|
||||
|
||||
kEnableResponder, _T("responder"), TYPE_REFTARG, P_NO_REF, 0,
|
||||
end,
|
||||
|
||||
end
|
||||
);
|
||||
|
||||
plResponderCmdEnable& plResponderCmdEnable::Instance()
|
||||
{
|
||||
static plResponderCmdEnable theInstance;
|
||||
return theInstance;
|
||||
}
|
||||
|
||||
ParamBlockDesc2 *plResponderCmdEnable::GetDesc()
|
||||
{
|
||||
return &gResponderEnableBlock;
|
||||
}
|
||||
|
||||
#include "plResponderGetComp.h"
|
||||
|
||||
const char *plResponderCmdEnable::GetInstanceName(IParamBlock2 *pb)
|
||||
{
|
||||
static char name[256];
|
||||
|
||||
plComponentBase *comp = plResponderGetComp::Instance().GetSavedComp(pb, kEnableNode, kEnableResponder, true);
|
||||
sprintf(name, "Responder Enable (%s)", comp ? comp->GetINode()->GetName() : "none");
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
plMessage *plResponderCmdEnable::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb)
|
||||
{
|
||||
plComponentBase *comp = plResponderGetComp::Instance().GetSavedComp(pb, kEnableNode, kEnableResponder, true);
|
||||
if (!comp)
|
||||
throw "No responder component specified";
|
||||
|
||||
BOOL enable = pb->GetInt(kEnable);
|
||||
|
||||
plResponderEnableMsg *msg = TRACKED_NEW plResponderEnableMsg;
|
||||
msg->fEnable = (enable != false);
|
||||
|
||||
plMaxNodeBase *respondNode = (plMaxNodeBase*)pb->GetReferenceTarget(kEnableNode);
|
||||
plKey responderKey = Responder::GetKey(comp, respondNode);
|
||||
msg->AddReceiver(responderKey);
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
class plResponderEnableProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
protected:
|
||||
@ -455,7 +388,7 @@ protected:
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
switch (msg)
|
||||
{
|
||||
@ -488,10 +421,69 @@ public:
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
void DeleteThis() {}
|
||||
virtual void DeleteThis() {}
|
||||
};
|
||||
static plResponderEnableProc gResponderEnableProc;
|
||||
|
||||
ParamBlockDesc2 gResponderEnableBlock
|
||||
(
|
||||
kResponderEnableMsgBlk, _T("enableCmd"), 0, NULL, P_AUTO_UI,
|
||||
|
||||
IDD_COMP_RESPOND_ENABLE, IDS_COMP_CMD_PARAMS, 0, 0, &gResponderEnableProc,
|
||||
|
||||
kEnable, _T("enable"), TYPE_BOOL, 0, 0,
|
||||
p_ui, TYPE_SINGLECHEKBOX, IDC_ENABLE_CHECK,
|
||||
p_default, TRUE,
|
||||
end,
|
||||
|
||||
kEnableNode, _T("node"), TYPE_REFTARG, 0, 0,
|
||||
end,
|
||||
|
||||
kEnableResponder, _T("responder"), TYPE_REFTARG, P_NO_REF, 0,
|
||||
end,
|
||||
|
||||
end
|
||||
);
|
||||
|
||||
plResponderCmdEnable& plResponderCmdEnable::Instance()
|
||||
{
|
||||
static plResponderCmdEnable theInstance;
|
||||
return theInstance;
|
||||
}
|
||||
|
||||
ParamBlockDesc2 *plResponderCmdEnable::GetDesc()
|
||||
{
|
||||
return &gResponderEnableBlock;
|
||||
}
|
||||
|
||||
const char *plResponderCmdEnable::GetInstanceName(IParamBlock2 *pb)
|
||||
{
|
||||
static char name[256];
|
||||
|
||||
plComponentBase *comp = plResponderGetComp::Instance().GetSavedComp(pb, kEnableNode, kEnableResponder, true);
|
||||
sprintf(name, "Responder Enable (%s)", comp ? comp->GetINode()->GetName() : "none");
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
plMessage *plResponderCmdEnable::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb)
|
||||
{
|
||||
plComponentBase *comp = plResponderGetComp::Instance().GetSavedComp(pb, kEnableNode, kEnableResponder, true);
|
||||
if (!comp)
|
||||
throw "No responder component specified";
|
||||
|
||||
BOOL enable = pb->GetInt(kEnable);
|
||||
|
||||
plResponderEnableMsg *msg = TRACKED_NEW plResponderEnableMsg;
|
||||
msg->fEnable = (enable != false);
|
||||
|
||||
plMaxNodeBase *respondNode = (plMaxNodeBase*)pb->GetReferenceTarget(kEnableNode);
|
||||
plKey responderKey = Responder::GetKey(comp, respondNode);
|
||||
msg->AddReceiver(responderKey);
|
||||
|
||||
return msg;
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -562,87 +554,15 @@ plMessage *plResponderCmdPhysEnable::CreateMsg(plMaxNode* node, plErrorMsg *pErr
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "plMessage/plOneShotMsg.h"
|
||||
#include "plOneShotComponent.h"
|
||||
|
||||
enum
|
||||
{
|
||||
kOneShotComp,
|
||||
kOneShotNode,
|
||||
};
|
||||
|
||||
class plResponderOneShotProc;
|
||||
extern plResponderOneShotProc gResponderOneShotProc;
|
||||
|
||||
ParamBlockDesc2 gResponderOneShotBlock
|
||||
(
|
||||
kResponderOneShotMsgBlk, _T("oneShotCmd"), 0, NULL, P_AUTO_UI,
|
||||
|
||||
IDD_COMP_RESPOND_ONESHOT, IDS_COMP_CMD_PARAMS, 0, 0, &gResponderOneShotProc,
|
||||
|
||||
kOneShotComp, _T("oneShotComp"), TYPE_REFTARG, 0, 0,
|
||||
end,
|
||||
|
||||
kOneShotNode, _T("oneShotNode"), TYPE_REFTARG, 0, 0,
|
||||
end,
|
||||
|
||||
end
|
||||
);
|
||||
|
||||
plResponderCmdOneShot& plResponderCmdOneShot::Instance()
|
||||
{
|
||||
static plResponderCmdOneShot theInstance;
|
||||
return theInstance;
|
||||
}
|
||||
|
||||
ParamBlockDesc2 *plResponderCmdOneShot::GetDesc()
|
||||
{
|
||||
return &gResponderOneShotBlock;
|
||||
}
|
||||
|
||||
const char *plResponderCmdOneShot::GetInstanceName(IParamBlock2 *pb)
|
||||
{
|
||||
static char name[256];
|
||||
|
||||
plMaxNode *node = (plMaxNode*)pb->GetReferenceTarget(kOneShotComp);
|
||||
sprintf(name, "One Shot (%s)", node ? node->GetName() : "none");
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
#include "plMessage/plOneShotMsg.h"
|
||||
#include "plOneShotComponent.h"
|
||||
|
||||
plMessage *plResponderCmdOneShot::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb)
|
||||
{
|
||||
plResponderCompNode compNode;
|
||||
plResponderCompNode::ClassIDs cids;
|
||||
cids.push_back(ONESHOTCLASS_ID);
|
||||
compNode.Init(pb, kOneShotComp, kOneShotNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids);
|
||||
|
||||
plComponentBase *comp;
|
||||
plMaxNodeBase *targNode;
|
||||
if (compNode.GetCompAndNode(comp, targNode))
|
||||
{
|
||||
plKey oneShotKey = OneShotComp::GetOneShotKey(comp, targNode);
|
||||
if (!oneShotKey)
|
||||
throw "One-shot component didn't convert";
|
||||
|
||||
plOneShotMsg *msg = TRACKED_NEW plOneShotMsg;
|
||||
msg->AddReceiver(oneShotKey);
|
||||
return msg;
|
||||
}
|
||||
else
|
||||
throw "No one-shot component specified";
|
||||
}
|
||||
|
||||
#include "plMessage/plOneShotCallbacks.h"
|
||||
|
||||
void plResponderCmdOneShot::CreateWait(plMaxNode* node, plErrorMsg* pErrMsg, IParamBlock2 *pb, ResponderWaitInfo& waitInfo)
|
||||
{
|
||||
plOneShotMsg *oneShotMsg = plOneShotMsg::ConvertNoRef(waitInfo.msg);
|
||||
hsAssert(oneShotMsg, "Bad One-Shot message");
|
||||
if (oneShotMsg)
|
||||
oneShotMsg->fCallbacks->AddCallback(waitInfo.point, waitInfo.receiver, waitInfo.callbackUser);
|
||||
}
|
||||
|
||||
class plResponderOneShotProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
protected:
|
||||
@ -685,6 +605,75 @@ public:
|
||||
};
|
||||
static plResponderOneShotProc gResponderOneShotProc;
|
||||
|
||||
ParamBlockDesc2 gResponderOneShotBlock
|
||||
(
|
||||
kResponderOneShotMsgBlk, _T("oneShotCmd"), 0, NULL, P_AUTO_UI,
|
||||
|
||||
IDD_COMP_RESPOND_ONESHOT, IDS_COMP_CMD_PARAMS, 0, 0, &gResponderOneShotProc,
|
||||
|
||||
kOneShotComp, _T("oneShotComp"), TYPE_REFTARG, 0, 0,
|
||||
end,
|
||||
|
||||
kOneShotNode, _T("oneShotNode"), TYPE_REFTARG, 0, 0,
|
||||
end,
|
||||
|
||||
end
|
||||
);
|
||||
|
||||
plResponderCmdOneShot& plResponderCmdOneShot::Instance()
|
||||
{
|
||||
static plResponderCmdOneShot theInstance;
|
||||
return theInstance;
|
||||
}
|
||||
|
||||
ParamBlockDesc2 *plResponderCmdOneShot::GetDesc()
|
||||
{
|
||||
return &gResponderOneShotBlock;
|
||||
}
|
||||
|
||||
const char *plResponderCmdOneShot::GetInstanceName(IParamBlock2 *pb)
|
||||
{
|
||||
static char name[256];
|
||||
|
||||
plMaxNode *node = (plMaxNode*)pb->GetReferenceTarget(kOneShotComp);
|
||||
sprintf(name, "One Shot (%s)", node ? node->GetName() : "none");
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
plMessage *plResponderCmdOneShot::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb)
|
||||
{
|
||||
plResponderCompNode compNode;
|
||||
plResponderCompNode::ClassIDs cids;
|
||||
cids.push_back(ONESHOTCLASS_ID);
|
||||
compNode.Init(pb, kOneShotComp, kOneShotNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids);
|
||||
|
||||
plComponentBase *comp;
|
||||
plMaxNodeBase *targNode;
|
||||
if (compNode.GetCompAndNode(comp, targNode))
|
||||
{
|
||||
plKey oneShotKey = OneShotComp::GetOneShotKey(comp, targNode);
|
||||
if (!oneShotKey)
|
||||
throw "One-shot component didn't convert";
|
||||
|
||||
plOneShotMsg *msg = TRACKED_NEW plOneShotMsg;
|
||||
msg->AddReceiver(oneShotKey);
|
||||
return msg;
|
||||
}
|
||||
else
|
||||
throw "No one-shot component specified";
|
||||
}
|
||||
|
||||
#include "plMessage/plOneShotCallbacks.h"
|
||||
|
||||
void plResponderCmdOneShot::CreateWait(plMaxNode* node, plErrorMsg* pErrMsg, IParamBlock2 *pb, ResponderWaitInfo& waitInfo)
|
||||
{
|
||||
plOneShotMsg *oneShotMsg = plOneShotMsg::ConvertNoRef(waitInfo.msg);
|
||||
hsAssert(oneShotMsg, "Bad One-Shot message");
|
||||
if (oneShotMsg)
|
||||
oneShotMsg->fCallbacks->AddCallback(waitInfo.point, waitInfo.receiver, waitInfo.callbackUser);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@ -721,12 +710,47 @@ plMessage *plResponderCmdNotify::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg,
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "plCameraComponents.h"
|
||||
|
||||
class plResponderActivatorEnableProc;
|
||||
extern plResponderActivatorEnableProc gResponderActivatorEnableProc;
|
||||
#include "plPickNode.h"
|
||||
|
||||
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
|
||||
(
|
||||
kResponderActivatorEnableBlk, _T("detectorEnable"), 0, NULL, P_AUTO_UI,
|
||||
@ -835,19 +859,18 @@ plMessage *plResponderCmdDetectorEnable::CreateMsg(plMaxNode* node, plErrorMsg *
|
||||
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:
|
||||
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)");
|
||||
}
|
||||
plResponderCompNode fCompNode;
|
||||
|
||||
public:
|
||||
BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
@ -855,14 +878,25 @@ public:
|
||||
switch (msg)
|
||||
{
|
||||
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;
|
||||
|
||||
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))
|
||||
IUpdateButton(pm->GetParamBlock(), hWnd);
|
||||
fCompNode.CompButtonPress(hWnd);
|
||||
return TRUE;
|
||||
}
|
||||
else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_NODE)
|
||||
{
|
||||
fCompNode.NodeButtonPress(hWnd);
|
||||
return TRUE;
|
||||
}
|
||||
break;
|
||||
@ -872,15 +906,7 @@ public:
|
||||
}
|
||||
void DeleteThis() {}
|
||||
};
|
||||
static plResponderActivatorEnableProc gResponderActivatorEnableProc;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class plResponderXRegionProc;
|
||||
extern plResponderXRegionProc gResponderXRegionProc;
|
||||
|
||||
enum { kXRegionComp, kXRegionType, kXRegionNode };
|
||||
static plResponderXRegionProc gResponderXRegionProc;
|
||||
|
||||
ParamBlockDesc2 gResponderXRegionBlock
|
||||
(
|
||||
@ -963,9 +989,6 @@ const char *plResponderCmdXRegion::GetInstanceName(IParamBlock2 *pb)
|
||||
return name;
|
||||
}
|
||||
|
||||
#include "plMessage/plExcludeRegionMsg.h"
|
||||
#include "plExcludeRegionComponent.h"
|
||||
|
||||
plMessage *plResponderCmdXRegion::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb)
|
||||
{
|
||||
plResponderCompNode compNode;
|
||||
@ -1000,53 +1023,9 @@ plMessage *plResponderCmdXRegion::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg
|
||||
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
|
||||
{ kCameraObj,
|
||||
kPopCamera,
|
||||
@ -1149,9 +1128,6 @@ plMessage *plResponderCmdCamTransition::CreateMsg(plMaxNode* node, plErrorMsg *p
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class plResponderCameraForceProc;
|
||||
extern plResponderCameraForceProc gResponderCameraForceProc;
|
||||
|
||||
enum
|
||||
{
|
||||
kCamForce,
|
||||
@ -1420,9 +1396,46 @@ plMessage *plResponderCmdVisibility::CreateMsg(plMaxNode* node, plErrorMsg *pErr
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
enum { kSubWorldNode, kSubWorldType };
|
||||
enum
|
||||
{
|
||||
kRespondSubWorldEnter,
|
||||
kRespondSubWorldExit,
|
||||
};
|
||||
|
||||
class plResponderSubWorldProc;
|
||||
extern plResponderSubWorldProc gResponderSubWorldProc;
|
||||
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() {}
|
||||
};
|
||||
|
||||
static plResponderSubWorldProc gResponderSubWorldProc;
|
||||
|
||||
ParamBlockDesc2 gResponderSubWorldBlock
|
||||
(
|
||||
@ -1440,12 +1453,6 @@ ParamBlockDesc2 gResponderSubWorldBlock
|
||||
end
|
||||
);
|
||||
|
||||
enum
|
||||
{
|
||||
kRespondSubWorldEnter,
|
||||
kRespondSubWorldExit,
|
||||
};
|
||||
|
||||
plResponderCmdSubWorld& plResponderCmdSubWorld::Instance()
|
||||
{
|
||||
static plResponderCmdSubWorld theInstance;
|
||||
@ -1532,55 +1539,46 @@ plMessage *plResponderCmdSubWorld::CreateMsg(plMaxNode* node, plErrorMsg *pErrMs
|
||||
|
||||
return swMsg;
|
||||
}
|
||||
|
||||
class plResponderSubWorldProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
public:
|
||||
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;
|
||||
}
|
||||
void DeleteThis() {}
|
||||
};
|
||||
|
||||
static plResponderSubWorldProc gResponderSubWorldProc;
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "pfMessage/plArmatureEffectMsg.h"
|
||||
#include "plAvatar/plArmatureEffects.h"
|
||||
|
||||
class plResponderFootSurfaceProc;
|
||||
extern plResponderFootSurfaceProc gResponderFootSurfaceProc;
|
||||
|
||||
enum
|
||||
{
|
||||
kSurface,
|
||||
};
|
||||
|
||||
class plResponderFootSurfaceProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
public:
|
||||
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)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
for (i = 0; i < plArmatureEffectsMgr::kMaxSurface; i++)
|
||||
ComboBox_AddString(hCB, plArmatureEffectsMgr::SurfaceStrings[i]);
|
||||
|
||||
ComboBox_SetCurSel(hCB, pb->GetInt(ParamID(kSurface)));
|
||||
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_RESPOND_FOOT_SURFACE)
|
||||
pb->SetValue(ParamID(kSurface), 0, ComboBox_GetCurSel(hCB));
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
void DeleteThis() {}
|
||||
};
|
||||
static plResponderFootSurfaceProc gResponderFootSurfaceProc;
|
||||
|
||||
ParamBlockDesc2 gResponderFootSurfaceBlock
|
||||
(
|
||||
kResponderFootSurfaceBlk, _T("FootSurface"), 0, NULL, P_AUTO_UI,
|
||||
@ -1623,45 +1621,53 @@ plMessage *plResponderCmdFootSurface::CreateMsg(plMaxNode* node, plErrorMsg *pEr
|
||||
return msg;
|
||||
}
|
||||
|
||||
class plResponderFootSurfaceProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
public:
|
||||
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)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
for (i = 0; i < plArmatureEffectsMgr::kMaxSurface; i++)
|
||||
ComboBox_AddString(hCB, plArmatureEffectsMgr::SurfaceStrings[i]);
|
||||
|
||||
ComboBox_SetCurSel(hCB, pb->GetInt(ParamID(kSurface)));
|
||||
|
||||
return TRUE;
|
||||
|
||||
case WM_COMMAND:
|
||||
if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_RESPOND_FOOT_SURFACE)
|
||||
pb->SetValue(ParamID(kSurface), 0, ComboBox_GetCurSel(hCB));
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
void DeleteThis() {}
|
||||
};
|
||||
static plResponderFootSurfaceProc gResponderFootSurfaceProc;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "plMultistageBehComponent.h"
|
||||
|
||||
class plResponderMultistageProc;
|
||||
extern plResponderMultistageProc gResponderMultistageProc;
|
||||
|
||||
enum { kMultistageComp, kMultistageNode };
|
||||
|
||||
class plResponderMultistageProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
protected:
|
||||
plResponderCompNode fCompNode;
|
||||
|
||||
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();
|
||||
|
||||
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;
|
||||
}
|
||||
virtual void DeleteThis() {}
|
||||
};
|
||||
static plResponderMultistageProc gResponderMultistageProc;
|
||||
|
||||
ParamBlockDesc2 gResponderMultistageBlock
|
||||
(
|
||||
kResponderMultistageBlk, _T("multistage"), 0, NULL, P_AUTO_UI,
|
||||
@ -1722,44 +1728,3 @@ plMessage *plResponderCmdMultistage::CreateMsg(plMaxNode* node, plErrorMsg *pErr
|
||||
else
|
||||
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;
|
||||
|
@ -72,8 +72,23 @@ enum MtlNodeType
|
||||
kNodeResponder // Use the node the responder is attached to
|
||||
};
|
||||
|
||||
class plResponderMtlProc;
|
||||
extern plResponderMtlProc gResponderMtlProc;
|
||||
#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;
|
||||
|
||||
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()
|
||||
{
|
||||
fMtlButtonID = IDC_MTL_BUTTON;
|
||||
|
@ -32,8 +32,29 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include "plResponderLink.h"
|
||||
|
||||
class plResponderWaitProc;
|
||||
extern plResponderWaitProc gResponderWaitProc;
|
||||
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; }
|
||||
|
||||
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
|
||||
{
|
||||
@ -111,30 +132,7 @@ const char* ResponderWait::GetWaitPoint(IParamBlock2* waitPB)
|
||||
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)
|
||||
{
|
||||
|
@ -99,6 +99,7 @@ class PickAnchorNode : public PickObjectProc
|
||||
|
||||
class DELBitmapDlgProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
public:
|
||||
PickAnchorNode fPickAnchorCallback;
|
||||
|
||||
/// Called to update the controls of the dialog
|
||||
@ -149,7 +150,7 @@ class DELBitmapDlgProc : public ParamMap2UserDlgProc
|
||||
}
|
||||
|
||||
/// 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)
|
||||
{
|
||||
@ -183,7 +184,7 @@ class DELBitmapDlgProc : public ParamMap2UserDlgProc
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void DeleteThis() {};
|
||||
virtual void DeleteThis() {};
|
||||
};
|
||||
|
||||
static DELBitmapDlgProc gDELBitmapDlgProc;
|
||||
|
@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
class DTLBitmapDlgProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
public:
|
||||
/// Called to update the controls of the dialog
|
||||
virtual void Update( TimeValue t, Interval &valid, IParamMap2 *map )
|
||||
{
|
||||
@ -69,7 +70,7 @@ class DTLBitmapDlgProc : public ParamMap2UserDlgProc
|
||||
}
|
||||
|
||||
/// 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)
|
||||
@ -136,7 +137,7 @@ class DTLBitmapDlgProc : public ParamMap2UserDlgProc
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
void DeleteThis() {};
|
||||
virtual void DeleteThis() {};
|
||||
|
||||
protected:
|
||||
/// Clamp texture sizes to a power of 2
|
||||
|
@ -173,7 +173,7 @@ BOOL plLayerTex::SetDlgThing(ParamDlg* dlg)
|
||||
|
||||
int plLayerTex::NumRefs()
|
||||
{
|
||||
return 3;
|
||||
return 2;
|
||||
}
|
||||
|
||||
//From ReferenceMaker
|
||||
@ -211,7 +211,7 @@ void plLayerTex::SetReference(int i, RefTargetHandle rtarg)
|
||||
|
||||
int plLayerTex::NumParamBlocks()
|
||||
{
|
||||
return 2;
|
||||
return 1;
|
||||
}
|
||||
|
||||
IParamBlock2* plLayerTex::GetParamBlock(int i)
|
||||
@ -248,7 +248,7 @@ RefTargetHandle plLayerTex::Clone(RemapDir &remap)
|
||||
|
||||
int plLayerTex::NumSubs()
|
||||
{
|
||||
return 3;
|
||||
return 2;
|
||||
}
|
||||
|
||||
Animatable* plLayerTex::SubAnim(int i)
|
||||
|
@ -64,7 +64,7 @@ static const char *kUsageTypes[] =
|
||||
class BasicDlgProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
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();
|
||||
|
||||
@ -101,6 +101,6 @@ public:
|
||||
|
||||
return false;
|
||||
}
|
||||
void DeleteThis() {};
|
||||
virtual void DeleteThis() {};
|
||||
};
|
||||
static BasicDlgProc gBasicDlgProc;
|
||||
|
@ -32,8 +32,365 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
class BMTexPBAccessor;
|
||||
extern BMTexPBAccessor bmtex_accessor;
|
||||
|
||||
class BitmapDlgProc;
|
||||
extern BitmapDlgProc gBitmapDlgProc;
|
||||
class BMCropper : public CropCallback
|
||||
{
|
||||
IParamBlock2 *fPBlock;
|
||||
|
||||
public:
|
||||
BMCropper(IParamBlock2* pblock) : fPBlock(pblock) {}
|
||||
|
||||
float GetInitU() { return fPBlock->GetFloat(kBmpClipU); }
|
||||
float GetInitV() { return fPBlock->GetFloat(kBmpClipV); }
|
||||
float GetInitW() { return fPBlock->GetFloat(kBmpClipW); }
|
||||
float GetInitH() { return fPBlock->GetFloat(kBmpClipH); }
|
||||
BOOL GetInitMode() { return fPBlock->GetInt(kBmpCropPlace); }
|
||||
void SetValues(float u, float v, float w, float h, BOOL md);
|
||||
void OnClose();
|
||||
};
|
||||
|
||||
class BitmapDlgProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
friend class BMTexPBAccessor;
|
||||
|
||||
|
||||
PBBitmap *fLastBMap;
|
||||
bool fSettingDetailValues;
|
||||
|
||||
public:
|
||||
/// Called to update the controls of the dialog
|
||||
/// Note: we're bad that we use a static here, but
|
||||
virtual void Update( TimeValue t, Interval &valid, IParamMap2 *map )
|
||||
{
|
||||
ICustButton *bmSelectBtn;
|
||||
IParamBlock2 *pblock;
|
||||
int width, height;
|
||||
|
||||
|
||||
ParamMap2UserDlgProc::Update( t, valid, map );
|
||||
|
||||
if( fSettingDetailValues )
|
||||
{
|
||||
// We're getting an update just because we changed detail values, so we
|
||||
// know we don't have to do anything ourselves
|
||||
return;
|
||||
}
|
||||
|
||||
pblock = map->GetParamBlock();
|
||||
|
||||
// Update texture map button
|
||||
bmSelectBtn = GetICustButton( GetDlgItem( map->GetHWnd(), IDC_LAYER_NAME ) );
|
||||
PBBitmap *pbbm = pblock->GetBitmap( kBmpBitmap, t );
|
||||
if( pbbm )
|
||||
{
|
||||
if( pbbm != fLastBMap )
|
||||
{
|
||||
bmSelectBtn->SetText( (TCHAR *)pbbm->bi.Filename() );
|
||||
|
||||
// Init values for clamping spinners to powers of 2
|
||||
width = IFloorPow2( pbbm->bi.Width() );
|
||||
map->SetRange( kBmpExportWidth, 4.f, (float)width );
|
||||
|
||||
height = IFloorPow2( pbbm->bi.Height() );
|
||||
map->SetRange( kBmpExportHeight, 4.f, (float)height );
|
||||
|
||||
IClampTexSizeSpinner( t, map, true );
|
||||
ISetDetailCurveNumLevels( map, t );
|
||||
}
|
||||
}
|
||||
else if( pbbm != fLastBMap )
|
||||
bmSelectBtn->SetText( _T( "None" ) );
|
||||
|
||||
fLastBMap = pbbm;
|
||||
|
||||
ReleaseICustButton( bmSelectBtn );
|
||||
|
||||
// Update detail curve control
|
||||
HWND dlg = map->GetHWnd();
|
||||
|
||||
plDetailCurveCtrl *ctrl = GET_DETAIL_CURVE_CTRL( dlg, IDC_DETAIL_CURVE_CTRL );
|
||||
if( ctrl == NULL )
|
||||
{
|
||||
// The control hasn't been created, so create it already!
|
||||
HWND basis;
|
||||
RECT r;
|
||||
|
||||
// Create the detail map control
|
||||
basis = GetDlgItem( dlg, IDC_DETAIL_SAMPLE );
|
||||
GetClientRect( basis, &r );
|
||||
MapWindowPoints( basis, dlg, (POINT *)&r, 2 );
|
||||
|
||||
ctrl = TRACKED_NEW plDetailCurveCtrl( dlg, IDC_DETAIL_CURVE_CTRL, &r );
|
||||
}
|
||||
|
||||
EnableWindow( GetDlgItem( dlg, IDC_DETAIL_CURVE_CTRL ), (BOOL)pblock->GetInt( kBmpUseDetail, t ) );
|
||||
|
||||
if( ctrl != NULL )
|
||||
{
|
||||
ctrl->SetStartPoint( (float)pblock->GetInt( kBmpDetailStartSize, t ) / 100.f,
|
||||
(float)pblock->GetInt( kBmpDetailStartOpac, t ) / 100.f );
|
||||
ctrl->SetEndPoint( (float)pblock->GetInt( kBmpDetailStopSize, t ) / 100.f,
|
||||
(float)pblock->GetInt( kBmpDetailStopOpac, t ) / 100.f );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static ICustButton* bmSelectBtn;
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
fLastBMap = NULL;
|
||||
fSettingDetailValues = false;
|
||||
break;
|
||||
|
||||
/// Note: the following *could* be done in the accessor, except that you end up in an
|
||||
/// infinite loop updating the values. Not good.
|
||||
case CC_SPINNER_CHANGE:
|
||||
|
||||
if( LOWORD( wParam ) == IDC_EXPORTWIDTH_SPINNER )
|
||||
IClampTexSizeSpinner( t, map, true );
|
||||
|
||||
else if( LOWORD( wParam ) == IDC_EXPORTHEIGHT_SPINNER )
|
||||
IClampTexSizeSpinner( t, map, false );
|
||||
|
||||
break;
|
||||
|
||||
// Message from the detail curve that a point got dragged
|
||||
case PL_DC_POINT_DRAGGED:
|
||||
{
|
||||
plDetailCurveCtrl *ctrl = (plDetailCurveCtrl *)lParam;
|
||||
IParamBlock2 *pblock = map->GetParamBlock();
|
||||
float x, y;
|
||||
|
||||
|
||||
fSettingDetailValues = true;
|
||||
|
||||
if( wParam == PL_DC_START_POINT )
|
||||
{
|
||||
ctrl->GetStartPoint( x, y );
|
||||
pblock->SetValue( kBmpDetailStartSize, t, (int)( x * 100.f ) );
|
||||
pblock->SetValue( kBmpDetailStartOpac, t, (int)( y * 100.f ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
ctrl->GetEndPoint( x, y );
|
||||
pblock->SetValue( kBmpDetailStopSize, t, (int)( x * 100.f ) );
|
||||
pblock->SetValue( kBmpDetailStopOpac, t, (int)( y * 100.f ) );
|
||||
}
|
||||
|
||||
map->UpdateUI( t );
|
||||
fSettingDetailValues = false;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case WM_COMMAND:
|
||||
if( HIWORD( wParam ) == EN_CHANGE && LOWORD( wParam ) == IDC_EXPORTWIDTH )
|
||||
IClampTexSizeSpinner( t, map, true );
|
||||
|
||||
else if( HIWORD( wParam ) == EN_CHANGE && LOWORD( wParam ) == IDC_EXPORTHEIGHT )
|
||||
IClampTexSizeSpinner( t, map, false );
|
||||
|
||||
else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_BM_CROP_IMAGE)
|
||||
{
|
||||
IParamBlock2 *pblock = map->GetParamBlock();
|
||||
PBBitmap *pbbm = pblock->GetBitmap(kBmpBitmap, t);
|
||||
if (pbbm)
|
||||
{
|
||||
if (!pbbm->bm)
|
||||
pbbm->bm = TheManager->Load(&pbbm->bi);
|
||||
|
||||
BMCropper *cropper = TRACKED_NEW BMCropper(pblock);
|
||||
|
||||
pbbm->bm->Display("Specify Cropping/Placement", BMM_CN, FALSE, TRUE, cropper);
|
||||
}
|
||||
// bm->DeleteThis();
|
||||
return TRUE;
|
||||
}
|
||||
else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_LAYER_RELOAD)
|
||||
{
|
||||
// TEMP
|
||||
IParamBlock2 *pblock = map->GetParamBlock();
|
||||
PBBitmap *pbbm = pblock->GetBitmap(kBmpBitmap, t);
|
||||
if (pbbm)
|
||||
{
|
||||
plLayerTex *layer = (plLayerTex*)map->GetParamBlock()->GetOwner();
|
||||
|
||||
layer->RefreshBitmaps();
|
||||
|
||||
layer->fMtlParams->MtlChanged();
|
||||
layer->IChanged();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
else if (LOWORD(wParam) == IDC_LAYER_NAME)
|
||||
{
|
||||
plPlasmaMAXLayer *layer = (plPlasmaMAXLayer *)map->GetParamBlock()->GetOwner();
|
||||
if (layer == nil)
|
||||
return FALSE;
|
||||
BOOL selectedNewBitmap = layer->HandleBitmapSelection();
|
||||
|
||||
if(selectedNewBitmap)
|
||||
{
|
||||
IParamBlock2 *pblock = map->GetParamBlock();
|
||||
//plLayerTex *layer = (plLayerTex*)map->GetParamBlock()->GetOwner();
|
||||
|
||||
//layer->SetBitmap(&bi);
|
||||
//layer->IChanged();
|
||||
//BitmapInfo *bi = &layer->GetPBBitmap()->bi;
|
||||
|
||||
bmSelectBtn = GetICustButton(GetDlgItem(hWnd,IDC_LAYER_NAME));
|
||||
PBBitmap *pbbm = layer->GetPBBitmap();
|
||||
bmSelectBtn->SetText(pbbm != nil ? (TCHAR*)pbbm->bi.Filename() : "");
|
||||
ReleaseICustButton(bmSelectBtn);
|
||||
|
||||
if (pbbm != nil)
|
||||
{
|
||||
// Init values for clamping spinners to powers of 2
|
||||
int width = IFloorPow2( pbbm->bi.Width() );
|
||||
map->SetRange( kBmpExportWidth, 4.f, (float)width );
|
||||
|
||||
int height = IFloorPow2( pbbm->bi.Height() );
|
||||
map->SetRange( kBmpExportHeight, 4.f, (float)height );
|
||||
|
||||
if( width > 512 )
|
||||
{
|
||||
height = (int)( 512.f * (float)( (float)height / (float)width ) );
|
||||
width = 512;
|
||||
}
|
||||
else if( height > 512 )
|
||||
{
|
||||
width = (int)( 512.f * (float)( (float)width / (float)height ) );
|
||||
height = 512;
|
||||
}
|
||||
pblock->SetValue( kBmpExportWidth, t, width );
|
||||
pblock->SetValue( kBmpExportLastWidth, t, width );
|
||||
pblock->SetValue( kBmpExportHeight, t, height );
|
||||
pblock->SetValue( kBmpExportLastHeight, t, height );
|
||||
|
||||
IClampTexSizeSpinner( t, map, true );
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
virtual void DeleteThis() {};
|
||||
|
||||
void ISetDetailCurveNumLevels( IParamMap2 *map, TimeValue t )
|
||||
{
|
||||
/// Set the level count on the detail control
|
||||
plDetailCurveCtrl *ctrl = GET_DETAIL_CURVE_CTRL( map->GetHWnd(), IDC_DETAIL_CURVE_CTRL );
|
||||
if( ctrl != NULL )
|
||||
{
|
||||
IParamBlock2 *pblock = map->GetParamBlock();
|
||||
int w = pblock->GetInt( kBmpExportWidth, t );
|
||||
int h = pblock->GetInt( kBmpExportHeight, t );
|
||||
int numLevels = 0;
|
||||
while( w > 1 && h > 1 )
|
||||
{
|
||||
w >>= 1;
|
||||
h >>= 1;
|
||||
numLevels++;
|
||||
}
|
||||
ctrl->SetNumLevels( numLevels );
|
||||
}
|
||||
}
|
||||
|
||||
/// Clamp texture sizes to a power of 2
|
||||
void IClampTexSizeSpinner( TimeValue t, IParamMap2 *map, bool clampWidth )
|
||||
{
|
||||
IParamBlock2 *pblock = map->GetParamBlock();
|
||||
ParamID clampNew, clampOld;
|
||||
ParamID otherNew, otherOld;
|
||||
|
||||
if( clampWidth )
|
||||
{
|
||||
clampNew = kBmpExportWidth; clampOld = kBmpExportLastWidth;
|
||||
otherNew = kBmpExportHeight; otherOld = kBmpExportLastHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
clampNew = kBmpExportHeight; clampOld = kBmpExportLastHeight;
|
||||
otherNew = kBmpExportWidth; otherOld = kBmpExportLastWidth;
|
||||
}
|
||||
|
||||
int lastVal = pblock->GetInt( clampOld, t );
|
||||
int tempVal, newVal = pblock->GetInt( clampNew, t );
|
||||
|
||||
if( newVal < lastVal )
|
||||
{
|
||||
lastVal = newVal;
|
||||
for( tempVal = 1; tempVal <= newVal; tempVal <<= 1 );
|
||||
newVal = tempVal >> 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastVal = newVal;
|
||||
for( tempVal = 1; tempVal < newVal; tempVal <<= 1 );
|
||||
newVal = tempVal;
|
||||
}
|
||||
|
||||
pblock->SetValue( clampNew, t, newVal );
|
||||
pblock->SetValue( clampOld, t, newVal );
|
||||
|
||||
// And clamp aspect ratio
|
||||
PBBitmap *pbbm = pblock->GetBitmap( kBmpBitmap, t );
|
||||
|
||||
if( pbbm != NULL )
|
||||
{
|
||||
int realWidth = pbbm->bi.Width();
|
||||
int realHeight = pbbm->bi.Height();
|
||||
|
||||
float aspect;
|
||||
if( clampWidth )
|
||||
aspect = (float)realHeight / (float)realWidth;
|
||||
else
|
||||
aspect = (float)realWidth / (float)realHeight;
|
||||
|
||||
int value = newVal;
|
||||
value *= aspect;
|
||||
|
||||
if( value < 4 )
|
||||
{
|
||||
// Can't be below 4!
|
||||
value = 4;
|
||||
pblock->SetValue( otherNew, t, value );
|
||||
pblock->SetValue( otherOld, t, value );
|
||||
value = value / aspect;
|
||||
pblock->SetValue( clampNew, t, value );
|
||||
pblock->SetValue( clampOld, t, value );
|
||||
}
|
||||
else
|
||||
{
|
||||
pblock->SetValue( otherNew, t, value );
|
||||
pblock->SetValue( otherOld, t, value );
|
||||
}
|
||||
}
|
||||
|
||||
ISetDetailCurveNumLevels( map, t );
|
||||
}
|
||||
|
||||
int IFloorPow2( int value )
|
||||
{
|
||||
int v;
|
||||
|
||||
|
||||
for( v = 1; v <= value; v <<= 1 );
|
||||
return v >> 1;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static BitmapDlgProc gBitmapDlgProc;
|
||||
|
||||
static ParamBlockDesc2 gBitmapParamBlk
|
||||
(
|
||||
@ -193,8 +550,6 @@ static ParamBlockDesc2 gBitmapParamBlk
|
||||
);
|
||||
ParamBlockDesc2 *GetBitmapBlk() { return &gBitmapParamBlk; }
|
||||
|
||||
class BMCropper;
|
||||
|
||||
class BMTexPBAccessor : public PBAccessor
|
||||
{
|
||||
public:
|
||||
@ -331,27 +686,13 @@ public:
|
||||
bool IIsProcSettingDetailValues( IParamBlock2 *pb );
|
||||
|
||||
};
|
||||
|
||||
static BMTexPBAccessor bmtex_accessor;
|
||||
|
||||
|
||||
//=========================================================================================
|
||||
// BMCropper
|
||||
//=========================================================================================
|
||||
class BMCropper : public CropCallback
|
||||
{
|
||||
IParamBlock2 *fPBlock;
|
||||
|
||||
public:
|
||||
BMCropper(IParamBlock2* pblock) : fPBlock(pblock) {}
|
||||
|
||||
float GetInitU() { return fPBlock->GetFloat(kBmpClipU); }
|
||||
float GetInitV() { return fPBlock->GetFloat(kBmpClipV); }
|
||||
float GetInitW() { return fPBlock->GetFloat(kBmpClipW); }
|
||||
float GetInitH() { return fPBlock->GetFloat(kBmpClipH); }
|
||||
BOOL GetInitMode() { return fPBlock->GetInt(kBmpCropPlace); }
|
||||
void SetValues(float u, float v, float w, float h, BOOL md);
|
||||
void OnClose();
|
||||
};
|
||||
|
||||
void BMCropper::SetValues(float u, float v, float w, float h, BOOL md)
|
||||
{
|
||||
@ -393,350 +734,6 @@ void BMCropper::OnClose()
|
||||
delete this;
|
||||
}
|
||||
|
||||
class BitmapDlgProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
friend class BMTexPBAccessor;
|
||||
|
||||
|
||||
PBBitmap *fLastBMap;
|
||||
bool fSettingDetailValues;
|
||||
|
||||
|
||||
/// Called to update the controls of the dialog
|
||||
/// Note: we're bad that we use a static here, but
|
||||
virtual void Update( TimeValue t, Interval &valid, IParamMap2 *map )
|
||||
{
|
||||
ICustButton *bmSelectBtn;
|
||||
IParamBlock2 *pblock;
|
||||
int width, height;
|
||||
|
||||
|
||||
ParamMap2UserDlgProc::Update( t, valid, map );
|
||||
|
||||
if( fSettingDetailValues )
|
||||
{
|
||||
// We're getting an update just because we changed detail values, so we
|
||||
// know we don't have to do anything ourselves
|
||||
return;
|
||||
}
|
||||
|
||||
pblock = map->GetParamBlock();
|
||||
|
||||
// Update texture map button
|
||||
bmSelectBtn = GetICustButton( GetDlgItem( map->GetHWnd(), IDC_LAYER_NAME ) );
|
||||
PBBitmap *pbbm = pblock->GetBitmap( kBmpBitmap, t );
|
||||
if( pbbm )
|
||||
{
|
||||
if( pbbm != fLastBMap )
|
||||
{
|
||||
bmSelectBtn->SetText( (TCHAR *)pbbm->bi.Filename() );
|
||||
|
||||
// Init values for clamping spinners to powers of 2
|
||||
width = IFloorPow2( pbbm->bi.Width() );
|
||||
map->SetRange( kBmpExportWidth, 4.f, (float)width );
|
||||
|
||||
height = IFloorPow2( pbbm->bi.Height() );
|
||||
map->SetRange( kBmpExportHeight, 4.f, (float)height );
|
||||
|
||||
IClampTexSizeSpinner( t, map, true );
|
||||
ISetDetailCurveNumLevels( map, t );
|
||||
}
|
||||
}
|
||||
else if( pbbm != fLastBMap )
|
||||
bmSelectBtn->SetText( _T( "None" ) );
|
||||
|
||||
fLastBMap = pbbm;
|
||||
|
||||
ReleaseICustButton( bmSelectBtn );
|
||||
|
||||
// Update detail curve control
|
||||
HWND dlg = map->GetHWnd();
|
||||
|
||||
plDetailCurveCtrl *ctrl = GET_DETAIL_CURVE_CTRL( dlg, IDC_DETAIL_CURVE_CTRL );
|
||||
if( ctrl == NULL )
|
||||
{
|
||||
// The control hasn't been created, so create it already!
|
||||
HWND basis;
|
||||
RECT r;
|
||||
|
||||
// Create the detail map control
|
||||
basis = GetDlgItem( dlg, IDC_DETAIL_SAMPLE );
|
||||
GetClientRect( basis, &r );
|
||||
MapWindowPoints( basis, dlg, (POINT *)&r, 2 );
|
||||
|
||||
ctrl = TRACKED_NEW plDetailCurveCtrl( dlg, IDC_DETAIL_CURVE_CTRL, &r );
|
||||
}
|
||||
|
||||
EnableWindow( GetDlgItem( dlg, IDC_DETAIL_CURVE_CTRL ), (BOOL)pblock->GetInt( kBmpUseDetail, t ) );
|
||||
|
||||
if( ctrl != NULL )
|
||||
{
|
||||
ctrl->SetStartPoint( (float)pblock->GetInt( kBmpDetailStartSize, t ) / 100.f,
|
||||
(float)pblock->GetInt( kBmpDetailStartOpac, t ) / 100.f );
|
||||
ctrl->SetEndPoint( (float)pblock->GetInt( kBmpDetailStopSize, t ) / 100.f,
|
||||
(float)pblock->GetInt( kBmpDetailStopOpac, t ) / 100.f );
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
static ICustButton* bmSelectBtn;
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
case WM_INITDIALOG:
|
||||
fLastBMap = NULL;
|
||||
fSettingDetailValues = false;
|
||||
break;
|
||||
|
||||
/// Note: the following *could* be done in the accessor, except that you end up in an
|
||||
/// infinite loop updating the values. Not good.
|
||||
case CC_SPINNER_CHANGE:
|
||||
|
||||
if( LOWORD( wParam ) == IDC_EXPORTWIDTH_SPINNER )
|
||||
IClampTexSizeSpinner( t, map, true );
|
||||
|
||||
else if( LOWORD( wParam ) == IDC_EXPORTHEIGHT_SPINNER )
|
||||
IClampTexSizeSpinner( t, map, false );
|
||||
|
||||
break;
|
||||
|
||||
// Message from the detail curve that a point got dragged
|
||||
case PL_DC_POINT_DRAGGED:
|
||||
{
|
||||
plDetailCurveCtrl *ctrl = (plDetailCurveCtrl *)lParam;
|
||||
IParamBlock2 *pblock = map->GetParamBlock();
|
||||
float x, y;
|
||||
|
||||
|
||||
fSettingDetailValues = true;
|
||||
|
||||
if( wParam == PL_DC_START_POINT )
|
||||
{
|
||||
ctrl->GetStartPoint( x, y );
|
||||
pblock->SetValue( kBmpDetailStartSize, t, (int)( x * 100.f ) );
|
||||
pblock->SetValue( kBmpDetailStartOpac, t, (int)( y * 100.f ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
ctrl->GetEndPoint( x, y );
|
||||
pblock->SetValue( kBmpDetailStopSize, t, (int)( x * 100.f ) );
|
||||
pblock->SetValue( kBmpDetailStopOpac, t, (int)( y * 100.f ) );
|
||||
}
|
||||
|
||||
map->UpdateUI( t );
|
||||
fSettingDetailValues = false;
|
||||
}
|
||||
return 0;
|
||||
|
||||
case WM_COMMAND:
|
||||
if( HIWORD( wParam ) == EN_CHANGE && LOWORD( wParam ) == IDC_EXPORTWIDTH )
|
||||
IClampTexSizeSpinner( t, map, true );
|
||||
|
||||
else if( HIWORD( wParam ) == EN_CHANGE && LOWORD( wParam ) == IDC_EXPORTHEIGHT )
|
||||
IClampTexSizeSpinner( t, map, false );
|
||||
|
||||
else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_BM_CROP_IMAGE)
|
||||
{
|
||||
IParamBlock2 *pblock = map->GetParamBlock();
|
||||
PBBitmap *pbbm = pblock->GetBitmap(kBmpBitmap, t);
|
||||
if (pbbm)
|
||||
{
|
||||
if (!pbbm->bm)
|
||||
pbbm->bm = TheManager->Load(&pbbm->bi);
|
||||
|
||||
BMCropper *cropper = TRACKED_NEW BMCropper(pblock);
|
||||
|
||||
pbbm->bm->Display("Specify Cropping/Placement", BMM_CN, FALSE, TRUE, cropper);
|
||||
}
|
||||
// bm->DeleteThis();
|
||||
return TRUE;
|
||||
}
|
||||
else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_LAYER_RELOAD)
|
||||
{
|
||||
// TEMP
|
||||
IParamBlock2 *pblock = map->GetParamBlock();
|
||||
PBBitmap *pbbm = pblock->GetBitmap(kBmpBitmap, t);
|
||||
if (pbbm)
|
||||
{
|
||||
plLayerTex *layer = (plLayerTex*)map->GetParamBlock()->GetOwner();
|
||||
|
||||
layer->RefreshBitmaps();
|
||||
|
||||
layer->fMtlParams->MtlChanged();
|
||||
layer->IChanged();
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
else if (LOWORD(wParam) == IDC_LAYER_NAME)
|
||||
{
|
||||
plPlasmaMAXLayer *layer = (plPlasmaMAXLayer *)map->GetParamBlock()->GetOwner();
|
||||
if (layer == nil)
|
||||
return FALSE;
|
||||
BOOL selectedNewBitmap = layer->HandleBitmapSelection();
|
||||
|
||||
if(selectedNewBitmap)
|
||||
{
|
||||
IParamBlock2 *pblock = map->GetParamBlock();
|
||||
//plLayerTex *layer = (plLayerTex*)map->GetParamBlock()->GetOwner();
|
||||
|
||||
//layer->SetBitmap(&bi);
|
||||
//layer->IChanged();
|
||||
//BitmapInfo *bi = &layer->GetPBBitmap()->bi;
|
||||
|
||||
bmSelectBtn = GetICustButton(GetDlgItem(hWnd,IDC_LAYER_NAME));
|
||||
PBBitmap *pbbm = layer->GetPBBitmap();
|
||||
bmSelectBtn->SetText(pbbm != nil ? (TCHAR*)pbbm->bi.Filename() : "");
|
||||
ReleaseICustButton(bmSelectBtn);
|
||||
|
||||
if (pbbm != nil)
|
||||
{
|
||||
// Init values for clamping spinners to powers of 2
|
||||
int width = IFloorPow2( pbbm->bi.Width() );
|
||||
map->SetRange( kBmpExportWidth, 4.f, (float)width );
|
||||
|
||||
int height = IFloorPow2( pbbm->bi.Height() );
|
||||
map->SetRange( kBmpExportHeight, 4.f, (float)height );
|
||||
|
||||
if( width > 512 )
|
||||
{
|
||||
height = (int)( 512.f * (float)( (float)height / (float)width ) );
|
||||
width = 512;
|
||||
}
|
||||
else if( height > 512 )
|
||||
{
|
||||
width = (int)( 512.f * (float)( (float)width / (float)height ) );
|
||||
height = 512;
|
||||
}
|
||||
pblock->SetValue( kBmpExportWidth, t, width );
|
||||
pblock->SetValue( kBmpExportLastWidth, t, width );
|
||||
pblock->SetValue( kBmpExportHeight, t, height );
|
||||
pblock->SetValue( kBmpExportLastHeight, t, height );
|
||||
|
||||
IClampTexSizeSpinner( t, map, true );
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
void DeleteThis() {};
|
||||
|
||||
void ISetDetailCurveNumLevels( IParamMap2 *map, TimeValue t )
|
||||
{
|
||||
/// Set the level count on the detail control
|
||||
plDetailCurveCtrl *ctrl = GET_DETAIL_CURVE_CTRL( map->GetHWnd(), IDC_DETAIL_CURVE_CTRL );
|
||||
if( ctrl != NULL )
|
||||
{
|
||||
IParamBlock2 *pblock = map->GetParamBlock();
|
||||
int w = pblock->GetInt( kBmpExportWidth, t );
|
||||
int h = pblock->GetInt( kBmpExportHeight, t );
|
||||
int numLevels = 0;
|
||||
while( w > 1 && h > 1 )
|
||||
{
|
||||
w >>= 1;
|
||||
h >>= 1;
|
||||
numLevels++;
|
||||
}
|
||||
ctrl->SetNumLevels( numLevels );
|
||||
}
|
||||
}
|
||||
|
||||
/// Clamp texture sizes to a power of 2
|
||||
void IClampTexSizeSpinner( TimeValue t, IParamMap2 *map, bool clampWidth )
|
||||
{
|
||||
IParamBlock2 *pblock = map->GetParamBlock();
|
||||
ParamID clampNew, clampOld;
|
||||
ParamID otherNew, otherOld;
|
||||
|
||||
if( clampWidth )
|
||||
{
|
||||
clampNew = kBmpExportWidth; clampOld = kBmpExportLastWidth;
|
||||
otherNew = kBmpExportHeight; otherOld = kBmpExportLastHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
clampNew = kBmpExportHeight; clampOld = kBmpExportLastHeight;
|
||||
otherNew = kBmpExportWidth; otherOld = kBmpExportLastWidth;
|
||||
}
|
||||
|
||||
int lastVal = pblock->GetInt( clampOld, t );
|
||||
int tempVal, newVal = pblock->GetInt( clampNew, t );
|
||||
|
||||
if( newVal < lastVal )
|
||||
{
|
||||
lastVal = newVal;
|
||||
for( tempVal = 1; tempVal <= newVal; tempVal <<= 1 );
|
||||
newVal = tempVal >> 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
lastVal = newVal;
|
||||
for( tempVal = 1; tempVal < newVal; tempVal <<= 1 );
|
||||
newVal = tempVal;
|
||||
}
|
||||
|
||||
pblock->SetValue( clampNew, t, newVal );
|
||||
pblock->SetValue( clampOld, t, newVal );
|
||||
|
||||
// And clamp aspect ratio
|
||||
PBBitmap *pbbm = pblock->GetBitmap( kBmpBitmap, t );
|
||||
|
||||
if( pbbm != NULL )
|
||||
{
|
||||
int realWidth = pbbm->bi.Width();
|
||||
int realHeight = pbbm->bi.Height();
|
||||
|
||||
float aspect;
|
||||
if( clampWidth )
|
||||
aspect = (float)realHeight / (float)realWidth;
|
||||
else
|
||||
aspect = (float)realWidth / (float)realHeight;
|
||||
|
||||
int value = newVal;
|
||||
value *= aspect;
|
||||
|
||||
if( value < 4 )
|
||||
{
|
||||
// Can't be below 4!
|
||||
value = 4;
|
||||
pblock->SetValue( otherNew, t, value );
|
||||
pblock->SetValue( otherOld, t, value );
|
||||
value = value / aspect;
|
||||
pblock->SetValue( clampNew, t, value );
|
||||
pblock->SetValue( clampOld, t, value );
|
||||
}
|
||||
else
|
||||
{
|
||||
pblock->SetValue( otherNew, t, value );
|
||||
pblock->SetValue( otherOld, t, value );
|
||||
}
|
||||
}
|
||||
|
||||
ISetDetailCurveNumLevels( map, t );
|
||||
}
|
||||
|
||||
int IFloorPow2( int value )
|
||||
{
|
||||
int v;
|
||||
|
||||
|
||||
for( v = 1; v <= value; v <<= 1 );
|
||||
return v >> 1;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static BitmapDlgProc gBitmapDlgProc;
|
||||
|
||||
|
||||
// Gotta love hacks....
|
||||
bool BMTexPBAccessor::IIsProcSettingDetailValues( IParamBlock2 *pb )
|
||||
|
@ -68,7 +68,7 @@ public:
|
||||
|
||||
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 code = HIWORD(wParam);
|
||||
@ -103,7 +103,7 @@ public:
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
void DeleteThis() {}
|
||||
virtual void DeleteThis() {}
|
||||
};
|
||||
static MAXCameraLayerDlgProc gMAXCameraLayerDlgProc;
|
||||
|
||||
|
@ -195,7 +195,7 @@ public:
|
||||
}
|
||||
|
||||
/// 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;
|
||||
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;
|
||||
}
|
||||
void DeleteThis() {};
|
||||
virtual void DeleteThis() {};
|
||||
|
||||
BOOL IDoSelectBaseFilename( IParamMap2 *map, TimeValue t, HWND hWnd )
|
||||
{
|
||||
|
@ -83,11 +83,11 @@ protected:
|
||||
HWND fhWnd;
|
||||
|
||||
public:
|
||||
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
void DeleteThis() { IDeleteSegMap(); }
|
||||
virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
virtual void DeleteThis() { IDeleteSegMap(); }
|
||||
void SetThing(ReferenceTarget *m);
|
||||
|
||||
void Update( TimeValue t, Interval &valid, IParamMap2 *pmap );
|
||||
virtual void Update( TimeValue t, Interval &valid, IParamMap2 *pmap );
|
||||
|
||||
protected:
|
||||
// Set all the controls to their stored value
|
||||
|
@ -28,8 +28,33 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "../resource.h"
|
||||
#include "iparamm2.h"
|
||||
|
||||
class BumpBasicDlgProc;
|
||||
extern BumpBasicDlgProc gBumpBasicDlgProc;
|
||||
class BumpBasicDlgProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
#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
|
||||
(
|
||||
@ -60,33 +85,3 @@ static ParamBlockDesc2 gBumpBasicPB
|
||||
end
|
||||
);
|
||||
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;
|
||||
|
||||
|
||||
|
@ -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
|
||||
{
|
||||
protected:
|
||||
@ -283,7 +202,7 @@ public:
|
||||
|
||||
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
|
||||
if (fCustomText.ProcessMsg(map, hWnd, msg, wParam, lParam))
|
||||
@ -427,6 +346,84 @@ public:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void DeleteThis() {}
|
||||
virtual void DeleteThis() {}
|
||||
};
|
||||
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
|
||||
);
|
||||
|
@ -31,8 +31,59 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
class DecalBasicPBAccessor;
|
||||
extern DecalBasicPBAccessor basicAccessor;
|
||||
|
||||
class DecalBasicDlgProc;
|
||||
extern DecalBasicDlgProc gDecalBasicDlgProc;
|
||||
class DecalBasicDlgProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
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
|
||||
(
|
||||
@ -178,59 +229,3 @@ public:
|
||||
}
|
||||
};
|
||||
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;
|
||||
|
@ -28,8 +28,87 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
class PartMtlPBAccessor;
|
||||
extern PartMtlPBAccessor partMtl_accessor;
|
||||
|
||||
class ParticleBasicDlgProc;
|
||||
extern ParticleBasicDlgProc gParticleBasicDlgProc;
|
||||
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); }
|
||||
|
||||
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_MAX_TILES 16
|
||||
@ -149,86 +228,3 @@ public:
|
||||
}
|
||||
};
|
||||
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;
|
||||
|
@ -59,9 +59,9 @@ class plPassAnimDlgProc : public ParamMap2UserDlgProc, public plMtlChangeCallbac
|
||||
plPassAnimDlgProc();
|
||||
virtual ~plPassAnimDlgProc();
|
||||
|
||||
BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
void DeleteThis() {}
|
||||
void SetThing(ReferenceTarget *m);
|
||||
virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
|
||||
virtual void DeleteThis() {}
|
||||
virtual void SetThing(ReferenceTarget *m);
|
||||
virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap);
|
||||
|
||||
void SegmentListChanged( void );
|
||||
|
@ -42,7 +42,7 @@ protected:
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
@ -79,7 +79,7 @@ public:
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void DeleteThis() {}
|
||||
virtual void DeleteThis() {}
|
||||
};
|
||||
|
||||
#endif
|
@ -391,8 +391,10 @@ RefTargetHandle plPassMtlBase::GetReference( int i )
|
||||
{
|
||||
if( i >= kRefNotetracks && i < kRefNotetracks + fNotetracks.GetCount() )
|
||||
return fNotetracks[ i - kRefNotetracks ];
|
||||
else
|
||||
hsAssert(false, "shit");
|
||||
|
||||
return NULL;
|
||||
return nil;
|
||||
}
|
||||
|
||||
//// SetReference ////////////////////////////////////////////////////////////
|
||||
|
@ -31,8 +31,60 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
class PassBasicPBAccessor;
|
||||
extern PassBasicPBAccessor basicAccessor;
|
||||
|
||||
class PassBasicDlgProc;
|
||||
extern PassBasicDlgProc gPassBasicDlgProc;
|
||||
class PassBasicDlgProc : public ParamMap2UserDlgProc
|
||||
{
|
||||
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
|
||||
(
|
||||
@ -179,62 +231,3 @@ public:
|
||||
}
|
||||
};
|
||||
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;
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user