diff --git a/Sources/Tools/MaxComponent/pfGUISkinComp.cpp b/Sources/Tools/MaxComponent/pfGUISkinComp.cpp index afe1e0b1..b8229805 100644 --- a/Sources/Tools/MaxComponent/pfGUISkinComp.cpp +++ b/Sources/Tools/MaxComponent/pfGUISkinComp.cpp @@ -32,6 +32,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plGUICompClassIDs.h" #include "MaxMain/plMaxNodeBase.h" +#include "MaxMain/MaxCompat.h" pfGUISkinEditProc *pfGUISkinEditProc::fInstance = nil; @@ -173,7 +174,7 @@ void pfGUISkinEditProc::IRefreshImageBuffer( void ) bi.SetHeight( fDblHeight ); newBM = TheManager->Create( &bi ); - BMM_Color_64 foo(0, 0, 0, 0 ); + BMM_Color_64 foo = BMMCOLOR(0, 0, 0, 0); newBM->CopyImage( pbBMap->bm, COPY_IMAGE_RESIZE_LO_QUALITY, foo, nil ); // Now copy from our newly created bitmap into our DC....way slow :( diff --git a/Sources/Tools/MaxComponent/plResponderLink.cpp b/Sources/Tools/MaxComponent/plResponderLink.cpp index 10870484..5099cd56 100644 --- a/Sources/Tools/MaxComponent/plResponderLink.cpp +++ b/Sources/Tools/MaxComponent/plResponderLink.cpp @@ -149,9 +149,9 @@ void plResponderCmdLink::SetupProperties(plMaxNode* node, plErrorMsg* pErrMsg, I { // set default title, or make same as name. if ( strcmp( spawnPtName, kDefaultSpawnPtName )==0 ) - pb->SetValue( kLinkAgeSpawnPointTitle, 0, kDefaultSpawnPtTitle ); + pb->SetValue( kLinkAgeSpawnPointTitle, 0, _T(kDefaultSpawnPtTitle)); else - pb->SetValue( kLinkAgeSpawnPointTitle, 0, spawnPtName ); + pb->SetValue( kLinkAgeSpawnPointTitle, 0, (TCHAR*)_T(spawnPtName)); } } } diff --git a/Sources/Tools/MaxComponent/plResponderWait.cpp b/Sources/Tools/MaxComponent/plResponderWait.cpp index 6ff7aa24..cedff94a 100644 --- a/Sources/Tools/MaxComponent/plResponderWait.cpp +++ b/Sources/Tools/MaxComponent/plResponderWait.cpp @@ -28,6 +28,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plResponderComponentPriv.h" #include "resource.h" #include "plModifier/plResponderModifier.h" +#include "MaxMain/MaxCompat.h" #include "plResponderLink.h" @@ -81,8 +82,8 @@ void ResponderWait::FixupWaitBlock(IParamBlock2 *waitPB) if (waitPB->Count(kWaitPointOld) > 0) { - const char* point = waitPB->GetStr(kWaitPointOld, 0, 0); - waitPB->SetValue(kWaitPoint, 0, point); + MCHAR* point = (MCHAR*)waitPB->GetStr(kWaitPointOld, 0, 0); + waitPB->SetValue(kWaitPoint, 0, _T(point)); waitPB->Delete(kWaitPointOld, 0, 1); } } diff --git a/Sources/Tools/MaxConvert/hsConverterUtils.cpp b/Sources/Tools/MaxConvert/hsConverterUtils.cpp index e643cb72..419d5baf 100644 --- a/Sources/Tools/MaxConvert/hsConverterUtils.cpp +++ b/Sources/Tools/MaxConvert/hsConverterUtils.cpp @@ -27,6 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsConverterUtils.h" #include "hsResMgr.h" +#include "MaxMain/MaxCompat.h" #if HS_BUILD_FOR_WIN32 @@ -419,7 +420,7 @@ hsBool hsConverterUtils::IsInstanced(Object* maxObject) } ObjectInstancedEnumProc instProc; - maxObject->DoEnumDependents(&instProc); + ENUMDEPENDENTS(maxObject, &instProc); return (instProc.GetInstanceCount() > 1); hsGuardEnd; diff --git a/Sources/Tools/MaxConvert/hsMaterialConverter.cpp b/Sources/Tools/MaxConvert/hsMaterialConverter.cpp index 73b23353..1c3c94e8 100644 --- a/Sources/Tools/MaxConvert/hsMaterialConverter.cpp +++ b/Sources/Tools/MaxConvert/hsMaterialConverter.cpp @@ -51,6 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsConverterUtils.h" #include "hsControlConverter.h" #include "MaxMain/plMaxNode.h" +#include "MaxMain/MaxCompat.h" #include "plInterp/plController.h" #include "hsExceptionStack.h" @@ -3932,7 +3933,7 @@ hsBool hsMaterialConverter::IClearDoneMaterial(Mtl* mtl, plMaxNode* node) #define VIEW_BK 5 -static BMM_Color_64 green64 = BMM_Color_64(0, (1<<16)-1, 0, (1<<16)-1); +static BMM_Color_64 green64 = BMMCOLOR(0, (1<<16)-1, 0, (1<<16)-1) BMM_Color_64 hsMaterialConverter::ICubeSample(Bitmap *bitmap[6], double phi, double theta) { diff --git a/Sources/Tools/MaxMain/CMakeLists.txt b/Sources/Tools/MaxMain/CMakeLists.txt index 13eb4014..daeb663e 100644 --- a/Sources/Tools/MaxMain/CMakeLists.txt +++ b/Sources/Tools/MaxMain/CMakeLists.txt @@ -16,6 +16,7 @@ set(MaxMain_HEADERS GlobalUtility.h main.def MaxAllocDll.h + MaxCompat.h plActionTableMgr.h plAgeDescInterface.h plCommonObjLib.h diff --git a/Sources/Tools/MaxMain/MaxCompat.h b/Sources/Tools/MaxMain/MaxCompat.h new file mode 100644 index 00000000..467db148 --- /dev/null +++ b/Sources/Tools/MaxMain/MaxCompat.h @@ -0,0 +1,57 @@ +/*==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 . + +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==*/ + +/* AUTHOR: Adam Johnson + * DATE: April 16, 2011 + * SUMMARY: Cool helpers that let us target MANY versions of 3ds Max + */ + +#ifndef _PLASMA_MAXCOMPAT_H +#define _PLASMA_MAXCOMPAT_H + +#include "maxversion.h" + +#if MAX_VERSION_MAJOR <= 9 +#define BMMCOLOR(x, y, z, w) \ + {x, y, x, w}; + +#define DEFAULTREMAP NoRemap() + +#define ENUMDEPENDENTS(maxObject, proc) \ + maxObject->EnumDependents(proc); + +typedef TCHAR MCHAR; +#else +#define BMMCOLOR(x, y, z, w) \ + BMM_Color_64(x, y, z, w); + +#define DEFAULTREMAP DefaultRemapDir() + +#define ENUMDEPENDENTS(maxObject, proc) \ + maxObject->DoEnumDependents(proc); +#endif //MAX_VERSION_MAJOR + +#endif // _PLASMA_MAXCOMPAT_H \ No newline at end of file diff --git a/Sources/Tools/MaxMain/main.cpp b/Sources/Tools/MaxMain/main.cpp index 9329c531..abc4eb86 100644 --- a/Sources/Tools/MaxMain/main.cpp +++ b/Sources/Tools/MaxMain/main.cpp @@ -32,6 +32,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "MaxExport/SimpleExport.h" +#include "MaxMain/MaxCompat.h" #include "MaxComponent/plComponentMgr.h" #include "MaxPlasmaMtls/plMtlImport.h" @@ -211,10 +212,10 @@ public: SClass_ID SuperClassID() {return CUST_ATTRIB_CLASS_ID;} Class_ID ClassID() {return fClassDesc->ClassID();} - ReferenceTarget *Clone(RemapDir &remap = DefaultRemapDir()); + ReferenceTarget *Clone(RemapDir &remap = DEFAULTREMAP); virtual bool CheckCopyAttribTo(ICustAttribContainer *to) { return true; } - const char* GetName() { return (TCHAR*)fClassDesc->ClassName(); } + const TCHAR* GetName() { return (const TCHAR*)_T(fClassDesc->ClassName()); } void DeleteThis() { delete this; } }; diff --git a/Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h b/Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h index 3746327c..a569aed2 100644 --- a/Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h +++ b/Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h @@ -34,6 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // Our generic headers #include "hsTypes.h" #include "MaxPlasmaMtls/Layers/plLayerTex.h" +#include "MaxMain/MaxCompat.h" extern TCHAR *GetString(int id); @@ -328,7 +329,7 @@ public: // plug-in mouse creation callback CreateMouseCallBack* GetCreateMouseCallBack(); - RefTargetHandle Clone(RemapDir &remap = DefaultRemapDir()){ plRTLightBase* thisObj = TRACKED_NEW plRTLightBase(); BaseClone(this, thisObj, remap); return thisObj;} + RefTargetHandle Clone(RemapDir &remap = DEFAULTREMAP){ plRTLightBase* thisObj = TRACKED_NEW plRTLightBase(); BaseClone(this, thisObj, remap); return thisObj;} virtual void BeginEditParams(IObjParam *ip, ULONG flags, Animatable *prev); virtual void EndEditParams(IObjParam *ip, ULONG flags, Animatable *next); diff --git a/Sources/Tools/MaxPlasmaLights/target.h b/Sources/Tools/MaxPlasmaLights/target.h index 39b0c7c4..656cd1a8 100644 --- a/Sources/Tools/MaxPlasmaLights/target.h +++ b/Sources/Tools/MaxPlasmaLights/target.h @@ -97,7 +97,7 @@ class TargetObject: public GeomObject { WPARAM wParam, LPARAM lParam ){return(0);} // From ref.h - RefTargetHandle Clone(RemapDir& remap = DefaultRemapDir()); + RefTargetHandle Clone(RemapDir& remap = DEFAULTREMAP); // IO IOResult Save(ISave *isave); diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp b/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp index 312c9672..773e2b7a 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp @@ -39,6 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "MaxComponent/plMaxAnimUtils.h" #include "MaxComponent/plPickNodeBase.h" +#include "MaxMain/MaxCompat.h" #include "iparamm2.h" @@ -454,11 +455,9 @@ hsBool plAnimStealthNode::IsParentUsedInScene( void ) } // Enum dependents - int i; - plGetRefs callback; - GetParentMtl()->DoEnumDependents( &callback ); - for( i = 0; i < callback.fList.GetCount(); i++ ) + ENUMDEPENDENTS(GetParentMtl(), &callback); + for(int i = 0; i < callback.fList.GetCount(); i++ ) { ReferenceMaker *maker = callback.fList[ i ];