Browse Source

Untangle MaxExport

Adam Johnson 12 years ago
parent
commit
ad8e87370d
  1. 2
      Sources/Tools/MaxConvert/plConvert.cpp
  2. 1
      Sources/Tools/MaxExport/CMakeLists.txt
  3. 51
      Sources/Tools/MaxExport/Pch.cpp
  4. 77
      Sources/Tools/MaxExport/Pch.h
  5. 14
      Sources/Tools/MaxExport/SimpleExport.cpp
  6. 5
      Sources/Tools/MaxExport/SimpleExport.h
  7. 5
      Sources/Tools/MaxExport/plErrorMsg.cpp
  8. 2
      Sources/Tools/MaxExport/plErrorMsg.h
  9. 40
      Sources/Tools/MaxExport/plExportDlg.cpp
  10. 16
      Sources/Tools/MaxExport/plExportErrorMsg.cpp
  11. 1
      Sources/Tools/MaxExport/plExportErrorMsg.h
  12. 8
      Sources/Tools/MaxExport/plExportLogErrorMsg.cpp
  13. 1
      Sources/Tools/MaxExport/plExportLogErrorMsg.h
  14. 8
      Sources/Tools/MaxExport/plExportProgressBar.cpp
  15. 3
      Sources/Tools/MaxExport/plExportProgressBar.h

2
Sources/Tools/MaxConvert/plConvert.cpp

@ -57,6 +57,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <bmmlib.h> #include <bmmlib.h>
#include <INode.h> #include <INode.h>
#include <stdmat.h> #include <stdmat.h>
#include <vector>
#pragma hdrstop #pragma hdrstop
#include "plConvert.h" #include "plConvert.h"

1
Sources/Tools/MaxExport/CMakeLists.txt

@ -28,6 +28,7 @@ set(MaxExport_SOURCES
SimpleExport.cpp SimpleExport.cpp
) )
use_precompiled_header(Pch.h Pch.cpp MaxExport_HEADERS MaxExport_SOURCES)
add_library(MaxExport STATIC ${MaxExport_HEADERS} ${MaxExport_SOURCES}) add_library(MaxExport STATIC ${MaxExport_HEADERS} ${MaxExport_SOURCES})
source_group("Header Files" FILES ${MaxExport_HEADERS}) source_group("Header Files" FILES ${MaxExport_HEADERS})

51
Sources/Tools/MaxExport/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 <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 "Pch.h"
/**
* \file Pch.cpp
* \brief Precompiled Header object for MaxExport
*
* This file prompts MSVC to generate a PCH file for the MaxExport project. It
* has no function if precompiled headers are disabled in cmake.
*/

77
Sources/Tools/MaxExport/Pch.h

@ -0,0 +1,77 @@
/*==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==*/
#ifndef _MaxExport_Pch_inc_
#define _MaxExport_Pch_inc_
/**
* \file Pch.h
* \brief Precompiled Header for MaxConvert
*/
// Standard Library
#include <string>
#include <set>
#include <vector>
// Core Plasma
#include "HeadSpin.h"
#include "hsExceptionStack.h"
#include "hsExceptions.h"
#include "plFileUtils.h"
#include "hsStlSortUtils.h"
#include "hsStream.h"
// Windows
#include "hsWindows.h"
#include <commdlg.h>
// 3ds Max SDK
// This stuff should ALWAYS come after hsWindows.h
#include <bmmlib.h>
#include <guplib.h>
#include <iparamb2.h>
#include <max.h>
#include <notify.h>
#endif // _MaxExport_Pch_inc_

14
Sources/Tools/MaxExport/SimpleExport.cpp

