Browse Source

Fix some stupid stuff that would have crashed the plugin...

Adam Johnson 13 years ago
parent
commit
205105ef23
  1. 8
      Sources/Tools/MaxComponent/plAudioComponents.cpp
  2. 8
      Sources/Tools/MaxComponent/plComponentBase.cpp
  3. 16
      Sources/Tools/MaxConvert/hsMaterialConverter.cpp
  4. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtlBasicPBDec.h
  5. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plCompositeMtlDlg.cpp
  6. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtl.cpp
  7. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtlBasicPBDec.h
  8. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plNoteTrackWatcher.cpp
  9. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plParticleMtl.cpp
  10. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBase.cpp
  11. 2
      Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBasicPBDec.h

8
Sources/Tools/MaxComponent/plAudioComponents.cpp

@ -1015,15 +1015,15 @@ protected:
void IGetNewLocalFileName( plBaseSoundEmitterComponent *soundComponent, plBaseSoundEmitterComponent::WhichSound which ) void IGetNewLocalFileName( plBaseSoundEmitterComponent *soundComponent, plBaseSoundEmitterComponent::WhichSound which )
{ {
char* fileName[ MAX_PATH ], dirName[ MAX_PATH ]; char fileName[ MAX_PATH ], dirName[ MAX_PATH ];
const char* name = soundComponent->GetSoundFileName( which ); const char* name = soundComponent->GetSoundFileName( which );
if( name != nil ) if( name != nil )
strcpy( (char*)fileName, name ); strcpy( fileName, name );
else else
strcpy( (char*)fileName, _T( "" ) ); strcpy( fileName, _T( "" ) );
strcpy( dirName, (const char*)fileName ); strcpy( dirName, fileName );
::PathRemoveFileSpec( dirName ); ::PathRemoveFileSpec( dirName );
OPENFILENAME ofn = {0}; OPENFILENAME ofn = {0};

8
Sources/Tools/MaxComponent/plComponentBase.cpp

@ -304,12 +304,8 @@ plMaxNodeBase *plComponentBase::GetINode()
ReferenceMaker* rm = di.Next(); ReferenceMaker* rm = di.Next();
while (rm != nil) while (rm != nil)
{ {
for (int i = 0; i < rm->NumRefs(); i++) if (rm->SuperClassID() == BASENODE_CLASS_ID)
{ return (plMaxNodeBase*)rm;
RefTargetHandle h = rm->GetReference(i);
if (h->SuperClassID() == BASENODE_CLASS_ID)
return (plMaxNodeBase*)h;
}
rm = di.Next(); rm = di.Next();
} }

16
Sources/Tools/MaxConvert/hsMaterialConverter.cpp

@ -4470,19 +4470,15 @@ static void GetMtlNodes(Mtl *mtl, INodeTab& nodes)
ReferenceMaker *rm = di.Next(); ReferenceMaker *rm = di.Next();
while (rm != nil) while (rm != nil)
{ {
for (int i = 0; i < rm->NumRefs(); i++) if (rm->SuperClassID() == BASENODE_CLASS_ID)
{ {
RefTargetHandle item = rm->GetReference(i); INode *node = (INode*)rm;
if (item->SuperClassID() == BASENODE_CLASS_ID) if (node->GetMtl() == mtl)
{ nodes.Append(1, &node);
INode *node = (INode*)item;
if (node->GetMtl() == mtl)
nodes.Append(1, &node);
}
} }
rm = di.Next();
} }
rm = di.Next();
} }
int hsMaterialConverter::GetMaterialArray(Mtl *mtl, hsTArray<hsGMaterial*>& out, UInt32 multiIndex /* = 0 */) int hsMaterialConverter::GetMaterialArray(Mtl *mtl, hsTArray<hsGMaterial*>& out, UInt32 multiIndex /* = 0 */)

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

@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include "plBumpMtl.h" #include "plBumpMtl.h"
#include "plBumpMtlBasicPB.h" #include "plBumpMtlBasicPB.h"
#include "resource.h" #include "../resource.h"
#include "iparamm2.h" #include "iparamm2.h"
class BumpBasicDlgProc; class BumpBasicDlgProc;

2
Sources/Tools/MaxPlasmaMtls/Materials/plCompositeMtlDlg.cpp

@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "max.h" #include "max.h"
#include "MaxIcon.h" #include "MaxIcon.h"
#include "resource.h" #include "../resource.h"
#include "plCompositeMtl.h" #include "plCompositeMtl.h"
//#include "plCompositeMtlPB.h" //#include "plCompositeMtlPB.h"
//#include "plMaxLayer.h" //#include "plMaxLayer.h"

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

@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plDecalMtl.h" #include "plDecalMtl.h"
#include "../resource.h" #include "../resource.h"
//extern ClassDesc2* GetMaxLayerDesc(); //extern ClassDesc2* GetMaxLayerDesc();
#include "Shaders.h" #include "../Shaders.h"
#include "MaxComponent/plMaxAnimUtils.h" #include "MaxComponent/plMaxAnimUtils.h"
#include "plPassBaseParamIDs.h" #include "plPassBaseParamIDs.h"

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

@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include "plDecalMtl.h" #include "plDecalMtl.h"
#include "plDecalMtlBasicPB.h" #include "plDecalMtlBasicPB.h"
#include "resource.h" #include "../resource.h"
#include "iparamm2.h" #include "iparamm2.h"
class DecalBasicPBAccessor; class DecalBasicPBAccessor;

2
Sources/Tools/MaxPlasmaMtls/Materials/plNoteTrackWatcher.cpp

@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
plNoteTrackWatcher::plNoteTrackWatcher( plPassMtlBase *parentMtl ) : fParentMtl(nil) plNoteTrackWatcher::plNoteTrackWatcher( plPassMtlBase *parentMtl ) : fParentMtl(nil)
{ {
fNoteTrackCount = parentMtl->NumNoteTracks(); fNoteTrackCount = parentMtl->NumNoteTracks();
MakeRefByID( FOREVER, kRefParentMtl, parentMtl ); ReplaceReference(kRefParentMtl, parentMtl);
} }
plNoteTrackWatcher::~plNoteTrackWatcher() plNoteTrackWatcher::~plNoteTrackWatcher()

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

@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plParticleMtl.h" #include "plParticleMtl.h"
#include "../resource.h" #include "../resource.h"
//extern ClassDesc2* GetMaxLayerDesc(); //extern ClassDesc2* GetMaxLayerDesc();
#include "Shaders.h" #include "../Shaders.h"
#include "iparamm2.h" #include "iparamm2.h"

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

@ -333,7 +333,7 @@ void plPassMtlBase::NoteTrackAdded( void )
if( fNotetracks.Find( track ) == fNotetracks.kMissingIndex ) if( fNotetracks.Find( track ) == fNotetracks.kMissingIndex )
{ {
MakeRefByID( FOREVER, kRefNotetracks + fNotetracks.GetCount(), track ); ReplaceReference(kRefNotetracks + fNotetracks.GetCount(), track);
break; break;
} }
} }

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

@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include "plPassMtl.h" #include "plPassMtl.h"
#include "plPassMtlBasicPB.h" #include "plPassMtlBasicPB.h"
#include "resource.h" #include "../resource.h"
#include "iparamm2.h" #include "iparamm2.h"
class PassBasicPBAccessor; class PassBasicPBAccessor;

Loading…
Cancel
Save