diff --git a/CMakeLists.txt b/CMakeLists.txt index 66ab43a7..32e72045 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,7 @@ find_package(OpenAL REQUIRED) find_package(PythonLibs REQUIRED) find_package(EXPAT REQUIRED) find_package(ZLIB REQUIRED) -find_package(PHYSX REQUIRED) #TODO: Not required if we aren't building the client +find_package(PhysX REQUIRED) #TODO: Not required if we aren't building the client find_package(Ogg REQUIRED) #TODO: Not required if we aren't building the client find_package(Vorbis REQUIRED) #TODO: Not required if we aren't building the client find_package(Speex REQUIRED) #TODO: Not required if we aren't building the client @@ -69,10 +69,21 @@ if(PLASMA_TARGETS STREQUAL "Ethereal") add_definitions(-DSTREAM_LOGGER) endif(PLASMA_TARGETS STREQUAL "Ethereal") +include(TestBigEndian) +test_big_endian(BIG_ENDIAN) +if(BIG_ENDIAN) + add_definitions(-DBIG_ENDIAN) +else() + add_definitions(-DLITTLE_ENDIAN) +endif() + if(MSVC) add_definitions(-D_CRT_SECURE_NO_WARNINGS) add_definitions(-D_SCL_SECURE_NO_WARNINGS) endif(MSVC) +#TODO: Make the OpenSSL includes less promiscuous so this isn't needed +include_directories(${OPENSSL_INCLUDE_DIR}) + add_subdirectory(Sources/Plasma) add_subdirectory(Sources/Tools) diff --git a/Sources/Plasma/Apps/plClient/CMakeLists.txt b/Sources/Plasma/Apps/plClient/CMakeLists.txt index 1efd5a95..e4c7667b 100644 --- a/Sources/Plasma/Apps/plClient/CMakeLists.txt +++ b/Sources/Plasma/Apps/plClient/CMakeLists.txt @@ -93,6 +93,9 @@ set(plClient_RESOURCES add_executable(plClient WIN32 ${plClient_SOURCES} ${plClient_HEADERS} ${plClient_TEXT} ${plClient_RESOURCES}) +if(PLASMA_EXTERNAL_RELEASE) + set_target_properties(plClient PROPERTIES OUTPUT_NAME "UruExplorer") +endif(PLASMA_EXTERNAL_RELEASE) target_link_libraries(plClient CoreLib) target_link_libraries(plClient CoreLibExe) target_link_libraries(plClient pfAnimation) @@ -184,8 +187,13 @@ target_link_libraries(plClient pnTimer) target_link_libraries(plClient pnUtils) target_link_libraries(plClient pnUtilsExe) -target_link_libraries(plClient debug ${PYTHON_DEBUG_LIBRARY}) -target_link_libraries(plClient optimized ${PYTHON_LIBRARY}) +if(PYTHON_DEBUG_LIBRARY) + target_link_libraries(plClient debug ${PYTHON_DEBUG_LIBRARY}) + target_link_libraries(plClient optimized ${PYTHON_LIBRARY}) +else() + target_link_libraries(plClient ${PYTHON_LIBRARY}) +endif() + target_link_libraries(plClient ${OPENAL_LIBRARY}) target_link_libraries(plClient ${OPENSSL_LIBRARIES}) target_link_libraries(plClient ${EXPAT_LIBRARY}) diff --git a/Sources/Plasma/Apps/plClient/res/plClient.rc b/Sources/Plasma/Apps/plClient/res/plClient.rc index dd96c179..fcc40005 100644 --- a/Sources/Plasma/Apps/plClient/res/plClient.rc +++ b/Sources/Plasma/Apps/plClient/res/plClient.rc @@ -2,15 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -34,25 +28,8 @@ END 2 TEXTINCLUDE BEGIN - "#include \r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "#define _AFX_NO_SPLITTER_RESOURCES\r\n" - "#define _AFX_NO_OLE_RESOURCES\r\n" - "#define _AFX_NO_TRACKER_RESOURCES\r\n" - "#define _AFX_NO_PROPERTY_RESOURCES\r\n" "\r\n" - "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n" - "#ifdef _WIN32\r\n" - "LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US\r\n" - "#pragma code_page(1252)\r\n" - "#endif //_WIN32\r\n" - "#endif\r\n" - "\r\n" - "CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST ""plClient.exe.manifest""\0" + "\0" END #endif // APSTUDIO_INVOKED diff --git a/Sources/Plasma/Apps/plPlasmaInstaller/plPlasmaInstaller.rc b/Sources/Plasma/Apps/plPlasmaInstaller/plPlasmaInstaller.rc index da984e23..9c9bca40 100644 --- a/Sources/Plasma/Apps/plPlasmaInstaller/plPlasmaInstaller.rc +++ b/Sources/Plasma/Apps/plPlasmaInstaller/plPlasmaInstaller.rc @@ -2,15 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -91,7 +85,6 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" "\0" END diff --git a/Sources/Plasma/Apps/plPlasmaUpdate/plPlasmaUpdate.rc b/Sources/Plasma/Apps/plPlasmaUpdate/plPlasmaUpdate.rc index 01a1f351..5d5463be 100644 --- a/Sources/Plasma/Apps/plPlasmaUpdate/plPlasmaUpdate.rc +++ b/Sources/Plasma/Apps/plPlasmaUpdate/plPlasmaUpdate.rc @@ -2,15 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -100,7 +94,6 @@ END 2 TEXTINCLUDE BEGIN - "#include ""afxres.h""\r\n" "\0" END diff --git a/Sources/Plasma/Apps/plPythonPack/CMakeLists.txt b/Sources/Plasma/Apps/plPythonPack/CMakeLists.txt index 1af4b4f8..3fd9cf70 100644 --- a/Sources/Plasma/Apps/plPythonPack/CMakeLists.txt +++ b/Sources/Plasma/Apps/plPythonPack/CMakeLists.txt @@ -14,8 +14,13 @@ set(plPythonPack_HEADERS add_executable(plPythonPack ${plPythonPack_SOURCES} ${plPythonPack_HEADERS}) target_link_libraries(plPythonPack CoreLib CoreLibExe plFile) -target_link_libraries(plPythonPack debug ${PYTHON_DEBUG_LIBRARY}) -target_link_libraries(plPythonPack optimized ${PYTHON_LIBRARY}) + +if(PYTHON_DEBUG_LIBRARY) + target_link_libraries(plPythonPack debug ${PYTHON_DEBUG_LIBRARY}) + target_link_libraries(plPythonPack optimized ${PYTHON_LIBRARY}) +else() + target_link_libraries(plPythonPack ${PYTHON_LIBRARY}) +endif() source_group("Source Files" FILES ${plPythonPack_SOURCES}) source_group("Header Files" FILES ${plPythonPack_HEADERS}) diff --git a/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt b/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt index f8a384a1..c759488c 100644 --- a/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt +++ b/Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt @@ -29,6 +29,9 @@ set(plUruLauncher_RESOURCES add_executable(plUruLauncher WIN32 ${plUruLauncher_SOURCES} ${plUruLauncher_HEADERS} ${plUruLauncher_RESOURCES}) +if(PLASMA_EXTERNAL_RELEASE) + set_target_properties(plUruLauncher PROPERTIES OUTPUT_NAME UruLauncher) +endif(PLASMA_EXTERNAL_RELEASE) target_link_libraries(plUruLauncher CoreLib) target_link_libraries(plUruLauncher CoreLibExe) target_link_libraries(plUruLauncher pfConsoleCore) diff --git a/Sources/Plasma/Apps/plUruLauncher/plUruLauncher.rc b/Sources/Plasma/Apps/plUruLauncher/plUruLauncher.rc index 1f750357..e6261ee9 100644 --- a/Sources/Plasma/Apps/plUruLauncher/plUruLauncher.rc +++ b/Sources/Plasma/Apps/plUruLauncher/plUruLauncher.rc @@ -2,15 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -33,12 +27,6 @@ BEGIN END 2 TEXTINCLUDE -BEGIN - "#include \r\n" - "\0" -END - -3 TEXTINCLUDE BEGIN "\r\n" "\0" diff --git a/Sources/Plasma/CoreLib/CMakeLists.txt b/Sources/Plasma/CoreLib/CMakeLists.txt index 7f01811a..70150197 100644 --- a/Sources/Plasma/CoreLib/CMakeLists.txt +++ b/Sources/Plasma/CoreLib/CMakeLists.txt @@ -74,6 +74,7 @@ set(CoreLib_HEADERS hsScalar.h hsStlSortUtils.h hsSTLStream.h + hsStlUtils.h hsStream.h hsStringTokenizer.h hsTemplates.h diff --git a/Sources/Plasma/CoreLib/hsMalloc.h b/Sources/Plasma/CoreLib/hsMalloc.h index c96454fb..e6b8ff60 100644 --- a/Sources/Plasma/CoreLib/hsMalloc.h +++ b/Sources/Plasma/CoreLib/hsMalloc.h @@ -159,7 +159,7 @@ inline void __cdecl operator delete (void *, void *) {} #ifdef __cplusplus #if !defined(HS_NO_TYPEINFO) -#include +#include #endif #endif // ifdef __cplusplus diff --git a/Sources/Plasma/CoreLib/hsUtils.h b/Sources/Plasma/CoreLib/hsUtils.h index ab46d9c5..339e7395 100644 --- a/Sources/Plasma/CoreLib/hsUtils.h +++ b/Sources/Plasma/CoreLib/hsUtils.h @@ -50,6 +50,7 @@ char * hsFormatStrV(const char * fmt, va_list args); // You are responsible f #define strnicmp _strnicmp #define wcsicmp _wcsicmp #define wcsnicmp _wcsnicmp +#define strlwr _strlwr #else #define stricmp strcasecmp #define strnicmp strncasecmp diff --git a/Sources/Plasma/CoreLibExe/CMakeLists.txt b/Sources/Plasma/CoreLibExe/CMakeLists.txt index 6d8abf9b..30caf2bf 100644 --- a/Sources/Plasma/CoreLibExe/CMakeLists.txt +++ b/Sources/Plasma/CoreLibExe/CMakeLists.txt @@ -1,5 +1,7 @@ add_definitions(-D_LIB) +include_directories("../../Plasma/CoreLib") + set(CoreLibExe_SOURCES hsExeError.cpp hsExeMalloc.cpp diff --git a/Sources/Plasma/CoreLibExe/Pch.h b/Sources/Plasma/CoreLibExe/Pch.h index 98bfe82d..ed60a32d 100644 --- a/Sources/Plasma/CoreLibExe/Pch.h +++ b/Sources/Plasma/CoreLibExe/Pch.h @@ -36,14 +36,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #pragma warning(push, 3) -#include "../CoreLib/HeadSpin.h" -#include "../CoreLib/hsConfig.h" -#include "../CoreLib/hsTypes.h" -#include "../CoreLib/hsWindows.h" -#include "../CoreLib/hsMalloc.h" -#include "../CoreLib/hsCritSect.h" -#include "../CoreLib/hsUtils.h" -#include "../CoreLib/hsWindows.h" +#include "HeadSpin.h" +#include "hsConfig.h" +#include "hsTypes.h" +#include "hsWindows.h" +#include "hsMalloc.h" +#include "hsCritSect.h" +#include "hsUtils.h" +#include "hsWindows.h" #pragma warning(pop) diff --git a/Sources/Plasma/FeatureLib/pfAnimation/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfAnimation/CMakeLists.txt index 08d90741..36bcd4f3 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfAnimation/CMakeLists.txt @@ -3,11 +3,6 @@ include_directories("../../NucleusLib") include_directories("../../NucleusLib/inc") include_directories("../../PubUtilLib") -include_directories(${OPENSSL_INCLUDE_DIR}) - -# this is in the vcproj, but it seems silly for animation... -# find_package(OpenSSL REQUIRED) - set(pfAnimation_SOURCES pfObjectFlocker.cpp plAnimDebugList.cpp diff --git a/Sources/Plasma/FeatureLib/pfAudio/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfAudio/CMakeLists.txt index 31350f2f..a5f69bef 100644 --- a/Sources/Plasma/FeatureLib/pfAudio/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfAudio/CMakeLists.txt @@ -5,7 +5,6 @@ include_directories(../../NucleusLib/inc) include_directories(../../PubUtilLib) #include_directories(../../PubUtilLib/inc) -include_directories(${OPENSSL_INCLUDE_DIR}) include_directories(${OPENAL_INCLUDE_DIR}) set(pfAudio_SOURCES diff --git a/Sources/Plasma/FeatureLib/pfCamera/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfCamera/CMakeLists.txt index d228365f..5b0c80f2 100644 --- a/Sources/Plasma/FeatureLib/pfCamera/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfCamera/CMakeLists.txt @@ -4,8 +4,6 @@ include_directories(../../NucleusLib) include_directories(../../NucleusLib/inc) include_directories(../../PubUtilLib) -include_directories(${OPENSSL_INCLUDE_DIR}) - set(pfCamera_SOURCES pfCameraProxy.cpp plCameraBrain.cpp diff --git a/Sources/Plasma/FeatureLib/pfCharacter/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfCharacter/CMakeLists.txt index 8a4535e7..3f6fd895 100644 --- a/Sources/Plasma/FeatureLib/pfCharacter/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfCharacter/CMakeLists.txt @@ -4,8 +4,6 @@ include_directories(../../NucleusLib) include_directories(../../NucleusLib/inc) include_directories(../../PubUtilLib) -include_directories(${OPENSSL_INCLUDE_DIR}) - set(pfCharacter_SOURCES pfMarkerInfo.cpp pfMarkerMgr.cpp diff --git a/Sources/Plasma/FeatureLib/pfConsole/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfConsole/CMakeLists.txt index b44a8b9b..e8b2c3dd 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfConsole/CMakeLists.txt @@ -4,7 +4,6 @@ include_directories(../../NucleusLib) include_directories(../../NucleusLib/inc) include_directories(../../PubUtilLib) -include_directories(${OPENSSL_INCLUDE_DIR}) include_directories(${OPENAL_INCLUDE_DIR}) include_directories(${PYTHON_INCLUDE_DIR}) diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp index 8fbec9c8..fff95861 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfAvatarConsoleCommands.cpp @@ -68,7 +68,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plAvatar/plArmatureEffects.h" #include "plAvatar/plAvTaskSeek.h" -//#include "../plHavok1/plSimulationMgr.h" +//#include "plHavok1/plSimulationMgr.h" #include "pnNetCommon/plNetApp.h" #include "plNetClient/plNetClientMgr.h" #include "plDrawable/plInstanceDrawInterface.h" diff --git a/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCommandsCore.cpp b/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCommandsCore.cpp index 644d089a..52c6f00d 100644 --- a/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCommandsCore.cpp +++ b/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleCommandsCore.cpp @@ -61,14 +61,6 @@ void PrintStringF(void pfun(const char *),const char * fmt, ...) * ***/ -//TODO: Fix Plasma to use OpenSSL's byte order (or better yet, to use OpenSSL), -// so this hack isn't needed -static void swap_key_bytes(byte keyData[]) -{ - for (size_t i = 0; i < (kNetDiffieHellmanKeyBits / 16); ++i) - std::swap(keyData[i], keyData[ (kNetDiffieHellmanKeyBits / 8) - i - 1 ]); -} - //============================================================================ // Server group PF_CONSOLE_GROUP(Server) @@ -159,7 +151,6 @@ PF_CONSOLE_CMD( Base64Decode(hsStrlen((const char *)params[0]), (const char *)params[0], kNetDiffieHellmanKeyBits / 8, kAuthDhNData); - swap_key_bytes(kAuthDhNData); } //============================================================================ @@ -178,7 +169,6 @@ PF_CONSOLE_CMD( Base64Decode(hsStrlen((const char *)params[0]), (const char *)params[0], kNetDiffieHellmanKeyBits / 8, kAuthDhXData); - swap_key_bytes(kAuthDhXData); } @@ -214,7 +204,6 @@ PF_CONSOLE_CMD( Base64Decode(hsStrlen((const char *)params[0]), (const char *)params[0], kNetDiffieHellmanKeyBits / 8, kCsrDhNData); - swap_key_bytes(kCsrDhNData); } //============================================================================ @@ -233,7 +222,6 @@ PF_CONSOLE_CMD( Base64Decode(hsStrlen((const char *)params[0]), (const char *)params[0], kNetDiffieHellmanKeyBits / 8, kCsrDhXData); - swap_key_bytes(kCsrDhXData); } @@ -257,7 +245,6 @@ PF_CONSOLE_CMD( Base64Decode(hsStrlen((const char *)params[0]), (const char *)params[0], kNetDiffieHellmanKeyBits / 8, kGameDhNData); - swap_key_bytes(kGameDhNData); } //============================================================================ @@ -276,7 +263,6 @@ PF_CONSOLE_CMD( Base64Decode(hsStrlen((const char *)params[0]), (const char *)params[0], kNetDiffieHellmanKeyBits / 8, kGameDhXData); - swap_key_bytes(kGameDhXData); } @@ -312,7 +298,6 @@ PF_CONSOLE_CMD( Base64Decode(hsStrlen((const char *)params[0]), (const char *)params[0], kNetDiffieHellmanKeyBits / 8, kGateKeeperDhNData); - swap_key_bytes(kGateKeeperDhNData); } //============================================================================ @@ -331,5 +316,4 @@ PF_CONSOLE_CMD( Base64Decode(hsStrlen((const char *)params[0]), (const char *)params[0], kNetDiffieHellmanKeyBits / 8, kGateKeeperDhXData); - swap_key_bytes(kGateKeeperDhXData); } diff --git a/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp b/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp index 95ba9a2f..779c3994 100644 --- a/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp +++ b/Sources/Plasma/FeatureLib/pfConsoleCore/pfConsoleEngine.cpp @@ -41,6 +41,7 @@ const Int32 pfConsoleEngine::fMaxNumParams = 16; static const char kTokenSeparators[] = " =\r\n\t,"; static const char kTokenGrpSeps[] = " =\r\n._\t,"; +//WARNING: Potentially increments the pointer passed to it. static char *console_strtok( char *&line, hsBool haveCommand ) { char *begin = line; @@ -461,6 +462,7 @@ hsBool pfConsoleEngine::FindPartialCmd( char *line, hsBool findAgain, hsBool pr static pfConsoleCmd *lastCmd = nil; static pfConsoleCmdGroup *lastGroup = nil, *lastParentGroup = nil; static char newStr[ 256 ]; + static char *originalLine = line; /// Repeat search @@ -525,13 +527,12 @@ hsBool pfConsoleEngine::FindPartialCmd( char *line, hsBool findAgain, hsBool pr if( preserveParams ) { /// Preserve the rest of the string after the matched command - ptr = strtok( nil, "\0" ); - if( ptr != nil ) - strcat( newStr, ptr ); + if( line != nil ) + strcat( newStr, line ); } // Copy back! - strcpy( line, newStr ); + strcpy( originalLine, newStr ); return true; } diff --git a/Sources/Plasma/FeatureLib/pfGameMgr/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfGameMgr/CMakeLists.txt index c3652c6d..90834319 100644 --- a/Sources/Plasma/FeatureLib/pfGameMgr/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfGameMgr/CMakeLists.txt @@ -4,8 +4,6 @@ include_directories(../../NucleusLib) include_directories(../../NucleusLib/inc) include_directories(../../PubUtilLib) -include_directories(${OPENSSL_INCLUDE_DIR}) - set(pfGameMgr_SOURCES pfGameMgr.cpp BlueSpiral/pfGmBlueSpiral.cpp diff --git a/Sources/Plasma/FeatureLib/pfJournalBook/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfJournalBook/CMakeLists.txt index 965e36da..c780ad21 100644 --- a/Sources/Plasma/FeatureLib/pfJournalBook/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfJournalBook/CMakeLists.txt @@ -4,8 +4,6 @@ include_directories(../../NucleusLib) include_directories(../../NucleusLib/inc) include_directories(../../PubUtilLib) -include_directories(${OPENSSL_INCLUDE_DIR}) - set(pfJournalBook_SOURCES pfJournalBook.cpp ) diff --git a/Sources/Plasma/FeatureLib/pfLoginDialog/pfLoginDialog.rc b/Sources/Plasma/FeatureLib/pfLoginDialog/pfLoginDialog.rc index 066e4c09..f4e94f94 100644 --- a/Sources/Plasma/FeatureLib/pfLoginDialog/pfLoginDialog.rc +++ b/Sources/Plasma/FeatureLib/pfLoginDialog/pfLoginDialog.rc @@ -2,15 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -34,7 +28,6 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" "\0" END diff --git a/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt index 56cee3c8..c005002c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt @@ -7,7 +7,6 @@ include_directories(../../) include_directories(${PYTHON_INCLUDE_DIR}) include_directories(${OPENAL_INCLUDE_DIR}) -include_directories(${OPENSSL_INCLUDE_DIR}) set(pfPython_SOURCES cyAccountManagement.cpp diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h index 75534e73..167145c2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGameGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGameGlue.cpp index 55bd3966..d7b4228e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGameGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGameGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyBlueSpiralGame.h" -#include +#include #include "../../pyEnum.h" /////////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsg.h index 821fdc86..3419f8a6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsg.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsgGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsgGlue.cpp index 0b143bec..239a9fb5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsgGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsgGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyBlueSpiralMsg.h" #include "../../pyEnum.h" -#include +#include /////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h index 810b8322..a6de4a48 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGameGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGameGlue.cpp index 7983e13e..5918ad8c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGameGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGameGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyClimbingWallGame.h" -#include +#include #include "../../pyEnum.h" /////////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsg.h index 0a964795..3d9e63ea 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsg.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsgGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsgGlue.cpp index 44a37498..355e5e9c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsgGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsgGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyClimbingWallMsg.h" #include "../../pyEnum.h" -#include +#include /////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h index 87dd5ab1..049bb1bb 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGameGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGameGlue.cpp index 63911241..dfce68ee 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGameGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGameGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyHeekGame.h" -#include +#include #include "../../pyEnum.h" /////////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h index dfb7b1e3..88497b24 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsgGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsgGlue.cpp index 6aa199b4..5f749855 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsgGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsgGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyHeekMsg.h" #include "../../pyEnum.h" -#include +#include /////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h index 52ad387e..23b0976d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGameGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGameGlue.cpp index cfe30f40..08a91272 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGameGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGameGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyMarkerGame.h" -#include +#include #include "../../pyEnum.h" /////////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h index 9cd3eda6..ca1066cd 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsgGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsgGlue.cpp index 723c0454..cef0f16a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsgGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsgGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyMarkerMsg.h" #include "../../pyEnum.h" -#include +#include /////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h index e93faf77..df0a8691 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGameGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGameGlue.cpp index e39d513c..a82f244d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGameGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGameGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyTTTGame.h" -#include +#include #include "../../pyEnum.h" /////////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsg.h index b7eee86f..0d67f5cb 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsg.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsgGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsgGlue.cpp index 59753b04..a8f160a9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsgGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsgGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyTTTMsg.h" #include "../../pyEnum.h" -#include +#include /////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h index 72f13e24..409afaa9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGameGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGameGlue.cpp index a39ba826..4aa6a67f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGameGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGameGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyVarSyncGame.h" -#include +#include #include "../../pyEnum.h" /////////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h index 9b1f3f16..a0ea6a56 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsgGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsgGlue.cpp index ffb65580..eac7b08a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsgGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsgGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyVarSyncMsg.h" #include "../../pyEnum.h" -#include +#include /////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h index 22d4e7c5..88d5d7fa 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../pyGlueHelpers.h" #include "../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliGlue.cpp index 1757dd49..35cd20c5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGameCli.h" #include "../pyEnum.h" -#include +#include /////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.h index 27fc6c20..64e9f5b2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../pyGlueHelpers.h" class pyGameCliMsg diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsgGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsgGlue.cpp index 4afe6f3f..2d165d58 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsgGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsgGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGameCliMsg.h" #include "../pyEnum.h" -#include +#include /////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h index 43429ed3..3a081eb7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" #include "pfGameMgr/pfGameMgr.h" -#include +#include #include "../pyGlueHelpers.h" class pyGameMgrMsg diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsgGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsgGlue.cpp index 6dfc71c7..5df47a87 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsgGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsgGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGameMgrMsg.h" #include "../pyEnum.h" -#include +#include /////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.h b/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.h index 2c703a2d..8c8554c6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyAccountManagement.h @@ -33,7 +33,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Python wrapper for account management functions // -#include +#include #include "hsTypes.h" #include "hsStlUtils.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h index 8355f904..60726f59 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "hsTemplates.h" -#include +#include #include "pyGlueHelpers.h" class cyAnimation diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAnimationGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAnimationGlue.cpp index 65acb4dd..ecf66345 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAnimationGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyAnimationGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "cyAnimation.h" #include "hsUtils.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptAnimation, cyAnimation); diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h index ab28fa04..8bb3d65c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h @@ -37,7 +37,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsBitVector.h" #include "pnKeyedObject/plKey.h" -#include +#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp index 33b79bec..5b234b54 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp @@ -31,7 +31,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plAvatar/plAvBrainHuman.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptAvatar, cyAvatar); diff --git a/Sources/Plasma/FeatureLib/pfPython/cyCamera.h b/Sources/Plasma/FeatureLib/pfPython/cyCamera.h index 26594526..873a3255 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyCamera.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyCamera.h @@ -37,7 +37,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnKeyedObject/plKey.h" class pyKey; -#include +#include #include "pyGlueHelpers.h" class cyCamera diff --git a/Sources/Plasma/FeatureLib/pfPython/cyCameraGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyCameraGlue.cpp index 2eacbfc1..adbacdb0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyCameraGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyCameraGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "cyCamera.h" #include "pyKey.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptCamera, cyCamera); diff --git a/Sources/Plasma/FeatureLib/pfPython/cyDraw.h b/Sources/Plasma/FeatureLib/pfPython/cyDraw.h index a35b95bc..abeb7080 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyDraw.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyDraw.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTemplates.h" #include "pnKeyedObject/plKey.h" -#include +#include #include "pyGlueHelpers.h" class cyDraw diff --git a/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp index 912508d4..4beeccf3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "cyDraw.h" #include "pyKey.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptDraw, cyDraw); diff --git a/Sources/Plasma/FeatureLib/pfPython/cyInputInterface.h b/Sources/Plasma/FeatureLib/pfPython/cyInputInterface.h index d50cd621..063a7490 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyInputInterface.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyInputInterface.h @@ -33,7 +33,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper to map InputInterface functions to plasma2 message // -#include +#include #include "pyGlueHelpers.h" class plInputInterface; diff --git a/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp index 61b139de..412c04a9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "cyInputInterface.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptInputInterface, cyInputInterface); diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.h b/Sources/Plasma/FeatureLib/pfPython/cyMisc.h index 764e7b4a..fe2afa51 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.h @@ -41,7 +41,7 @@ class pyColor; class pyAgeInfoStruct; class pyPoint3; -#include +#include #include "hsTypes.h" #include "hsStlUtils.h" #include "pnUtils/pnUtils.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp index e878bb6d..2a2c842d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue.cpp @@ -30,7 +30,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsUtils.h" -#include +#include PYTHON_GLOBAL_METHOD_DEFINITION_NOARGS(PtGetAgeName, "DEPRECIATED - use ptDniInfoSource instead") { diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp index 30ee778f..c6f4900b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plResMgr\plLocalization.h" #include "plMessage\plLOSRequestMsg.h" -#include +#include PYTHON_GLOBAL_METHOD_DEFINITION(PtYesNoDialog, args, "Params: selfkey,dialogMessage\nThis will display a Yes/No dialog to the user with the text dialogMessage\n" "This dialog _has_ to be answered by the user.\n" diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp index d254026b..85a00897 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue3.cpp @@ -28,7 +28,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "pySceneObject.h" -#include +#include PYTHON_GLOBAL_METHOD_DEFINITION(PtSendPetitionToCCR, args, "Params: message,reason=0,title=\"\"\nSends a petition with a message to the CCR group") { diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp index 1fb39176..d7f50c6d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue4.cpp @@ -32,7 +32,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "NucleusLib/inc/plPipeline.h" #include "pnNetBase/pnNetBase.h" -#include +#include PYTHON_GLOBAL_METHOD_DEFINITION(PtRequestLOSScreen, args, "Params: selfKey,ID,xPos,yPos,distance,what,reportType\nRequest a LOS check from a point on the screen") { diff --git a/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h b/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h index 0c78d43b..1beec8b9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h @@ -37,7 +37,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnKeyedObject/plKey.h" class pyKey; -#include +#include #include "pyGlueHelpers.h" class cyParticleSys diff --git a/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp index 0dd1c02a..526e92df 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "cyParticleSys.h" #include "pyKey.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptParticle, cyParticleSys); diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h b/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h index 14f1871a..dc7c8332 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTemplates.h" #include "pnKeyedObject/plKey.h" -#include +#include #include "pyGlueHelpers.h" class pyPoint3; diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp index a156b3e8..66e8af8a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp @@ -28,7 +28,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGeometry3.h" #include "pyMatrix44.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptPhysics, cyPhysics); diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h b/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h index 373af8b2..69e9ce0d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h @@ -32,7 +32,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE) #include "../../Apps/CyPythonIDE/plCyDebug/plCyDebServer.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h index 91b0d36f..efb0d644 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h @@ -38,7 +38,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsGeometry3.h" #include "hsResMgr.h" -#include +#include #include "plPythonParameter.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h index 59ad8e90..e127f8c0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h @@ -33,7 +33,7 @@ class plSimpleStateVariable; #include "hsStlUtils.h" #include "plModifier/plSDLModifier.h" -#include +#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifierGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifierGlue.cpp index 4f2ce7e9..04cba03d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifierGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifierGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plPythonSDLModifier.h" #include "pyKey.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptSDL, pySDLModifier); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp index e0bf0548..4aeab4e5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp @@ -107,7 +107,18 @@ const char * pyAgeInfoStruct::GetAgeInstanceGuid() const void pyAgeInfoStruct::SetAgeInstanceGuid( const char * guid ) { - fAgeInfo.SetAgeInstanceGuid( &plUUID( guid ) ); + if ( guid[0] == '@' ) + { + // if it starts with an @ then do a meta kind of GUID + std::string curInst = fAgeInfo.GetAgeInstanceName(); + std::string y = curInst + guid; + + plUUID instanceGuid; + CryptDigest(kCryptMd5, instanceGuid.fData , y.length(), y.c_str()); + fAgeInfo.SetAgeInstanceGuid(&instanceGuid); + } + else + fAgeInfo.SetAgeInstanceGuid( &plUUID( guid ) ); } Int32 pyAgeInfoStruct::GetAgeSequenceNumber() const diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h index c25cea74..86bd9849 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h @@ -30,7 +30,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" #include "plNetCommon/plNetServerSessionInfo.h" -#include +#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStructGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStructGlue.cpp index b77b4786..bf0808a0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStructGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStructGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyAgeInfoStruct.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptAgeInfoStruct, pyAgeInfoStruct); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h index 0eec878f..23b3d2fa 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h @@ -31,7 +31,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetCommon/plNetServerSessionInfo.h" #include "pyAgeInfoStruct.h" -#include +#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStructGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStructGlue.cpp index 563be956..b403abbd 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStructGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStructGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyAgeLinkStruct.h" #include "pySpawnPointInfo.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptAgeLinkStruct, pyAgeLinkStruct); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h index 4deb9f23..407326d7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h @@ -39,7 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" class pyVaultNode; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeVaultGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeVaultGlue.cpp index 5a6dae81..ce635228 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeVaultGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeVaultGlue.cpp @@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyAgeInfoStruct.h" #include "pySDL.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptAgeVault, pyAgeVault); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAlarm.h b/Sources/Plasma/FeatureLib/pfPython/pyAlarm.h index d4801c49..1677f27d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAlarm.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAlarm.h @@ -28,7 +28,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include struct pyAlarm; class pyAlarmMgr diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h b/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h index 72abb507..1010cd81 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h @@ -34,7 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" -#include +#include #include "pyGlueHelpers.h" class pyAudioControl diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAudioControlGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAudioControlGlue.cpp index fe49f630..6ab3106f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAudioControlGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAudioControlGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyAudioControl.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptAudioControl, pyAudioControl); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue.cpp index 7c73010c..00c2d988 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue.cpp @@ -26,4 +26,4 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyCCRMgr.h" #include "pyAgeLinkStruct.h" -#include +#include diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue2.cpp b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue2.cpp index 49ee5670..09a87cfb 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue2.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue2.cpp @@ -25,4 +25,4 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyCCRMgr.h" -#include +#include diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCluster.h b/Sources/Plasma/FeatureLib/pfPython/pyCluster.h index e3ed9295..c1091bdb 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCluster.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyCluster.h @@ -28,7 +28,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" -#include +#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyClusterGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyClusterGlue.cpp index 82ea3f9e..cc43f0d1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyClusterGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyClusterGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyCluster.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptCluster, pyCluster); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyColor.h b/Sources/Plasma/FeatureLib/pfPython/pyColor.h index 1cf8155b..c0780bf1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyColor.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyColor.h @@ -34,7 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsColorRGBA.h" -#include +#include #include "pyGlueHelpers.h" class pyColor diff --git a/Sources/Plasma/FeatureLib/pfPython/pyColorGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyColorGlue.cpp index f0166d85..2e3c7140 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyColorGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyColorGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyColor.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptColor, pyColor); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.h b/Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.h index bb230747..ae21989a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyCritterBrain.h @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef _pyCritterBrain_h_ #define _pyCritterBrain_h_ -#include +#include #include "pyGlueHelpers.h" #include "pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCritterBrainGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyCritterBrainGlue.cpp index 12e88d09..9d0f1380 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCritterBrainGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyCritterBrainGlue.cpp @@ -29,7 +29,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plMessage/plAIMsg.h" -#include +#include /////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h index 0d2cfc39..86b83a62 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsGeometry3.h" -#include +#include #include "pyGlueHelpers.h" class plDniCoordinateInfo; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinatesGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinatesGlue.cpp index 57d31360..26c5214a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinatesGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinatesGlue.cpp @@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGeometry3.h" #include "plVault/plDniCoordinateInfo.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptDniCoordinates, pyDniCoordinates); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h index cea21511..f49ed96c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h @@ -30,7 +30,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" class pyDniCoordinates; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSourceGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSourceGlue.cpp index d16f3547..63bf8028 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSourceGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSourceGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyDniInfoSource.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptDniInfoSource, pyDniInfoSource); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h b/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h index e2f7c471..1c5d4abb 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" class pyDrawControl diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDrawControlGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDrawControlGlue.cpp index 7eed7411..0222abf9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDrawControlGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDrawControlGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyDrawControl.h" #include "pyEnum.h" -#include +#include PYTHON_GLOBAL_METHOD_DEFINITION(PtSetGamma2, args, "Params: gamma\nSet the gamma with gamma2 rules") { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h index a0d5fbf5..6b3a51d0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h @@ -40,7 +40,7 @@ class pyImage; #include "hsTemplates.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDynamicTextGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDynamicTextGlue.cpp index 8e7fcbb0..be4600ab 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDynamicTextGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDynamicTextGlue.cpp @@ -30,7 +30,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyImage.h" #include "plGImage/plDynamicTextMap.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptDynamicMap, pyDynamicText); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyEnum.cpp b/Sources/Plasma/FeatureLib/pfPython/pyEnum.cpp index 997e7ed6..adea87c2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyEnum.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyEnum.cpp @@ -33,7 +33,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyEnum.h" -#include +#include #include "structmember.h" #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyEnum.h b/Sources/Plasma/FeatureLib/pfPython/pyEnum.h index 3e9227da..53322a27 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyEnum.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyEnum.h @@ -34,7 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // class // -#include +#include #include "hsConfig.h" #include "hsStlUtils.h" #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h index 8e58b7e0..ee49496e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "pyGeometry3.h" -#include +#include #include "pyGlueHelpers.h" class pyGUIDialog; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h index bd11cfd2..31faccc3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "pyGeometry3.h" -#include +#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButtonGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButtonGlue.cpp index eca52433..faf35345 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButtonGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButtonGlue.cpp @@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyEnum.h" #include "pfGameGUIMgr/pfGUIButtonMod.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlButton, pyGUIControlButton); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h index 24959656..0fbeb3f6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" -#include +#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBoxGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBoxGlue.cpp index cd834e74..c5f5bd65 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBoxGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBoxGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyGUIControlCheckBox.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlCheckBox, pyGUIControlCheckBox); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h index 335e4315..32f51a68 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" -#include +#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMapGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMapGlue.cpp index 53852eb7..6662a79e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMapGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMapGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyGUIControlClickMap.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlClickMap, pyGUIControlClickMap); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h index 67de66b5..c7c54444 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" -#include +#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBarGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBarGlue.cpp index bc791c64..1af7ea73 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBarGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBarGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyGUIControlDragBar.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlDragBar, pyGUIControlDragBar); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h index 76d72aa3..03a489c2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" -#include +#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggableGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggableGlue.cpp index 15c6bf9e..c74b121c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggableGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggableGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyGUIControlDraggable.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlDraggable, pyGUIControlDraggable); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h index 67ba1d5d..d9bb123a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "pyGUIControl.h" -#include +#include #include "pyGlueHelpers.h" class pyDynamicText; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicTextGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicTextGlue.cpp index 2a1a2d54..5311e8fc 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicTextGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicTextGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyGUIControlDynamicText.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlDynamicText, pyGUIControlDynamicText); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h index 0efa2162..9c49bf8f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" #include "pyKey.h" -#include +#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBoxGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBoxGlue.cpp index f4f6f300..2c7331ae 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBoxGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBoxGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGUIControlEditBox.h" #include "pyColor.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlEditBox, pyGUIControlEditBox); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlGlue.cpp index 01f8c90b..0e234c0a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlGlue.cpp @@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "pyGeometry3.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIControl, pyGUIControl); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h index c9b822ab..e5ffd3cc 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h @@ -39,7 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "pyGUIControl.h" -#include +#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBoxGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBoxGlue.cpp index eb024ff7..777d8449 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBoxGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBoxGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGUIControlListBox.h" #include "pyImage.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlListBox, pyGUIControlListBox); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h index 46a1e787..eb6ac34e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "pyGUIControl.h" -#include +#include #include "pyGlueHelpers.h" class pyColor; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEditGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEditGlue.cpp index be8c0b3b..7af3e676 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEditGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEditGlue.cpp @@ -28,7 +28,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyColor.h" #include "pfGameGUIMgr/pfGUIMultiLineEditCtrl.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlMultiLineEdit, pyGUIControlMultiLineEdit); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h index 7c197d5e..18b3b155 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "pyGUIControl.h" -#include +#include #include "pyGlueHelpers.h" class pyGUIControlRadioGroup :public pyGUIControl diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroupGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroupGlue.cpp index b80c9850..c99a6d61 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroupGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroupGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyGUIControlRadioGroup.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlRadioGroup, pyGUIControlRadioGroup); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h index 7de33448..8739152e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h @@ -37,7 +37,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGUIControl.h" #include "pfGameGUIMgr/pfGUIControlMod.h" -#include +#include #include "pyGlueHelpers.h" class pyColor; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBoxGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBoxGlue.cpp index 0d8596d9..08cae39c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBoxGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBoxGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGUIControlTextBox.h" #include "pyColor.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlTextBox, pyGUIControlTextBox); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValue.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValue.h index 6146b274..2a98f8be 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValue.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValue.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "pyGUIControl.h" -#include +#include #include "pyGlueHelpers.h" class pyGUIControlValue : public pyGUIControl diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValueGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValueGlue.cpp index 6c6b3c66..fe4cebc2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValueGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlValueGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyGUIControlValue.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIControlValue, pyGUIControlValue); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h index 4ac2f3b5..374e23af 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" #include "pyKey.h" -#include +#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp index f0d532a5..55789a98 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyGUIDialog.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIDialog, pyGUIDialog); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h index d8669329..f954dcc9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h @@ -37,7 +37,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" -#include +#include #include "pyGlueHelpers.h" class pyColor; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenuGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenuGlue.cpp index f3318b0f..551f71e4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenuGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenuGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyGUIPopUpMenu.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUIPopUpMenu, pyGUIPopUpMenu); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUISkin.h b/Sources/Plasma/FeatureLib/pfPython/pyGUISkin.h index 14cab933..22976d45 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUISkin.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUISkin.h @@ -33,7 +33,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "pyKey.h" -#include +#include #include "pyGlueHelpers.h" class pyColor; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUISkinGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUISkinGlue.cpp index 4dfee16b..e40dcd58 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUISkinGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUISkinGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyGUISkin.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGUISkin, pyGUISkin); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h b/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h index bb7b2cc5..fa72bf7c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" struct pfGameScore; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h b/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h index ef3facbd..08ebe381 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h @@ -34,7 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsGeometry3.h" -#include +#include #include "pyGlueHelpers.h" class pyPoint3 diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGeometry3Glue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGeometry3Glue.cpp index 0d3914ca..d675ac82 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGeometry3Glue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGeometry3Glue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyGeometry3.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptPoint3, pyPoint3); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h b/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h index a285290f..62c0d3e8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h @@ -30,7 +30,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" -#include +#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGrassShaderGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGrassShaderGlue.cpp index 94389894..4f5e7cac 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGrassShaderGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGrassShaderGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyGrassShader.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptGrassShader, pyGrassShader); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyImage.h b/Sources/Plasma/FeatureLib/pfPython/pyImage.h index 824fc150..d19f7ec0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyImage.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyImage.h @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plGImage/plMipmap.h" #endif -#include +#include #include "pyGlueHelpers.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp index 21854b41..bf93fe70 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyImageGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyImage.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptImage, pyImage); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h index 005f0c06..2565f0ae 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h @@ -37,7 +37,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGeometry3.h" -#include +#include #include "pyGlueHelpers.h" class pyImage; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyJournalBookGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyJournalBookGlue.cpp index 4520f164..f3d77298 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyJournalBookGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyJournalBookGlue.cpp @@ -29,7 +29,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyImage.h" #include "pfJournalBook/pfJournalBook.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptBook, pyJournalBook); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKey.h b/Sources/Plasma/FeatureLib/pfPython/pyKey.h index 13eff562..a6072806 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKey.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyKey.h @@ -34,7 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnKeyedObject/plKey.h" -#include +#include #include "pyGlueHelpers.h" class plPythonFileMod; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKeyGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyKeyGlue.cpp index 4d3f8e36..7c6f41b0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKeyGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyKeyGlue.cpp @@ -28,7 +28,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pySceneObject.h" #endif -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptKey, pyKey); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h b/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h index ba33ede3..424d46af 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "pnInputCore/plKeyMap.h" -#include +#include #include "pyGlueHelpers.h" class pyKeyMap diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKeyMapGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyKeyMapGlue.cpp index eef62094..5cb0c7df 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKeyMapGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyKeyMapGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyKeyMap.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptKeyMap, pyKeyMap); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h index c20f2eee..170ca2e4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h @@ -34,7 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" -#include +#include #include "pyGlueHelpers.h" class pyMarkerMgr diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgrGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgrGlue.cpp index 0c53863a..43175ac2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgrGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgrGlue.cpp @@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pfMessage/pfMarkerMsg.h" #include "pyEnum.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptMarkerMgr, pyMarkerMgr); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h index fac6f5d2..778b7ba4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h @@ -31,7 +31,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsMatrix44.h" #include "pyGeometry3.h" -#include +#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44Glue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44Glue.cpp index 611f2b1f..e6eb057a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44Glue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44Glue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyMatrix44.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptMatrix44, pyMatrix44); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h index 3edb02cb..17ef45e2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "pyColor.h" -#include +#include #include "pyGlueHelpers.h" class pyMoviePlayer diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayerGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayerGlue.cpp index e380a689..a1e27d12 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayerGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayerGlue.cpp @@ -29,7 +29,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyColor.h" #include "pfMessage/pfMovieEventMsg.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptMoviePlayer, pyMoviePlayer); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h index 4f8b71e6..aeb22164 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h @@ -29,7 +29,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgrGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgrGlue.cpp index db9662e3..d1905419 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgrGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgrGlue.cpp @@ -28,7 +28,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyAgeLinkStruct.h" #include "plNetCommon/plNetCommon.h" -#include +#include #ifndef BUILDING_PYPLASMA diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h b/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h index 1c0c30bc..ae611793 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h @@ -30,7 +30,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetCommon/plNetServerSessionInfo.h" #include "plUUID/plUUID.h" -#include +#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfoGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfoGlue.cpp index 3a571b37..31e75fc3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfoGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfoGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyNetServerSessionInfo.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptNetServerSessionInfo, pyNetServerSessionInfo); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNotify.h b/Sources/Plasma/FeatureLib/pfPython/pyNotify.h index 1fd65a6a..2274cae0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNotify.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyNotify.h @@ -37,7 +37,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "pyGeometry3.h" -#include +#include #include "pyGlueHelpers.h" class pyNotify diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNotifyGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyNotifyGlue.cpp index b43ed17a..d2c4ba12 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNotifyGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyNotifyGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyNotify.h" #include "pyEnum.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptNotify, pyNotify); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h b/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h index 82d46746..917b6ca8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" #include "pyKey.h" -#include +#include #include "pyGlueHelpers.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp index 1f042a26..e04c69d9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyPlayer.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptPlayer, pyPlayer); diff --git a/Sources/Plasma/FeatureLib/pfPython/pySDL.h b/Sources/Plasma/FeatureLib/pfPython/pySDL.h index e1dcb718..ceab6890 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySDL.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySDL.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" class plStateDataRecord; diff --git a/Sources/Plasma/FeatureLib/pfPython/pySDLGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pySDLGlue.cpp index 886a7f5b..b36d7be9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySDLGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySDLGlue.cpp @@ -28,7 +28,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyEnum.h" #include "pyKey.h" -#include +#include void pySDL::AddPlasmaConstantsClasses(PyObject *m) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h index 9c214985..b10503e5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h @@ -41,7 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pySceneObjectGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pySceneObjectGlue.cpp index a1183c6d..52b2c8da 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySceneObjectGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySceneObjectGlue.cpp @@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyMatrix44.h" #include "pyGeometry3.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptSceneobject, pySceneObject); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyScoreMgr.h b/Sources/Plasma/FeatureLib/pfPython/pyScoreMgr.h index 84df4b9b..6679a57b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyScoreMgr.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyScoreMgr.h @@ -36,7 +36,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h b/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h index 5a2df42d..68c95096 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h @@ -30,7 +30,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" #include "plNetCommon/plSpawnPointInfo.h" -#include +#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfoGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfoGlue.cpp index 0425260a..e749ccb1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfoGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfoGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pySpawnPointInfo.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptSpawnPointInfo, pySpawnPointInfo); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h b/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h index e91c948e..2b9e598c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" -#include +#include #include "pyGlueHelpers.h" #include "pyColor.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStatusLogGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyStatusLogGlue.cpp index 092b3ad3..cacfb9e1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStatusLogGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyStatusLogGlue.cpp @@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyEnum.h" #include "plStatusLog/plStatusLog.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptStatusLog, pyStatusLog); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStream.h b/Sources/Plasma/FeatureLib/pfPython/pyStream.h index 25d2b995..9231a057 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStream.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyStream.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStreamGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyStreamGlue.cpp index eb2c551d..c22fbe14 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStreamGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyStreamGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyStream.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptStream, pyStream); diff --git a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h index e4adb15a..b49c4a0c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h @@ -28,7 +28,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" -#include +#include #include "pyGlueHelpers.h" class pySwimCurrentInterface diff --git a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterfaceGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterfaceGlue.cpp index 2af67768..6cd53c65 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterfaceGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterfaceGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pySwimCurrentInterface.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptSwimCurrentInterface, pySwimCurrentInterface); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVault.h b/Sources/Plasma/FeatureLib/pfPython/pyVault.h index 5f170b03..78be40fd 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVault.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVault.h @@ -34,7 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" -#include +#include #include "pyGlueHelpers.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h index 2726f591..8303bbfa 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" #include "pyVaultFolderNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNodeGlue.cpp index 9697653b..739db2a3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNodeGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyVaultAgeInfoListNode.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultAgeInfoListNode, pyVaultAgeInfoListNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h index 301fea71..7cd2a8e7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNodeGlue.cpp index d36fd84b..7aa78ad1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNodeGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyVaultAgeInfoNode.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultAgeInfoNode, pyVaultAgeInfoNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h index eafd88f3..348d0fb9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNodeGlue.cpp index c8f1a944..10682d1b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNodeGlue.cpp @@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pySpawnPointInfo.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultAgeLinkNode, pyVaultAgeLinkNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h index a9f6756a..c70a5c84 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNodeGlue.cpp index 2c11bf45..b8f7e1b3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNodeGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyVaultChronicleNode.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultChronicleNode, pyVaultChronicleNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h index f3d3a3ea..3c3aa040 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNodeGlue.cpp index 4cd9acce..32e5c5aa 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNodeGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyVaultFolderNode.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultFolderNode, pyVaultFolderNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultGlue.cpp index 33c114f4..2af4d7ee 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultGlue.cpp @@ -32,7 +32,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plVault/plVault.h" #include "plMessage/plVaultNotifyMsg.h" -#include +#include #ifndef BUILDING_PYPLASMA diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h index 19c8cdcb..83a1d1d4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNodeGlue.cpp index c246c95d..711fadd3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNodeGlue.cpp @@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyImage.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultImageNode, pyVaultImageNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h index fd3897f3..fca94adc 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h @@ -34,7 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" -#include +#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNodeGlue.cpp index 4ead4ae7..2cf363af 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNodeGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyVaultMarkerGameNode.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultMarkerGameNode, pyVaultMarkerGameNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h index 363ac165..79c23c70 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h @@ -34,7 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" struct RelVaultNode; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeGlue.cpp index 5d8f5296..1e01adfe 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyVaultNode.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultNode, pyVaultNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h index 960ba879..c07039b5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h @@ -34,7 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" -#include +#include #include "pyGlueHelpers.h" struct RelVaultNode; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRefGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRefGlue.cpp index fc74f05a..cbbecb1c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRefGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRefGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyVaultNodeRef.h" #include "plVault/plVault.h" -#include +#include // glue functions // glue functions diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h index 646ee135..963532a5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" #include "pyVaultFolderNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNodeGlue.cpp index 0b4f55b3..cc88300e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNodeGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyVaultPlayerInfoListNode.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultPlayerInfoListNode, pyVaultPlayerInfoListNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h index e2d6ea33..b6947c8e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h @@ -33,7 +33,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ////////////////////////////////////////////////////////////////////// #include "pyVaultNode.h" -#include +#include #include "pyGlueHelpers.h" class pyVaultPlayerInfoNode : public pyVaultNode diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNodeGlue.cpp index 7313c3e1..592220d4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNodeGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyVaultPlayerInfoNode.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultPlayerInfoNode, pyVaultPlayerInfoNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h index ca9c57e9..cb9c7c0d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" #include "pfPython/pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNodeGlue.cpp index 7fb634ea..065dc557 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNodeGlue.cpp @@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyAgeInfoStruct.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultPlayerNode, pyVaultPlayerNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h index ac93da93..a7c4f5be 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNodeGlue.cpp index 7e380dcc..d01e93f4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNodeGlue.cpp @@ -27,7 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pySDL.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultSDLNode, pyVaultSDLNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h index 09ba03e1..baa07726 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h @@ -35,7 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNodeGlue.cpp index d51c5129..ef12344b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNodeGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyVaultSystemNode.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultSystemNode, pyVaultSystemNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h index 2b2e6057..278aab5f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h @@ -34,7 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" -#include +#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNodeGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNodeGlue.cpp index 303c3533..6680fce6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNodeGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNodeGlue.cpp @@ -26,7 +26,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyVaultTextNoteNode.h" #include "plVault/plVault.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptVaultTextNoteNode, pyVaultTextNoteNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h b/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h index e806d8ad..3cf94d61 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h @@ -30,7 +30,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGeometry3.h" #include "pyColor.h" -#include +#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyWaveSetGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyWaveSetGlue.cpp index b33b8c5f..f254ce3c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyWaveSetGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyWaveSetGlue.cpp @@ -25,7 +25,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "pyWaveSet.h" -#include +#include // glue functions PYTHON_CLASS_DEFINITION(ptWaveSet, pyWaveSet); diff --git a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp index 847887f0..2b0056d8 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp @@ -589,20 +589,22 @@ static void ClientConnect (NetCli * cli) { { ZERO(cli->seed); unsigned bytes; - const void * data = clientSeed.GetData(&bytes); + unsigned char * data = clientSeed.GetData_LE(&bytes); MemCopy(cli->seed, data, min(bytes, sizeof(cli->seed))); + delete [] data; } // Send server seed if (cli->sock) { unsigned bytes; NetCli_Cli2Srv_Connect msg; - const void * data = serverSeed.GetData(&bytes); + unsigned char * data = serverSeed.GetData_LE(&bytes); ASSERTMSG(bytes <= sizeof(msg.dh_y_data), "4"); msg.message = kNetCliCli2SrvConnect; msg.length = (byte) (sizeof(msg) - sizeof(msg.dh_y_data) + bytes); MemCopy(msg.dh_y_data, data, bytes); AsyncSocketSend(cli->sock, &msg, msg.length); + delete [] data; } } @@ -643,8 +645,9 @@ static bool ServerRecvConnect ( ZERO(clientSeed); unsigned bytes; - const void * data = clientSeedValue.GetData(&bytes); + unsigned char * data = clientSeedValue.GetData_LE(&bytes); MemCopy(clientSeed, data, min(bytes, sizeof(clientSeed))); + delete [] data; } // Create the symmetric key from a combination diff --git a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrBuildId.cpp b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrBuildId.cpp index 70034d72..f65868f4 100644 --- a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrBuildId.cpp +++ b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrBuildId.cpp @@ -41,7 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // This line must NEVER be modified manually; it is automatically updated // by the build server. -#define BUILD_ID 897 +#define BUILD_ID 902 COMPILER_ASSERT(BUILD_ID != 0); diff --git a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt index 65263bf4..7caf3e34 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt @@ -1,8 +1,6 @@ include_directories("../../CoreLib") include_directories("../../NucleusLib") -include_directories(${OPENSSL_INCLUDE_DIR}) - set(pnUtils_HEADERS Intern.h Pch.h diff --git a/Sources/Plasma/NucleusLib/pnUtils/Intern.h b/Sources/Plasma/NucleusLib/pnUtils/Intern.h index f5a06a85..13091e1b 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Intern.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Intern.h @@ -51,27 +51,4 @@ public: virtual unsigned GetBlockSize () const = 0; }; -//============================================================================ -class KeyRc4 : public KeyBase { -private: - unsigned m_x; - unsigned m_y; - byte m_state[256]; - - void Initialize (unsigned bytes, const void * data); - -public: - KeyRc4 (unsigned bytes, const void * data) { Initialize(bytes, data); } - - void Codec (bool encrypt, ARRAY(byte) * dest, unsigned sourceBytes, const void * sourceData); - unsigned GetBlockSize () const { return 1; } - - static void KeyGen ( - unsigned randomBytes, - const void * randomData, - ARRAY(byte) * privateData - ); -}; - - } // namespace Crypt diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp index 46d35263..785e3f19 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp @@ -32,57 +32,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "../Pch.h" #pragma hdrstop +#include +#include -/**************************************************************************** -* -* Constants and macros -* -***/ - -const unsigned VAL_BITS = 8 * sizeof(BigNum::Val); -const BigNum::DVal VAL_RANGE = ((BigNum::DVal)1) << VAL_BITS; - -#define LOW(dval) ((Val)(dval)) -#define HIGH(dval) ((Val)((dval) / VAL_RANGE)) -#define PACK(low, high) ((DVal)((high) * VAL_RANGE + (low))) - -#define ALLOC_TEMP(struct, count) \ - (struct).UseTempAlloc((Val *)_alloca((count) * sizeof(Val)), count) - - -/**************************************************************************** -* -* BigNum private methods -* -***/ - -//=========================================================================== -void BigNum::SetVal (unsigned index, Val value) { - ARRAY(Val)::operator[](index) = value; -} - -//=========================================================================== -void BigNum::SetVal (unsigned index, DVal value, Val * carry) { - ARRAY(Val)::operator[](index) = LOW(value); - *carry = HIGH(value); -} - -//=========================================================================== -void BigNum::Trim (unsigned count) { - ASSERT(count <= Count()); - while (count && !ARRAY(Val)::operator[](count - 1)) - --count; - SetCountFewer(count); -} - -//=========================================================================== -BigNum * BigNum::UseTempAlloc (Val * ptr, unsigned count) { - m_isTemp = true; - AttachTemp(ptr, count); - return this; +static inline void byteswap(size_t size, unsigned char * data) +{ + for (size_t i = 0; i < (size / 2); ++i) + std::swap(data[i], data[size - i - 1]); } - /**************************************************************************** * * BigNum public methods @@ -90,1296 +48,98 @@ BigNum * BigNum::UseTempAlloc (Val * ptr, unsigned count) { ***/ //=========================================================================== -BigNum::BigNum () : - m_isTemp(false) +BigNum::BigNum () : m_context(nil) { + BN_init(&m_number); } //=========================================================================== -BigNum::BigNum (const BigNum & a) : - m_isTemp(false) +BigNum::BigNum (const BigNum & a) : m_context(nil) { - Set(a); + BN_init(&m_number); + BN_copy(&m_number, &a.m_number); } //=========================================================================== -BigNum::BigNum (unsigned a) : - m_isTemp(false) +BigNum::BigNum (unsigned a) : m_context(nil) { - Set(a); + BN_init(&m_number); + BN_set_word(&m_number, a); } //=========================================================================== -BigNum::BigNum (unsigned bytes, const void * data) : - m_isTemp(false) +BigNum::BigNum (unsigned bytes, const void * data, bool le) : m_context(nil) { - FromData(bytes, data); + BN_init(&m_number); + if (le) + FromData_LE(bytes, data); + else + FromData_BE(bytes, data); } //=========================================================================== -BigNum::BigNum (const wchar str[], Val radix) : - m_isTemp(false) +BigNum::~BigNum () { - FromStr(str, radix); -} - -//=========================================================================== -BigNum::~BigNum () { - if (m_isTemp) - Detach(); -} - -//=========================================================================== -void BigNum::Add (const BigNum & a, Val b) { - // this = a + b - - const unsigned count = a.Count(); - GrowToCount(count + 1, true); - unsigned index = 0; - Val carry = b; - for (; index < count; ++index) - SetVal(index, (DVal)((DVal)a[index] + (DVal)carry), &carry); - if (carry) - SetVal(index++, carry); - Trim(index); - -} - -//=========================================================================== -void BigNum::Add (const BigNum & a, const BigNum & b) { - // this = a + b - - const unsigned aCount = a.Count(); - const unsigned bCount = b.Count(); - const unsigned count = aCount + bCount; - GrowToCount(count + 1, true); - unsigned index = 0; - Val carry = 0; - for (; index < count; ++index) { - Val aVal = (index < aCount) ? a[index] : (Val)0; - Val bVal = (index < bCount) ? b[index] : (Val)0; - SetVal(index, (DVal)((DVal)aVal + (DVal)bVal + (DVal)carry), &carry); - } - if (carry) - SetVal(index++, carry); - Trim(index); - -} - -//=========================================================================== -int BigNum::Compare (Val a) const { - // -1 if (this < a) - // 0 if (this == a) - // 1 if (this > a) - - // Handle the case where this number has more digits than the comparand - const unsigned count = Count(); - ASSERT(!count || (*this)[count - 1]); - if (count > 1) - return 1; - - // Handle the case where this number has fewer digits than the comparand - if (!count) - return a ? -1 : 0; - - // Handle the case where both numbers share the same number of digits - Val thisVal = (*this)[0]; - return (thisVal > a) ? 1 : (thisVal < a) ? -1 : 0; - + if (m_context) + BN_CTX_free(m_context); + BN_free(&m_number); } //=========================================================================== -int BigNum::Compare (const BigNum & a) const { +int BigNum::Compare (dword a) const { // -1 if (this < a) // 0 if (this == a) // 1 if (this > a) - // Handle the case where this number has more digits than the comparand - const unsigned thisCount = Count(); - const unsigned compCount = a.Count(); - ASSERT(!thisCount || (*this)[thisCount - 1]); - ASSERT(!compCount || a[compCount - 1]); - if (thisCount > compCount) - return 1; + if (BN_is_word(&m_number, a)) + return 0; - // Handle the case where this number has fewer digits than the comparand - if (thisCount < compCount) + // This returns 0xFFFFFFFFL if the number is bigger than one word, so + // it doesn't need any size check + if (BN_get_word(&m_number) < a) return -1; - // Handle the case where both numbers share the same number of digits - for (unsigned index = thisCount; index--; ) { - Val thisVal = (*this)[index]; - Val compVal = a[index]; - if (thisVal == compVal) - continue; - return (thisVal > compVal) ? 1 : -1; - } - return 0; - -} - -//=========================================================================== -void BigNum::Div (const BigNum & a, Val b, Val * remainder) { - // this = a / b, remainder = a % b - - const unsigned count = a.Count(); - SetCount(count); - *remainder = 0; - for (unsigned index = count; index--; ) { - DVal value = PACK(a[index], *remainder); - SetVal(index, (Val)(value / b)); - *remainder = (Val)(value % b); - } - Trim(count); - -} - -//=========================================================================== -void BigNum::Div (const BigNum & a, const BigNum & b, BigNum * remainder) { - // this = a / b, remainder = a % b - // either this or remainder may be nil - - ASSERT(this != remainder); - - // Check for division by zero - ASSERT(b.Count() && b[b.Count() - 1]); - - // Normalize the operands so that the highest bit is set in the most - // significant word of the denominator - const unsigned shift = 8 * sizeof(Val) - MathHighBitPos(b[b.Count() - 1]) - 1; - BigNum aaBuffer; - BigNum bbBuffer; - BigNum * aa = shift ? ALLOC_TEMP(aaBuffer, a.Count() + 1) : (BigNum *)&a; - BigNum * bb = shift ? ALLOC_TEMP(bbBuffer, b.Count() + 1) : (BigNum *)&b; - if (shift) { - aa->Shl(a, shift); - bb->Shl(b, shift); - } - - // Perform the division - DivNormalized(*aa, *bb, remainder); - - // Denormalize the remainder - if (remainder) - remainder->Shr(*remainder, shift); - -} - -//=========================================================================== -void BigNum::DivNormalized (const BigNum & a, const BigNum & b, BigNum * remainder) { - // this = a / b, remainder = a % b - // either this or remainder may be nil - // high bit of b must be set - - ASSERT(this != remainder); - - // Check for division by zero - ASSERT(b.Count() && b[b.Count() - 1]); - - // Verify that the operands are normalized - ASSERT(MathHighBitPos(b[b.Count() - 1]) == 8 * sizeof(Val) - 1); - - // Handle the case where the denominator is greater than the numerator - if ((b.Count() > a.Count()) || (b.Compare(a) > 0)) { - if (remainder && (remainder != &a)) - remainder->Set(a); - if (this) - ZeroCount(); - return; - } - - // Create a distinct buffer for the denominator if necessary - BigNum denomTemp; - BigNum * denom = ((&b != this) && (&b != remainder)) ? (BigNum *)&b : ALLOC_TEMP(denomTemp, b.Count()); - denom->Set(b); - - // Store the numerator into the remainder buffer - BigNum numerTemp; - BigNum * numer = remainder ? remainder : ALLOC_TEMP(numerTemp, a.Count()); - numer->Set(a); - - // Prepare the destination buffer - const unsigned numerCount = numer->Count(); - const unsigned denomCount = denom->Count(); - if (this) - this->SetCount(numerCount + 1 - denomCount); - - // Calculate the quotient one word at a time - DVal t = (DVal)((DVal)(*denom)[denomCount - 1] + (DVal)1); - for (unsigned quotientIndex = numerCount + 1 - denomCount; quotientIndex--; ) { - - // Calculate the approximate value of the next quotient word, - // erring on the side of underestimation - Val low = (*numer)[quotientIndex + denomCount - 1]; - Val high = (quotientIndex + denomCount < numerCount) ? (*numer)[quotientIndex + denomCount] : (Val)0; - ASSERT(high < t); - Val quotient = (Val)(PACK(low, high) / t); - - // Calculate the product of the denominator and this quotient word - // (using zero for all lower quotient words) and subtract the product - // from the current numerator - if (quotient) { - Val borrow = 0; - Val carry = 0; - unsigned denomIndex; - for (denomIndex = 0; denomIndex != denomCount; ++denomIndex) { - DVal product = (DVal)(Mul((*denom)[denomIndex], quotient) + carry); - carry = HIGH(product); - numer->SetVal(quotientIndex + denomIndex, (DVal)((DVal)(*numer)[quotientIndex + denomIndex] - (DVal)LOW(product) - (DVal)borrow), &borrow); - borrow = (Val)((Val)0 - (Val)borrow); - } - if (quotientIndex + denomCount != numerCount) { - numer->SetVal(quotientIndex + denomCount, (DVal)((DVal)(*numer)[quotientIndex + denomIndex] - (DVal)carry - (DVal)borrow), &borrow); - carry = 0; - } - ASSERT(!carry); - ASSERT(!borrow); - } - - // Check whether we underestimated the quotient word, and adjust - // it if necessary - for (;;) { - - // Test whether the current numerator is still greater than or - // equal to the denominator - if ((quotientIndex + denomCount == numerCount) || !(*numer)[quotientIndex + denomCount]) { - bool numerLess = false; - for (unsigned denomIndex = denomCount; !numerLess && denomIndex--; ) { - Val numerVal = (*numer)[quotientIndex + denomIndex]; - Val denomVal = (*denom)[denomIndex]; - numerLess = (numerVal < denomVal); - if (numerVal != denomVal) - break; - } - if (numerLess) - break; - } - - // Increment the quotient by one, and correct the current - // numerator for this adjustment by subtracting the denominator - ++quotient; - Val borrow = 0; - for (unsigned denomIndex = 0; denomIndex != denomCount; ++denomIndex) { - numer->SetVal(quotientIndex + denomIndex, (DVal)((DVal)(*numer)[quotientIndex + denomIndex] - (DVal)(*denom)[denomIndex] - (DVal)borrow), &borrow); - borrow = (Val)((Val)0 - (Val)borrow); - } - if (borrow) - numer->SetVal(quotientIndex + denomCount, (DVal)((DVal)(*numer)[quotientIndex + denomCount] - (DVal)borrow), &borrow); - ASSERT(!borrow); - - } - ASSERT((quotientIndex + denomCount == numerCount) || !(*numer)[quotientIndex + denomCount]); - - // Store the final quotient word - if (this) - this->SetVal(quotientIndex, quotient); - - } - - // The final remainder is the remaining portion of the numerator - if (remainder) { - ASSERT(remainder == numer); - remainder->Trim(denomCount); - } - - // Trim the result - if (this) - this->Trim(numerCount + 1 - denomCount); - + // Not less or equal, must be greater + return 1; } //=========================================================================== -void BigNum::FromData (unsigned bytes, const void * data) { - ASSERT(data || !bytes); - - // Calculate the number of words required to hold the data - unsigned count = (bytes + sizeof(Val) - 1) / sizeof(Val); - SetCount(count); - - // Fill in whole words - unsigned index = 0; - unsigned offset = 0; - for (; offset + sizeof(Val) <= bytes; ++index, offset += sizeof(Val)) - SetVal(index, *(const Val *)((const byte *)data + offset)); - - // Fill in the final partial word - if (offset < bytes) { - Val value = 0; - MemCopy(&value, (const byte *)data + offset, bytes - offset); - SetVal(index, value); - } - -} - -//=========================================================================== -void BigNum::FromStr (const wchar str[], Val radix) { - ASSERT(str); - - // Decode the prefix - if (str[0] == L'0') { - if ((str[1] == L'x') || (str[1] == L'X')) { - str += 2; - if (!radix) - radix = 16; - } - else if ((str[1] >= L'0') && (str[1] <= L'9')) { - str += 1; - if (!radix) - radix = 8; - } - else if (!radix) { - ZeroCount(); - return; - } - } - else if (!radix) - radix = 10; - - // Decode the number - ZeroCount(); - for (; *str; ++str) { - - // Decode the next character - Val value; - if ((*str >= L'0') && (*str <= '9')) - value = (Val)(*str - L'0'); - else if ((*str >= L'a') && (*str <= L'z')) - value = (Val)(*str + 10 - L'a'); - else if ((*str >= L'A') && (*str <= L'Z')) - value = (Val)(*str + 10 - L'A'); - else - break; - if (value >= radix) - break; - - // Apply it to the result - Mul(*this, radix); - Add(*this, value); - - } - -} - -//=========================================================================== -void BigNum::Gcd (const BigNum & a, const BigNum & b) { - - // Allocate working copies of a and b - BigNum aa; - BigNum bb; - unsigned maxCount = max(a.Count(), b.Count()); - ALLOC_TEMP(aa, maxCount + 1); - ALLOC_TEMP(bb, maxCount + 1); - aa.Set(a); - bb.Set(b); - - // Find the greatest common denominator using Euclid's algorithm - Set(bb); - while (aa.Count()) { - Set(aa); - aa.Mod(bb, aa); - bb.Set(*this); - } - -} - -//=========================================================================== -const void * BigNum::GetData (unsigned * bytes) const { - if (bytes) - *bytes = Bytes(); - return Ptr(); -} - -//=========================================================================== -unsigned BigNum::HighBitPos () const { - // returns the position of the highest set bit, or -1 if no bits are set - - for (unsigned index = Count(); index--; ) { - Val val = (*this)[index]; - if (!val) - continue; - return index * 8 * sizeof(Val) + MathHighBitPos(val); - } - - return (unsigned)-1; -} - -//=========================================================================== -bool BigNum::InverseMod (const BigNum & a, const BigNum & b) { - // finds value for this such that (a ^ -1) == (this mod b) - // returns false if a has no inverse modulo b - - // Verify that a and b are nonzero - ASSERT(a.Count()); - ASSERT(b.Count()); - - // Verify that a is less than b - ASSERT(a.Compare(b) < 0); - - // Verify that either a or b is odd. If both are even then they cannot - // possibly be relatively prime, so there cannot be a solution. - if (!(a.IsOdd() || b.IsOdd())) - return false; - - // Allocate buffers for intermediate values - BigNum uArray[3]; - BigNum tArray[3]; - BigNum * u = uArray; - BigNum * t = tArray; - - // Find the inverse using the extended Euclidean algorithm - u[0].SetOne(); - u[1].SetZero(); - u[2].Set(b); - t[0].Set(a); - t[1].Sub(b, 1); - t[2].Set(a); - do { - do { - if (!u[2].IsOdd()) { - if (u[0].IsOdd() || u[1].IsOdd()) { - u[0].Add(u[0], a); - u[1].Add(u[1], b); - } - u[0].Shr(u[0], 1); - u[1].Shr(u[1], 1); - u[2].Shr(u[2], 1); - } - if (!t[2].IsOdd() || (u[2].Compare(t[2]) < 0)) - SWAP(u, t); - } while (!u[2].IsOdd()); - - while ((u[0].Compare(t[0]) < 0) || (u[1].Compare(t[1]) < 0)) { - u[0].Add(u[0], a); - u[1].Add(u[1], b); - } - - u[0].Sub(u[0], t[0]); - u[1].Sub(u[1], t[1]); - u[2].Sub(u[2], t[2]); - } while (t[2].Count()); - - while ((u[0].Compare(a) >= 0) && (u[1].Compare(b) >= 0)) { - u[0].Sub(u[0], a); - u[1].Sub(u[1], b); - } - - // If the greatest common denominator is not one then there is no - // solution - if (u[2].Compare(1)) - return false; - - // Return the solution - Sub(b, u[1]); - return true; - -} - -//=========================================================================== -bool BigNum::IsMultiple (Val a) const { - // returns true if (this % a) == 0 - - DVal remainder = 0; - for (unsigned index = Count(); index--; ) - remainder = (DVal)(PACK((*this)[index], remainder) % a); - - return !remainder; -} - -//=========================================================================== -bool BigNum::IsOdd () const { - // returns true if this is an odd number - - return Count() ? (*this)[0] & 1 : false; -} - -//=========================================================================== -bool BigNum::IsPrime () const { - // returns true if there is a strong likelihood that this is prime - - // Verify that the number is odd, or is exactly equal to two - if (!Count() || (!((*this)[0] & 1) && ((Count() > 1) || ((*this)[0] > 2)))) - return false; - - // Verify that the number is not evenly divisible by a small prime - static const Val smallPrimes[] = {3, 5, 7, 11}; - unsigned loop; - for (loop = 0; loop != arrsize(smallPrimes); ++loop) - if (IsMultiple(smallPrimes[loop])) - return false; - if (Compare(smallPrimes[arrsize(smallPrimes)-1]) <= 0) - return true; - - // Rabin-Miller Test - - // Calculate b, where b is the number of times 2 divides (this - 1) - BigNum this_1; - ALLOC_TEMP(this_1, Count()); - this_1.Sub(*this, 1); - const unsigned b = this_1.LowBitPos(); - - // Calculate m, such that this == 1 + 2 ^ b * m - BigNum m; - ALLOC_TEMP(m, Count()); - m.Shr(this_1, b); - - // For a number of witnesses, test whether the witness demonstrates this - // number to be composite via Fermat's Little Theorem, or has a - // nontrivial square root mod n - static const Val witnesses[] = {3, 5, 7}; - BigNum z; - ALLOC_TEMP(z, 2 * (Count() + 1)); - for (loop = 0; loop != arrsize(witnesses); ++loop) { - - // Initialize z to (witness ^ m % this) - z.PowMod(witnesses[loop], m, *this); - - // This passes the test if (z == 1) - if (!z.Compare(1)) - continue; - - for (unsigned j = 0; z.Compare(this_1); ) { - - // This fails the test if we reach b iterations. - ++j; - if (j == b) - return false; - - // Square z. This fails the test if z mod this equals 1. - z.MulMod(z, z, *this); - if (!z.Compare(1)) - return false; - - } - - } - - return true; -} - -//=========================================================================== -unsigned BigNum::LowBitPos () const { - // returns the position of the lowest set bit, or -1 if no bits are set - - for (unsigned index = 0, count = Count(); index < count; ++index) { - Val val = (*this)[index]; - if (!val) - continue; - for (unsigned bit = 0; ; ++bit) - if (val & (1 << bit)) - return index * 8 * sizeof(Val) + bit; - } - - return (unsigned)-1; -} - -//=========================================================================== -void BigNum::Mod (const BigNum & a, const BigNum & b) { - // this = a % b - - ((BigNum *)nil)->Div(a, b, this); -} - -//=========================================================================== -void BigNum::ModNormalized (const BigNum & a, const BigNum & b) { - // this = a % b - // high bit of b must be set - - ((BigNum *)nil)->DivNormalized(a, b, this); -} - -//=========================================================================== -BigNum::DVal BigNum::Mul (BigNum::Val a, BigNum::Val b) { - // returns a * b - - return (DVal)a * (DVal)b; -} - -//=========================================================================== -void BigNum::Mul (const BigNum & a, Val b) { - // this = a * b - - const unsigned count = a.Count(); - GrowToCount(count + 1, true); - unsigned index = 0; - Val carry = 0; - for (; index < count; ++index) - SetVal(index, (DVal)(Mul(a[index], b) + carry), &carry); - if (carry) - SetVal(index++, carry); - Trim(index); - -} - -//=========================================================================== -void BigNum::Mul (const BigNum & a, const BigNum & b) { - // this = a * b - - const unsigned aCount = a.Count(); - const unsigned bCount = b.Count(); - const unsigned count = aCount + bCount; - SetCount(count); - if (!count) - return; - - // We perform the multiplication from left to right, so that we don't - // overwrite any operand words before they're used in the case that - // the destination is not distinct from either of the operands - SetVal(count - 1, 0); - for (unsigned index = count - 1; index--; ) { - - // Iterate every combination of aIndex + bIndex that adds up to - // index, and sum the products of those words - DVal value = 0; - const unsigned aStart = (index < bCount) ? 0 : (index + 1 - bCount); - const unsigned aTerm = min(index + 1, aCount); - for (unsigned aIndex = aStart; aIndex != aTerm; ++aIndex) { - - // Accumulate the product of this pair of words - value = (DVal)(Mul(a[aIndex], b[index - aIndex]) + value); - - // If the product exceeds the word size, apply carry - Val carry = HIGH(value); - for (unsigned carryIndex = index + 1; carry; ++carryIndex) - SetVal(carryIndex, (DVal)((DVal)(*this)[carryIndex] + (DVal)carry), &carry); - value = LOW(value); - - } - - // Store the sum of products as the final value for index - SetVal(index, LOW(value)); - - } - - Trim(count); - -} - -//=========================================================================== -void BigNum::MulMod (const BigNum & a, const BigNum & b, const BigNum & c) { - // this = a * b % c - - if (this != &c) { - Mul(a, b); - Mod(*this, c); - } - else { - BigNum temp; - ALLOC_TEMP(temp, a.Count() + b.Count()); - temp.Mul(a, b); - Mod(temp, c); - } - -} - -//=========================================================================== -void BigNum::PowMod (Val a, const BigNum & b, const BigNum & c) { - // this = a ^ b % c - - // Verify that b is distinct from this - BigNum bbBuffer; - const BigNum & bb = (&b != this) ? b : bbBuffer; - if (&bb != &b) { - ALLOC_TEMP(bbBuffer, b.Count()); - bbBuffer.Set(b); - } - - // Generate a table which may allow us to process two bits at once - Val aMult[4] = { - 1, - a, - (Val)(a * a), - (Val)(a * a * a) - }; - bool overflow = (aMult[2] < a) || (aMult[3] < a) || (c.Compare(aMult[3]) <= 0); - - // Normalize the denominator so that the high bit is set. The result - // will be built shifted an equivalent amount. - const unsigned shift = 8 * sizeof(Val) - MathHighBitPos(c[c.Count() - 1]) - 1; - BigNum cc; - ALLOC_TEMP(cc, c.Count() + 1); - cc.Shl(c, shift); - - // Perform the exponentiation from left to right two bits at a time - if (!overflow) { - SetBits(shift, 1); - bool anySet = false; - for (unsigned index = bb.Count(); index--; ) - for (unsigned bit = 8 * sizeof(Val); bit; ) { - bit -= 2; - - if (anySet) { - Square(*this); - Shr(*this, shift); - ModNormalized(*this, cc); - Square(*this); - Shr(*this, shift); - ModNormalized(*this, cc); - } - - unsigned entry = (bb[index] >> bit) & 3; - if (entry) { - Mul(*this, aMult[entry]); - ModNormalized(*this, cc); - anySet = true; - } - - } - } - - // Perform the exponentiation from left to right a single bit at a time - else { - SetBits(shift, 1); - bool anySet = false; - for (unsigned index = bb.Count(); index--; ) - for (unsigned bit = 8 * sizeof(Val); bit--; ) { - - if (anySet) { - Square(*this); - ModNormalized(*this, cc); - } - - if (bb[index] & (1 << bit)) { - Mul(*this, a); - ModNormalized(*this, cc); - anySet = true; - } - - } - } - - // Denormalize the result - Shr(*this, shift); - +void BigNum::FromData_LE (unsigned bytes, const void * data) +{ + unsigned char * buffer = TRACKED_NEW unsigned char[bytes]; + memcpy(buffer, data, bytes); + byteswap(bytes, buffer); + BN_bin2bn(buffer, bytes, &m_number); + delete [] buffer; } //=========================================================================== -void BigNum::PowMod (const BigNum & a, const BigNum & b, const BigNum & c) { - // this = a ^ b % c - - // Verify that a and b are distinct from this - BigNum distinctTemp; - const BigNum & aa = (&a != this) ? a : distinctTemp; - const BigNum & bb = (&b != this) ? b : distinctTemp; - if ((&aa != &a) || (&bb != &b)) { - ALLOC_TEMP(distinctTemp, Count()); - distinctTemp.Set(*this); - } - - // Generate a table which will allow us to process two bits at once - BigNum a2; - BigNum a3; - ALLOC_TEMP(a2, 2 * aa.Count() + 1); - ALLOC_TEMP(a3, 3 * aa.Count() + 1); - a2.Mul(aa, aa); - a2.Mod(a2, c); - a3.Mul(aa, a2); - a3.Mod(a3, c); - const BigNum * aMult[] = { - nil, - &aa, - &a2, - &a3 - }; - - // Normalize the denominator so that the high bit is set. The result - // will be built shifted an equivalent amount. - const unsigned shift = 8 * sizeof(Val) - MathHighBitPos(c[c.Count() - 1]) - 1; - BigNum cc; - ALLOC_TEMP(cc, c.Count() + 1); - cc.Shl(c, shift); - - // Perform the exponentiation from left to right two bits at a time - SetBits(shift, 1); - bool anySet = false; - for (unsigned index = bb.Count(); index--; ) - for (unsigned bit = 8 * sizeof(Val); bit; ) { - bit -= 2; - - if (anySet) { - Square(*this); - Shr(*this, shift); - ModNormalized(*this, cc); - Square(*this); - Shr(*this, shift); - ModNormalized(*this, cc); - } - - unsigned entry = (bb[index] >> bit) & 3; - if (entry) { - Mul(*this, *aMult[entry]); - ModNormalized(*this, cc); - anySet = true; - } - - } - - // Denormalize the result - Shr(*this, shift); - +unsigned char * BigNum::GetData_BE (unsigned * bytes) const +{ + *bytes = BN_num_bytes(&m_number); + unsigned char * data = TRACKED_NEW unsigned char[*bytes]; + BN_bn2bin(&m_number, data); + return data; } //=========================================================================== -void BigNum::Rand (const BigNum & a, BigNum * seed) { - // this = random number less than a - - ASSERT(seed != &a); - ASSERT(seed != this); - - // Verify that a is distinct from this - BigNum distinctTemp; - const BigNum & aa = (&a != this) ? a : distinctTemp; - if (&aa != &a) { - ALLOC_TEMP(distinctTemp, a.Count()); - distinctTemp.Set(a); - } - - // Count the number of bits in a - unsigned bits = aa.HighBitPos() + 1; - - for (;;) { - - // Generate a random number with the same number of bits as a - Rand(bits, seed); - - // Check whether the number is less than a - if (Compare(aa) < 0) - break; - - } - +unsigned char * BigNum::GetData_LE (unsigned * bytes) const +{ + *bytes = BN_num_bytes(&m_number); + unsigned char * data = TRACKED_NEW unsigned char[*bytes]; + BN_bn2bin(&m_number, data); + byteswap(*bytes, data); + return data; } //=========================================================================== -void BigNum::Rand (unsigned bits, BigNum * seed) { +void BigNum::Rand (unsigned bits, BigNum * seed) +{ // this = random number with bits or fewer bits - ASSERT(seed != this); - - // Prepare the output buffer - const unsigned count = (bits + 8 * sizeof(Val) - 1) / (8 * sizeof(Val)); - SetCount(count); - if (!count) - return; - - // Prepare the seed - unsigned seedCount = seed->Count(); - if (!seedCount) - seed->SetCount(++seedCount); - unsigned seedIndex = 0; - - // Produce a random number with the correct number of words - for (unsigned index = 0; index < count; ++index) { - - // Read the next word of the seed - dword randValue = (*seed)[seedIndex] ^ ((index == seedIndex) ? 0x075bd924 : 0); - - // Produce one word of randomness, 16 bits at a time - Val value = 0; - for (unsigned bit = 0; bit < 8 * sizeof(Val); bit += 16) { - const dword A = 0xbc8f; - const dword Q = 0xadc8; - const dword R = 0x0d47; - - dword div = randValue / Q; - randValue = A * (randValue - Q * div) - R * div; - randValue &= 0x7fffffff; - - value |= (randValue & 0xffff) << bit; - } - - // Store the random word - SetVal(index, value); - - // Update the seed and move to the seed next word - seed->SetVal(seedIndex, (Val)randValue); - if (++seedIndex >= seedCount) - seedIndex = 0; - - } - - // Mask the final word to contain the correct number of bits - Val mask = (Val)((Val)-1 >> (count * 8 * sizeof(Val) - bits)); - SetVal(count - 1, (Val)((*this)[count - 1] & mask)); - - // Trim the result - Trim(count); - - // Rotate the seed so the next unused seed word will be the first seed - // word used in the next random operation - if (seedIndex) { - BigNum saved; - ALLOC_TEMP(saved, seedCount); - saved.Set(*seed); - - for (unsigned index = 0; index < seedCount; ++index) - (*seed)[index] = saved[(index + seedIndex) % seedCount]; - } - -} - -//=========================================================================== -void BigNum::RandPrime (unsigned bits, BigNum * seed) { - - // Calculate the required number of words to hold the generated number - unsigned count = (bits + 8 * sizeof(Val) - 1) / (8 * sizeof(Val)); - - // For large bit counts, calculate the prime number as 2 * q * n + 1, - // where q is a random prime with fewer bits, and n is a random number - // chosen as follows: - // n >= (2 ^ (bits - 1) - 1) / (2 * q) - // n < (2 ^ bits - 1) / (2 * q) - if (bits > 128) { - - // Choose a prime number q, and multiply it by 2 - BigNum q_2; - ALLOC_TEMP(q_2, count / 2 + 2); - q_2.RandPrime(bits / 2, seed); - q_2.Mul(q_2, 2); - - // Calculate the lower bound - BigNum lowerBound; - ALLOC_TEMP(lowerBound, count + 1); - lowerBound.SetBits(0, bits - 1); - lowerBound.Div(lowerBound, q_2, nil); - - // Calculate the upper bound - BigNum upperBound; - ALLOC_TEMP(upperBound, count + 1); - upperBound.SetBits(0, bits); - upperBound.Div(upperBound, q_2, nil); - - // Calculate the number of bits in the upper bound - unsigned upperBoundBits = upperBound.HighBitPos() + 1; - - for (;;) { - - // Choose a random number between the lower and upper bounds - Rand(upperBoundBits, seed); - if (Compare(upperBound) >= 0) - continue; - if (Compare(lowerBound) < 0) - continue; - - // Calculate 2 * q * n + 1 - Mul(*this, q_2); - Add(*this, 1); - - // Test whether the result is prime - if (IsPrime()) - break; - - } - - } - - // For small bit counts, choose a random number with the requested - // number of bits, then keep incrementing it until we find a prime - else { - - // Define the upper bound for a number with the requested number - // of bits - BigNum bound; - ALLOC_TEMP(bound, count + 1); - bound.SetBits(bits, 1); - - for (;;) { - - // Choose a random number with (bits - 1) bits - Rand(bits - 1, seed); - - // Subtract it from the upper bound to generate a number with - // the high bit set - Sub(bound, *this); - - // Keep incrementing the number until we find a prime - if (!IsOdd()) - Add(*this, 1); - while (!IsPrime()) - Add(*this, 2); - - // If the number reached or exceeded the upper bound, try again - if (Compare(bound) < 0) - break; - - } - - } - -} - -//=========================================================================== -void BigNum::Set (const BigNum & a) { - // this = a - - if (&a == this) - return; - - const unsigned count = a.Count(); - SetCount(count); - for (unsigned index = count; index--; ) - SetVal(index, a[index]); - -} - -//=========================================================================== -void BigNum::Set (unsigned a) { - // this = a - - ZeroCount(); - if (a) - for (unsigned index = 0; ; ++index) { - SetCount(index + 1); - SetVal(index, LOW(a)); - if (a < VAL_RANGE) - break; - a = (unsigned)(a / VAL_RANGE); - } - -} - -//=========================================================================== -void BigNum::SetBits (unsigned setBitsOffset, unsigned setBitsCount) { - // this = binary [1...][0...], where 'setBitsOffset' is the number of - // zero bits and 'setBitsCount' is the number of one bits - - if (!setBitsCount) { - ZeroCount(); - return; - } - - const unsigned setBitsTerm = setBitsOffset + setBitsCount - 1; - const unsigned bitsPerWord = 8 * sizeof(Val); - const unsigned firstSetWord = setBitsOffset / bitsPerWord; - const unsigned lastSetWord = (setBitsOffset + setBitsCount - 1) / bitsPerWord; - Val firstSetMask = (Val)((Val)-1 << (setBitsOffset % bitsPerWord)); - Val lastSetMask = (Val)((Val)-1 >> (bitsPerWord - setBitsTerm % bitsPerWord - 1)); - if (firstSetWord == lastSetWord) - firstSetMask = lastSetMask = (Val)(firstSetMask & lastSetMask); - - SetCount(lastSetWord + 1); - unsigned index = 0; - for (; index < firstSetWord; ++index) - SetVal(index, 0); - SetVal(index++, firstSetMask); - if (firstSetWord == lastSetWord) - return; - for (; index < lastSetWord; ++index) - SetVal(index, (Val)-1); - SetVal(index, lastSetMask); - -} - -//=========================================================================== -void BigNum::SetOne () { - // this = 1 - - SetCount(1); - SetVal(0, 1); -} - -//=========================================================================== -void BigNum::SetZero () { - // this = 0 - - ZeroCount(); -} - -//=========================================================================== -void BigNum::Shl (const BigNum & a, unsigned b) { - // this = a << b - - ASSERT(b < 8 * sizeof(Val)); - if (!b) { - Set(a); - return; - } - const unsigned bInv = 8 * sizeof(Val) - b; - - const unsigned count = a.Count(); - SetCount(count + 1); - Val curr = 0; - for (unsigned index = count; index >= 1; --index) { - Val next = a[index - 1]; - SetVal(index, (Val)((next >> bInv) | (curr << b))); - curr = next; - } - SetVal(0, (Val)(curr << b)); - Trim(count + 1); - -} - -//=========================================================================== -void BigNum::Shr (const BigNum & a, unsigned b) { - // this = a >> b - - ASSERT(b < 8 * sizeof(Val)); - if (!b) { - Set(a); - return; - } - const unsigned bInv = 8 * sizeof(Val) - b; - - const unsigned count = a.Count(); - SetCount(count); - if (!count) - return; - - Val curr = a[0]; - for (unsigned index = 0; index + 1 < count; ++index) { - Val next = a[index + 1]; - SetVal(index, (Val)((next << bInv) | (curr >> b))); - curr = next; - } - SetVal(count - 1, (Val)(curr >> b)); - Trim(count); - -} - -//=========================================================================== -void BigNum::Square (const BigNum & a) { - // this = a * a - - const unsigned aCount = a.Count(); - const unsigned count = 2 * aCount; - SetCount(count); - if (!count) - return; - - // We perform the multiplication from left to right, so that we don't - // overwrite any operand words before they're used in the case that - // the destination is not distinct from the operand - SetVal(count - 1, 0); - for (unsigned index = count - 1; index--; ) { - - // Iterate every combination of source indices that adds up to - // index, and sum the products of those words - DVal value = 0; - unsigned aIndex = (index < aCount) ? 0 : (index + 1 - aCount); - unsigned bIndex; - for (; (int)((bIndex = index - aIndex) - aIndex) >= 0; ++aIndex) { - - // Calculate the product of this pair of words - DVal product = Mul(a[aIndex], a[bIndex]); - - // Add the product to the sum. If it exceeds the word size, - // apply carry. - value = (DVal)(value + product); - Val carry = HIGH(value); - unsigned carryIndex; - for (carryIndex = index + 1; carry; ++carryIndex) - SetVal(carryIndex, (DVal)((DVal)(*this)[carryIndex] + (DVal)carry), &carry); - value = LOW(value); - - // If this pair of words should be multiplied twice, add the - // product again. - if (aIndex == bIndex) - continue; - value = (DVal)(value + product); - carry = HIGH(value); - for (carryIndex = index + 1; carry; ++carryIndex) - SetVal(carryIndex, (DVal)((DVal)(*this)[carryIndex] + (DVal)carry), &carry); - value = LOW(value); - - } - - // Store the sum of products as the final value for index - SetVal(index, LOW(value)); - - } - - Trim(count); - -} - -//=========================================================================== -void BigNum::Sub (const BigNum & a, Val b) { - // this = a - b - - const unsigned count = a.Count(); - SetCount(count); - Val borrow = b; - unsigned index; - for (index = 0; index < count; ++index) { - SetVal(index, (DVal)((DVal)a[index] - (DVal)borrow), &borrow); - borrow = (Val)((Val)0 - (Val)borrow); - } - ASSERT(!borrow); - Trim(index); - -} - -//=========================================================================== -void BigNum::Sub (const BigNum & a, const BigNum & b) { - // this = a - b - - const unsigned count = a.Count(); - const unsigned bCount = b.Count(); - GrowToCount(count, true); - Val borrow = 0; - unsigned index; - for (index = 0; index < count; ++index) { - Val bVal = (index < bCount) ? b[index] : (Val)0; - SetVal(index, (DVal)((DVal)a[index] - (DVal)bVal - (DVal)borrow), &borrow); - borrow = (Val)((Val)0 - (Val)borrow); - } - ASSERT(!borrow); - Trim(index); - -} - -//=========================================================================== -void BigNum::ToStr (BigNum * buffer, Val radix) const { - ASSERT(this != buffer); - - // Calculate the number of characters in the prefix - unsigned prefixChars; - if (radix == 16) - prefixChars = 2; - else if (radix == 8) - prefixChars = 1; - else - prefixChars = 0; - - // Preallocate space for the output string - unsigned charsPerVal = 0; - for (Val testVal = (Val)-1; testVal; testVal = (Val)(testVal / radix)) - ++charsPerVal; - const unsigned charsTotal = max(1, Count()) * charsPerVal + prefixChars + 1; - buffer->SetCount((charsTotal * sizeof(wchar) + sizeof(Val) - 1) / sizeof(Val)); - - // Build the prefix - wchar * prefix = (wchar *)buffer->Ptr(); - if (prefixChars) { - prefix[0] = L'0'; - if (radix == 16) - prefix[1] = L'x'; - else - ASSERT(prefixChars == 1); - } - - // Build the number starting with the least significant digit - wchar * start = prefix + prefixChars; - wchar * curr = start; - BigNum work; - ALLOC_TEMP(work, Count()); - work.Set(*this); - do { - - // Extract the next value - Val remainder; - work.Div(work, radix, &remainder); - - // Encode it as a character in the output string - if (remainder >= 10) - *curr++ = (wchar)(L'a' + (unsigned)remainder - 10); - else - *curr++ = (wchar)(L'0' + (unsigned)remainder); - - } while (work.Count()); - *curr = 0; - - // Reverse the order of the output string - for (wchar * left = start, * right = curr - 1; left < right; ++left, --right) - SWAP(*left, *right); - + unsigned seedBytes; + unsigned char * seedData = seed->GetData_BE(&seedBytes); + RAND_seed(seedData, seedBytes); + BN_rand(&m_number, bits, 0, 0); + delete [] seedData; } diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h index 06d231de..b56d7df2 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h @@ -41,70 +41,169 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -class BigNum : private ARRAY(dword) { -public: - typedef dword Val; // must match base array - typedef qword DVal; // must be twice as large as Val +#include +class BigNum { private: - bool m_isTemp; - - void DivNormalized (const BigNum & a, const BigNum & b, BigNum * remainder); - void ModNormalized (const BigNum & a, const BigNum & b); - - inline static DVal Mul (Val a, Val b); + BIGNUM m_number; + mutable BN_CTX * m_context; - inline void SetVal (unsigned index, Val value); - inline void SetVal (unsigned index, DVal value, Val * carry); - inline void Trim (unsigned count); - inline BigNum * UseTempAlloc (Val * ptr, unsigned count); + BN_CTX * GetContext () const + { + if (!m_context) + m_context = BN_CTX_new(); + return m_context; + } public: BigNum (); BigNum (const BigNum & a); BigNum (unsigned a); - BigNum (unsigned bytes, const void * data); - BigNum (const wchar str[], Val radix); + BigNum (unsigned bytes, const void * data, bool le=false); ~BigNum (); + BigNum & operator= (const BigNum & a) + { + BN_copy(&m_number, &a.m_number); + return *this; + } + // Constant parameters need not be distinct from the destination or from // each other - void Add (const BigNum & a, Val b); - void Add (const BigNum & a, const BigNum & b); - int Compare (Val a) const; - int Compare (const BigNum & a) const; - void Div (const BigNum & a, Val b, Val * remainder); - void Div (const BigNum & a, const BigNum & b, BigNum * remainder); - void FromData (unsigned bytes, const void * data); - void FromStr (const wchar str[], Val radix); - void Gcd (const BigNum & a, const BigNum & b); - const void * GetData (unsigned * bytes) const; - unsigned HighBitPos () const; - bool InverseMod (const BigNum & a, const BigNum & b); - bool IsMultiple (Val a) const; - bool IsOdd () const; - bool IsPrime () const; - unsigned LowBitPos () const; - void Mod (const BigNum & a, const BigNum & b); - void Mul (const BigNum & a, Val b); - void Mul (const BigNum & a, const BigNum & b); - void MulMod (const BigNum & a, const BigNum & b, const BigNum & c); - void PowMod (Val a, const BigNum & b, const BigNum & c); - void PowMod (const BigNum & a, const BigNum & b, const BigNum & c); - void Rand (const BigNum & a, BigNum * seed); + void Add (const BigNum & a, dword b) + { + // this = a + b + BN_copy(&m_number, &a.m_number); + BN_add_word(&m_number, b); + } + + void Add (const BigNum & a, const BigNum & b) + { + // this = a + b + BN_add(&m_number, &a.m_number, &b.m_number); + } + + int Compare (dword a) const; + int Compare (const BigNum & a) const + { + return BN_cmp(&m_number, &a.m_number); + } + + void Div (const BigNum & a, dword b, dword * remainder) + { + // this = a / b, remainder = a % b + BN_copy(&m_number, &a.m_number); + *remainder = (dword)BN_div_word(&m_number, b); + } + + void Div (const BigNum & a, const BigNum & b, BigNum * remainder) + { + // this = a / b, remainder = a % b + // either this or remainder may be nil + BN_div(this ? &m_number : nil, remainder ? &remainder->m_number : nil, + &a.m_number, &b.m_number, GetContext()); + } + + void FromData_BE (unsigned bytes, const void * data) + { + BN_bin2bn((const unsigned char *)data, bytes, &m_number); + } + + void FromData_LE (unsigned bytes, const void * data); + + unsigned char * GetData_BE (unsigned * bytes) const; + unsigned char * GetData_LE (unsigned * bytes) const; + + bool IsPrime () const + { + // Cyan's code uses 3 checks, so we'll follow suit. + // This provides an accurate answer to p < 0.015625 + return BN_is_prime_fasttest(&m_number, 3, nil, GetContext(), nil, 1) > 0; + } + + void Mod (const BigNum & a, const BigNum & b) + { + // this = a % b + BN_div(nil, &m_number, &a.m_number, &b.m_number, GetContext()); + } + + void Mul (const BigNum & a, dword b) + { + // this = a * b + BN_copy(&m_number, &a.m_number); + BN_mul_word(&m_number, b); + } + + void Mul (const BigNum & a, const BigNum & b) + { + // this = a * b + BN_mul(&m_number, &a.m_number, &b.m_number, GetContext()); + } + + void PowMod (dword a, const BigNum & b, const BigNum & c) + { + // this = a ^ b % c + PowMod(BigNum(a), b, c); + } + + void PowMod (const BigNum & a, const BigNum & b, const BigNum & c) + { + // this = a ^ b % c + BN_mod_exp(&m_number, &a.m_number, &b.m_number, &c.m_number, GetContext()); + } + + void Rand (const BigNum & a, BigNum * seed) + { + // this = random number less than a + unsigned bits = BN_num_bits(&a.m_number); + do + Rand(bits, seed); + while (Compare(a) >= 0); + } + void Rand (unsigned bits, BigNum * seed); - void RandPrime (unsigned bits, BigNum * seed); - void Set (const BigNum & a); - void Set (unsigned a); - void SetBits (unsigned setBitsOffset, unsigned setBitsCount); - void SetOne (); - void SetZero (); - void Shl (const BigNum & a, unsigned b); - void Shr (const BigNum & a, unsigned b); - void Square (const BigNum & a); - void Sub (const BigNum & a, Val b); - void Sub (const BigNum & a, const BigNum & b); - void ToStr (BigNum * buffer, Val radix) const; + void RandPrime (unsigned bits, BigNum * seed) + { + BN_generate_prime(&m_number, bits, 1, nil, nil, nil, nil); + } + + void Set (const BigNum & a) + { + BN_copy(&m_number, &a.m_number); + } + + void Set (unsigned a) + { + BN_set_word(&m_number, a); + } + + void SetOne () { Set(1); } + void SetZero () { Set(0); } + + void Shl (const BigNum & a, unsigned b) + { + // this = a << b + BN_lshift(&m_number, &a.m_number, b); + } + + void Shr (const BigNum & a, unsigned b) + { + // this = a >> b + BN_rshift(&m_number, &a.m_number, b); + } + + void Sub (const BigNum & a, dword b) + { + // this = a - b + BN_copy(&m_number, &a.m_number); + BN_sub_word(&m_number, b); + } + + void Sub (const BigNum & a, const BigNum & b) + { + // this = a - b + BN_sub(&m_number, &a.m_number, &b.m_number); + } }; diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp index 2dddb1f2..5c19cefe 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp @@ -34,12 +34,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include - -// OpenSSL's RC4 algorithm has bugs and randomly corrupts data -//#define OPENSSL_RC4 -#ifdef OPENSSL_RC4 #include -#endif /***************************************************************************** * @@ -134,7 +129,6 @@ void Sha1Process ( * ***/ -#ifdef OPENSSL_RC4 //============================================================================ static void Rc4Codec ( CryptKey * key, @@ -161,105 +155,6 @@ static void Rc4Codec ( MemCopy(data, temp, bytes); } -#else // OPENSSL_RC4 - -//=========================================================================== -void KeyRc4::Codec (bool encrypt, ARRAY(byte) * dest, unsigned sourceBytes, const void * sourceData) { - // RC4 uses the same algorithm to both encrypt and decrypt - dest->SetCount(sourceBytes); - - byte * destDataPtr = (byte *)dest->Ptr(); - const byte * sourceDataPtr = (const byte *)sourceData; - - for (unsigned index = 0; index < sourceBytes; ++index) { - m_x = (m_x + 1) & 0xff; - m_y = (m_state[m_x] + m_y) & 0xff; - SWAP(m_state[m_x], m_state[m_y]); - - const unsigned offset = (m_state[m_x] + m_state[m_y]) & 0xff; - destDataPtr[index] = (byte)(sourceDataPtr[index] ^ m_state[offset]); - } -} - -//=========================================================================== -void KeyRc4::KeyGen ( - unsigned randomBytes, - const void * randomData, - ARRAY(byte) * privateData -) { - // Allocate an output digest - struct Digest { dword data[5]; }; - privateData->SetCount(sizeof(Digest)); - Digest * digest = (Digest *)privateData->Ptr(); - - // Perform the hash - { - // Initialize the hash values with the repeating pattern of random - // data - unsigned offset = 0; - for (; offset < sizeof(Digest); ++offset) - ((byte *)digest)[offset] = ((const byte *)randomData)[offset % randomBytes]; - for (; offset < randomBytes; ++offset) - ((byte *)digest)[offset % sizeof(Digest)] ^= ((const byte *)randomData)[offset]; - - // 32-bit rotate left - #ifdef _MSC_VER - #define ROTL(n, X) _rotl(X, n) - #else - #define ROTL(n, X) (((X) << (n)) | ((X) >> (32 - (n)))) - #endif - #define f1(x,y,z) (z ^ (x & (y ^ z))) // Rounds 0-19 - #define K1 0x5A827999L // Rounds 0-19 - #define subRound(a, b, c, d, e, f, k, data) (e += ROTL(5, a) + f(b, c, d) + k + data, b = ROTL(30, b)) - - // first five subrounds from SHA1 - dword A = 0x67452301; - dword B = 0xEFCDAB89; - dword C = 0x98BADCFE; - dword D = 0x10325476; - dword E = 0xC3D2E1F0; - subRound(A, B, C, D, E, f1, K1, digest->data[ 0]); - subRound(E, A, B, C, D, f1, K1, digest->data[ 1]); - subRound(D, E, A, B, C, f1, K1, digest->data[ 2]); - subRound(C, D, E, A, B, f1, K1, digest->data[ 3]); - subRound(B, C, D, E, A, f1, K1, digest->data[ 4]); - digest->data[0] += A; - digest->data[1] += B; - digest->data[2] += C; - digest->data[3] += D; - digest->data[4] += E; - } -} - -//=========================================================================== -void KeyRc4::Initialize (unsigned bytes, const void * data) { - ASSERT(bytes); - ASSERT(data); - - // Initialize key with default values - { - m_x = 0; - m_y = 0; - for (unsigned offset = 0; offset < arrsize(m_state); ++offset) - m_state[offset] = (byte) offset; - } - - // Seed key from digest - { - unsigned index1 = 0; - unsigned index2 = 0; - for (unsigned offset = 0; offset < arrsize(m_state); ++offset) { - ASSERT(index1 < bytes); - index2 = (((const byte *)data)[index1] + m_state[offset] + index2) & 0xff; - SWAP(m_state[offset], m_state[index2]); - if (++index1 == bytes) - index1 = 0; - } - } -} - -#endif // OPENSSL_RC4 - } using namespace Crypt; @@ -319,18 +214,11 @@ CryptKey * CryptKeyCreate ( CryptKey * key = nil; switch (algorithm) { case kCryptRc4: { - #ifdef OPENSSL_RC4 RC4_KEY * rc4 = NEW(RC4_KEY); RC4_set_key(rc4, bytes, (const unsigned char *)data); key = NEW(CryptKey); key->algorithm = kCryptRc4; key->handle = rc4; - #else - KeyRc4 * rc4 = NEWZERO(KeyRc4)(bytes, data); - key = NEW(CryptKey); - key->algorithm = kCryptRc4; - key->handle = rc4; - #endif } break; @@ -343,43 +231,6 @@ CryptKey * CryptKeyCreate ( return key; } -//=========================================================================== -// Not exposed in header because is not used at the moment and I don't want a big rebuild right now :) -void CryptKeyGenerate ( - ECryptAlgorithm algorithm, - unsigned keyBits, // used for algorithms with variable key strength - unsigned randomBytes, - const void * randomData, - ARRAY(byte) * privateData, - ARRAY(byte) * publicData // only for public key cryptography -) { - // Allocate and fill in private and/or public key classes - switch (algorithm) { - - case kCryptRc4: - KeyRc4::KeyGen( - randomBytes, - randomData, - privateData - ); - break; - - case kCryptRsa: - #if 0 - KeyRsa::KeyGen( - keyBits, - randomBytes, - randomData, - privateData, - publicData - ); - break; - #endif // fall thru to fatal... - - DEFAULT_FATAL(algorithm); - } -} - //============================================================================ void CryptKeyClose ( CryptKey * key @@ -397,12 +248,7 @@ unsigned CryptKeyGetBlockSize ( ) { switch (key->algorithm) { case kCryptRc4: { - #ifdef OPENSSL_RC4 return 1; - #else - KeyRc4 * rc4 = (KeyRc4 *)key->handle; - return rc4->GetBlockSize(); - #endif } break; @@ -537,12 +383,7 @@ void CryptEncrypt ( ) { switch (key->algorithm) { case kCryptRc4: { - #ifdef OPENSSL_RC4 Rc4Codec(key, true, dest, sourceBytes, sourceData); - #else - KeyRc4 * rc4 = (KeyRc4 *)key->handle; - rc4->Codec(true, dest, sourceBytes, sourceData); - #endif } break; @@ -564,14 +405,7 @@ void CryptEncrypt ( switch (key->algorithm) { case kCryptRc4: { - #ifdef OPENSSL_RC4 Rc4Codec(key, true, bytes, data); - #else - ARRAY(byte) dest; - dest.Reserve(bytes); - CryptEncrypt(key, &dest, bytes, data); - MemCopy(data, dest.Ptr(), bytes); - #endif } break; @@ -592,12 +426,7 @@ void CryptDecrypt ( ) { switch (key->algorithm) { case kCryptRc4: { - #ifdef OPENSSL_RC4 Rc4Codec(key, false, dest, sourceBytes, sourceData); - #else - KeyRc4 * rc4 = (KeyRc4 *)key->handle; - rc4->Codec(false, dest, sourceBytes, sourceData); - #endif } break; @@ -619,14 +448,7 @@ void CryptDecrypt ( switch (key->algorithm) { case kCryptRc4: { - #ifdef OPENSSL_RC4 Rc4Codec(key, false, bytes, data); - #else - ARRAY(byte) dest; - dest.Reserve(bytes); - CryptDecrypt(key, &dest, bytes, data); - MemCopy(data, dest.Ptr(), bytes); - #endif } break; diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h index 29f2eeb1..51e2837d 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtEndian.h @@ -40,22 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // use little-endian as the "native" language of our network messages. -/***************************************************************************** -* -* Types and constants -* -***/ - -#ifdef _M_IX86 -# define LITTLE_ENDIAN 1 -#else -# define BIG_ENDIAN 1 -// That was a pretty weak check for endian-ness, if it -// failed then we probably need to strengthen it a bit. -# error "Are you sure this is a big-endian CPU?" -#endif - - /***************************************************************************** * * Little endian functions diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h index 0af9a71e..d4e60a7e 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h @@ -80,7 +80,7 @@ bool GuidFromHex (const byte buf[], unsigned length, Uuid * uuid); * ***/ -#include +#include struct Uuid { union { dword dwords[4]; @@ -98,6 +98,6 @@ struct Uuid { inline bool operator != (const Uuid & rhs) const { return !GuidsAreEqual(*this, rhs); } inline bool operator != (int rhs) const { ASSERT(!rhs); return !GuidsAreEqual(*this, kNilGuid); } }; -#include +#include diff --git a/Sources/Plasma/PubUtilLib/plAgeDescription/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plAgeDescription/CMakeLists.txt index 956d2f05..1666bfad 100644 --- a/Sources/Plasma/PubUtilLib/plAgeDescription/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plAgeDescription/CMakeLists.txt @@ -3,8 +3,6 @@ include_directories("../../FeatureLib") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") -include_directories(${OPENSSL_INCLUDE_DIR}) - set(plAgeDescription_SOURCES plAgeDescription.cpp plAgeManifest.cpp diff --git a/Sources/Plasma/PubUtilLib/plAgeLoader/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plAgeLoader/CMakeLists.txt index 39a7f095..bab47702 100644 --- a/Sources/Plasma/PubUtilLib/plAgeLoader/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plAgeLoader/CMakeLists.txt @@ -4,8 +4,6 @@ include_directories("../../NucleusLib/inc") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") -include_directories(${OPENSSL_INCLUDE_DIR}) - set(plAgeLoader_SOURCES plAgeLoader.cpp plAgeLoaderPaging.cpp diff --git a/Sources/Plasma/PubUtilLib/plAudio/plDSoundBuffer.cpp b/Sources/Plasma/PubUtilLib/plAudio/plDSoundBuffer.cpp index 82422c93..d757e8b0 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plDSoundBuffer.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plDSoundBuffer.cpp @@ -46,8 +46,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plStatusLog/plStatusLog.h" -#include - UInt32 plDSoundBuffer::fNumBuffers = 0; plProfile_CreateCounterNoReset( "Playing", "Sound", SoundPlaying ); plProfile_CreateCounterNoReset( "Allocated", "Sound", NumAllocated ); @@ -89,20 +87,10 @@ plDSoundBuffer::~plDSoundBuffer() void plDSoundBuffer::IAllocate( UInt32 size, plWAVHeader &bufferDesc, hsBool enable3D, hsBool tryStatic ) { // Create a DSound buffer description - fBufferDesc = TRACKED_NEW DSBUFFERDESC; - fBufferDesc->dwSize = sizeof( DSBUFFERDESC ); - - fBufferDesc->dwBufferBytes = size; - fBufferDesc->dwReserved = 0; - - fBufferDesc->lpwfxFormat = TRACKED_NEW WAVEFORMATEX; - fBufferDesc->lpwfxFormat->cbSize = 0; - fBufferDesc->lpwfxFormat->nAvgBytesPerSec = bufferDesc.fAvgBytesPerSec; - fBufferDesc->lpwfxFormat->nBlockAlign = bufferDesc.fBlockAlign; - fBufferDesc->lpwfxFormat->nChannels = bufferDesc.fNumChannels; - fBufferDesc->lpwfxFormat->nSamplesPerSec = bufferDesc.fNumSamplesPerSec; - fBufferDesc->lpwfxFormat->wBitsPerSample = bufferDesc.fBitsPerSample; - fBufferDesc->lpwfxFormat->wFormatTag = bufferDesc.fFormatTag; + fBufferDesc = TRACKED_NEW plWAVHeader; + *fBufferDesc = bufferDesc; + + fBufferSize = size; // Do we want to try EAX? if( plgAudioSys::UsingEAX() ) @@ -133,14 +121,10 @@ void plDSoundBuffer::IRelease( void ) alGetError(); memset(streamingBuffers, 0, STREAMING_BUFFERS * sizeof(unsigned)); - if( fBufferDesc != nil ) - { - delete fBufferDesc->lpwfxFormat; - fBufferDesc->lpwfxFormat = nil; - } delete fBufferDesc; fBufferDesc = nil; + fBufferSize = 0; fValid = false; plProfile_Dec( NumAllocated ); @@ -181,7 +165,7 @@ bool plDSoundBuffer::FillBuffer(void *data, unsigned bytes, plWAVHeader *header) source = 0; buffer = 0; - ALenum format = IGetALFormat(fBufferDesc->lpwfxFormat->wBitsPerSample, fBufferDesc->lpwfxFormat->nChannels); + ALenum format = IGetALFormat(fBufferDesc->fBitsPerSample, fBufferDesc->fNumChannels); ALenum error = alGetError(); alGenBuffers(1, &buffer); error = alGetError(); @@ -264,8 +248,8 @@ bool plDSoundBuffer::SetupStreamingSource(plAudioFileReader *stream) return false; } - ALenum format = IGetALFormat(fBufferDesc->lpwfxFormat->wBitsPerSample, fBufferDesc->lpwfxFormat->nChannels); - alBufferData( streamingBuffers[i], format, data, size, fBufferDesc->lpwfxFormat->nSamplesPerSec ); + ALenum format = IGetALFormat(fBufferDesc->fBitsPerSample, fBufferDesc->fNumChannels); + alBufferData( streamingBuffers[i], format, data, size, fBufferDesc->fNumSamplesPerSec ); if( (error = alGetError()) != AL_NO_ERROR ) plStatusLog::AddLineS("audio.log", "alBufferData"); } @@ -330,8 +314,8 @@ bool plDSoundBuffer::SetupStreamingSource(void *data, unsigned bytes) return false; } - ALenum format = IGetALFormat(fBufferDesc->lpwfxFormat->wBitsPerSample, fBufferDesc->lpwfxFormat->nChannels); - alBufferData( streamingBuffers[i], format, bufferData, size, fBufferDesc->lpwfxFormat->nSamplesPerSec ); + ALenum format = IGetALFormat(fBufferDesc->fBitsPerSample, fBufferDesc->fNumChannels); + alBufferData( streamingBuffers[i], format, bufferData, size, fBufferDesc->fNumSamplesPerSec ); if( (error = alGetError()) != AL_NO_ERROR ) plStatusLog::AddLineS("audio.log", "alBufferData"); } @@ -434,8 +418,8 @@ bool plDSoundBuffer::StreamingFillBuffer(plAudioFileReader *stream) { unsigned int size = stream->NumBytesLeft() < STREAM_BUFFER_SIZE ? stream->NumBytesLeft() : STREAM_BUFFER_SIZE; stream->Read(size, data); - ALenum format = IGetALFormat(fBufferDesc->lpwfxFormat->wBitsPerSample, fBufferDesc->lpwfxFormat->nChannels); - alBufferData( bufferId, format, data, size, fBufferDesc->lpwfxFormat->nSamplesPerSec ); + ALenum format = IGetALFormat(fBufferDesc->fBitsPerSample, fBufferDesc->fNumChannels); + alBufferData( bufferId, format, data, size, fBufferDesc->fNumSamplesPerSec ); if( (error = alGetError()) != AL_NO_ERROR ) { plStatusLog::AddLineS("audio.log", "Failed to copy data to sound buffer %d", error); @@ -550,8 +534,8 @@ bool plDSoundBuffer::VoiceFillBuffer(void *data, unsigned bytes, unsigned buffer ALenum error; unsigned int size = bytes < STREAM_BUFFER_SIZE ? bytes : STREAM_BUFFER_SIZE; - ALenum format = IGetALFormat(fBufferDesc->lpwfxFormat->wBitsPerSample, fBufferDesc->lpwfxFormat->nChannels); - alBufferData( bufferId, format, data, size, fBufferDesc->lpwfxFormat->nSamplesPerSec ); + ALenum format = IGetALFormat(fBufferDesc->fBitsPerSample, fBufferDesc->fNumChannels); + alBufferData( bufferId, format, data, size, fBufferDesc->fNumSamplesPerSec ); if( (error = alGetError()) != AL_NO_ERROR ) { plStatusLog::AddLineS("audio.log", "Failed to copy data to sound buffer %d", error); @@ -703,17 +687,17 @@ hsBool plDSoundBuffer::IsEAXAccelerated( void ) const UInt32 plDSoundBuffer::BytePosToMSecs( UInt32 bytePos ) const { - return (UInt32)(bytePos * 1000 / (hsScalar)fBufferDesc->lpwfxFormat->nAvgBytesPerSec); + return (UInt32)(bytePos * 1000 / (hsScalar)fBufferDesc->fAvgBytesPerSec); } //// GetBufferBytePos //////////////////////////////////////////////////////// UInt32 plDSoundBuffer::GetBufferBytePos( hsScalar timeInSecs ) const { - hsAssert( fBufferDesc != nil && fBufferDesc->lpwfxFormat != nil, "Nil buffer description when calling GetBufferBytePos()" ); + hsAssert( fBufferDesc != nil, "Nil buffer description when calling GetBufferBytePos()" ); - UInt32 byte = (UInt32)( timeInSecs * (hsScalar)fBufferDesc->lpwfxFormat->nSamplesPerSec ); - byte *= fBufferDesc->lpwfxFormat->nBlockAlign; + UInt32 byte = (UInt32)( timeInSecs * (hsScalar)fBufferDesc->fNumSamplesPerSec ); + byte *= fBufferDesc->fBlockAlign; return byte; } @@ -722,7 +706,7 @@ UInt32 plDSoundBuffer::GetBufferBytePos( hsScalar timeInSecs ) const UInt32 plDSoundBuffer::GetLengthInBytes( void ) const { - return (UInt32)fBufferDesc->dwBufferBytes; + return fBufferSize; } //// SetEAXSettings ////////////////////////////////////////////////////////// @@ -736,7 +720,7 @@ void plDSoundBuffer::SetEAXSettings( plEAXSourceSettings *settings, hsBool f UInt8 plDSoundBuffer::GetBlockAlign( void ) const { - return ( fBufferDesc != nil && fBufferDesc->lpwfxFormat != nil ) ? fBufferDesc->lpwfxFormat->nBlockAlign : 0; + return ( fBufferDesc != nil ) ? fBufferDesc->fBlockAlign : 0; } //// SetScalarVolume ///////////////////////////////////////////////////////// diff --git a/Sources/Plasma/PubUtilLib/plAudio/plDSoundBuffer.h b/Sources/Plasma/PubUtilLib/plAudio/plDSoundBuffer.h index 2f9a6f58..ddf5f365 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plDSoundBuffer.h +++ b/Sources/Plasma/PubUtilLib/plAudio/plDSoundBuffer.h @@ -46,9 +46,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com class plWAVHeader; class plAudioFileReader; -typedef struct tWAVEFORMATEX WAVEFORMATEX; -typedef struct _DSBUFFERDESC DSBUFFERDESC; - // Ported to OpenAL from DirectSound May 2006. Idealy the openal sources would be seperate from this class. // OpenAl sound buffer, and source. @@ -127,7 +124,8 @@ protected: hsTArray fPosNotifys; bool fStreaming; - DSBUFFERDESC* fBufferDesc; + plWAVHeader* fBufferDesc; + UInt32 fBufferSize; unsigned buffer; // used if this is not a streaming buffer unsigned streamingBuffers[STREAMING_BUFFERS]; // used if this is a streaming buffer diff --git a/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp b/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp index 8412c4d2..3d5f7d15 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plVoiceChat.cpp @@ -30,8 +30,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include #include "plDSoundBuffer.h" -#include -#include +#include +#include #include "hsGeometry3.h" #include "plVoiceChat.h" #include "plAudioSystem.h" @@ -535,13 +535,13 @@ hsBool plSpeex::Init(Mode mode) if(mode == kNarrowband) { - fEncoderState = speex_encoder_init(&speex_nb_mode); // narrowband - fDecoderState = speex_decoder_init(&speex_nb_mode); + fEncoderState = speex_encoder_init(speex_lib_get_mode(SPEEX_MODEID_NB)); // narrowband + fDecoderState = speex_decoder_init(speex_lib_get_mode(SPEEX_MODEID_NB)); } else if(mode == kWideband) { - fEncoderState = speex_encoder_init(&speex_wb_mode); - fDecoderState = speex_decoder_init(&speex_wb_mode); + fEncoderState = speex_encoder_init(speex_lib_get_mode(SPEEX_MODEID_WB)); + fDecoderState = speex_decoder_init(speex_lib_get_mode(SPEEX_MODEID_WB)); } speex_encoder_ctl(fEncoderState, SPEEX_GET_FRAME_SIZE, &fFrameSize); // get frame size diff --git a/Sources/Plasma/PubUtilLib/plAudioCore/plOGGCodec.cpp b/Sources/Plasma/PubUtilLib/plAudioCore/plOGGCodec.cpp index 4464fa3c..116659c5 100644 --- a/Sources/Plasma/PubUtilLib/plAudioCore/plOGGCodec.cpp +++ b/Sources/Plasma/PubUtilLib/plAudioCore/plOGGCodec.cpp @@ -33,9 +33,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // ////////////////////////////////////////////////////////////////////////////// -#include -#include -#include +#include +#include +#include #include #include diff --git a/Sources/Plasma/PubUtilLib/plAvatar/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plAvatar/CMakeLists.txt index bc9fe9cf..c8b82c78 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plAvatar/CMakeLists.txt @@ -4,7 +4,6 @@ include_directories("../../NucleusLib/inc") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") -include_directories(${OPENSSL_INCLUDE_DIR}) include_directories(${OPENAL_INCLUDE_DIR}) set(plAvatar_SOURCES diff --git a/Sources/Plasma/PubUtilLib/plEncryption/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plEncryption/CMakeLists.txt index 605f698e..7acf42ef 100644 --- a/Sources/Plasma/PubUtilLib/plEncryption/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plEncryption/CMakeLists.txt @@ -2,8 +2,6 @@ include_directories("../../CoreLib") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") -include_directories(${OPENSSL_INCLUDE_DIR}) - set(plEncryption_SOURCES plChecksum.cpp ) diff --git a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp index 3f5c1e1e..efa6f60b 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp @@ -54,6 +54,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #if HS_BUILD_FOR_WIN32 #include #include +#define mkdir _mkdir +#define chdir _chdir +#define chmod _chmod +#define rmdir _rmdir +#define unlink _unlink #endif #if HS_BUILD_FOR_UNIX diff --git a/Sources/Plasma/PubUtilLib/plGLight/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plGLight/CMakeLists.txt index 0fa8d498..91cffd48 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plGLight/CMakeLists.txt @@ -3,8 +3,6 @@ include_directories("../../NucleusLib/inc") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") -include_directories(${OPENSSL_INCLUDE_DIR}) - set(plGLight_SOURCES plDirectShadowMaster.cpp plLightInfo.cpp diff --git a/Sources/Plasma/PubUtilLib/plInputCore/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plInputCore/CMakeLists.txt index 89692688..27f7f818 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plInputCore/CMakeLists.txt @@ -4,7 +4,6 @@ include_directories("../../NucleusLib") include_directories("../../PubUtilLib") include_directories(${DirectX_INCLUDE_DIR}) -include_directories(${OPENSSL_INCLUDE_DIR}) include_directories(${OPENAL_INCLUDE_DIR}) set(plInputCore_SOURCES diff --git a/Sources/Plasma/PubUtilLib/plModifier/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plModifier/CMakeLists.txt index 2bf814e7..988029bd 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plModifier/CMakeLists.txt @@ -6,7 +6,6 @@ include_directories("../../PubUtilLib") include_directories(${PHYSX_INCLUDE_DIRS}) include_directories(${OPENAL_INCLUDE_DIR}) -include_directories(${OPENSSL_INCLUDE_DIR}) set(plModifier_SOURCES plAnimEventModifier.cpp diff --git a/Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt index 32a13e09..3b4947ab 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt @@ -4,8 +4,6 @@ include_directories("../../NucleusLib/inc") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") -include_directories(${OPENSSL_INCLUDE_DIR}) - set(plNetClient_SOURCES plLinkEffectsMgr.cpp plNetCliAgeJoiner.cpp diff --git a/Sources/Plasma/PubUtilLib/plNetClientComm/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plNetClientComm/CMakeLists.txt index 42dc6531..186c1860 100644 --- a/Sources/Plasma/PubUtilLib/plNetClientComm/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plNetClientComm/CMakeLists.txt @@ -4,8 +4,6 @@ include_directories("../../NucleusLib/inc") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") -include_directories(${OPENSSL_INCLUDE_DIR}) - set(plNetClientComm_SOURCES plNetClientComm.cpp ) diff --git a/Sources/Plasma/PubUtilLib/plNetTransport/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plNetTransport/CMakeLists.txt index 5d987ff3..a59601ae 100644 --- a/Sources/Plasma/PubUtilLib/plNetTransport/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plNetTransport/CMakeLists.txt @@ -3,8 +3,6 @@ include_directories("../../NucleusLib/inc") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") -include_directories(${OPENSSL_INCLUDE_DIR}) - set(plNetTransport_SOURCES plNetTransport.cpp plNetTransportMember.cpp diff --git a/Sources/Plasma/PubUtilLib/plPhysX/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plPhysX/CMakeLists.txt index 0fdbbba9..8f2a18ae 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plPhysX/CMakeLists.txt @@ -4,7 +4,6 @@ include_directories("../../NucleusLib") include_directories("../../PubUtilLib") include_directories(${PHYSX_INCLUDE_DIRS}) -include_directories(${OPENSSL_INCLUDE_DIR}) set(plPhysX_SOURCES plLOSDispatch.cpp diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp index 857f3aaa..c840e6c4 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp @@ -9019,7 +9019,10 @@ hsBool plDXPipeline::TestVisibleWorld( const hsBounds3Ext& wBnd ) { if( fView.fCullTreeDirty ) IRefreshCullTree(); - return fView.fCullTree.BoundsVisible(wBnd); + if (wBnd.GetType() == kBoundsNormal) + return fView.fCullTree.BoundsVisible(wBnd); + else + return false; } hsBool plDXPipeline::TestVisibleWorld( const plSceneObject* sObj ) diff --git a/Sources/Plasma/PubUtilLib/plSDLBrowser/plSDLBrowser.rc b/Sources/Plasma/PubUtilLib/plSDLBrowser/plSDLBrowser.rc index 0f3b49bb..6886a2cd 100644 --- a/Sources/Plasma/PubUtilLib/plSDLBrowser/plSDLBrowser.rc +++ b/Sources/Plasma/PubUtilLib/plSDLBrowser/plSDLBrowser.rc @@ -2,15 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -77,7 +71,6 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" "\0" END diff --git a/Sources/Plasma/PubUtilLib/plStatGather/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plStatGather/CMakeLists.txt index 2fb6e70f..eb1868f4 100644 --- a/Sources/Plasma/PubUtilLib/plStatGather/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plStatGather/CMakeLists.txt @@ -3,8 +3,6 @@ include_directories("../../NucleusLib/inc") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") -include_directories(${OPENSSL_INCLUDE_DIR}) - set(plStatGather_SOURCES plAutoProfile.cpp plCalculatedProfiles.cpp diff --git a/Sources/Tools/MaxComponent/plAnimCompProc.cpp b/Sources/Tools/MaxComponent/plAnimCompProc.cpp index ff0b9e30..62f3ab67 100644 --- a/Sources/Tools/MaxComponent/plAnimCompProc.cpp +++ b/Sources/Tools/MaxComponent/plAnimCompProc.cpp @@ -315,7 +315,7 @@ void plMtlAnimProc::ILoadAnimCombo(HWND hWnd, IParamBlock2* pb) } #include "plPickMaterialMap.h" -#include "../MaxMain/plMtlCollector.h" +#include "MaxMain/plMtlCollector.h" void plMtlAnimProc::IMtlButtonPress(HWND hWnd, IParamBlock2* pb) { diff --git a/Sources/Tools/MaxComponent/plAnimCompProc.h b/Sources/Tools/MaxComponent/plAnimCompProc.h index 276f9a4a..66f96c73 100644 --- a/Sources/Tools/MaxComponent/plAnimCompProc.h +++ b/Sources/Tools/MaxComponent/plAnimCompProc.h @@ -58,9 +58,9 @@ protected: public: plAnimCompProc(); - void DeleteThis() {} + virtual void DeleteThis() {} - BOOL DlgProc(TimeValue t, IParamMap2* pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + virtual BOOL DlgProc(TimeValue t, IParamMap2* pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); bool GetCompAndNode(IParamBlock2* pb, plComponentBase*& comp, plMaxNode*& node); }; diff --git a/Sources/Tools/MaxComponent/plAnimComponent.cpp b/Sources/Tools/MaxComponent/plAnimComponent.cpp index b664f2d3..3a596b4f 100644 --- a/Sources/Tools/MaxComponent/plAnimComponent.cpp +++ b/Sources/Tools/MaxComponent/plAnimComponent.cpp @@ -557,7 +557,7 @@ hsBool plAnimGroupedComponent::GetKeyList( INode *restrictedNode, hsTArrayGetParamBlock(); + + fNoteTrackDlgX.Init(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIMX), + nil, + kClickDragAnimX, + -1, + fPB, + fPB->GetOwner()); + + fNoteTrackDlgX.Load(); + + EnableWindow(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIMX), true); + + fNoteTrackDlgY.Init(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIM_Y), + nil, + kClickDragAnimY, + -1, + fPB, + fPB->GetOwner()); + + fNoteTrackDlgY.Load(); + + EnableWindow(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIM_Y), true); + return TRUE; + + case WM_COMMAND: + if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_CLICK_DRAG_ANIMX) + { + fNoteTrackDlgX.AnimChanged(); + return TRUE; + } + if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_CLICK_DRAG_ANIM_Y) + { + fNoteTrackDlgY.AnimChanged(); + return TRUE; + } + break; + } + return false; + } + + void DeleteThis() + { + fNoteTrackDlgX.DeleteCache(); + fNoteTrackDlgY.DeleteCache(); + } +}; +static plClickDragComponentProc gClickDragComponentProc; ParamBlockDesc2 gClickDragBlock ( @@ -539,67 +600,3 @@ hsBool plClickDragComponent::DeInit( plMaxNode *node, plErrorMsg *pErrMsg ) fAxisKeys.clear(); return plActivatorBaseComponent::DeInit( node, pErrMsg ); } - -#include "plNoteTrackDlgComp.h" - -class plClickDragComponentProc : public ParamMap2UserDlgProc -{ -protected: - plComponentNoteTrackDlg fNoteTrackDlgX; - plComponentNoteTrackDlg fNoteTrackDlgY; - IParamBlock2 *fPB; - -public: - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) - { - switch (msg) - { - case WM_INITDIALOG: - fPB = map->GetParamBlock(); - - fNoteTrackDlgX.Init(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIMX), - nil, - kClickDragAnimX, - -1, - fPB, - fPB->GetOwner()); - - fNoteTrackDlgX.Load(); - - EnableWindow(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIMX), true); - - fNoteTrackDlgY.Init(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIM_Y), - nil, - kClickDragAnimY, - -1, - fPB, - fPB->GetOwner()); - - fNoteTrackDlgY.Load(); - - EnableWindow(GetDlgItem(hWnd, IDC_COMP_CLICK_DRAG_ANIM_Y), true); - return TRUE; - - case WM_COMMAND: - if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_CLICK_DRAG_ANIMX) - { - fNoteTrackDlgX.AnimChanged(); - return TRUE; - } - if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_CLICK_DRAG_ANIM_Y) - { - fNoteTrackDlgY.AnimChanged(); - return TRUE; - } - break; - } - return false; - } - - void DeleteThis() - { - fNoteTrackDlgX.DeleteCache(); - fNoteTrackDlgY.DeleteCache(); - } -}; -static plClickDragComponentProc gClickDragComponentProc; diff --git a/Sources/Tools/MaxComponent/plComponent.h b/Sources/Tools/MaxComponent/plComponent.h index b6e8ad58..017edf10 100644 --- a/Sources/Tools/MaxComponent/plComponent.h +++ b/Sources/Tools/MaxComponent/plComponent.h @@ -222,7 +222,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *************************************************************************************************/ #include "plComponentBase.h" -#include "../MaxExport/plErrorMsg.h" +#include "MaxExport/plErrorMsg.h" class plMaxNode; diff --git a/Sources/Tools/MaxComponent/plComponent.rc b/Sources/Tools/MaxComponent/plComponent.rc index 5ecbc99c..9dfb6a56 100644 --- a/Sources/Tools/MaxComponent/plComponent.rc +++ b/Sources/Tools/MaxComponent/plComponent.rc @@ -2,15 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -6057,7 +6051,6 @@ END 2 TEXTINCLUDE BEGIN - "#include ""afxres.h""\r\n" "\0" END @@ -6945,8 +6938,8 @@ END // Icon with lowest ID value placed first to ensure application icon // remains consistent on all systems. -IDI_ZOOMIN ICON "../MaxComponent/icon1.ico" -IDI_ZOOMOUT ICON "../MaxComponent/zoomin1.ico" +IDI_ZOOMIN ICON "MaxComponent/icon1.ico" +IDI_ZOOMOUT ICON "MaxComponent/zoomin1.ico" ///////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Tools/MaxComponent/plGUIComponents.cpp b/Sources/Tools/MaxComponent/plGUIComponents.cpp index e2df524b..cfc7ef81 100644 --- a/Sources/Tools/MaxComponent/plGUIComponents.cpp +++ b/Sources/Tools/MaxComponent/plGUIComponents.cpp @@ -2676,7 +2676,7 @@ hsBool plGUIKnobCtrlComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg) } // For hackery below (see warning below) -#include "../plAvatar/plAGMasterMod.h" +#include "plAvatar/plAGMasterMod.h" hsBool plGUIKnobCtrlComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) { @@ -4398,7 +4398,7 @@ hsBool plGUIProgressCtrlComponent::PreConvert(plMaxNode *node, plErrorMsg *pErr } // For hackery below (see warning below) -#include "../plAvatar/plAGMasterMod.h" +#include "plAvatar/plAGMasterMod.h" hsBool plGUIProgressCtrlComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) { diff --git a/Sources/Tools/MaxComponent/plMiscComponents.cpp b/Sources/Tools/MaxComponent/plMiscComponents.cpp index a9289fd6..7ccf120a 100644 --- a/Sources/Tools/MaxComponent/plMiscComponents.cpp +++ b/Sources/Tools/MaxComponent/plMiscComponents.cpp @@ -2013,10 +2013,10 @@ hsBool plReferencePointComponent::SetupProperties(plMaxNode *pNode, plErrorMsg * // // -#include "../pnNetCommon/plSDLTypes.h" -#include "../MaxConvert/hsMaterialConverter.h" -#include "../plSurface/hsGMaterial.h" -#include "../plSurface/plLayerInterface.h" +#include "pnNetCommon/plSDLTypes.h" +#include "MaxConvert/hsMaterialConverter.h" +#include "plSurface/hsGMaterial.h" +#include "plSurface/plLayerInterface.h" #include "plCreatableIndex.h" class plNetSyncComponent : public plComponent diff --git a/Sources/Tools/MaxComponent/plNavigableComponents.cpp b/Sources/Tools/MaxComponent/plNavigableComponents.cpp index bc7fd5d2..c3d2713e 100644 --- a/Sources/Tools/MaxComponent/plNavigableComponents.cpp +++ b/Sources/Tools/MaxComponent/plNavigableComponents.cpp @@ -56,9 +56,6 @@ void DummyCodeIncludeFuncNavigablesRegion() {} CLASS_DESC(plAvLadderComponent, gAvLadderComponentDesc, "(ex)Ladder Component", "(ex)LadderComp", COMP_TYPE_PHYS_TERRAINS, NAV_LADDER_CID) -class plAvLadderComponentProc; -extern plAvLadderComponentProc gAvLadderComponentProc; - enum kAvLadderFields { kTypeCombo, @@ -70,6 +67,63 @@ enum kAvLadderFields kLadderNode, }; +class plAvLadderComponentProc : public ParamMap2UserDlgProc +{ +public: + enum kLadderTypesEnums + { + kReallyBig, + kFourFeet, + kTwoFeet, + }; + + BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + switch (msg) + { + case WM_INITDIALOG: + { + HWND hLadder = GetDlgItem(hWnd,IDC_COMP_NAV_LADDER_COMBO); + + ComboBox_AddString(hLadder, "Big"); + ComboBox_AddString(hLadder, "4 feet"); + ComboBox_AddString(hLadder, "2 feet"); + + int type = map->GetParamBlock()->GetInt(kTypeCombo); + ComboBox_SetCurSel(hLadder, type); + } + return TRUE; + + case WM_COMMAND: + if (LOWORD(wParam) == IDC_COMP_NAV_LADDER_COMBO && HIWORD(wParam) == CBN_SELCHANGE) + { + //Util fcn found in plEventGroupRefs files in MaxMain + HWND hLadder = GetDlgItem(hWnd,IDC_COMP_NAV_LADDER_COMBO); + int idx = ComboBox_GetCurSel(hLadder); + map->GetParamBlock()->SetValue(kTypeCombo, 0, idx); +/* + if (idx == kReallyBig) + { + map->Enable(kLoopsInt, TRUE); +// map->Invalidate(kLoopsInt); + } + else + { + map->Enable(kLoopsInt, TRUE); +// map->Invalidate(kLoopsInt); + } +*/ + return TRUE; + } + break; + } + return FALSE; + } + + void DeleteThis() {} +}; +static plAvLadderComponentProc gAvLadderComponentProc; + ParamBlockDesc2 gAvLadderComponentBlock ( plComponent::kBlkComp, _T("(ex)Ladder Component"), 0, &gAvLadderComponentDesc, P_AUTO_CONSTRUCT + P_AUTO_UI, plComponent::kRefComp, @@ -219,62 +273,3 @@ hsBool plAvLadderComponent::DeInit(plMaxNode *node, plErrorMsg *pErrMsg) fKeys.Reset(); return true; } - -class plAvLadderComponentProc : public ParamMap2UserDlgProc -{ -public: - enum kLadderTypesEnums - { - kReallyBig, - kFourFeet, - kTwoFeet, - }; - - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) - { - switch (msg) - { - case WM_INITDIALOG: - { - HWND hLadder = GetDlgItem(hWnd,IDC_COMP_NAV_LADDER_COMBO); - - ComboBox_AddString(hLadder, "Big"); - ComboBox_AddString(hLadder, "4 feet"); - ComboBox_AddString(hLadder, "2 feet"); - - int type = map->GetParamBlock()->GetInt(kTypeCombo); - ComboBox_SetCurSel(hLadder, type); - } - return TRUE; - - case WM_COMMAND: - if (LOWORD(wParam) == IDC_COMP_NAV_LADDER_COMBO && HIWORD(wParam) == CBN_SELCHANGE) - { - //Util fcn found in plEventGroupRefs files in MaxMain - HWND hLadder = GetDlgItem(hWnd,IDC_COMP_NAV_LADDER_COMBO); - int idx = ComboBox_GetCurSel(hLadder); - map->GetParamBlock()->SetValue(kTypeCombo, 0, idx); -/* - if (idx == kReallyBig) - { - map->Enable(kLoopsInt, TRUE); -// map->Invalidate(kLoopsInt); - } - else - { - map->Enable(kLoopsInt, TRUE); -// map->Invalidate(kLoopsInt); - } -*/ - return TRUE; - } - break; - } - return FALSE; - } - - void DeleteThis() {} -}; -static plAvLadderComponentProc gAvLadderComponentProc; - - diff --git a/Sources/Tools/MaxComponent/plParticleComponents.cpp b/Sources/Tools/MaxComponent/plParticleComponents.cpp index a60f25e0..b78703ef 100644 --- a/Sources/Tools/MaxComponent/plParticleComponents.cpp +++ b/Sources/Tools/MaxComponent/plParticleComponents.cpp @@ -618,6 +618,130 @@ void plParticleCoreComponent::SetParticleStats(plParticleMtl *mtl) fUserInput.fOrientation = pb->GetInt(plParticleMtl::kOrientation); } +class ParticleCompDlgProc : public ParamMap2UserDlgProc +{ +protected: + void EnableDynGenParams(IParamMap2 *pm, bool enabled) + { + pm->Enable(plParticleComponent::kConeAngle, enabled); + pm->Enable(plParticleComponent::kVelocityMin, enabled); + pm->Enable(plParticleComponent::kVelocityMax, enabled); + pm->Enable(plParticleComponent::kLifeMin, enabled); + pm->Enable(plParticleComponent::kLifeMax, enabled); + pm->Enable(plParticleComponent::kImmortal, enabled); + pm->Enable(plParticleComponent::kPPS, enabled); + pm->Enable(plParticleComponent::kGravity, enabled); + pm->Enable(plParticleComponent::kPreSim, enabled); + pm->Enable(plParticleComponent::kDrag, enabled); + } + +public: + ParticleCompDlgProc() {} + ~ParticleCompDlgProc() {} + + void IValidateSpinners(TimeValue t, IParamBlock2 *pb, IParamMap2 *map, UInt32 id) + { + UInt32 minIndex, maxIndex; + hsBool adjustMin; + switch(id) + { + case IDC_COMP_PARTICLE_VELMIN: + case IDC_COMP_PARTICLE_VELMIN_SPIN: + minIndex = plParticleCoreComponent::kVelocityMin; maxIndex = plParticleCoreComponent::kVelocityMax; adjustMin = false; + break; + case IDC_COMP_PARTICLE_VELMAX: + case IDC_COMP_PARTICLE_VELMAX_SPIN: + minIndex = plParticleCoreComponent::kVelocityMin; maxIndex = plParticleCoreComponent::kVelocityMax; adjustMin = true; + break; + case IDC_COMP_PARTICLE_LIFEMIN: + case IDC_COMP_PARTICLE_LIFEMIN_SPIN: + minIndex = plParticleCoreComponent::kLifeMin; maxIndex = plParticleCoreComponent::kLifeMax; adjustMin = false; + break; + case IDC_COMP_PARTICLE_LIFEMAX: + case IDC_COMP_PARTICLE_LIFEMAX_SPIN: + minIndex = plParticleCoreComponent::kLifeMin; maxIndex = plParticleCoreComponent::kLifeMax; adjustMin = true; + break; + default: + return; + } + + float min, max; + min = pb->GetFloat(minIndex, t); + max = pb->GetFloat(maxIndex, t); + + if (min > max) + { + if (adjustMin) + pb->SetValue(minIndex, t, max); + else + pb->SetValue(maxIndex, t, min); + + map->Invalidate(minIndex); + map->Invalidate(maxIndex); + } + } + + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + int id = LOWORD(wParam); + int code = HIWORD(wParam); + + IParamBlock2 *pb = map->GetParamBlock(); + HWND cbox = NULL; + + int selection; + switch (msg) + { + case WM_INITDIALOG: + int j; + for (j = 0; j < plParticleCoreComponent::kGenNumOptions; j++) + { + cbox = GetDlgItem(hWnd, IDC_GEN_TYPE); + SendMessage(cbox, CB_ADDSTRING, 0, (LPARAM)plParticleCoreComponent::GenStrings[j]); + } + selection = pb->GetInt(plParticleCoreComponent::kGenType); + SendMessage(cbox, CB_SETCURSEL, selection, 0); + EnableDynGenParams(map, selection != plParticleCoreComponent::kGenOnePerVertex); + + CheckDlgButton(hWnd, IDC_TRACKVIEW_SHOW, plParticleComponent::fAllowUnhide ? BST_CHECKED : BST_UNCHECKED); + return TRUE; + + case WM_COMMAND: + if (id == IDC_GEN_TYPE) + { + selection = SendMessage(GetDlgItem(hWnd, id), CB_GETCURSEL, 0, 0); + pb->SetValue(plParticleCoreComponent::kGenType, t, selection); + EnableDynGenParams(map, selection != plParticleCoreComponent::kGenOnePerVertex); + return TRUE; + } + else if (id == IDC_COMP_PARTICLE_VELMIN || id == IDC_COMP_PARTICLE_VELMAX || + id == IDC_COMP_PARTICLE_LIFEMIN || id == IDC_COMP_PARTICLE_LIFEMAX) + { + IValidateSpinners(t, pb, map, id); + return TRUE; + } + else if (id == IDC_TRACKVIEW_SHOW && code == BN_CLICKED) + { + plParticleComponent::fAllowUnhide = (IsDlgButtonChecked(hWnd, IDC_TRACKVIEW_SHOW) == BST_CHECKED); + plComponentShow::Update(); + return TRUE; + } + break; + case CC_SPINNER_CHANGE: + if (id == IDC_COMP_PARTICLE_VELMIN_SPIN || id == IDC_COMP_PARTICLE_VELMAX_SPIN || + id == IDC_COMP_PARTICLE_LIFEMIN_SPIN || id == IDC_COMP_PARTICLE_LIFEMAX_SPIN) + { + IValidateSpinners(t, pb, map, id); + return TRUE; + } + break; + } + return FALSE; + } + virtual void DeleteThis() {} +}; +static ParticleCompDlgProc gParticleCompDlgProc; + CLASS_DESC(plParticleComponent, gParticleDesc, "Particle System", "ParticleSystem", COMP_TYPE_PARTICLE, PARTICLE_SYSTEM_COMPONENT_CLASS_ID) ParamBlockDesc2 gParticleBk @@ -778,130 +902,6 @@ hsBool plParticleComponent::GetParamVals(plMaxNode *pNode) return true; } -class ParticleCompDlgProc : public ParamMap2UserDlgProc -{ -protected: - void EnableDynGenParams(IParamMap2 *pm, bool enabled) - { - pm->Enable(plParticleComponent::kConeAngle, enabled); - pm->Enable(plParticleComponent::kVelocityMin, enabled); - pm->Enable(plParticleComponent::kVelocityMax, enabled); - pm->Enable(plParticleComponent::kLifeMin, enabled); - pm->Enable(plParticleComponent::kLifeMax, enabled); - pm->Enable(plParticleComponent::kImmortal, enabled); - pm->Enable(plParticleComponent::kPPS, enabled); - pm->Enable(plParticleComponent::kGravity, enabled); - pm->Enable(plParticleComponent::kPreSim, enabled); - pm->Enable(plParticleComponent::kDrag, enabled); - } - -public: - ParticleCompDlgProc() {} - ~ParticleCompDlgProc() {} - - void IValidateSpinners(TimeValue t, IParamBlock2 *pb, IParamMap2 *map, UInt32 id) - { - UInt32 minIndex, maxIndex; - hsBool adjustMin; - switch(id) - { - case IDC_COMP_PARTICLE_VELMIN: - case IDC_COMP_PARTICLE_VELMIN_SPIN: - minIndex = plParticleCoreComponent::kVelocityMin; maxIndex = plParticleCoreComponent::kVelocityMax; adjustMin = false; - break; - case IDC_COMP_PARTICLE_VELMAX: - case IDC_COMP_PARTICLE_VELMAX_SPIN: - minIndex = plParticleCoreComponent::kVelocityMin; maxIndex = plParticleCoreComponent::kVelocityMax; adjustMin = true; - break; - case IDC_COMP_PARTICLE_LIFEMIN: - case IDC_COMP_PARTICLE_LIFEMIN_SPIN: - minIndex = plParticleCoreComponent::kLifeMin; maxIndex = plParticleCoreComponent::kLifeMax; adjustMin = false; - break; - case IDC_COMP_PARTICLE_LIFEMAX: - case IDC_COMP_PARTICLE_LIFEMAX_SPIN: - minIndex = plParticleCoreComponent::kLifeMin; maxIndex = plParticleCoreComponent::kLifeMax; adjustMin = true; - break; - default: - return; - } - - float min, max; - min = pb->GetFloat(minIndex, t); - max = pb->GetFloat(maxIndex, t); - - if (min > max) - { - if (adjustMin) - pb->SetValue(minIndex, t, max); - else - pb->SetValue(maxIndex, t, min); - - map->Invalidate(minIndex); - map->Invalidate(maxIndex); - } - } - - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) - { - int id = LOWORD(wParam); - int code = HIWORD(wParam); - - IParamBlock2 *pb = map->GetParamBlock(); - HWND cbox = NULL; - - int selection; - switch (msg) - { - case WM_INITDIALOG: - int j; - for (j = 0; j < plParticleCoreComponent::kGenNumOptions; j++) - { - cbox = GetDlgItem(hWnd, IDC_GEN_TYPE); - SendMessage(cbox, CB_ADDSTRING, 0, (LPARAM)plParticleCoreComponent::GenStrings[j]); - } - selection = pb->GetInt(plParticleCoreComponent::kGenType); - SendMessage(cbox, CB_SETCURSEL, selection, 0); - EnableDynGenParams(map, selection != plParticleCoreComponent::kGenOnePerVertex); - - CheckDlgButton(hWnd, IDC_TRACKVIEW_SHOW, plParticleComponent::fAllowUnhide ? BST_CHECKED : BST_UNCHECKED); - return TRUE; - - case WM_COMMAND: - if (id == IDC_GEN_TYPE) - { - selection = SendMessage(GetDlgItem(hWnd, id), CB_GETCURSEL, 0, 0); - pb->SetValue(plParticleCoreComponent::kGenType, t, selection); - EnableDynGenParams(map, selection != plParticleCoreComponent::kGenOnePerVertex); - return TRUE; - } - else if (id == IDC_COMP_PARTICLE_VELMIN || id == IDC_COMP_PARTICLE_VELMAX || - id == IDC_COMP_PARTICLE_LIFEMIN || id == IDC_COMP_PARTICLE_LIFEMAX) - { - IValidateSpinners(t, pb, map, id); - return TRUE; - } - else if (id == IDC_TRACKVIEW_SHOW && code == BN_CLICKED) - { - plParticleComponent::fAllowUnhide = (IsDlgButtonChecked(hWnd, IDC_TRACKVIEW_SHOW) == BST_CHECKED); - plComponentShow::Update(); - return TRUE; - } - break; - case CC_SPINNER_CHANGE: - if (id == IDC_COMP_PARTICLE_VELMIN_SPIN || id == IDC_COMP_PARTICLE_VELMAX_SPIN || - id == IDC_COMP_PARTICLE_LIFEMIN_SPIN || id == IDC_COMP_PARTICLE_LIFEMAX_SPIN) - { - IValidateSpinners(t, pb, map, id); - return TRUE; - } - break; - } - return FALSE; - } - void DeleteThis() {} -}; -static ParticleCompDlgProc gParticleCompDlgProc; - ////////////////////////////////////////////////////////////////////////////////////////// // // Particle Effects Base class diff --git a/Sources/Tools/MaxComponent/plParticleComponents.h b/Sources/Tools/MaxComponent/plParticleComponents.h index 4880cac8..a66a3c2f 100644 --- a/Sources/Tools/MaxComponent/plParticleComponents.h +++ b/Sources/Tools/MaxComponent/plParticleComponents.h @@ -71,9 +71,6 @@ public: fXTiles(1), fYTiles(1), fHSize(1), fVSize(1), fImmortal(false) {} }; -class ParticleCompDlgProc; -extern ParticleCompDlgProc gParticleCompDlgProc; - class plParticleCoreComponent : public plComponent { protected: diff --git a/Sources/Tools/MaxComponent/plPhysicalComponents.h b/Sources/Tools/MaxComponent/plPhysicalComponents.h index b714c95d..6bddcb90 100644 --- a/Sources/Tools/MaxComponent/plPhysicalComponents.h +++ b/Sources/Tools/MaxComponent/plPhysicalComponents.h @@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include "plPhysical.h" -#include "../plAvatar/plSwimRegion.h" +#include "plAvatar/plSwimRegion.h" ///////////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/Sources/Tools/MaxComponent/plPickMaterialMap.cpp b/Sources/Tools/MaxComponent/plPickMaterialMap.cpp index 70b1a7d1..a12f2d55 100644 --- a/Sources/Tools/MaxComponent/plPickMaterialMap.cpp +++ b/Sources/Tools/MaxComponent/plPickMaterialMap.cpp @@ -93,7 +93,7 @@ bool plPickMaterialMap::PickTexmap(IParamBlock2 *pb, int id) return IPickMaterial(pb, id, BROWSE_MAPSONLY); } -#include "../MaxMain/plMtlCollector.h" +#include "MaxMain/plMtlCollector.h" #include "resource.h" static bool GetPickedMtl(HWND hDlg, Mtl** mtl) diff --git a/Sources/Tools/MaxComponent/plPythonFileComponent.cpp b/Sources/Tools/MaxComponent/plPythonFileComponent.cpp index a80920df..0f20cb15 100644 --- a/Sources/Tools/MaxComponent/plPythonFileComponent.cpp +++ b/Sources/Tools/MaxComponent/plPythonFileComponent.cpp @@ -388,7 +388,7 @@ hsBool plPythonFileComponent::PreConvert(plMaxNode *node, plErrorMsg *pErrMsg) } #include "plActivatorBaseComponent.h" -#include "../pnKeyedObject/plKey.h" +#include "pnKeyedObject/plKey.h" #include "plResponderComponent.h" hsBool plPythonFileComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) diff --git a/Sources/Tools/MaxComponent/plResponderAnim.cpp b/Sources/Tools/MaxComponent/plResponderAnim.cpp index 319ae996..2cf5c429 100644 --- a/Sources/Tools/MaxComponent/plResponderAnim.cpp +++ b/Sources/Tools/MaxComponent/plResponderAnim.cpp @@ -60,33 +60,6 @@ enum kRespAnimObjectType, }; -class plResponderAnimProc; -extern plResponderAnimProc gResponderAnimProc; - -ParamBlockDesc2 gResponderAnimBlock -( - kResponderAnimBlk, _T("animCmd"), 0, NULL, P_AUTO_UI, - - IDD_COMP_RESPOND_ANIM, IDS_COMP_CMD_PARAMS, 0, 0, &gResponderAnimProc, - - kRespAnimComp, _T("comp"), TYPE_REFTARG, 0, 0, - end, - - kRespAnimObject, _T("object"), TYPE_REFTARG, 0, 0, - end, - - kRespAnimLoop, _T("loop"), TYPE_STRING, 0, 0, - end, - - kRespAnimType, _T("type"), TYPE_INT, 0, 0, - end, - - kRespAnimObjectType, _T("objType"), TYPE_INT, 0, 0, - end, - - end -); - enum AnimObjectType { kNodePB, // Use the node in the PB @@ -99,11 +72,6 @@ plResponderCmdAnim& plResponderCmdAnim::Instance() return theInstance; } -ParamBlockDesc2 *plResponderCmdAnim::GetDesc() -{ - return &gResponderAnimBlock; -} - // Use the old types, for backwards compatibility enum { @@ -291,17 +259,6 @@ static bool IsSoundMsg(int type) return false; } -IParamBlock2 *plResponderCmdAnim::CreatePB(int idx) -{ - int type = IndexToOldType(idx); - - // Create the paramblock and save it's type - IParamBlock2 *pb = CreateParameterBlock2(&gResponderAnimBlock, nil); - pb->SetValue(kRespAnimType, 0, type); - - return pb; -} - plComponentBase *plResponderCmdAnim::GetComponent(IParamBlock2 *pb) { plMaxNode *node = (plMaxNode*)pb->GetReferenceTarget(kRespAnimComp); @@ -563,7 +520,7 @@ class plResponderAnimProc : public plAnimCompProc { public: plResponderAnimProc(); - BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + virtual BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); protected: virtual void IPickComponent(IParamBlock2* pb); @@ -673,6 +630,46 @@ void plResponderAnimProc::IPickComponent(IParamBlock2* pb) plPick::NodeRefKludge(pb, kRespAnimComp, &cids, true, false); } +ParamBlockDesc2 gResponderAnimBlock +( + kResponderAnimBlk, _T("animCmd"), 0, NULL, P_AUTO_UI, + + IDD_COMP_RESPOND_ANIM, IDS_COMP_CMD_PARAMS, 0, 0, &gResponderAnimProc, + + kRespAnimComp, _T("comp"), TYPE_REFTARG, 0, 0, + end, + + kRespAnimObject, _T("object"), TYPE_REFTARG, 0, 0, + end, + + kRespAnimLoop, _T("loop"), TYPE_STRING, 0, 0, + end, + + kRespAnimType, _T("type"), TYPE_INT, 0, 0, + end, + + kRespAnimObjectType, _T("objType"), TYPE_INT, 0, 0, + end, + + end +); + +ParamBlockDesc2 *plResponderCmdAnim::GetDesc() +{ + return &gResponderAnimBlock; +} + +IParamBlock2 *plResponderCmdAnim::CreatePB(int idx) +{ + int type = IndexToOldType(idx); + + // Create the paramblock and save it's type + IParamBlock2 *pb = CreateParameterBlock2(&gResponderAnimBlock, nil); + pb->SetValue(kRespAnimType, 0, type); + + return pb; +} + #include "plPickNodeBase.h" static const char* kResponderNodeName = "(Responder Node)"; diff --git a/Sources/Tools/MaxComponent/plResponderComponent.cpp b/Sources/Tools/MaxComponent/plResponderComponent.cpp index c476db80..4ea88c68 100644 --- a/Sources/Tools/MaxComponent/plResponderComponent.cpp +++ b/Sources/Tools/MaxComponent/plResponderComponent.cpp @@ -59,6 +59,68 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com IParamBlock2 *CreateWaitBlk(); +class plResponderProc : public ParamMap2UserDlgProc +{ +protected: + HWND fhDlg; + IParamBlock2 *fPB; + IParamBlock2 *fStatePB; + int fCurState; + + plResponderComponent *fComp; + + IParamMap2 *fCmdMap; + IParamMap2 *fWaitMap; + + int fCmdIdx; + + typedef std::map NameID; + NameID fNames; + + HMENU fhMenu; + typedef std::pair CmdID; + typedef std::map MenuCmd; + MenuCmd fMenuCmds; + + HWND fhList; + + bool fIgnoreNextDrop; + +public: + plResponderProc(); + + BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + void DeleteThis() { IRemoveCmdRollups(); } + +protected: + void ICreateMenu(); + void IAddMenuItem(HMENU hMenu, int id); + + void ICmdRightClick(HWND hCmdList); + + // Add and remove command rollups + void ICreateCmdRollups(); + void IRemoveCmdRollups(); + IParamMap2 *ICreateMap(IParamBlock2 *pb); // Helper + + const char* GetCommandName(int cmdIdx); + void LoadList(); + + BOOL DragListProc(HWND hWnd, DRAGLISTINFO *info); + + void IDrawComboItem(DRAWITEMSTRUCT *dis); + + void LoadState(); + + void AddCommand(); + void RemoveCurCommand(); + void MoveCommand(int oldIdx, int newIdx); + + // Takes a freshly created state PB and adds it as a new state, then returns its index + int AddState(IParamBlock2 *pb); +}; +static plResponderProc gResponderComponentProc; + int ResponderGetActivatorCount(plComponentBase *comp) { if (comp->ClassID() == RESPONDER_CID) @@ -93,8 +155,6 @@ plKey Responder::GetKey(plComponentBase *comp, plMaxNodeBase *node) CLASS_DESC(plResponderComponent, gResponderDesc, "Responder", "Responder", COMP_TYPE_LOGIC, RESPONDER_CID) -class plResponderProc; -extern plResponderProc gResponderComponentProc; // When one of our parameters that is a ref changes, send out the component ref // changed message. Normally, messages from component refs are ignored since @@ -494,8 +554,6 @@ void plResponderComponent::IFixOldPB() //////////////////////////////////////////////////////////////////////////////// -#define CUSTOM_DRAW - enum { kStateName, @@ -505,70 +563,6 @@ enum kStateCopy, }; -class plResponderProc : public ParamMap2UserDlgProc -{ -protected: - HWND fhDlg; - IParamBlock2 *fPB; - IParamBlock2 *fStatePB; - int fCurState; - - plResponderComponent *fComp; - - IParamMap2 *fCmdMap; - IParamMap2 *fWaitMap; - - int fCmdIdx; - - typedef std::map NameID; - NameID fNames; - - HMENU fhMenu; - typedef std::pair CmdID; - typedef std::map MenuCmd; - MenuCmd fMenuCmds; - - HWND fhList; - - bool fIgnoreNextDrop; - -public: - plResponderProc(); - - BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); - void DeleteThis() { IRemoveCmdRollups(); } - -protected: - void ICreateMenu(); - void IAddMenuItem(HMENU hMenu, int id); - - void ICmdRightClick(HWND hCmdList); - - // Add and remove command rollups - void ICreateCmdRollups(); - void IRemoveCmdRollups(); - IParamMap2 *ICreateMap(IParamBlock2 *pb); // Helper - - const char* GetCommandName(int cmdIdx); - void LoadList(); - - BOOL DragListProc(HWND hWnd, DRAGLISTINFO *info); - -#ifdef CUSTOM_DRAW - void IDrawComboItem(DRAWITEMSTRUCT *dis); -#endif - - void LoadState(); - - void AddCommand(); - void RemoveCurCommand(); - void MoveCommand(int oldIdx, int newIdx); - - // Takes a freshly created state PB and adds it as a new state, then returns its index - int AddState(IParamBlock2 *pb); -}; -static plResponderProc gResponderComponentProc; - void plResponderProc::IAddMenuItem(HMENU hMenu, int id) { AppendMenu(hMenu, MF_STRING, id+1, fNames[id]); @@ -861,7 +855,6 @@ BOOL plResponderProc::DragListProc(HWND hWnd, DRAGLISTINFO *info) return FALSE; } -#ifdef CUSTOM_DRAW void plResponderProc::IDrawComboItem(DRAWITEMSTRUCT *dis) { if (dis->itemID == -1) // empty item @@ -916,7 +909,6 @@ void plResponderProc::IDrawComboItem(DRAWITEMSTRUCT *dis) if (dis->itemState & ODS_FOCUS) DrawFocusRect(dis->hDC, &dis->rcItem); } -#endif void plResponderProc::LoadState() { diff --git a/Sources/Tools/MaxComponent/plResponderLink.cpp b/Sources/Tools/MaxComponent/plResponderLink.cpp index 5099cd56..1508e323 100644 --- a/Sources/Tools/MaxComponent/plResponderLink.cpp +++ b/Sources/Tools/MaxComponent/plResponderLink.cpp @@ -66,9 +66,59 @@ enum #define kDefaultLinkInAnimName "LinkOut" -class plResponderLinkProc; -extern plResponderLinkProc gResponderLinkProc; +class plResponderLinkProc : public ParamMap2UserDlgProc +{ +protected: + void ILoadLinkingRulesCombo(HWND hWnd, IParamBlock2* pb); + void ILoadAgeFilenamesCombo(HWND hWnd, IParamBlock2 *pb); + void ILoadParentAgeFilenamesCombo(HWND hWnd, IParamBlock2 *pb); + +public: + virtual BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + switch (msg) + { + case WM_INITDIALOG: + ILoadLinkingRulesCombo(hWnd, pm->GetParamBlock()); + ILoadAgeFilenamesCombo(hWnd, pm->GetParamBlock()); + ILoadParentAgeFilenamesCombo(hWnd, pm->GetParamBlock()); + return TRUE; + case WM_COMMAND: + if (HIWORD(wParam) == CBN_SELCHANGE) + { + int sel = ComboBox_GetCurSel((HWND)lParam); + if (sel != CB_ERR) + { + if (LOWORD(wParam) == IDC_LINKINGRULE) + { + int data = ComboBox_GetItemData((HWND)lParam, sel); + pm->GetParamBlock()->SetValue(kLinkingRule, 0, data); + return TRUE; + } + else if (LOWORD(wParam) == IDC_LINKAGEFILENAME) + { + char buf[256]; + SendMessage((HWND)lParam, CB_GETLBTEXT, sel, (LPARAM)buf); + pm->GetParamBlock()->SetValue(kLinkAgeFilename, 0, buf); + return TRUE; + } + else if (LOWORD(wParam) == IDC_PARENTAGEFILENAME) + { + char buf[256]; + SendMessage((HWND)lParam, CB_GETLBTEXT, sel, (LPARAM)buf); + pm->GetParamBlock()->SetValue(kLinkParentAgeFilename, 0, buf); + return TRUE; + } + } + } + break; + } + return FALSE; + } + virtual void DeleteThis() {} +}; +static plResponderLinkProc gResponderLinkProc; ParamBlockDesc2 gResponderLinkBlock ( @@ -200,60 +250,6 @@ plMessage *plResponderCmdLink::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, I return msg; } -class plResponderLinkProc : public ParamMap2UserDlgProc -{ -protected: - void ILoadLinkingRulesCombo(HWND hWnd, IParamBlock2* pb); - void ILoadAgeFilenamesCombo(HWND hWnd, IParamBlock2 *pb); - void ILoadParentAgeFilenamesCombo(HWND hWnd, IParamBlock2 *pb); - -public: - BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) - { - switch (msg) - { - case WM_INITDIALOG: - ILoadLinkingRulesCombo(hWnd, pm->GetParamBlock()); - ILoadAgeFilenamesCombo(hWnd, pm->GetParamBlock()); - ILoadParentAgeFilenamesCombo(hWnd, pm->GetParamBlock()); - return TRUE; - - case WM_COMMAND: - if (HIWORD(wParam) == CBN_SELCHANGE) - { - int sel = ComboBox_GetCurSel((HWND)lParam); - if (sel != CB_ERR) - { - if (LOWORD(wParam) == IDC_LINKINGRULE) - { - int data = ComboBox_GetItemData((HWND)lParam, sel); - pm->GetParamBlock()->SetValue(kLinkingRule, 0, data); - return TRUE; - } - else if (LOWORD(wParam) == IDC_LINKAGEFILENAME) - { - char buf[256]; - SendMessage((HWND)lParam, CB_GETLBTEXT, sel, (LPARAM)buf); - pm->GetParamBlock()->SetValue(kLinkAgeFilename, 0, buf); - return TRUE; - } - else if (LOWORD(wParam) == IDC_PARENTAGEFILENAME) - { - char buf[256]; - SendMessage((HWND)lParam, CB_GETLBTEXT, sel, (LPARAM)buf); - pm->GetParamBlock()->SetValue(kLinkParentAgeFilename, 0, buf); - return TRUE; - } - } - } - break; - } - return FALSE; - } - void DeleteThis() {} -}; -static plResponderLinkProc gResponderLinkProc; - static int ComboBox_AddStringData(HWND hCombo, const char* str, int data) { int idx = ComboBox_AddString(hCombo, str); @@ -368,7 +364,8 @@ void plResponderLinkProc::ILoadParentAgeFilenamesCombo(HWND hWnd, IParamBlock2 * #include "plComponentBase.h" // Needed for message creation -#include "../plModifier/plResponderModifier.h" +#include "plModifier/plResponderModifier.h" +#include "plResponderGetComp.h" enum { @@ -377,8 +374,56 @@ enum kEnableResponder, }; -class plResponderEnableProc; -extern plResponderEnableProc gResponderEnableProc; +class plResponderEnableProc : public ParamMap2UserDlgProc +{ +protected: + void IUpdateButton(HWND hWnd, IParamBlock2 *pb) + { + HWND hComp = GetDlgItem(hWnd, IDC_RESPONDER_BUTTON); + plComponentBase *comp = plResponderGetComp::Instance().GetSavedComp(pb, kEnableNode, kEnableResponder); + if (comp) + SetWindowText(hComp, comp->GetINode()->GetName()); + else + SetWindowText(hComp, "(none)"); + } + +public: + virtual BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + switch (msg) + { + case WM_INITDIALOG: + { + IParamBlock2 *pb = pm->GetParamBlock(); + + IUpdateButton(hWnd, pb); + } + return TRUE; + + case WM_COMMAND: + if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_BUTTON) + { + IParamBlock2 *pb = pm->GetParamBlock(); + + // If the responder component is hosed, remove it so the plResponderGetComp won't get bogus info + if (!plResponderGetComp::Instance().GetSavedComp(pb, kEnableNode, kEnableResponder)) + { + ReferenceTarget *empty = nil; + pb->SetValue(kEnableResponder, 0, empty); + } + + plResponderGetComp::ClassIDs cids; + cids.push_back(RESPONDER_CID); + plResponderGetComp::Instance().GetComp(pb, kEnableNode, kEnableResponder, &cids); + IUpdateButton(hWnd, pb); + } + break; + } + return FALSE; + } + virtual void DeleteThis() {} +}; +static plResponderEnableProc gResponderEnableProc; ParamBlockDesc2 gResponderEnableBlock ( @@ -411,8 +456,6 @@ ParamBlockDesc2 *plResponderCmdEnable::GetDesc() return &gResponderEnableBlock; } -#include "plResponderGetComp.h" - const char *plResponderCmdEnable::GetInstanceName(IParamBlock2 *pb) { static char name[256]; @@ -441,61 +484,10 @@ plMessage *plResponderCmdEnable::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, return msg; } -class plResponderEnableProc : public ParamMap2UserDlgProc -{ -protected: - void IUpdateButton(HWND hWnd, IParamBlock2 *pb) - { - HWND hComp = GetDlgItem(hWnd, IDC_RESPONDER_BUTTON); - plComponentBase *comp = plResponderGetComp::Instance().GetSavedComp(pb, kEnableNode, kEnableResponder); - if (comp) - SetWindowText(hComp, comp->GetINode()->GetName()); - else - SetWindowText(hComp, "(none)"); - } - -public: - BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) - { - switch (msg) - { - case WM_INITDIALOG: - { - IParamBlock2 *pb = pm->GetParamBlock(); - - IUpdateButton(hWnd, pb); - } - return TRUE; - - case WM_COMMAND: - if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_BUTTON) - { - IParamBlock2 *pb = pm->GetParamBlock(); - - // If the responder component is hosed, remove it so the plResponderGetComp won't get bogus info - if (!plResponderGetComp::Instance().GetSavedComp(pb, kEnableNode, kEnableResponder)) - { - ReferenceTarget *empty = nil; - pb->SetValue(kEnableResponder, 0, empty); - } - - plResponderGetComp::ClassIDs cids; - cids.push_back(RESPONDER_CID); - plResponderGetComp::Instance().GetComp(pb, kEnableNode, kEnableResponder, &cids); - IUpdateButton(hWnd, pb); - } - break; - } - return FALSE; - } - void DeleteThis() {} -}; -static plResponderEnableProc gResponderEnableProc; - /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// -#include "../pnMessage/plEnableMsg.h" +#include "pnMessage/plEnableMsg.h" enum { @@ -542,7 +534,7 @@ const char *plResponderCmdPhysEnable::GetInstanceName(IParamBlock2 *pb) return name; } -#include "../plMessage/plSimStateMsg.h" +#include "plMessage/plSimStateMsg.h" plMessage *plResponderCmdPhysEnable::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb) { plMaxNode* physNode = (plMaxNode*)pb->GetINode(kEnablePhysNode); @@ -562,14 +554,56 @@ plMessage *plResponderCmdPhysEnable::CreateMsg(plMaxNode* node, plErrorMsg *pErr /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// +#include "plMessage/plOneShotMsg.h" +#include "plOneShotComponent.h" + enum { kOneShotComp, kOneShotNode, }; -class plResponderOneShotProc; -extern plResponderOneShotProc gResponderOneShotProc; +class plResponderOneShotProc : public ParamMap2UserDlgProc +{ +protected: + plResponderCompNode fCompNode; + +public: + BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + switch (msg) + { + case WM_INITDIALOG: + { + IParamBlock2 *pb = pm->GetParamBlock(); + + plResponderCompNode::ClassIDs cids; + cids.push_back(ONESHOTCLASS_ID); + fCompNode.Init(pb, kOneShotComp, kOneShotNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids); + + fCompNode.InitDlg(hWnd); + } + return TRUE; + + case WM_COMMAND: + if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_COMP) + { + fCompNode.CompButtonPress(hWnd); + return TRUE; + } + else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_NODE) + { + fCompNode.NodeButtonPress(hWnd); + return TRUE; + } + break; + } + + return FALSE; + } + void DeleteThis() {} +}; +static plResponderOneShotProc gResponderOneShotProc; ParamBlockDesc2 gResponderOneShotBlock ( @@ -607,9 +641,6 @@ const char *plResponderCmdOneShot::GetInstanceName(IParamBlock2 *pb) return name; } -#include "../plMessage/plOneShotMsg.h" -#include "plOneShotComponent.h" - plMessage *plResponderCmdOneShot::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb) { plResponderCompNode compNode; @@ -633,7 +664,7 @@ plMessage *plResponderCmdOneShot::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg throw "No one-shot component specified"; } -#include "../plMessage/plOneShotCallbacks.h" +#include "plMessage/plOneShotCallbacks.h" void plResponderCmdOneShot::CreateWait(plMaxNode* node, plErrorMsg* pErrMsg, IParamBlock2 *pb, ResponderWaitInfo& waitInfo) { @@ -643,48 +674,6 @@ void plResponderCmdOneShot::CreateWait(plMaxNode* node, plErrorMsg* pErrMsg, IPa oneShotMsg->fCallbacks->AddCallback(waitInfo.point, waitInfo.receiver, waitInfo.callbackUser); } -class plResponderOneShotProc : public ParamMap2UserDlgProc -{ -protected: - plResponderCompNode fCompNode; - -public: - BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) - { - switch (msg) - { - case WM_INITDIALOG: - { - IParamBlock2 *pb = pm->GetParamBlock(); - - plResponderCompNode::ClassIDs cids; - cids.push_back(ONESHOTCLASS_ID); - fCompNode.Init(pb, kOneShotComp, kOneShotNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids); - - fCompNode.InitDlg(hWnd); - } - return TRUE; - - case WM_COMMAND: - if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_COMP) - { - fCompNode.CompButtonPress(hWnd); - return TRUE; - } - else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_NODE) - { - fCompNode.NodeButtonPress(hWnd); - return TRUE; - } - break; - } - - return FALSE; - } - void DeleteThis() {} -}; -static plResponderOneShotProc gResponderOneShotProc; - /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// @@ -706,7 +695,7 @@ ParamBlockDesc2 *plResponderCmdNotify::GetDesc() return &gResponderNotifyBlock; } -#include "../pnMessage/plNotifyMsg.h" +#include "pnMessage/plNotifyMsg.h" plMessage *plResponderCmdNotify::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb) { @@ -721,12 +710,47 @@ plMessage *plResponderCmdNotify::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, /////////////////////////////////////////////////////////////////////////////////////////////// #include "plCameraComponents.h" - -class plResponderActivatorEnableProc; -extern plResponderActivatorEnableProc gResponderActivatorEnableProc; +#include "plPickNode.h" enum { kActivatorComp, kActivatorEnable }; +class plResponderActivatorEnableProc : public ParamMap2UserDlgProc +{ +protected: + void IUpdateButton(IParamBlock2 *pb, HWND hWnd) + { + INode *node = pb->GetINode(kActivatorComp); + if (node) + SetDlgItemText(hWnd, IDC_RESPONDER_BUTTON, node->GetName()); + else + SetDlgItemText(hWnd, IDC_RESPONDER_BUTTON, "(none)"); + } + +public: + BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + switch (msg) + { + case WM_INITDIALOG: + IUpdateButton(pm->GetParamBlock(), hWnd); + return TRUE; + + case WM_COMMAND: + if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_BUTTON) + { + if (plPick::DetectorEnable(pm->GetParamBlock(), kActivatorComp, true)) + IUpdateButton(pm->GetParamBlock(), hWnd); + return TRUE; + } + break; + } + + return FALSE; + } + void DeleteThis() {} +}; +static plResponderActivatorEnableProc gResponderActivatorEnableProc; + ParamBlockDesc2 gResponderActivatorEnableBlock ( kResponderActivatorEnableBlk, _T("detectorEnable"), 0, NULL, P_AUTO_UI, @@ -765,7 +789,7 @@ const char *plResponderCmdDetectorEnable::GetInstanceName(IParamBlock2 *pb) return name; } -#include "../pnMessage/plEnableMsg.h" +#include "pnMessage/plEnableMsg.h" #include "plActivatorBaseComponent.h" #include "plVolumeGadgetComponent.h" #include "plNavigableComponents.h" @@ -835,19 +859,18 @@ plMessage *plResponderCmdDetectorEnable::CreateMsg(plMaxNode* node, plErrorMsg * return msg; } -#include "plPickNode.h" +/////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////// -class plResponderActivatorEnableProc : public ParamMap2UserDlgProc -{ -protected: - void IUpdateButton(IParamBlock2 *pb, HWND hWnd) - { - INode *node = pb->GetINode(kActivatorComp); - if (node) - SetDlgItemText(hWnd, IDC_RESPONDER_BUTTON, node->GetName()); - else - SetDlgItemText(hWnd, IDC_RESPONDER_BUTTON, "(none)"); - } +#include "plMessage/plExcludeRegionMsg.h" +#include "plExcludeRegionComponent.h" + +enum { kXRegionComp, kXRegionType, kXRegionNode }; + +class plResponderXRegionProc : public ParamMap2UserDlgProc +{ +protected: + plResponderCompNode fCompNode; public: BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) @@ -855,14 +878,25 @@ public: switch (msg) { case WM_INITDIALOG: - IUpdateButton(pm->GetParamBlock(), hWnd); + { + IParamBlock2 *pb = pm->GetParamBlock(); + + plResponderCompNode::ClassIDs cids; + cids.push_back(XREGION_CID); + fCompNode.Init(pb, kXRegionComp, kXRegionNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids); + fCompNode.InitDlg(hWnd); + } return TRUE; case WM_COMMAND: - if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_BUTTON) + if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_COMP) { - if (plPick::DetectorEnable(pm->GetParamBlock(), kActivatorComp, true)) - IUpdateButton(pm->GetParamBlock(), hWnd); + fCompNode.CompButtonPress(hWnd); + return TRUE; + } + else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_NODE) + { + fCompNode.NodeButtonPress(hWnd); return TRUE; } break; @@ -872,15 +906,7 @@ public: } void DeleteThis() {} }; -static plResponderActivatorEnableProc gResponderActivatorEnableProc; - -/////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////// - -class plResponderXRegionProc; -extern plResponderXRegionProc gResponderXRegionProc; - -enum { kXRegionComp, kXRegionType, kXRegionNode }; +static plResponderXRegionProc gResponderXRegionProc; ParamBlockDesc2 gResponderXRegionBlock ( @@ -963,9 +989,6 @@ const char *plResponderCmdXRegion::GetInstanceName(IParamBlock2 *pb) return name; } -#include "../plMessage/plExcludeRegionMsg.h" -#include "plExcludeRegionComponent.h" - plMessage *plResponderCmdXRegion::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb) { plResponderCompNode compNode; @@ -1000,53 +1023,9 @@ plMessage *plResponderCmdXRegion::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg throw "No exclude region component specified"; } -class plResponderXRegionProc : public ParamMap2UserDlgProc -{ -protected: - plResponderCompNode fCompNode; - -public: - BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) - { - switch (msg) - { - case WM_INITDIALOG: - { - IParamBlock2 *pb = pm->GetParamBlock(); - - plResponderCompNode::ClassIDs cids; - cids.push_back(XREGION_CID); - fCompNode.Init(pb, kXRegionComp, kXRegionNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids); - fCompNode.InitDlg(hWnd); - } - return TRUE; - - case WM_COMMAND: - if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_COMP) - { - fCompNode.CompButtonPress(hWnd); - return TRUE; - } - else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_NODE) - { - fCompNode.NodeButtonPress(hWnd); - return TRUE; - } - break; - } - - return FALSE; - } - void DeleteThis() {} -}; -static plResponderXRegionProc gResponderXRegionProc; - /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// -class plResponderCameraTransitionProc; -extern plResponderCameraTransitionProc gResponderCameraTransitionProc; - enum { kCameraObj, kPopCamera, @@ -1093,7 +1072,7 @@ const char *plResponderCmdCamTransition::GetInstanceName(IParamBlock2 *pb) return name; } -#include "../pnMessage/plCameraMsg.h" +#include "pnMessage/plCameraMsg.h" #include "plCameraComponents.h" plMessage *plResponderCmdCamTransition::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb) @@ -1149,9 +1128,6 @@ plMessage *plResponderCmdCamTransition::CreateMsg(plMaxNode* node, plErrorMsg *p /////////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////////// -class plResponderCameraForceProc; -extern plResponderCameraForceProc gResponderCameraForceProc; - enum { kCamForce, @@ -1243,7 +1219,7 @@ const char *plResponderCmdDelay::GetInstanceName(IParamBlock2 *pb) return name; } -#include "../plMessage/plTimerCallbackMsg.h" +#include "plMessage/plTimerCallbackMsg.h" plMessage *plResponderCmdDelay::CreateMsg(plMaxNode* node, plErrorMsg *pErrMsg, IParamBlock2 *pb) { @@ -1368,7 +1344,7 @@ const char *plResponderCmdVisibility::GetInstanceName(IParamBlock2 *pb) return name; } -#include "../pnMessage/plEnableMsg.h" +#include "pnMessage/plEnableMsg.h" static void AddChildKeysRecur(plMaxNode* node, plMessage* msg) { @@ -1420,9 +1396,46 @@ plMessage *plResponderCmdVisibility::CreateMsg(plMaxNode* node, plErrorMsg *pErr /////////////////////////////////////////////////////////////////////////////////////////////// enum { kSubWorldNode, kSubWorldType }; +enum +{ + kRespondSubWorldEnter, + kRespondSubWorldExit, +}; + +class plResponderSubWorldProc : public ParamMap2UserDlgProc +{ +public: + virtual BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + switch (msg) + { + case WM_INITDIALOG: + { + IParamBlock2 *pb = pm->GetParamBlock(); + int type = pb->GetInt(kSubWorldType); + + HWND nButton = GetDlgItem(hWnd, IDC_NODE_BUTTON); + //HWND sEnterText = GetDlgItem(hWnd, IDC_SUBWORLD_ENTER); + HWND sExitText = GetDlgItem(hWnd, IDC_SUBWORLD_EXIT); + + BOOL isEnter = (type == kRespondSubWorldEnter) ? TRUE : FALSE; + + ShowWindow(nButton, (isEnter) ? SW_SHOW : SW_HIDE); + //ShowWindow(sEnterText,(isEnter) ? SW_SHOW : SW_HIDE); + ShowWindow(sExitText, (isEnter) ? SW_HIDE : SW_SHOW); + } + return TRUE; + + case WM_COMMAND: + break; + } + + return FALSE; + } + virtual void DeleteThis() {} +}; -class plResponderSubWorldProc; -extern plResponderSubWorldProc gResponderSubWorldProc; +static plResponderSubWorldProc gResponderSubWorldProc; ParamBlockDesc2 gResponderSubWorldBlock ( @@ -1440,12 +1453,6 @@ ParamBlockDesc2 gResponderSubWorldBlock end ); -enum -{ - kRespondSubWorldEnter, - kRespondSubWorldExit, -}; - plResponderCmdSubWorld& plResponderCmdSubWorld::Instance() { static plResponderCmdSubWorld theInstance; @@ -1532,54 +1539,45 @@ plMessage *plResponderCmdSubWorld::CreateMsg(plMaxNode* node, plErrorMsg *pErrMs return swMsg; } +/////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////// -class plResponderSubWorldProc : public ParamMap2UserDlgProc +#include "pfMessage/plArmatureEffectMsg.h" +#include "plAvatar/plArmatureEffects.h" + +enum +{ + kSurface, +}; + +class plResponderFootSurfaceProc : public ParamMap2UserDlgProc { public: BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { + IParamBlock2 *pb = pm->GetParamBlock(); + HWND hCB = GetDlgItem(hWnd, IDC_COMP_RESPOND_FOOT_SURFACE); + int i; + switch (msg) { case WM_INITDIALOG: - { - IParamBlock2 *pb = pm->GetParamBlock(); - int type = pb->GetInt(kSubWorldType); - - HWND nButton = GetDlgItem(hWnd, IDC_NODE_BUTTON); - //HWND sEnterText = GetDlgItem(hWnd, IDC_SUBWORLD_ENTER); - HWND sExitText = GetDlgItem(hWnd, IDC_SUBWORLD_EXIT); + for (i = 0; i < plArmatureEffectsMgr::kMaxSurface; i++) + ComboBox_AddString(hCB, plArmatureEffectsMgr::SurfaceStrings[i]); - BOOL isEnter = (type == kRespondSubWorldEnter) ? TRUE : FALSE; + ComboBox_SetCurSel(hCB, pb->GetInt(ParamID(kSurface))); - ShowWindow(nButton, (isEnter) ? SW_SHOW : SW_HIDE); - //ShowWindow(sEnterText,(isEnter) ? SW_SHOW : SW_HIDE); - ShowWindow(sExitText, (isEnter) ? SW_HIDE : SW_SHOW); - } return TRUE; case WM_COMMAND: - break; + if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_RESPOND_FOOT_SURFACE) + pb->SetValue(ParamID(kSurface), 0, ComboBox_GetCurSel(hCB)); } - return FALSE; } void DeleteThis() {} }; - -static plResponderSubWorldProc gResponderSubWorldProc; -/////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////// - -#include "../pfMessage/plArmatureEffectMsg.h" -#include "../plAvatar/plArmatureEffects.h" - -class plResponderFootSurfaceProc; -extern plResponderFootSurfaceProc gResponderFootSurfaceProc; - -enum -{ - kSurface, -}; +static plResponderFootSurfaceProc gResponderFootSurfaceProc; ParamBlockDesc2 gResponderFootSurfaceBlock ( @@ -1623,44 +1621,52 @@ plMessage *plResponderCmdFootSurface::CreateMsg(plMaxNode* node, plErrorMsg *pEr return msg; } -class plResponderFootSurfaceProc : public ParamMap2UserDlgProc +/////////////////////////////////////////////////////////////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////////////////////////// + +#include "plMultistageBehComponent.h" +enum { kMultistageComp, kMultistageNode }; + +class plResponderMultistageProc : public ParamMap2UserDlgProc { +protected: + plResponderCompNode fCompNode; + public: - BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + virtual BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { - IParamBlock2 *pb = pm->GetParamBlock(); - HWND hCB = GetDlgItem(hWnd, IDC_COMP_RESPOND_FOOT_SURFACE); - int i; - switch (msg) { case WM_INITDIALOG: - for (i = 0; i < plArmatureEffectsMgr::kMaxSurface; i++) - ComboBox_AddString(hCB, plArmatureEffectsMgr::SurfaceStrings[i]); - - ComboBox_SetCurSel(hCB, pb->GetInt(ParamID(kSurface))); + { + IParamBlock2 *pb = pm->GetParamBlock(); + plResponderCompNode::ClassIDs cids; + cids.push_back(MULTISTAGE_BEH_CID); + fCompNode.Init(pb, kMultistageComp, kMultistageNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids); + fCompNode.InitDlg(hWnd); + } return TRUE; case WM_COMMAND: - if (HIWORD(wParam) == CBN_SELCHANGE && LOWORD(wParam) == IDC_COMP_RESPOND_FOOT_SURFACE) - pb->SetValue(ParamID(kSurface), 0, ComboBox_GetCurSel(hCB)); + if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_COMP) + { + fCompNode.CompButtonPress(hWnd); + return TRUE; + } + else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_NODE) + { + fCompNode.NodeButtonPress(hWnd); + return TRUE; + } + break; } + return FALSE; } - void DeleteThis() {} + virtual void DeleteThis() {} }; -static plResponderFootSurfaceProc gResponderFootSurfaceProc; - -/////////////////////////////////////////////////////////////////////////////////////////////// -/////////////////////////////////////////////////////////////////////////////////////////////// - -#include "plMultistageBehComponent.h" - -class plResponderMultistageProc; -extern plResponderMultistageProc gResponderMultistageProc; - -enum { kMultistageComp, kMultistageNode }; +static plResponderMultistageProc gResponderMultistageProc; ParamBlockDesc2 gResponderMultistageBlock ( @@ -1722,44 +1728,3 @@ plMessage *plResponderCmdMultistage::CreateMsg(plMaxNode* node, plErrorMsg *pErr else throw "No Multistage component specified"; } - -class plResponderMultistageProc : public ParamMap2UserDlgProc -{ -protected: - plResponderCompNode fCompNode; - -public: - BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) - { - switch (msg) - { - case WM_INITDIALOG: - { - IParamBlock2 *pb = pm->GetParamBlock(); - - plResponderCompNode::ClassIDs cids; - cids.push_back(MULTISTAGE_BEH_CID); - fCompNode.Init(pb, kMultistageComp, kMultistageNode, IDC_RESPONDER_COMP, IDC_RESPONDER_NODE, &cids); - fCompNode.InitDlg(hWnd); - } - return TRUE; - - case WM_COMMAND: - if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_COMP) - { - fCompNode.CompButtonPress(hWnd); - return TRUE; - } - else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_RESPONDER_NODE) - { - fCompNode.NodeButtonPress(hWnd); - return TRUE; - } - break; - } - - return FALSE; - } - void DeleteThis() {} -}; -static plResponderMultistageProc gResponderMultistageProc; diff --git a/Sources/Tools/MaxComponent/plResponderMtl.cpp b/Sources/Tools/MaxComponent/plResponderMtl.cpp index a0f59161..ba59aa12 100644 --- a/Sources/Tools/MaxComponent/plResponderMtl.cpp +++ b/Sources/Tools/MaxComponent/plResponderMtl.cpp @@ -72,8 +72,23 @@ enum MtlNodeType kNodeResponder // Use the node the responder is attached to }; -class plResponderMtlProc; -extern plResponderMtlProc gResponderMtlProc; +#include "plAnimCompProc.h" + +class plResponderMtlProc : public plMtlAnimProc +{ +public: + plResponderMtlProc(); + +protected: + virtual void IOnInitDlg(HWND hWnd, IParamBlock2* pb); + virtual void ILoadUser(HWND hWnd, IParamBlock2* pb); + virtual bool IUserCommand(HWND hWnd, IParamBlock2* pb, int cmd, int resID); + + virtual void IPickNode(IParamBlock2* pb); + + virtual void ISetNodeButtonText(HWND hWnd, IParamBlock2* pb); +}; +static plResponderMtlProc gResponderMtlProc; ParamBlockDesc2 gResponderMtlBlock ( @@ -461,24 +476,6 @@ void plResponderCmdMtl::CreateWait(plMaxNode* node, plErrorMsg* pErrMsg, IParamB //////////////////////////////////////////////////////////////////////////////// -#include "plAnimCompProc.h" - -class plResponderMtlProc : public plMtlAnimProc -{ -public: - plResponderMtlProc(); - -protected: - virtual void IOnInitDlg(HWND hWnd, IParamBlock2* pb); - virtual void ILoadUser(HWND hWnd, IParamBlock2* pb); - virtual bool IUserCommand(HWND hWnd, IParamBlock2* pb, int cmd, int resID); - - virtual void IPickNode(IParamBlock2* pb); - - virtual void ISetNodeButtonText(HWND hWnd, IParamBlock2* pb); -}; -static plResponderMtlProc gResponderMtlProc; - plResponderMtlProc::plResponderMtlProc() { fMtlButtonID = IDC_MTL_BUTTON; diff --git a/Sources/Tools/MaxComponent/plResponderWait.cpp b/Sources/Tools/MaxComponent/plResponderWait.cpp index cedff94a..3506cb16 100644 --- a/Sources/Tools/MaxComponent/plResponderWait.cpp +++ b/Sources/Tools/MaxComponent/plResponderWait.cpp @@ -32,8 +32,29 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plResponderLink.h" -class plResponderWaitProc; -extern plResponderWaitProc gResponderWaitProc; +class plResponderWaitProc : public ParamMap2UserDlgProc +{ +protected: + IParamBlock2 *fStatePB; + IParamBlock2 *fWaitPB; + + int fCurCmd; + HWND fhDlg; + HWND fhList; + +public: + void Init(IParamBlock2 *curStatePB, int curCmd, HWND hList) { fStatePB = curStatePB; fCurCmd = curCmd; fhList = hList; } + + virtual BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); + virtual void DeleteThis() {} + +protected: + void LoadWho(bool setDefault=false); + void LoadPoint(bool force=false); + + IParamBlock2 *GetCmdParams(int cmdIdx); +}; +static plResponderWaitProc gResponderWaitProc; enum { @@ -111,30 +132,7 @@ const char* ResponderWait::GetWaitPoint(IParamBlock2* waitPB) return point; } -class plResponderWaitProc : public ParamMap2UserDlgProc -{ -protected: - IParamBlock2 *fStatePB; - IParamBlock2 *fWaitPB; - - int fCurCmd; - HWND fhDlg; - HWND fhList; - -public: - void Init(IParamBlock2 *curStatePB, int curCmd, HWND hList) { fStatePB = curStatePB; fCurCmd = curCmd; fhList = hList; } - - BOOL DlgProc(TimeValue t, IParamMap2 *pm, HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam); - - void DeleteThis() {} - -protected: - void LoadWho(bool setDefault=false); - void LoadPoint(bool force=false); - - IParamBlock2 *GetCmdParams(int cmdIdx); -}; -static plResponderWaitProc gResponderWaitProc; +///////////////////////////////////////////////////////////////////////////// void ResponderWait::InitDlg(IParamBlock2 *curStatePB, int curCmd, HWND hList) { diff --git a/Sources/Tools/MaxComponent/plSmoothComponent.cpp b/Sources/Tools/MaxComponent/plSmoothComponent.cpp index c99d0c00..3e53a4da 100644 --- a/Sources/Tools/MaxComponent/plSmoothComponent.cpp +++ b/Sources/Tools/MaxComponent/plSmoothComponent.cpp @@ -38,7 +38,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // The AccMeshSmooth now does everything the InterMeshSmooth and AvMeshSmooth // components did, only better and with fewer bugs. -//#include "../plDrawable/plInterMeshSmooth.h" +//#include "plDrawable/plInterMeshSmooth.h" #include "plDrawable/plAvMeshSmooth.h" #include "plDrawable/plAccMeshSmooth.h" diff --git a/Sources/Tools/MaxComponent/plTemplateComponent.cpp b/Sources/Tools/MaxComponent/plTemplateComponent.cpp index 4bd341d0..ae073c29 100644 --- a/Sources/Tools/MaxComponent/plTemplateComponent.cpp +++ b/Sources/Tools/MaxComponent/plTemplateComponent.cpp @@ -100,7 +100,7 @@ const char* plTemplateComponent::IGetAgeName(plMaxNode *node) return nil; } -#include "../MaxMain/plMaxNodeData.h" +#include "MaxMain/plMaxNodeData.h" // SetupProperties - Internal setup and write-only set properties on the MaxNode. No reading // of properties on the MaxNode, as it's still indeterminant. @@ -150,7 +150,7 @@ hsBool plTemplateComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) //////////////////////////////////////////////////////////////////////////////// -#include "../plModifier/plCloneSpawnModifier.h" +#include "plModifier/plCloneSpawnModifier.h" class plSpawnComponent : public plComponent { diff --git a/Sources/Tools/MaxComponent/plTypesComponents.cpp b/Sources/Tools/MaxComponent/plTypesComponents.cpp index 65a5b405..34cb4f4f 100644 --- a/Sources/Tools/MaxComponent/plTypesComponents.cpp +++ b/Sources/Tools/MaxComponent/plTypesComponents.cpp @@ -230,10 +230,10 @@ plVehicleComponent::plVehicleComponent() : fMod(nil) fClassDesc->MakeAutoParamBlocks(this); } -#include "../MaxMain/plPhysicalProps.h" -#include "../pnSceneObject/plSimulationInterface.h" -//#include "../plHavok1/plVehicleModifier.h" -//#include "../plHavok1/plPhysicsGroups.h" +#include "MaxMain/plPhysicalProps.h" +#include "pnSceneObject/plSimulationInterface.h" +//#include "plHavok1/plVehicleModifier.h" +//#include "plHavok1/plPhysicsGroups.h" /* void SetupVehiclePhys(plMaxNode* physNode, plMaxNode* node, plErrorMsg* pErrMsg, bool chassis=false) { @@ -396,7 +396,7 @@ hsBool plVehicleComponent::Convert(plMaxNode *node, plErrorMsg *pErrMsg) // // -#include "../plModifier/plMaintainersMarkerModifier.h" +#include "plModifier/plMaintainersMarkerModifier.h" enum { @@ -459,10 +459,10 @@ hsBool plMaintainersMarkerComponent::PreConvert(plMaxNode *pNode, plErrorMsg *pE // Game Marker Component // -#include "../plModifier/plGameMarkerModifier.h" +#include "plModifier/plGameMarkerModifier.h" #include "plNotetrackAnim.h" #include "plPickMaterialMap.h" -#include "../MaxMain/plMtlCollector.h" +#include "MaxMain/plMtlCollector.h" #include "plResponderMtl.h" #include "plResponderGetComp.h" #include "plAnimComponent.h" diff --git a/Sources/Tools/MaxConvert/hsControlConverter.cpp b/Sources/Tools/MaxConvert/hsControlConverter.cpp index 5f45688b..c57a3755 100644 --- a/Sources/Tools/MaxConvert/hsControlConverter.cpp +++ b/Sources/Tools/MaxConvert/hsControlConverter.cpp @@ -2027,12 +2027,12 @@ hsBool hsControlConverter::IGetSubAnimByName( Animatable *anim, TSTR &name, Ani // bad craziness, isolated here. #include "plConvert.h" #include "plgDispatch.h" -#include "../MaxComponent/plAnimComponent.h" -#include "../MaxComponent/plCameraComponents.h" -#include "../../../Sources/Plasma/NucleusLib/pnMessage/plCameraMsg.h" -#include "../../../Sources/Plasma/PubUtilLib/plMessage/plAnimCmdMsg.h" -#include "../../../Sources/Plasma/FeatureLib/pfCamera/plCameraModifier.h" -#include "../../../Sources/Plasma/NucleusLib/pnSceneObject/plSceneObject.h" +#include "MaxComponent/plAnimComponent.h" +#include "MaxComponent/plCameraComponents.h" +#include "pnMessage/plCameraMsg.h" +#include "plMessage/plAnimCmdMsg.h" +#include "pfCamera/plCameraModifier.h" +#include "pnSceneObject/plSceneObject.h" void hsControlConverter::IExportAnimatedCameraFOV(plMaxNode* node, hsTArray * kfArray) { diff --git a/Sources/Tools/MaxConvert/hsMaterialConverter.cpp b/Sources/Tools/MaxConvert/hsMaterialConverter.cpp index 1c3c94e8..7b8c625b 100644 --- a/Sources/Tools/MaxConvert/hsMaterialConverter.cpp +++ b/Sources/Tools/MaxConvert/hsMaterialConverter.cpp @@ -1112,7 +1112,7 @@ hsGMaterial *hsMaterialConverter::ICreateMaterial(Mtl *mtl, plMaxNode *node, con hsGuardEnd; } -#include "../MaxPlasmaMtls/Materials/plMultipassMtl.h" +#include "MaxPlasmaMtls/Materials/plMultipassMtl.h" // // Handle materials for normal non-light, non-particle nodes. @@ -2618,7 +2618,7 @@ void hsMaterialConverter::IAddLayerToMaterial(hsGMaterial *mat, plLayerInterface // // Functions called by the converters up above... // -#include "../MaxPlasmaMtls/Layers/plLayerTex.h" +#include "MaxPlasmaMtls/Layers/plLayerTex.h" //// IMustBeUniqueMaterial //////////////////////////////////////////////////// // Fun stuff here. If one of the layers of the material is a dynamic EnvMap, diff --git a/Sources/Tools/MaxConvert/plConvert.cpp b/Sources/Tools/MaxConvert/plConvert.cpp index c39d7daa..95a964d0 100644 --- a/Sources/Tools/MaxConvert/plConvert.cpp +++ b/Sources/Tools/MaxConvert/plConvert.cpp @@ -248,7 +248,7 @@ hsBool plConvert::Convert() #endif } -//#include "../MaxMain/plMaxNodeData.h" +//#include "MaxMain/plMaxNodeData.h" //#include hsBool ConvertList(hsTArray& nodes, PMaxNodeFunc p, plErrorMsg *errMsg, plConvertSettings *settings) diff --git a/Sources/Tools/MaxMain/CMakeLists.txt b/Sources/Tools/MaxMain/CMakeLists.txt index daeb663e..dfd469e9 100644 --- a/Sources/Tools/MaxMain/CMakeLists.txt +++ b/Sources/Tools/MaxMain/CMakeLists.txt @@ -7,7 +7,6 @@ include_directories("../../Plasma/NucleusLib/inc") include_directories("../../Plasma/PubUtilLib") include_directories("../../Plasma/PubUtilLib/inc") include_directories(${3dsm_INCLUDE_DIR}) -include_directories(${OPENSSL_INCLUDE_DIR}) include_directories(${OPENAL_INCLUDE_DIR}) include_directories(${PHYSX_INCLUDE_DIRS}) include_directories(${PYTHON_INCLUDE_DIR}) diff --git a/Sources/Tools/MaxMain/GlobalUtility.cpp b/Sources/Tools/MaxMain/GlobalUtility.cpp index 6449f3ac..e3f77d9d 100644 --- a/Sources/Tools/MaxMain/GlobalUtility.cpp +++ b/Sources/Tools/MaxMain/GlobalUtility.cpp @@ -96,7 +96,7 @@ void DoAllRecur(PMaxNodeFunc p, plMaxNode *node) } } -//#include "../MaxComponent/plComponentBase.h" +//#include "MaxComponent/plComponentBase.h" #include "MaxExport/plExportErrorMsg.h" diff --git a/Sources/Tools/MaxMain/SimpleExport.rc b/Sources/Tools/MaxMain/SimpleExport.rc index e335a965..cb57200e 100644 --- a/Sources/Tools/MaxMain/SimpleExport.rc +++ b/Sources/Tools/MaxMain/SimpleExport.rc @@ -2,15 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -34,7 +28,6 @@ END 2 TEXTINCLUDE BEGIN - "#include ""afxres.h""\r\n" "\0" END diff --git a/Sources/Tools/MaxMain/plComponentPanel.cpp b/Sources/Tools/MaxMain/plComponentPanel.cpp index ba17b881..67225dd6 100644 --- a/Sources/Tools/MaxMain/plComponentPanel.cpp +++ b/Sources/Tools/MaxMain/plComponentPanel.cpp @@ -305,7 +305,7 @@ int plComponentUtil::IFindListItem(plComponentBase* comp) return ListView_FindItem(GetDlgItem(fhPanel, IDC_COMPLIST), -1, &fi); } -#include "../MaxComponent/plAutoUIComp.h" +#include "MaxComponent/plAutoUIComp.h" void plComponentUtil::IAddRollups(plComponentBase* comp) { diff --git a/Sources/Tools/MaxMain/plMaxNode.h b/Sources/Tools/MaxMain/plMaxNode.h index 51d1691e..094368b1 100644 --- a/Sources/Tools/MaxMain/plMaxNode.h +++ b/Sources/Tools/MaxMain/plMaxNode.h @@ -32,7 +32,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTemplates.h" #include "hsMatrix44.h" #include "iparamb2.h" -#include "../pnKeyedObject/plKey.h" +#include "pnKeyedObject/plKey.h" #include class plMaxNode; diff --git a/Sources/Tools/MaxMain/plMaxNodeBase.h b/Sources/Tools/MaxMain/plMaxNodeBase.h index 0f80dd61..d25046c2 100644 --- a/Sources/Tools/MaxMain/plMaxNodeBase.h +++ b/Sources/Tools/MaxMain/plMaxNodeBase.h @@ -31,7 +31,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "max.h" #include "hsMatrix44.h" #include "hsColorRGBA.h" -#include "../pnKeyedObject/plKey.h" +#include "pnKeyedObject/plKey.h" #include "plLoadMask.h" class plLocation; diff --git a/Sources/Tools/MaxMain/plMaxNodeData.h b/Sources/Tools/MaxMain/plMaxNodeData.h index 7087fb2b..0e926080 100644 --- a/Sources/Tools/MaxMain/plMaxNodeData.h +++ b/Sources/Tools/MaxMain/plMaxNodeData.h @@ -33,7 +33,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plRenderLevel.h" #include "plPhysicalProps.h" #include "hsBitVector.h" -#include "../pnKeyedObject/plKey.h" +#include "pnKeyedObject/plKey.h" #include "plLoadMask.h" class plMaxNodeBase; diff --git a/Sources/Tools/MaxMain/plPythonMgr.cpp b/Sources/Tools/MaxMain/plPythonMgr.cpp index a1b4998e..40afa96c 100644 --- a/Sources/Tools/MaxMain/plPythonMgr.cpp +++ b/Sources/Tools/MaxMain/plPythonMgr.cpp @@ -112,7 +112,7 @@ bool ICallStrFunc(PyObject *dict, char *funcName, char*& val) } -#include "../MaxComponent/plPythonFileComponent.h" +#include "MaxComponent/plPythonFileComponent.h" #include "hsUtils.h" enum ParamTypes @@ -549,7 +549,7 @@ void plPythonMgr::IAddGUISkin(plAutoUIBlock *autoUI, PyObject *tuple, char *para autoUI->AddPickGUISkinButton(id, nil, paramName, vid, vstates); } -#include "../MaxComponent/plResponderComponent.h" +#include "MaxComponent/plResponderComponent.h" void plPythonMgr::IAddResponder(plAutoUIBlock *autoUI, PyObject *tuple, char *paramName, int id, int vid, std::vector* vstates) { diff --git a/Sources/Tools/MaxMtlUpdate/plMaterialUpdate.rc b/Sources/Tools/MaxMtlUpdate/plMaterialUpdate.rc index b22f4c5a..d3738171 100644 --- a/Sources/Tools/MaxMtlUpdate/plMaterialUpdate.rc +++ b/Sources/Tools/MaxMtlUpdate/plMaterialUpdate.rc @@ -2,15 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -68,7 +62,6 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" "\0" END diff --git a/Sources/Tools/MaxPlasmaLights/plRTLights.rc b/Sources/Tools/MaxPlasmaLights/plRTLights.rc index bdafa31e..15648f69 100644 --- a/Sources/Tools/MaxPlasmaLights/plRTLights.rc +++ b/Sources/Tools/MaxPlasmaLights/plRTLights.rc @@ -2,17 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -388,9 +380,6 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""windows.h""\r\n" - "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" "\0" END diff --git a/Sources/Tools/MaxPlasmaMtls/Layers/plDynamicEnvLayerBitmapPB.cpp b/Sources/Tools/MaxPlasmaMtls/Layers/plDynamicEnvLayerBitmapPB.cpp index c084b69d..c0c6dc98 100644 --- a/Sources/Tools/MaxPlasmaMtls/Layers/plDynamicEnvLayerBitmapPB.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Layers/plDynamicEnvLayerBitmapPB.cpp @@ -99,6 +99,7 @@ class PickAnchorNode : public PickObjectProc class DELBitmapDlgProc : public ParamMap2UserDlgProc { +public: PickAnchorNode fPickAnchorCallback; /// Called to update the controls of the dialog @@ -149,7 +150,7 @@ class DELBitmapDlgProc : public ParamMap2UserDlgProc } /// Main message proc - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -183,7 +184,7 @@ class DELBitmapDlgProc : public ParamMap2UserDlgProc return FALSE; } - void DeleteThis() {}; + virtual void DeleteThis() {}; }; static DELBitmapDlgProc gDELBitmapDlgProc; diff --git a/Sources/Tools/MaxPlasmaMtls/Layers/plDynamicTextLayerBitmapPB.cpp b/Sources/Tools/MaxPlasmaMtls/Layers/plDynamicTextLayerBitmapPB.cpp index 4fefe691..e255f451 100644 --- a/Sources/Tools/MaxPlasmaMtls/Layers/plDynamicTextLayerBitmapPB.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Layers/plDynamicTextLayerBitmapPB.cpp @@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com class DTLBitmapDlgProc : public ParamMap2UserDlgProc { +public: /// Called to update the controls of the dialog virtual void Update( TimeValue t, Interval &valid, IParamMap2 *map ) { @@ -69,7 +70,7 @@ class DTLBitmapDlgProc : public ParamMap2UserDlgProc } /// Main message proc - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) @@ -136,7 +137,7 @@ class DTLBitmapDlgProc : public ParamMap2UserDlgProc return FALSE; } - void DeleteThis() {}; + virtual void DeleteThis() {}; protected: /// Clamp texture sizes to a power of 2 diff --git a/Sources/Tools/MaxPlasmaMtls/Layers/plLayerTex.cpp b/Sources/Tools/MaxPlasmaMtls/Layers/plLayerTex.cpp index c14277f4..2734b294 100644 --- a/Sources/Tools/MaxPlasmaMtls/Layers/plLayerTex.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Layers/plLayerTex.cpp @@ -173,7 +173,7 @@ BOOL plLayerTex::SetDlgThing(ParamDlg* dlg) int plLayerTex::NumRefs() { - return 3; + return 2; } //From ReferenceMaker @@ -211,7 +211,7 @@ void plLayerTex::SetReference(int i, RefTargetHandle rtarg) int plLayerTex::NumParamBlocks() { - return 2; + return 1; } IParamBlock2* plLayerTex::GetParamBlock(int i) @@ -248,7 +248,7 @@ RefTargetHandle plLayerTex::Clone(RemapDir &remap) int plLayerTex::NumSubs() { - return 3; + return 2; } Animatable* plLayerTex::SubAnim(int i) diff --git a/Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBasicPB.cpp b/Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBasicPB.cpp index 79d951bf..616896b5 100644 --- a/Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBasicPB.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBasicPB.cpp @@ -64,7 +64,7 @@ static const char *kUsageTypes[] = class BasicDlgProc : public ParamMap2UserDlgProc { public: - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { IParamBlock2 *pb = map->GetParamBlock(); @@ -101,6 +101,6 @@ public: return false; } - void DeleteThis() {}; + virtual void DeleteThis() {}; }; static BasicDlgProc gBasicDlgProc; diff --git a/Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBitmapPB.cpp b/Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBitmapPB.cpp index caacd62c..dbf669de 100644 --- a/Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBitmapPB.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Layers/plLayerTexBitmapPB.cpp @@ -32,8 +32,365 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com class BMTexPBAccessor; extern BMTexPBAccessor bmtex_accessor; -class BitmapDlgProc; -extern BitmapDlgProc gBitmapDlgProc; +class BMCropper : public CropCallback +{ + IParamBlock2 *fPBlock; + +public: + BMCropper(IParamBlock2* pblock) : fPBlock(pblock) {} + + float GetInitU() { return fPBlock->GetFloat(kBmpClipU); } + float GetInitV() { return fPBlock->GetFloat(kBmpClipV); } + float GetInitW() { return fPBlock->GetFloat(kBmpClipW); } + float GetInitH() { return fPBlock->GetFloat(kBmpClipH); } + BOOL GetInitMode() { return fPBlock->GetInt(kBmpCropPlace); } + void SetValues(float u, float v, float w, float h, BOOL md); + void OnClose(); +}; + +class BitmapDlgProc : public ParamMap2UserDlgProc +{ + friend class BMTexPBAccessor; + + + PBBitmap *fLastBMap; + bool fSettingDetailValues; + +public: + /// Called to update the controls of the dialog + /// Note: we're bad that we use a static here, but + virtual void Update( TimeValue t, Interval &valid, IParamMap2 *map ) + { + ICustButton *bmSelectBtn; + IParamBlock2 *pblock; + int width, height; + + + ParamMap2UserDlgProc::Update( t, valid, map ); + + if( fSettingDetailValues ) + { + // We're getting an update just because we changed detail values, so we + // know we don't have to do anything ourselves + return; + } + + pblock = map->GetParamBlock(); + + // Update texture map button + bmSelectBtn = GetICustButton( GetDlgItem( map->GetHWnd(), IDC_LAYER_NAME ) ); + PBBitmap *pbbm = pblock->GetBitmap( kBmpBitmap, t ); + if( pbbm ) + { + if( pbbm != fLastBMap ) + { + bmSelectBtn->SetText( (TCHAR *)pbbm->bi.Filename() ); + + // Init values for clamping spinners to powers of 2 + width = IFloorPow2( pbbm->bi.Width() ); + map->SetRange( kBmpExportWidth, 4.f, (float)width ); + + height = IFloorPow2( pbbm->bi.Height() ); + map->SetRange( kBmpExportHeight, 4.f, (float)height ); + + IClampTexSizeSpinner( t, map, true ); + ISetDetailCurveNumLevels( map, t ); + } + } + else if( pbbm != fLastBMap ) + bmSelectBtn->SetText( _T( "None" ) ); + + fLastBMap = pbbm; + + ReleaseICustButton( bmSelectBtn ); + + // Update detail curve control + HWND dlg = map->GetHWnd(); + + plDetailCurveCtrl *ctrl = GET_DETAIL_CURVE_CTRL( dlg, IDC_DETAIL_CURVE_CTRL ); + if( ctrl == NULL ) + { + // The control hasn't been created, so create it already! + HWND basis; + RECT r; + + // Create the detail map control + basis = GetDlgItem( dlg, IDC_DETAIL_SAMPLE ); + GetClientRect( basis, &r ); + MapWindowPoints( basis, dlg, (POINT *)&r, 2 ); + + ctrl = TRACKED_NEW plDetailCurveCtrl( dlg, IDC_DETAIL_CURVE_CTRL, &r ); + } + + EnableWindow( GetDlgItem( dlg, IDC_DETAIL_CURVE_CTRL ), (BOOL)pblock->GetInt( kBmpUseDetail, t ) ); + + if( ctrl != NULL ) + { + ctrl->SetStartPoint( (float)pblock->GetInt( kBmpDetailStartSize, t ) / 100.f, + (float)pblock->GetInt( kBmpDetailStartOpac, t ) / 100.f ); + ctrl->SetEndPoint( (float)pblock->GetInt( kBmpDetailStopSize, t ) / 100.f, + (float)pblock->GetInt( kBmpDetailStopOpac, t ) / 100.f ); + } + + } + + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + static ICustButton* bmSelectBtn; + + switch (msg) + { + case WM_INITDIALOG: + fLastBMap = NULL; + fSettingDetailValues = false; + break; + + /// Note: the following *could* be done in the accessor, except that you end up in an + /// infinite loop updating the values. Not good. + case CC_SPINNER_CHANGE: + + if( LOWORD( wParam ) == IDC_EXPORTWIDTH_SPINNER ) + IClampTexSizeSpinner( t, map, true ); + + else if( LOWORD( wParam ) == IDC_EXPORTHEIGHT_SPINNER ) + IClampTexSizeSpinner( t, map, false ); + + break; + + // Message from the detail curve that a point got dragged + case PL_DC_POINT_DRAGGED: + { + plDetailCurveCtrl *ctrl = (plDetailCurveCtrl *)lParam; + IParamBlock2 *pblock = map->GetParamBlock(); + float x, y; + + + fSettingDetailValues = true; + + if( wParam == PL_DC_START_POINT ) + { + ctrl->GetStartPoint( x, y ); + pblock->SetValue( kBmpDetailStartSize, t, (int)( x * 100.f ) ); + pblock->SetValue( kBmpDetailStartOpac, t, (int)( y * 100.f ) ); + } + else + { + ctrl->GetEndPoint( x, y ); + pblock->SetValue( kBmpDetailStopSize, t, (int)( x * 100.f ) ); + pblock->SetValue( kBmpDetailStopOpac, t, (int)( y * 100.f ) ); + } + + map->UpdateUI( t ); + fSettingDetailValues = false; + } + return 0; + + case WM_COMMAND: + if( HIWORD( wParam ) == EN_CHANGE && LOWORD( wParam ) == IDC_EXPORTWIDTH ) + IClampTexSizeSpinner( t, map, true ); + + else if( HIWORD( wParam ) == EN_CHANGE && LOWORD( wParam ) == IDC_EXPORTHEIGHT ) + IClampTexSizeSpinner( t, map, false ); + + else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_BM_CROP_IMAGE) + { + IParamBlock2 *pblock = map->GetParamBlock(); + PBBitmap *pbbm = pblock->GetBitmap(kBmpBitmap, t); + if (pbbm) + { + if (!pbbm->bm) + pbbm->bm = TheManager->Load(&pbbm->bi); + + BMCropper *cropper = TRACKED_NEW BMCropper(pblock); + + pbbm->bm->Display("Specify Cropping/Placement", BMM_CN, FALSE, TRUE, cropper); + } + // bm->DeleteThis(); + return TRUE; + } + else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_LAYER_RELOAD) + { + // TEMP + IParamBlock2 *pblock = map->GetParamBlock(); + PBBitmap *pbbm = pblock->GetBitmap(kBmpBitmap, t); + if (pbbm) + { + plLayerTex *layer = (plLayerTex*)map->GetParamBlock()->GetOwner(); + + layer->RefreshBitmaps(); + + layer->fMtlParams->MtlChanged(); + layer->IChanged(); + } + return TRUE; + } + else if (LOWORD(wParam) == IDC_LAYER_NAME) + { + plPlasmaMAXLayer *layer = (plPlasmaMAXLayer *)map->GetParamBlock()->GetOwner(); + if (layer == nil) + return FALSE; + BOOL selectedNewBitmap = layer->HandleBitmapSelection(); + + if(selectedNewBitmap) + { + IParamBlock2 *pblock = map->GetParamBlock(); + //plLayerTex *layer = (plLayerTex*)map->GetParamBlock()->GetOwner(); + + //layer->SetBitmap(&bi); + //layer->IChanged(); + //BitmapInfo *bi = &layer->GetPBBitmap()->bi; + + bmSelectBtn = GetICustButton(GetDlgItem(hWnd,IDC_LAYER_NAME)); + PBBitmap *pbbm = layer->GetPBBitmap(); + bmSelectBtn->SetText(pbbm != nil ? (TCHAR*)pbbm->bi.Filename() : ""); + ReleaseICustButton(bmSelectBtn); + + if (pbbm != nil) + { + // Init values for clamping spinners to powers of 2 + int width = IFloorPow2( pbbm->bi.Width() ); + map->SetRange( kBmpExportWidth, 4.f, (float)width ); + + int height = IFloorPow2( pbbm->bi.Height() ); + map->SetRange( kBmpExportHeight, 4.f, (float)height ); + + if( width > 512 ) + { + height = (int)( 512.f * (float)( (float)height / (float)width ) ); + width = 512; + } + else if( height > 512 ) + { + width = (int)( 512.f * (float)( (float)width / (float)height ) ); + height = 512; + } + pblock->SetValue( kBmpExportWidth, t, width ); + pblock->SetValue( kBmpExportLastWidth, t, width ); + pblock->SetValue( kBmpExportHeight, t, height ); + pblock->SetValue( kBmpExportLastHeight, t, height ); + + IClampTexSizeSpinner( t, map, true ); + } + return TRUE; + } + else + { + return FALSE; + } + } + break; + } + + return FALSE; + } + virtual void DeleteThis() {}; + + void ISetDetailCurveNumLevels( IParamMap2 *map, TimeValue t ) + { + /// Set the level count on the detail control + plDetailCurveCtrl *ctrl = GET_DETAIL_CURVE_CTRL( map->GetHWnd(), IDC_DETAIL_CURVE_CTRL ); + if( ctrl != NULL ) + { + IParamBlock2 *pblock = map->GetParamBlock(); + int w = pblock->GetInt( kBmpExportWidth, t ); + int h = pblock->GetInt( kBmpExportHeight, t ); + int numLevels = 0; + while( w > 1 && h > 1 ) + { + w >>= 1; + h >>= 1; + numLevels++; + } + ctrl->SetNumLevels( numLevels ); + } + } + + /// Clamp texture sizes to a power of 2 + void IClampTexSizeSpinner( TimeValue t, IParamMap2 *map, bool clampWidth ) + { + IParamBlock2 *pblock = map->GetParamBlock(); + ParamID clampNew, clampOld; + ParamID otherNew, otherOld; + + if( clampWidth ) + { + clampNew = kBmpExportWidth; clampOld = kBmpExportLastWidth; + otherNew = kBmpExportHeight; otherOld = kBmpExportLastHeight; + } + else + { + clampNew = kBmpExportHeight; clampOld = kBmpExportLastHeight; + otherNew = kBmpExportWidth; otherOld = kBmpExportLastWidth; + } + + int lastVal = pblock->GetInt( clampOld, t ); + int tempVal, newVal = pblock->GetInt( clampNew, t ); + + if( newVal < lastVal ) + { + lastVal = newVal; + for( tempVal = 1; tempVal <= newVal; tempVal <<= 1 ); + newVal = tempVal >> 1; + } + else + { + lastVal = newVal; + for( tempVal = 1; tempVal < newVal; tempVal <<= 1 ); + newVal = tempVal; + } + + pblock->SetValue( clampNew, t, newVal ); + pblock->SetValue( clampOld, t, newVal ); + + // And clamp aspect ratio + PBBitmap *pbbm = pblock->GetBitmap( kBmpBitmap, t ); + + if( pbbm != NULL ) + { + int realWidth = pbbm->bi.Width(); + int realHeight = pbbm->bi.Height(); + + float aspect; + if( clampWidth ) + aspect = (float)realHeight / (float)realWidth; + else + aspect = (float)realWidth / (float)realHeight; + + int value = newVal; + value *= aspect; + + if( value < 4 ) + { + // Can't be below 4! + value = 4; + pblock->SetValue( otherNew, t, value ); + pblock->SetValue( otherOld, t, value ); + value = value / aspect; + pblock->SetValue( clampNew, t, value ); + pblock->SetValue( clampOld, t, value ); + } + else + { + pblock->SetValue( otherNew, t, value ); + pblock->SetValue( otherOld, t, value ); + } + } + + ISetDetailCurveNumLevels( map, t ); + } + + int IFloorPow2( int value ) + { + int v; + + + for( v = 1; v <= value; v <<= 1 ); + return v >> 1; + } + +}; + +static BitmapDlgProc gBitmapDlgProc; static ParamBlockDesc2 gBitmapParamBlk ( @@ -174,568 +531,208 @@ static ParamBlockDesc2 gBitmapParamBlk p_default, 512, end, kBmpExportHeight, _T("exportHeight"), TYPE_INT, 0, 0, - p_ui, TYPE_SPINNER, EDITTYPE_INT, IDC_EXPORTHEIGHT, IDC_EXPORTHEIGHT_SPINNER, SPIN_AUTOSCALE, - p_range, 4, 2048, - p_default, 512, - end, - kBmpExportLastWidth, _T("lastExportWidth"), TYPE_INT, 0, 0, - end, - kBmpExportLastHeight, _T("lastExportHeight"), TYPE_INT, 0, 0, - end, - - // Keep a sysmem copy at runtime (for image examination/manipulation). - kBmpNoDiscard, _T("noDiscard"), TYPE_BOOL, 0, 0, - p_ui, TYPE_SINGLECHEKBOX, IDC_NO_DISCARD, - p_default, FALSE, - end, - - end -); -ParamBlockDesc2 *GetBitmapBlk() { return &gBitmapParamBlk; } - -class BMCropper; - -class BMTexPBAccessor : public PBAccessor -{ -public: - void Set(PB2Value& val, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t) - { - plLayerTex* layer = (plLayerTex*)owner; - - if(layer == NULL) return; - - IParamBlock2 *pb = layer->GetParamBlockByID(plLayerTex::kBlkBitmap); - - switch (id) - { - case kBmpBitmap: - if (pb->GetMap()) - pb->GetMap()->Invalidate(kBmpBitmap); - - // Update the bitmap saved by the layer - //layer->SetBitmap(&val.bm->bi, tabIndex); - break; - -/* - case kBmpFilename: - bmt->SetMapName(val.s); - break; - - case kBmpFiltering: - bmt->filterType = val.i; - if (bmt->thebm) - bmt->thebm->SetFilter(bmFilterType(val.i)); - break; -*/ - case kBmpClipU: - { - float u = val.f; - float w = pb->GetFloat(kBmpClipW, t); - if (u + w > 1.0f) - { - pb->SetValue(kBmpClipW, t, 1.0f-u); - if (pb->GetMap()) - pb->GetMap()->Invalidate(kBmpClipW); - } - break; - } - case kBmpClipW: - { - float w = val.f; - float u = pb->GetFloat(kBmpClipU, t); - if (u + w > 1.0f) - { - pb->SetValue(kBmpClipU, t, 1.0f-w); - if (pb->GetMap()) - pb->GetMap()->Invalidate(kBmpClipU); - } - break; - } - case kBmpClipV: - { - float v = val.f; - float h = pb->GetFloat(kBmpClipH, t); - if (v + h > 1.0f) - { - pb->SetValue(kBmpClipH, t, 1.0f-v); - if (pb->GetMap()) - pb->GetMap()->Invalidate(kBmpClipH); - } - break; - } - case kBmpClipH: - { - float h = val.f; - float v = pb->GetFloat(kBmpClipV, t); - if (v + h > 1.0f) - { - pb->SetValue(kBmpClipV, t, 1.0f-h); - if (pb->GetMap()) - pb->GetMap()->Invalidate(kBmpClipV); - } - break; - } - - case kBmpDetailStartSize: - case kBmpDetailStopSize: - case kBmpDetailStartOpac: - case kBmpDetailStopOpac: - if( pb != NULL ) - { - if( IIsProcSettingDetailValues( pb ) ) - break; // Ignore, since we're the ones setting 'em - - HWND dlg = pb->GetMap()->GetHWnd(); - plDetailCurveCtrl *ctrl = GET_DETAIL_CURVE_CTRL( dlg, IDC_DETAIL_CURVE_CTRL ); - if( ctrl != NULL ) - { - if( id == kBmpDetailStartSize || id == kBmpDetailStartOpac ) - ctrl->SetStartPoint( (float)pb->GetInt( kBmpDetailStartSize, t ) / 100.f, - (float)pb->GetInt( kBmpDetailStartOpac, t ) / 100.f ); - else - ctrl->SetEndPoint( (float)pb->GetInt( kBmpDetailStopSize, t ) / 100.f, - (float)pb->GetInt( kBmpDetailStopOpac, t ) / 100.f ); - } - - // Make sure start is less than end - if( id == kBmpDetailStartSize ) - { - int end = pb->GetInt( kBmpDetailStopSize, t ); - if( val.i > end ) - pb->SetValue( kBmpDetailStopSize, t, val.i ); - } - else if( id == kBmpDetailStopSize ) - { - int start = pb->GetInt( kBmpDetailStartSize, t ); - if( val.i < start ) - pb->SetValue( kBmpDetailStartSize, t, val.i ); - } - - } - break; - - case kBmpUseDetail: - if( pb != NULL ) - { - HWND dlg = pb->GetMap()->GetHWnd(); - EnableWindow( GetDlgItem( dlg, IDC_DETAIL_CURVE_CTRL ), (BOOL)val.i ); - } - break; - } - } - void Get(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t, Interval &valid) - { - } - - // Gotta love hacks.... - bool IIsProcSettingDetailValues( IParamBlock2 *pb ); - -}; -static BMTexPBAccessor bmtex_accessor; - - -//========================================================================================= -// BMCropper -//========================================================================================= -class BMCropper : public CropCallback -{ - IParamBlock2 *fPBlock; - -public: - BMCropper(IParamBlock2* pblock) : fPBlock(pblock) {} - - float GetInitU() { return fPBlock->GetFloat(kBmpClipU); } - float GetInitV() { return fPBlock->GetFloat(kBmpClipV); } - float GetInitW() { return fPBlock->GetFloat(kBmpClipW); } - float GetInitH() { return fPBlock->GetFloat(kBmpClipH); } - BOOL GetInitMode() { return fPBlock->GetInt(kBmpCropPlace); } - void SetValues(float u, float v, float w, float h, BOOL md); - void OnClose(); -}; + p_ui, TYPE_SPINNER, EDITTYPE_INT, IDC_EXPORTHEIGHT, IDC_EXPORTHEIGHT_SPINNER, SPIN_AUTOSCALE, + p_range, 4, 2048, + p_default, 512, + end, + kBmpExportLastWidth, _T("lastExportWidth"), TYPE_INT, 0, 0, + end, + kBmpExportLastHeight, _T("lastExportHeight"), TYPE_INT, 0, 0, + end, -void BMCropper::SetValues(float u, float v, float w, float h, BOOL md) -{ - TimeValue t = GetCOREInterface()->GetTime(); + // Keep a sysmem copy at runtime (for image examination/manipulation). + kBmpNoDiscard, _T("noDiscard"), TYPE_BOOL, 0, 0, + p_ui, TYPE_SINGLECHEKBOX, IDC_NO_DISCARD, + p_default, FALSE, + end, - if (u != fPBlock->GetFloat(kBmpClipU, t)) - { - fPBlock->SetValue(kBmpClipU, t, u); - fPBlock->GetMap()->Invalidate(kBmpClipU); - } + end +); +ParamBlockDesc2 *GetBitmapBlk() { return &gBitmapParamBlk; } - if (v != fPBlock->GetFloat(kBmpClipV, t)) +class BMTexPBAccessor : public PBAccessor +{ +public: + void Set(PB2Value& val, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t) { - fPBlock->SetValue(kBmpClipV, t, v); - fPBlock->GetMap()->Invalidate(kBmpClipV); - } + plLayerTex* layer = (plLayerTex*)owner; - if (w != fPBlock->GetFloat(kBmpClipW, t)) - { - fPBlock->SetValue(kBmpClipW, t, w); - fPBlock->GetMap()->Invalidate(kBmpClipW); - } + if(layer == NULL) return; + + IParamBlock2 *pb = layer->GetParamBlockByID(plLayerTex::kBlkBitmap); - if (h != fPBlock->GetFloat(kBmpClipH, t)) - { - fPBlock->SetValue(kBmpClipH, t, h); - fPBlock->GetMap()->Invalidate(kBmpClipH); - } + switch (id) + { + case kBmpBitmap: + if (pb->GetMap()) + pb->GetMap()->Invalidate(kBmpBitmap); - if (md != fPBlock->GetInt(kBmpCropPlace)) - { - fPBlock->SetValue(kBmpCropPlace, t, md); - fPBlock->GetMap()->Invalidate(kBmpCropPlace); - } -} + // Update the bitmap saved by the layer + //layer->SetBitmap(&val.bm->bi, tabIndex); + break; -void BMCropper::OnClose() -{ - delete this; -} +/* + case kBmpFilename: + bmt->SetMapName(val.s); + break; -class BitmapDlgProc : public ParamMap2UserDlgProc -{ - friend class BMTexPBAccessor; - - - PBBitmap *fLastBMap; - bool fSettingDetailValues; - - - /// Called to update the controls of the dialog - /// Note: we're bad that we use a static here, but - virtual void Update( TimeValue t, Interval &valid, IParamMap2 *map ) - { - ICustButton *bmSelectBtn; - IParamBlock2 *pblock; - int width, height; - - - ParamMap2UserDlgProc::Update( t, valid, map ); - - if( fSettingDetailValues ) - { - // We're getting an update just because we changed detail values, so we - // know we don't have to do anything ourselves - return; - } - - pblock = map->GetParamBlock(); - - // Update texture map button - bmSelectBtn = GetICustButton( GetDlgItem( map->GetHWnd(), IDC_LAYER_NAME ) ); - PBBitmap *pbbm = pblock->GetBitmap( kBmpBitmap, t ); - if( pbbm ) - { - if( pbbm != fLastBMap ) - { - bmSelectBtn->SetText( (TCHAR *)pbbm->bi.Filename() ); - - // Init values for clamping spinners to powers of 2 - width = IFloorPow2( pbbm->bi.Width() ); - map->SetRange( kBmpExportWidth, 4.f, (float)width ); - - height = IFloorPow2( pbbm->bi.Height() ); - map->SetRange( kBmpExportHeight, 4.f, (float)height ); - - IClampTexSizeSpinner( t, map, true ); - ISetDetailCurveNumLevels( map, t ); - } - } - else if( pbbm != fLastBMap ) - bmSelectBtn->SetText( _T( "None" ) ); - - fLastBMap = pbbm; - - ReleaseICustButton( bmSelectBtn ); - - // Update detail curve control - HWND dlg = map->GetHWnd(); - - plDetailCurveCtrl *ctrl = GET_DETAIL_CURVE_CTRL( dlg, IDC_DETAIL_CURVE_CTRL ); - if( ctrl == NULL ) - { - // The control hasn't been created, so create it already! - HWND basis; - RECT r; - - // Create the detail map control - basis = GetDlgItem( dlg, IDC_DETAIL_SAMPLE ); - GetClientRect( basis, &r ); - MapWindowPoints( basis, dlg, (POINT *)&r, 2 ); - - ctrl = TRACKED_NEW plDetailCurveCtrl( dlg, IDC_DETAIL_CURVE_CTRL, &r ); - } - - EnableWindow( GetDlgItem( dlg, IDC_DETAIL_CURVE_CTRL ), (BOOL)pblock->GetInt( kBmpUseDetail, t ) ); - - if( ctrl != NULL ) - { - ctrl->SetStartPoint( (float)pblock->GetInt( kBmpDetailStartSize, t ) / 100.f, - (float)pblock->GetInt( kBmpDetailStartOpac, t ) / 100.f ); - ctrl->SetEndPoint( (float)pblock->GetInt( kBmpDetailStopSize, t ) / 100.f, - (float)pblock->GetInt( kBmpDetailStopOpac, t ) / 100.f ); - } - - } - - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) - { - static ICustButton* bmSelectBtn; - - switch (msg) - { - case WM_INITDIALOG: - fLastBMap = NULL; - fSettingDetailValues = false; - break; - - /// Note: the following *could* be done in the accessor, except that you end up in an - /// infinite loop updating the values. Not good. - case CC_SPINNER_CHANGE: - - if( LOWORD( wParam ) == IDC_EXPORTWIDTH_SPINNER ) - IClampTexSizeSpinner( t, map, true ); - - else if( LOWORD( wParam ) == IDC_EXPORTHEIGHT_SPINNER ) - IClampTexSizeSpinner( t, map, false ); - - break; - - // Message from the detail curve that a point got dragged - case PL_DC_POINT_DRAGGED: + case kBmpFiltering: + bmt->filterType = val.i; + if (bmt->thebm) + bmt->thebm->SetFilter(bmFilterType(val.i)); + break; +*/ + case kBmpClipU: { - plDetailCurveCtrl *ctrl = (plDetailCurveCtrl *)lParam; - IParamBlock2 *pblock = map->GetParamBlock(); - float x, y; - - - fSettingDetailValues = true; - - if( wParam == PL_DC_START_POINT ) - { - ctrl->GetStartPoint( x, y ); - pblock->SetValue( kBmpDetailStartSize, t, (int)( x * 100.f ) ); - pblock->SetValue( kBmpDetailStartOpac, t, (int)( y * 100.f ) ); - } - else + float u = val.f; + float w = pb->GetFloat(kBmpClipW, t); + if (u + w > 1.0f) { - ctrl->GetEndPoint( x, y ); - pblock->SetValue( kBmpDetailStopSize, t, (int)( x * 100.f ) ); - pblock->SetValue( kBmpDetailStopOpac, t, (int)( y * 100.f ) ); + pb->SetValue(kBmpClipW, t, 1.0f-u); + if (pb->GetMap()) + pb->GetMap()->Invalidate(kBmpClipW); } - - map->UpdateUI( t ); - fSettingDetailValues = false; + break; } - return 0; - - case WM_COMMAND: - if( HIWORD( wParam ) == EN_CHANGE && LOWORD( wParam ) == IDC_EXPORTWIDTH ) - IClampTexSizeSpinner( t, map, true ); - - else if( HIWORD( wParam ) == EN_CHANGE && LOWORD( wParam ) == IDC_EXPORTHEIGHT ) - IClampTexSizeSpinner( t, map, false ); - - else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_BM_CROP_IMAGE) + case kBmpClipW: { - IParamBlock2 *pblock = map->GetParamBlock(); - PBBitmap *pbbm = pblock->GetBitmap(kBmpBitmap, t); - if (pbbm) + float w = val.f; + float u = pb->GetFloat(kBmpClipU, t); + if (u + w > 1.0f) { - if (!pbbm->bm) - pbbm->bm = TheManager->Load(&pbbm->bi); - - BMCropper *cropper = TRACKED_NEW BMCropper(pblock); - - pbbm->bm->Display("Specify Cropping/Placement", BMM_CN, FALSE, TRUE, cropper); + pb->SetValue(kBmpClipU, t, 1.0f-w); + if (pb->GetMap()) + pb->GetMap()->Invalidate(kBmpClipU); } - // bm->DeleteThis(); - return TRUE; + break; } - else if (HIWORD(wParam) == BN_CLICKED && LOWORD(wParam) == IDC_LAYER_RELOAD) + case kBmpClipV: { - // TEMP - IParamBlock2 *pblock = map->GetParamBlock(); - PBBitmap *pbbm = pblock->GetBitmap(kBmpBitmap, t); - if (pbbm) + float v = val.f; + float h = pb->GetFloat(kBmpClipH, t); + if (v + h > 1.0f) { - plLayerTex *layer = (plLayerTex*)map->GetParamBlock()->GetOwner(); - - layer->RefreshBitmaps(); - - layer->fMtlParams->MtlChanged(); - layer->IChanged(); + pb->SetValue(kBmpClipH, t, 1.0f-v); + if (pb->GetMap()) + pb->GetMap()->Invalidate(kBmpClipH); } - return TRUE; + break; } - else if (LOWORD(wParam) == IDC_LAYER_NAME) + case kBmpClipH: { - plPlasmaMAXLayer *layer = (plPlasmaMAXLayer *)map->GetParamBlock()->GetOwner(); - if (layer == nil) - return FALSE; - BOOL selectedNewBitmap = layer->HandleBitmapSelection(); - - if(selectedNewBitmap) + float h = val.f; + float v = pb->GetFloat(kBmpClipV, t); + if (v + h > 1.0f) { - IParamBlock2 *pblock = map->GetParamBlock(); - //plLayerTex *layer = (plLayerTex*)map->GetParamBlock()->GetOwner(); - - //layer->SetBitmap(&bi); - //layer->IChanged(); - //BitmapInfo *bi = &layer->GetPBBitmap()->bi; - - bmSelectBtn = GetICustButton(GetDlgItem(hWnd,IDC_LAYER_NAME)); - PBBitmap *pbbm = layer->GetPBBitmap(); - bmSelectBtn->SetText(pbbm != nil ? (TCHAR*)pbbm->bi.Filename() : ""); - ReleaseICustButton(bmSelectBtn); - - if (pbbm != nil) + pb->SetValue(kBmpClipV, t, 1.0f-h); + if (pb->GetMap()) + pb->GetMap()->Invalidate(kBmpClipV); + } + break; + } + + case kBmpDetailStartSize: + case kBmpDetailStopSize: + case kBmpDetailStartOpac: + case kBmpDetailStopOpac: + if( pb != NULL ) + { + if( IIsProcSettingDetailValues( pb ) ) + break; // Ignore, since we're the ones setting 'em + + HWND dlg = pb->GetMap()->GetHWnd(); + plDetailCurveCtrl *ctrl = GET_DETAIL_CURVE_CTRL( dlg, IDC_DETAIL_CURVE_CTRL ); + if( ctrl != NULL ) { - // Init values for clamping spinners to powers of 2 - int width = IFloorPow2( pbbm->bi.Width() ); - map->SetRange( kBmpExportWidth, 4.f, (float)width ); - - int height = IFloorPow2( pbbm->bi.Height() ); - map->SetRange( kBmpExportHeight, 4.f, (float)height ); - - if( width > 512 ) - { - height = (int)( 512.f * (float)( (float)height / (float)width ) ); - width = 512; - } - else if( height > 512 ) - { - width = (int)( 512.f * (float)( (float)width / (float)height ) ); - height = 512; - } - pblock->SetValue( kBmpExportWidth, t, width ); - pblock->SetValue( kBmpExportLastWidth, t, width ); - pblock->SetValue( kBmpExportHeight, t, height ); - pblock->SetValue( kBmpExportLastHeight, t, height ); - - IClampTexSizeSpinner( t, map, true ); - } - return TRUE; + if( id == kBmpDetailStartSize || id == kBmpDetailStartOpac ) + ctrl->SetStartPoint( (float)pb->GetInt( kBmpDetailStartSize, t ) / 100.f, + (float)pb->GetInt( kBmpDetailStartOpac, t ) / 100.f ); + else + ctrl->SetEndPoint( (float)pb->GetInt( kBmpDetailStopSize, t ) / 100.f, + (float)pb->GetInt( kBmpDetailStopOpac, t ) / 100.f ); + } + + // Make sure start is less than end + if( id == kBmpDetailStartSize ) + { + int end = pb->GetInt( kBmpDetailStopSize, t ); + if( val.i > end ) + pb->SetValue( kBmpDetailStopSize, t, val.i ); + } + else if( id == kBmpDetailStopSize ) + { + int start = pb->GetInt( kBmpDetailStartSize, t ); + if( val.i < start ) + pb->SetValue( kBmpDetailStartSize, t, val.i ); + } + } - else + break; + + case kBmpUseDetail: + if( pb != NULL ) { - return FALSE; + HWND dlg = pb->GetMap()->GetHWnd(); + EnableWindow( GetDlgItem( dlg, IDC_DETAIL_CURVE_CTRL ), (BOOL)val.i ); } - } - break; + break; } - - return FALSE; } - void DeleteThis() {}; - - void ISetDetailCurveNumLevels( IParamMap2 *map, TimeValue t ) + void Get(PB2Value& v, ReferenceMaker* owner, ParamID id, int tabIndex, TimeValue t, Interval &valid) { - /// Set the level count on the detail control - plDetailCurveCtrl *ctrl = GET_DETAIL_CURVE_CTRL( map->GetHWnd(), IDC_DETAIL_CURVE_CTRL ); - if( ctrl != NULL ) - { - IParamBlock2 *pblock = map->GetParamBlock(); - int w = pblock->GetInt( kBmpExportWidth, t ); - int h = pblock->GetInt( kBmpExportHeight, t ); - int numLevels = 0; - while( w > 1 && h > 1 ) - { - w >>= 1; - h >>= 1; - numLevels++; - } - ctrl->SetNumLevels( numLevels ); - } } - - /// Clamp texture sizes to a power of 2 - void IClampTexSizeSpinner( TimeValue t, IParamMap2 *map, bool clampWidth ) + + // Gotta love hacks.... + bool IIsProcSettingDetailValues( IParamBlock2 *pb ); + +}; + +static BMTexPBAccessor bmtex_accessor; + + +//========================================================================================= +// BMCropper +//========================================================================================= + +void BMCropper::SetValues(float u, float v, float w, float h, BOOL md) +{ + TimeValue t = GetCOREInterface()->GetTime(); + + if (u != fPBlock->GetFloat(kBmpClipU, t)) { - IParamBlock2 *pblock = map->GetParamBlock(); - ParamID clampNew, clampOld; - ParamID otherNew, otherOld; - - if( clampWidth ) - { - clampNew = kBmpExportWidth; clampOld = kBmpExportLastWidth; - otherNew = kBmpExportHeight; otherOld = kBmpExportLastHeight; - } - else - { - clampNew = kBmpExportHeight; clampOld = kBmpExportLastHeight; - otherNew = kBmpExportWidth; otherOld = kBmpExportLastWidth; - } - - int lastVal = pblock->GetInt( clampOld, t ); - int tempVal, newVal = pblock->GetInt( clampNew, t ); - - if( newVal < lastVal ) - { - lastVal = newVal; - for( tempVal = 1; tempVal <= newVal; tempVal <<= 1 ); - newVal = tempVal >> 1; - } - else - { - lastVal = newVal; - for( tempVal = 1; tempVal < newVal; tempVal <<= 1 ); - newVal = tempVal; - } - - pblock->SetValue( clampNew, t, newVal ); - pblock->SetValue( clampOld, t, newVal ); - - // And clamp aspect ratio - PBBitmap *pbbm = pblock->GetBitmap( kBmpBitmap, t ); - - if( pbbm != NULL ) - { - int realWidth = pbbm->bi.Width(); - int realHeight = pbbm->bi.Height(); - - float aspect; - if( clampWidth ) - aspect = (float)realHeight / (float)realWidth; - else - aspect = (float)realWidth / (float)realHeight; - - int value = newVal; - value *= aspect; - - if( value < 4 ) - { - // Can't be below 4! - value = 4; - pblock->SetValue( otherNew, t, value ); - pblock->SetValue( otherOld, t, value ); - value = value / aspect; - pblock->SetValue( clampNew, t, value ); - pblock->SetValue( clampOld, t, value ); - } - else - { - pblock->SetValue( otherNew, t, value ); - pblock->SetValue( otherOld, t, value ); - } - } - - ISetDetailCurveNumLevels( map, t ); + fPBlock->SetValue(kBmpClipU, t, u); + fPBlock->GetMap()->Invalidate(kBmpClipU); } - - int IFloorPow2( int value ) + + if (v != fPBlock->GetFloat(kBmpClipV, t)) { - int v; - - - for( v = 1; v <= value; v <<= 1 ); - return v >> 1; + fPBlock->SetValue(kBmpClipV, t, v); + fPBlock->GetMap()->Invalidate(kBmpClipV); } - -}; -static BitmapDlgProc gBitmapDlgProc; + if (w != fPBlock->GetFloat(kBmpClipW, t)) + { + fPBlock->SetValue(kBmpClipW, t, w); + fPBlock->GetMap()->Invalidate(kBmpClipW); + } + + if (h != fPBlock->GetFloat(kBmpClipH, t)) + { + fPBlock->SetValue(kBmpClipH, t, h); + fPBlock->GetMap()->Invalidate(kBmpClipH); + } + + if (md != fPBlock->GetInt(kBmpCropPlace)) + { + fPBlock->SetValue(kBmpCropPlace, t, md); + fPBlock->GetMap()->Invalidate(kBmpCropPlace); + } +} + +void BMCropper::OnClose() +{ + delete this; +} // Gotta love hacks.... diff --git a/Sources/Tools/MaxPlasmaMtls/Layers/plMAXCameraLayer.cpp b/Sources/Tools/MaxPlasmaMtls/Layers/plMAXCameraLayer.cpp index 3c3fa1ae..c9f42e92 100644 --- a/Sources/Tools/MaxPlasmaMtls/Layers/plMAXCameraLayer.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Layers/plMAXCameraLayer.cpp @@ -68,7 +68,7 @@ public: virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap) { UpdateDisplay(pmap); } - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { int id = LOWORD(wParam); int code = HIWORD(wParam); @@ -103,7 +103,7 @@ public: } return FALSE; } - void DeleteThis() {} + virtual void DeleteThis() {} }; static MAXCameraLayerDlgProc gMAXCameraLayerDlgProc; diff --git a/Sources/Tools/MaxPlasmaMtls/Layers/plStaticEnvLayerBitmapPB.cpp b/Sources/Tools/MaxPlasmaMtls/Layers/plStaticEnvLayerBitmapPB.cpp index e1f74da9..ece09e5a 100644 --- a/Sources/Tools/MaxPlasmaMtls/Layers/plStaticEnvLayerBitmapPB.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Layers/plStaticEnvLayerBitmapPB.cpp @@ -195,7 +195,7 @@ public: } /// Main message proc - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { static ICustButton* bmSelectBtn; long buttons[ 6 ] = { IDC_FRONT_NAME, IDC_BACK_NAME, IDC_LEFT_NAME, IDC_RIGHT_NAME, IDC_TOP_NAME, IDC_BOTTOM_NAME }; @@ -264,7 +264,7 @@ public: return FALSE; } - void DeleteThis() {}; + virtual void DeleteThis() {}; BOOL IDoSelectBaseFilename( IParamMap2 *map, TimeValue t, HWND hWnd ) { diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp b/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp index 773e2b7a..a5f4acd7 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plAnimStealthNode.cpp @@ -83,11 +83,11 @@ protected: HWND fhWnd; public: - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); - void DeleteThis() { IDeleteSegMap(); } + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + virtual void DeleteThis() { IDeleteSegMap(); } void SetThing(ReferenceTarget *m); - void Update( TimeValue t, Interval &valid, IParamMap2 *pmap ); + virtual void Update( TimeValue t, Interval &valid, IParamMap2 *pmap ); protected: // Set all the controls to their stored value diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtlBasicPBDec.h b/Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtlBasicPBDec.h index 8bffa9f0..4ee01142 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtlBasicPBDec.h +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plBumpMtlBasicPBDec.h @@ -28,8 +28,33 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "../resource.h" #include "iparamm2.h" -class BumpBasicDlgProc; -extern BumpBasicDlgProc gBumpBasicDlgProc; +class BumpBasicDlgProc : public ParamMap2UserDlgProc +{ +#if 1 +protected: + +public: + BumpBasicDlgProc() {} + ~BumpBasicDlgProc() { } +#endif + +public: + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + IParamBlock2 *pb = map->GetParamBlock(); + + switch (msg) + { + case WM_INITDIALOG: + { + } + return TRUE; + } + return FALSE; + } + virtual void DeleteThis() {} +}; +static BumpBasicDlgProc gBumpBasicDlgProc; static ParamBlockDesc2 gBumpBasicPB ( @@ -60,33 +85,3 @@ static ParamBlockDesc2 gBumpBasicPB end ); ParamBlockDesc2 *GetBumpBasicPB() { return &gBumpBasicPB; } - -class BumpBasicDlgProc : public ParamMap2UserDlgProc -{ -#if 1 -protected: - -public: - BumpBasicDlgProc() {} - ~BumpBasicDlgProc() { } -#endif - -public: - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) - { - IParamBlock2 *pb = map->GetParamBlock(); - - switch (msg) - { - case WM_INITDIALOG: - { - } - return TRUE; - } - return FALSE; - } - void DeleteThis() {} -}; -static BumpBasicDlgProc gBumpBasicDlgProc; - - diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plClothingMtlPBDec.h b/Sources/Tools/MaxPlasmaMtls/Materials/plClothingMtlPBDec.h index 4366d7eb..fd692a82 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plClothingMtlPBDec.h +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plClothingMtlPBDec.h @@ -121,87 +121,6 @@ public: } }; -class ClothingBasicDlgProc; -extern ClothingBasicDlgProc gClothingBasicDlgProc; - -static ParamBlockDesc2 gClothingMtlPB -( - plClothingMtl::kBlkBasic, _T("Clothing"), IDS_PASS_BASIC, GetClothingMtlDesc(), - P_AUTO_CONSTRUCT + P_AUTO_UI + P_CALLSETS_ON_LOAD, plClothingMtl::kRefBasic, - - // UI - IDD_CLOTHING, IDS_PASS_BASIC, 0, 0, &gClothingBasicDlgProc, - - plClothingMtl::kTileset, _T("tileset"), TYPE_INT, 0, 0, - p_default, 0, - end, - - plClothingMtl::kTexmap, _T("texmap"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, - end, - - plClothingMtl::kDescription, _T("ItemDescription"), TYPE_STRING, 0, 0, - p_ui, TYPE_EDITBOX, IDC_CLOTHING_DESCRIPTION, - end, - - plClothingMtl::kThumbnail, _T("Thumbnail"), TYPE_TEXMAP, 0, 0, - end, - - plClothingMtl::kLayer, _T("Layer"), TYPE_INT, 0, 0, - p_default, plClothingElement::kLayerTint1, - end, - - plClothingMtl::kTexmapSkin, _T("SkinLayer"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, - end, - - plClothingMtl::kTexmap2, _T("TintLayer2"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, - end, - - plClothingMtl::kDefault, _T("Default"), TYPE_BOOL, 0, 0, - p_ui, TYPE_SINGLECHEKBOX, IDC_CLOTHING_DEFAULT, - p_default, 0, - end, - - plClothingMtl::kCustomTextSpecs, _T("TextSpecs"), TYPE_STRING, 0, 0, - end, - - plClothingMtl::kTexmapBase, _T("BaseLayer"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, - end, - - plClothingMtl::kTexmapSkinBlend1, _T("SkinBlend(1)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, - end, - - plClothingMtl::kTexmapSkinBlend2, _T("SkinBlend(2)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, - end, - - plClothingMtl::kTexmapSkinBlend3, _T("SkinBlend(3)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, - end, - - plClothingMtl::kTexmapSkinBlend4, _T("SkinBlend(4)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, - end, - - plClothingMtl::kTexmapSkinBlend5, _T("SkinBlend(5)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, - end, - - plClothingMtl::kTexmapSkinBlend6, _T("SkinBlend(6)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, - end, - - plClothingMtl::kDefaultTint1, _T("DefaultTint1"), TYPE_RGBA, 0, 0, - p_ui, TYPE_COLORSWATCH, IDC_CLOTHING_TINT1, - p_default, Color(1,1,1), - end, - - plClothingMtl::kDefaultTint2, _T("DefaultTint2"), TYPE_RGBA, 0, 0, - p_ui, TYPE_COLORSWATCH, IDC_CLOTHING_TINT2, - p_default, Color(1,1,1), - end, - - plClothingMtl::kForcedAcc, _T("ForcedAcc"), TYPE_STRING, 0, 0, - p_ui, TYPE_EDITBOX, IDC_CLOTHING_FORCED_ACC, - end, - - end -); - class ClothingBasicDlgProc : public ParamMap2UserDlgProc { protected: @@ -283,7 +202,7 @@ public: virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap) { UpdateDisplay(pmap); } - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { // Check if it is for our edit box if (fCustomText.ProcessMsg(map, hWnd, msg, wParam, lParam)) @@ -427,6 +346,84 @@ public: return FALSE; } - void DeleteThis() {} + virtual void DeleteThis() {} }; static ClothingBasicDlgProc gClothingBasicDlgProc; + +static ParamBlockDesc2 gClothingMtlPB +( + plClothingMtl::kBlkBasic, _T("Clothing"), IDS_PASS_BASIC, GetClothingMtlDesc(), + P_AUTO_CONSTRUCT + P_AUTO_UI + P_CALLSETS_ON_LOAD, plClothingMtl::kRefBasic, + + // UI + IDD_CLOTHING, IDS_PASS_BASIC, 0, 0, &gClothingBasicDlgProc, + + plClothingMtl::kTileset, _T("tileset"), TYPE_INT, 0, 0, + p_default, 0, + end, + + plClothingMtl::kTexmap, _T("texmap"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, + end, + + plClothingMtl::kDescription, _T("ItemDescription"), TYPE_STRING, 0, 0, + p_ui, TYPE_EDITBOX, IDC_CLOTHING_DESCRIPTION, + end, + + plClothingMtl::kThumbnail, _T("Thumbnail"), TYPE_TEXMAP, 0, 0, + end, + + plClothingMtl::kLayer, _T("Layer"), TYPE_INT, 0, 0, + p_default, plClothingElement::kLayerTint1, + end, + + plClothingMtl::kTexmapSkin, _T("SkinLayer"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, + end, + + plClothingMtl::kTexmap2, _T("TintLayer2"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, + end, + + plClothingMtl::kDefault, _T("Default"), TYPE_BOOL, 0, 0, + p_ui, TYPE_SINGLECHEKBOX, IDC_CLOTHING_DEFAULT, + p_default, 0, + end, + + plClothingMtl::kCustomTextSpecs, _T("TextSpecs"), TYPE_STRING, 0, 0, + end, + + plClothingMtl::kTexmapBase, _T("BaseLayer"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, + end, + + plClothingMtl::kTexmapSkinBlend1, _T("SkinBlend(1)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, + end, + + plClothingMtl::kTexmapSkinBlend2, _T("SkinBlend(2)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, + end, + + plClothingMtl::kTexmapSkinBlend3, _T("SkinBlend(3)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, + end, + + plClothingMtl::kTexmapSkinBlend4, _T("SkinBlend(4)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, + end, + + plClothingMtl::kTexmapSkinBlend5, _T("SkinBlend(5)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, + end, + + plClothingMtl::kTexmapSkinBlend6, _T("SkinBlend(6)"), TYPE_TEXMAP_TAB, plClothingMtl::kMaxTiles, 0, 0, + end, + + plClothingMtl::kDefaultTint1, _T("DefaultTint1"), TYPE_RGBA, 0, 0, + p_ui, TYPE_COLORSWATCH, IDC_CLOTHING_TINT1, + p_default, Color(1,1,1), + end, + + plClothingMtl::kDefaultTint2, _T("DefaultTint2"), TYPE_RGBA, 0, 0, + p_ui, TYPE_COLORSWATCH, IDC_CLOTHING_TINT2, + p_default, Color(1,1,1), + end, + + plClothingMtl::kForcedAcc, _T("ForcedAcc"), TYPE_STRING, 0, 0, + p_ui, TYPE_EDITBOX, IDC_CLOTHING_FORCED_ACC, + end, + + end +); diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtlBasicPBDec.h b/Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtlBasicPBDec.h index b251e9cd..6ce976c5 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtlBasicPBDec.h +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plDecalMtlBasicPBDec.h @@ -31,8 +31,59 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com class DecalBasicPBAccessor; extern DecalBasicPBAccessor basicAccessor; -class DecalBasicDlgProc; -extern DecalBasicDlgProc gDecalBasicDlgProc; +class DecalBasicDlgProc : public ParamMap2UserDlgProc +{ +protected: + HIMAGELIST hLockButtons; + + void LoadLockButtons() + { + static bool loaded = false; + if (loaded) + return; + loaded = true; + + HINSTANCE hInst = hInstance; + hLockButtons = ImageList_Create(16, 15, TRUE, 2, 0); + HBITMAP hBitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_BUTTONS)); + HBITMAP hMask = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_MASKBUTTONS)); + ImageList_Add(hLockButtons, hBitmap, hMask); + DeleteObject(hBitmap); + DeleteObject(hMask); + } + void ISetLock(HWND hButton) + { + LoadLockButtons(); + + ICustButton *iBut = GetICustButton(hButton); + iBut->SetImage(hLockButtons,0,1,0,1,16,15); + iBut->SetType(CBT_CHECK); + ReleaseICustButton(iBut); + } + +public: + DecalBasicDlgProc() : hLockButtons(NULL) {} + ~DecalBasicDlgProc() { if (hLockButtons) ImageList_Destroy(hLockButtons); } + +public: + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + IParamBlock2 *pb = map->GetParamBlock(); + + switch (msg) + { + case WM_INITDIALOG: + { + ISetLock(GetDlgItem(hWnd, IDC_LOCK_AD)); + ISetLock(GetDlgItem(hWnd, IDC_LOCK_COLORS)); + } + return TRUE; + } + return FALSE; + } + virtual void DeleteThis() {} +}; +static DecalBasicDlgProc gDecalBasicDlgProc; static ParamBlockDesc2 gDecalBasicPB ( @@ -178,59 +229,3 @@ public: } }; static DecalBasicPBAccessor basicAccessor; - -class DecalBasicDlgProc : public ParamMap2UserDlgProc -{ -#if 1 -protected: - HIMAGELIST hLockButtons; - - void LoadLockButtons() - { - static bool loaded = false; - if (loaded) - return; - loaded = true; - - HINSTANCE hInst = hInstance; - hLockButtons = ImageList_Create(16, 15, TRUE, 2, 0); - HBITMAP hBitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_BUTTONS)); - HBITMAP hMask = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_MASKBUTTONS)); - ImageList_Add(hLockButtons, hBitmap, hMask); - DeleteObject(hBitmap); - DeleteObject(hMask); - } - void ISetLock(HWND hButton) - { - LoadLockButtons(); - - ICustButton *iBut = GetICustButton(hButton); - iBut->SetImage(hLockButtons,0,1,0,1,16,15); - iBut->SetType(CBT_CHECK); - ReleaseICustButton(iBut); - } - -public: - DecalBasicDlgProc() : hLockButtons(NULL) {} - ~DecalBasicDlgProc() { if (hLockButtons) ImageList_Destroy(hLockButtons); } -#endif - -public: - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) - { - IParamBlock2 *pb = map->GetParamBlock(); - - switch (msg) - { - case WM_INITDIALOG: - { - ISetLock(GetDlgItem(hWnd, IDC_LOCK_AD)); - ISetLock(GetDlgItem(hWnd, IDC_LOCK_COLORS)); - } - return TRUE; - } - return FALSE; - } - void DeleteThis() {} -}; -static DecalBasicDlgProc gDecalBasicDlgProc; diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plParticleMtlPBDec.h b/Sources/Tools/MaxPlasmaMtls/Materials/plParticleMtlPBDec.h index d68a5761..71d3ee19 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plParticleMtlPBDec.h +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plParticleMtlPBDec.h @@ -28,8 +28,87 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com class PartMtlPBAccessor; extern PartMtlPBAccessor partMtl_accessor; -class ParticleBasicDlgProc; -extern ParticleBasicDlgProc gParticleBasicDlgProc; +class ParticleBasicDlgProc : public ParamMap2UserDlgProc +{ +public: + ParticleBasicDlgProc() {} + ~ParticleBasicDlgProc() {} + + void UpdateDisplay(IParamMap2 *pmap) + { + HWND hWnd = pmap->GetHWnd(); + IParamBlock2 *pb = pmap->GetParamBlock(); + HWND cbox = GetDlgItem(hWnd, IDC_PARTICLE_NORMAL); + plPlasmaMAXLayer *layer = (plPlasmaMAXLayer *)pb->GetTexmap(ParamID(plParticleMtl::kTexmap)); + PBBitmap *pbbm; + ICustButton *bmSelectBtn; + + SendMessage(cbox, CB_SETCURSEL, pb->GetInt(plParticleMtl::kNormal), 0); + pbbm = (layer == nil ? nil : layer->GetPBBitmap()); + + bmSelectBtn = GetICustButton(GetDlgItem(hWnd,IDC_PARTICLE_TEXTURE)); + bmSelectBtn->SetText(pbbm ? (TCHAR*)pbbm->bi.Filename() : "(none)"); + ReleaseICustButton(bmSelectBtn); + } + + virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap) { UpdateDisplay(pmap); } + + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + int id = LOWORD(wParam); + int code = HIWORD(wParam); + + IParamBlock2 *pb = map->GetParamBlock(); + HWND cbox = NULL; + plPlasmaMAXLayer *layer = (plPlasmaMAXLayer *)pb->GetTexmap(ParamID(plParticleMtl::kTexmap)); + + switch (msg) + { + case WM_INITDIALOG: + int j; + for (j = 0; j < plParticleMtl::kNumNormalOptions; j++) + { + cbox = GetDlgItem(hWnd, IDC_PARTICLE_NORMAL); + SendMessage(cbox, CB_ADDSTRING, 0, (LPARAM)plParticleMtl::NormalStrings[j]); + } + UpdateDisplay(map); + return TRUE; + + case WM_COMMAND: + if (id == IDC_PARTICLE_NORMAL) + { + pb->SetValue(plParticleMtl::kNormal, t, SendMessage(GetDlgItem(hWnd, id), CB_GETCURSEL, 0, 0)); + return TRUE; + } + else if (id == IDC_PARTICLE_TEXTURE) + { + if (layer == nil) + return FALSE; + layer->HandleBitmapSelection(); + UpdateDisplay(map); + return TRUE; + } + else if (id == IDC_PARTICLE_NOFILTER) + { + if (!layer) + return FALSE; + if( pb->GetInt(plParticleMtl::kNoFilter) ) + { + layer->GetParamBlockByID( plLayerTex::kBlkBitmap )->SetValue(kBmpNoFilter, t, 1); + } + else + { + layer->GetParamBlockByID( plLayerTex::kBlkBitmap )->SetValue(kBmpNoFilter, t, 0); + } + return TRUE; + } + break; + } + return FALSE; + } + virtual void DeleteThis() {} +}; +static ParticleBasicDlgProc gParticleBasicDlgProc; #define PL_PARTICLE_MTL_MIN_TILES 1 #define PL_PARTICLE_MTL_MAX_TILES 16 @@ -149,86 +228,3 @@ public: } }; static PartMtlPBAccessor partMtl_accessor; - - -class ParticleBasicDlgProc : public ParamMap2UserDlgProc -{ -public: - ParticleBasicDlgProc() {} - ~ParticleBasicDlgProc() {} - - void UpdateDisplay(IParamMap2 *pmap) - { - HWND hWnd = pmap->GetHWnd(); - IParamBlock2 *pb = pmap->GetParamBlock(); - HWND cbox = GetDlgItem(hWnd, IDC_PARTICLE_NORMAL); - plPlasmaMAXLayer *layer = (plPlasmaMAXLayer *)pb->GetTexmap(ParamID(plParticleMtl::kTexmap)); - PBBitmap *pbbm; - ICustButton *bmSelectBtn; - - SendMessage(cbox, CB_SETCURSEL, pb->GetInt(plParticleMtl::kNormal), 0); - pbbm = (layer == nil ? nil : layer->GetPBBitmap()); - - bmSelectBtn = GetICustButton(GetDlgItem(hWnd,IDC_PARTICLE_TEXTURE)); - bmSelectBtn->SetText(pbbm ? (TCHAR*)pbbm->bi.Filename() : "(none)"); - ReleaseICustButton(bmSelectBtn); - } - - virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap) { UpdateDisplay(pmap); } - - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) - { - int id = LOWORD(wParam); - int code = HIWORD(wParam); - - IParamBlock2 *pb = map->GetParamBlock(); - HWND cbox = NULL; - plPlasmaMAXLayer *layer = (plPlasmaMAXLayer *)pb->GetTexmap(ParamID(plParticleMtl::kTexmap)); - - switch (msg) - { - case WM_INITDIALOG: - int j; - for (j = 0; j < plParticleMtl::kNumNormalOptions; j++) - { - cbox = GetDlgItem(hWnd, IDC_PARTICLE_NORMAL); - SendMessage(cbox, CB_ADDSTRING, 0, (LPARAM)plParticleMtl::NormalStrings[j]); - } - UpdateDisplay(map); - return TRUE; - - case WM_COMMAND: - if (id == IDC_PARTICLE_NORMAL) - { - pb->SetValue(plParticleMtl::kNormal, t, SendMessage(GetDlgItem(hWnd, id), CB_GETCURSEL, 0, 0)); - return TRUE; - } - else if (id == IDC_PARTICLE_TEXTURE) - { - if (layer == nil) - return FALSE; - layer->HandleBitmapSelection(); - UpdateDisplay(map); - return TRUE; - } - else if (id == IDC_PARTICLE_NOFILTER) - { - if (!layer) - return FALSE; - if( pb->GetInt(plParticleMtl::kNoFilter) ) - { - layer->GetParamBlockByID( plLayerTex::kBlkBitmap )->SetValue(kBmpNoFilter, t, 1); - } - else - { - layer->GetParamBlockByID( plLayerTex::kBlkBitmap )->SetValue(kBmpNoFilter, t, 0); - } - return TRUE; - } - break; - } - return FALSE; - } - void DeleteThis() {} -}; -static ParticleBasicDlgProc gParticleBasicDlgProc; diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plPassAnimDlgProc.h b/Sources/Tools/MaxPlasmaMtls/Materials/plPassAnimDlgProc.h index a7c6356a..f9488c46 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plPassAnimDlgProc.h +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plPassAnimDlgProc.h @@ -59,9 +59,9 @@ class plPassAnimDlgProc : public ParamMap2UserDlgProc, public plMtlChangeCallbac plPassAnimDlgProc(); virtual ~plPassAnimDlgProc(); - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); - void DeleteThis() {} - void SetThing(ReferenceTarget *m); + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam); + virtual void DeleteThis() {} + virtual void SetThing(ReferenceTarget *m); virtual void Update(TimeValue t, Interval& valid, IParamMap2* pmap); void SegmentListChanged( void ); diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlAnimPB.h b/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlAnimPB.h index 97776538..9e474bc6 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlAnimPB.h +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlAnimPB.h @@ -42,7 +42,7 @@ protected: } public: - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { @@ -79,7 +79,7 @@ public: return FALSE; } - void DeleteThis() {} + virtual void DeleteThis() {} }; #endif \ No newline at end of file diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBase.cpp b/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBase.cpp index 06685796..48dab1cc 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBase.cpp +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBase.cpp @@ -391,8 +391,10 @@ RefTargetHandle plPassMtlBase::GetReference( int i ) { if( i >= kRefNotetracks && i < kRefNotetracks + fNotetracks.GetCount() ) return fNotetracks[ i - kRefNotetracks ]; + else + hsAssert(false, "shit"); - return NULL; + return nil; } //// SetReference //////////////////////////////////////////////////////////// diff --git a/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBasicPBDec.h b/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBasicPBDec.h index f7493c3f..fe4c34a3 100644 --- a/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBasicPBDec.h +++ b/Sources/Tools/MaxPlasmaMtls/Materials/plPassMtlBasicPBDec.h @@ -31,8 +31,60 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com class PassBasicPBAccessor; extern PassBasicPBAccessor basicAccessor; -class PassBasicDlgProc; -extern PassBasicDlgProc gPassBasicDlgProc; +class PassBasicDlgProc : public ParamMap2UserDlgProc +{ +protected: + HIMAGELIST hLockButtons; + + void LoadLockButtons() + { + static bool loaded = false; + if (loaded) + return; + loaded = true; + + HINSTANCE hInst = hInstance; + hLockButtons = ImageList_Create(16, 15, TRUE, 2, 0); + HBITMAP hBitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_BUTTONS)); + HBITMAP hMask = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_MASKBUTTONS)); + ImageList_Add(hLockButtons, hBitmap, hMask); + DeleteObject(hBitmap); + DeleteObject(hMask); + } + void ISetLock(HWND hButton) + { + LoadLockButtons(); + + ICustButton *iBut = GetICustButton(hButton); + iBut->SetImage(hLockButtons,0,1,0,1,16,15); + iBut->SetType(CBT_CHECK); + ReleaseICustButton(iBut); + } + + +public: + PassBasicDlgProc() : hLockButtons(NULL) {} + ~PassBasicDlgProc() { if (hLockButtons) ImageList_Destroy(hLockButtons); } + + virtual BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) + { + IParamBlock2 *pb = map->GetParamBlock(); + + switch (msg) + { + case WM_INITDIALOG: + { + ISetLock(GetDlgItem(hWnd, IDC_LOCK_AD)); + ISetLock(GetDlgItem(hWnd, IDC_LOCK_COLORS)); + } + return TRUE; + } + return FALSE; + } + + virtual void DeleteThis() {} +}; +static PassBasicDlgProc gPassBasicDlgProc; static ParamBlockDesc2 gPassBasicPB ( @@ -179,62 +231,3 @@ public: } }; static PassBasicPBAccessor basicAccessor; - -class PassBasicDlgProc : public ParamMap2UserDlgProc -{ -#if 1 -protected: - HIMAGELIST hLockButtons; - - void LoadLockButtons() - { - static bool loaded = false; - if (loaded) - return; - loaded = true; - - HINSTANCE hInst = hInstance; - hLockButtons = ImageList_Create(16, 15, TRUE, 2, 0); - HBITMAP hBitmap = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_BUTTONS)); - HBITMAP hMask = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_MASKBUTTONS)); - ImageList_Add(hLockButtons, hBitmap, hMask); - DeleteObject(hBitmap); - DeleteObject(hMask); - } - void ISetLock(HWND hButton) - { - LoadLockButtons(); - - ICustButton *iBut = GetICustButton(hButton); - iBut->SetImage(hLockButtons,0,1,0,1,16,15); - iBut->SetType(CBT_CHECK); - ReleaseICustButton(iBut); - } - - -public: - PassBasicDlgProc() : hLockButtons(NULL) {} - ~PassBasicDlgProc() { if (hLockButtons) ImageList_Destroy(hLockButtons); } -#endif - -public: - BOOL DlgProc(TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) - { - IParamBlock2 *pb = map->GetParamBlock(); - - switch (msg) - { - case WM_INITDIALOG: - { - ISetLock(GetDlgItem(hWnd, IDC_LOCK_AD)); - ISetLock(GetDlgItem(hWnd, IDC_LOCK_COLORS)); - } - return TRUE; - } - return FALSE; - } - void DeleteThis() {} -}; -static PassBasicDlgProc gPassBasicDlgProc; - - diff --git a/Sources/Tools/MaxPlasmaMtls/MaxPlasmaMtls.rc b/Sources/Tools/MaxPlasmaMtls/MaxPlasmaMtls.rc index 5f520a97..e5fe2837 100644 --- a/Sources/Tools/MaxPlasmaMtls/MaxPlasmaMtls.rc +++ b/Sources/Tools/MaxPlasmaMtls/MaxPlasmaMtls.rc @@ -2,15 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -1051,7 +1045,6 @@ END 2 TEXTINCLUDE BEGIN - "#include ""afxres.h""\r\n" "\0" END diff --git a/Sources/Tools/Migration/Migration.rc b/Sources/Tools/Migration/Migration.rc index 297a9b0b..1c630d3b 100644 --- a/Sources/Tools/Migration/Migration.rc +++ b/Sources/Tools/Migration/Migration.rc @@ -2,18 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#define APSTUDIO_HIDDEN_SYMBOLS -#include "windows.h" -#undef APSTUDIO_HIDDEN_SYMBOLS -#include "resource.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -42,10 +33,6 @@ IDI_SMALL ICON DISCARDABLE "SMALL.ICO" 2 TEXTINCLUDE DISCARDABLE BEGIN - "#define APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""windows.h""\r\n" - "#undef APSTUDIO_HIDDEN_SYMBOLS\r\n" - "#include ""resource.h""\r\n" "\0" END diff --git a/Sources/Tools/plFontConverter/res/plFontConverter.rc b/Sources/Tools/plFontConverter/res/plFontConverter.rc index 7c9b8b6b..a47b2de3 100644 --- a/Sources/Tools/plFontConverter/res/plFontConverter.rc +++ b/Sources/Tools/plFontConverter/res/plFontConverter.rc @@ -2,15 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -43,7 +37,6 @@ END 2 TEXTINCLUDE DISCARDABLE BEGIN - "#include ""afxres.h""\r\n" "\0" END diff --git a/Sources/Tools/plResBrowser/res/plResBrowser.rc b/Sources/Tools/plResBrowser/res/plResBrowser.rc index 055b9063..f63d2146 100644 --- a/Sources/Tools/plResBrowser/res/plResBrowser.rc +++ b/Sources/Tools/plResBrowser/res/plResBrowser.rc @@ -2,15 +2,9 @@ // #include "resource.h" -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "afxres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS +#define WIN32_LEAN_AND_MEAN +#include +#define IDC_STATIC (-1) // all static controls ///////////////////////////////////////////////////////////////////////////// // English (U.S.) resources @@ -48,7 +42,6 @@ END 2 TEXTINCLUDE BEGIN - "#include ""afxres.h""\r\n" "\0" END diff --git a/cmake/FindPhysX.cmake b/cmake/FindPhysX.cmake index 6233e23e..1a5949b8 100644 --- a/cmake/FindPhysX.cmake +++ b/cmake/FindPhysX.cmake @@ -4,6 +4,14 @@ elseif(PHYSX_SDK_PATH AND PHYSX_LOADER_LIBRARY) set(PHYSX_FIND_QUIETLY TRUE) endif() + +#This isn't quite right, but we'll assume they are all at the same place. +find_path(PHYSX_SDK_PATH Cooking/Include/NxCooking.h + /usr/local/include + /usr/include + PATH_SUFFIXES "PhysX/v2.7.3/SDKs" +) + if(PHYSX_SDK_PATH) set(PHYSX_FOUNDATION_INCLUDE_DIR "${PHYSX_SDK_PATH}/Foundation/include") set(PHYSX_COOKING_INCLUDE_DIR "${PHYSX_SDK_PATH}/Cooking/include") @@ -24,15 +32,22 @@ if(PHYSX_SDK_PATH) ) endif() -#TODO: Make find paths work for Linux builds too +#2.7.3 is the earliest version that can be downloaded from nVidia's archive. find_library(PHYSX_COOKING_LIBRARY NAMES NxCooking - PATHS "${PHYSX_SDK_PATH}/lib/win32") + PATH_SUFFIXES "PhysX/v2.7.3" + PATHS "${PHYSX_SDK_PATH}/lib/win32" +) find_library(PHYSX_CHARACTER_LIBRARY NAMES NxCharacter - PATHS "${PHYSX_SDK_PATH}/lib/win32") + PATH_SUFFIXES "PhysX/v2.7.3" + PATHS "${PHYSX_SDK_PATH}/lib/win32" +) find_library(PHYSX_EXTENSIONS_LIBRARY NAMES NxExtensions - PATHS "${PHYSX_SDK_PATH}/lib/win32") + PATH_SUFFIXES "PhysX/v2.7.3" + PATHS "${PHYSX_SDK_PATH}/lib/win32" +) find_library(PHYSX_LOADER_LIBRARY NAMES PhysXLoader - PATHS "${PHYSX_SDK_PATH}/lib/win32") + PATHS "${PHYSX_SDK_PATH}/lib/win32" +) set(PHYSX_LIBRARIES ${PHYSX_COOKING_LIBRARY} diff --git a/cmake/FindSpeex.cmake b/cmake/FindSpeex.cmake index 18577d84..2a5b92c0 100644 --- a/cmake/FindSpeex.cmake +++ b/cmake/FindSpeex.cmake @@ -3,7 +3,8 @@ if(Speex_INCLUDE_DIR AND Speex_LIBRARY) endif() -find_path(Speex_INCLUDE_DIR speex.h +#It would be a good idea to eventually use pkgconfig here. +find_path(Speex_INCLUDE_DIR speex/speex.h /usr/local/include /usr/include ) @@ -25,6 +26,11 @@ if (Speex_FOUND) endif() else() if(Speex_FIND_REQUIRED) - message(FATAL_ERROR "Could not find speex") + if(NOT Speex_LIBRARIES) + message(FATAL_ERROR "Could not find speex libraries") + endif() + if(NOT Speex_INCLUDE_DIR) + message(FATAL_ERROR "Could not find speex includes") + endif() endif() endif()