Browse Source

Merge pull request #94 from branan/max12

Updates for modern max
Adam Johnson 13 years ago
parent
commit
ed2eb2d155
  1. 3
      Sources/Tools/MaxComponent/plAudioComponents.cpp
  2. 9
      Sources/Tools/MaxComponent/plClusterComponent.cpp
  3. 23
      Sources/Tools/MaxComponent/plParticleComponents.cpp
  4. 15
      Sources/Tools/MaxConvert/hsConverterUtils.cpp
  5. 1
      Sources/Tools/MaxConvert/plLayerConverter.cpp
  6. 14
      Sources/Tools/MaxMain/MaxCompat.h
  7. 2
      Sources/Tools/MaxMain/main.cpp
  8. 14
      Sources/Tools/MaxMain/plMaxMenu.cpp
  9. 20
      Sources/Tools/MaxMain/plMaxNode.cpp
  10. 4
      Sources/Tools/MaxPlasmaLights/DLLEntry.cpp
  11. 12
      Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h
  12. 6
      Sources/Tools/MaxPlasmaMtls/CMakeLists.txt
  13. 12
      Sources/Tools/MaxPlasmaMtls/Layers/plLayerTex.cpp
  14. 3
      Sources/Tools/MaxPlasmaMtls/Layers/plLayerTex.h
  15. 122
      Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBasicPB.cpp
  16. 68
      Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBasicPB.h
  17. 3
      Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtl.cpp
  18. 11
      Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtl.cpp
  19. 11
      Sources/Tools/MaxPlasmaMtls/Materials/plParticleMtl.cpp
  20. 11
      Sources/Tools/MaxPlasmaMtls/Materials/plPassMtl.cpp

3
Sources/Tools/MaxComponent/plAudioComponents.cpp

@ -71,6 +71,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "MaxConvert/hsControlConverter.h"
#include "plInterp/plController.h"
#include "MaxMain/plMaxNode.h"
#include "MaxMain/MaxCompat.h"
#include "pnKeyedObject/plKey.h"
//Physics Related
@ -924,7 +925,7 @@ hsBool plBaseSoundEmitterComponent::AddToAnim( plAGAnim *anim, plMaxNode *node
end = anim->GetEnd();
}
ctl = cc.MakeScalarController( fCompPB->GetController( (ParamID)kSoundVolumeSlider ), node, start, end );
ctl = cc.MakeScalarController( GetParamBlock2Controller(fCompPB, (ParamID)kSoundVolumeSlider ), node, start, end );
if( ctl != nil )
{
// Better only do this when the sound component is applied to only one object...

9
Sources/Tools/MaxComponent/plClusterComponent.cpp

@ -75,6 +75,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <vector>
#if MAX_VERSION_MAJOR >= 13
#include <INamedSelectionSetManager.h>
#endif
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
// Start with the component bookkeeping song and dance.
@ -564,8 +568,13 @@ void plClusterComponent::Select()
nodeTab.Append(1, &clust);
}
}
#if MAX_VERSION_MAJOR <= 12
GetCOREInterface()->RemoveNamedSelSet(TSTR(GetINode()->GetName()));
GetCOREInterface()->AddNewNamedSelSet(nodeTab, TSTR(GetINode()->GetName()));
#else
INamedSelectionSetManager::GetInstance()->RemoveNamedSelSet(TSTR(GetINode()->GetName()));
INamedSelectionSetManager::GetInstance()->AddNewNamedSelSet(nodeTab, TSTR(GetINode()->GetName()));
#endif
}
void plClusterComponent::Clear()

23
Sources/Tools/MaxComponent/plParticleComponents.cpp

