Browse Source

Fixes to make MaxComponent buildable

Adam Johnson 14 years ago
parent
commit
92defe7570
  1. 4
      Sources/Plasma/CoreLib/hsWindows.h
  2. 45
      Sources/Tools/MaxComponent/plAnimComponent.cpp
  3. 38
      Sources/Tools/MaxComponent/plAnimComponent.h
  4. 61
      Sources/Tools/MaxComponent/plAudioComponents.cpp
  5. 8
      Sources/Tools/MaxComponent/plAudioComponents.h
  6. 2
      Sources/Tools/MaxComponent/plAvatarComponent.cpp
  7. 1
      Sources/Tools/MaxComponent/plCAnimParamBlock.cpp
  8. 16
      Sources/Tools/MaxComponent/plComponentBase.cpp
  9. 10
      Sources/Tools/MaxComponent/plComponentMgr.cpp
  10. 6
      Sources/Tools/MaxComponent/plGUIComponents.cpp
  11. 16
      Sources/Tools/MaxComponent/plMiscComponents.cpp
  12. 2
      Sources/Tools/MaxComponent/plMiscComponents.h
  13. 62
      Sources/Tools/MaxComponent/plResponderAnim.cpp
  14. 7
      Sources/Tools/MaxComponent/plResponderComponent.cpp
  15. 5
      Sources/Tools/MaxComponent/resource.h
  16. 2
      Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h

4
Sources/Plasma/CoreLib/hsWindows.h

@ -28,10 +28,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#if HS_BUILD_FOR_WIN32 #if HS_BUILD_FOR_WIN32
#ifndef __AFX_H__ // MFC apps won't let us include windows from here. =( #ifndef __AFX_H__ // MFC apps won't let us include windows from here. =(
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0400
#endif // _WIN32_WINNT
#ifndef MAXPLUGINCODE #ifndef MAXPLUGINCODE
#include <WinSock2.h> #include <WinSock2.h>
#endif // MAXPLUGINCODE #endif // MAXPLUGINCODE

45
Sources/Tools/MaxComponent/plAnimComponent.cpp