@ -44,14 +44,20 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// //
#include "HeadSpin.h" #include "HeadSpin.h"
#include "SimpleExport.h" #include "hsExceptionStack.h"
#include "notify.h" #include "plFileUtils.h"
#include "hsStream.h"
#include <bitmap.h>
#include <notify.h>
#include <max.h>
#pragma hdrstop
#include "SimpleExport.h"
#include "plExportErrorMsg.h" #include "plExportErrorMsg.h"
#include "plExportLogErrorMsg.h" #include "plExportLogErrorMsg.h"
#include "MaxConvert/UserPropMgr.h" #include "MaxConvert/UserPropMgr.h"
#include "hsExceptionStack.h"
#include "MaxConvert/hsConverterUtils.h" #include "MaxConvert/hsConverterUtils.h"
#include "MaxConvert/plBitmapCreator.h" #include "MaxConvert/plBitmapCreator.h"
#include "pfPython/plPythonFileMod.h" #include "pfPython/plPythonFileMod.h"
@ -59,7 +65,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "MaxMain/plPluginResManager.h" #include "MaxMain/plPluginResManager.h"
#include "plResMgr/plRegistryHelpers.h" #include "plResMgr/plRegistryHelpers.h"
#include "plResMgr/plRegistryNode.h" #include "plResMgr/plRegistryNode.h"
#include "hsStream.h"
#include "MaxConvert/plConvert.h" #include "MaxConvert/plConvert.h"
#include "MaxConvert/hsMaterialConverter.h" #include "MaxConvert/hsMaterialConverter.h"
@ -79,7 +84,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plExportDlg.h" #include "plExportDlg.h"
#include "plStatusLog/plStatusLog.h" #include "plStatusLog/plStatusLog.h"
#include "plFileUtils.h"
#include "plAvatar/plAvatarMgr.h" #include "plAvatar/plAvatarMgr.h"

5
Sources/Tools/MaxExport/SimpleExport.h

@ -42,11 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef __SIMPLEEXPORT_H #ifndef __SIMPLEEXPORT_H
#define __SIMPLEEXPORT_H #define __SIMPLEEXPORT_H
#include "MaxMain/resource.h"
#include "Max.h"
#include "HeadSpin.h"
// //
// Inlines // Inlines
// //

5
Sources/Tools/MaxExport/plErrorMsg.cpp

@ -39,11 +39,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021 Mead, WA 99021
*==LICENSE==*/ *==LICENSE==*/
#include "HeadSpin.h"
#include "plErrorMsg.h"
#include "HeadSpin.h" #include "HeadSpin.h"
#include "hsExceptions.h" #include "hsExceptions.h"
#pragma hdrstop
#include "plErrorMsg.h" #include "plErrorMsg.h"

2
Sources/Tools/MaxExport/plErrorMsg.h

@ -42,8 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef __plErrorMsg_h #ifndef __plErrorMsg_h
#define __plErrorMsg_h #define __plErrorMsg_h
#include "HeadSpin.h"
#define PL_ERR_MSG_MAX_MSG 2048 #define PL_ERR_MSG_MAX_MSG 2048
class plErrorMsg class plErrorMsg

40
Sources/Tools/MaxExport/plExportDlg.cpp