@ -72,6 +72,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plInterp/hsInterp.h"
#include "plInterp/plAnimEaseTypes.h"
#include "MaxMain/plMaxNode.h"
#include "MaxMain/MaxCompat.h"
#include "pnKeyedObject/plKey.h"
#include "plSurface/hsGMaterial.h"
#include "plPipeline/plGBufferGroup.h"
@ -222,7 +223,7 @@ hsBool plParticleCoreComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
// Need to do this even when immortal, so that maxTotalParticles is computed correctly.
partLifeMin = fUserInput.fLifeMin;
partLifeMax = fUserInput.fLifeMax;
plLeafController *ppsCtl = cc.MakeScalarController(fCompPB->GetController(ParamID(kPPS)), node);
plLeafController *ppsCtl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kPPS)), node);
if (ppsCtl != nil && ppsCtl->GetLength() > 0)
{
// Simulate just the birth across the curve and record the max
@ -529,7 +530,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
if (fCompPB->GetInt(kGenType) != kGenOnePerVertex)
{
ctl = cc.MakeScalarController(fCompPB->GetController(ParamID(kLifeMin)), node, start, end);
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kLifeMin)), node, start, end);
if (ctl != nil)
{
plParticleLifeMinApplicator *app = TRACKED_NEW plParticleLifeMinApplicator();
@ -538,7 +539,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true;
}
ctl = cc.MakeScalarController(fCompPB->GetController(ParamID(kLifeMax)), node, start, end);
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kLifeMax)), node, start, end);
if (ctl != nil)
{
plParticleLifeMaxApplicator *app = TRACKED_NEW plParticleLifeMaxApplicator();
@ -547,7 +548,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true;
}
ctl = cc.MakeScalarController(fCompPB->GetController(ParamID(kPPS)), node, start, end);
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kPPS)), node, start, end);
if (ctl != nil)
{
plParticlePPSApplicator *app = TRACKED_NEW plParticlePPSApplicator();
@ -556,7 +557,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true;
}
ctl = cc.MakeScalarController(fCompPB->GetController(ParamID(kConeAngle)), node, start, end);
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kConeAngle)), node, start, end);
if (ctl != nil)
{
plParticleAngleApplicator *app = TRACKED_NEW plParticleAngleApplicator();
@ -565,7 +566,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true;
}
ctl = cc.MakeScalarController(fCompPB->GetController(ParamID(kVelocityMin)), node, start, end);
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kVelocityMin)), node, start, end);
if (ctl != nil)
{
plParticleVelMinApplicator *app = TRACKED_NEW plParticleVelMinApplicator();
@ -574,7 +575,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true;
}
ctl = cc.MakeScalarController(fCompPB->GetController(ParamID(kVelocityMax)), node, start, end);
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kVelocityMax)), node, start, end);
if (ctl != nil)
{
plParticleVelMaxApplicator *app = TRACKED_NEW plParticleVelMaxApplicator();
@ -584,7 +585,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
}
/*
ctl = cc.MakeScalarController(fCompPB->GetController(ParamID(kGravity)), node, start, end);
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kGravity)), node, start, end);
if (ctl != nil)
{
plParticleGravityApplicator *app = TRACKED_NEW plParticleGravityApplicator();
@ -592,7 +593,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true;
}
ctl = cc.MakeScalarController(fCompPB->GetController(ParamID(kDrag)), node, start, end);
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kDrag)), node, start, end);
if (ctl != nil)
{
plParticleDragApplicator *app = TRACKED_NEW plParticleDragApplicator();
@ -602,7 +603,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
*/
}
ctl = cc.MakeScalarController(fCompPB->GetController(ParamID(kScaleMin)), node, start, end);
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kScaleMin)), node, start, end);
if (ctl != nil)
{
plParticleScaleMinApplicator *app = TRACKED_NEW plParticleScaleMinApplicator();
@ -611,7 +612,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true;
}
ctl = cc.MakeScalarController(fCompPB->GetController(ParamID(kScaleMax)), node, start, end);
ctl = cc.MakeScalarController(GetParamBlock2Controller(fCompPB, ParamID(kScaleMax)), node, start, end);
if (ctl != nil)
{
plParticleScaleMaxApplicator *app = TRACKED_NEW plParticleScaleMaxApplicator();

15
Sources/Tools/MaxConvert/hsConverterUtils.cpp

@ -64,6 +64,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnKeyedObject/plKey.h"
#include "pnKeyedObject/hsKeyedObject.h"
#include "MaxMain/MaxCompat.h"
#if MAX_VERSION_MAJOR >= 13
#include <INamedSelectionSetManager.h>
#endif
const char hsConverterUtils::fTagSeps[] = " ,\t\n=:;";
extern UserPropMgr gUserPropMgr;
@ -416,11 +422,20 @@ Int32 hsConverterUtils::FindNamedSelSetFromName(const char *name)
{
hsGuardBegin("hsConverterUtils::FindNamedSelSetFromName");
#if MAX_VERSION_MAJOR <= 12
for (Int32 i=0; i<fInterface->GetNumNamedSelSets(); i++)
{
if (!_stricmp(name, fInterface->GetNamedSelSetName(i)))
return (i);
}
#else
INamedSelectionSetManager* selSetMgr = INamedSelectionSetManager::GetInstance();
for (Int32 i=0; i<selSetMgr->GetNumNamedSelSets(); i++)
{
if (!_stricmp(name, selSetMgr->GetNamedSelSetName(i)))
return (i);
}
#endif
return (-1);
hsGuardEnd;

1
Sources/Tools/MaxConvert/plLayerConverter.cpp

@ -101,7 +101,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "MaxPlasmaMtls/Layers/plPlasmaMAXLayer.h"
#include "MaxPlasmaMtls/Layers/plLayerTex.h"
#include "MaxPlasmaMtls/Layers/plLayerTexBasicPB.h"
#include "MaxPlasmaMtls/Layers/plLayerTexBitmapPB.h"
#include "MaxPlasmaMtls/Layers/plStaticEnvLayer.h"
#include "MaxPlasmaMtls/Layers/plDynamicEnvLayer.h"

14
Sources/Tools/MaxMain/MaxCompat.h

@ -70,4 +70,18 @@ typedef TCHAR MCHAR;
maxObject->DoEnumDependents(proc);
#endif //MAX_VERSION_MAJOR
#if MAX_VERSION_MAJOR <= 13
#define GetParamBlock2Controller(pb, id) pb->GetController(id)
#define SetParamBlock2Controller(pb, id, tab, ctl) pb->SetController(id, tab, ctl)
#else
#define GetParamBlock2Controller(pb, id) pb->GetControllerByID(id)
#define SetParamBlock2Controller(pb, id, tab, ctl) pb->SetControllerByID(id, tab, ctl)
#endif // MAX_VERSION_MAJOR
#if MAX_VERSION_MAJOR <= 11 // max 2009. Just a guess, really. 2010 doesn't need this function.
#define INIT_CUSTOM_CONTROLLS(instance) InitCustomControls(instance)
#else
#define INIT_CUSTOM_CONTROLS(instance)
#endif
#endif // _PLASMA_MAXCOMPAT_H

2
Sources/Tools/MaxMain/main.cpp

@ -154,7 +154,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved)
controlsInit = TRUE;
// jaguar controls
InitCustomControls(hInstance);
INIT_CUSTOM_CONTROLS(hInstance);
// initialize Chicago controls
InitCommonControls();

14
Sources/Tools/MaxMain/plMaxMenu.cpp

@ -243,7 +243,7 @@ plActionTableMgr theActionTableMgr(actionInfo, DoAction);
MenuContextId kMyMenuContextId=0xcff95f6c; //<random number>
static char *kMenuName = "Plasma";
static int kMenuVersion = 10; // Increment this number if you add an entry to the menu
static int kMenuVersion = 11; // Increment this number if you add an entry to the menu
extern TCHAR *GetString(int id);
@ -308,7 +308,9 @@ void AddPlasmaExportMenu()
void plCreateMenu()
{
#if MAX_VERSION_MAJOR <= 11
AddPlasmaExportMenu();
#endif
IMenuManager* pMenuMan = GetCOREInterface()->GetMenuManager();
bool newlyRegistered = pMenuMan->RegisterMenuBarContext(kMyMenuContextId, kMenuName);
@ -354,9 +356,17 @@ void plCreateMenu()
/////////////////////////////////////////////////
// Add the menu items
//
IMenuItem* pMenuItem;
#if MAX_VERSION_MAJOR >= 12
// Add the export action to the menu
pMenuItem = GetIMenuItem();
pMenuItem->SetActionItem(pActionTable->GetAction(kActionExport));
pPlasmaMenu->AddItem(pMenuItem);
#endif
// Add the save selected action to the menu
IMenuItem* pMenuItem = GetIMenuItem();
pMenuItem = GetIMenuItem();
pMenuItem->SetActionItem(pActionTable->GetAction(kActionSaveSel));
pPlasmaMenu->AddItem(pMenuItem);

20
Sources/Tools/MaxMain/plMaxNode.cpp

@ -2945,19 +2945,19 @@ bool plMaxNode::IsAnimatedLight()
hsControlConverter& cc = hsControlConverter::Instance();
// Is the color animated?
Control *colorCtl = pb->GetController( ParamID( plRTLightBase::kLightColor ) );
Control *colorCtl = GetParamBlock2Controller(pb, ParamID( plRTLightBase::kLightColor ) );
if (colorCtl && cc.HasKeyTimes(colorCtl))
return true;
// Is the specularity animated?
Control *specCtl = pb->GetController( ParamID( plRTLightBase::kSpecularColorSwatch ) );
Control *specCtl = GetParamBlock2Controller(pb, ParamID( plRTLightBase::kSpecularColorSwatch ) );
if (specCtl && cc.HasKeyTimes(specCtl))
return true;
// Is the attenuation animated? (Spot and Omni lights only)
if (cid == RTSPOT_LIGHT_CLASSID || cid == RTOMNI_LIGHT_CLASSID)
{
Control *falloffCtl = pb->GetController( ParamID( plRTLightBase::kAttenMaxFalloffEdit ) );
Control *falloffCtl = GetParamBlock2Controller(pb, ParamID( plRTLightBase::kAttenMaxFalloffEdit ) );
if (falloffCtl && cc.HasKeyTimes(falloffCtl))
return true;
}
@ -2965,11 +2965,11 @@ bool plMaxNode::IsAnimatedLight()
// Is the cone animated? (Spot only)
if (cid == RTSPOT_LIGHT_CLASSID)
{
Control *innerCtl = pb->GetController( ParamID( plRTLightBase::kHotSpot ) );
Control *innerCtl = GetParamBlock2Controller(pb, ParamID( plRTLightBase::kHotSpot ) );
if (innerCtl && cc.HasKeyTimes(innerCtl))
return true;
Control *outerCtl = pb->GetController( ParamID( plRTLightBase::kFallOff ) );
Control *outerCtl = GetParamBlock2Controller(pb, ParamID( plRTLightBase::kFallOff ) );
if (outerCtl && cc.HasKeyTimes(outerCtl))
return true;
}
@ -2982,7 +2982,7 @@ void plMaxNode::GetRTLightAttenAnim(IParamBlock2* ProperPB, plAGAnim *anim)
{
if( ProperPB->GetInt(plRTLightBase::kUseAttenuationBool, TimeValue(0)) )
{
Control* falloffCtl = ProperPB->GetController(ParamID(plRTLightBase::kAttenMaxFalloffEdit));
Control* falloffCtl = GetParamBlock2Controller(ProperPB, ParamID(plRTLightBase::kAttenMaxFalloffEdit));
if( falloffCtl )
{
plLeafController* subCtl;
@ -3118,8 +3118,8 @@ void plMaxNode::IAdjustRTColorByIntensity(plController* ctl, IParamBlock2* Prope
void plMaxNode::GetRTLightColAnim(IParamBlock2* ProperPB, plAGAnim *anim)
{
Control* ambientCtl = nil; // Ambient not currently supported
Control* colorCtl = ProperPB->GetController(ParamID(plRTLightBase::kLightColor));
Control* specCtl = ProperPB->GetController(ParamID(plRTLightBase::kSpecularColorSwatch));
Control* colorCtl = GetParamBlock2Controller(ProperPB, ParamID(plRTLightBase::kLightColor));
Control* specCtl = GetParamBlock2Controller(ProperPB, ParamID(plRTLightBase::kSpecularColorSwatch));
plPointControllerChannel *chan;
if( ambientCtl )
@ -3184,8 +3184,8 @@ void plMaxNode::GetRTLightColAnim(IParamBlock2* ProperPB, plAGAnim *anim)
void plMaxNode::GetRTConeAnim(IParamBlock2* ProperPB, plAGAnim *anim)
{
Control* innerCtl = ProperPB->GetController(ParamID(plRTLightBase::kHotSpot));
Control* outerCtl = ProperPB->GetController(ParamID(plRTLightBase::kFallOff));
Control* innerCtl = GetParamBlock2Controller(ProperPB, ParamID(plRTLightBase::kHotSpot));
Control* outerCtl = GetParamBlock2Controller(ProperPB, ParamID(plRTLightBase::kFallOff));
plScalarControllerChannel *chan;
if( innerCtl )

4
Sources/Tools/MaxPlasmaLights/DLLEntry.cpp

@ -48,6 +48,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnKeyedObject/pnKeyedObjectCreatable.h"
#include "pnNetCommon/pnNetCommonCreatable.h"
#include "MaxMain/MaxCompat.h"
#include "plSurface/plLayerInterface.h"
REGISTER_NONCREATABLE( plLayerInterface );
@ -69,7 +71,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved)
controlsInit = TRUE;
// Note: InitCustomControls is deprecated
// New versions of 3dsm do this for us :)
InitCustomControls(hInstance); // Initialize MAX's custom controls
INIT_CUSTOM_CONTROLS(hInstance); // Initialize MAX's custom controls
InitCommonControls(); // Initialize Win95 controls
}

12
Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h

@ -491,12 +491,12 @@ public:
BOOL GetAttenNearDisplay() {return false;}
ExclList& GetExclusionList() {return exclList;}
void SetExclusionList(ExclList & a) {}
BOOL SetHotSpotControl(Control* a) {fLightPB->SetController(ParamID(kHotSpot),0, a); return true;}
BOOL SetFalloffControl(Control* a) {fLightPB->SetController(ParamID(kFallOff),0, a); return true;}
Control* GetHotSpotControl() {return fLightPB->GetController(ParamID(kHotSpot));}
Control* GetFalloffControl() {return fLightPB->GetController(ParamID(kFallOff));}
BOOL SetColorControl(Control * a) {fLightPB->SetController(ParamID(kLightColor),0, a); return true;}
Control* GetColorControl() {return fLightPB->GetController(ParamID(kLightColor)); }
BOOL SetHotSpotControl(Control* a) {SetParamBlock2Controller(fLightPB, ParamID(kHotSpot),0, a); return true;}
BOOL SetFalloffControl(Control* a) {SetParamBlock2Controller(fLightPB, ParamID(kFallOff),0, a); return true;}
Control* GetHotSpotControl() {return GetParamBlock2Controller(fLightPB, ParamID(kHotSpot));}
Control* GetFalloffControl() {return GetParamBlock2Controller(fLightPB, ParamID(kFallOff));}
BOOL SetColorControl(Control * a) {SetParamBlock2Controller(fLightPB, ParamID(kLightColor),0, a); return true;}
Control* GetColorControl() {return GetParamBlock2Controller(fLightPB, ParamID(kLightColor)); }
BOOL GetDecayType() { return fLightPB->GetInt(kAttenTypeRadio, 0) + 1;} //Offset for the radio.
void SetDecayType(BOOL onOff) {if (!onOff) return; else {fLightPB->SetValue(kAttenTypeRadio, 0, ((int) onOff - 1)); return;} }

6
Sources/Tools/MaxPlasmaMtls/CMakeLists.txt

@ -97,16 +97,11 @@ set(MaxPlasmaMtls_SOURCES
set(MaxPlasmaMtls_SOURCES_Layers
Layers/plAngleAttenLayer.cpp
Layers/plDynamicEnvLayer.cpp
Layers/plDynamicEnvLayerBitmapPB.cpp
Layers/plDynamicTextLayer.cpp
Layers/plDynamicTextLayerBitmapPB.cpp
Layers/plLayerTex.cpp
Layers/plLayerTexBasicPB.cpp
Layers/plLayerTexBitmapPB.cpp
Layers/plMAXCameraLayer.cpp
Layers/plPlasmaMAXLayer.cpp
Layers/plStaticEnvLayer.cpp
Layers/plStaticEnvLayerBitmapPB.cpp
)
set(MaxPlasmaMtls_SOURCES_Materials
@ -119,7 +114,6 @@ set(MaxPlasmaMtls_SOURCES_Materials
Materials/plDecalMtl.cpp
Materials/plMultipassMtl.cpp
Materials/plMultipassMtlDlg.cpp
Materials/plMultipassMtlPB.cpp
Materials/plNoteTrackWatcher.cpp
Materials/plParticleMtl.cpp
Materials/plPassAnimDlgProc.cpp

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

@ -69,10 +69,8 @@ ClassDesc2* GetLayerTexDesc() { return &plLayerTexDesc; }
ParamDlg* plLayerTex::fUVGenDlg = NULL;
// For initializing paramblock descriptor
//ParamBlockDesc2 *GetBasicBlk();
ParamBlockDesc2 *GetBitmapBlk();
//#include "plLayerTexBasicPB.cpp"
#include "plLayerTexBitmapPB.cpp"
void plLayerTex::GetClassName( TSTR &s )
@ -82,7 +80,6 @@ void plLayerTex::GetClassName( TSTR &s )
plLayerTex::plLayerTex() :
fBitmapPB(NULL),
//fBasicPB(NULL),
fUVGen(NULL),
fTexHandle(NULL),
fTexTime(0),
@ -95,7 +92,6 @@ plLayerTex::plLayerTex() :
if (!descInit)
{
descInit = true;
//GetBasicBlk()->SetClassDesc(GetLayerTexDesc());
GetBitmapBlk()->SetClassDesc(GetLayerTexDesc());
}
#endif
@ -159,7 +155,6 @@ Interval plLayerTex::Validity(TimeValue t)
// No warranty on this not being stupid.
Interval v = FOREVER;
fBitmapPB->GetValidity(t, v);
//fBasicPB->GetValidity(t, v);
v &= fUVGen->Validity(t);
return v;
}
@ -199,7 +194,6 @@ RefTargetHandle plLayerTex::GetReference(int i)
{
case kRefUVGen: return fUVGen;
case kRefBitmap: return fBitmapPB;
//case kRefBasic: return fBasicPB;
default: return NULL;
}
}
@ -235,7 +229,6 @@ IParamBlock2* plLayerTex::GetParamBlock(int i)
switch (i)
{
case 0: return fBitmapPB;
//case 1: return fBasicPB;
default: return NULL;
}
}
@ -244,8 +237,6 @@ IParamBlock2* plLayerTex::GetParamBlockByID(BlockID id)
{
if (fBitmapPB->ID() == id)
return fBitmapPB;
//else if (fBasicPB->ID() == id)
// return fBasicPB;
else
return NULL;
}
@ -255,7 +246,6 @@ RefTargetHandle plLayerTex::Clone(RemapDir &remap)
{
plLayerTex *mnew = TRACKED_NEW plLayerTex();
*((MtlBase*)mnew) = *((MtlBase*)this); // copy superclass stuff
//mnew->ReplaceReference(kRefBasic, remap.CloneRef(fBasicPB));
mnew->ReplaceReference(kRefBitmap, remap.CloneRef(fBitmapPB));
mnew->ReplaceReference(kRefUVGen, remap.CloneRef(fUVGen));
BaseClone(this, mnew, remap);
@ -274,7 +264,6 @@ Animatable* plLayerTex::SubAnim(int i)
{
case kRefUVGen: return fUVGen;
case kRefBitmap: return fBitmapPB;
//case kRefBasic: return fBasicPB;
default: return NULL;
}
}
@ -285,7 +274,6 @@ TSTR plLayerTex::SubAnimName(int i)
{
case kRefUVGen: return "UVGen";
case kRefBitmap: return fBitmapPB->GetLocalName();
//case kRefBasic: return fBasicPB->GetLocalName();
default: return "";
}
}

3
Sources/Tools/MaxPlasmaMtls/Layers/plLayerTex.h

@ -59,7 +59,6 @@ class plLayerTex : public plPlasmaMAXLayer
protected:
// Parameter block
IParamBlock2 *fBitmapPB;
IParamBlock2 *fBasicPB;
UVGen *fUVGen;
IMtlParams *fMtlParams;
@ -78,14 +77,12 @@ public:
enum
{
kRefUVGen,
kRefBasic, // DEAD, but left in for backwards compatability
kRefBitmap,
};
// Block ID's
enum
{
kBlkBasic, // DEAD
kBlkBitmap,
};

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

@ -1,122 +0,0 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "hsTypes.h"
#include "plLayerTex.h"
#include "plLayerTexBasicPB.h"
#include "../resource.h"
class BasicDlgProc;
extern BasicDlgProc gBasicDlgProc;
static ParamBlockDesc2 gBasicParamBlk
(
plLayerTex::kBlkBasic, _T("basicLayer"), 0, GetLayerTexDesc(),//NULL,
P_AUTO_CONSTRUCT + P_AUTO_UI, plLayerTex::kRefBasic,
// UI
IDD_LAYER_BASIC, IDS_LAYER_BASIC, 0, 0, &gBasicDlgProc,
// Usage
kBasicUsage, _T("usage"), TYPE_INT, 0, 0,
end,
end
);
ParamBlockDesc2 *GetBasicBlk() { return &gBasicParamBlk; }
static const char *kUsageTypes[] =
{
"None",
"Base Texture",
"Detail",
"Grime",
"Map Blend",
"Highlight/Specular",
"Alpha Mask",
"Shadow/Light Map",
"Helper Object",
"Best Guess"
};
class BasicDlgProc : public ParamMap2UserDlgProc
{
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:
{
HWND hUsage = GetDlgItem(hWnd, IDC_USAGE_TYPE);
for (int i = 0; i < kUsageNumTypes; i++)
SendMessage(hUsage, CB_ADDSTRING, 0, (LPARAM)kUsageTypes[i]);
SendMessage(hUsage, CB_SETCURSEL, pb->GetInt(kBasicUsage), 0);
}
break;
case WM_COMMAND:
switch (HIWORD(wParam))
{
case CBN_SELCHANGE:
switch (LOWORD(wParam))
{
case IDC_USAGE_TYPE:
{
int cur = SendMessage((HWND)lParam, CB_GETCURSEL, 0, 0);
if (LOWORD(wParam) == IDC_USAGE_TYPE)
pb->SetValue(kBasicUsage, t, cur);
return true;
}
break;
}
break;
}
break;
}
return false;
}
virtual void DeleteThis() {};
};
static BasicDlgProc gBasicDlgProc;

68
Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBasicPB.h

@ -1,68 +0,0 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef PL_LAYERTEXBASICPB_H
#define PL_LAYERTEXBASICPB_H
// Param ID's
enum
{
kBasicUsage,
};
// Usage types
enum
{
kUsageNone,
kUsageBase,
kUsageDetail,
kUsageGrime,
kUsageTransition,
kUsageHighlight,
kUsageAlphaMask,
kUsageShadowLight,
kUsageHelper,
kUsageGuess,
kUsageNumTypes
};
#endif //PL_LAYERTEXBASICPB_H

3
Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtl.cpp

@ -52,6 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "../Layers/plLayerTex.h"
#include "../Layers/plStaticEnvLayer.h"
#include "MaxMain/plPlasmaRefMsgs.h"
#include "MaxMain/MaxCompat.h"
extern HINSTANCE hInstance;
@ -665,7 +666,7 @@ Control *plBumpMtl::GetPreshadeColorController() { return nil; }
Control *plBumpMtl::GetAmbColorController() { return nil; }
Control *plBumpMtl::GetOpacityController() { return nil; }
Control *plBumpMtl::GetSpecularColorController() { return nil; }
Control *plBumpMtl::GetRuntimeColorController() { return fBasicPB->GetController(ParamID(kBumpBasRunColor)); }
Control *plBumpMtl::GetRuntimeColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kBumpBasRunColor)); }
// Layer block
Texmap *plBumpMtl::GetBaseLayer() { return fBasicPB->GetTexmap(kBumpBasLayer); }