@ -47,7 +47,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAvatar/plScalarChannel.h" #include "plAvatar/plScalarChannel.h"
#include "MaxMain/plMaxNode.h" #include "MaxMain/plMaxNode.h"
#include "MaxConvert/hsControlConverter.h" #include "MaxConvert/hsControlConverter.h"
#include "MaxPlasmaMtls/Materials/plPassMtlBase.h"
#include "pnKeyedObject/plUoid.h" #include "pnKeyedObject/plUoid.h"
#include "plMaxAnimUtils.h" #include "plMaxAnimUtils.h"
@ -140,35 +139,6 @@ plAnimObjInterface *plAnimComponentBase::GetAnimInterface( INode *inode )
return nil; return nil;
} }
//This enum is necessary and can only be appended.
//This is used in the ParamBlock2Desc.
enum
{
kAnimRadio_DEAD,
kAnimAutoStart, // Start the Animation on load (V2)
kAnimLoop, // Start Looping at Begin Location
kAnimBegin_DEAD,
kAnimEnd_DEAD,
kAnimLoopSegCkBx_DEAD,
kAnimLoopSegBeg_DEAD,
kAnimLoopSegEnd_DEAD,
kAnimName, // Name of the notetrack animation to play
kAnimLoopSegBegBox_DEAD,
kAnimLoopSegEndBox_DEAD,
kAnimUseGlobal,
kAnimGlobalName,
kAnimLoopName, // Name of the notetrack specified loop
kAnimEaseInType,
kAnimEaseOutType,
kAnimEaseInLength,
kAnimEaseOutLength,
kAnimEaseInMin,
kAnimEaseInMax,
kAnimEaseOutMin,
kAnimEaseOutMax,
kAnimPhysAnim,
};
void plAnimComponentProc::EnableGlobal(HWND hWnd, hsBool enable) void plAnimComponentProc::EnableGlobal(HWND hWnd, hsBool enable)
{ {
ComboBox_Enable(GetDlgItem(hWnd, IDC_ANIM_GLOBAL_LIST), enable); ComboBox_Enable(GetDlgItem(hWnd, IDC_ANIM_GLOBAL_LIST), enable);
@ -178,7 +148,7 @@ void plAnimComponentProc::EnableGlobal(HWND hWnd, hsBool enable)
Button_Enable(GetDlgItem(hWnd, IDC_COMP_ANIM_LOOP_CKBX), !enable); Button_Enable(GetDlgItem(hWnd, IDC_COMP_ANIM_LOOP_CKBX), !enable);
} }
void plAnimComponentProc::FillAgeGlobalComboBox(HWND box, char *varName) void plAnimComponentProc::FillAgeGlobalComboBox(HWND box, const char *varName)
{ {
plStateDescriptor *sd = plSDLMgr::GetInstance()->FindDescriptor(plPageInfoComponent::GetCurrExportAgeName(), plSDL::kLatestVersion); plStateDescriptor *sd = plSDLMgr::GetInstance()->FindDescriptor(plPageInfoComponent::GetCurrExportAgeName(), plSDL::kLatestVersion);
if (sd) if (sd)
@ -199,7 +169,7 @@ void plAnimComponentProc::FillAgeGlobalComboBox(HWND box, char *varName)
ComboBox_AddString(box, "(none)"); ComboBox_AddString(box, "(none)");
} }
void plAnimComponentProc::SetBoxToAgeGlobal(HWND box, char *varName) void plAnimComponentProc::SetBoxToAgeGlobal(HWND box, const char *varName)
{ {
char buff[512]; char buff[512];
if (!varName || !strcmp(varName, "")) if (!varName || !strcmp(varName, ""))
@ -412,9 +382,6 @@ public:
} }
}; };
*/ */
static plEaseAccessor gAnimCompEaseAccessor(plComponentBase::kBlkComp,
kAnimEaseInMin, kAnimEaseInMax, kAnimEaseInLength,
kAnimEaseOutMin, kAnimEaseOutMax, kAnimEaseOutLength);
CLASS_DESC(plAnimComponent, gAnimDesc, "Animation", "Animation", COMP_TYPE_MISC, ANIM_COMP_CID) CLASS_DESC(plAnimComponent, gAnimDesc, "Animation", "Animation", COMP_TYPE_MISC, ANIM_COMP_CID)
CLASS_DESC(plAnimGroupedComponent, gAnimGroupedDesc, "Animation Grouped", "AnimGrouped", COMP_TYPE_MISC, ANIM_GROUP_COMP_CID) CLASS_DESC(plAnimGroupedComponent, gAnimGroupedDesc, "Animation Grouped", "AnimGrouped", COMP_TYPE_MISC, ANIM_GROUP_COMP_CID)
@ -734,14 +701,14 @@ hsBool plAnimComponentBase::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
// we've added all keys during convert. Some cleanup might // we've added all keys during convert. Some cleanup might
// be necessary in this case. // be necessary in this case.
char *animName = fCompPB->GetStr(kAnimName); const char *animName = fCompPB->GetStr(kAnimName);
if (animName == nil || !strcmp(animName, "")) if (animName == nil || !strcmp(animName, ""))
animName = ENTIRE_ANIMATION_NAME; animName = ENTIRE_ANIMATION_NAME;
if (fCompPB->GetInt(ParamID(kAnimUseGlobal))) if (fCompPB->GetInt(ParamID(kAnimUseGlobal)))
{ {
plAgeGlobalAnim *ageAnim = TRACKED_NEW plAgeGlobalAnim(animName, 0, 0); plAgeGlobalAnim *ageAnim = TRACKED_NEW plAgeGlobalAnim(animName, 0, 0);
ageAnim->SetGlobalVarName(fCompPB->GetStr(ParamID(kAnimGlobalName))); ageAnim->SetGlobalVarName((char*)fCompPB->GetStr(ParamID(kAnimGlobalName)));
fAnims[node] = ageAnim; fAnims[node] = ageAnim;
} }
@ -765,7 +732,7 @@ hsBool plAnimComponentBase::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg)
if (fCompPB->GetInt(kAnimLoop)) if (fCompPB->GetInt(kAnimLoop))
{ {
ATCAnim->SetLoop(true); ATCAnim->SetLoop(true);
char *loopName = fCompPB->GetStr(kAnimLoopName); const char *loopName = fCompPB->GetStr(kAnimLoopName);
hsScalar loopStart = info.GetLoopStart(loopName); hsScalar loopStart = info.GetLoopStart(loopName);
hsScalar loopEnd = info.GetLoopEnd(loopName); hsScalar loopEnd = info.GetLoopEnd(loopName);
@ -926,7 +893,7 @@ hsBool plAnimComponentBase::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
if (fCompPB->GetInt(ParamID(kAnimUseGlobal))) if (fCompPB->GetInt(ParamID(kAnimUseGlobal)))
{ {
((plAgeGlobalAnim *)fAnims[node])->SetGlobalVarName(fCompPB->GetStr(ParamID(kAnimGlobalName))); ((plAgeGlobalAnim *)fAnims[node])->SetGlobalVarName((char*)fCompPB->GetStr(ParamID(kAnimGlobalName)));
} }
else // It's an ATCAnim else // It's an ATCAnim
{ {

38
Sources/Tools/MaxComponent/plAnimComponent.h

@ -33,11 +33,45 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsTemplates.h" #include "hsTemplates.h"
#include "plAnimObjInterface.h" #include "plAnimObjInterface.h"
#include "plNoteTrackDlgComp.h" #include "plNoteTrackDlgComp.h"
#include "MaxPlasmaMtls/Materials/plPassMtlBase.h"
#define ANIM_COMP_CID Class_ID(0x32e77ab, 0x28a80383) #define ANIM_COMP_CID Class_ID(0x32e77ab, 0x28a80383)
#define ANIM_GROUP_COMP_CID Class_ID(0x341a57fc, 0x4cda6c64) #define ANIM_GROUP_COMP_CID Class_ID(0x341a57fc, 0x4cda6c64)
#define ANIM_COMPRESS_COMP_CID Class_ID(0x116d3175, 0x4e465807) #define ANIM_COMPRESS_COMP_CID Class_ID(0x116d3175, 0x4e465807)
//This enum is necessary and can only be appended.
//This is used in the ParamBlock2Desc.
enum
{
kAnimRadio_DEAD,
kAnimAutoStart, // Start the Animation on load (V2)
kAnimLoop, // Start Looping at Begin Location
kAnimBegin_DEAD,
kAnimEnd_DEAD,
kAnimLoopSegCkBx_DEAD,
kAnimLoopSegBeg_DEAD,
kAnimLoopSegEnd_DEAD,
kAnimName, // Name of the notetrack animation to play
kAnimLoopSegBegBox_DEAD,
kAnimLoopSegEndBox_DEAD,
kAnimUseGlobal,
kAnimGlobalName,
kAnimLoopName, // Name of the notetrack specified loop
kAnimEaseInType,
kAnimEaseOutType,
kAnimEaseInLength,
kAnimEaseOutLength,
kAnimEaseInMin,
kAnimEaseInMax,
kAnimEaseOutMin,
kAnimEaseOutMax,
kAnimPhysAnim,
};
static plEaseAccessor gAnimCompEaseAccessor(plComponentBase::kBlkComp,
kAnimEaseInMin, kAnimEaseInMax, kAnimEaseInLength,
kAnimEaseOutMin, kAnimEaseOutMax, kAnimEaseOutLength);
class plComponentBase; class plComponentBase;
class plMaxNode; class plMaxNode;
class plSimpleTMModifier; class plSimpleTMModifier;
@ -163,8 +197,8 @@ protected:
void EnableGlobal(HWND hWnd, hsBool enable); void EnableGlobal(HWND hWnd, hsBool enable);
public: public:
static void FillAgeGlobalComboBox(HWND box, char *varName); static void FillAgeGlobalComboBox(HWND box, const char *varName);
static void SetBoxToAgeGlobal(HWND box, char *varName); static void SetBoxToAgeGlobal(HWND box, const char *varName);
virtual 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);
virtual void Update(TimeValue t, Interval &valid, IParamMap2 *map); virtual void Update(TimeValue t, Interval &valid, IParamMap2 *map);

61
Sources/Tools/MaxComponent/plAudioComponents.cpp

@ -66,7 +66,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// Sound Related // Sound Related
#include "plPhysical/plEnvEffectDetector.h" #include "plPhysical/plEnvEffectDetector.h"
#include "pnMessage/plEnvEffectMsg.h" #include "pnMessage/plEnvEffectMsg.h"
#include "PubUtilLib/plAudible/plWinAudible.h" #include "plAudible/plWinAudible.h"
#include "pnSceneObject/plAudioInterface.h" #include "pnSceneObject/plAudioInterface.h"
// Anim Related // Anim Related
@ -80,7 +80,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plFile/plFileUtils.h" #include "plFile/plFileUtils.h"
// Valdez Asset Manager Related // Valdez Asset Manager Related
#ifdef MAXASS_AVAILABLE
#include "../../AssetMan/PublicInterface/MaxAssInterface.h" #include "../../AssetMan/PublicInterface/MaxAssInterface.h"
#endif
#include <shlwapi.h> #include <shlwapi.h>
// Fun soft volume stuff // Fun soft volume stuff
@ -93,8 +95,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// EAX stuff // EAX stuff
#include "plAudio/plEAXListenerMod.h" #include "plAudio/plEAXListenerMod.h"
#ifdef EAX_SDK_AVAILABLE
#include <eax-util.h> #include <eax-util.h>
#include <eaxlegacy.h> #include <eaxlegacy.h>
#endif
#include "plResMgr/plLocalization.h" #include "plResMgr/plLocalization.h"
#include "plPhysical/plPhysicalSndGroup.h" #include "plPhysical/plPhysicalSndGroup.h"
@ -242,8 +246,10 @@ RefTargetHandle plBaseSoundEmitterComponent::Clone( RemapDir &remap )
// Do the base clone // Do the base clone
plBaseSoundEmitterComponent *obj = (plBaseSoundEmitterComponent *)plComponentBase::Clone( remap ); plBaseSoundEmitterComponent *obj = (plBaseSoundEmitterComponent *)plComponentBase::Clone( remap );
#ifdef MAXASS_AVAILABLE
obj->fSoundAssetId = fSoundAssetId; obj->fSoundAssetId = fSoundAssetId;
obj->fCoverSoundAssetID = fCoverSoundAssetID; obj->fCoverSoundAssetID = fCoverSoundAssetID;
#endif
return obj; return obj;
} }
@ -285,6 +291,7 @@ IOResult plBaseSoundEmitterComponent::Save(ISave *isave)
if (res != IO_OK) if (res != IO_OK)
return res; return res;
#ifdef MAXASS_AVAILABLE
isave->BeginChunk(MAX_ASS_CHUNK); isave->BeginChunk(MAX_ASS_CHUNK);
ULONG nwrite; ULONG nwrite;
@ -299,6 +306,7 @@ IOResult plBaseSoundEmitterComponent::Save(ISave *isave)
return res; return res;
isave->EndChunk(); isave->EndChunk();
#endif
return IO_OK; return IO_OK;
} }
@ -309,6 +317,7 @@ IOResult plBaseSoundEmitterComponent::Load(ILoad *iload)
if (res != IO_OK) if (res != IO_OK)
return res; return res;
#ifdef MAXASS_AVAILABLE
while (IO_OK == (res = iload->OpenChunk())) while (IO_OK == (res = iload->OpenChunk()))
{ {
if (iload->CurChunkID() == OLD_MAX_ASS_CHUNK) if (iload->CurChunkID() == OLD_MAX_ASS_CHUNK)
@ -332,10 +341,12 @@ IOResult plBaseSoundEmitterComponent::Load(ILoad *iload)
if (res != IO_OK) if (res != IO_OK)
return res; return res;
} }
#endif
return IO_OK; return IO_OK;
} }
#ifdef MAXASS_AVAILABLE
void plBaseSoundEmitterComponent::SetSoundAssetId( plBaseSoundEmitterComponent::WhichSound which, jvUniqueId assetId, const TCHAR *fileName ) void plBaseSoundEmitterComponent::SetSoundAssetId( plBaseSoundEmitterComponent::WhichSound which, jvUniqueId assetId, const TCHAR *fileName )
{ {
if( which == kBaseSound ) if( which == kBaseSound )
@ -362,9 +373,11 @@ jvUniqueId plBaseSoundEmitterComponent::GetSoundAssetID( plBaseSoundEmitterCompo
hsAssert( false, "Getting a sound that isn't supported on this component" ); hsAssert( false, "Getting a sound that isn't supported on this component" );
return fSoundAssetId; return fSoundAssetId;
} }
#endif
void plBaseSoundEmitterComponent::IUpdateAssets( void ) void plBaseSoundEmitterComponent::IUpdateAssets( void )
{ {
#ifdef MAXASS_AVAILABLE
if( fAssetsUpdated ) if( fAssetsUpdated )
return; return;
@ -386,9 +399,10 @@ void plBaseSoundEmitterComponent::IUpdateAssets( void )
} }
else else
fAssetsUpdated = true; fAssetsUpdated = true;
#endif
} }
TCHAR *plBaseSoundEmitterComponent::GetSoundFileName( plBaseSoundEmitterComponent::WhichSound which ) const char* plBaseSoundEmitterComponent::GetSoundFileName( plBaseSoundEmitterComponent::WhichSound which )
{ {
IUpdateAssets(); IUpdateAssets();
@ -671,6 +685,7 @@ plSoundBuffer *plBaseSoundEmitterComponent::IGetSourceBuffer( const char *file
// copied over to the AssetMan directory, returning the path to said asset. // copied over to the AssetMan directory, returning the path to said asset.
// Returns true if found, false if not. // Returns true if found, false if not.
#ifdef MAXASS_AVAILABLE
hsBool plBaseSoundEmitterComponent::LookupLatestAsset( const char *waveName, char *retPath, plErrorMsg *errMsg ) hsBool plBaseSoundEmitterComponent::LookupLatestAsset( const char *waveName, char *retPath, plErrorMsg *errMsg )
{ {
MaxAssInterface* assetMan = GetMaxAssInterface(); MaxAssInterface* assetMan = GetMaxAssInterface();
@ -698,10 +713,11 @@ hsBool plBaseSoundEmitterComponent::LookupLatestAsset( const char *waveName, ch
return false; return false;
} }
#endif
plSoundBuffer *plBaseSoundEmitterComponent::IProcessSourceBuffer( plMaxNode *maxNode, plErrorMsg *errMsg ) plSoundBuffer *plBaseSoundEmitterComponent::IProcessSourceBuffer( plMaxNode *maxNode, plErrorMsg *errMsg )
{ {
char *fileName = GetSoundFileName( kBaseSound ); const char *fileName = GetSoundFileName( kBaseSound );
if( fileName == nil ) if( fileName == nil )
return nil; return nil;
@ -999,34 +1015,35 @@ protected:
void IGetNewLocalFileName( plBaseSoundEmitterComponent *soundComponent, plBaseSoundEmitterComponent::WhichSound which ) void IGetNewLocalFileName( plBaseSoundEmitterComponent *soundComponent, plBaseSoundEmitterComponent::WhichSound which )
{ {
TCHAR fileName[ MAX_PATH ], dirName[ MAX_PATH ], *name; char* fileName[ MAX_PATH ], dirName[ MAX_PATH ];
const char* name = soundComponent->GetSoundFileName( which );
name = soundComponent->GetSoundFileName( which );
if( name != nil ) if( name != nil )
strcpy( fileName, name ); strcpy( (char*)fileName, name );
else else
strcpy( fileName, _T( "" ) ); strcpy( (char*)fileName, _T( "" ) );
strcpy( dirName, fileName ); strcpy( dirName, (const char*)fileName );
::PathRemoveFileSpec( dirName ); ::PathRemoveFileSpec( dirName );
OPENFILENAME ofn = {0}; OPENFILENAME ofn = {0};
ofn.lStructSize = sizeof( OPENFILENAME ); ofn.lStructSize = sizeof( OPENFILENAME );
ofn.hwndOwner = GetCOREInterface()->GetMAXHWnd(); ofn.hwndOwner = GetCOREInterface()->GetMAXHWnd();
ofn.lpstrFilter = "WAV Files (*.wav)\0*.wav\0Windows Media Audio Files (*.wma)\0*.wma\0OGG Vorbis Files (*.ogg)\0*.ogg\0"; ofn.lpstrFilter = "WAV Files (*.wav)\0*.wav\0Windows Media Audio Files (*.wma)\0*.wma\0OGG Vorbis Files (*.ogg)\0*.ogg\0";
ofn.lpstrFile = fileName; ofn.lpstrFile = (LPSTR)fileName;
ofn.nMaxFile = sizeof( fileName ); ofn.nMaxFile = sizeof( fileName );
ofn.lpstrInitialDir = dirName; ofn.lpstrInitialDir = dirName;
ofn.lpstrTitle = "Choose a sound file"; ofn.lpstrTitle = "Choose a sound file";
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST; ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_PATHMUSTEXIST;
ofn.lpstrDefExt = "wav"; ofn.lpstrDefExt = "wav";
#ifdef MAXASS_AVAILABLE
if( GetOpenFileName( &ofn ) ) if( GetOpenFileName( &ofn ) )
{ {
jvUniqueId emptyId; jvUniqueId emptyId;
soundComponent->SetSoundAssetId( which, emptyId, fileName ); soundComponent->SetSoundAssetId( which, emptyId, fileName );
} }
#endif
} }
void IUpdateSoundButton( plBaseSoundEmitterComponent *soundComponent, HWND hDlg, int dlgBtnItemToSet, plBaseSoundEmitterComponent::WhichSound which ) void IUpdateSoundButton( plBaseSoundEmitterComponent *soundComponent, HWND hDlg, int dlgBtnItemToSet, plBaseSoundEmitterComponent::WhichSound which )
@ -1038,7 +1055,7 @@ protected:
custButton = GetICustButton( GetDlgItem( hDlg, dlgBtnItemToSet ) ); custButton = GetICustButton( GetDlgItem( hDlg, dlgBtnItemToSet ) );
if( custButton != nil ) if( custButton != nil )
{ {
TCHAR *origName = soundComponent->GetSoundFileName( which ); const char* origName = soundComponent->GetSoundFileName( which );
if( origName != nil && strlen( origName ) > 0 ) if( origName != nil && strlen( origName ) > 0 )
{ {
@ -1057,6 +1074,7 @@ protected:
void ISelectSoundFile( plBaseSoundEmitterComponent *soundComponent, HWND hDlg, int dlgBtnItemToSet, plBaseSoundEmitterComponent::WhichSound which ) void ISelectSoundFile( plBaseSoundEmitterComponent *soundComponent, HWND hDlg, int dlgBtnItemToSet, plBaseSoundEmitterComponent::WhichSound which )
{ {
#ifdef MAXASS_AVAILABLE
MaxAssInterface* maxAssInterface = GetMaxAssInterface(); MaxAssInterface* maxAssInterface = GetMaxAssInterface();
// if we have the assetman plug-in, then try to use it, unless shift is held down // if we have the assetman plug-in, then try to use it, unless shift is held down
@ -1075,6 +1093,9 @@ protected:
{ {
IGetNewLocalFileName( soundComponent, which ); IGetNewLocalFileName( soundComponent, which );
} }
#else
IGetNewLocalFileName( soundComponent, which );
#endif
// Update the button now // Update the button now
if( hDlg != nil ) if( hDlg != nil )
@ -2135,7 +2156,7 @@ hsBool plSound3DEmitterComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
if( fCreateGrouped ) if( fCreateGrouped )
return true; return true;
char* fileName = GetSoundFileName( kBaseSound ); const char* fileName = GetSoundFileName( kBaseSound );
int fIndex = -1; int fIndex = -1;
if (fIndices.find(node) != fIndices.end()) if (fIndices.find(node) != fIndices.end())
@ -2219,7 +2240,7 @@ hsBool plSound3DEmitterComponent::ConvertGrouped( plMaxNode *baseNode, hsTArray
} }
// Grab the buffer for this sound directly from the original source // Grab the buffer for this sound directly from the original source
char *fileName = groupArray[ i ]->GetSoundFileName( kBaseSound ); const char *fileName = groupArray[ i ]->GetSoundFileName( kBaseSound );
plSoundBuffer *buffer = TRACKED_NEW plSoundBuffer( fileName ); plSoundBuffer *buffer = TRACKED_NEW plSoundBuffer( fileName );
if( !buffer->IsValid() || !buffer->EnsureInternal() ) if( !buffer->IsValid() || !buffer->EnsureInternal() )
@ -2230,11 +2251,11 @@ hsBool plSound3DEmitterComponent::ConvertGrouped( plMaxNode *baseNode, hsTArray
bool worked = false; bool worked = false;
if( plasmaDir != nil ) if( plasmaDir != nil )
{ {
char newPath[ MAX_PATH ], *c; char newPath[ MAX_PATH ];
strcpy( newPath, plasmaDir ); strcpy( newPath, plasmaDir );
strcat( newPath, "sfx\\" ); strcat( newPath, "sfx\\" );
c = strrchr( fileName, '\\' ); const char* c = strrchr( fileName, '\\' );
if( c == nil ) if( c == nil )
c = strrchr( fileName, '/' ); c = strrchr( fileName, '/' );
if( c == nil ) if( c == nil )
@ -2459,7 +2480,7 @@ hsBool plBackgroundMusicComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
if (!fValidNodes[node]) if (!fValidNodes[node])
return false; return false;
char* fileName = GetSoundFileName( kBaseSound ); const char* fileName = GetSoundFileName( kBaseSound );
int fIndex = -1; int fIndex = -1;
if (fIndices.find(node) != fIndices.end()) if (fIndices.find(node) != fIndices.end())
@ -2614,7 +2635,7 @@ hsBool plGUISoundComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg)
if (!fValidNodes[node]) if (!fValidNodes[node])
return false; return false;
char* fileName = GetSoundFileName( kBaseSound ); const char* fileName = GetSoundFileName( kBaseSound );
int fIndex = -1; int fIndex = -1;
if (fIndices.find(node) != fIndices.end()) if (fIndices.find(node) != fIndices.end())
@ -2790,9 +2811,11 @@ public:
HWND comboBox = GetDlgItem( hWnd, IDC_EAX_PRESET_COMBO ); HWND comboBox = GetDlgItem( hWnd, IDC_EAX_PRESET_COMBO );
ComboBox_ResetContent( comboBox ); ComboBox_ResetContent( comboBox );
#ifdef EAX_SDK_AVAILABLE
for( i = 0; i < /*sizeof( EAX30_ORIGINAL_PRESETS ) for( i = 0; i < /*sizeof( EAX30_ORIGINAL_PRESETS )
/ sizeof( EAXLISTENERPROPERTIES )*/26 ; i++ ) / sizeof( EAXLISTENERPROPERTIES )*/26 ; i++ )
ComboBox_AddString( comboBox, EAX30_ORIGINAL_PRESET_NAMES[ i ] ); ComboBox_AddString( comboBox, EAX30_ORIGINAL_PRESET_NAMES[ i ] );
#endif
ComboBox_SetCurSel( comboBox, pb->GetInt( (ParamID)plEAXListenerComponent::kRefPreset ) ); ComboBox_SetCurSel( comboBox, pb->GetInt( (ParamID)plEAXListenerComponent::kRefPreset ) );
@ -2927,6 +2950,7 @@ hsBool plEAXListenerComponent::Convert(plMaxNode *node, plErrorMsg *errMsg)
// Add the soft region // Add the soft region
hsgResMgr::ResMgr()->AddViaNotify( softKey, TRACKED_NEW plGenRefMsg( listener->GetKey(), plRefMsg::kOnCreate, 0, plEAXListenerMod::kRefSoftRegion ), plRefFlags::kActiveRef ); hsgResMgr::ResMgr()->AddViaNotify( softKey, TRACKED_NEW plGenRefMsg( listener->GetKey(), plRefMsg::kOnCreate, 0, plEAXListenerMod::kRefSoftRegion ), plRefFlags::kActiveRef );
#ifdef EAX_SDK_AVAILABLE
// Set up the parameters of the listener mod // Set up the parameters of the listener mod
EAXLISTENERPROPERTIES *listenerProps = listener->GetListenerProps(); EAXLISTENERPROPERTIES *listenerProps = listener->GetListenerProps();
if( fCompPB->GetInt( (ParamID)kRefWhichSettings ) == 0 ) if( fCompPB->GetInt( (ParamID)kRefWhichSettings ) == 0 )
@ -2961,6 +2985,7 @@ hsBool plEAXListenerComponent::Convert(plMaxNode *node, plErrorMsg *errMsg)
listenerProps->flRoomRolloffFactor = fCompPB->GetFloat( (ParamID)kRefRoomRolloffFactor ); listenerProps->flRoomRolloffFactor = fCompPB->GetFloat( (ParamID)kRefRoomRolloffFactor );
listenerProps->ulFlags = fCompPB->GetInt( (ParamID)kRefFlags ); listenerProps->ulFlags = fCompPB->GetInt( (ParamID)kRefFlags );
} }
#endif
return true; return true;
} }
@ -3132,7 +3157,7 @@ enum
kRandomSoundGroup, kRandomSoundGroup,
}; };
static const kMaxGroups = 10; static const int kMaxGroups = 10;
class plRandomSoundComponentProc : public ParamMap2UserDlgProc class plRandomSoundComponentProc : public ParamMap2UserDlgProc
{ {

8
Sources/Tools/MaxComponent/plAudioComponents.h

@ -31,7 +31,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define SOUND_PHYS_COMP_ID Class_ID(0x29415900, 0x1ade37a5) #define SOUND_PHYS_COMP_ID Class_ID(0x29415900, 0x1ade37a5)
#include "pnKeyedObject/plKey.h" #include "pnKeyedObject/plKey.h"
#ifdef MAXASS_AVAILABLE
#include "../../AssetMan/PublicInterface/AssManBaseTypes.h" #include "../../AssetMan/PublicInterface/AssManBaseTypes.h"
#endif
#include "hsTemplates.h" #include "hsTemplates.h"
class plComponentBase; class plComponentBase;
@ -67,9 +69,11 @@ class plBaseSoundEmitterComponent : public plComponent
kCoverSound kCoverSound
}; };
#ifdef MAXASS_AVAILABLE
virtual void SetSoundAssetId( WhichSound which, jvUniqueId assetId, const TCHAR *fileName ); virtual void SetSoundAssetId( WhichSound which, jvUniqueId assetId, const TCHAR *fileName );
virtual jvUniqueId GetSoundAssetID( WhichSound which ); virtual jvUniqueId GetSoundAssetID( WhichSound which );
virtual TCHAR *GetSoundFileName( WhichSound which ); #endif
virtual const char* GetSoundFileName( WhichSound which );
// Internal setup and write-only set properties on the MaxNode. No reading // Internal setup and write-only set properties on the MaxNode. No reading
// of properties on the MaxNode, as it's still indeterminant. // of properties on the MaxNode, as it's still indeterminant.
@ -111,8 +115,10 @@ class plBaseSoundEmitterComponent : public plComponent
virtual hsScalar GetSoundVolume( void ) const; virtual hsScalar GetSoundVolume( void ) const;
protected: protected:
#ifdef MAXASS_AVAILABLE
jvUniqueId fSoundAssetId; // used for the AssMan jvUniqueId fSoundAssetId; // used for the AssMan
jvUniqueId fCoverSoundAssetID; jvUniqueId fCoverSoundAssetID;
#endif
hsBool fAssetsUpdated; hsBool fAssetsUpdated;
friend class plAudioBaseComponentProc; friend class plAudioBaseComponentProc;

2
Sources/Tools/MaxComponent/plAvatarComponent.cpp

@ -640,7 +640,7 @@ static AvatarCompDlgProc gAvatarCompDlgProc;
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////
class plCompoundCtrlComponent : plComponent class plCompoundCtrlComponent : public plComponent
{ {
public: public:
plCompoundCtrlComponent(); plCompoundCtrlComponent();

1
Sources/Tools/MaxComponent/plCAnimParamBlock.cpp

@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plCAnimParamBlock.h" #include "plCAnimParamBlock.h"
#include "plInterp/plAnimEaseTypes.h" #include "plInterp/plAnimEaseTypes.h"
#include "MaxPlasmaMtls/Materials/plPassMtlBase.h"
#include "plAnimComponent.h" #include "plAnimComponent.h"
#include "resource.h" #include "resource.h"

16
Sources/Tools/MaxComponent/plComponentBase.cpp

@ -300,14 +300,18 @@ plMaxNodeBase *plComponentBase::GetINode()
{ {
// Go through the reflist looking for RefMakers with a ref to this component. // Go through the reflist looking for RefMakers with a ref to this component.
// There should only be one INode in this list. // There should only be one INode in this list.
RefList &refList = GetRefList(); DependentIterator di(this);
RefListItem *item = refList.FirstItem(); ReferenceMaker* rm = di.Next();
while (item) while (rm != nil)
{ {
if (item->maker->SuperClassID() == BASENODE_CLASS_ID) for (int i = 0; i < rm->NumRefs(); i++)
return (plMaxNodeBase*)item->maker; {
RefTargetHandle h = rm->GetReference(i);
if (h->SuperClassID() == BASENODE_CLASS_ID)
return (plMaxNodeBase*)h;
}
item = item->next; rm = di.Next();
} }
return nil; return nil;

10
Sources/Tools/MaxComponent/plComponentMgr.cpp

@ -88,16 +88,16 @@ int IDescCompare(ClassDesc *desc1, ClassDesc *desc2);
void plComponentMgr::Register(ClassDesc *desc) void plComponentMgr::Register(ClassDesc *desc)
{ {
// Organize desc's by category and name // Organize desc's by category and name
for (unsigned int i = 0; i < fDescs.size(); i++)
std::vector<ClassDesc*>::iterator it;
for (it = fDescs.begin(); it != fDescs.end(); it++)
{ {
if (IDescCompare(desc, fDescs[i]) < 0) if (IDescCompare(desc, (*it)) < 0)
{ {
fDescs.insert(&fDescs[i], desc); fDescs.insert(it, desc);
return; return;
} }
} }
fDescs.push_back(desc);
} }
int IDescCompare(ClassDesc *desc1, ClassDesc *desc2) int IDescCompare(ClassDesc *desc1, ClassDesc *desc2)

6
Sources/Tools/MaxComponent/plGUIComponents.cpp

@ -1189,14 +1189,14 @@ hsBool plGUIDialogComponent::SetupProperties(plMaxNode *node, plErrorMsg *pErrM
/// Either way, we mangle our own location component. None of this user-defined-location stuff. /// Either way, we mangle our own location component. None of this user-defined-location stuff.
char *dialogName = fCompPB->GetStr( kRefDialogName ); const char *dialogName = fCompPB->GetStr( kRefDialogName );
if( dialogName == nil || *dialogName == 0 ) if( dialogName == nil || *dialogName == 0 )
{ {
pErrMsg->Set(true, "GUI Dialog Component Error", "No dialog name specified on GUI Dialog component (object: %s)", node->GetName()).Show(); pErrMsg->Set(true, "GUI Dialog Component Error", "No dialog name specified on GUI Dialog component (object: %s)", node->GetName()).Show();
return false; return false;
} }
char *ageName = fCompPB->GetStr(kRefAgeName); const char *ageName = fCompPB->GetStr(kRefAgeName);
Int32 seqNum = plPageInfoUtils::GetSeqNumFromAgeDesc( ageName, dialogName ); Int32 seqNum = plPageInfoUtils::GetSeqNumFromAgeDesc( ageName, dialogName );
Int32 newNum = plPluginResManager::ResMgr()->VerifySeqNumber( seqNum, ageName, dialogName ); Int32 newNum = plPluginResManager::ResMgr()->VerifySeqNumber( seqNum, ageName, dialogName );
if( newNum != seqNum ) if( newNum != seqNum )
@ -1425,7 +1425,7 @@ void plGUIDialogProc::ILoadPages( HWND hWnd, IParamBlock2 *pb )
return; return;
plAgePage *page; plAgePage *page;
char *selPageName = pb->GetStr( plGUIDialogComponent::kRefDialogName ); const char *selPageName = pb->GetStr( plGUIDialogComponent::kRefDialogName );
aged->SeekFirstPage(); aged->SeekFirstPage();
ComboBox_ResetContent( hWnd ); ComboBox_ResetContent( hWnd );

16
Sources/Tools/MaxComponent/plMiscComponents.cpp

@ -28,7 +28,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "resource.h" #include "resource.h"
#include "plMiscComponents.h" #include "plMiscComponents.h"
#include "plComponentReg.h" #include "plComponentReg.h"
#ifdef MAXASS_AVAILABLE
#include "../../AssetMan/PublicInterface/MaxAssInterface.h" #include "../../AssetMan/PublicInterface/MaxAssInterface.h"
#endif
#include "MaxMain/plPlasmaRefMsgs.h" #include "MaxMain/plPlasmaRefMsgs.h"
#include "MaxMain/plMaxNodeData.h" #include "MaxMain/plMaxNodeData.h"
@ -368,8 +370,8 @@ hsBool plPageInfoComponent::SetupProperties(plMaxNode *pNode, plErrorMsg *pErrMs
if (pNode->GetRoomKey()) if (pNode->GetRoomKey())
return false; return false;
char *age = fCompPB->GetStr(kInfoAge); const char *age = fCompPB->GetStr(kInfoAge);
char *room = fCompPB->GetStr(kInfoPage); const char *room = fCompPB->GetStr(kInfoPage);
if (!age || *age == '\0' || !room || *room == '\0') if (!age || *age == '\0' || !room || *room == '\0')
{ {
@ -539,7 +541,7 @@ hsBool plPageInfoComponent::DeInit(plMaxNode *node, plErrorMsg *pErrMsg)
return true; return true;
} }
char *plPageInfoComponent::GetAgeName() const char *plPageInfoComponent::GetAgeName()
{ {
return fCompPB->GetStr(ParamID(kInfoAge)); return fCompPB->GetStr(ParamID(kInfoAge));
} }
@ -550,6 +552,7 @@ char *plPageInfoComponent::GetAgeName()
void plPageInfoComponent::IVerifyLatestAgeAsset( const char *ageName, const char *localPath, plErrorMsg *errMsg ) void plPageInfoComponent::IVerifyLatestAgeAsset( const char *ageName, const char *localPath, plErrorMsg *errMsg )
{ {
#ifdef MAXASS_AVAILABLE
char ageFileName[ MAX_PATH ], assetPath[ MAX_PATH ]; char ageFileName[ MAX_PATH ], assetPath[ MAX_PATH ];
@ -579,6 +582,7 @@ void plPageInfoComponent::IVerifyLatestAgeAsset( const char *ageName, const c
{ {
// Not found, so just assume it's a local one (no error) // Not found, so just assume it's a local one (no error)
} }
#endif
} }
//// IUpdateSeqNumbersFromAgeFile //////////////////////////////////////////// //// IUpdateSeqNumbersFromAgeFile ////////////////////////////////////////////
@ -812,7 +816,7 @@ const char* LocCompGetPage(plComponentBase* comp)
return nil; return nil;
} }
static char *CheckPageInfoCompsRecur(plMaxNode *node) static const char *CheckPageInfoCompsRecur(plMaxNode *node)
{ {
plComponentBase *comp = node->ConvertToComponent(); plComponentBase *comp = node->ConvertToComponent();
if (comp && comp->ClassID() == PAGEINFO_CID) if (comp && comp->ClassID() == PAGEINFO_CID)
@ -823,7 +827,7 @@ static char *CheckPageInfoCompsRecur(plMaxNode *node)
for (int i = 0; i < node->NumberOfChildren(); i++) for (int i = 0; i < node->NumberOfChildren(); i++)
{ {
char *result = CheckPageInfoCompsRecur((plMaxNode*)node->GetChildNode(i)); const char *result = CheckPageInfoCompsRecur((plMaxNode*)node->GetChildNode(i));
if (result) if (result)
return result; return result;
} }
@ -834,7 +838,7 @@ void plPageInfoComponent::NotifyProc(void *param, NotifyInfo *info)
{ {
if (info->intcode == NOTIFY_FILE_POST_OPEN) if (info->intcode == NOTIFY_FILE_POST_OPEN)
{ {
char *ageName = CheckPageInfoCompsRecur((plMaxNode*)GetCOREInterface()->GetRootNode()); const char *ageName = CheckPageInfoCompsRecur((plMaxNode*)GetCOREInterface()->GetRootNode());
if (ageName != nil) if (ageName != nil)
strncpy( fCurrExportedAge, ageName, sizeof( fCurrExportedAge ) ); strncpy( fCurrExportedAge, ageName, sizeof( fCurrExportedAge ) );
} }

2
Sources/Tools/MaxComponent/plMiscComponents.h

@ -71,7 +71,7 @@ public:
virtual hsBool SetupProperties(plMaxNode *pNode, plErrorMsg *pErrMsg); virtual hsBool SetupProperties(plMaxNode *pNode, plErrorMsg *pErrMsg);
virtual hsBool Convert(plMaxNode *node, plErrorMsg *pErrMsg); virtual hsBool Convert(plMaxNode *node, plErrorMsg *pErrMsg);
virtual hsBool DeInit(plMaxNode *node, plErrorMsg *pErrMsg); virtual hsBool DeInit(plMaxNode *node, plErrorMsg *pErrMsg);
char *GetAgeName(); const char *GetAgeName();
hsBool GetItinerant() {return fItinerant; } hsBool GetItinerant() {return fItinerant; }
enum enum

62
Sources/Tools/MaxComponent/plResponderAnim.cpp

@ -52,12 +52,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
enum enum
{ {
kAnimComp, kRespAnimComp,
kAnimLoop, kRespAnimLoop,
kAnimType, kRespAnimType,
kAnimOwner, kRespAnimOwner,
kAnimObject, kRespAnimObject,
kAnimObjectType, kRespAnimObjectType,
}; };
class plResponderAnimProc; class plResponderAnimProc;
@ -69,19 +69,19 @@ ParamBlockDesc2 gResponderAnimBlock
IDD_COMP_RESPOND_ANIM, IDS_COMP_CMD_PARAMS, 0, 0, &gResponderAnimProc, IDD_COMP_RESPOND_ANIM, IDS_COMP_CMD_PARAMS, 0, 0, &gResponderAnimProc,
kAnimComp, _T("comp"), TYPE_REFTARG, 0, 0, kRespAnimComp, _T("comp"), TYPE_REFTARG, 0, 0,
end, end,
kAnimObject, _T("object"), TYPE_REFTARG, 0, 0, kRespAnimObject, _T("object"), TYPE_REFTARG, 0, 0,
end, end,
kAnimLoop, _T("loop"), TYPE_STRING, 0, 0, kRespAnimLoop, _T("loop"), TYPE_STRING, 0, 0,
end, end,
kAnimType, _T("type"), TYPE_INT, 0, 0, kRespAnimType, _T("type"), TYPE_INT, 0, 0,
end, end,
kAnimObjectType, _T("objType"), TYPE_INT, 0, 0, kRespAnimObjectType, _T("objType"), TYPE_INT, 0, 0,
end, end,
end end
@ -270,8 +270,8 @@ const char *plResponderCmdAnim::GetInstanceName(IParamBlock2 *pb)
{ {
static char name[256]; static char name[256];
const char *shortName = GetShortName(pb->GetInt(kAnimType)); const char *shortName = GetShortName(pb->GetInt(kRespAnimType));
plMaxNode *node = (plMaxNode*)pb->GetReferenceTarget(kAnimComp); plMaxNode *node = (plMaxNode*)pb->GetReferenceTarget(kRespAnimComp);
sprintf(name, "%s (%s)", shortName, node ? node->GetName() : "none"); sprintf(name, "%s (%s)", shortName, node ? node->GetName() : "none");
return name; return name;
@ -297,14 +297,14 @@ IParamBlock2 *plResponderCmdAnim::CreatePB(int idx)
// Create the paramblock and save it's type // Create the paramblock and save it's type
IParamBlock2 *pb = CreateParameterBlock2(&gResponderAnimBlock, nil); IParamBlock2 *pb = CreateParameterBlock2(&gResponderAnimBlock, nil);
pb->SetValue(kAnimType, 0, type); pb->SetValue(kRespAnimType, 0, type);
return pb; return pb;
} }
plComponentBase *plResponderCmdAnim::GetComponent(IParamBlock2 *pb) plComponentBase *plResponderCmdAnim::GetComponent(IParamBlock2 *pb)
{ {
plMaxNode *node = (plMaxNode*)pb->GetReferenceTarget(kAnimComp); plMaxNode *node = (plMaxNode*)pb->GetReferenceTarget(kRespAnimComp);
if (node) if (node)
return node->ConvertToComponent(); return node->ConvertToComponent();
else else
@ -313,7 +313,7 @@ plComponentBase *plResponderCmdAnim::GetComponent(IParamBlock2 *pb)
plMessage *plResponderCmdAnim::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb) plMessage *plResponderCmdAnim::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb)
{ {
if (IsSoundMsg(pb->GetInt(kAnimType))) if (IsSoundMsg(pb->GetInt(kRespAnimType)))
return ICreateSndMsg(node, pErrMsg, pb); return ICreateSndMsg(node, pErrMsg, pb);
else else
return ICreateAnimMsg(node, pErrMsg, pb); return ICreateAnimMsg(node, pErrMsg, pb);
@ -321,7 +321,7 @@ plMessage *plResponderCmdAnim::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, I
bool GetCompAndNode(IParamBlock2* pb, plMaxNode* node, plComponentBase*& comp, plMaxNode*& targNode) bool GetCompAndNode(IParamBlock2* pb, plMaxNode* node, plComponentBase*& comp, plMaxNode*& targNode)
{ {
plMaxNode *compNode = (plMaxNode*)pb->GetReferenceTarget(kAnimComp); plMaxNode *compNode = (plMaxNode*)pb->GetReferenceTarget(kRespAnimComp);
if (!compNode) if (!compNode)
return false; return false;
@ -331,10 +331,10 @@ bool GetCompAndNode(IParamBlock2* pb, plMaxNode* node, plComponentBase*& comp, p
if (comp->ClassID() == ANIM_GROUP_COMP_CID) if (comp->ClassID() == ANIM_GROUP_COMP_CID)
return true; return true;
if (pb->GetInt(kAnimObjectType) == kNodeResponder) if (pb->GetInt(kRespAnimObjectType) == kNodeResponder)
targNode = node; targNode = node;
else else
targNode = (plMaxNode*)pb->GetReferenceTarget(kAnimObject); targNode = (plMaxNode*)pb->GetReferenceTarget(kRespAnimObject);
if (!targNode) if (!targNode)
return false; return false;
@ -364,7 +364,7 @@ plMessage *plResponderCmdAnim::ICreateAnimMsg(plMaxNode* node, plErrorMsg *pErrM
msg->SetAnimName(tempAnimName); msg->SetAnimName(tempAnimName);
// Create and initialize a message for the command // Create and initialize a message for the command
switch (pb->GetInt(kAnimType)) switch (pb->GetInt(kRespAnimType))
{ {
case kRespondPlayAnim: case kRespondPlayAnim:
msg->SetCmd(plAnimCmdMsg::kContinue); msg->SetCmd(plAnimCmdMsg::kContinue);
@ -417,7 +417,7 @@ plMessage* plResponderCmdAnim::ICreateSndMsg(plMaxNode* node, plErrorMsg *pErrMs
if (!GetCompAndNode(pb, node, comp, targNode)) if (!GetCompAndNode(pb, node, comp, targNode))
throw "A valid sound component and node were not found"; throw "A valid sound component and node were not found";
int type = pb->GetInt(kAnimType); int type = pb->GetInt(kRespAnimType);
switch (type) switch (type)
{ {
case kRespondPlaySound: case kRespondPlaySound:
@ -487,7 +487,7 @@ plMessage* plResponderCmdAnim::ICreateSndMsg(plMaxNode* node, plErrorMsg *pErrMs
bool plResponderCmdAnim::IsWaitable(IParamBlock2 *pb) bool plResponderCmdAnim::IsWaitable(IParamBlock2 *pb)
{ {
int type = pb->GetInt(kAnimType); int type = pb->GetInt(kRespAnimType);
if (type == kRespondPlayAnim || if (type == kRespondPlayAnim ||
type == kRespondToggleAnim || type == kRespondToggleAnim ||
type == kRespondStopAnim || type == kRespondStopAnim ||
@ -501,7 +501,7 @@ bool plResponderCmdAnim::IsWaitable(IParamBlock2 *pb)
void plResponderCmdAnim::GetWaitPoints(IParamBlock2 *pb, WaitPoints& waitPoints) void plResponderCmdAnim::GetWaitPoints(IParamBlock2 *pb, WaitPoints& waitPoints)
{ {
int type = pb->GetInt(kAnimType); int type = pb->GetInt(kRespAnimType);
// Don't try and get points for the stop anim, it can only stop at a stop point // Don't try and get points for the stop anim, it can only stop at a stop point
if (type == kRespondStopAnim || IsSoundMsg(type)) if (type == kRespondStopAnim || IsSoundMsg(type))
@ -579,9 +579,9 @@ static plResponderAnimProc gResponderAnimProc;
plResponderAnimProc::plResponderAnimProc() plResponderAnimProc::plResponderAnimProc()
{ {
fCompButtonID = IDC_ANIM_BUTTON; fCompButtonID = IDC_ANIM_BUTTON;
fCompParamID = kAnimComp; fCompParamID = kRespAnimComp;
fNodeButtonID = IDC_OBJ_BUTTON; fNodeButtonID = IDC_OBJ_BUTTON;
fNodeParamID = kAnimObject; fNodeParamID = kRespAnimObject;
} }
BOOL plResponderAnimProc::DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) BOOL plResponderAnimProc::DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
@ -592,7 +592,7 @@ BOOL plResponderAnimProc::DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT m
{ {
IParamBlock2 *pb = pm->GetParamBlock(); IParamBlock2 *pb = pm->GetParamBlock();
int type = pb->GetInt(kAnimType); int type = pb->GetInt(kRespAnimType);
// Only show the loop control if this is a loop command // Only show the loop control if this is a loop command
int show = (type == kRespondLoopAnimOn) ? SW_SHOW : SW_HIDE; int show = (type == kRespondLoopAnimOn) ? SW_SHOW : SW_HIDE;
@ -647,7 +647,7 @@ void plResponderAnimProc::IPickComponent(IParamBlock2* pb)
{ {
std::vector<Class_ID> cids; std::vector<Class_ID> cids;
int type = pb->GetInt(kAnimType); int type = pb->GetInt(kRespAnimType);
if (type == kRespondPlaySound || if (type == kRespondPlaySound ||
type == kRespondStopSound || type == kRespondStopSound ||
type == kRespondToggleSound || type == kRespondToggleSound ||
@ -670,7 +670,7 @@ void plResponderAnimProc::IPickComponent(IParamBlock2* pb)
cids.push_back(ANIM_GROUP_COMP_CID); cids.push_back(ANIM_GROUP_COMP_CID);
} }
plPick::NodeRefKludge(pb, kAnimComp, &cids, true, false); plPick::NodeRefKludge(pb, kRespAnimComp, &cids, true, false);
} }
#include "plPickNodeBase.h" #include "plPickNodeBase.h"
@ -711,7 +711,7 @@ public:
void plResponderAnimProc::IPickNode(IParamBlock2* pb, plComponentBase* comp) void plResponderAnimProc::IPickNode(IParamBlock2* pb, plComponentBase* comp)
{ {
plPickRespNode pick(pb, kAnimObject, kAnimObjectType, comp); plPickRespNode pick(pb, kRespAnimObject, kRespAnimObjectType, comp);
pick.DoPick(); pick.DoPick();
} }
@ -720,7 +720,7 @@ void plResponderAnimProc::IPickNode(IParamBlock2* pb, plComponentBase* comp)
void plResponderAnimProc::ILoadUser(HWND hWnd, IParamBlock2 *pb) void plResponderAnimProc::ILoadUser(HWND hWnd, IParamBlock2 *pb)
{ {
// Premptive strike. If this isn't a loop, don't bother! // Premptive strike. If this isn't a loop, don't bother!
int type = pb->GetInt(kAnimType); int type = pb->GetInt(kRespAnimType);
if (type != kRespondLoopAnimOn) if (type != kRespondLoopAnimOn)
return; return;
@ -764,7 +764,7 @@ void plResponderAnimProc::ILoadUser(HWND hWnd, IParamBlock2 *pb)
void plResponderAnimProc::IUpdateNodeButton(HWND hWnd, IParamBlock2* pb) void plResponderAnimProc::IUpdateNodeButton(HWND hWnd, IParamBlock2* pb)
{ {
if (pb->GetInt(kAnimObjectType) == kNodeResponder) if (pb->GetInt(kRespAnimObjectType) == kNodeResponder)
{ {
HWND hButton = GetDlgItem(hWnd, IDC_OBJ_BUTTON); HWND hButton = GetDlgItem(hWnd, IDC_OBJ_BUTTON);
SetWindowText(hButton, kResponderNodeName); SetWindowText(hButton, kResponderNodeName);

7
Sources/Tools/MaxComponent/plResponderComponent.cpp

@ -949,13 +949,16 @@ public:
return oldTarg; return oldTarg;
} }
void PatchPointer(RefTargetHandle* patchThis, RefTargetHandle oldTarg) { hsAssert(0, "shit"); }
RefTargetHandle FindMapping(RefTargetHandle from) { hsAssert(0, "shit"); return NULL; } RefTargetHandle FindMapping(RefTargetHandle from) { hsAssert(0, "shit"); return NULL; }
void PatchPointer(RefTargetHandle* patchThis, RefTargetHandle oldTarg) { hsAssert(0, "shit"); }
void AddPostPatchProc(PostPatchProc* proc, bool toDelete) { hsAssert(0, "shit"); }
void AddEntry(RefTargetHandle hfrom, RefTargetHandle hto) { hsAssert(0, "shit"); } void AddEntry(RefTargetHandle hfrom, RefTargetHandle hto) { hsAssert(0, "shit"); }
void Backpatch() { hsAssert(0, "shit"); } void Backpatch() { hsAssert(0, "shit"); }
bool BackpatchPending() { hsAssert(0, "shit"); return false; }
void Clear() { hsAssert(0, "shit"); } void Clear() { hsAssert(0, "shit"); }
void ClearBackpatch() { hsAssert(0, "shit"); }
void DeleteThis() { hsAssert(0, "shit"); } void DeleteThis() { hsAssert(0, "shit"); }
void AddPostPatchProc(PostPatchProc* proc, bool toDelete) { hsAssert(0, "shit"); }
}; };
// Even turdier - I had to define this to compile // Even turdier - I had to define this to compile
RefTargetHandle RemapDir::CloneRef(RefTargetHandle oldTarg) { return NULL; } RefTargetHandle RemapDir::CloneRef(RefTargetHandle oldTarg) { return NULL; }

5
Sources/Tools/MaxComponent/resource.h

@ -1891,8 +1891,3 @@
#define _APS_NEXT_SYMED_VALUE 101 #define _APS_NEXT_SYMED_VALUE 101
#endif #endif
#endif #endif
// Hack -- don't ask.
#if(WINVER < 0x0500)
#define IDC_HAND IDC_CROSS
#endif

2
Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h

@ -328,7 +328,7 @@ public:
// plug-in mouse creation callback // plug-in mouse creation callback
CreateMouseCallBack* GetCreateMouseCallBack(); CreateMouseCallBack* GetCreateMouseCallBack();
RefTargetHandle Clone(RemapDir &remap = NoRemap()){ plRTLightBase* thisObj = TRACKED_NEW plRTLightBase(); BaseClone(this, thisObj, remap); return thisObj;} RefTargetHandle Clone(RemapDir &remap = DefaultRemapDir()){ plRTLightBase* thisObj = TRACKED_NEW plRTLightBase(); BaseClone(this, thisObj, remap); return thisObj;}
virtual void BeginEditParams(IObjParam *ip, ULONG flags, Animatable *prev); virtual void BeginEditParams(IObjParam *ip, ULONG flags, Animatable *prev);
virtual void EndEditParams(IObjParam *ip, ULONG flags, Animatable *next); virtual void EndEditParams(IObjParam *ip, ULONG flags, Animatable *next);

Loading…
Cancel
Save