@ -39,18 +39,26 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021 Mead, WA 99021
*==LICENSE==*/ *==LICENSE==*/
#include "HeadSpin.h" #include "HeadSpin.h"
#include "HeadSpin.h" #include "hsStlSortUtils.h"
#include "plExportDlg.h" #include "hsWindows.h"
#include "MaxMain/resource.h"
#include "max.h"
#include "MaxMain/plMaxCFGFile.h" #include <bitmap.h>
#include <iparamb2.h>
#include <max.h>
#include <vector> #include <set>
#include <string> #include <string>
using std::vector; #include <vector>
using std::string; #pragma hdrstop
#include "plExportDlg.h"
#include "MaxComponent/plComponentBase.h"
#include "MaxComponent/plMiscComponents.h"
#include "MaxMain/resource.h"
#include "MaxMain/plMaxCFGFile.h"
#include "MaxMain/plMaxNode.h"
extern HINSTANCE hInstance; extern HINSTANCE hInstance;
@ -146,12 +154,6 @@ const char* plExportDlgImp::GetExportPage()
return fExportPage; return fExportPage;
} }
#include "MaxComponent/plComponentBase.h"
#include "MaxComponent/plMiscComponents.h"
#include "MaxMain/plMaxNode.h"
#include "hsStlSortUtils.h"
#include <set>
typedef std::set<plComponentBase*> CompSet; typedef std::set<plComponentBase*> CompSet;
static void GetPagesRecur(plMaxNode* node, CompSet& comps) static void GetPagesRecur(plMaxNode* node, CompSet& comps)
@ -385,7 +387,7 @@ void plExportDlgImp::Show()
fDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EXPORT), GetCOREInterface()->GetMAXHWnd(), ForwardDlgProc); fDlg = CreateDialog(hInstance, MAKEINTRESOURCE(IDD_EXPORT), GetCOREInterface()->GetMAXHWnd(), ForwardDlgProc);
} }
static bool IsExcluded(const char* fileName, vector<string>& excludeFiles) static bool IsExcluded(const char* fileName, std::vector<std::string>& excludeFiles)
{ {
for (int i = 0; i < excludeFiles.size(); i++) for (int i = 0; i < excludeFiles.size(); i++)
{ {
@ -396,7 +398,7 @@ static bool IsExcluded(const char* fileName, vector<string>& excludeFiles)
return false; return false;
} }
static bool AutoExportDir(const char* inputDir, const char* outputDir, const char* groupFiles, vector<string>& excludeFiles) static bool AutoExportDir(const char* inputDir, const char* outputDir, const char* groupFiles, std::vector<std::string>& excludeFiles)
{ {
bool exportedFile = false; bool exportedFile = false;
@ -466,7 +468,7 @@ static void ShutdownMax()
PostMessage(GetCOREInterface()->GetMAXHWnd(), WM_CLOSE, 0, 0); PostMessage(GetCOREInterface()->GetMAXHWnd(), WM_CLOSE, 0, 0);
} }
static void GetStringSection(const char* configFile, const char* keyName, vector<string>& strings) static void GetStringSection(const char* configFile, const char* keyName, std::vector<std::string>& strings)
{ {
char source[256]; char source[256];
GetPrivateProfileString("Settings", keyName, "", source, sizeof(source), configFile); GetPrivateProfileString("Settings", keyName, "", source, sizeof(source), configFile);
@ -501,13 +503,13 @@ void plExportDlgImp::StartAutoExport()
hsMessageBox_SuppressPrompts = true; hsMessageBox_SuppressPrompts = true;
// Files to ignore // Files to ignore
vector<string> excludeFiles; std::vector<std::string> excludeFiles;
GetStringSection(configFile, "ExcludeFiles", excludeFiles); GetStringSection(configFile, "ExcludeFiles", excludeFiles);
// //
// Get the file substrings to export in one session // Get the file substrings to export in one session
// //
vector<string> groupedFiles; std::vector<std::string> groupedFiles;
GetStringSection(configFile, "GroupedFiles", groupedFiles); GetStringSection(configFile, "GroupedFiles", groupedFiles);
for (int i = 0; i < groupedFiles.size(); i++) for (int i = 0; i < groupedFiles.size(); i++)

16
Sources/Tools/MaxExport/plExportErrorMsg.cpp

@ -40,12 +40,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include "HeadSpin.h" #include "HeadSpin.h"
#include "HeadSpin.h"
#include "plExportErrorMsg.h"
#include "hsExceptions.h" #include "hsExceptions.h"
#pragma hdrstop
#include "plExportErrorMsg.h"
bool plExportErrorMsg::Show() bool plExportErrorMsg::Show()
@ -61,7 +59,7 @@ bool plExportErrorMsg::Ask()
{ {
if( GetBogus() ) if( GetBogus() )
{ {
return IDYES == hsMessageBox(GetMsg(), GetLabel(), hsMessageBoxYesNo/*|hsMessageBoxIconExclamation*/); return hsMBoxYes == hsMessageBox(GetMsg(), GetLabel(), hsMessageBoxYesNo/*|hsMessageBoxIconExclamation*/);
} }
return false; return false;
} }
@ -86,12 +84,12 @@ bool plExportErrorMsg::CheckAskOrCancel()
{ {
strncat(GetMsg(), " - ABORT? (Cancel to mute warnings)", 255); strncat(GetMsg(), " - ABORT? (Cancel to mute warnings)", 255);
int ret = hsMessageBox(GetMsg(), GetLabel(), hsMessageBoxYesNoCancel/*|hsMessageBoxIconExclamation*/); int ret = hsMessageBox(GetMsg(), GetLabel(), hsMessageBoxYesNoCancel/*|hsMessageBoxIconExclamation*/);
if( IDYES == ret ) if( hsMBoxYes == ret )
{ {
sprintf(GetMsg(), "!Abort at user response to error!"); sprintf(GetMsg(), "!Abort at user response to error!");
Check(); Check();
} }
else if( IDCANCEL == ret ) else if( hsMBoxCancel == ret )
return 1; return 1;
} }
return false; return false;
@ -131,9 +129,7 @@ void plExportErrorMsg::Quit()
void plExportErrorMsg::IDebugThrow() void plExportErrorMsg::IDebugThrow()
{ {
try { try {
#if HS_BUILD_FOR_WIN32 DebugBreakIfDebuggerPresent();
DebugBreak();
#endif // HS_BUILD_FOR_WIN32
} }
catch(...) catch(...)
{ {

1
Sources/Tools/MaxExport/plExportErrorMsg.h

@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plExportErrorMsg_inc #ifndef plExportErrorMsg_inc
#define plExportErrorMsg_inc #define plExportErrorMsg_inc
#include <string.h>
#include "plErrorMsg.h" #include "plErrorMsg.h"
#if !HS_BUILD_FOR_WIN32 #if !HS_BUILD_FOR_WIN32

8
Sources/Tools/MaxExport/plExportLogErrorMsg.cpp

@ -40,14 +40,16 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include "HeadSpin.h" #include "HeadSpin.h"
#include "Max.h" #include "hsExceptions.h"
#include "hsWindows.h"
#include <commdlg.h> #include <commdlg.h>
#include <max.h>
#include <bmmlib.h> #include <bmmlib.h>
#include <guplib.h> #include <guplib.h>
#pragma hdrstop
#include "HeadSpin.h"
#include "plExportLogErrorMsg.h" #include "plExportLogErrorMsg.h"
#include "hsExceptions.h"
// //

1
Sources/Tools/MaxExport/plExportLogErrorMsg.h

@ -48,7 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// If there is no errors then there should be no file created. // If there is no errors then there should be no file created.
// //
#include <string.h>
#include "plErrorMsg.h" #include "plErrorMsg.h"
#if !HS_BUILD_FOR_WIN32 #if !HS_BUILD_FOR_WIN32

8
Sources/Tools/MaxExport/plExportProgressBar.cpp

@ -40,11 +40,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/ *==LICENSE==*/
#include "HeadSpin.h" #include "HeadSpin.h"
#include "Max.h" #include "hsWindows.h"
#include "plExportProgressBar.h"
#include <commdlg.h> #include <commdlg.h>
#include <max.h>
#include <bmmlib.h> #include <bmmlib.h>
#include <guplib.h> #include <guplib.h>
#pragma hdrstop
#include "plExportProgressBar.h"
namespace { namespace {
DWORD WINAPI ProgressDummyFunc(LPVOID arg) DWORD WINAPI ProgressDummyFunc(LPVOID arg)

3
Sources/Tools/MaxExport/plExportProgressBar.h

@ -42,8 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plExportProgressBar_inc #ifndef plExportProgressBar_inc
#define plExportProgressBar_inc #define plExportProgressBar_inc
#include "HeadSpin.h" class Interface;
class INode; class INode;
class plExportProgressBar class plExportProgressBar

Loading…
Cancel
Save