11
Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtl.cpp

@ -55,6 +55,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "../Layers/plLayerTex.h"
#include "../Layers/plStaticEnvLayer.h"
#include "MaxMain/plPlasmaRefMsgs.h"
#include "MaxMain/MaxCompat.h"
extern HINSTANCE hInstance;
@ -782,13 +783,13 @@ int plDecalMtl::GetEmissive() { return fBasicPB->GetInt(kDecalBasEmissive);
int plDecalMtl::GetUseSpec() { return fBasicPB->GetInt(kDecalBasUseSpec); }
int plDecalMtl::GetShine() { return fBasicPB->GetInt(kDecalBasShine); }
Color plDecalMtl::GetSpecularColor() { return fBasicPB->GetColor(kDecalBasSpecColor); }
Control *plDecalMtl::GetPreshadeColorController() { return fBasicPB->GetController(ParamID(kDecalBasColor)); }
Control *plDecalMtl::GetAmbColorController() { return fBasicPB->GetController(ParamID(kDecalBasColorAmb)); }
Control *plDecalMtl::GetOpacityController() { return fBasicPB->GetController(ParamID(kDecalBasOpacity)); }
Control *plDecalMtl::GetSpecularColorController() { return fBasicPB->GetController(ParamID(kDecalBasSpecColor)); }
Control *plDecalMtl::GetPreshadeColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kDecalBasColor)); }
Control *plDecalMtl::GetAmbColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kDecalBasColorAmb)); }
Control *plDecalMtl::GetOpacityController() { return GetParamBlock2Controller(fBasicPB, ParamID(kDecalBasOpacity)); }
Control *plDecalMtl::GetSpecularColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kDecalBasSpecColor)); }
int plDecalMtl::GetDiffuseColorLock() { return fBasicPB->GetInt(kDecalBasDiffuseLock); }
Color plDecalMtl::GetRuntimeColor() { return fBasicPB->GetColor(kDecalBasRunColor); }
Control *plDecalMtl::GetRuntimeColorController() { return fBasicPB->GetController(ParamID(kDecalBasRunColor)); }
Control *plDecalMtl::GetRuntimeColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kDecalBasRunColor)); }
// Layer block
Texmap *plDecalMtl::GetBaseLayer() { return fLayersPB->GetTexmap(kDecalLayBase); }

