diff --git a/Sources/Tools/MaxConvert/CMakeLists.txt b/Sources/Tools/MaxConvert/CMakeLists.txt
index 85a7d9af..66527df0 100644
--- a/Sources/Tools/MaxConvert/CMakeLists.txt
+++ b/Sources/Tools/MaxConvert/CMakeLists.txt
@@ -48,6 +48,7 @@ set(MaxConvert_SOURCES
UserPropMgr.cpp
)
+use_precompiled_header(Pch.h Pch.cpp MaxConvert_HEADERS MaxConvert_SOURCES)
add_library(MaxConvert STATIC ${MaxConvert_HEADERS} ${MaxConvert_SOURCES})
source_group("Header Files" FILES ${MaxConvert_HEADERS})
diff --git a/Sources/Tools/MaxConvert/Pch.cpp b/Sources/Tools/MaxConvert/Pch.cpp
new file mode 100644
index 00000000..25cd61cc
--- /dev/null
+++ b/Sources/Tools/MaxConvert/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 MaxConvert
+ *
+ * This file prompts MSVC to generate a PCH file for the MaxConvert project. It
+ * has no function if precompiled headers are disabled in cmake.
+ */
diff --git a/Sources/Tools/MaxConvert/Pch.h b/Sources/Tools/MaxConvert/Pch.h
new file mode 100644
index 00000000..475e7a59
--- /dev/null
+++ b/Sources/Tools/MaxConvert/Pch.h
@@ -0,0 +1,101 @@
+/*==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 _MaxConvert_Pch_inc_
+#define _MaxConvert_Pch_inc_
+
+/**
+ * \file Pch.h
+ * \brief Precompiled Header for MaxConvert
+ */
+
+// Standard Library
+#include
+#include
+#include
+#include
+#include
+
+// Core Plasma
+#include "HeadSpin.h"
+#include "hsBitVector.h"
+#include "hsColorRGBA.h"
+#include "plgDispatch.h"
+#include "hsExceptionStack.h"
+#include "hsFastMath.h"
+#include "hsGeometry3.h"
+#include "hsMatrix44.h"
+#include "hsResMgr.h"
+#include "plString.h"
+#include "hsStringTokenizer.h"
+#include "hsTemplates.h"
+#include "plTweak.h"
+
+// Windows
+#include "hsWindows.h"
+#include
+#include
+
+// MaxComponent
+#include "MaxComponent/plComponent.h"
+
+// 3ds Max SDK
+// This stuff should ALWAYS come after hsWindows.h
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#if MAX_VERSION_MAJOR >= 13
+# include
+#endif
+
+#endif // _MaxConvert_Pch_inc_
diff --git a/Sources/Tools/MaxConvert/StringTokenizer.cpp b/Sources/Tools/MaxConvert/StringTokenizer.cpp
index 8b594d92..04b8ea76 100644
--- a/Sources/Tools/MaxConvert/StringTokenizer.cpp
+++ b/Sources/Tools/MaxConvert/StringTokenizer.cpp
@@ -39,10 +39,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021
*==LICENSE==*/
-// StringTokenizer.cpp
+
+#include
+#pragma hdrstop
#include "StringTokenizer.h"
-#include "string.h"
// String Tokenizer routines
StringTokenizer::StringTokenizer() {
@@ -81,7 +82,7 @@ char *StringTokenizer::next() {
};
bool StringTokenizer::isSep(char c) {
if (!qAsTok || !inQuote) {
- for (int32_t i=0; i
#include "UserPropMgr.h"
#include "hsStringTokenizer.h"
-
#include "hsHashTable.h"
#define REFMSG_USERPROP (REFMSG_USER + 1)
@@ -69,7 +69,7 @@ UserPropMgr::~UserPropMgr()
CloseQuickTable();
}
-void UserPropMgr::SetUserPropFlag(INode *node, const char *name, const BOOL setFlag, const int32_t hFlag)
+void UserPropMgr::SetUserPropFlag(INode *node, const char *name, const bool setFlag, const int32_t hFlag)
{
if (setFlag) SetUserProp(node,name,NULL,hFlag);
else ClearUserProp(node,name,hFlag);
@@ -83,7 +83,7 @@ void UserPropMgr::ClearUserPropALL(const char *name, const int32_t hFlag)
}
}
-void UserPropMgr::SelectUserPropFlagALL(INode *node, const char *name, const BOOL flag) {
+void UserPropMgr::SelectUserPropFlagALL(INode *node, const char *name, const bool flag) {
if (node)
{
if (UserPropExists(node,name) == flag) ip->SelectNode(node,false);
@@ -96,7 +96,7 @@ void UserPropMgr::SelectUserPropFlagALL(INode *node, const char *name, const BOO
void UserPropMgr::DeSelectWithOut(const char *name, const char *value) {
- BOOL oldProps = vProps;
+ bool oldProps = vProps;
vProps=false;
TSTR val;
INode *nodes[1];
@@ -169,7 +169,7 @@ ip->ThawSelection();
-int UserPropMgr::RecursiveCountAlike(INode *node, BOOL MatchAll) {
+int UserPropMgr::RecursiveCountAlike(INode *node, bool MatchAll) {
int count=0;
if (node) {
if (!node->IsNodeHidden() && !node->IsFrozen() && IsAlike(node,MatchAll)) count++;
@@ -182,18 +182,18 @@ int UserPropMgr::RecursiveCountAlike(INode *node, BOOL MatchAll) {
}
-int UserPropMgr::CountAlike(BOOL MatchAll) {
+int UserPropMgr::CountAlike(bool MatchAll) {
return RecursiveCountAlike(NULL, MatchAll);
}
-BOOL UserPropMgr::IsMatch(const char *val1, const char *val2) {
+bool UserPropMgr::IsMatch(const char *val1, const char *val2) {
if (!stricmp(val1,val2)) return true;
hsStringTokenizer toker(val1," ,@");
char *tok;
while (tok=toker.next()) {
hsStringTokenizer toker2(val2," ,@");
- BOOL found = false;
+ bool found = false;
char *tok2;
while ((tok2=toker2.next()) && !found) {
if (tok[0] >= '1' && tok[0] <= '0') {
@@ -210,11 +210,11 @@ BOOL UserPropMgr::IsMatch(const char *val1, const char *val2) {
}
-BOOL UserPropMgr::IsAlike(INode *node, BOOL MatchAll) {
+bool UserPropMgr::IsAlike(INode *node, bool MatchAll) {
TSTR buf;
GetUserPropBuffer(node,buf);
- BOOL oldProps = vProps;
+ bool oldProps = vProps;
vProps=false;
hsStringTokenizer toker(buf," \r\n");
@@ -223,7 +223,7 @@ BOOL UserPropMgr::IsAlike(INode *node, BOOL MatchAll) {
TSTR name;
TSTR value;
TSTR tval;
- BOOL match = MatchAll;
+ bool match = MatchAll;
bool isName = true;
tok = toker.next();
while (tok && (match==MatchAll)) {
@@ -304,14 +304,14 @@ void UserPropMgr::SetUserPropBuffer(INode *node, const TSTR &buf)
}
}
-void UserPropMgr::SetUserPropFlagALL(const char *name, const BOOL setFlag, const int32_t hFlag)
+void UserPropMgr::SetUserPropFlagALL(const char *name, const bool setFlag, const int32_t hFlag)
{
for (int i=0; iGetSelNodeCount() == 1) name = ip->GetSelNode(0)->GetName();
else return false;
@@ -725,7 +725,7 @@ void UserPropMgr::SetNodeNameALL(const char *name) {
}
-void UserPropMgr::LoadVirtualProps(BOOL reset) {
+void UserPropMgr::LoadVirtualProps(bool reset) {
if (reset)
{
vbuf = "";
@@ -736,7 +736,7 @@ void UserPropMgr::LoadVirtualProps(BOOL reset) {
void UserPropMgr::DestroyVirtualProps() {
vProps = false;
}
-BOOL UserPropMgr::IsVirtual() {
+bool UserPropMgr::IsVirtual() {
return vProps;
}
@@ -837,7 +837,7 @@ void UserPropMgr::IBuildQuickTable(INode* node)
}
}
-BOOL UserPropMgr::ICheckQuickEntry(const char *key, TSTR &value)
+bool UserPropMgr::ICheckQuickEntry(const char *key, TSTR &value)
{
QuickPair q;
q.SetKey(key);
diff --git a/Sources/Tools/MaxConvert/UserPropMgr.h b/Sources/Tools/MaxConvert/UserPropMgr.h
index ef12db30..d6e66094 100644
--- a/Sources/Tools/MaxConvert/UserPropMgr.h
+++ b/Sources/Tools/MaxConvert/UserPropMgr.h
@@ -44,10 +44,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef _USERPROPMGR_H_
#define _USERPROPMGR_H_
-#include "Max.h"
#include "HeadSpin.h"
template class hsHashTable;
+class Interface;
+class NameMaker;
+class INode;
class UserPropMgr {
public:
@@ -64,40 +66,40 @@ public:
NameMaker *nm;
- void SetUserPropFlag(INode *node, const char *name, const BOOL setFlag, const int32_t hFlag=kMe);
+ void SetUserPropFlag(INode *node, const char *name, const bool setFlag, const int32_t hFlag=kMe);
- void SelectUserPropFlagALL(INode *node, const char *name, const BOOL flag);
+ void SelectUserPropFlagALL(INode *node, const char *name, const bool flag);
void ClearUserProp(INode *node, const char *name, const int32_t hFlag=kMe);
void ClearUserPropALL(const char *name, const int32_t hFlag=kMe);
- void SetUserPropFlagALL(const char *name, const BOOL setFlag, const int32_t hFlag=kMe);
- BOOL GetUserPropFlagALL(const char *name, BOOL &isSet, const int32_t hFlag=kMe);
+ void SetUserPropFlagALL(const char *name, const bool setFlag, const int32_t hFlag=kMe);
+ bool GetUserPropFlagALL(const char *name, bool &isSet, const int32_t hFlag=kMe);
- BOOL GetUserProp(INode *node, const char *name, TSTR &value, const int32_t hFlag=kMe);
+ bool GetUserProp(INode *node, const char *name, TSTR &value, const int32_t hFlag=kMe);
void SetUserProp(INode *node, const char *name, const char *value, const int32_t hFlag=kMe);
- BOOL UserPropExists(INode *node, const char *name, const int32_t hFlag=kMe);
+ bool UserPropExists(INode *node, const char *name, const int32_t hFlag=kMe);
- BOOL GetUserPropString(INode *node, const char *name, TSTR &value, const int32_t hFlag=kMe);
+ bool GetUserPropString(INode *node, const char *name, TSTR &value, const int32_t hFlag=kMe);
void SetUserPropString(INode *node, const char *name, const char *value, const int32_t hFlag=kMe);
- BOOL GetUserPropFloat(INode *node, const char *name, float &value, const int32_t hFlag=kMe);
+ bool GetUserPropFloat(INode *node, const char *name, float &value, const int32_t hFlag=kMe);
void SetUserPropFloat(INode *node, const char *name, const float value, const int32_t hFlag=kMe);
- BOOL GetUserPropInt(INode *node, const char *name, int &value, const int32_t hFlag=kMe);
+ bool GetUserPropInt(INode *node, const char *name, int &value, const int32_t hFlag=kMe);
void SetUserPropInt(INode *node, const char *name, const int value, const int32_t hFlag=kMe);
- BOOL GetUserPropStringList(INode *node, const char *name, int &num, TSTR list[]);
- BOOL GetUserPropIntList(INode *node, const char *name, int &num, int list[]);
- BOOL GetUserPropFloatList(INode *node, const char *name, int &num, float list[]);
+ bool GetUserPropStringList(INode *node, const char *name, int &num, TSTR list[]);
+ bool GetUserPropIntList(INode *node, const char *name, int &num, int list[]);
+ bool GetUserPropFloatList(INode *node, const char *name, int &num, float list[]);
- BOOL GetUserPropStringALL(const char *name, TSTR &value, const int32_t hFlag=kMe);
+ bool GetUserPropStringALL(const char *name, TSTR &value, const int32_t hFlag=kMe);
void SetUserPropStringALL(const char *name, const char *value, const int32_t hFlag=kMe);
- BOOL GetUserPropStringListALL(const char *name, int &num, TSTR list[]);
- BOOL GetUserPropIntListALL(const char *name, int &num, int *list);
- BOOL GetUserPropFloatListALL(const char *name, int &num, float *list);
+ bool GetUserPropStringListALL(const char *name, int &num, TSTR list[]);
+ bool GetUserPropIntListALL(const char *name, int &num, int *list);
+ bool GetUserPropFloatListALL(const char *name, int &num, float *list);
- BOOL GetNodeNameALL(TSTR &name);
+ bool GetNodeNameALL(TSTR &name);
void SetNodeNameALL(const char *name);
- void LoadVirtualProps(BOOL reset=true);
+ void LoadVirtualProps(bool reset=true);
void DestroyVirtualProps();
- BOOL IsVirtual();
+ bool IsVirtual();
int GetSelNodeCount();
INode *GetSelNode(int i);
@@ -106,8 +108,8 @@ public:
void GetUserPropBuffer(INode *node, TSTR &buf);
void SetUserPropBuffer(INode *node, const TSTR &buf);
- BOOL IsAlike(INode *node, BOOL MatchAll=true);
- int CountAlike(BOOL MatchAll=true);
+ bool IsAlike(INode *node, bool MatchAll=true);
+ int CountAlike(bool MatchAll=true);
void DeSelectUnAlike(INode *node=NULL);
Interface *GetInterface() { return ip; }
@@ -119,9 +121,9 @@ private:
INode* GetAncestorIfNeeded(INode* node, const int32_t hFlag);
void DeSelectWithOut(const char *name, const char *value);
void RecursiveSelectAll(INode *node = NULL);
- int RecursiveCountAlike(INode *node = NULL, BOOL MatchAll=true);
- BOOL IsMatch(const char *val1, const char *val2);
- BOOL vProps;
+ int RecursiveCountAlike(INode *node = NULL, bool MatchAll=true);
+ bool IsMatch(const char *val1, const char *val2);
+ bool vProps;
TSTR vbuf;
TSTR vname;
@@ -150,7 +152,7 @@ private:
static const uint32_t kQuickSize;
INode* fQuickNode;
void IBuildQuickTable(INode* node);
- BOOL ICheckQuickEntry(const char *key, TSTR &value);
+ bool ICheckQuickEntry(const char *key, TSTR &value);
Interface *ip;
diff --git a/Sources/Tools/MaxConvert/hsControlConverter.cpp b/Sources/Tools/MaxConvert/hsControlConverter.cpp
index 89f89486..a8c81b15 100644
--- a/Sources/Tools/MaxConvert/hsControlConverter.cpp
+++ b/Sources/Tools/MaxConvert/hsControlConverter.cpp
@@ -41,18 +41,21 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
+#include "hsExceptionStack.h"
+#include "hsTemplates.h"
+#include "hsWindows.h"
#include
#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#pragma hdrstop
-//#include "Max.h"
#include "MaxMain/plMaxNode.h"
-#include "stdmat.h"
-#include "bmmlib.h"
-#include "istdplug.h"
-#include "texutil.h"
-#include "iparamb2.h"
-#include "modstack.h"
-#include "keyreduc.h"
#include "hsMaxLayerBase.h"
#include "plInterp/plController.h"
@@ -62,7 +65,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsConverterUtils.h"
#include "hsControlConverter.h"
#include "hsMaterialConverter.h"
-#include "hsExceptionStack.h"
#include "MaxExport/plErrorMsg.h"
#include "MaxComponent/plNoteTrackAnim.h"
#include "MaxComponent/plCameraComponents.h"
@@ -2100,11 +2102,8 @@ void hsControlConverter::IExportAnimatedCameraFOV(plMaxNode* node, hsTArray ConvertToType(t, Class_ID(LOOKAT_CAM_CLASS_ID, 0));
- float FOVvalue= 0.0; //Currently in Radians
- // radians
- FOVvalue = theCam->GetFOV(t);
- // convert
- FOVvalue = FOVvalue*(180/3.141592);
+ float FOVvalue= theCam->GetFOV(t); // in radians
+ FOVvalue *= (float)(180.f / M_PI); // to degrees
int FOVType = theCam->GetFOVType();
float wDeg, hDeg;
switch(FOVType)
diff --git a/Sources/Tools/MaxConvert/hsControlConverter.h b/Sources/Tools/MaxConvert/hsControlConverter.h
index 1ced7661..79862887 100644
--- a/Sources/Tools/MaxConvert/hsControlConverter.h
+++ b/Sources/Tools/MaxConvert/hsControlConverter.h
@@ -42,18 +42,22 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef __HSCONTROLCONVERTER_H
#define __HSCONTROLCONVERTER_H
-#include
-#include
-
-//#include "Max.h"
-#include "stdmat.h"
-#include "bmmlib.h"
-#include "istdplug.h"
-#include "texutil.h"
#include "plInterp/hsKeys.h"
-#include "hsTemplates.h"
+class Animatable;
+class plCompoundController;
+class Control;
+class plController;
+class hsConverterUtils;
+class plErrorMsg;
+class Interface;
+struct hsKeyFrame;
+class plLeafController;
+class Matrix3;
class plMaxNode;
+class IParamBlock2;
+class plSceneObject;
+class StdUVGen;
enum ControllerType
{
@@ -75,13 +79,6 @@ enum ControllerType
ctrlTypeRollAngle,
};
-class plController;
-class plLeafController;
-class plCompoundController;
-struct hsKeyFrame;
-class hsConverterUtils;
-class plSceneObject;
-
class hsControlConverter
{
private:
diff --git a/Sources/Tools/MaxConvert/hsConverterUtils.cpp b/Sources/Tools/MaxConvert/hsConverterUtils.cpp
index 2c5e8049..5302a148 100644
--- a/Sources/Tools/MaxConvert/hsConverterUtils.cpp
+++ b/Sources/Tools/MaxConvert/hsConverterUtils.cpp
@@ -41,35 +41,33 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
-#include "hsConverterUtils.h"
+#include "hsExceptionStack.h"
+#include "hsHashTable.h"
+#include "hsStringTokenizer.h"
#include "hsResMgr.h"
-#include "MaxMain/MaxCompat.h"
+#include
-#if HS_BUILD_FOR_WIN32
+#include
+#include
+#if MAX_VERSION_MAJOR >= 13
+# include
+#endif
+#pragma hdrstop
-#include
+#include "hsConverterUtils.h"
+#include "MaxMain/MaxCompat.h"
#include "hsMaxLayerBase.h"
#include "plInterp/plController.h"
#include "MaxExport/plErrorMsg.h"
#include "UserPropMgr.h"
-#include "hsStringTokenizer.h"
-//#include "hsDXTDirectXCodec.h"
-//#include "hsDXTSoftwareCodec.h"
#include "plGImage/hsCodecManager.h"
-///#include "SwitchUtil.h"
-#include "hsExceptionStack.h"
-#include "hsHashTable.h"
#include "pnKeyedObject/plKey.h"
#include "pnKeyedObject/hsKeyedObject.h"
#include "MaxMain/MaxCompat.h"
-#if MAX_VERSION_MAJOR >= 13
-#include
-#endif
-
const char hsConverterUtils::fTagSeps[] = " ,\t\n=:;";
extern UserPropMgr gUserPropMgr;
@@ -577,5 +575,3 @@ bool hsConverterUtils::CacheNode::operator==(const CacheNode& other) const
else
return !_stricmp(k1,k2);
}
-
-#endif // HS_BUILD_FOR_WIN32
diff --git a/Sources/Tools/MaxConvert/hsConverterUtils.h b/Sources/Tools/MaxConvert/hsConverterUtils.h
index 80246374..ffeb6390 100644
--- a/Sources/Tools/MaxConvert/hsConverterUtils.h
+++ b/Sources/Tools/MaxConvert/hsConverterUtils.h
@@ -42,20 +42,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef __HSCONVERTERUTILS_H
#define __HSCONVERTERUTILS_H
-#include "Max.h"
-#include "stdmat.h"
-#include
-#include "bmmlib.h"
-#include "istdplug.h"
-#include "texutil.h"
-
-#include "Headspin.h"
-
-class INode;
class Control;
+class INode;
class Interface;
-template class hsHashTable;
+template class hsHashTable;
class hsMaxLayerBase;
class plSimplePosController;
class plScalarController;
@@ -120,7 +111,7 @@ private:
plErrorMsg *fErrorMsg;
bool fSuppressMangling;
- uint32_t fWarned;
+ uint32_t fWarned;
bool fSave;
struct CacheNode
diff --git a/Sources/Tools/MaxConvert/hsMaterialConverter.cpp b/Sources/Tools/MaxConvert/hsMaterialConverter.cpp
index 8be1339d..028cd132 100644
--- a/Sources/Tools/MaxConvert/hsMaterialConverter.cpp
+++ b/Sources/Tools/MaxConvert/hsMaterialConverter.cpp
@@ -40,21 +40,30 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-#include "hsMaterialConverter.h"
-#include
+#include "HeadSpin.h"
+#include "plgDispatch.h"
+#include "hsExceptionStack.h"
+#include "hsResMgr.h"
+#include "hsStringTokenizer.h"
+#include "hsTemplates.h"
+
+#include "MaxComponent/plComponent.h"
+
#include
#include
-#include "Max.h"
-#include "stdmat.h"
-#include "bmmlib.h"
-#include "istdplug.h"
-#include "texutil.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#pragma hdrstop
+#include "hsMaterialConverter.h"
#include "plLayerConverter.h"
#include "MaxComponent/plMaxAnimUtils.h"
#include "plResMgr/plKeyFinder.h"
-#include "hsResMgr.h"
#include "pnKeyedObject/plUoid.h"
#include "hsMaxLayerBase.h"
@@ -70,15 +79,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "MaxMain/MaxCompat.h"
#include "plInterp/plController.h"
-#include "hsExceptionStack.h"
-#include "hsStringTokenizer.h"
#include "plSurface/plLayerInterface.h"
#include "plSurface/plLayer.h"
#include "plSurface/plLayerAnimation.h"
#include "plGImage/plMipmap.h"
-#include "plgDispatch.h"
-
#include "pnMessage/plRefMsg.h"
#include "pnKeyedObject/plKey.h"
#include "pnKeyedObject/plKeyImp.h"
@@ -1124,8 +1129,6 @@ hsGMaterial *hsMaterialConverter::ICreateMaterial(Mtl *mtl, plMaxNode *node, con
hsGuardEnd;
}
-#include "MaxPlasmaMtls/Materials/plMultipassMtl.h"
-
//
// Handle materials for normal non-light, non-particle nodes.
//
@@ -2369,7 +2372,7 @@ bool hsMaterialConverter::IProcessPlasmaMaterial(Mtl *mtl, plMaxNode *node, hsGM
if (passBase->GetUseSpec())
{
shadeFlags |= hsGMatState::kShadeSpecular;
- shine = passBase->GetShine();
+ shine = (float)passBase->GetShine();
specColor = passBase->GetSpecularColor();
}
@@ -2630,7 +2633,6 @@ void hsMaterialConverter::IAddLayerToMaterial(hsGMaterial *mat, plLayerInterface
//
// Functions called by the converters up above...
//
-#include "MaxPlasmaMtls/Layers/plLayerTex.h"
//// IMustBeUniqueMaterial ////////////////////////////////////////////////////
// Fun stuff here. If one of the layers of the material is a dynamic EnvMap,
@@ -4246,7 +4248,7 @@ bool hsMaterialConverter::HasMaterialDiffuseOrOpacityAnimation(plMaxNode* nod
{
plPassMtlBase* passMtl = (plPassMtlBase*)subMtl;
if( plPassMtlBase::kBlendAlpha == passMtl->GetOutputBlend() )
- baseOpac = passMtl->GetOpacity();
+ baseOpac = (float)passMtl->GetOpacity();
}
int iMtl;
for( iMtl = 1; iMtl < mtl->NumSubMtls(); iMtl++ )
@@ -4259,7 +4261,7 @@ bool hsMaterialConverter::HasMaterialDiffuseOrOpacityAnimation(plMaxNode* nod
{
if( baseOpac >= 0 )
return true;
- baseOpac = passMtl->GetOpacity();
+ baseOpac = (float)passMtl->GetOpacity();
}
}
}
@@ -4536,12 +4538,12 @@ plClothingItem *hsMaterialConverter::GenerateClothingItem(plClothingMtl *mtl, co
Color tint1 = mtl->GetDefaultTint1();
Color tint2 = mtl->GetDefaultTint2();
- cloth->fDefaultTint1[0] = tint1.r * 255;
- cloth->fDefaultTint1[1] = tint1.g * 255;
- cloth->fDefaultTint1[2] = tint1.b * 255;
- cloth->fDefaultTint2[0] = tint2.r * 255;
- cloth->fDefaultTint2[1] = tint2.g * 255;
- cloth->fDefaultTint2[2] = tint2.b * 255;
+ cloth->fDefaultTint1[0] = (uint8_t)(tint1.r * 255.f);
+ cloth->fDefaultTint1[1] = (uint8_t)(tint1.g * 255.f);
+ cloth->fDefaultTint1[2] = (uint8_t)(tint1.b * 255.f);
+ cloth->fDefaultTint2[0] = (uint8_t)(tint2.r * 255.f);
+ cloth->fDefaultTint2[1] = (uint8_t)(tint2.g * 255.f);
+ cloth->fDefaultTint2[2] = (uint8_t)(tint2.b * 255.f);
clothKeyName = plString::Format("CItm_%s", cloth->fName);
hsgResMgr::ResMgr()->NewKey(clothKeyName, cloth, loc);
diff --git a/Sources/Tools/MaxConvert/hsMaterialConverter.h b/Sources/Tools/MaxConvert/hsMaterialConverter.h
index e56a1ebb..2f77f1c3 100644
--- a/Sources/Tools/MaxConvert/hsMaterialConverter.h
+++ b/Sources/Tools/MaxConvert/hsMaterialConverter.h
@@ -43,11 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define __HSMATERIALCONVERTER_H
#include "HeadSpin.h"
-#include "hsTemplates.h"
-
-#include "Max.h"
-
-class Interface;
class hsStream;
class hsScene;
@@ -64,19 +59,21 @@ class plBitmap;
class plMipmap;
class plErrorMsg;
class plString;
+class plLocation;
-class Mtl;
-class Texmap;
-class plMaxNode;
-class StdUVGen;
-class BitmapTex;
-class StdMat;
-class TSTR;
class Animatable;
+struct BMM_Color_64;
class Bitmap;
-class plLocation;
-
+class BitmapTex;
+class Color;
+class Interface;
+class Mtl;
+class Point3;
+class StdMat;
+class StdUVGen;
+class Texmap;
+class plMaxNode;
class plLayerTex;
class plBitmapData;
class plCubicRenderTarget;
diff --git a/Sources/Tools/MaxConvert/hsMaxLayerBase.h b/Sources/Tools/MaxConvert/hsMaxLayerBase.h
index 7b6e8f9c..fe870fcb 100644
--- a/Sources/Tools/MaxConvert/hsMaxLayerBase.h
+++ b/Sources/Tools/MaxConvert/hsMaxLayerBase.h
@@ -42,8 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef __HSMAXLAYERBASE_H
#define __HSMAXLAYERBASE_H
-#include "stdmat.h"
-
#define HSMAX_LAYER_CLASS_ID 0x41990fe7
const Class_ID hsMaxLayerClassID(HSMAX_LAYER_CLASS_ID, 0x72404998);
diff --git a/Sources/Tools/MaxConvert/hsVertexShader.cpp b/Sources/Tools/MaxConvert/hsVertexShader.cpp
index b382df85..379d59cd 100644
--- a/Sources/Tools/MaxConvert/hsVertexShader.cpp
+++ b/Sources/Tools/MaxConvert/hsVertexShader.cpp
@@ -52,18 +52,20 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "HeadSpin.h"
-
-#include "Max.h"
-#include "stdmat.h"
-#include "istdplug.h"
-#include "dummy.h"
-#include "notetrck.h"
-
-#include "MaxMain/plMaxNode.h"
#include "hsBitVector.h"
-
+#include "hsExceptionStack.h"
#include "hsMatrix44.h"
#include "hsTemplates.h"
+#include "hsWindows.h"
+
+#include
+#include
+#include
+#include
+#include
+#pragma hdrstop
+
+#include "MaxMain/plMaxNode.h"
#include "plSurface/hsGMaterial.h"
#include "UserPropMgr.h"
@@ -72,7 +74,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsConverterUtils.h"
#include "hsControlConverter.h"
-#include "hsExceptionStack.h"
#include "plSurface/hsGMaterial.h"
#include "plSurface/plLayerInterface.h"
diff --git a/Sources/Tools/MaxConvert/plBitmapCreator.cpp b/Sources/Tools/MaxConvert/plBitmapCreator.cpp
index 5e9f964e..e814a765 100644
--- a/Sources/Tools/MaxConvert/plBitmapCreator.cpp
+++ b/Sources/Tools/MaxConvert/plBitmapCreator.cpp
@@ -39,10 +39,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021
*==LICENSE==*/
+
#include "HeadSpin.h"
-#include "max.h"
+#include "hsWindows.h"
+
+#include
#include
-#include "bmmlib.h"
+#include
+#pragma hdrstop
#include "plGImage/plMipmap.h"
#include "hsExceptionStack.h"
diff --git a/Sources/Tools/MaxConvert/plBitmapCreator.h b/Sources/Tools/MaxConvert/plBitmapCreator.h
index 00b3fa0a..7fa18561 100644
--- a/Sources/Tools/MaxConvert/plBitmapCreator.h
+++ b/Sources/Tools/MaxConvert/plBitmapCreator.h
@@ -39,16 +39,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021
*==LICENSE==*/
-#include "HeadSpin.h"
-#include "pnKeyedObject/plKey.h"
class BitmapInfo;
class Bitmap;
class plBitmap;
+class plErrorMsg;
+class plKey;
+class plLocation;
class plMipmap;
class hsMaxLayerBase;
-class plLocation;
-class plErrorMsg;
class plBitmapData
diff --git a/Sources/Tools/MaxConvert/plClusterUtil.cpp b/Sources/Tools/MaxConvert/plClusterUtil.cpp
index b5516805..8ffc3435 100644
--- a/Sources/Tools/MaxConvert/plClusterUtil.cpp
+++ b/Sources/Tools/MaxConvert/plClusterUtil.cpp
@@ -41,21 +41,23 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
-#include
-
-#include "Max.h"
-#include "stdmat.h"
-#include "bmmlib.h"
-#include "iparamb2.h"
-#include "meshdlib.h"
+#include "hsColorRGBA.h"
+#include "hsGeometry3.h"
+#include "hsResMgr.h"
+#include "plTweak.h"
-#include "HeadSpin.h"
+#include "MaxComponent/plComponent.h"
-#include
#include
+#include
+#include
+#include
+#include
+#include
+#include
+#pragma hdrstop
#include "MaxMain/plMaxNode.h"
-#include "MaxComponent/plComponent.h"
#include "MaxComponent/plLightGrpComponent.h"
#include "MaxComponent/plSoftVolumeComponent.h"
@@ -76,13 +78,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsVertexShader.h"
#include "plLightMapGen.h"
-#include "hsResMgr.h"
#include "pnKeyedObject/plUoid.h"
#include "pnMessage/plNodeRefMsg.h"
-#include "plTweak.h"
-
plConst(int) kDefMinFaces(200);
plConst(int) kDefMaxFaces(1000);
plConst(float) kDefMinSize(50.f);
diff --git a/Sources/Tools/MaxConvert/plClusterUtil.h b/Sources/Tools/MaxConvert/plClusterUtil.h
index 249737a5..67c96d8d 100644
--- a/Sources/Tools/MaxConvert/plClusterUtil.h
+++ b/Sources/Tools/MaxConvert/plClusterUtil.h
@@ -43,17 +43,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plClusterUtil_inc
#define plClusterUtil_inc
-#include "hsGeometry3.h"
-#include "hsColorRGBA.h"
-
#include "plDrawable/plSpanInstance.h"
-class plMaxNode;
-class plClusterGroup;
-class plSpanTemplateB;
class hsBounds3Ext;
class plCluster;
+class plClusterGroup;
class hsGMaterial;
+class plMaxNode;
+class Point3;
+class plSpanEncoding;
+class plSpanTemplateB;
+struct hsVector3;
class plDeformVert
{
diff --git a/Sources/Tools/MaxConvert/plConvert.cpp b/Sources/Tools/MaxConvert/plConvert.cpp
index dbefec88..bf255780 100644
--- a/Sources/Tools/MaxConvert/plConvert.cpp
+++ b/Sources/Tools/MaxConvert/plConvert.cpp
@@ -44,16 +44,22 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// 3DSMax HeadSpin exporter
//
#include "HeadSpin.h"
-#include "Max.h"
-#include "istdplug.h"
-#include "Notify.h"
+#include "plgDispatch.h"
+#include "hsResMgr.h"
+#include "hsStringTokenizer.h"
+#include "hsTemplates.h"
+#include "hsWindows.h"
+
+#include
+#include
+#include
#include
-#include "bmmlib.h"
-#include "INode.h"
+#include
+#include
+#include
+#pragma hdrstop
#include "plConvert.h"
-#include "hsResMgr.h"
-#include "hsTemplates.h"
#include "hsConverterUtils.h"
#include "hsControlConverter.h"
@@ -61,12 +67,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsMaterialConverter.h"
#include "plLayerConverter.h"
#include "UserPropMgr.h"
-#include "hsStringTokenizer.h"
#include "MaxExport/plErrorMsg.h"
#include "hsVertexShader.h"
#include "plLightMapGen.h"
#include "plBitmapCreator.h"
-#include "plgDispatch.h"
#include "pnMessage/plTimeMsg.h"
#include "MaxComponent/plComponent.h"
@@ -76,6 +80,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "MaxComponent/plClusterComponent.h"
#include "plPhysX/plSimulationMgr.h"
+#include "MaxMain/plMaxMeshExtractor.h"
#include "MaxMain/plPhysXCooking.h"
#include "MaxExport/plExportProgressBar.h"
diff --git a/Sources/Tools/MaxConvert/plConvert.h b/Sources/Tools/MaxConvert/plConvert.h
index 1aa35d6c..604b7c29 100644
--- a/Sources/Tools/MaxConvert/plConvert.h
+++ b/Sources/Tools/MaxConvert/plConvert.h
@@ -43,11 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plConvert_inc
#define plConvert_inc
-#include "HeadSpin.h"
-#include "hsTemplates.h"
-#include "pnKeyedObject/plKey.h"
-
class plErrorMsg;
+class plKey;
class plLocation;
class plMaxNode;
class plMessage;
diff --git a/Sources/Tools/MaxConvert/plDistTree.cpp b/Sources/Tools/MaxConvert/plDistTree.cpp
index b052bb9a..47a8b1ae 100644
--- a/Sources/Tools/MaxConvert/plDistTree.cpp
+++ b/Sources/Tools/MaxConvert/plDistTree.cpp
@@ -41,7 +41,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
-#include "Max.h"
+#include "hsTemplates.h"
+#include "hsWindows.h"
+#include
+#pragma hdrstop
#include "plDistTree.h"
diff --git a/Sources/Tools/MaxConvert/plDistTree.h b/Sources/Tools/MaxConvert/plDistTree.h
index 0eb48f93..49903b3b 100644
--- a/Sources/Tools/MaxConvert/plDistTree.h
+++ b/Sources/Tools/MaxConvert/plDistTree.h
@@ -43,8 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plDistTree_inc
#define plDistTree_inc
-#include "hsTemplates.h"
-
class plDistNode
{
public:
diff --git a/Sources/Tools/MaxConvert/plDistributor.cpp b/Sources/Tools/MaxConvert/plDistributor.cpp
index a4b2a29b..20cab330 100644
--- a/Sources/Tools/MaxConvert/plDistributor.cpp
+++ b/Sources/Tools/MaxConvert/plDistributor.cpp
@@ -41,13 +41,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
-#include
+#include "hsGeometry3.h"
+#include "hsTemplates.h"
+#include "hsWindows.h"
-#include "Max.h"
-#include "stdmat.h"
-#include "bmmlib.h"
-#include "iparamb2.h"
-#include "meshdlib.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#pragma hdrstop
#include "MaxExport/plExportProgressBar.h"
#include "MaxPlasmaMtls/Layers/plLayerTexBitmapPB.h"
@@ -55,9 +59,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsMaterialConverter.h"
-#include "HeadSpin.h"
-#include "hsGeometry3.h"
-
#include "plMath/plTriUtils.h"
#include "plDistributor.h"
diff --git a/Sources/Tools/MaxConvert/plLayerConverter.cpp b/Sources/Tools/MaxConvert/plLayerConverter.cpp
index c6e3ddef..f69dbce5 100644
--- a/Sources/Tools/MaxConvert/plLayerConverter.cpp
+++ b/Sources/Tools/MaxConvert/plLayerConverter.cpp
@@ -60,23 +60,25 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "HeadSpin.h"
-#include "Max.h"
-#include "stdmat.h"
-#include "istdplug.h"
-#include "iparamb2.h"
-#include "iparamm2.h"
-
-
#include "hsExceptionStack.h"
+#include "hsResMgr.h"
+#include "hsTemplates.h"
+#include "hsWindows.h"
+
+#include
+#include
+#include
+#include
+#include
+#pragma hdrstop
#include "plLayerConverter.h"
-#include "MaxConvert/hsMaxLayerBase.h"
-#include "MaxConvert/hsConverterUtils.h"
-#include "MaxConvert/hsControlConverter.h"
-#include "MaxConvert/hsMaterialConverter.h"
-#include "MaxConvert/plBitmapCreator.h"
-#include "hsResMgr.h"
+#include "hsMaxLayerBase.h"
+#include "hsConverterUtils.h"
+#include "hsControlConverter.h"
+#include "hsMaterialConverter.h"
+#include "plBitmapCreator.h"
#include "MaxExport/plErrorMsg.h"
#include "MaxMain/plMaxNode.h"
@@ -750,10 +752,11 @@ uint32_t *plLayerConverter::IGetInitBitmapBuffer( plDynamicTextLayer *layer ) c
for( int x = 0; x < width; x++ )
{
- color.SetARGB( p64[ x ].a * 255.f / 65535.f,
- p64[ x ].r * 255.f / 65535.f,
- p64[ x ].g * 255.f / 65535.f,
- p64[ x ].b * 255.f / 65535.f );
+ const float konst = 255.f / 65535.f;
+ color.SetARGB((uint8_t)(p64[ x ].a * konst),
+ (uint8_t)(p64[ x ].r * konst),
+ (uint8_t)(p64[ x ].g * konst),
+ (uint8_t)(p64[ x ].b * konst));
buffPtr[ x ] = color;
}
diff --git a/Sources/Tools/MaxConvert/plLayerConverter.h b/Sources/Tools/MaxConvert/plLayerConverter.h
index 764ff346..6dfee79b 100644
--- a/Sources/Tools/MaxConvert/plLayerConverter.h
+++ b/Sources/Tools/MaxConvert/plLayerConverter.h
@@ -53,10 +53,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef _plLayerConverter_h
#define _plLayerConverter_h
-#include "HeadSpin.h"
-#include "hsTemplates.h"
-#include "Max.h"
-
//// Class Definition /////////////////////////////////////////////////////////
diff --git a/Sources/Tools/MaxConvert/plLightMapGen.cpp b/Sources/Tools/MaxConvert/plLightMapGen.cpp
index fad508ac..2adf7606 100644
--- a/Sources/Tools/MaxConvert/plLightMapGen.cpp
+++ b/Sources/Tools/MaxConvert/plLightMapGen.cpp
@@ -40,12 +40,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
-//#define MF_NEW_RGC
-
#include "HeadSpin.h"
-#include "Max.h"
-#include "dummy.h"
-#include "notify.h"
+#include "hsFastMath.h"
+#include "hsTemplates.h"
+#include "hsWindows.h"
+
+#include "MaxComponent/plComponent.h"
+
+#include
+#include
+#include
+#pragma hdrstop
#include "plLightMapGen.h"
#include "plGImage/plMipmap.h"
@@ -57,7 +62,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plSurface/hsGMaterial.h"
#include "MaxMain/plPluginResManager.h"
#include "plDrawable/plGeometrySpan.h"
-#include "hsFastMath.h"
#include "hsControlConverter.h"
#include "plBitmapCreator.h"
#include "pnKeyedObject/plKey.h"
@@ -968,7 +972,7 @@ bool plLightMapGen::ISpotAffectsNode(plLightMapInfo* liInfo, LightObject* liObj,
liObj->EvalLightState(TimeValue(0), FOREVER, &ls);
float coneRad[2];
- coneRad[0] = ls.fallsize * M_PI / 180.f;
+ coneRad[0] = (float)(ls.fallsize * M_PI / 180.f);
coneRad[1] = coneRad[0];
if( ls.shape == RECT_LIGHT )
coneRad[1] /= ls.aspect;
@@ -1567,7 +1571,7 @@ bool plLightMapGen::ISelectBitmapDimension(plMaxNode* node, const hsMatrix44& l2
if( duDr > 0 )
{
- fWidth = kTexPerFoot / duDr;
+ fWidth = (int)(kTexPerFoot / duDr);
if( fWidth > kMaxSize )
fWidth = kMaxSize;
@@ -1583,7 +1587,7 @@ bool plLightMapGen::ISelectBitmapDimension(plMaxNode* node, const hsMatrix44& l2
if( dvDr > 0 )
{
- fHeight = kTexPerFoot / duDr;
+ fHeight = (int)(kTexPerFoot / duDr);
if( fHeight > kMaxSize )
fHeight = kMaxSize;
diff --git a/Sources/Tools/MaxConvert/plLightMapGen.h b/Sources/Tools/MaxConvert/plLightMapGen.h
index 0fe3bf90..dd90d0bc 100644
--- a/Sources/Tools/MaxConvert/plLightMapGen.h
+++ b/Sources/Tools/MaxConvert/plLightMapGen.h
@@ -43,10 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plLightMapGen_inc
#define plLightMapGen_inc
-#include "hsTemplates.h"
-
-#include
-
class plMaxLightContext;
class plRenderGlobalContext;
class plLayerInterface;
diff --git a/Sources/Tools/MaxConvert/plMeshConverter.cpp b/Sources/Tools/MaxConvert/plMeshConverter.cpp
index 97e6811d..d87cb724 100644
--- a/Sources/Tools/MaxConvert/plMeshConverter.cpp
+++ b/Sources/Tools/MaxConvert/plMeshConverter.cpp
@@ -50,17 +50,22 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//////////////////////////////////////////////////////////////////////////////
#include "HeadSpin.h"
-#include "Max.h"
-#include "iparamb2.h"
-#include "modstack.h"
-#include "ISkin.h"
-#include "meshdlib.h"
+#include "hsBitVector.h"
+#include "hsExceptionStack.h"
+#include "hsResMgr.h"
+#include "hsTemplates.h"
+#include "plTweak.h"
+#include "hsWindows.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#pragma hdrstop
-#include "HeadSpin.h"
-#include "hsBitVector.h"
#include "plMeshConverter.h"
-#include "hsResMgr.h"
#include "MaxMain/plMaxNode.h"
#include "MaxExport/plErrorMsg.h"
#include "plSurface/hsGMaterial.h"
@@ -69,7 +74,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsConverterUtils.h"
#include "hsMaterialConverter.h"
#include "hsControlConverter.h"
-#include "hsExceptionStack.h"
#include "MaxPlasmaMtls/Materials/plCompositeMtl.h"
#include "MaxPlasmaMtls/Materials/plPassMtl.h"
#include "MaxPlasmaMtls/Materials/plCompositeMtlPB.h"
@@ -85,8 +89,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plStatusLog/plStatusLog.h"
-#include "plTweak.h"
-
//// Static Members //////////////////////////////////////////////////////////
bool plMeshConverter::fWarnBadNormals = true;
@@ -1351,9 +1353,9 @@ uint32_t plMeshConverter::ICreateHexColor( float r, float g, float b )
au = 0xff000000;
- ru = r * 255.0f;
- gu = g * 255.0f;
- bu = b * 255.0f;
+ ru = (uint32_t)(r * 255.0f);
+ gu = (uint32_t)(g * 255.0f);
+ bu = (uint32_t)(b * 255.0f);
return au | ( ru << 16 ) | ( gu << 8 ) | ( bu );
}
diff --git a/Sources/Tools/MaxConvert/plMeshConverter.h b/Sources/Tools/MaxConvert/plMeshConverter.h
index befc8128..52000698 100644
--- a/Sources/Tools/MaxConvert/plMeshConverter.h
+++ b/Sources/Tools/MaxConvert/plMeshConverter.h
@@ -54,10 +54,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef _plMeshConverter_h
#define _plMeshConverter_h
-#include "Max.h"
-#include "HeadSpin.h"
-#include "hsTemplates.h"
-
class plMaxNode;
class plErrorMsg;
class hsConverterUtils;
diff --git a/Sources/Tools/MaxConvert/plRenderGlobalContext.cpp b/Sources/Tools/MaxConvert/plRenderGlobalContext.cpp
index 25a3caa4..94c4c159 100644
--- a/Sources/Tools/MaxConvert/plRenderGlobalContext.cpp
+++ b/Sources/Tools/MaxConvert/plRenderGlobalContext.cpp
@@ -41,10 +41,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
-#include "Max.h"
+#include "hsTemplates.h"
+#include "hsWindows.h"
+#include
+#pragma hdrstop
#include "MaxMain/plMaxNode.h"
#include "plRenderGlobalContext.h"
+#include "plRenderInstance.h"
plRenderGlobalContext::plRenderGlobalContext(Interface* ip, TimeValue t)
{
@@ -114,6 +118,14 @@ void plRenderGlobalContext::MakeRenderInstances(plMaxNode* root, TimeValue t)
fInstList[i].SetNext(&fInstList[i+1]);
}
+RenderInstance* plRenderGlobalContext::GetRenderInstance(int i) const
+{
+ if (fInstList.GetCount() > i)
+ return &fInstList[i];
+ else
+ return nil;
+}
+
void plRenderGlobalContext::IMakeRenderInstances(plMaxNode* node, TimeValue t, bool isBarney)
{
const char* dbgNodeName = node->GetName();
diff --git a/Sources/Tools/MaxConvert/plRenderGlobalContext.h b/Sources/Tools/MaxConvert/plRenderGlobalContext.h
index 29ec9912..a464cf6a 100644
--- a/Sources/Tools/MaxConvert/plRenderGlobalContext.h
+++ b/Sources/Tools/MaxConvert/plRenderGlobalContext.h
@@ -43,8 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plRenderGlobalContext_inc
#define plRenderGlobalContext_inc
-#include "hsTemplates.h"
-#include "plRenderInstance.h"
+class plRenderInstance;
class plRenderGlobalContext : public RenderGlobalContext
{
@@ -63,8 +62,8 @@ public:
void MakeRenderInstances(plMaxNode* root, TimeValue t);
- virtual int NumRenderInstances() { return fInstList.GetCount(); }
- virtual RenderInstance* GetRenderInstance( int i ) { return i < fInstList.GetCount() ? &fInstList[i] : nil; }
+ virtual int NumRenderInstances() const { return fInstList.GetCount(); }
+ virtual RenderInstance* GetRenderInstance( int i ) const;
virtual void IntersectRay(RenderInstance *inst, Ray& ray, ISect &isct, ISectList &xpList, BOOL findExit);
virtual BOOL IntersectWorld(Ray &ray, int skipID, ISect &hit, ISectList &xplist, int blurFrame = NO_MOTBLUR);
diff --git a/Sources/Tools/MaxConvert/plRenderInstance.cpp b/Sources/Tools/MaxConvert/plRenderInstance.cpp
index 82ec1b69..c6bb83be 100644
--- a/Sources/Tools/MaxConvert/plRenderInstance.cpp
+++ b/Sources/Tools/MaxConvert/plRenderInstance.cpp
@@ -41,7 +41,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
-#include "Max.h"
+#include "hsTemplates.h"
+#include "hsWindows.h"
+#include
+#pragma hdrstop
#include "plRenderInstance.h"
diff --git a/Sources/Tools/MaxConvert/plRenderInstance.h b/Sources/Tools/MaxConvert/plRenderInstance.h
index a3a04aae..3cbd19e3 100644
--- a/Sources/Tools/MaxConvert/plRenderInstance.h
+++ b/Sources/Tools/MaxConvert/plRenderInstance.h
@@ -43,8 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plRenderInstance_inc
#define plRenderInstance_inc
-#include "hsTemplates.h"
-
class plRenderInstance : public RenderInstance
{
protected:
diff --git a/Sources/Tools/MaxMain/MaxCompat.h b/Sources/Tools/MaxMain/MaxCompat.h
index 36702273..71f0eba3 100644
--- a/Sources/Tools/MaxMain/MaxCompat.h
+++ b/Sources/Tools/MaxMain/MaxCompat.h
@@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef _PLASMA_MAXCOMPAT_H
#define _PLASMA_MAXCOMPAT_H
-#include "maxversion.h"
+#include
#if MAX_VERSION_MAJOR <= 9
#define BMMCOLOR(x, y, z, w) \