diff --git a/Sources/Tools/MaxPlasmaLights/CMakeLists.txt b/Sources/Tools/MaxPlasmaLights/CMakeLists.txt index bc2c5a08..d9a86b9c 100644 --- a/Sources/Tools/MaxPlasmaLights/CMakeLists.txt +++ b/Sources/Tools/MaxPlasmaLights/CMakeLists.txt @@ -10,15 +10,11 @@ set(MaxPlasmaLights_HEADERS plRealTimeLightBase.h plRealTimeLights.h plRealTimeLightsPBDec.h - plRTLightBaseAnimDlgProc.h - plRTLightBaseAnimPBDec.h plRTObjLightDesc.h plRTPlasmaLights.def plRTProjDirLight.h plRTProjDirLightClassDesc.h plRTProjDirLightPBDec.h - prim.h - target.h ) set(MaxPlasmaLights_RESOURCES @@ -35,6 +31,7 @@ set(MaxPlasmaLights_SOURCES ) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Plasma_BINARY_DIR}/bin) +use_precompiled_header(Pch.h Pch.cpp MaxPlasmaLights_HEADERS MaxPlasmaLights_SOURCES) add_library(MaxPlasmaLights SHARED ${MaxPlasmaLights_HEADERS} ${MaxPlasmaLights_RESOURCES} ${MaxPlasmaLights_SOURCES}) set_target_properties(MaxPlasmaLights PROPERTIES SUFFIX ".dlo") diff --git a/Sources/Tools/MaxPlasmaLights/DLLEntry.cpp b/Sources/Tools/MaxPlasmaLights/DLLEntry.cpp index 6643b08d..741b77e3 100644 --- a/Sources/Tools/MaxPlasmaLights/DLLEntry.cpp +++ b/Sources/Tools/MaxPlasmaLights/DLLEntry.cpp @@ -39,18 +39,20 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ + #include "HeadSpin.h" -#include "plRealTimeLightBase.h" + #include "plRealTimeLights.h" -#include "plRTProjDirLightClassDesc.h" +#include "MaxMain/MaxCompat.h" +#pragma hdrstop #include "pnMessage/pnMessageCreatable.h" #include "pnKeyedObject/pnKeyedObjectCreatable.h" #include "pnNetCommon/pnNetCommonCreatable.h" -#include "MaxMain/MaxCompat.h" - +#include "plRTProjDirLightClassDesc.h" #include "plSurface/plLayerInterface.h" + REGISTER_NONCREATABLE( plLayerInterface ); diff --git a/Sources/Tools/MaxPlasmaLights/Pch.cpp b/Sources/Tools/MaxPlasmaLights/Pch.cpp new file mode 100644 index 00000000..52b0cac9 --- /dev/null +++ b/Sources/Tools/MaxPlasmaLights/Pch.cpp @@ -0,0 +1,51 @@ +/*==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 . + +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 "Pch.h" + +/** + * \file Pch.cpp + * \brief Precompiled Header object for MaxPlasmaLights + * + * This file prompts MSVC to generate a PCH file for the MaxPlasmaLights project. It + * has no function if precompiled headers are disabled in cmake. + */ diff --git a/Sources/Tools/MaxPlasmaLights/Pch.h b/Sources/Tools/MaxPlasmaLights/Pch.h new file mode 100644 index 00000000..62fb1039 --- /dev/null +++ b/Sources/Tools/MaxPlasmaLights/Pch.h @@ -0,0 +1,69 @@ +/*==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 . + +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 _MaxPlasmaLights_Pch_inc_ +#define _MaxPlasmaLights_Pch_inc_ + +/** + * \file Pch.h + * \brief Precompiled Header for MaxPlasmaLights + */ + +// Core Plasma +#include "HeadSpin.h" + +// Windows +#include "hsWindows.h" + +// Base MaxPlasmaLights stuff... +#include "plRealTimeLightBase.h" +#include "plRealTimeLights.h" + +// Max SDK +#include +#include + +// Utility +#include "MaxMain/MaxCompat.h" +#include "resource.h" + +#endif // _MaxPlasmaLights_Pch_inc_ \ No newline at end of file diff --git a/Sources/Tools/MaxPlasmaLights/plRTLightBaseAnimDlgProc.h b/Sources/Tools/MaxPlasmaLights/plRTLightBaseAnimDlgProc.h deleted file mode 100644 index b2558113..00000000 --- a/Sources/Tools/MaxPlasmaLights/plRTLightBaseAnimDlgProc.h +++ /dev/null @@ -1,86 +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 . - -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==*/ -/////////////////////////////////////////////////////////////////////////////// -// // -// Animation Rollout Dialog Proc Class Definition // -// Cyan, Inc. // -// // -//// Version History ////////////////////////////////////////////////////////// -// // -// 8.6.2001 mcn - Created. // -// // -/////////////////////////////////////////////////////////////////////////////// - -#if 0//ndef _plRTLightBaseAnimDlgProc_h -#define _plRTLightBaseAnimDlgProc_h - -#include "plNotetrackDlg.h" - -/////////////////////////////////////////////////////////////////////////////// -//// Dialog Proc for Animation Rollout //////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -class plRTLightBaseAnimDlgProc : public ParamMap2UserDlgProc -{ - protected: - plNoteTrackDlg fNoteTrackDlg; - - HWND fhWnd; - - static plRTLightBaseAnimDlgProc fInstance; - static const char *kDecalNameNone; - - public: - BOOL DlgProc( TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ); - void DeleteThis() { fNoteTrackDlg.DeleteCache(); } - void SetThing( ReferenceTarget *m ); - - static plRTLightBaseAnimDlgProc *Instance() { return &fInstance; } - - protected: - void IInitControls( Animatable *anim, IParamBlock2 *pb ); - -}; - - -#endif //_plRTLightBaseAnimDlgProc_h - diff --git a/Sources/Tools/MaxPlasmaLights/plRTLightBaseAnimPBDec.h b/Sources/Tools/MaxPlasmaLights/plRTLightBaseAnimPBDec.h deleted file mode 100644 index 2bdd1e66..00000000 --- a/Sources/Tools/MaxPlasmaLights/plRTLightBaseAnimPBDec.h +++ /dev/null @@ -1,84 +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 . - -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==*/ -/////////////////////////////////////////////////////////////////////////////// -// // -// Animation Rollout ParamBlock for Runtime Lights // -// Cyan, Inc. // -// // -//// Version History ////////////////////////////////////////////////////////// -// // -// 8.3.2001 mcn - Created. // -// // -/////////////////////////////////////////////////////////////////////////////// - -#if 0//ndef _plRTLightBaseAnimPB_h -#define _plRTLightBaseAnimPB_h - -/////////////////////////////////////////////////////////////////////////////// -//// Animation Rollout ParamBlock ///////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////// - -ParamBlockDesc2 plRTLightBaseAnimPB -( - plRTLightBase::kBlkAnim, _T("anim"), IDS_LIGHT_ANIM, nil, // To be added manually - P_AUTO_CONSTRUCT + P_AUTO_UI, plRTLightBase::kRefAnimParams, - - // UI - IDD_LIGHT_ANIM, IDS_LIGHT_ANIM, 0, APPENDROLL_CLOSED, plRTLightBaseAnimDlgProc::Instance(), - - plRTLightBase::kAnimName, _T("animName"), TYPE_STRING, 0, 0, - end, - - plRTLightBase::kAnimAutoStart, _T("autoStart"), TYPE_BOOL, 0, 0, - end, - - plRTLightBase::kAnimLoop, _T("loop"), TYPE_BOOL, 0, 0, - end, - plRTLightBase::kAnimLoopName, _T("loopName"), TYPE_STRING, 0, 0, - end, - - end -); - - -#endif //_plRTLightBaseAnimPB_h - diff --git a/Sources/Tools/MaxPlasmaLights/plRTObjLightDesc.h b/Sources/Tools/MaxPlasmaLights/plRTObjLightDesc.h index bcc3bc3a..104555e4 100644 --- a/Sources/Tools/MaxPlasmaLights/plRTObjLightDesc.h +++ b/Sources/Tools/MaxPlasmaLights/plRTObjLightDesc.h @@ -53,9 +53,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef _plRTObjLightDesc_h #define _plRTObjLightDesc_h -#include "plRealTimeLightBase.h" -#include "resource.h" - +class plRTLightBase; class plMaxNode; //// AttenRanges Class //////////////////////////////////////////////////////// diff --git a/Sources/Tools/MaxPlasmaLights/plRTProjDirLight.cpp b/Sources/Tools/MaxPlasmaLights/plRTProjDirLight.cpp index 01b26bd4..dc0d6a08 100644 --- a/Sources/Tools/MaxPlasmaLights/plRTProjDirLight.cpp +++ b/Sources/Tools/MaxPlasmaLights/plRTProjDirLight.cpp @@ -51,14 +51,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com /////////////////////////////////////////////////////////////////////////////// #include "HeadSpin.h" +#include "plRealTimeLights.h" +#pragma hdrstop + #include "plRTProjDirLight.h" #include "plRTProjDirLightClassDesc.h" -#include "iparamm2.h" #include "MaxPlasmaMtls/Layers/plLayerTex.h" #include "MaxPlasmaMtls/Layers/plLayerTexBitmapPB.h" #include "MaxComponent/plMaxAnimUtils.h" #include "plRTObjLightDesc.h" -#include "plRTLightBaseAnimDlgProc.h" //// Static ClassDesc2 Get Functions ////////////////////////////////////////// diff --git a/Sources/Tools/MaxPlasmaLights/plRTProjDirLight.h b/Sources/Tools/MaxPlasmaLights/plRTProjDirLight.h index 52cbd8f3..a84ae4e6 100644 --- a/Sources/Tools/MaxPlasmaLights/plRTProjDirLight.h +++ b/Sources/Tools/MaxPlasmaLights/plRTProjDirLight.h @@ -54,8 +54,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef _plRTProjDirLight_h #define _plRTProjDirLight_h -#include "plRealTimeLightBase.h" -#include "iparamm2.h" +class Class_ID; +class IParamBlock2; +struct PB2Value; +class ReferenceMaker; /////////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Tools/MaxPlasmaLights/plRTProjDirLightClassDesc.h b/Sources/Tools/MaxPlasmaLights/plRTProjDirLightClassDesc.h index 1aea4a15..aa791ac9 100644 --- a/Sources/Tools/MaxPlasmaLights/plRTProjDirLightClassDesc.h +++ b/Sources/Tools/MaxPlasmaLights/plRTProjDirLightClassDesc.h @@ -55,8 +55,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _plRTProjDirLightClassDesc_h #include "plRTProjDirLight.h" -#include "iparamm2.h" -#include "resource.h" class plRTProjDirLightDesc : public ClassDesc2 { diff --git a/Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.cpp b/Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.cpp index 9c268a5c..5b335be5 100644 --- a/Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.cpp +++ b/Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.cpp @@ -39,13 +39,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ + #include "HeadSpin.h" + #include "plRealTimeLightBase.h" -#include "iparamm2.h" #include "resource.h" -#include "decomp.h" -#include "hsv.h" -#include "target.h" + +#include +#include +#pragma hdrstop + #include "MaxPlasmaMtls/Layers/plLayerTex.h" #include "MaxPlasmaMtls/Layers/plLayerTexBitmapPB.h" @@ -1750,354 +1753,3 @@ void plRTLightBase::UpdateTargDistance(TimeValue t, INode* inode) } } - - - - -/// -// -// -// Target Creation for Targeted Lights... -// -// -// - - -#if 0 -class TSpotCreationManager : public MouseCallBack, ReferenceMaker -{ -private: - CreateMouseCallBack *createCB; - INode *lgtNode,*targNode; - plRTLightBase *lgtObject; - TargetObject *targObject; - int attachedToNode; - IObjCreate *createInterface; - ClassDesc *cDesc; - Matrix3 mat; // the nodes TM relative to the CP - IPoint2 pt0; - int ignoreSelectionChange; - int lastPutCount; - - void CreateNewObject(); - - int NumRefs() { return 1; } - RefTargetHandle GetReference(int i) { return (RefTargetHandle)lgtNode; } - void SetReference(int i, RefTargetHandle rtarg) { lgtNode = (INode *)rtarg; } - - // StdNotifyRefChanged calls this, which can change the partID to new value - // If it doesnt depend on the particular message& partID, it should return - // REF_DONTCARE - RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, - PartID& partID, RefMessage message); - -public: - void Begin( IObjCreate *ioc, ClassDesc *desc ); - void End(); - - TSpotCreationManager() { ignoreSelectionChange = FALSE; } - int proc( HWND hwnd, int msg, int point, int flag, IPoint2 m ); - BOOL SupportAutoGrid(){return TRUE;} -}; - - -#define CID_TSPOTCREATE CID_USER + 3 - -class TSpotCreateMode : public CommandMode { - TSpotCreationManager proc; -public: - void Begin( IObjCreate *ioc, ClassDesc *desc ) { proc.Begin( ioc, desc ); } - void End() { proc.End(); } - - int Class() { return CREATE_COMMAND; } - int ID() { return CID_TSPOTCREATE; } - MouseCallBack *MouseProc(int *numPoints) { *numPoints = 1000000; return &proc; } - ChangeForegroundCallback *ChangeFGProc() { return CHANGE_FG_SELECTED; } - BOOL ChangeFG( CommandMode *oldMode ) { return (oldMode->ChangeFGProc() != CHANGE_FG_SELECTED); } - void EnterMode() { - } - void ExitMode() { - } - BOOL IsSticky() { return FALSE; } -}; - -static TSpotCreateMode theTSpotCreateMode; - -#endif - -#if 0 -void TSpotCreationManager::Begin( IObjCreate *ioc, ClassDesc *desc ) -{ - createInterface = ioc; - cDesc = desc; - attachedToNode = FALSE; - createCB = NULL; - lgtNode = NULL; - targNode = NULL; - lgtObject = NULL; - targObject = NULL; - CreateNewObject(); -} - -void TSpotCreationManager::End() -{ - if ( lgtObject ) { - lgtObject->EndEditParams( (IObjParam*)createInterface, END_EDIT_REMOVEUI, NULL); - if ( !attachedToNode ) { - // RB 4-9-96: Normally the hold isn't holding when this - // happens, but it can be in certain situations (like a track view paste) - // Things get confused if it ends up with undo... - theHold.Suspend(); - //delete lgtObject; - lgtObject->DeleteThis(); // JBW 11.1.99, this allows scripted plugin lights to delete cleanly - lgtObject = NULL; - theHold.Resume(); - // RB 7/28/97: If something has been put on the undo stack since this object was created, we have to flush the undo stack. - if (theHold.GetGlobalPutCount()!=lastPutCount) { - GetSystemSetting(SYSSET_CLEAR_UNDO); - } - macroRec->Cancel(); // JBW 4/23/99 - } - else if ( lgtNode ) { - // Get rid of the reference. - DeleteReference(0); // sets lgtNode = NULL - } - } -} - -RefResult TSpotCreationManager::NotifyRefChanged( - Interval changeInt, - RefTargetHandle hTarget, - PartID& partID, - RefMessage message) -{ - switch (message) { - - case REFMSG_PRENOTIFY_PASTE: - case REFMSG_TARGET_SELECTIONCHANGE: - if ( ignoreSelectionChange ) { - break; - } - if (lgtObject && lgtNode==hTarget) { - // this will set camNode== NULL; - DeleteReference(0); - goto endEdit; - } - // fall through - - case REFMSG_TARGET_DELETED: - if ( lgtObject && lgtNode==hTarget ) { - endEdit: - lgtObject->EndEditParams( (IObjParam*)createInterface, 0, NULL); - lgtObject = NULL; - lgtNode = NULL; - CreateNewObject(); - attachedToNode = FALSE; - } - else if (targNode==hTarget) { - targNode = NULL; - targObject = NULL; - } - break; - } - return REF_SUCCEED; -} - - -void TSpotCreationManager::CreateNewObject() -{ - lgtObject = (plRTLightBase *)cDesc->Create(); - lastPutCount = theHold.GetGlobalPutCount(); - - macroRec->BeginCreate(cDesc); // JBW 4/23/99 - - // Start the edit params process - if ( lgtObject ) { - lgtObject->BeginEditParams( (IObjParam*)createInterface, BEGIN_EDIT_CREATE, NULL ); - } -} - -static void whoa(){}; - -static BOOL needToss; - -int TSpotCreationManager::proc( - HWND hwnd, - int msg, - int point, - int flag, - IPoint2 m ) -{ - int res; - TSTR targName; - ViewExp *vpx = createInterface->GetViewport(hwnd); - assert( vpx ); - - switch ( msg ) { - case MOUSE_POINT: - switch ( point ) { - case 0: - pt0 = m; - assert( lgtObject ); - vpx->CommitImplicitGrid(m, flag); //KENNY MERGE - if ( createInterface->SetActiveViewport(hwnd) ) { - return FALSE; - } - - if (createInterface->IsCPEdgeOnInView()) { - res = FALSE; - goto done; - } - - // if lights were hidden by category, re-display them - GetCOREInterface()->SetHideByCategoryFlags( - GetCOREInterface()->GetHideByCategoryFlags() & ~HIDE_LIGHTS); - - if ( attachedToNode ) { - // send this one on its way - lgtObject->EndEditParams( (IObjParam*)createInterface, 0, NULL); - macroRec->EmitScript(); // JBW 4/23/99 - - // Get rid of the reference. - if (lgtNode) - DeleteReference(0); - - // new object - CreateNewObject(); // creates lgtObject - } - - needToss = theHold.GetGlobalPutCount()!=lastPutCount; - - theHold.Begin(); // begin hold for undo - mat.IdentityMatrix(); - - // link it up - lgtNode = createInterface->CreateObjectNode( lgtObject); - attachedToNode = TRUE; - assert( lgtNode ); - createCB = lgtObject->GetCreateMouseCallBack(); - createInterface->SelectNode( lgtNode ); - - // Create target object and node - targObject = new TargetObject; - assert(targObject); - targNode = createInterface->CreateObjectNode( targObject); - assert(targNode); - targName = lgtNode->GetName(); - targName += GetString(IDS_DB_DOT_TARGET); - targNode->SetName(targName); - - // hook up camera to target using lookat controller. - createInterface->BindToTarget(lgtNode,targNode); - - // Reference the new node so we'll get notifications. - MakeRefByID( FOREVER, 0, lgtNode); - - // Position camera and target at first point then drag. - mat.IdentityMatrix(); - //mat[3] = vpx->GetPointOnCP(m); - #ifdef _3D_CREATE - mat.SetTrans( vpx->SnapPoint(m,m,NULL,SNAP_IN_3D) ); - #else - mat.SetTrans(vpx->SnapPoint(m,m,NULL,SNAP_IN_PLANE)); - #endif - createInterface->SetNodeTMRelConstPlane(lgtNode, mat); - createInterface->SetNodeTMRelConstPlane(targNode, mat); - lgtObject->Enable(1); - - ignoreSelectionChange = TRUE; - createInterface->SelectNode( targNode,0); - ignoreSelectionChange = FALSE; - res = TRUE; - break; - - case 1: - if (Length(m-pt0)<2) - goto abort; - //mat[3] = vpx->GetPointOnCP(m); - #ifdef _3D_CREATE - mat.SetTrans( vpx->SnapPoint(m,m,NULL,SNAP_IN_3D) ); - #else - mat.SetTrans(vpx->SnapPoint(m,m,NULL,SNAP_IN_PLANE)); - #endif - macroRec->Disable(); // JBW 4/23/99 - createInterface->SetNodeTMRelConstPlane(targNode, mat); - macroRec->Enable(); - - ignoreSelectionChange = TRUE; - createInterface->SelectNode( lgtNode); - ignoreSelectionChange = FALSE; - - theHold.Accept(IDS_DS_CREATE); - - createInterface->AddLightToScene(lgtNode); - createInterface->RedrawViews(createInterface->GetTime()); - - res = FALSE; // We're done - break; - } - break; - - case MOUSE_MOVE: - //mat[3] = vpx->GetPointOnCP(m); - #ifdef _3D_CREATE - mat.SetTrans( vpx->SnapPoint(m,m,NULL,SNAP_IN_3D) ); - #else - mat.SetTrans(vpx->SnapPoint(m,m,NULL,SNAP_IN_PLANE)); - #endif - macroRec->Disable(); // JBW 4/23/99 - createInterface->SetNodeTMRelConstPlane(targNode, mat); - macroRec->Enable(); - createInterface->RedrawViews(createInterface->GetTime()); - - macroRec->SetProperty(lgtObject, _T("target"), // JBW 4/23/99 - mr_create, Class_ID(TARGET_CLASS_ID, 0), GEOMOBJECT_CLASS_ID, 1, _T("transform"), mr_matrix3, &mat); - - res = TRUE; - break; - - case MOUSE_FREEMOVE: - SetCursor(LoadCursor(hInstance, MAKEINTRESOURCE(IDC_CROSS_HAIR))); - #ifdef _OSNAP - //Snap Preview - #ifdef _3D_CREATE - vpx->SnapPreview(m,m,NULL, SNAP_IN_3D); - #else - vpx->SnapPreview(m,m,NULL, SNAP_IN_PLANE); - #endif - #endif - vpx->TrackImplicitGrid(m); //KENNY MERGE - break; - - case MOUSE_PROPCLICK: - // right click while between creations - createInterface->RemoveMode(NULL); - break; - - case MOUSE_ABORT: - abort: - assert( lgtObject ); - lgtObject->EndEditParams( (IObjParam*)createInterface,0,NULL); - // Toss the undo stack if param changes have been made - macroRec->Cancel(); // JBW 4/23/99 - theHold.Cancel(); // deletes both the camera and target. - if (needToss) - GetSystemSetting(SYSSET_CLEAR_UNDO); - lgtNode = NULL; - targNode = NULL; - createInterface->RedrawViews(createInterface->GetTime()); - CreateNewObject(); - attachedToNode = FALSE; - res = FALSE; - } - -done: - //KENNY MERGE - if ((res == CREATE_STOP)||(res==CREATE_ABORT)) - vpx->ReleaseImplicitGrid(); - createInterface->ReleaseViewport(vpx); - return res; -} - - -#endif diff --git a/Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h b/Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h index f5c62d6c..6585ab72 100644 --- a/Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h +++ b/Sources/Tools/MaxPlasmaLights/plRealTimeLightBase.h @@ -42,21 +42,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef PL_RTLIGHT_BASE_H #define PL_RTLIGHT_BASE_H -// Max related headers -#include "max.h" -#include "iparamb2.h" -#include "iparamm2.h" - // Our generic headers #include "HeadSpin.h" -#include "MaxPlasmaMtls/Layers/plLayerTex.h" +#include "hsWindows.h" + +// Max related headers +#include +#include #include "MaxMain/MaxCompat.h" extern TCHAR *GetString(int id); - - - extern HINSTANCE hInstance; #define RTOMNI_LIGHT_CLASSID Class_ID(0x57cf7089, 0x282e5b71) @@ -87,16 +83,15 @@ extern HINSTANCE hInstance; inline float MaxF(float a, float b) { return a>b?a:b; } inline float MinF(float a, float b) { return a. - -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==*/ -/********************************************************************** - *< - FILE: prim.h - - DESCRIPTION: - - CREATED BY: Dan Silva - - HISTORY: - - *> Copyright (c) 1994, All Rights Reserved. - **********************************************************************/ - -#ifndef __PRIM__H -#define __PRIM__H - -#include "Max.h" -#include "resource.h" - -#ifdef DESIGN_VER //for conversion to amodeler solids -#include "igeomimp.h" -#include "plugapi.h" -#endif - -TCHAR *GetString(int id); - -extern ClassDesc* GetBoxobjDesc(); -extern ClassDesc* GetSphereDesc(); -extern ClassDesc* GetCylinderDesc(); -extern ClassDesc* GetSimpleCamDesc(); -extern ClassDesc* GetOmniLightDesc(); -extern ClassDesc* GetDirLightDesc(); -extern ClassDesc *GetTDirLightDesc(); -extern ClassDesc* GetFSpotLightDesc(); -extern ClassDesc* GetTSpotLightDesc(); -extern ClassDesc* GetLookatCamDesc(); -extern ClassDesc* GetSplineDesc(); -#ifdef DESIGN_VER -extern ClassDesc* GetOrthoSplineDesc(); -#endif -extern ClassDesc* GetNGonDesc(); -extern ClassDesc* GetDonutDesc(); -extern ClassDesc* GetTargetObjDesc(); -extern ClassDesc* GetBonesDesc(); -extern ClassDesc* GetRingMasterDesc(); -extern ClassDesc* GetSlaveControlDesc(); -extern ClassDesc* GetQuadPatchDesc(); -extern ClassDesc* GetTriPatchDesc(); -extern ClassDesc* GetTorusDesc(); -extern ClassDesc* GetMorphObjDesc(); -extern ClassDesc* GetCubicMorphContDesc(); -extern ClassDesc* GetRectangleDesc(); -extern ClassDesc* GetBoolObjDesc(); -extern ClassDesc* GetTapeHelpDesc(); -extern ClassDesc* GetProtHelpDesc(); -extern ClassDesc* GetTubeDesc(); -extern ClassDesc* GetConeDesc(); -extern ClassDesc* GetHedraDesc(); -extern ClassDesc* GetCircleDesc(); -extern ClassDesc* GetEllipseDesc(); -extern ClassDesc* GetArcDesc(); -extern ClassDesc* GetStarDesc(); -extern ClassDesc* GetHelixDesc(); -extern ClassDesc* GetRainDesc(); -extern ClassDesc* GetSnowDesc(); -extern ClassDesc* GetTextDesc(); -extern ClassDesc* GetTeapotDesc(); -extern ClassDesc* GetBaryMorphContDesc(); -#ifdef DESIGN_VER -extern ClassDesc* GetOrthoSplineDesc(); -extern ClassDesc* GetParallelCamDesc(); -#endif -extern ClassDesc* GetGridobjDesc(); -extern ClassDesc* GetNewBonesDesc(); - -extern HINSTANCE hInstance; - - -#endif diff --git a/Sources/Tools/MaxPlasmaLights/target.h b/Sources/Tools/MaxPlasmaLights/target.h deleted file mode 100644 index c49fe8d6..00000000 --- a/Sources/Tools/MaxPlasmaLights/target.h +++ /dev/null @@ -1,124 +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 . - -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==*/ -/********************************************************************** - *< - FILE: target.h - - DESCRIPTION: Defines a Target Object Class - - CREATED BY: Dan Silva - - HISTORY: created 11 January 1995 - - *> Copyright (c) 1994, All Rights Reserved. - **********************************************************************/ - -#ifndef __TARGET__H__ - -#define __TARGET__H__ - -class TargetObject: public GeomObject { - friend class TargetObjectCreateCallBack; - friend BOOL CALLBACK TargetParamDialogProc( HWND hDlg, UINT message, - WPARAM wParam, LPARAM lParam ); - - // Mesh cache - static HWND hSimpleCamParams; - static IObjParam* iObjParams; - static Mesh mesh; - static int meshBuilt; - - void GetMat(TimeValue t, INode* inode, ViewExp* vpt, Matrix3& tm); - void BuildMesh(); - - // inherited virtual methods for Reference-management - RefResult NotifyRefChanged( Interval changeInt, RefTargetHandle hTarget, - PartID& partID, RefMessage message ); - - public: - TargetObject(); - - // inherited virtual methods: - - // From BaseObject - int HitTest(TimeValue t, INode* inode, int type, int crossing, int flags, IPoint2 *p, ViewExp *vpt); - void Snap(TimeValue t, INode* inode, SnapInfo *snap, IPoint2 *p, ViewExp *vpt); - int Display(TimeValue t, INode* inode, ViewExp *vpt, int flags); - CreateMouseCallBack* GetCreateMouseCallBack(); - void BeginEditParams( IObjParam *ip, ULONG flags,Animatable *prev); - void EndEditParams( IObjParam *ip, ULONG flags,Animatable *next); - TCHAR *GetObjectName() { return GetString(IDS_DB_TARGET); } - - // From Object - ObjectState Eval(TimeValue time); - void InitNodeName(TSTR& s) { s = GetString(IDS_DB_TARGET); } - ObjectHandle ApplyTransform(Matrix3& matrix); - int UsesWireColor() { return 0; } - int IsRenderable() { return 0; } - - // From GeomObject - int IntersectRay(TimeValue t, Ray& r, float& at); - ObjectHandle CreateTriObjRep(TimeValue t); // for rendering, also for deformation - void GetWorldBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box ); - void GetLocalBoundBox(TimeValue t, INode *mat, ViewExp *vpt, Box3& box ); - void GetDeformBBox(TimeValue t, Box3& box, Matrix3 *tm, BOOL useSel ); - - // From Animatable - void DeleteThis() { - delete this; - } - Class_ID ClassID() { return Class_ID(TARGET_CLASS_ID,0); } - void GetClassName(TSTR& s) { s = TSTR(GetString(IDS_DB_TARGET_CLASS)); } - int IsKeyable(){ return 1;} - LRESULT CALLBACK TrackViewWinProc( HWND hwnd, UINT message, - WPARAM wParam, LPARAM lParam ){return(0);} - - // From ref.h - RefTargetHandle Clone(RemapDir& remap = DEFAULTREMAP); - - // IO - IOResult Save(ISave *isave); - IOResult Load(ILoad *iload); - }; - - -#endif