mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Stubify MaxFileData
So, yeah, this blows away MaxSceneViewer. We're never going to get around to fixing that. In exchange for this massive code explosion, you get a free MaxFileData stub type thing. It keeps all the data just so we don't blow up Cyan's plugins. This fixes the "Missing Dll" messages people keep whining about.
This commit is contained in:
@ -62,6 +62,7 @@ set(MaxMain_SOURCES
|
||||
plGetLocationDlg.cpp
|
||||
plMaxAccelerators.cpp
|
||||
plMaxCFGFile.cpp
|
||||
plMaxFileData.cpp
|
||||
plMaxMenu.cpp
|
||||
plMaxMeshExtractor.cpp
|
||||
plMaxNode.cpp
|
||||
|
@ -52,12 +52,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include "GlobalUtility.h"
|
||||
|
||||
#include "MaxSceneViewer/SceneSync.h"
|
||||
|
||||
#include "MaxComponent/ComponentDummies.h"
|
||||
#include "plActionTableMgr.h"
|
||||
#include "plMaxMenu.h"
|
||||
#include "MaxSceneViewer/plMaxFileData.h"
|
||||
#include "pfPython/cyPythonInterface.h"
|
||||
#include "MaxPlasmaMtls/Layers/plPlasmaMAXLayer.h"
|
||||
|
||||
@ -203,15 +200,6 @@ DWORD PlasmaMax::Start()
|
||||
DummyCodeIncludeFuncClimbTrigger();
|
||||
DummyCodeIncludeFuncObjectFlocker();
|
||||
DummyCodeIncludeFuncGrassShader();
|
||||
|
||||
// Register the SceneViewer with Max
|
||||
#ifdef MAXSCENEVIEWER_ENABLED
|
||||
SceneSync::Instance();
|
||||
#endif
|
||||
|
||||
#ifdef MAXSCENEVIEWER_ENABLED
|
||||
InitMaxFileData();
|
||||
#endif
|
||||
|
||||
// Setup the localization mgr
|
||||
// Dirty hacks are because Cyan sucks...
|
||||
|
@ -123,11 +123,7 @@ __declspec(dllexport) ClassDesc *LibClassDesc(int i)
|
||||
case 4:
|
||||
return GetComponentMgrDesc();
|
||||
case 5:
|
||||
#ifdef MAXSCENEVIEWER_ENABLED
|
||||
return GetMaxFileDataDesc();
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
case 6:
|
||||
return GetMaxUtilsDesc();
|
||||
default:
|
||||
|
158
Sources/Tools/MaxMain/plMaxFileData.cpp
Normal file
158
Sources/Tools/MaxMain/plMaxFileData.cpp
Normal file
@ -0,0 +1,158 @@
|
||||
/*==LICENSE==*
|
||||
|
||||
CyanWorlds.com Engine - MMOG client, server and tools
|
||||
Copyright (C) 2011 Cyan Worlds, Inc.
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Additional permissions under GNU GPL version 3 section 7
|
||||
|
||||
If you modify this Program, or any covered work, by linking or
|
||||
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
|
||||
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
|
||||
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
|
||||
(or a modified version of those libraries),
|
||||
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
|
||||
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
|
||||
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
|
||||
licensors of this Program grant you additional
|
||||
permission to convey the resulting work. Corresponding Source for a
|
||||
non-source form of such a combination shall include the source code for
|
||||
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
|
||||
work.
|
||||
|
||||
You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
or by snail mail at:
|
||||
Cyan Worlds, Inc.
|
||||
14617 N Newport Hwy
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
|
||||
#include "HeadSpin.h"
|
||||
#include "plString.h"
|
||||
|
||||
#include <max.h>
|
||||
#pragma hdrstop
|
||||
|
||||
/** \file This file contains a stub implementation for the ClassDescs left behind by
|
||||
* Cyan's SceneViewer crap. This just keeps new versions of 3ds Max from crashing on
|
||||
* null ClassDescs returned by the GUP. It also silences that "Dll Missing" dialog that
|
||||
* everyone evar wants to whine about even though it means absolutely nothing.
|
||||
*/
|
||||
|
||||
#define PLASMA_FILE_DATA_CID Class_ID(0x255a700a, 0x285279dc)
|
||||
#define MAXFILE_DATA_CHUNK 1001
|
||||
static const uint8_t kVersion = 1;
|
||||
|
||||
class plMaxFileDataControl : public StdControl
|
||||
{
|
||||
public:
|
||||
SYSTEMTIME fCodeBuildTime;
|
||||
char fBranch[128];
|
||||
|
||||
plMaxFileDataControl()
|
||||
{
|
||||
memset(&fCodeBuildTime, 0, sizeof(SYSTEMTIME));
|
||||
memset(&fBranch, 0, arrsize(fBranch));
|
||||
}
|
||||
|
||||
// Animatable
|
||||
virtual void EditTrackParams(TimeValue t, ParamDimensionBase *dim, TCHAR *pname, HWND hParent, IObjParam *ip, DWORD flags) { }
|
||||
int TrackParamsType() { return TRACKPARAMS_WHOLE; }
|
||||
virtual void DeleteThis() { delete this; }
|
||||
|
||||
// ReferenceMaker
|
||||
virtual RefResult NotifyRefChanged(Interval changeInt, RefTargetHandle hTarget, PartID& partID, RefMessage message)
|
||||
{
|
||||
return REF_DONTCARE;
|
||||
}
|
||||
|
||||
Class_ID ClassID() { return PLASMA_FILE_DATA_CID; }
|
||||
SClass_ID SuperClassID() { return CTRL_FLOAT_CLASS_ID; }
|
||||
void GetClassName(TSTR& s) { s = "DEAD - SceneViewer"; }
|
||||
|
||||
// Control methods
|
||||
RefTargetHandle Clone(RemapDir& remap) { return new plMaxFileDataControl(); }
|
||||
void Copy(Control* from) { }
|
||||
virtual BOOL IsReplaceable() { return FALSE; }
|
||||
|
||||
// StdControl methods
|
||||
void GetValueLocalTime(TimeValue t, void* val, Interval& valid, GetSetMethod method = CTRL_ABSOLUTE) { }
|
||||
void SetValueLocalTime(TimeValue t, void* val, int commit, GetSetMethod method) { }
|
||||
void Extrapolate(Interval range, TimeValue t, void* val, Interval& valid, int type) { }
|
||||
void *CreateTempValue() { return nullptr; }
|
||||
void DeleteTempValue(void *val) { }
|
||||
void ApplyValue(void* val, void* delta) { }
|
||||
void MultiplyValue(void* val, float m) { }
|
||||
|
||||
// MyControl methods
|
||||
IOResult Load(ILoad *iload);
|
||||
IOResult Save(ISave *isave);
|
||||
};
|
||||
|
||||
IOResult plMaxFileDataControl::Load(ILoad *iload)
|
||||
{
|
||||
ULONG nb;
|
||||
IOResult res;
|
||||
while (IO_OK==(res=iload->OpenChunk()))
|
||||
{
|
||||
if (iload->CurChunkID() == MAXFILE_DATA_CHUNK)
|
||||
{
|
||||
uint8_t version = 0;
|
||||
res = iload->Read(&version, sizeof(uint8_t), &nb);
|
||||
res = iload->Read(&fCodeBuildTime, sizeof(SYSTEMTIME), &nb);
|
||||
|
||||
int branchLen = 0;
|
||||
iload->Read(&branchLen, sizeof(int), &nb);
|
||||
iload->Read(&fBranch, branchLen, &nb);
|
||||
}
|
||||
|
||||
iload->CloseChunk();
|
||||
if (res != IO_OK)
|
||||
return res;
|
||||
}
|
||||
|
||||
return IO_OK;
|
||||
}
|
||||
|
||||
IOResult plMaxFileDataControl::Save(ISave *isave)
|
||||
{
|
||||
ULONG nb;
|
||||
isave->BeginChunk(MAXFILE_DATA_CHUNK);
|
||||
|
||||
isave->Write(&kVersion, sizeof(kVersion), &nb);
|
||||
isave->Write(&fCodeBuildTime, sizeof(SYSTEMTIME), &nb);
|
||||
|
||||
int branchLen = strlen(fBranch)+1;
|
||||
isave->Write(&branchLen, sizeof(int), &nb);
|
||||
isave->Write(&fBranch, branchLen, &nb);
|
||||
|
||||
isave->EndChunk();
|
||||
return IO_OK;
|
||||
}
|
||||
|
||||
class MaxFileDataClassDesc : public ClassDesc
|
||||
{
|
||||
public:
|
||||
int IsPublic() { return FALSE; }
|
||||
void* Create(BOOL loading) { return new plMaxFileDataControl; }
|
||||
const TCHAR* ClassName() { return _T("MaxFileData"); }
|
||||
SClass_ID SuperClassID() { return CTRL_FLOAT_CLASS_ID; }
|
||||
Class_ID ClassID() { return PLASMA_FILE_DATA_CID; }
|
||||
const TCHAR* Category() { return _T(""); }
|
||||
};
|
||||
|
||||
MaxFileDataClassDesc gMaxFileDataClassDesc;
|
||||
ClassDesc* GetMaxFileDataDesc() { return &gMaxFileDataClassDesc; }
|
@ -60,7 +60,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plMaxCFGFile.h"
|
||||
#include "plResCollector.h"
|
||||
#include "plAgeDescInterface.h"
|
||||
#include "MaxSceneViewer/SceneViewer.h"
|
||||
#include "plNodeLock.h"
|
||||
#include "plResetXform.h"
|
||||
#include "plTextureSearch.h"
|
||||
@ -81,7 +80,7 @@ enum
|
||||
kActionResCollect,
|
||||
kActionAgeDesc,
|
||||
kActionCompCopy,
|
||||
kActionSceneViewer,
|
||||
kActionSceneViewer, // DEAD. But I don't dare remove it--don't want to break stuff :/
|
||||
kActionLock,
|
||||
kActionUnlock,
|
||||
kActionTexSearch,
|
||||
@ -201,15 +200,6 @@ bool DoAction(int id)
|
||||
CopyComponents();
|
||||
return true;
|
||||
|
||||
case kActionSceneViewer:
|
||||
#ifdef MAXSCENEVIEWER_ENABLED
|
||||
SceneViewer::Instance().Show();
|
||||
return true;
|
||||
#else
|
||||
hsMessageBox("The SceneViewer has been disabled in this build", "Disabled", 0);
|
||||
return true;
|
||||
#endif
|
||||
|
||||
case kActionLock:
|
||||
plNodeLock().Lock();
|
||||
return true;
|
||||
@ -420,18 +410,6 @@ void plCreateMenu()
|
||||
pMenuItem->ActAsSeparator();
|
||||
pPlasmaMenu->AddItem(pMenuItem);
|
||||
|
||||
#ifdef MAXSCENEVIEWER_ENABLED
|
||||
// Add the SceneViewer to the menu
|
||||
pMenuItem = GetIMenuItem();
|
||||
pMenuItem->SetActionItem(pActionTable->GetAction(kActionSceneViewer));
|
||||
pPlasmaMenu->AddItem(pMenuItem);
|
||||
#endif
|
||||
|
||||
// Add a separator
|
||||
pMenuItem = GetIMenuItem();
|
||||
pMenuItem->ActAsSeparator();
|
||||
pPlasmaMenu->AddItem(pMenuItem);
|
||||
|
||||
// Add the Lock Selected to the menu
|
||||
pMenuItem = GetIMenuItem();
|
||||
pMenuItem->SetActionItem(pActionTable->GetAction(kActionLock));
|
||||
|
Reference in New Issue
Block a user