11
Sources/Tools/MaxPlasmaMtls/Materials/plParticleMtl.cpp

@ -52,6 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "stdmat.h"
#include "../Layers/plLayerTex.h"
#include "../Layers/plLayerTexBitmapPB.h"
#include "MaxMain/MaxCompat.h"
extern HINSTANCE hInstance;
@ -629,8 +630,8 @@ Interval plParticleMtl::DisplacementValidity(TimeValue t)
return iv;
}
Control *plParticleMtl::GetAmbColorController() { return fBasicPB->GetController(ParamID(kColorAmb)); }
Control *plParticleMtl::GetColorController() { return fBasicPB->GetController(ParamID(kColor)); }
Control *plParticleMtl::GetOpacityController() { return fBasicPB->GetController(ParamID(kOpacity)); }
Control *plParticleMtl::GetWidthController() { return fBasicPB->GetController(ParamID(kWidth)); }
Control *plParticleMtl::GetHeightController() { return fBasicPB->GetController(ParamID(kHeight)); }
Control *plParticleMtl::GetAmbColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kColorAmb)); }
Control *plParticleMtl::GetColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kColor)); }
Control *plParticleMtl::GetOpacityController() { return GetParamBlock2Controller(fBasicPB, ParamID(kOpacity)); }
Control *plParticleMtl::GetWidthController() { return GetParamBlock2Controller(fBasicPB, ParamID(kWidth)); }
Control *plParticleMtl::GetHeightController() { return GetParamBlock2Controller(fBasicPB, ParamID(kHeight)); }

