Browse Source

Merge branch 'master' into linux

Darryl Pogue 13 years ago
parent
commit
db6066e109
  1. 18
      Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp
  2. 16
      Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp
  3. 7
      Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp
  4. 25
      Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp
  5. 3
      Sources/Tools/MaxComponent/plAudioComponents.cpp
  6. 9
      Sources/Tools/MaxComponent/plClusterComponent.cpp
  7. 23
      Sources/Tools/MaxComponent/plParticleComponents.cpp
  8. 15
      Sources/Tools/MaxConvert/hsConverterUtils.cpp
  9. 1
      Sources/Tools/MaxConvert/plLayerConverter.cpp
  10. 14
      Sources/Tools/MaxMain/MaxCompat.h
  11. 2
      Sources/Tools/MaxMain/main.cpp
  12. 14
      Sources/Tools/MaxMain/plMaxMenu.cpp
  13. 20
      Sources/Tools/MaxMain/plMaxNode.cpp
  14. 6
      Sources/Tools/MaxPlasmaLights/DLLEntry.cpp
  15. 12
      Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h
  16. 7
      Sources/Tools/MaxPlasmaMtls/CMakeLists.txt
  17. 12
      Sources/Tools/MaxPlasmaMtls/Layers/plLayerTex.cpp
  18. 3
      Sources/Tools/MaxPlasmaMtls/Layers/plLayerTex.h
  19. 122
      Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBasicPB.cpp
  20. 68
      Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBasicPB.h
  21. 3
      Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtl.cpp
  22. 11
      Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtl.cpp
  23. 11
      Sources/Tools/MaxPlasmaMtls/Materials/plParticleMtl.cpp
  24. 11
      Sources/Tools/MaxPlasmaMtls/Materials/plPassMtl.cpp

18
Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp

@ -208,6 +208,22 @@ void plPythonSDLModifier::SetItemIdx(const char* key, int idx, PyObject* value,
return; return;
} }
if (pyTuple && pyTuple->ob_refcnt != 1)
{
// others already have references to the tuple and expect it to be immutable, must make a copy
int n = PyTuple_Size(pyTuple);
PyObject* newTuple = PyTuple_New(n);
for (int j = 0; j < n; j++)
{
PyObject* item = PyTuple_GetItem(pyTuple, j);
Py_INCREF(item);
PyTuple_SetItem(newTuple, j, item);
}
Py_DECREF(pyTuple);
pyTuple = newTuple;
it->second.obj = newTuple;
}
if (pyTuple) if (pyTuple)
{ {
if (PyTuple_Size(pyTuple) <= idx) if (PyTuple_Size(pyTuple) <= idx)
@ -221,6 +237,8 @@ void plPythonSDLModifier::SetItemIdx(const char* key, int idx, PyObject* value,
Py_INCREF(Py_None); Py_INCREF(Py_None);
PyTuple_SetItem(pyTuple, j, Py_None); PyTuple_SetItem(pyTuple, j, Py_None);
} }
// _PyTuple_Resize may have changed pyTuple
it->second.obj = pyTuple;
} }
} }
else else

16
Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp

@ -425,6 +425,14 @@ bool plAnimStage::IMoveBackward(double time, float delta, float &overrun, plArma
bool infiniteLoop = fLoops == -1; bool infiniteLoop = fLoops == -1;
bool loopsRemain = fCurLoop > 0 || infiniteLoop; bool loopsRemain = fCurLoop > 0 || infiniteLoop;
// If we don't have this animation, just pretend to have worked.
// Otherwise, we crash the client.
if (!fAnimInstance)
{
hsAssert(false, "AnimInstance nil");
return true;
}
// This must be here before we set the local time. // This must be here before we set the local time.
if (fAnimInstance->GetTimeConvert()) if (fAnimInstance->GetTimeConvert())
fAnimInstance->GetTimeConvert()->Backwards(); fAnimInstance->GetTimeConvert()->Backwards();
@ -477,6 +485,14 @@ bool plAnimStage::IMoveForward(double time, float delta, float &overrun, plArmat
// first get the target time in local time, ignoring overruns // first get the target time in local time, ignoring overruns
float target = fLocalTime + delta; float target = fLocalTime + delta;
// If we don't have this animation, just pretend to have worked.
// Otherwise, we crash the client.
if (!fAnimInstance)
{
hsAssert(false, "AnimInstance nil");
return true;
}
if (fAnimInstance->GetTimeConvert()) if (fAnimInstance->GetTimeConvert())
fAnimInstance->GetTimeConvert()->Forewards(); fAnimInstance->GetTimeConvert()->Forewards();

7
Sources/Plasma/PubUtilLib/plResMgr/plResManager.cpp

@ -1193,6 +1193,9 @@ void plResManager::PageInRoom(const plLocation& page, UInt16 objClassToRef, plRe
return; return;
} }
// Step 0.9: Open the stream on this page, so it remains open for the entire loading process
pageNode->OpenStream();
// Step 1: We force a load on all the keys in the given page // Step 1: We force a load on all the keys in the given page
kResMgrLog(2, ILog(2, "...Loading page keys...")); kResMgrLog(2, ILog(2, "...Loading page keys..."));
LoadPageKeys(pageNode); LoadPageKeys(pageNode);
@ -1211,6 +1214,7 @@ void plResManager::PageInRoom(const plLocation& page, UInt16 objClassToRef, plRe
kResMgrLog(1, ILog(1, "...SceneNode not found to base page-in op on. Aborting...")); kResMgrLog(1, ILog(1, "...SceneNode not found to base page-in op on. Aborting..."));
// This is coming up a lot lately; too intrusive to be an assert. // This is coming up a lot lately; too intrusive to be an assert.
// hsAssert( false, "No object found on which to base our PageInRoom()" ); // hsAssert( false, "No object found on which to base our PageInRoom()" );
pageNode->CloseStream();
return; return;
} }
@ -1229,6 +1233,9 @@ void plResManager::PageInRoom(const plLocation& page, UInt16 objClassToRef, plRe
kResMgrLog(2, ILog(2, "...Dispatching refMessage...")); kResMgrLog(2, ILog(2, "...Dispatching refMessage..."));
AddViaNotify(objKey, refMsg, plRefFlags::kActiveRef); AddViaNotify(objKey, refMsg, plRefFlags::kActiveRef);
// Step 5.9: Close the page stream
pageNode->CloseStream();
// All done! // All done!
kResMgrLog(1, ILog(1, "...Page in complete!")); kResMgrLog(1, ILog(1, "...Page in complete!"));

25
Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp

@ -73,6 +73,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#if HS_BUILD_FOR_UNIX #if HS_BUILD_FOR_UNIX
#include <limits.h> #include <limits.h>
#define MAX_PATH PATH_MAX #define MAX_PATH PATH_MAX
#elif HS_BUILD_FOR_WIN32
#include <Shlobj.h>
#endif #endif
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
@ -90,7 +92,20 @@ plStatusLogMgr::plStatusLogMgr()
fDrawer = nil; fDrawer = nil;
fLastLogChangeTime = 0; fLastLogChangeTime = 0;
plFileUtils::ConcatFileName(fBasePath, L"log"); #if HS_BUILD_FOR_WIN32
SHGetSpecialFolderPathW(NULL, fBasePath, CSIDL_LOCAL_APPDATA, TRUE);
//#elif HS_BUILD_FOR_DARWIN
// Do some Mac specific thing here eventually
#else
const char* home = getenv("HOME");
if (!home) home = "";
wchar* temp = hsStringToWString(home);
swprintf(fBasePath, MAX_PATH, L"%S/.cache", temp);
delete[] temp;
#endif
plFileUtils::ConcatFileName(fBasePath, ProductLongName());
plFileUtils::ConcatFileName(fBasePath, L"Log");
plFileUtils::EnsureFilePathExists(fBasePath); plFileUtils::EnsureFilePathExists(fBasePath);
} }
@ -820,7 +835,13 @@ bool plStatusLog::IPrintLineToFile( const char *line, UInt32 count )
strncat(buf, work, arrsize(work)); strncat(buf, work, arrsize(work));
} }
strncat(buf, line, arrsize(line)); size_t remaining = arrsize(buf) - strlen(buf) - 1;
if (!fEncryptMe) remaining -= 1;
if (count <= remaining) {
strncat(buf, line, count);
} else {
strncat(buf, line, remaining);
}
if(!fEncryptMe ) if(!fEncryptMe )
{ {

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 "MaxConvert/hsControlConverter.h"
#include "plInterp/plController.h" #include "plInterp/plController.h"
#include "MaxMain/plMaxNode.h" #include "MaxMain/plMaxNode.h"
#include "MaxMain/MaxCompat.h"
#include "pnKeyedObject/plKey.h" #include "pnKeyedObject/plKey.h"
//Physics Related //Physics Related
@ -924,7 +925,7 @@ hsBool plBaseSoundEmitterComponent::AddToAnim( plAGAnim *anim, plMaxNode *node
end = anim->GetEnd(); 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 ) if( ctl != nil )
{ {
// Better only do this when the sound component is applied to only one object... // 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> #include <vector>
#if MAX_VERSION_MAJOR >= 13
#include <INamedSelectionSetManager.h>
#endif
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////
// Start with the component bookkeeping song and dance. // Start with the component bookkeeping song and dance.
@ -564,8 +568,13 @@ void plClusterComponent::Select()
nodeTab.Append(1, &clust); nodeTab.Append(1, &clust);
} }
} }
#if MAX_VERSION_MAJOR <= 12
GetCOREInterface()->RemoveNamedSelSet(TSTR(GetINode()->GetName())); GetCOREInterface()->RemoveNamedSelSet(TSTR(GetINode()->GetName()));
GetCOREInterface()->AddNewNamedSelSet(nodeTab, 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() 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/hsInterp.h"
#include "plInterp/plAnimEaseTypes.h" #include "plInterp/plAnimEaseTypes.h"
#include "MaxMain/plMaxNode.h" #include "MaxMain/plMaxNode.h"
#include "MaxMain/MaxCompat.h"
#include "pnKeyedObject/plKey.h" #include "pnKeyedObject/plKey.h"
#include "plSurface/hsGMaterial.h" #include "plSurface/hsGMaterial.h"
#include "plPipeline/plGBufferGroup.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. // Need to do this even when immortal, so that maxTotalParticles is computed correctly.
partLifeMin = fUserInput.fLifeMin; partLifeMin = fUserInput.fLifeMin;
partLifeMax = fUserInput.fLifeMax; 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) if (ppsCtl != nil && ppsCtl->GetLength() > 0)
{ {
// Simulate just the birth across the curve and record the max // 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) 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) if (ctl != nil)
{ {
plParticleLifeMinApplicator *app = TRACKED_NEW plParticleLifeMinApplicator(); plParticleLifeMinApplicator *app = TRACKED_NEW plParticleLifeMinApplicator();
@ -538,7 +539,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true; 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) if (ctl != nil)
{ {
plParticleLifeMaxApplicator *app = TRACKED_NEW plParticleLifeMaxApplicator(); plParticleLifeMaxApplicator *app = TRACKED_NEW plParticleLifeMaxApplicator();
@ -547,7 +548,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true; 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) if (ctl != nil)
{ {
plParticlePPSApplicator *app = TRACKED_NEW plParticlePPSApplicator(); plParticlePPSApplicator *app = TRACKED_NEW plParticlePPSApplicator();
@ -556,7 +557,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true; 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) if (ctl != nil)
{ {
plParticleAngleApplicator *app = TRACKED_NEW plParticleAngleApplicator(); plParticleAngleApplicator *app = TRACKED_NEW plParticleAngleApplicator();
@ -565,7 +566,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true; 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) if (ctl != nil)
{ {
plParticleVelMinApplicator *app = TRACKED_NEW plParticleVelMinApplicator(); plParticleVelMinApplicator *app = TRACKED_NEW plParticleVelMinApplicator();
@ -574,7 +575,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true; 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) if (ctl != nil)
{ {
plParticleVelMaxApplicator *app = TRACKED_NEW plParticleVelMaxApplicator(); 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) if (ctl != nil)
{ {
plParticleGravityApplicator *app = TRACKED_NEW plParticleGravityApplicator(); plParticleGravityApplicator *app = TRACKED_NEW plParticleGravityApplicator();
@ -592,7 +593,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true; 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) if (ctl != nil)
{ {
plParticleDragApplicator *app = TRACKED_NEW plParticleDragApplicator(); 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) if (ctl != nil)
{ {
plParticleScaleMinApplicator *app = TRACKED_NEW plParticleScaleMinApplicator(); plParticleScaleMinApplicator *app = TRACKED_NEW plParticleScaleMinApplicator();
@ -611,7 +612,7 @@ hsBool plParticleCoreComponent::AddToAnim(plAGAnim *anim, plMaxNode *node)
result = true; 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) if (ctl != nil)
{ {
plParticleScaleMaxApplicator *app = TRACKED_NEW plParticleScaleMaxApplicator(); 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/plKey.h"
#include "pnKeyedObject/hsKeyedObject.h" #include "pnKeyedObject/hsKeyedObject.h"
#include "MaxMain/MaxCompat.h"
#if MAX_VERSION_MAJOR >= 13
#include <INamedSelectionSetManager.h>
#endif
const char hsConverterUtils::fTagSeps[] = " ,\t\n=:;"; const char hsConverterUtils::fTagSeps[] = " ,\t\n=:;";
extern UserPropMgr gUserPropMgr; extern UserPropMgr gUserPropMgr;
@ -416,11 +422,20 @@ Int32 hsConverterUtils::FindNamedSelSetFromName(const char *name)
{ {
hsGuardBegin("hsConverterUtils::FindNamedSelSetFromName"); hsGuardBegin("hsConverterUtils::FindNamedSelSetFromName");
#if MAX_VERSION_MAJOR <= 12
for (Int32 i=0; i<fInterface->GetNumNamedSelSets(); i++) for (Int32 i=0; i<fInterface->GetNumNamedSelSets(); i++)
{ {
if (!_stricmp(name, fInterface->GetNamedSelSetName(i))) if (!_stricmp(name, fInterface->GetNamedSelSetName(i)))
return (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); return (-1);
hsGuardEnd; 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/plPlasmaMAXLayer.h"
#include "MaxPlasmaMtls/Layers/plLayerTex.h" #include "MaxPlasmaMtls/Layers/plLayerTex.h"
#include "MaxPlasmaMtls/Layers/plLayerTexBasicPB.h"
#include "MaxPlasmaMtls/Layers/plLayerTexBitmapPB.h" #include "MaxPlasmaMtls/Layers/plLayerTexBitmapPB.h"
#include "MaxPlasmaMtls/Layers/plStaticEnvLayer.h" #include "MaxPlasmaMtls/Layers/plStaticEnvLayer.h"
#include "MaxPlasmaMtls/Layers/plDynamicEnvLayer.h" #include "MaxPlasmaMtls/Layers/plDynamicEnvLayer.h"

14
Sources/Tools/MaxMain/MaxCompat.h

@ -70,4 +70,18 @@ typedef TCHAR MCHAR;
maxObject->DoEnumDependents(proc); maxObject->DoEnumDependents(proc);
#endif //MAX_VERSION_MAJOR #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 #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; controlsInit = TRUE;
// jaguar controls // jaguar controls
InitCustomControls(hInstance); INIT_CUSTOM_CONTROLS(hInstance);
// initialize Chicago controls // initialize Chicago controls
InitCommonControls(); InitCommonControls();

14
Sources/Tools/MaxMain/plMaxMenu.cpp

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

20
Sources/Tools/MaxMain/plMaxNode.cpp

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

6
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 "pnKeyedObject/pnKeyedObjectCreatable.h"
#include "pnNetCommon/pnNetCommonCreatable.h" #include "pnNetCommon/pnNetCommonCreatable.h"
#include "MaxMain/MaxCompat.h"
#include "plSurface/plLayerInterface.h" #include "plSurface/plLayerInterface.h"
REGISTER_NONCREATABLE( plLayerInterface ); REGISTER_NONCREATABLE( plLayerInterface );
@ -69,7 +71,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved)
controlsInit = TRUE; controlsInit = TRUE;
// Note: InitCustomControls is deprecated // Note: InitCustomControls is deprecated
// New versions of 3dsm do this for us :) // 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 InitCommonControls(); // Initialize Win95 controls
} }
@ -78,7 +80,7 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,ULONG fdwReason,LPVOID lpvReserved)
__declspec(dllexport) const TCHAR* LibDescription() __declspec(dllexport) const TCHAR* LibDescription()
{ {
return NULL; return TEXT("MaxPlasmaLights");
} }
__declspec(dllexport) int LibNumberClasses() __declspec(dllexport) int LibNumberClasses()

12
Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h

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

7
Sources/Tools/MaxPlasmaMtls/CMakeLists.txt

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

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

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

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

@ -59,7 +59,6 @@ class plLayerTex : public plPlasmaMAXLayer
protected: protected:
// Parameter block // Parameter block
IParamBlock2 *fBitmapPB; IParamBlock2 *fBitmapPB;
IParamBlock2 *fBasicPB;
UVGen *fUVGen; UVGen *fUVGen;
IMtlParams *fMtlParams; IMtlParams *fMtlParams;
@ -78,14 +77,12 @@ public:
enum enum
{ {
kRefUVGen, kRefUVGen,
kRefBasic, // DEAD, but left in for backwards compatability
kRefBitmap, kRefBitmap,
}; };
// Block ID's // Block ID's
enum enum
{ {
kBlkBasic, // DEAD
kBlkBitmap, 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/plLayerTex.h"
#include "../Layers/plStaticEnvLayer.h" #include "../Layers/plStaticEnvLayer.h"
#include "MaxMain/plPlasmaRefMsgs.h" #include "MaxMain/plPlasmaRefMsgs.h"
#include "MaxMain/MaxCompat.h"
extern HINSTANCE hInstance; extern HINSTANCE hInstance;
@ -665,7 +666,7 @@ Control *plBumpMtl::GetPreshadeColorController() { return nil; }
Control *plBumpMtl::GetAmbColorController() { return nil; } Control *plBumpMtl::GetAmbColorController() { return nil; }
Control *plBumpMtl::GetOpacityController() { return nil; } Control *plBumpMtl::GetOpacityController() { return nil; }
Control *plBumpMtl::GetSpecularColorController() { 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 // Layer block
Texmap *plBumpMtl::GetBaseLayer() { return fBasicPB->GetTexmap(kBumpBasLayer); } 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/plLayerTex.h"
#include "../Layers/plStaticEnvLayer.h" #include "../Layers/plStaticEnvLayer.h"
#include "MaxMain/plPlasmaRefMsgs.h" #include "MaxMain/plPlasmaRefMsgs.h"
#include "MaxMain/MaxCompat.h"
extern HINSTANCE hInstance; extern HINSTANCE hInstance;
@ -782,13 +783,13 @@ int plDecalMtl::GetEmissive() { return fBasicPB->GetInt(kDecalBasEmissive);
int plDecalMtl::GetUseSpec() { return fBasicPB->GetInt(kDecalBasUseSpec); } int plDecalMtl::GetUseSpec() { return fBasicPB->GetInt(kDecalBasUseSpec); }
int plDecalMtl::GetShine() { return fBasicPB->GetInt(kDecalBasShine); } int plDecalMtl::GetShine() { return fBasicPB->GetInt(kDecalBasShine); }
Color plDecalMtl::GetSpecularColor() { return fBasicPB->GetColor(kDecalBasSpecColor); } Color plDecalMtl::GetSpecularColor() { return fBasicPB->GetColor(kDecalBasSpecColor); }
Control *plDecalMtl::GetPreshadeColorController() { return fBasicPB->GetController(ParamID(kDecalBasColor)); } Control *plDecalMtl::GetPreshadeColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kDecalBasColor)); }
Control *plDecalMtl::GetAmbColorController() { return fBasicPB->GetController(ParamID(kDecalBasColorAmb)); } Control *plDecalMtl::GetAmbColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kDecalBasColorAmb)); }
Control *plDecalMtl::GetOpacityController() { return fBasicPB->GetController(ParamID(kDecalBasOpacity)); } Control *plDecalMtl::GetOpacityController() { return GetParamBlock2Controller(fBasicPB, ParamID(kDecalBasOpacity)); }
Control *plDecalMtl::GetSpecularColorController() { return fBasicPB->GetController(ParamID(kDecalBasSpecColor)); } Control *plDecalMtl::GetSpecularColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kDecalBasSpecColor)); }
int plDecalMtl::GetDiffuseColorLock() { return fBasicPB->GetInt(kDecalBasDiffuseLock); } int plDecalMtl::GetDiffuseColorLock() { return fBasicPB->GetInt(kDecalBasDiffuseLock); }
Color plDecalMtl::GetRuntimeColor() { return fBasicPB->GetColor(kDecalBasRunColor); } 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 // Layer block
Texmap *plDecalMtl::GetBaseLayer() { return fLayersPB->GetTexmap(kDecalLayBase); } 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 "stdmat.h"
#include "../Layers/plLayerTex.h" #include "../Layers/plLayerTex.h"
#include "../Layers/plLayerTexBitmapPB.h" #include "../Layers/plLayerTexBitmapPB.h"
#include "MaxMain/MaxCompat.h"
extern HINSTANCE hInstance; extern HINSTANCE hInstance;
@ -629,8 +630,8 @@ Interval plParticleMtl::DisplacementValidity(TimeValue t)
return iv; return iv;
} }
Control *plParticleMtl::GetAmbColorController() { return fBasicPB->GetController(ParamID(kColorAmb)); } Control *plParticleMtl::GetAmbColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kColorAmb)); }
Control *plParticleMtl::GetColorController() { return fBasicPB->GetController(ParamID(kColor)); } Control *plParticleMtl::GetColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kColor)); }
Control *plParticleMtl::GetOpacityController() { return fBasicPB->GetController(ParamID(kOpacity)); } Control *plParticleMtl::GetOpacityController() { return GetParamBlock2Controller(fBasicPB, ParamID(kOpacity)); }
Control *plParticleMtl::GetWidthController() { return fBasicPB->GetController(ParamID(kWidth)); } Control *plParticleMtl::GetWidthController() { return GetParamBlock2Controller(fBasicPB, ParamID(kWidth)); }
Control *plParticleMtl::GetHeightController() { return fBasicPB->GetController(ParamID(kHeight)); } 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/plLayerTex.h"
#include "../Layers/plStaticEnvLayer.h" #include "../Layers/plStaticEnvLayer.h"
#include "MaxMain/MaxCompat.h"
#include "hsBitVector.h" #include "hsBitVector.h"
@ -847,11 +848,11 @@ int plPassMtl::GetShine() { return fBasicPB->GetInt(kPassBasShine); }
Color plPassMtl::GetSpecularColor() { return fBasicPB->GetColor(kPassBasSpecColor); } Color plPassMtl::GetSpecularColor() { return fBasicPB->GetColor(kPassBasSpecColor); }
int plPassMtl::GetDiffuseColorLock() { return fBasicPB->GetInt(kPassBasDiffuseLock); } int plPassMtl::GetDiffuseColorLock() { return fBasicPB->GetInt(kPassBasDiffuseLock); }
Color plPassMtl::GetRuntimeColor() { return fBasicPB->GetColor(kPassBasRunColor); } Color plPassMtl::GetRuntimeColor() { return fBasicPB->GetColor(kPassBasRunColor); }
Control *plPassMtl::GetPreshadeColorController() { return fBasicPB->GetController(ParamID(kPassBasColor)); } Control *plPassMtl::GetPreshadeColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kPassBasColor)); }
Control *plPassMtl::GetAmbColorController() { return fBasicPB->GetController(ParamID(kPassBasColorAmb)); } Control *plPassMtl::GetAmbColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kPassBasColorAmb)); }
Control *plPassMtl::GetOpacityController() { return fBasicPB->GetController(ParamID(kPassBasOpacity)); } Control *plPassMtl::GetOpacityController() { return GetParamBlock2Controller(fBasicPB, ParamID(kPassBasOpacity)); }
Control *plPassMtl::GetSpecularColorController() { return fBasicPB->GetController(ParamID(kPassBasSpecColor)); } Control *plPassMtl::GetSpecularColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kPassBasSpecColor)); }
Control *plPassMtl::GetRuntimeColorController() { return fBasicPB->GetController(ParamID(kPassBasRunColor)); } Control *plPassMtl::GetRuntimeColorController() { return GetParamBlock2Controller(fBasicPB, ParamID(kPassBasRunColor)); }
// Layer block // Layer block
Texmap *plPassMtl::GetBaseLayer() { return fLayersPB->GetTexmap(kPassLayBase); } Texmap *plPassMtl::GetBaseLayer() { return fLayersPB->GetTexmap(kPassLayBase); }

Loading…
Cancel
Save