11
Sources/Tools/MaxPlasmaMtls/Materials/plPassMtl.cpp

@ -54,6 +54,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "../Layers/plLayerTex.h"
#include "../Layers/plStaticEnvLayer.h"
#include "MaxMain/MaxCompat.h"
#include "hsBitVector.h"
@ -847,11 +848,11 @@ int plPassMtl::GetShine() { return fBasicPB->GetInt(kPassBasShine); }
Color plPassMtl::GetSpecularColor() { return fBasicPB->GetColor(kPassBasSpecColor); }
int plPassMtl::GetDiffuseColorLock() { return fBasicPB->GetInt(kPassBasDiffuseLock); }
Color plPassMtl::GetRuntimeColor() { return fBasicPB->GetColor(kPassBasRunColor); }
Control *plPassMtl::GetPreshadeColorController() { return fBasicPB->GetController(ParamID(kPassBasColor)); }
Control *plPassMtl::GetAmbColorController() { return fBasicPB->GetController(ParamID(kPassBasColorAmb)); }
Control *plPassMtl::GetOpacityController() { return fBasicPB->GetController(ParamID(kPassBasOpacity)); }
Control *plPassMtl::GetSpecularColorController() { return fBasicPB->GetController(ParamID(kPassBasSpecColor)); }
Control *plPassMtl::GetRuntimeColorController() { return fBasicPB->GetController(ParamID(kPassBasRunColor)); }
Control *plPassMtl::GetPreshadeColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kPassBasColor)); }
Control *plPassMtl::GetAmbColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kPassBasColorAmb)); }
Control *plPassMtl::GetOpacityController() { return GetParamBlock2Controller(fBasicPB, ParamID(kPassBasOpacity)); }
Control *plPassMtl::GetSpecularColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kPassBasSpecColor)); }
Control *plPassMtl::GetRuntimeColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kPassBasRunColor)); }
// Layer block
Texmap *plPassMtl::GetBaseLayer() { return fLayersPB->GetTexmap(kPassLayBase); }

Loading…
Cancel
Save