diff --git a/Sources/Plasma/Apps/plClient/plClient.cpp b/Sources/Plasma/Apps/plClient/plClient.cpp index 7a90dc88..553bd4e8 100644 --- a/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/Sources/Plasma/Apps/plClient/plClient.cpp @@ -2251,8 +2251,6 @@ void plClient::IDetectAudioVideoSettings() if(rec->GetG3DHALorHEL() == hsG3DDeviceSelector::kHHD3DRefDev) refDevice = true; - plPipeline::fDefaultPipeParams.Width = hsG3DDeviceSelector::kDefaultWidth; - plPipeline::fDefaultPipeParams.Height = hsG3DDeviceSelector::kDefaultHeight; plPipeline::fDefaultPipeParams.ColorDepth = hsG3DDeviceSelector::kDefaultDepth; #if defined(HS_DEBUGGING) || defined(DEBUG) plPipeline::fDefaultPipeParams.Windowed = true; @@ -2260,6 +2258,18 @@ void plClient::IDetectAudioVideoSettings() plPipeline::fDefaultPipeParams.Windowed = false; #endif + // Use current desktop resolution for fullscreen mode + if(!plPipeline::fDefaultPipeParams.Windowed) + { + plPipeline::fDefaultPipeParams.Width = GetSystemMetrics(SM_CXSCREEN); + plPipeline::fDefaultPipeParams.Height = GetSystemMetrics(SM_CYSCREEN); + } + else + { + plPipeline::fDefaultPipeParams.Width = hsG3DDeviceSelector::kDefaultWidth; + plPipeline::fDefaultPipeParams.Height = hsG3DDeviceSelector::kDefaultHeight; + } + plPipeline::fDefaultPipeParams.Shadows = 0; // enable shadows if TnL is available, meaning not an intel extreme. if(rec->GetG3DHALorHEL() == hsG3DDeviceSelector::kHHD3DTnLHalDev) diff --git a/Sources/Plasma/Apps/plClientPatcher/CMakeLists.txt b/Sources/Plasma/Apps/plClientPatcher/CMakeLists.txt index 21e3d82e..7e99acda 100644 --- a/Sources/Plasma/Apps/plClientPatcher/CMakeLists.txt +++ b/Sources/Plasma/Apps/plClientPatcher/CMakeLists.txt @@ -18,6 +18,7 @@ set(plClientPatcher_SOURCES ) add_library(plClientPatcher STATIC ${plClientPatcher_HEADERS} ${plClientPatcher_SOURCES}) +target_link_libraries(plClientPatcher CoreLib plAudioCore) source_group("Header Files" FILES ${plClientPatcher_HEADERS}) source_group("Source Files" FILES ${plClientPatcher_SOURCES}) diff --git a/Sources/Plasma/CoreLib/HeadSpin.h b/Sources/Plasma/CoreLib/HeadSpin.h index 0405e223..8c91e1dd 100644 --- a/Sources/Plasma/CoreLib/HeadSpin.h +++ b/Sources/Plasma/CoreLib/HeadSpin.h @@ -48,8 +48,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // Internal Headers // These are only ever included here :) -#include "hsWindows.h" #include "hsTypes.h" +#include "hsWindows.h" #include "hsUtils.h" #endif diff --git a/Sources/Plasma/CoreLib/hsTypes.h b/Sources/Plasma/CoreLib/hsTypes.h index 961cdd28..ed2ec9f9 100644 --- a/Sources/Plasma/CoreLib/hsTypes.h +++ b/Sources/Plasma/CoreLib/hsTypes.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include #include +#include /************************** Basic Macros *****************************/ diff --git a/Sources/Plasma/CoreLib/hsUtils.h b/Sources/Plasma/CoreLib/hsUtils.h index 000e010e..b213687b 100644 --- a/Sources/Plasma/CoreLib/hsUtils.h +++ b/Sources/Plasma/CoreLib/hsUtils.h @@ -46,7 +46,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _HSUTILS_H #include "HeadSpin.h" -#include +#include +#include #include int hsStrlen(const char src[]); @@ -163,6 +164,8 @@ inline hsBool hsCompare(float a, float b, float delta=0.0001); # define hsSnwprintf swprintf # define hsWFopen(name, mode) fopen(hsWStringToString(name), hsWStringToString(mode)) + +# define MAX_PATH 1024 #endif // Useful floating point utilities diff --git a/Sources/Plasma/CoreLib/hsWindows.h b/Sources/Plasma/CoreLib/hsWindows.h index 1fcbd83f..b683c73c 100644 --- a/Sources/Plasma/CoreLib/hsWindows.h +++ b/Sources/Plasma/CoreLib/hsWindows.h @@ -58,6 +58,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com # pragma warning( disable : 4305 4503 4018 4786 4284 4800) # endif // _MSC_VER + // Terrible hacks for MinGW because they don't have a reasonable + // default for the Windows version. We cheat and say it's XP. +# ifdef __MINGW32__ +# undef _WIN32_WINNT +# define _WIN32_WINNT 0x501 +# undef _WIN32_IE +# define _WIN32_IE 0x400 +# endif + // Windows.h includes winsock.h (winsocks 1), so we need to manually include winsock2 // and tell Windows.h to only bring in modern headers # ifndef MAXPLUGINCODE @@ -65,9 +74,28 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com # include # endif // MAXPLUGINCODE # define WIN32_LEAN_AND_MEAN +# ifndef NOMINMAX +# define NOMINMAX // Needed to prevent NxMath conflicts +# endif # include typedef HWND hsWindowHndl; + typedef HINSTANCE hsWindowInst; #else typedef int32_t* hsWindowHndl; + typedef int32_t* hsWindowInst; #endif // HS_BUILD_FOR_WIN32 + +/**************************************************************************** +* +* max/min inline functions +* +***/ + +#ifdef max +#undef max +#endif + +#ifdef min +#undef min +#endif diff --git a/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp b/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp index 38d00c63..75a72a25 100644 --- a/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp +++ b/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp @@ -977,7 +977,7 @@ plCameraBrain1_Avatar::~plCameraBrain1_Avatar() pMsg->SetFadeOut(false); pMsg->SetSubjectKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); pMsg->SetBCastFlag(plMessage::kBCastByExactType); - pMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); + pMsg->SetBCastFlag(plMessage::kNetPropagate, false); pMsg->AddReceiver(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); plgDispatch::MsgSend(pMsg); } @@ -1152,7 +1152,7 @@ void plCameraBrain1_Avatar::ISendFadeMsg(hsBool fade) pMsg->SetFadeOut(fade); pMsg->SetSubjectKey(GetSubject()->GetKey()); pMsg->SetBCastFlag(plMessage::kBCastByExactType); - pMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); + pMsg->SetBCastFlag(plMessage::kNetPropagate, false); pMsg->AddReceiver(GetSubject()->GetKey()); plgDispatch::MsgSend(pMsg); } diff --git a/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp b/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp index 32febf18..5e1257c4 100644 --- a/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp +++ b/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp @@ -189,7 +189,7 @@ plVirtualCam1::plVirtualCam1() wchar_t fileAndPath[MAX_PATH]; PathGetLogDirectory(fileAndPath, arrsize(fileAndPath)); PathAddFilename(fileAndPath, fileAndPath, L"camLog.txt", arrsize(fileAndPath)); - foutLog = _wfopen( fileAndPath, L"wt" ); + foutLog = hsWFopen( fileAndPath, L"wt" ); } #endif @@ -1306,7 +1306,7 @@ hsBool plVirtualCam1::MsgReceive(plMessage* msg) pMsg->SetFadeOut(true); pMsg->SetSubjectKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); pMsg->SetBCastFlag(plMessage::kBCastByExactType); - pMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); + pMsg->SetBCastFlag(plMessage::kNetPropagate, false); pMsg->AddReceiver(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); plgDispatch::MsgSend(pMsg); return true; diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp index 0e7159d3..c029c919 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp @@ -45,6 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // ////////////////////////////////////////////////////////////////////////////// +#include "pfPython/cyPythonInterface.h" + #include "HeadSpin.h" #include "pfConsole.h" #include "pfConsoleCore/pfConsoleEngine.h" @@ -62,7 +64,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plgDispatch.h" #include "plPipeline.h" -#include "pfPython/cyPythonInterface.h" #include "plNetClient/plNetClientMgr.h" #ifndef PLASMA_EXTERNAL_RELEASE @@ -225,7 +226,6 @@ void pfConsole::Init( pfConsoleEngine *engine ) fWorkingCursor = 0; memset( fHistory, 0, sizeof( fHistory ) ); - fHistoryCursor = fHistoryRecallCursor = 0; fEffectCounter = 0; fMode = 0; @@ -540,8 +540,9 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg ) static hsBool findAgain = false; static uint32_t findCounter = 0; - - if( !msg->GetKeyDown() ) + // filter out keyUps and ascii control characters + // as the control functions are handled on the keyDown event + if( !msg->GetKeyDown() || (msg->GetKeyChar() > '\0' && msg->GetKeyChar() < ' ')) return; if( msg->GetKeyCode() == KEY_ESCAPE ) @@ -625,11 +626,11 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg ) } else if( msg->GetKeyCode() == KEY_UP ) { - i = ( fHistoryRecallCursor > 0 ) ? fHistoryRecallCursor - 1 : kNumHistoryItems - 1; - if( fHistory[ i ][ 0 ] != 0 ) + i = ( fHistory[ fPythonMode ].fRecallCursor > 0 ) ? fHistory[ fPythonMode ].fRecallCursor - 1 : kNumHistoryItems - 1; + if( fHistory[ fPythonMode ].fData[ i ][ 0 ] != 0 ) { - fHistoryRecallCursor = i; - strcpy( fWorkingLine, fHistory[ fHistoryRecallCursor ] ); + fHistory[ fPythonMode ].fRecallCursor = i; + strcpy( fWorkingLine, fHistory[ fPythonMode ].fData[ fHistory[ fPythonMode ].fRecallCursor ] ); findAgain = false; findCounter = 0; fWorkingCursor = strlen( fWorkingLine ); @@ -638,18 +639,18 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg ) } else if( msg->GetKeyCode() == KEY_DOWN ) { - if( fHistoryRecallCursor != fHistoryCursor ) + if( fHistory[ fPythonMode ].fRecallCursor != fHistory[ fPythonMode ].fCursor ) { - i = ( fHistoryRecallCursor < kNumHistoryItems - 1 ) ? fHistoryRecallCursor + 1 : 0; - if( i != fHistoryCursor ) + i = ( fHistory[ fPythonMode ].fRecallCursor < kNumHistoryItems - 1 ) ? fHistory[ fPythonMode ].fRecallCursor + 1 : 0; + if( i != fHistory[ fPythonMode ].fCursor ) { - fHistoryRecallCursor = i; - strcpy( fWorkingLine, fHistory[ fHistoryRecallCursor ] ); + fHistory[ fPythonMode ].fRecallCursor = i; + strcpy( fWorkingLine, fHistory[ fPythonMode ].fData[ fHistory[ fPythonMode ].fRecallCursor ] ); } else { memset( fWorkingLine, 0, sizeof( fWorkingLine ) ); - fHistoryRecallCursor = fHistoryCursor; + fHistory[ fPythonMode ].fRecallCursor = fHistory[ fPythonMode ].fCursor; } findAgain = false; findCounter = 0; @@ -725,9 +726,9 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg ) if( fWorkingLine[ 0 ] != 0 ) { // Save to history - strcpy( fHistory[ fHistoryCursor ], fWorkingLine ); - fHistoryCursor = ( fHistoryCursor < kNumHistoryItems - 1 ) ? fHistoryCursor + 1 : 0; - fHistoryRecallCursor = fHistoryCursor; + strcpy( fHistory[ fPythonMode ].fData[ fHistory[ fPythonMode ].fCursor ], fWorkingLine ); + fHistory[ fPythonMode ].fCursor = ( fHistory[ fPythonMode ].fCursor < kNumHistoryItems - 1 ) ? fHistory[ fPythonMode ].fCursor + 1 : 0; + fHistory[ fPythonMode ].fRecallCursor = fHistory[ fPythonMode ].fCursor; } // EXECUTE!!! (warning: DESTROYS fWorkingLine) @@ -771,10 +772,10 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg ) for ( i=fPythonMultiLines; i>0 ; i--) { // reach back in the history and find this line and paste it in here - int recall = fHistoryCursor - i; + int recall = fHistory[ fPythonMode ].fCursor - i; if ( recall < 0 ) recall += kNumHistoryItems; - strcat(biglines,fHistory[ recall ]); + strcat(biglines,fHistory[ fPythonMode ].fData[ recall ]); strcat(biglines,"\n"); } // now evaluate this mess they made @@ -873,7 +874,7 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg ) } } // or are they just typing in a working line - else if( fWorkingCursor < kMaxCharsWide - 2 && key != 0 ) + else if( strlen( fWorkingLine ) < kMaxCharsWide - 2 && key != 0 ) { for( i = strlen( fWorkingLine ) + 1; i > fWorkingCursor; i-- ) fWorkingLine[ i ] = fWorkingLine[ i - 1 ]; @@ -1141,7 +1142,7 @@ void pfConsole::Draw( plPipeline *p ) strcpy( tmp, "]" ); drawText.DrawString( 10, y, tmp, 255, 255, 255, 255 ); - i = 10 + drawText.CalcStringWidth( tmp ) + 4; + i = 19 + drawText.CalcStringWidth( tmp ); drawText.DrawString( i, y, fWorkingLine, fConsoleTextColor ); if( fCursorTicks >= 0 ) @@ -1214,7 +1215,7 @@ void pfConsole::AddLineF(const char * fmt, ...) { char str[1024]; va_list args; va_start(args, fmt); - _vsnprintf(str, arrsize(str), fmt, args); + hsVsnprintf(str, arrsize(str), fmt, args); va_end(args); AddLine(str); } diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.h b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.h index c1e9803d..867d4708 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.h +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.h @@ -76,6 +76,7 @@ class pfConsole : public hsKeyedObject enum Konstants { kNumHistoryItems = 16, + kNumHistoryTypes = 2, kModeHidden = 0, kModeSingleLine = 1, kModeFull = 2, @@ -100,8 +101,10 @@ class pfConsole : public hsKeyedObject short fCursorTicks; uint32_t fMsgTimeoutTimer; - char fHistory[ kNumHistoryItems ][ kMaxCharsWide ]; - uint32_t fHistoryCursor, fHistoryRecallCursor; + struct _fHistory { + char fData[ kNumHistoryItems ][ kMaxCharsWide ]; + uint32_t fCursor, fRecallCursor; + } fHistory[ kNumHistoryTypes ]; char *fDisplayBuffer; char fWorkingLine[ kWorkingLineSize ]; uint32_t fWorkingCursor; @@ -114,7 +117,7 @@ class pfConsole : public hsKeyedObject static uint32_t fConsoleTextColor; static pfConsole *fTheConsole; - static void _cdecl IAddLineCallback( const char *string ); + static void CDECL IAddLineCallback( const char *string ); static plPipeline *fPipeline; diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp index 0499522d..1515f42a 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp @@ -49,6 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define LIMIT_CONSOLE_COMMANDS 1 #endif +#include "pfPython/cyPythonInterface.h" +#include "pfPython/plPythonSDLModifier.h" #include "pfConsoleCore/pfConsoleCmd.h" #include "plgDispatch.h" @@ -163,10 +165,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" #include "hsTemplates.h" - -#include "pfPython/cyPythonInterface.h" -#include "pfPython/plPythonSDLModifier.h" - #include "plResMgr/plResManagerHelper.h" #include "plResMgr/plResMgrSettings.h" #include "plResMgr/plLocalization.h" @@ -2466,11 +2464,10 @@ PF_CONSOLE_CMD( App, // groupName "", // paramList "Quit the client app" ) // helpString { - if( plClient::GetInstance() ) - PostMessage(plClient::GetInstance()->GetWindowHandle(), - WM_SYSCOMMAND, - SC_CLOSE, - 0); + if( plClient::GetInstance() ) { + plClientMsg* msg = new plClientMsg(plClientMsg::kQuit); + msg->Send(hsgResMgr::ResMgr()->FindKey(kClient_KEY)); + } } #ifndef LIMIT_CONSOLE_COMMANDS @@ -2510,8 +2507,12 @@ PF_CONSOLE_CMD(App, "", "Set low priority for this process") { +#if HS_BUILD_FOR_WIN32 SetPriorityClass( GetCurrentProcess(), IDLE_PRIORITY_CLASS ); PrintString( "Set process priority to lowest setting" ); +#else + PrintString("Not implemented on your platform!"); +#endif } @@ -3932,6 +3933,8 @@ PF_CONSOLE_CMD( Nav, PageInNodeList, // Group name, Function name "string roomNameBase", // Params "Pages in all scene nodes that start with name." ) // Help string { +/* This is really old and hasn't worked since 2002 anyways. */ +#if HS_BUILD_FOR_WIN32 plSynchEnabler ps(false); // disable dirty tracking while paging in std::string pageInNodesStr; @@ -3949,6 +3952,7 @@ PF_CONSOLE_CMD( Nav, PageInNodeList, // Group name, Function name } pMsg1->AddReceiver( plClient::GetInstance()->GetKey() ); plgDispatch::MsgSend(pMsg1); +#endif } #ifndef LIMIT_CONSOLE_COMMANDS diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp index 3a96e8b3..14cee051 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif +#include "pfPython/plPythonSDLModifier.h" #include "pfConsoleCore/pfConsoleCmd.h" #include "plgDispatch.h" @@ -355,7 +356,8 @@ PF_CONSOLE_CMD( Net, // groupName link.GetAgeInfo()->SetAgeFilename( params[0] ); //link.GetAgeInfo()->SetAgeInstanceName( params[0] ); //link.GetAgeInfo()->SetAgeUserDefinedName( params[0] ); - link.GetAgeInfo()->SetAgeInstanceGuid( &plUUID( params[1] ) ); + plUUID guid(params[1]); + link.GetAgeInfo()->SetAgeInstanceGuid( &guid ); link.SetLinkingRules( plNetCommon::LinkingRules::kBasicLink ); plNetLinkingMgr::GetInstance()->LinkToAge( &link ); PrintString("Linking to age..."); @@ -637,7 +639,6 @@ PF_CONSOLE_CMD( Net_DebugObject, // groupName plNetObjectDebugger::GetInstance()->ClearAllDebugObjects(); } -#include "pfPython/plPythonSDLModifier.h" PF_CONSOLE_CMD( Net_DebugObject, // groupName DumpAgeSDLHook, // fxnName "bool dirtyOnly", // paramList @@ -810,7 +811,8 @@ PF_CONSOLE_CMD( Net_Vault, plAgeLinkStruct link; link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeInstanceName( params[0] ); - link.GetAgeInfo()->SetAgeInstanceGuid( &plUUID(GuidGenerate())); + plUUID guid(GuidGenerate()); + link.GetAgeInfo()->SetAgeInstanceGuid( &guid); link.SetSpawnPoint( kDefaultSpawnPoint ); bool success = VaultRegisterOwnedAgeAndWait(&link); PrintStringF(PrintString, "Operation %s.", success ? "Successful" : "Failed"); @@ -837,7 +839,8 @@ PF_CONSOLE_CMD( Net_Vault, plAgeLinkStruct link; link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeInstanceName( params[0] ); - link.GetAgeInfo()->SetAgeInstanceGuid( &plUUID(GuidGenerate())); + plUUID guid(GuidGenerate()); + link.GetAgeInfo()->SetAgeInstanceGuid( &guid); link.SetSpawnPoint( kDefaultSpawnPoint ); bool success = VaultRegisterOwnedAgeAndWait(&link); PrintStringF(PrintString, "Operation %s.", success ? "Successful" : "Failed"); diff --git a/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp b/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp index 10bc1176..f7c9b6a0 100644 --- a/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp +++ b/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp @@ -1841,7 +1841,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & } else if( lastParChunk != nil ) { - uint32_t count = ((uint32_t)c - (uint32_t)start)/2; // wchar_t is 2 bytes + uint32_t count = ((uintptr_t)c - (uintptr_t)start)/2; // wchar_t is 2 bytes wchar_t *temp = new wchar_t[ count + 1 ]; wcsncpy( temp, start, count ); @@ -1901,7 +1901,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & } else if( wcsicmp( name, L"link" ) == 0 ) { - chunk->fEventID = _wtoi( option ); + chunk->fEventID = wcstol(option, NULL, 0); chunk->fFlags |= pfEsHTMLChunk::kCanLink; } else if( wcsicmp( name, L"blend" ) == 0 ) @@ -1917,10 +1917,10 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & if( comma != nil ) { - chunk->fAbsoluteY = _wtoi( comma + 1 ); + chunk->fAbsoluteY = wcstol(comma + 1, NULL, 0); *comma = 0; } - chunk->fAbsoluteX = _wtoi( option ); + chunk->fAbsoluteX = wcstol(option, NULL, 0); } else if( wcsicmp( name, L"glow" ) == 0 ) { @@ -1961,7 +1961,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & wchar_t *comma2 = wcschr( comma + 1, L',' ); if( comma2 != nil ) { - if( _wtoi( comma2 + 1 ) != 0 ) + if( wcstol(comma2 + 1, NULL, 0) != 0 ) chunk->fFlags |= pfEsHTMLChunk::kChecked; *comma2 = 0; } @@ -2089,7 +2089,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & } else if( wcsicmp( name, L"size" ) == 0 ) { - chunk->fFontSize = _wtoi( option ); + chunk->fFontSize = wcstol(option, NULL, 0); if (fBookGUIs[fCurBookGUI]->IsEditable()) { fBookGUIs[fCurBookGUI]->GetEditCtrl(pfJournalDlgProc::kTagRightEditCtrl)->SetFontSize(chunk->fFontSize); @@ -2112,7 +2112,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & } else if( wcsicmp( name, L"spacing" ) == 0 ) { - chunk->fLineSpacing = _wtoi(option); + chunk->fLineSpacing = wcstol(option, NULL, 0); chunk->fFlags |= pfEsHTMLChunk::kFontSpacing; } } @@ -2127,13 +2127,13 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & while(IGetNextOption(c,name,option)) { if (wcsicmp(name,L"top") == 0) - fPageTMargin = _wtoi(option); + fPageTMargin = wcstol(option, NULL, 0); else if (wcsicmp(name,L"left") == 0) - fPageLMargin = _wtoi(option); + fPageLMargin = wcstol(option, NULL, 0); else if (wcsicmp(name,L"bottom") == 0) - fPageBMargin = _wtoi(option); + fPageBMargin = wcstol(option, NULL, 0); else if (wcsicmp(name,L"right") == 0) - fPageRMargin = _wtoi(option); + fPageRMargin = wcstol(option, NULL, 0); } // set the edit controls to the margins we just set if (fBookGUIs[fCurBookGUI]->IsEditable()) @@ -2203,10 +2203,10 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & if( comma != nil ) { - chunk->fAbsoluteY = _wtoi( comma + 1 ); + chunk->fAbsoluteY = wcstol(comma + 1, NULL, 0); *comma = 0; } - chunk->fAbsoluteX = _wtoi( option ); + chunk->fAbsoluteX = wcstol(option, NULL, 0); } else if (wcsicmp(name,L"resize")==0) { @@ -2251,7 +2251,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & } else if( wcsicmp( name, L"link" ) == 0 ) { - chunk->fEventID = _wtoi( option ); + chunk->fEventID = wcstol(option, NULL, 0); chunk->fFlags |= pfEsHTMLChunk::kCanLink; } else if( wcsicmp( name, L"pos" ) == 0 ) @@ -2262,10 +2262,10 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & if( comma != nil ) { - chunk->fAbsoluteY = _wtoi( comma + 1 ); + chunk->fAbsoluteY = wcstol(comma + 1, NULL, 0); *comma = 0; } - chunk->fAbsoluteX = _wtoi( option ); + chunk->fAbsoluteX = wcstol(option, NULL, 0); } else if (wcsicmp(name,L"resize")==0) { @@ -2336,7 +2336,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & } else if( lastParChunk != nil ) { - uint32_t count = (uint32_t)c - (uint32_t)start; + uint32_t count = (uintptr_t)c - (uintptr_t)start; wchar_t *temp = new wchar_t[ count + 1 ]; wcsncpy( temp, start, count + 1 ); @@ -2422,7 +2422,7 @@ hsBool pfJournalBook::IGetNextOption( const wchar_t *&string, wchar_t *name, wc return false; // Copy name - uint32_t len = ((uint32_t)string - (uint32_t)c)/2; // divide length by 2 because each character is two bytes + uint32_t len = ((uintptr_t)string - (uintptr_t)c)/2; // divide length by 2 because each character is two bytes wcsncpy( name, c, len ); name[len] = L'\0'; @@ -2442,7 +2442,7 @@ hsBool pfJournalBook::IGetNextOption( const wchar_t *&string, wchar_t *name, wc while( *string != L'>' && *string != L'\"' && *string != L'\0' ) string++; - len = ((uint32_t)string - (uint32_t)c)/2; // divide length by 2 because each character is two bytes + len = ((uintptr_t)string - (uintptr_t)c)/2; // divide length by 2 because each character is two bytes wcsncpy( option, c, len ); option[len] = L'\0'; @@ -2457,7 +2457,7 @@ hsBool pfJournalBook::IGetNextOption( const wchar_t *&string, wchar_t *name, wc while( *string != L' ' && *string != L'>' && *string != L'\0' ) string++; - len = ((uint32_t)string - (uint32_t)c)/2; // divide length by 2 because each character is two bytes + len = ((uintptr_t)string - (uintptr_t)c)/2; // divide length by 2 because each character is two bytes wcsncpy( option, c, len ); option[len] = L'\0'; diff --git a/Sources/Plasma/FeatureLib/pfMessage/pfMessageCreatable.h b/Sources/Plasma/FeatureLib/pfMessage/pfMessageCreatable.h index 293da492..945d6adc 100644 --- a/Sources/Plasma/FeatureLib/pfMessage/pfMessageCreatable.h +++ b/Sources/Plasma/FeatureLib/pfMessage/pfMessageCreatable.h @@ -99,4 +99,4 @@ REGISTER_CREATABLE(pfBackdoorMsg); REGISTER_CREATABLE(pfMovieEventMsg); -#endif pfMessageCreatable_inc +#endif //pfMessageCreatable_inc diff --git a/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt index c005002c..b390708f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt @@ -38,6 +38,7 @@ set(pfPython_SOURCES pyEnum.cpp pyGameScore.cpp pyGeometry3.cpp + pyGlueHelpers.cpp pyGrassShader.cpp pyGUIControl.cpp pyGUIControlButton.cpp diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h index 71769008..0ca9484a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for the BlueSpiral game client // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsg.h index 78f27f17..fc992b51 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for BlueSpiral game messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h index 02b34c95..0ce90a89 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for the climbing wall game client // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsg.h index 85636b4e..5b111d9f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for ClimbingWall game messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h index c028b320..ebd6073c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h @@ -49,9 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper for the Heek game client // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h index 1515f1b2..f87cc1d1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for Heek game messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h index 1490855b..2f02005f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for the Marker game client // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h index 1515d6eb..8671dbb5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for Marker game messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h index afe04552..40653dc7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for the TTT game client // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsg.h index efb716e7..2f512fca 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for TTT game messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h index 4776d560..a5b25fc3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for the VarSync game client // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h index 98537e8b..8c173e48 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for VarSync game messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h index 1fef769f..51d53684 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h @@ -49,9 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper for the game client base class // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../pyGlueHelpers.h" #include "../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.cpp index f1571571..c840e939 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.cpp @@ -42,11 +42,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGameCliMsg.h" #include "pyGameCli.h" -#include "TicTacToe\pyTTTMsg.h" -#include "Heek\pyHeekMsg.h" -#include "Marker\pyMarkerMsg.h" -#include "BlueSpiral\pyBlueSpiralMsg.h" -#include "ClimbingWall\pyClimbingWallMsg.h" +#include "TicTacToe/pyTTTMsg.h" +#include "Heek/pyHeekMsg.h" +#include "Marker/pyMarkerMsg.h" +#include "BlueSpiral/pyBlueSpiralMsg.h" +#include "ClimbingWall/pyClimbingWallMsg.h" #include "VarSync/pyVarSyncMsg.h" /////////////////////////////////////////////////////////////////////////////// @@ -239,4 +239,4 @@ unsigned long pyGameCliOwnerChangeMsg::OwnerID() const return gmMsg->ownerId; } return 0; -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.h index 1793fcb5..4b5ec2ce 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for game client messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../pyGlueHelpers.h" class pyGameCliMsg diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h index 01d45582..5906df9d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h @@ -49,10 +49,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper for game manager messages // +#include #include "hsStlUtils.h" #include "pfGameMgr/pfGameMgr.h" -#include #include "../pyGlueHelpers.h" class pyGameMgrMsg diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp index 71efed9e..56498b9c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp @@ -46,11 +46,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper to map animation functions to plasma2 message // +#include "cyAnimation.h" #include "plgDispatch.h" #include "plMessage/plAnimCmdMsg.h" #include "pnMessage/plEventCallbackMsg.h" -#include "cyAnimation.h" cyAnimation::cyAnimation() { diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h index 9734c39c..d0ce9fb5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper to map animation functions to plasma2 message // +#include #include "pyKey.h" #include "hsTemplates.h" -#include #include "pyGlueHelpers.h" class cyAnimation diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp index c57afce5..fa475e89 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp @@ -118,7 +118,8 @@ void cyAvatar::SetNetForce(hsBool state) void cyAvatar::SetSenderKey(pyKey& pKey) { - SetSender(pKey.getKey()); + plKey k = pKey.getKey(); + SetSender(k); } diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h index 21281c0b..db666f3d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h @@ -48,12 +48,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper to map animation functions to plasma2 message // +#include #include "hsStlUtils.h" #include "hsTemplates.h" #include "hsBitVector.h" #include "pnKeyedObject/plKey.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp index 20a30ec9..498424a0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp @@ -801,10 +801,10 @@ PYTHON_CLASS_NEW_IMPL(ptAvatar, cyAvatar) static PyObject* New(PyObject* sender, PyObject* recvr = nil) { ptAvatar* newObj = (ptAvatar*)ptAvatar_type.tp_new(&ptAvatar_type, NULL, NULL); - pyKey* senderKey = pyKey::ConvertFrom(sender); - pyKey* recvrKey = pyKey::ConvertFrom(recvr); - newObj->fThis->SetSender(senderKey->getKey()); - newObj->fThis->AddRecvr(recvrKey->getKey()); + plKey senderKey = pyKey::ConvertFrom(sender)->getKey(); + plKey recvrKey = pyKey::ConvertFrom(recvr)->getKey(); + newObj->fThis->SetSender(senderKey); + newObj->fThis->AddRecvr(recvrKey); newObj->fThis->SetNetForce(false); return (PyObject*) newObj; } diff --git a/Sources/Plasma/FeatureLib/pfPython/cyCamera.h b/Sources/Plasma/FeatureLib/pfPython/cyCamera.h index 209429ad..6c438c4e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyCamera.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyCamera.h @@ -48,12 +48,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper to map camera functions to plasma2 message // +#include #include "HeadSpin.h" #include "pnKeyedObject/plKey.h" class pyKey; -#include #include "pyGlueHelpers.h" class cyCamera diff --git a/Sources/Plasma/FeatureLib/pfPython/cyDraw.h b/Sources/Plasma/FeatureLib/pfPython/cyDraw.h index 55373719..fb0dfb4f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyDraw.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyDraw.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper to map draw functions to plasma2 message // +#include #include "hsTemplates.h" #include "pnKeyedObject/plKey.h" -#include #include "pyGlueHelpers.h" class cyDraw diff --git a/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp index 5422222e..93daa9a4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp @@ -97,13 +97,13 @@ PyObject *cyDraw::New(PyObject *sender, PyObject *recvr) ptDraw *newObj = (ptDraw*)ptDraw_type.tp_new(&ptDraw_type, NULL, NULL); if (sender != NULL) { - pyKey *senderKey = pyKey::ConvertFrom(sender); - newObj->fThis->SetSender(senderKey->getKey()); + plKey senderKey = pyKey::ConvertFrom(sender)->getKey(); + newObj->fThis->SetSender(senderKey); } if (recvr != NULL) { - pyKey *recvrKey = pyKey::ConvertFrom(recvr); - newObj->fThis->AddRecvr(recvrKey->getKey()); + plKey recvrKey = pyKey::ConvertFrom(recvr)->getKey(); + newObj->fThis->AddRecvr(recvrKey); } newObj->fThis->fNetForce = false; @@ -122,4 +122,4 @@ void cyDraw::AddPlasmaClasses(PyObject *m) PYTHON_CLASS_IMPORT_START(m); PYTHON_CLASS_IMPORT(m, ptDraw); PYTHON_CLASS_IMPORT_END(m); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp index 0b3ff593..9d5ed431 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp @@ -39,10 +39,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ -#include "HeadSpin.h" -#include "cyInputInterface.h" - #include +#include "cyInputInterface.h" +#include "HeadSpin.h" // glue functions PYTHON_CLASS_DEFINITION(ptInputInterface, cyInputInterface); @@ -80,4 +79,4 @@ void cyInputInterface::AddPlasmaClasses(PyObject *m) PYTHON_CLASS_IMPORT_START(m); PYTHON_CLASS_IMPORT(m, ptInputInterface); PYTHON_CLASS_IMPORT_END(m); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp index 378aabf5..84509e15 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp @@ -1317,7 +1317,8 @@ void cyMisc::SetPrivateChatList(const std::vector & tolist) for (int i=0 ; iGetClientList()->Append(tolist[i]->GetPlayerID()); - pMsg->SetRemovedKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); + plKey k = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + pMsg->SetRemovedKey(k); pMsg->Send(); } } @@ -1334,7 +1335,8 @@ void cyMisc::SetPrivateChatList(const std::vector & tolist) void cyMisc::ClearPrivateChatList(pyKey& member) { plNetVoiceListMsg* pMsg = new plNetVoiceListMsg(plNetVoiceListMsg::kDistanceMode); - pMsg->SetRemovedKey( member.getKey() ); + plKey k = member.getKey(); + pMsg->SetRemovedKey(k); pMsg->Send(); } @@ -1548,7 +1550,7 @@ void cyMisc::EnableAvatarCursorFade() plIfaceFadeAvatarMsg* iMsg = new plIfaceFadeAvatarMsg; iMsg->SetSubjectKey(nmgr->GetLocalPlayerKey()); iMsg->SetBCastFlag(plMessage::kBCastByExactType); - iMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); + iMsg->SetBCastFlag(plMessage::kNetPropagate, false); iMsg->Enable(); iMsg->Send(); } @@ -1562,7 +1564,7 @@ void cyMisc::DisableAvatarCursorFade() plIfaceFadeAvatarMsg* iMsg = new plIfaceFadeAvatarMsg; iMsg->SetSubjectKey(nmgr->GetLocalPlayerKey()); iMsg->SetBCastFlag(plMessage::kBCastByExactType); - iMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); + iMsg->SetBCastFlag(plMessage::kNetPropagate, false); iMsg->Disable(); iMsg->Send(); } @@ -1577,7 +1579,7 @@ void cyMisc::FadeLocalPlayer(hsBool fade) pMsg->SetFadeOut(fade); pMsg->SetSubjectKey(nmgr->GetLocalPlayerKey()); pMsg->SetBCastFlag(plMessage::kBCastByExactType); - pMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); + pMsg->SetBCastFlag(plMessage::kNetPropagate, false); pMsg->AddReceiver(nmgr->GetLocalPlayerKey()); plgDispatch::MsgSend(pMsg); } @@ -1659,7 +1661,8 @@ void cyMisc::ToggleAvatarClickability(hsBool on) pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kGUIEnableAvatarClickable); else pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kGUIDisableAvatarClickable); - pMsg->SetAvKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); + plKey k = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + pMsg->SetAvKey(k); pMsg->SetBCastFlag(plMessage::kNetPropagate); pMsg->SetBCastFlag(plMessage::kNetForce); pMsg->Send(); @@ -1669,7 +1672,8 @@ void cyMisc::ToggleAvatarClickability(hsBool on) void cyMisc::SetShareSpawnPoint(const char* spawnPoint) { plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kSetShareSpawnPoint); - pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); + plKey k = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + pMsg->SetSender(k); pMsg->SetSpawnPoint(spawnPoint); pMsg->Send(); } @@ -1677,7 +1681,8 @@ void cyMisc::SetShareSpawnPoint(const char* spawnPoint) void cyMisc::SetShareAgeInstanceGuid(const Uuid& guid) { plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kSetShareAgeInstanceGuid); - pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); + plKey k = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + pMsg->SetSender(k); pMsg->SetAgeInstanceGuid(guid); pMsg->Send(); } @@ -2425,7 +2430,7 @@ int cyMisc::GetKILevel() StrToUnicode(wStr, pfKIMsg::kChronicleKILevel, arrsize(wStr)); if (RelVaultNode * rvn = VaultFindChronicleEntryIncRef(wStr)) { VaultChronicleNode chron(rvn); - result = _wtoi(chron.entryValue); + result = wcstol(chron.entryValue, nil, 0); rvn->DecRef(); } diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp index 348931cc..34bc8efa 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp @@ -39,6 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include #include "cyMisc.h" #include "pyGlueHelpers.h" #include "pyKey.h" @@ -47,11 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyEnum.h" // for enums -#include "plNetCommon\plNetCommon.h" -#include "plResMgr\plLocalization.h" -#include "plMessage\plLOSRequestMsg.h" +#include "plNetCommon/plNetCommon.h" +#include "plResMgr/plLocalization.h" +#include "plMessage/plLOSRequestMsg.h" -#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/cyParticleSys.h b/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h index 4065a6a2..60f3a7f7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h @@ -48,12 +48,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper to for Particle System // +#include #include "hsTemplates.h" #include "pnKeyedObject/plKey.h" class pyKey; -#include #include "pyGlueHelpers.h" class cyParticleSys diff --git a/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp index 16ce0fe5..de65bbc9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp @@ -120,13 +120,13 @@ PyObject *cyParticleSys::New(PyObject *sender, PyObject *recvr) ptParticle *newObj = (ptParticle*)ptParticle_type.tp_new(&ptParticle_type, NULL, NULL); if (sender != NULL) { - pyKey *senderKey = pyKey::ConvertFrom(sender); - newObj->fThis->SetSender(senderKey->getKey()); + plKey senderKey = pyKey::ConvertFrom(sender)->getKey(); + newObj->fThis->SetSender(senderKey); } if (recvr != NULL) { - pyKey *recvrKey = pyKey::ConvertFrom(recvr); - newObj->fThis->AddRecvr(recvrKey->getKey()); + plKey recvrKey = pyKey::ConvertFrom(recvr)->getKey(); + newObj->fThis->AddRecvr(recvrKey); } newObj->fThis->SetNetForce(false); return (PyObject*)newObj; diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h b/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h index b1e61a16..c953ee63 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper to map animation functions to plasma2 message // +#include #include "hsTemplates.h" #include "pnKeyedObject/plKey.h" -#include #include "pyGlueHelpers.h" class pyPoint3; diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp index 905a96d1..ac0b7f0c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp @@ -396,13 +396,13 @@ PyObject *cyPhysics::New(PyObject *sender, PyObject *recvr) ptPhysics *newObj = (ptPhysics*)ptPhysics_type.tp_new(&ptPhysics_type, NULL, NULL); if (sender != NULL) { - pyKey *senderKey = pyKey::ConvertFrom(sender); - newObj->fThis->SetSender(senderKey->getKey()); + plKey senderKey = pyKey::ConvertFrom(sender)->getKey(); + newObj->fThis->SetSender(senderKey); } if (recvr != NULL) { - pyKey *recvrKey = pyKey::ConvertFrom(recvr); - newObj->fThis->AddRecvr(recvrKey->getKey()); + plKey recvrKey = pyKey::ConvertFrom(recvr)->getKey(); + newObj->fThis->AddRecvr(recvrKey); } newObj->fThis->SetNetForce(false); return (PyObject*)newObj; @@ -420,4 +420,4 @@ void cyPhysics::AddPlasmaClasses(PyObject *m) PYTHON_CLASS_IMPORT_START(m); PYTHON_CLASS_IMPORT(m, ptPhysics); PYTHON_CLASS_IMPORT_END(m); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h b/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h index 7078705c..9e16611e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h @@ -46,9 +46,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // NOTE: Eventually, this will be made into a separate dll, because there should // only be one instance of this interface. // +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE) #include "../../Apps/CyPythonIDE/plCyDebug/plCyDebServer.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp index 6d89af14..41ab1ffd 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp @@ -46,6 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // This modifier will handle the interface to python code that has been file-ized. // ////////////////////////////////////////////////////////////////////////// +#include "plPythonFileMod.h" #include "HeadSpin.h" #include "hsStream.h" @@ -97,7 +98,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plProfile.h" -#include "plPythonFileMod.h" #include "cyPythonInterface.h" #include "pyKey.h" #include "cyDraw.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h index dd6512dc..aeeb6f82 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h @@ -49,12 +49,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // This modifier will handle the interface to python code that has been file-ized. // ////////////////////////////////////////////////////////////////////// +#include #include "pnModifier/plMultiModifier.h" #include "hsGeometry3.h" #include "hsResMgr.h" -#include #include "plPythonParameter.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp b/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp index d44cd821..f672fbb4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp @@ -39,9 +39,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include "plPythonPack.h" #include "HeadSpin.h" #include "hsStlUtils.h" -#include "plPythonPack.h" #include "hsStream.h" #include "plFile/hsFiles.h" #include "plFile/plSecureStream.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonPack.h b/Sources/Plasma/FeatureLib/pfPython/plPythonPack.h index b1a98cd5..9a35c547 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonPack.h +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonPack.h @@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plPythonPack_h_inc #define plPythonPack_h_inc -#include "Python.h" +#include #include "HeadSpin.h" namespace PythonPack diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp index e846f49b..058ada79 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp @@ -39,7 +39,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ -#include "HeadSpin.h" #include "plPythonSDLModifier.h" #include "cyPythonInterface.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h index 1181e06a..604d0ae8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h @@ -46,10 +46,12 @@ class plPythonFileMod; class plStateDataRecord; class plSimpleStateVariable; +#include + +#include "HeadSpin.h" #include "hsStlUtils.h" #include "plModifier/plSDLModifier.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp index 4ded3087..7620cdf4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp @@ -39,9 +39,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include "pyAgeInfoStruct.h" #include "hsStlUtils.h" +#include "pnUtils/pnUtCrypt.h" -#include "pyAgeInfoStruct.h" /////////////////////////////////////////////////////////////////////////// @@ -133,8 +134,10 @@ void pyAgeInfoStruct::SetAgeInstanceGuid( const char * guid ) CryptDigest(kCryptMd5, instanceGuid.fData , y.length(), y.c_str()); fAgeInfo.SetAgeInstanceGuid(&instanceGuid); } - else - fAgeInfo.SetAgeInstanceGuid( &plUUID( guid ) ); + else { + plUUID temp(guid); + fAgeInfo.SetAgeInstanceGuid( &temp ); + } } int32_t pyAgeInfoStruct::GetAgeSequenceNumber() const @@ -220,7 +223,8 @@ const char * pyAgeInfoStructRef::GetAgeInstanceGuid() const void pyAgeInfoStructRef::SetAgeInstanceGuid( const char * guid ) { - fAgeInfo.SetAgeInstanceGuid( &plUUID( guid ) ); + plUUID tmp(guid); + fAgeInfo.SetAgeInstanceGuid( &tmp ); } int32_t pyAgeInfoStructRef::GetAgeSequenceNumber() const diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h index cca3fbbb..e7a33887 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h @@ -41,12 +41,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #ifndef pyAgeInfoStruct_h_inc #define pyAgeInfoStruct_h_inc +#include #include "HeadSpin.h" #include "hsStlUtils.h" #include "plNetCommon/plNetServerSessionInfo.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.cpp index 7c18bac1..744a89db 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.cpp @@ -39,9 +39,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include "pyAgeLinkStruct.h" #include "hsStlUtils.h" -#include "pyAgeLinkStruct.h" #include "pySpawnPointInfo.h" /////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h index f21e554d..ca6528c0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h @@ -42,12 +42,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pyAgeLinkStruct_h_inc #define pyAgeLinkStruct_h_inc +#include #include "HeadSpin.h" #include "hsStlUtils.h" #include "plNetCommon/plNetServerSessionInfo.h" #include "pyAgeInfoStruct.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h index d2d40a8a..8560c0fa 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h @@ -51,11 +51,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyAgeVault - a wrapper class to provide interface to the plVaultAgeNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" class pyVaultNode; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAlarm.h b/Sources/Plasma/FeatureLib/pfPython/pyAlarm.h index e0d3a30f..0f86310c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAlarm.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAlarm.h @@ -42,9 +42,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pyAlarm_h_inc #define pyAlarm_h_inc +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include struct pyAlarm; class pyAlarmMgr diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h b/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h index 4a0edf63..382a2851 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h @@ -48,9 +48,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" -#include #include "pyGlueHelpers.h" class pyAudioControl diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue.cpp index 1f7eb058..cca82970 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue.cpp @@ -39,7 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include #include "pyCCRMgr.h" #include "pyAgeLinkStruct.h" -#include diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue2.cpp b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue2.cpp index 52592ada..2dc8cdc8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue2.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue2.cpp @@ -39,6 +39,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include #include "pyCCRMgr.h" -#include diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCluster.h b/Sources/Plasma/FeatureLib/pfPython/pyCluster.h index 9b29be1a..311e82a2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCluster.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyCluster.h @@ -42,9 +42,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pyCluster_h #define pyCluster_h +#include #include "pyKey.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// @@ -79,4 +79,4 @@ public: }; -#endif // pyCluster_h \ No newline at end of file +#endif // pyCluster_h diff --git a/Sources/Plasma/FeatureLib/pfPython/pyColor.h b/Sources/Plasma/FeatureLib/pfPython/pyColor.h index 9b311e85..4452e0c2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyColor.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyColor.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyColor - the wrapper class for hsColorRGBA structure // ////////////////////////////////////////////////////////////////////// +#include #include "hsColorRGBA.h" -#include #include "pyGlueHelpers.h" class pyColor diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h index 8fe5a383..4370a2d6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsGeometry3.h" -#include #include "pyGlueHelpers.h" class plDniCoordinateInfo; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp index a761e26c..4fbd03ca 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp @@ -39,11 +39,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include "pyDniInfoSource.h" #include "pnUtils/pnUtils.h" #include "plUnifiedTime/plUnifiedTime.h" #include "plVault/plAgeInfoSource.h" #include "plVault/plVault.h" -#include "pyDniInfoSource.h" #include "pyDniCoordinates.h" pyDniInfoSource::pyDniInfoSource() diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h index 9fe1881f..e22a31f3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h @@ -41,12 +41,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #ifndef pyDniInfoSource_h_inc #define pyDniInfoSource_h_inc +#include #include "HeadSpin.h" #include "hsStlUtils.h" - -#include #include "pyGlueHelpers.h" class pyDniCoordinates; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h b/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h index 29ce034f..18b535a6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h @@ -47,12 +47,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyDrawControl - a wrapper class all the draw/pipeline control functions // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" class pyDrawControl diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp index 63b48590..3ad7aa99 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp @@ -46,6 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // ////////////////////////////////////////////////////////////////////////////// +#include "pyDynamicText.h" #include "plgDispatch.h" #include "plMessage/plDynamicTextMsg.h" #include "pyKey.h" @@ -54,7 +55,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyImage.h" #include "plGImage/plDynamicTextMap.h" -#include "pyDynamicText.h" pyDynamicText::pyDynamicText() { @@ -154,7 +154,8 @@ void pyDynamicText::ClearToColor( pyColor& color ) plDynamicTextMsg* pMsg = ICreateDTMsg(); if ( pMsg ) { - pMsg->ClearToColor(color.getColor()); + hsColorRGBA col = color.getColor(); + pMsg->ClearToColor(col); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } @@ -193,7 +194,8 @@ void pyDynamicText::SetTextColor2( pyColor& color, bool blockRGB ) plDynamicTextMsg* pMsg = ICreateDTMsg(); if ( pMsg ) { - pMsg->SetTextColor(color.getColor(),blockRGB); + hsColorRGBA col = color.getColor(); + pMsg->SetTextColor(col,blockRGB); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } } @@ -215,7 +217,8 @@ void pyDynamicText::FillRect( uint16_t left, uint16_t top, uint16_t right, uint1 plDynamicTextMsg* pMsg = ICreateDTMsg(); if ( pMsg ) { - pMsg->FillRect(left,top,right,bottom,color.getColor()); + hsColorRGBA col = color.getColor(); + pMsg->FillRect(left,top,right,bottom,col); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } } @@ -226,7 +229,8 @@ void pyDynamicText::FrameRect( uint16_t left, uint16_t top, uint16_t right, uint plDynamicTextMsg* pMsg = ICreateDTMsg(); if ( pMsg ) { - pMsg->FrameRect(left,top,right,bottom,color.getColor()); + hsColorRGBA col = color.getColor(); + pMsg->FrameRect(left,top,right,bottom,col); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } } @@ -311,7 +315,8 @@ void pyDynamicText::DrawImage( uint16_t x, uint16_t y, pyImage& image, hsBool re plDynamicTextMsg* pMsg = ICreateDTMsg(); if ( pMsg ) { - pMsg->DrawImage( x, y, image.GetKey(), respectAlpha); + plKey k = image.GetKey(); + pMsg->DrawImage( x, y, k, respectAlpha); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } } @@ -326,7 +331,8 @@ void pyDynamicText::DrawImageClipped( uint16_t x, uint16_t y, pyImage& image, ui plDynamicTextMsg* pMsg = ICreateDTMsg(); if ( pMsg ) { - pMsg->DrawClippedImage( x, y, image.GetKey(), cx, cy, cw, ch, respectAlpha); + plKey k = image.GetKey(); + pMsg->DrawClippedImage( x, y, k, cx, cy, cw, ch, respectAlpha); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h index 0088f6bb..665f495c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h @@ -53,10 +53,11 @@ class pyKey; class pyColor; class pyImage; +#include #include "hsTemplates.h" #include "hsStlUtils.h" +#include "hsResMgr.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.cpp index 7baee232..543e2457 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.cpp @@ -43,12 +43,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // /////////////////////////////////////////////// +#include "pyGUIControl.h" #include "pfGameGUIMgr/pfGUIControlMod.h" #include "pfGameGUIMgr/pfGUIDialogMod.h" #include "pyKey.h" -#include "pyGUIControl.h" #include "pyGUIDialog.h" #include "pyColor.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h index d2d854d7..36be2c94 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h @@ -49,10 +49,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyGeometry3.h" -#include #include "pyGlueHelpers.h" class pyGUIDialog; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h index 2c504714..c27b9a25 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlButton // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyGeometry3.h" -#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h index 37549191..8e13fa7b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h @@ -49,9 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" -#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h index 6cda66db..c27d0502 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h @@ -49,9 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" -#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h index eaaa0090..89b65d56 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h @@ -49,9 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" -#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h index 2fdecfd6..83c72ff3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlDraggable // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" -#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h index 86afe0b1..a4f9f2f0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlDynamicText // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyGUIControl.h" -#include #include "pyGlueHelpers.h" class pyDynamicText; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h index c3bd31fa..56c6a495 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlEditBox // ////////////////////////////////////////////////////////////////////// +#include #include "hsStlUtils.h" #include "pyKey.h" -#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp index 113480b8..083cbc87 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp @@ -250,7 +250,7 @@ class pfColorListElement : public pfGUIListText { size_t length = wcslen( fString1 ) + wcslen( fString2 ) + 3; thestring = new wchar_t[ length ]; - snwprintf( thestring, length, L"%s %s", fString1, fString2 ); + hsSnwprintf( thestring, length, L"%s %s", fString1, fString2 ); wemade_string = true; } else if (fString1) diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h index 8b8f8d97..ce813ef8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h @@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControl (such as Button, ListBox, etc.) // ////////////////////////////////////////////////////////////////////// +#include #include "hsTemplates.h" @@ -55,7 +56,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "pyGUIControl.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp index 561fa415..8b928671 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp @@ -182,7 +182,7 @@ void pyGUIControlMultiLineEdit::SetEncodedBuffer( PyObject* buffer_object ) { // something to do here... later uint8_t* daBuffer = nil; - int length; + Py_ssize_t length; PyObject_AsReadBuffer( buffer_object, (const void**)&daBuffer, &length); if ( daBuffer != nil ) { @@ -218,7 +218,7 @@ void pyGUIControlMultiLineEdit::SetEncodedBufferW( PyObject* buffer_object ) { // something to do here... later uint16_t* daBuffer = nil; - int length; + Py_ssize_t length; PyObject_AsReadBuffer( buffer_object, (const void**)&daBuffer, &length); if ( daBuffer != nil ) { @@ -392,7 +392,8 @@ void pyGUIControlMultiLineEdit::InsertColor( pyColor& color ) pfGUIMultiLineEditCtrl* pbmod = pfGUIMultiLineEditCtrl::ConvertNoRef(fGCkey->ObjectIsLoaded()); if ( pbmod ) { - pbmod->InsertColor(color.getColor()); + hsColorRGBA col = color.getColor(); + pbmod->InsertColor(col); } } } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h index 1db5213f..d0d2799b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlMultiLineEdit // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyGUIControl.h" -#include #include "pyGlueHelpers.h" class pyColor; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h index a5a6c63f..ed056d5a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlRadioGroup // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyGUIControl.h" -#include #include "pyGlueHelpers.h" class pyGUIControlRadioGroup :public pyGUIControl diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h index 53436613..1efa3f0c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h @@ -48,12 +48,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlTextBox // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyGUIControl.h" #include "pfGameGUIMgr/pfGUIControlMod.h" -#include #include "pyGlueHelpers.h" class pyColor; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h index 5e2689b9..da74181f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h @@ -49,10 +49,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "hsStlUtils.h" #include "pyKey.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp index 82c440dc..749c66d5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp @@ -378,4 +378,4 @@ void pyGUIDialog::AddPlasmaMethods(std::vector &methods) PYTHON_BASIC_GLOBAL_METHOD(methods, PtGUICursorOff); PYTHON_BASIC_GLOBAL_METHOD(methods, PtGUICursorOn); PYTHON_BASIC_GLOBAL_METHOD(methods, PtGUICursorDimmed); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h index 4f453ba5..c2c5e943 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h @@ -49,11 +49,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "pfGameGUIMgr/pfGUIPopUpMenu.h" #include "pyKey.h" -#include #include "pyGlueHelpers.h" class pyColor; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h b/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h index b0112dfc..bf0bca76 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h @@ -49,10 +49,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: a wrapper class to provide access to a game score // +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" struct pfGameScore; @@ -87,4 +87,4 @@ public: bool SetPoints(int numPoints); }; -#endif \ No newline at end of file +#endif diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h b/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h index 92df489b..a7511020 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyGeometry3 - the wrapper class for hsPoint3 and hsVector3 // ////////////////////////////////////////////////////////////////////// +#include #include "hsGeometry3.h" -#include #include "pyGlueHelpers.h" class pyPoint3 diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.cpp new file mode 100644 index 00000000..e6dbf4a9 --- /dev/null +++ b/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.cpp @@ -0,0 +1,63 @@ +/*==LICENSE==* + +CyanWorlds.com Engine - MMOG client, server and tools +Copyright (C) 2011 Cyan Worlds, Inc. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Additional permissions under GNU GPL version 3 section 7 + +If you modify this Program, or any covered work, by linking or +combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, +NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent +JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK +(or a modified version of those libraries), +containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, +PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG +JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the +licensors of this Program grant you additional +permission to convey the resulting work. Corresponding Source for a +non-source form of such a combination shall include the source code for +the parts of OpenSSL and IJG JPEG Library used as well as that of the covered +work. + +You can contact Cyan Worlds, Inc. by email legal@cyan.com + or by snail mail at: + Cyan Worlds, Inc. + 14617 N Newport Hwy + Mead, WA 99021 + +*==LICENSE==*/ + +#include "HeadSpin.h" +#include "pyGlueHelpers.h" + +char* PyString_AsStringEx(PyObject* obj) +{ + if (PyString_Check(obj)) + return hsStrcpy(PyString_AsString(obj)); + else if (PyUnicode_Check(obj)) + { + PyObject* utf8 = PyUnicode_AsUTF8String(obj); + char* buf = hsStrcpy(PyString_AsString(utf8)); + Py_DECREF(utf8); + return buf; + } else + return NULL; // You suck. +} + +bool PyString_CheckEx(PyObject* obj) +{ + return (PyString_Check(obj) || PyUnicode_Check(obj)); +} diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.h b/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.h index 1184c1ce..26cf4d5f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.h @@ -42,6 +42,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef _pyGlueHelpers_h_ #define _pyGlueHelpers_h_ +#include + +// Useful string functions +char* PyString_AsStringEx(PyObject*); +inline bool PyString_CheckEx(PyObject*); + // A set of macros to take at least some of the tediousness out of creating straight python glue code ///////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h b/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h index 195c014f..4a4754c0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h @@ -42,11 +42,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pyGrassShader_h #define pyGrassShader_h +#include #include "hsStlUtils.h" #include "pyKey.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyImage.h b/Sources/Plasma/FeatureLib/pfPython/pyImage.h index f5791847..86e9337f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyImage.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyImage.h @@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper for Python to a plMipMap image // +#include #include "hsStlUtils.h" #include "pyKey.h" @@ -59,7 +60,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plGImage/plMipmap.h" #endif -#include #include "pyGlueHelpers.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h index 5c17b721..d1193e28 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h @@ -48,12 +48,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "hsStlUtils.h" #include "pyKey.h" #include "pyGeometry3.h" -#include #include "pyGlueHelpers.h" class pyImage; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKey.h b/Sources/Plasma/FeatureLib/pfPython/pyKey.h index 43d0e50a..f8c0c4b6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKey.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyKey.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyKey - the wrapper class around a plKey so that Python can handle it // ////////////////////////////////////////////////////////////////////// +#include #include "pnKeyedObject/plKey.h" -#include #include "pyGlueHelpers.h" #include "plString.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h b/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h index b0f295f0..71a56f12 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "pnInputCore/plKeyMap.h" -#include #include "pyGlueHelpers.h" class pyKeyMap diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h index c6e470f7..1ece9214 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyMarkerMgr - a wrapper class to provide interface to the pfMarkerMgr stuff // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" -#include #include "pyGlueHelpers.h" class pyMarkerMgr diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h index 05382273..cfce21e4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h @@ -41,13 +41,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #ifndef pyMatrix44_h_inc #define pyMatrix44_h_inc +#include #include "hsStlUtils.h" #include "hsMatrix44.h" #include "pyGeometry3.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h index 0e6a0faf..af28c7f8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyMoviePlayer - a wrapper class all the movie player functions // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyColor.h" -#include #include "pyGlueHelpers.h" class pyMoviePlayer diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.cpp b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.cpp index 67b227f8..d9e4ec24 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.cpp @@ -44,9 +44,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com # error "pyNetLinkingMgr is not compatible with pyPlasma.pyd. Use BUILDING_PYPLASMA macro to ifdef out unwanted headers." #endif +#include "pyNetLinkingMgr.h" #include "hsStlUtils.h" -#include "pyNetLinkingMgr.h" #include "plNetClient/plNetLinkingMgr.h" #include "plAvatar/plAvatarMgr.h" #include "plAvatar/plArmatureMod.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h index 271f8f72..99d3b467 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h @@ -41,11 +41,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #ifndef pyNetLinkingMgr_h_inc #define pyNetLinkingMgr_h_inc +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h b/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h index 12e8da8e..a1e1b8f2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h @@ -41,12 +41,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #ifndef pyNetServerSessionInfo_h_inc #define pyNetServerSessionInfo_h_inc +#include #include "HeadSpin.h" #include "plNetCommon/plNetServerSessionInfo.h" #include "pnUUID/pnUUID.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp b/Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp index 9352eeaf..a8846251 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp @@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyNotify - a wrapper class to provide interface to send a NotifyMsg // ////////////////////////////////////////////////////////////////////// +#include "pyNotify.h" #include "plgDispatch.h" #include "pnMessage/plNotifyMsg.h" @@ -51,7 +52,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plPythonFileMod.h" #include "pyGeometry3.h" -#include "pyNotify.h" pyNotify::pyNotify() { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNotify.h b/Sources/Plasma/FeatureLib/pfPython/pyNotify.h index 72eb86c7..b02b6ffe 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNotify.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyNotify.h @@ -48,12 +48,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "pnMessage/plNotifyMsg.h" #include "pyKey.h" #include "pyGeometry3.h" -#include #include "pyGlueHelpers.h" class pyNotify diff --git a/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h b/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h index a90c716e..22dad7c2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for Python to the player data // +#include #include "hsStlUtils.h" #include "pyKey.h" -#include #include "pyGlueHelpers.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp index dced2f27..517c43e7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp @@ -63,56 +63,46 @@ PYTHON_INIT_DEFINITION(ptPlayer, args, keywords) PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); PYTHON_RETURN_INIT_ERROR; } - if (pyKey::Check(firstObj)) // arg set 1 + + pyKey* key = NULL; + char* name = NULL; + uint32_t pid = -1; + float distSeq = -1; + + if (pyKey::Check(firstObj)) { - // make sure the remaining objects fit the arg list - if ((!thirdObj) || (!fourthObj)) + key = pyKey::ConvertFrom(firstObj); + if (!(name = PyString_AsStringEx(secondObj))) { - // missing arguments PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); PYTHON_RETURN_INIT_ERROR; } - if ((!PyString_Check(secondObj)) || (!PyLong_Check(thirdObj)) || (!PyFloat_Check(fourthObj))) - { - // incorrect types - PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); - PYTHON_RETURN_INIT_ERROR; - } - // all args are correct, convert and init - pyKey* key = pyKey::ConvertFrom(firstObj); - char* name = PyString_AsString(secondObj); - unsigned long pid = PyLong_AsUnsignedLong(thirdObj); - float distsq = (float)PyFloat_AsDouble(fourthObj); - self->fThis->Init(key->getKey(), name, pid, distsq); - PYTHON_RETURN_INIT_OK; - } - else if (PyString_Check(firstObj)) // arg set 2 - { - // make sure there are only two args - if (thirdObj || fourthObj) + if (!(PyNumber_Check(thirdObj) && PyFloat_Check(fourthObj))) { - // too many arguments + delete[] name; PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); PYTHON_RETURN_INIT_ERROR; } - char* name = PyString_AsString(firstObj); - unsigned long pid = 0; - if (PyLong_Check(secondObj)) - pid = PyLong_AsUnsignedLong(secondObj); - else if (PyInt_Check(secondObj)) - pid = (unsigned long)PyInt_AsLong(secondObj); - else + + pid = PyNumber_AsSsize_t(thirdObj, NULL); + distSeq = (float)PyFloat_AsDouble(fourthObj); + } else if (name = PyString_AsStringEx(firstObj)) { + if (!PyNumber_Check(secondObj) || thirdObj || fourthObj) { - // incorrect type + delete[] name; PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); PYTHON_RETURN_INIT_ERROR; } - self->fThis->Init(nil, name, pid, -1); - PYTHON_RETURN_INIT_OK; + + pid = PyNumber_AsSsize_t(secondObj, NULL); + } else { + PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); + PYTHON_RETURN_INIT_ERROR; } - // some other args came in - PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); - PYTHON_RETURN_INIT_ERROR; + + self->fThis->Init(key, name, pid, distSeq); + delete[] name; + PYTHON_RETURN_INIT_OK; } PYTHON_RICH_COMPARE_DEFINITION(ptPlayer, obj1, obj2, compareType) diff --git a/Sources/Plasma/FeatureLib/pfPython/pySDL.h b/Sources/Plasma/FeatureLib/pfPython/pySDL.h index 17e1ec49..c27bb919 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySDL.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySDL.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pySDL - python subset of the plSDL library. // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" class plStateDataRecord; diff --git a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp index 46d3e915..0a1fcd42 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp @@ -39,8 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ -#include "HeadSpin.h" // TEMP, for STL warnings #include "pySceneObject.h" +#include "HeadSpin.h" // TEMP, for STL warnings #include "pnKeyedObject/plKey.h" #include "cyAvatar.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h index be6d4f63..b15e4b7f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h @@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a SceneObject // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "cyDraw.h" @@ -57,7 +58,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyScoreMgr.h b/Sources/Plasma/FeatureLib/pfPython/pyScoreMgr.h index 970a24c4..8cafbff0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyScoreMgr.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyScoreMgr.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: a wrapper class to provide an interface to the scoring system // +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" @@ -112,4 +112,4 @@ public: ); }; -#endif \ No newline at end of file +#endif diff --git a/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h b/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h index c12e9d70..88901f86 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h @@ -41,12 +41,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #ifndef pySpawnPointInfo_h_inc #define pySpawnPointInfo_h_inc +#include #include "HeadSpin.h" #include "hsStlUtils.h" #include "plNetCommon/plSpawnPointInfo.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h b/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h index 60b59c4e..390e4ef1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // and interface to the ChatLog (ptChatStatusLog) ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" -#include #include "pyGlueHelpers.h" #include "pyColor.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStream.h b/Sources/Plasma/FeatureLib/pfPython/pyStream.h index 7da64f6d..4845b6ba 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStream.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyStream.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyStream - a wrapper class to provide interface to the File stream stuff // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h index 385ca669..9f06495b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h @@ -42,9 +42,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pySwimCurrentInterface_h #define pySwimCurrentInterface_h +#include #include "pyKey.h" -#include #include "pyGlueHelpers.h" class pySwimCurrentInterface @@ -88,4 +88,4 @@ public: void disable(); }; -#endif \ No newline at end of file +#endif diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp index c944e2d9..1988b4c5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp @@ -575,7 +575,8 @@ void pyVault::UnRegisterVisitAge( const char * guidstr ) Uuid uuid; GuidFromString(guidstr, &uuid); plAgeInfoStruct info; - info.SetAgeInstanceGuid(&plUUID(uuid)); + plUUID guid(uuid); + info.SetAgeInstanceGuid(&guid); VaultUnregisterVisitAgeAndWait(&info); } @@ -583,7 +584,7 @@ void pyVault::UnRegisterVisitAge( const char * guidstr ) void _InvitePlayerToAge(ENetError result, void* state, void* param, RelVaultNode* node) { if (result == kNetSuccess) - VaultSendNode(node, (uint32_t)param); + VaultSendNode(node, (uint32_t)((uintptr_t)param)); } void pyVault::InvitePlayerToAge( const pyAgeLinkStruct & link, uint32_t playerID ) @@ -602,13 +603,14 @@ void pyVault::InvitePlayerToAge( const pyAgeLinkStruct & link, uint32_t playerID void _UninvitePlayerToAge(ENetError result, void* state, void* param, RelVaultNode* node) { if (result == kNetSuccess) - VaultSendNode(node, (uint32_t)param); + VaultSendNode(node, (uint32_t)((uintptr_t)param)); } void pyVault::UnInvitePlayerToAge( const char * str, uint32_t playerID ) { plAgeInfoStruct info; - info.SetAgeInstanceGuid(&plUUID(str)); + plUUID guid(str); + info.SetAgeInstanceGuid(&guid); if (RelVaultNode * rvnLink = VaultGetOwnedAgeLinkIncRef(&info)) { if (RelVaultNode * rvnInfo = rvnLink->GetChildNodeIncRef(plVault::kNodeType_AgeInfo, 1)) { @@ -667,7 +669,8 @@ void pyVault::CreateNeighborhood() desc = plString::Format( "%s's %s", nc->GetPlayerName().c_str(), link.GetAgeInfo()->GetAgeInstanceName() ); } - link.GetAgeInfo()->SetAgeInstanceGuid(&plUUID(GuidGenerate())); + plUUID guid(GuidGenerate()); + link.GetAgeInfo()->SetAgeInstanceGuid(&guid); link.GetAgeInfo()->SetAgeUserDefinedName( _TEMP_CONVERT_TO_CONST_CHAR(title) ); link.GetAgeInfo()->SetAgeDescription( _TEMP_CONVERT_TO_CONST_CHAR(desc) ); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVault.h b/Sources/Plasma/FeatureLib/pfPython/pyVault.h index ec67026d..1d52c5da 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVault.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVault.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVault - a wrapper class to provide interface to the plVault and the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" -#include #include "pyGlueHelpers.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h index 231a96c9..c6ba4313 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultAgeInfoListNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultFolderNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp index 11e6f81c..559b9601 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp @@ -44,10 +44,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultAgeInfoNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include "pyVaultAgeInfoNode.h" #include "hsStlUtils.h" -#include "pyVaultAgeInfoNode.h" #include "pyVaultAgeInfoListNode.h" #include "pyVaultPlayerInfoListNode.h" #include "pyVaultPlayerInfoNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h index 0e01f9ac..7e5a0f21 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultAgeInfoNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h index db713571..162f4d41 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultAgeLinkNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h index e1b262a4..59504e8b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultChronicleNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h index 50d123d2..2c0a236e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultFolderNode - a wrapper class to provide interface to the plVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp index ed3f947d..a64c5067 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp @@ -210,7 +210,7 @@ void pyVaultImageNode::SetImageFromBuf( PyObject * pybuf ) } uint8_t * buffer = nil; - int bytes; + Py_ssize_t bytes; PyObject_AsReadBuffer(pybuf, (const void **)&buffer, &bytes); if (buffer) { VaultImageNode access(fNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h index 8e13f539..daefefb5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultImageNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp index b2f60bcb..8821e7d3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp @@ -44,11 +44,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultMarkerGameNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include "pyVaultMarkerGameNode.h" #include "hsStlUtils.h" -#include "pyVaultMarkerGameNode.h" - #include "plVault/plVault.h" // should only be created from C++ side diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h index 183ab7bd..7af1e406 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultMarkerGameNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp index d030a55d..e5afc01e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp @@ -82,7 +82,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com /////////////////////////////////////////////////////////////////////////// -static void __cdecl LogDumpProc ( +static void CDECL LogDumpProc ( void * , const wchar_t fmt[], ... diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h index 1d770781..55d8c312 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" struct RelVaultNode; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h index d93545f0..401a8657 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultNodeRef - a wrapper class to provide interface to the plVaultNodeRef // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" -#include #include "pyGlueHelpers.h" struct RelVaultNode; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h index 25d72457..d5da151e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultPlayerInfoListNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultFolderNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h index 1ba6b5fa..6318dbea 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h @@ -48,8 +48,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyVaultNode.h" #include +#include "pyVaultNode.h" #include "pyGlueHelpers.h" class pyVaultPlayerInfoNode : public pyVaultNode diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp index 20946203..a09bd428 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp @@ -238,7 +238,8 @@ void pyVaultPlayerNode::RemoveVisitAgeLink(const char *guidstr) Uuid uuid; GuidFromString(guidstr, &uuid); plAgeInfoStruct info; - info.SetAgeInstanceGuid(&plUUID(uuid)); + plUUID guid(uuid); + info.SetAgeInstanceGuid(&guid); VaultUnregisterOwnedAgeAndWait(&info); } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h index f319d06a..18900214 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultPlayerNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pfPython/pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h index ccf3523b..fe32d5ac 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultSDLNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h index 3d8da8f4..87143b72 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultSystemNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h index 3a7bbd6a..b2c05932 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h @@ -48,9 +48,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h b/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h index e9c095e3..d0560da7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h @@ -42,11 +42,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pyWaveSet_h #define pyWaveSet_h +#include #include "pyKey.h" #include "pyGeometry3.h" #include "pyColor.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// @@ -216,4 +216,4 @@ public: }; -#endif // pyWaveSet_h \ No newline at end of file +#endif // pyWaveSet_h diff --git a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h index 56bd5b9b..287e3a4b 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h +++ b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h @@ -238,7 +238,7 @@ bool AsyncFileSeek ( * ***/ -#include +#pragma pack(push,1) struct AsyncSocketConnectPacket { uint8_t connType; uint16_t hdrBytes; @@ -247,7 +247,7 @@ struct AsyncSocketConnectPacket { uint32_t branchId; Uuid productId; }; -#include +#pragma pack(pop) /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcLog.cpp b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcLog.cpp index e6e02354..edcca438 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcLog.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcLog.cpp @@ -122,7 +122,7 @@ void LogUnregisterHandler (FLogHandler callback) { } //=========================================================================== -void __cdecl LogMsg (ELogSeverity severity, const char format[], ...) { +void CDECL LogMsg (ELogSeverity severity, const char format[], ...) { ASSERT(format); va_list args; @@ -132,7 +132,7 @@ void __cdecl LogMsg (ELogSeverity severity, const char format[], ...) { } //=========================================================================== -void __cdecl LogMsg (ELogSeverity severity, const wchar_t format[], ...) { +void CDECL LogMsg (ELogSeverity severity, const wchar_t format[], ...) { ASSERT(format); va_list args; diff --git a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h index f81feac0..81ca9c24 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h +++ b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h @@ -63,7 +63,7 @@ const unsigned kAsyncTimeInfinite = (unsigned) -1; #ifdef _MSC_VER #define THREADCALL __stdcall #else -#define THREADCALL __cdecl +#define THREADCALL CDECL #endif struct AsyncThread; diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp index e4ef0e54..cf291ac8 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp @@ -219,7 +219,7 @@ AsyncId CThreadDispObject::Queue (void * op) { ***/ //=========================================================================== -static unsigned CALLBACK W9xThreadProc (AsyncThread *) { +static unsigned THREADCALL W9xThreadProc (AsyncThread *) { // Perform the main thread loop for (;;) { diff --git a/Sources/Plasma/NucleusLib/pnCsrNet/pnCsrNet.h b/Sources/Plasma/NucleusLib/pnCsrNet/pnCsrNet.h index d72d7225..f5de1923 100644 --- a/Sources/Plasma/NucleusLib/pnCsrNet/pnCsrNet.h +++ b/Sources/Plasma/NucleusLib/pnCsrNet/pnCsrNet.h @@ -67,7 +67,7 @@ enum { //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) #define CSRNET_MSG(a) \ CsrNet_##a () : SimpleNet_MsgHeader(kSimpleNetChannelCsr, kCsrNet_##a) { } @@ -82,7 +82,7 @@ struct CsrNet_ExecConsoleCmd : SimpleNet_MsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) #endif // PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNCSRNET_PNCSRNET_H diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h b/Sources/Plasma/NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h index 1003a0ce..3210c765 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h @@ -93,7 +93,7 @@ enum { //============================================================================ // Begin networked data scructures -#include +#pragma pack(push,1) //============================================================================ //======================================================================== @@ -134,5 +134,5 @@ enum { //============================================================================ // End networked data structures -#include +#pragma pack(pop) //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h b/Sources/Plasma/NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h index 6bf5a2de..9afccb28 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h @@ -106,7 +106,7 @@ enum { //============================================================================ // Begin networked data structures -#include +#pragma pack(push,1) //============================================================================ //======================================================================== @@ -180,5 +180,5 @@ enum { //============================================================================ // End networked data structures -#include +#pragma pack(pop) //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h b/Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h index d48304d8..6511680e 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h @@ -124,7 +124,7 @@ enum { //============================================================================ // Begin networked data structures -#include +#pragma pack(push,1) //============================================================================ //======================================================================== @@ -199,5 +199,5 @@ enum { //============================================================================ // End networked data structures -#include -//============================================================================ \ No newline at end of file +#pragma pack(pop) +//============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h b/Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h index 78215554..a90f39ae 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h @@ -117,7 +117,7 @@ enum { //============================================================================ // Begin networked data structures -#include +#pragma pack(push,1) //============================================================================ //======================================================================== @@ -225,5 +225,5 @@ enum { //============================================================================ // End networked data structures -#include +#pragma pack(pop) //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h b/Sources/Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h index a0643073..68e85305 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h @@ -96,7 +96,7 @@ enum { //============================================================================ // Begin networked data scructures -#include +#pragma pack(push,1) //============================================================================ //======================================================================== @@ -132,5 +132,5 @@ enum { //============================================================================ // End networked data structures -#include +#pragma pack(pop) //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h b/Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h index 75c3de39..892a62d7 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h @@ -96,7 +96,7 @@ enum { //============================================================================ // Begin networked data structures -#include +#pragma pack(push,1) //============================================================================ //======================================================================== @@ -153,5 +153,5 @@ enum { //============================================================================ // End networked data structures -#include +#pragma pack(pop) //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h b/Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h index 5797fd7e..3aa9bd66 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h @@ -165,7 +165,7 @@ enum { //============================================================================ // Begin networked data scructures -#include +#pragma pack(push,1) //============================================================================ struct GameMsgHeader { @@ -247,7 +247,7 @@ enum { //============================================================================ // End networked data structures -#include +#pragma pack(pop) //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp b/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp index bf969711..b958cd2c 100644 --- a/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp +++ b/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp @@ -295,7 +295,7 @@ static void ParseBuffer ( } if (chr == SECTION_CLOSE_CHAR) { - StrCopy(dst, start, min(buffer - start + 1, arrsize(dst))); + StrCopy(dst, start, min((unsigned long)(buffer - start + 1), arrsize(dst))); section = AddSection(ini, dst); state = STATE_STRIP_TRAILING; } @@ -319,7 +319,7 @@ static void ParseBuffer ( break; } - StrCopy(dst, start, min(buffer - start + 1, arrsize(dst))); + StrCopy(dst, start, min((unsigned long)(buffer - start + 1), arrsize(dst))); value = AddKeyValue(section, dst, lineNum); start = buffer + 1; state = STATE_VALUE; @@ -340,7 +340,7 @@ static void ParseBuffer ( break; } - StrCopy(dst, start, min(buffer - start + 1, arrsize(dst))); + StrCopy(dst, start, min((unsigned long)(buffer - start + 1), arrsize(dst))); AddValueString(value, dst); if (chr == VALUE_SEPARATOR) start = buffer + 1; @@ -352,7 +352,7 @@ static void ParseBuffer ( // cleanup current value if (state == STATE_VALUE) { - StrCopy(dst, start, min(buffer - start + 1, arrsize(dst))); + StrCopy(dst, start, min((unsigned long)(buffer - start + 1), arrsize(dst))); AddValueString(value, dst); } } diff --git a/Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h b/Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h index 7f046db8..f9be1cbb 100644 --- a/Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h +++ b/Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h @@ -125,14 +125,14 @@ struct CommandConvert struct plMouseInfo { - plMouseInfo(ControlEventCode _code, uint32_t _flags, hsPoint4 _box, char* _desc) + plMouseInfo(ControlEventCode _code, uint32_t _flags, hsPoint4 _box, const char* _desc) { fCode = _code; fControlFlags = _flags; fBox = _box; fControlDescription = _desc; } - plMouseInfo(ControlEventCode _code, uint32_t _flags, float pt1, float pt2, float pt3, float pt4, char* _desc) + plMouseInfo(ControlEventCode _code, uint32_t _flags, float pt1, float pt2, float pt3, float pt4, const char* _desc) { fCode = _code; fControlFlags = _flags; @@ -140,9 +140,9 @@ struct plMouseInfo fControlDescription = _desc; } ControlEventCode fCode; - uint32_t fControlFlags; + uint32_t fControlFlags; hsPoint4 fBox; - char* fControlDescription; + const char* fControlDescription; }; diff --git a/Sources/Plasma/NucleusLib/pnInputCore/plKeyDef.h b/Sources/Plasma/NucleusLib/pnInputCore/plKeyDef.h index 9c638277..60ac846a 100644 --- a/Sources/Plasma/NucleusLib/pnInputCore/plKeyDef.h +++ b/Sources/Plasma/NucleusLib/pnInputCore/plKeyDef.h @@ -141,15 +141,15 @@ enum plKeyDef KEY_PRINTSCREEN = VK_SNAPSHOT, KEY_INSERT = VK_INSERT, KEY_DELETE = VK_DELETE, - KEY_NUMPAD0 = VK_NUMPAD0, - KEY_NUMPAD1 = VK_NUMPAD1, - KEY_NUMPAD2 = VK_NUMPAD2, - KEY_NUMPAD3 = VK_NUMPAD3, - KEY_NUMPAD4 = VK_NUMPAD4, - KEY_NUMPAD5 = VK_NUMPAD5, - KEY_NUMPAD6 = VK_NUMPAD6, - KEY_NUMPAD7 = VK_NUMPAD7, - KEY_NUMPAD8 = VK_NUMPAD8, + KEY_NUMPAD0 = VK_NUMPAD0, + KEY_NUMPAD1 = VK_NUMPAD1, + KEY_NUMPAD2 = VK_NUMPAD2, + KEY_NUMPAD3 = VK_NUMPAD3, + KEY_NUMPAD4 = VK_NUMPAD4, + KEY_NUMPAD5 = VK_NUMPAD5, + KEY_NUMPAD6 = VK_NUMPAD6, + KEY_NUMPAD7 = VK_NUMPAD7, + KEY_NUMPAD8 = VK_NUMPAD8, KEY_NUMPAD9 = VK_NUMPAD9, KEY_NUMPAD_MULTIPLY = VK_MULTIPLY, KEY_NUMPAD_ADD = VK_ADD, @@ -161,11 +161,11 @@ enum plKeyDef KEY_PERIOD = VK_OEM_PERIOD, KEY_DASH = VK_OEM_MINUS, KEY_EQUAL = VK_OEM_PLUS, - + // these are only good in the US of A... KEY_SEMICOLON = VK_OEM_1, KEY_SLASH = VK_OEM_2, - KEY_TILDE = VK_OEM_3, + KEY_TILDE = VK_OEM_3, KEY_LBRACKET = VK_OEM_4, KEY_BACKSLASH = VK_OEM_5, KEY_RBRACKET = VK_OEM_6, @@ -176,8 +176,104 @@ enum plKeyDef #elif HS_BUILD_FOR_UNIX +/* This is a total hack (for now) */ enum plKeyDef { + KEY_A = 0xffffffff, + KEY_B = 0xffffffff, + KEY_C = 0xffffffff, + KEY_D = 0xffffffff, + KEY_E = 0xffffffff, + KEY_F = 0xffffffff, + KEY_G = 0xffffffff, + KEY_H = 0xffffffff, + KEY_I = 0xffffffff, + KEY_J = 0xffffffff, + KEY_K = 0xffffffff, + KEY_L = 0xffffffff, + KEY_M = 0xffffffff, + KEY_N = 0xffffffff, + KEY_O = 0xffffffff, + KEY_P = 0xffffffff, + KEY_Q = 0xffffffff, + KEY_R = 0xffffffff, + KEY_S = 0xffffffff, + KEY_T = 0xffffffff, + KEY_U = 0xffffffff, + KEY_V = 0xffffffff, + KEY_W = 0xffffffff, + KEY_X = 0xffffffff, + KEY_Y = 0xffffffff, + KEY_Z = 0xffffffff, + KEY_0 = 0xffffffff, + KEY_1 = 0xffffffff, + KEY_2 = 0xffffffff, + KEY_3 = 0xffffffff, + KEY_4 = 0xffffffff, + KEY_5 = 0xffffffff, + KEY_6 = 0xffffffff, + KEY_7 = 0xffffffff, + KEY_8 = 0xffffffff, + KEY_9 = 0xffffffff, + KEY_F1 = 0xffffffff, + KEY_F2 = 0xffffffff, + KEY_F3 = 0xffffffff, + KEY_F4 = 0xffffffff, + KEY_F5 = 0xffffffff, + KEY_F6 = 0xffffffff, + KEY_F7 = 0xffffffff, + KEY_F8 = 0xffffffff, + KEY_F9 = 0xffffffff, + KEY_F10 = 0xffffffff, + KEY_F11 = 0xffffffff, + KEY_F12 = 0xffffffff, + KEY_ESCAPE = 0xffffffff, + KEY_TAB = 0xffffffff, + KEY_SHIFT = 0xffffffff, + KEY_CTRL = 0xffffffff, + KEY_ALT = 0xffffffff, + KEY_UP = 0xffffffff, + KEY_DOWN = 0xffffffff, + KEY_LEFT = 0xffffffff, + KEY_RIGHT = 0xffffffff, + KEY_BACKSPACE = 0xffffffff, + KEY_ENTER = 0xffffffff, + KEY_PAUSE = 0xffffffff, + KEY_CAPSLOCK = 0xffffffff, + KEY_PAGEUP = 0xffffffff, + KEY_PAGEDOWN = 0xffffffff, + KEY_END = 0xffffffff, + KEY_HOME = 0xffffffff, + KEY_PRINTSCREEN = 0xffffffff, + KEY_INSERT = 0xffffffff, + KEY_DELETE = 0xffffffff, + KEY_NUMPAD0 = 0xffffffff, + KEY_NUMPAD1 = 0xffffffff, + KEY_NUMPAD2 = 0xffffffff, + KEY_NUMPAD3 = 0xffffffff, + KEY_NUMPAD4 = 0xffffffff, + KEY_NUMPAD5 = 0xffffffff, + KEY_NUMPAD6 = 0xffffffff, + KEY_NUMPAD7 = 0xffffffff, + KEY_NUMPAD8 = 0xffffffff, + KEY_NUMPAD9 = 0xffffffff, + KEY_NUMPAD_MULTIPLY = 0xffffffff, + KEY_NUMPAD_ADD = 0xffffffff, + KEY_NUMPAD_SUBTRACT = 0xffffffff, + KEY_NUMPAD_PERIOD = 0xffffffff, + KEY_NUMPAD_DIVIDE = 0xffffffff, + KEY_SPACE = 0xffffffff, + KEY_COMMA = 0xffffffff, + KEY_PERIOD = 0xffffffff, + KEY_DASH = 0xffffffff, + KEY_EQUAL = 0xffffffff, + KEY_SEMICOLON = 0xffffffff, + KEY_SLASH = 0xffffffff, + KEY_TILDE = 0xffffffff, + KEY_LBRACKET = 0xffffffff, + KEY_BACKSLASH = 0xffffffff, + KEY_RBRACKET = 0xffffffff, + KEY_QUOTE = 0xffffffff, KEY_UNMAPPED = 0xffffffff, }; #endif diff --git a/Sources/Plasma/NucleusLib/pnMail/pnMail.cpp b/Sources/Plasma/NucleusLib/pnMail/pnMail.cpp index 30a36f4a..bed2d193 100644 --- a/Sources/Plasma/NucleusLib/pnMail/pnMail.cpp +++ b/Sources/Plasma/NucleusLib/pnMail/pnMail.cpp @@ -95,7 +95,7 @@ static bool MailNotifyProc ( void ** userState ); -static void __cdecl Send ( +static void CDECL Send ( AsyncSocket sock, const char str[], ... @@ -431,7 +431,7 @@ static bool MailNotifyProc ( } //=========================================================================== -static void __cdecl Send ( +static void CDECL Send ( AsyncSocket sock, const char str[], ... diff --git a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp index 8d557b9d..422910da 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp @@ -53,7 +53,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com # pragma message("Compiling pnNetCli with debugging on") # define NCCLI_LOG LogMsg #else -# define NCCLI_LOG NULL_STMT +# define NCCLI_LOG LogMsg #endif #ifndef PLASMA_EXTERNAL_RELEASE @@ -603,7 +603,7 @@ namespace Connect { * ***/ -#include +#pragma pack(push,1) enum { kNetCliCli2SrvConnect, kNetCliSrv2CliEncrypt, @@ -627,7 +627,7 @@ struct NetCli_Srv2Cli_Encrypt : NetCli_PacketHeader { struct NetCli_Srv2Cli_Error : NetCli_PacketHeader { uint32_t error; // ENetError }; -#include +#pragma pack(pop) //=========================================================================== diff --git a/Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp b/Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp index dc96362a..938fca29 100644 --- a/Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp +++ b/Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp @@ -68,7 +68,7 @@ typedef DWORD (PASCAL FAR * FGetAdaptersInfo)( * ***/ -static FGetAdaptersInfo GetAdaptersInfo; +static FGetAdaptersInfo getAdaptersInfo; /***************************************************************************** @@ -81,14 +81,14 @@ static FGetAdaptersInfo GetAdaptersInfo; void SysStartup () { if (g_lib) { - GetAdaptersInfo = (FGetAdaptersInfo)GetProcAddress(g_lib, "GetAdaptersInfo"); + getAdaptersInfo = (FGetAdaptersInfo)GetProcAddress(g_lib, "GetAdaptersInfo"); } } //============================================================================ void SysShutdown () { - GetAdaptersInfo = nil; + getAdaptersInfo = nil; } @@ -150,17 +150,17 @@ void NetDiagSys ( } { // Adapters - if (!GetAdaptersInfo) { + if (!getAdaptersInfo) { dump(L"[SYS] Failed to load IP helper API"); callback(diag, kNetProtocolNil, kNetErrNotSupported, param); return; } ULONG ulOutBufLen = 0; - GetAdaptersInfo(nil, &ulOutBufLen); + getAdaptersInfo(nil, &ulOutBufLen); PIP_ADAPTER_INFO pInfo = (PIP_ADAPTER_INFO)malloc(ulOutBufLen); PIP_ADAPTER_INFO pAdapter; - if (GetAdaptersInfo(pInfo, &ulOutBufLen) == NO_ERROR) { + if (getAdaptersInfo(pInfo, &ulOutBufLen) == NO_ERROR) { pAdapter = pInfo; while (pAdapter) { dump(L"[SYS] NIC: %S", pAdapter->Description); diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Auth/pnNpCli2Auth.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Auth/pnNpCli2Auth.h index de66c9f7..1aaef9cb 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Auth/pnNpCli2Auth.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Auth/pnNpCli2Auth.h @@ -218,7 +218,7 @@ COMPILER_ASSERT_HEADER(Cli2Auth, kNumAuth2CliMessages <= (uint16_t)-1); //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -1046,4 +1046,4 @@ struct Auth2Cli_ScoreGetRanksReply { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.h index 49986ec9..df373048 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.h @@ -101,7 +101,7 @@ COMPILER_ASSERT_HEADER(Cli2Scr, kNumCsr2CliMessages <= (uint16_t)-1); * Networked structures * ***/ -#include +#pragma pack(push,1) //============================================================================ // Connect packet @@ -174,5 +174,5 @@ struct Csr2Cli_LoginReply : Cli2Csr_MsgHeader { }; -#include +#pragma pack(pop) diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.h index 2207db6a..df08897c 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.h @@ -97,7 +97,7 @@ static const unsigned kFileSrvBuildId = 0; //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -208,4 +208,4 @@ struct File2Cli_FileDownloadReply : Cli2File_MsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h index 80665418..f01b2798 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h @@ -86,7 +86,7 @@ COMPILER_ASSERT_HEADER(Cli2Game, kNumGame2CliMessages <= (uint16_t)-1); //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -191,4 +191,4 @@ struct Game2Cli_GameMgrMsg { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h index 69b7c71c..7e04142f 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h @@ -78,7 +78,7 @@ COMPILER_ASSERT_HEADER(Cli2GateKeeper, kNumGateKeeper2CliMessages <= (uint16_t)- //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -154,4 +154,5 @@ struct GateKeeper2Cli_AuthSrvIpAddressReply { uint32_t messageId; uint32_t transId; wchar_t address[24]; -}; \ No newline at end of file +}; +#pragma pack(pop) diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h index e51a7bc7..3bd0a089 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h @@ -160,7 +160,7 @@ enum { //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -554,7 +554,7 @@ struct Db2Srv_CsrAcctInfoReply : SrvMsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.h index b7ac0b01..8f8edb68 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.h @@ -54,7 +54,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) // Srv2Log enum { @@ -103,7 +103,7 @@ struct Srv2Log_LogMsg : SrvMsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h index bcc59484..2296b069 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h @@ -96,7 +96,7 @@ enum { //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -252,7 +252,7 @@ struct Mcp2Srv_PropagateBuffer : SrvMsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.h index cfd69d80..27a5d646 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.h @@ -54,7 +54,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) // kNetProtocolSrv2Score messages enum { @@ -169,7 +169,7 @@ struct Score2Srv_ScoreGetRanksReply : SrvMsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h index dfb4ab06..31b364e9 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h @@ -68,7 +68,7 @@ enum { //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -129,7 +129,7 @@ struct State2Srv_ObjectFetched : SrvMsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h index 6c7f519d..1187f2d0 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h @@ -142,7 +142,7 @@ enum { //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -453,7 +453,7 @@ struct Vault2Srv_CurrentPopulationRequest : SrvMsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h index 7666945d..1a3cef0c 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h @@ -79,14 +79,14 @@ const NetMsgField kNetMsgFieldBuildId = NET_MSG_FIELD_DWORD(); * ***/ -#include +#pragma pack(push,1) struct SrvPlayerInfo { unsigned playerInt; wchar_t playerName[kMaxPlayerNameLength]; wchar_t avatarShape[kMaxVaultNodeStringLength]; unsigned explorer; }; -#include +#pragma pack(pop) /***************************************************************************** @@ -441,14 +441,14 @@ struct NetVaultNodeFieldArray { //============================================================================ // NetVaultNodeRef (packed because is sent over wire directly) //============================================================================ -#include +#pragma pack(push,1) struct NetVaultNodeRef { unsigned parentId; unsigned childId; unsigned ownerId; bool seen; }; -#include +#pragma pack(pop) //============================================================================ // SrvPackBuffer diff --git a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp index d76b0fe9..5f928da1 100644 --- a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp +++ b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp @@ -119,7 +119,7 @@ const wchar_t * ProductLongName () { //============================================================================ void ProductString (wchar_t * dest, unsigned destChars) { // Example: "UruLive.2.214 - External.Release" - swprintf( + hsSnwprintf( dest, destChars, L"%s.%u.%u - %s.%s", diff --git a/Sources/Plasma/NucleusLib/pnSceneObject/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnSceneObject/CMakeLists.txt index ac027b41..d33c49c4 100644 --- a/Sources/Plasma/NucleusLib/pnSceneObject/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnSceneObject/CMakeLists.txt @@ -23,6 +23,7 @@ set(pnSceneObject_SOURCES ) add_library(pnSceneObject STATIC ${pnSceneObject_HEADERS} ${pnSceneObject_SOURCES}) +target_link_libraries(pnSceneObject CoreLib pnKeyedObject pnNetCommon) source_group("Header Files" FILES ${pnSceneObject_HEADERS}) source_group("Source Files" FILES ${pnSceneObject_SOURCES}) diff --git a/Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.h b/Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.h index 6690c09c..b857e998 100644 --- a/Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.h +++ b/Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.h @@ -84,7 +84,7 @@ COMPILER_ASSERT_HEADER(ESimpleNetChannel, kMaxSimpleNetChannels <= 0xff); //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) //============================================================================ // Connect packet @@ -179,5 +179,6 @@ void SimpleNetSend ( SimpleNetConn * conn, SimpleNet_MsgHeader * msg ); +#pragma pack(pop) #endif // PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNSIMPLENET_PNSIMPLENET_H diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp index b447b508..32beab3f 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp @@ -62,6 +62,11 @@ plUUID::plUUID( const plUUID & other ) CopyFrom( &other ); } +plUUID::plUUID( const Uuid & uuid ) +{ + memcpy(fData, uuid.data, sizeof(fData)); +} + void plUUID::Read( hsStream * s) { s->LogSubStreamPushDesc("plUUID"); @@ -78,3 +83,9 @@ plString plUUID::AsString() const { ToString(str); return str; } + +plUUID::operator Uuid () const { + Uuid uuid; + memcpy(uuid.data, fData, sizeof(uuid.data)); + return uuid; +} diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h index dd2aed4a..c8102dcf 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h @@ -44,9 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "hsStlUtils.h" -#ifdef HS_BUILD_FOR_WIN32 -#include "pnUtils/pnUtils.h" -#endif +#include "pnUtils/pnUtUuid.h" class hsStream; class plString; @@ -67,9 +65,7 @@ public: plUUID( const char * s ); plUUID( const plString & s ); plUUID( const plUUID & other ); -#ifdef HS_BUILD_FOR_WIN32 plUUID( const Uuid & uuid ); -#endif void Clear(); bool IsNull() const; bool IsSet() const { return !IsNull(); } @@ -87,9 +83,7 @@ public: bool operator==( const plUUID & other ) const { return IsEqualTo( &other ); } bool operator!=( const plUUID & other ) const { return !IsEqualTo( &other ); } int operator <( const plUUID & other ) const { return CompareTo( &other ); } -#ifdef HS_BUILD_FOR_WIN32 operator Uuid () const; -#endif static plUUID Generate(); }; diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp index 6cd665c4..10ef5d86 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp @@ -47,11 +47,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include -plUUID::plUUID( const Uuid & uuid ) -{ - memcpy(fData, uuid.data, sizeof(fData)); -} - void plUUID::Clear() { UuidCreateNil( (GUID *)this ); @@ -85,12 +80,6 @@ void plUUID::CopyFrom( const plUUID & v ) { memcpy(fData, v.fData, sizeof(fData)); } -plUUID::operator Uuid () const { - Uuid uuid; - memcpy(uuid.data, fData, sizeof(uuid.data)); - return uuid; -} - bool plUUID::FromString( const char * str ) { Clear(); diff --git a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt index 6820ede5..2774f622 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt @@ -2,88 +2,80 @@ include_directories("../../CoreLib") include_directories("../../NucleusLib") set(pnUtils_HEADERS - Intern.h Pch.h pnUtils.h -) - -set(pnUtils_PRIVATE - Private/pnUtAddr.h - Private/pnUtAddr.cpp - Private/pnUtAllIncludes.h - Private/pnUtArray.h - Private/pnUtArray.cpp - Private/pnUtBase64.h - Private/pnUtBase64.cpp - Private/pnUtBigNum.h - Private/pnUtBigNum.cpp - Private/pnUtCmd.h - Private/pnUtCmd.cpp - Private/pnUtCoreLib.h - Private/pnUtCrypt.h - Private/pnUtCrypt.cpp - Private/pnUtHash.h - Private/pnUtHash.cpp - Private/pnUtList.h - Private/pnUtList.cpp - Private/pnUtMath.h - Private/pnUtMath.cpp - Private/pnUtMisc.h - Private/pnUtMisc.cpp - Private/pnUtPath.h - Private/pnUtPath.cpp - Private/pnUtPragma.h - Private/pnUtPriQ.h - Private/pnUtRand.h - Private/pnUtRand.cpp - Private/pnUtRef.h - Private/pnUtSkipList.h - Private/pnUtSort.h - Private/pnUtSpareList.h - Private/pnUtSpareList.cpp - Private/pnUtStr.h - Private/pnUtStr.cpp - Private/pnUtSubst.h - Private/pnUtSubst.cpp - Private/pnUtSync.h - Private/pnUtTime.h - Private/pnUtTime.cpp - Private/pnUtTls.h - Private/pnUtTls.cpp - Private/pnUtUuid.h - Private/pnUtUuid.cpp + pnUtCoreLib.h + pnUtAddr.h + pnUtAllIncludes.h + pnUtArray.h + pnUtBase64.h + pnUtBigNum.h + pnUtCmd.h + pnUtCrypt.h + pnUtHash.h + pnUtList.h + pnUtMath.h + pnUtMisc.h + pnUtPath.h + pnUtPragma.h + pnUtPriQ.h + pnUtRand.h + pnUtRef.h + pnUtSort.h + pnUtSpareList.h + pnUtStr.h + pnUtSync.h + pnUtTime.h + pnUtTls.h + pnUtUuid.h ) set(pnUtils_SOURCES - pnUtils.cpp + pnUtAddr.cpp + pnUtArray.cpp + pnUtBase64.cpp + pnUtBigNum.cpp + pnUtCmd.cpp + pnUtHash.cpp + pnUtList.cpp + pnUtMath.cpp + pnUtMisc.cpp + pnUtPath.cpp + pnUtRand.cpp + pnUtSpareList.cpp + pnUtStr.cpp + pnUtTime.cpp + pnUtUuid.cpp ) if(WIN32) set(pnUtils_WIN32 - Private/Win32/pnUtW32Addr.cpp - Private/Win32/pnUtW32Misc.cpp - Private/Win32/pnUtW32Path.cpp - Private/Win32/pnUtW32Str.cpp - Private/Win32/pnUtW32Sync.cpp - Private/Win32/pnUtW32Time.cpp - Private/Win32/pnUtW32Uuid.cpp + Win32/pnUtW32Addr.cpp + Win32/pnUtW32Misc.cpp + Win32/pnUtW32Path.cpp + Win32/pnUtW32Str.cpp + Win32/pnUtW32Sync.cpp + Win32/pnUtW32Time.cpp + Win32/pnUtW32Uuid.cpp + + pnUtCrypt.cpp + pnUtTls.cpp ) else() set(pnUtils_UNIX - Private/Unix/pnUtUxStr.cpp - Private/Unix/pnUtUxSync.cpp - Private/Unix/pnUtUxUuid.cpp + Unix/pnUtUxStr.cpp + #Unix/pnUtUxSync.cpp + Unix/pnUtUxUuid.cpp ) endif() -add_library(pnUtils STATIC ${pnUtils_HEADERS} ${pnUtils_PRIVATE} ${pnUtils_SOURCES} +add_library(pnUtils STATIC ${pnUtils_HEADERS} ${pnUtils_SOURCES} ${pnUtils_UNIX} ${pnUtils_WIN32}) source_group("Header Files" FILES ${pnUtils_HEADERS}) source_group("Source Files" FILES ${pnUtils_SOURCES}) -source_group("Private" FILES ${pnUtils_PRIVATE}) if(WIN32) - source_group("Private\\Win32" FILES ${pnUtils_WIN32}) + source_group("Win32" FILES ${pnUtils_WIN32}) else() - source_group("Private\\Unix" FILES ${pnUtils_UNIX}) + source_group("Unix" FILES ${pnUtils_UNIX}) endif() diff --git a/Sources/Plasma/NucleusLib/pnUtils/Intern.h b/Sources/Plasma/NucleusLib/pnUtils/Intern.h deleted file mode 100644 index 5c93109e..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/Intern.h +++ /dev/null @@ -1,70 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Intern.h -* -***/ - -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_INTERN_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Intern.h included more than once" -#endif -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_INTERN_H - - - -/***************************************************************************** -* -* Crypt -* -***/ - -namespace Crypt { - -//============================================================================ -class KeyBase { -public: - virtual void Codec (bool encrypt, ARRAY(uint8_t) * dest, unsigned sourceBytes, const void * sourceData) = 0; - virtual unsigned GetBlockSize () const = 0; -}; - -} // namespace Crypt diff --git a/Sources/Plasma/NucleusLib/pnUtils/Pch.h b/Sources/Plasma/NucleusLib/pnUtils/Pch.h index b956e38c..b62001ac 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Pch.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Pch.h @@ -45,15 +45,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PCH_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Pch.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PCH_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PCH_H -#include "Private/pnUtAllIncludes.h" -#include "Intern.h" - -#include "pnProduct/pnProduct.h" +#include "pnUtCoreLib.h" // must be first in list +#include "pnUtPragma.h" #include @@ -66,4 +62,4 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #pragma warning(pop) #endif -#include // _alloca +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.cpp b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.cpp deleted file mode 100644 index 8677abd6..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.cpp +++ /dev/null @@ -1,97 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.cpp -* -***/ - -#include "../Pch.h" -#pragma hdrstop - - -/***************************************************************************** -* -* Exported bit manipulation functions -* -***/ - -//=========================================================================== -#ifndef _M_IX86 - -unsigned MathHighBitPos (uint32_t val) { - ASSERT(val); - double f = (double)val; - return (*((uint32_t *)&f + 1) >> 20) - 1023; -} - -#else - -__declspec(naked) unsigned __fastcall MathHighBitPos (uint32_t) { - __asm { - bsr eax, ecx - ret 0 - }; -} - -#endif - -//=========================================================================== -#ifndef _M_IX86 - -unsigned MathLowBitPos (uint32_t val) { - val &= ~(val - 1); // clear all but the low bit - ASSERT(val); - double f = (double)val; - return (*((uint32_t *)&f + 1) >> 20) - 1023; -} - -#else - -__declspec(naked) unsigned __fastcall MathLowBitPos (uint32_t) { - __asm { - bsf eax, ecx - ret 0 - }; -} - -#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h deleted file mode 100644 index df4668dd..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h +++ /dev/null @@ -1,477 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h -* -***/ - -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSKIPLIST_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h included more than once" -#endif -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSKIPLIST_H - - -/***************************************************************************** -* -* Macros -* -***/ - -#define SKIPLIST(type, keyType, keyField, cmp) TSkipList< type, keyType, offsetof(type, keyField), cmp > -#define SKIPLIST_NUMERIC(type, keyType, keyField) SKIPLIST(type, keyType, keyField, TSkipListNumericCmp) -#define SKIPLIST_STRING(type, keyType, keyField) SKIPLIST(type, keyType, keyField, TSkipListStringCmp) -#define SKIPLIST_STRINGI(type, keyType, keyField) SKIPLIST(type, keyType, keyField, TSkipListStringCmpI) - - - -/***************************************************************************** -* -* Typedefs -* -***/ - -typedef void * SkipListTag; - - -/***************************************************************************** -* -* Comparers -* -***/ - - -template -class TSkipListNumericCmp { -public: - static bool Eq (const K & a, const K & b) { return a == b; } - static bool Lt (const K & a, const K & b) { return a < b; } -}; - -template -class TSkipListStringCmp { -public: - static bool Eq (const K & a, const K & b) { return StrCmp(a, b, (unsigned)-1) == 0; } - static bool Lt (const K & a, const K & b) { return StrCmp(a, b, (unsigned)-1) < 0; } -}; - -template -class TSkipListStringCmpI { -public: - static bool Eq (const K & a, const K & b) { return StrCmpI(a, b, (unsigned)-1) == 0; } - static bool Lt (const K & a, const K & b) { return StrCmpI(a, b, (unsigned)-1) < 0; } -}; - - -/***************************************************************************** -* -* TSkipList -* -***/ - -template -class TSkipList { -private: - enum { kMaxLevels = 32 }; - - template - struct TNode { - const K2 * key; - T2 * object; - unsigned level; - TNode * prev; - TNode * next[1]; // variable size array - }; - typedef TNode Node; - - unsigned m_level; - Node * m_head; - Node * m_stop; - unsigned m_randomBits; - unsigned m_randomsLeft; - - Node * AllocNode (unsigned levels); - void FreeNode (Node * node); - unsigned RandomLevel (); - -public: - inline TSkipList (); - inline ~TSkipList (); - inline void Clear (); - inline void Delete (T * object); - inline T * Find (const K & key, SkipListTag * tag = nil) const; - inline T * FindNext (SkipListTag * tag) const; - inline T * Head (SkipListTag * tag) const; - inline T * Next (SkipListTag * tag) const; - inline T * Prev (SkipListTag * tag) const; - inline T * Tail (SkipListTag * tag) const; - inline void Link (T * object); - inline void Unlink (T * object); - inline void Unlink (SkipListTag * tag); - inline void UnlinkAll (); - - #ifdef HS_DEBUGGING - inline void Print () const; - #endif -}; - - -/***************************************************************************** -* -* TSkipList private member functions -* -***/ - -//============================================================================ -template -typename TSkipList::Node* TSkipList::AllocNode (unsigned level) { - - unsigned size = offsetof(Node, next) + (level + 1) * sizeof(Node); - Node * node = (Node *)malloc(size); - node->level = level; - return node; -} - -//============================================================================ -template -void TSkipList::FreeNode (TNode * node) { - - free(node); -} - -//============================================================================ -template -unsigned TSkipList::RandomLevel () { - - unsigned level = 0; - unsigned bits = 0; - - while (!bits) { - bits = m_randomBits % 4; - if (!bits) - ++level; - m_randomBits >>= 2; - m_randomsLeft -= 2; - if (!m_randomsLeft) { - m_randomBits = RandUnsigned(); - m_randomsLeft = 30; - } - } - - return level; -} - - -/***************************************************************************** -* -* TSkipList public member functions -* -***/ - -//============================================================================ -template -TSkipList::TSkipList () { - - m_level = 0; - m_head = AllocNode(kMaxLevels); - m_stop = AllocNode(0); - m_randomBits = RandUnsigned(); - m_randomsLeft = 30; - - // Initialize header and stop skip node pointers - m_stop->prev = m_head; - m_stop->object = nil; - m_stop->next[0] = nil; - m_head->object = nil; - for (unsigned index = 0; index < kMaxLevels; ++index) - m_head->next[index] = m_stop; -} - -//============================================================================ -template -TSkipList::~TSkipList () { - - UnlinkAll(); - ASSERT(m_stop->prev == m_head); - FreeNode(m_head); - FreeNode(m_stop); -} - -//============================================================================ -template -void TSkipList::Clear () { - - Node * ptr = m_head->next[0]; - while (ptr != m_stop) { - Node * next = ptr->next[0]; - delete ptr->object; - FreeNode(ptr); - ptr = next; - } - - m_stop->prev = m_head; - for (unsigned index = 0; index < kMaxLevels; ++index) - m_head->next[index] = m_stop; - m_level = 0; -} - -//============================================================================ -template -void TSkipList::Delete (T * object) { - - Unlink(object); - delete object; -} - -//============================================================================ -template -T * TSkipList::Find (const K & key, SkipListTag * tag) const { - - Node * node = m_head; - - m_stop->key = &key; - for (int level = (int)m_level; level >= 0; --level) - while (Cmp::Lt(*node->next[level]->key, key)) - node = node->next[level]; - - node = node->next[0]; - if (node != m_stop && Cmp::Eq(*node->key, *m_stop->key)) { - if (tag) - *tag = node; - return node->object; - } - else { - if (tag) - *tag = nil; - return nil; - } -} - -//============================================================================ -template -T * TSkipList::FindNext (SkipListTag * tag) const { - - Node * node = (Node *)*tag; - - m_stop->key = node->key; - for (int level = (int)node->level; level >= 0; --level) - while (Cmp::Lt(*node->next[level]->key, *m_stop->key)) - node = node->next[level]; - - node = node->next[0]; - if (node != m_stop && Cmp::Eq(*node->key, *m_stop->key)) { - *tag = node; - return node->object; - } - else { - *tag = nil; - return nil; - } -} - -//============================================================================ -template -T * TSkipList::Head (SkipListTag * tag) const { - - ASSERT(tag); - Node * first = m_head->next[0]; - if (first == m_stop) { - *tag = nil; - return nil; - } - - *tag = first; - return first->object; -} - -//============================================================================ -template -T * TSkipList::Next (SkipListTag * tag) const { - - ASSERT(tag); - Node * node = (Node *)*tag; - ASSERT(node); - if (node->next[0] == m_stop) { - *tag = nil; - return nil; - } - - *tag = node->next[0]; - return node->next[0]->object; -} - -//============================================================================ -template -T * TSkipList::Prev (SkipListTag * tag) const { - - ASSERT(tag); - Node * node = (Node *)*tag; - ASSERT(node); - if (node->prev == m_head) { - *tag = nil; - return nil; - } - - *tag = node->prev; - return node->prev->object; -} - -//============================================================================ -template -T * TSkipList::Tail (SkipListTag * tag) const { - - ASSERT(tag); - Node * last = m_stop->prev; - if (last == m_head) { - *tag = nil; - return nil; - } - - *tag = last; - return last->object; -} - -//============================================================================ -template -void TSkipList::Link (T * object) { - - const K * key = (const K *)((const uint8_t *)object + keyOffset); - - // Find the node's insertion point - m_stop->key = key; - Node * update[kMaxLevels]; - Node * node = m_head; - for (int level = (int)m_level; level >= 0; --level) { - while (Cmp::Lt(*node->next[level]->key, *key)) - node = node->next[level]; - update[level] = node; - } - node = node->next[0]; - - { - // Select a level for the skip node - unsigned newLevel = RandomLevel(); - if (newLevel > m_level) { - if (m_level < kMaxLevels - 1) { - newLevel = ++m_level; - update[newLevel] = m_head; - } - else - newLevel = m_level; - } - - // Create the node and insert it into the skip list - Node * node = AllocNode(newLevel); - node->key = key; - node->object = object; - for (unsigned level = newLevel; level >= 1; --level) { - node->next[level] = update[level]->next[level]; - update[level]->next[level] = node; - } - node->prev = update[0]; - node->next[0] = update[0]->next[0]; - update[0]->next[0]->prev = node; - update[0]->next[0] = node; - } -} - -//============================================================================ -template -void TSkipList::Unlink (T * object) { - - const K * key = (const K *)((const uint8_t *)object + keyOffset); - - Node * node = m_head; - Node * update[kMaxLevels]; - int level = m_level; - - for (;;) { - // Find the node being unlinked - m_stop->key = key; - for (; level >= 0; --level) { - while (Cmp::Lt(*node->next[level]->key, *key)) - node = node->next[level]; - update[level] = node; - } - node = node->next[0]; - - // Node wasn't found so do nothing - if (*node->key != *key || node == m_stop) - return; - - if (node->object == object) - break; - } - - // Update all links - for (level = m_level; level >= 1; --level) { - if (update[level]->next[level] != node) - continue; - update[level]->next[level] = node->next[level]; - } - ASSERT(update[0]->next[0] == node); - node->next[0]->prev = update[0]; - update[0]->next[0] = node->next[0]; - - // Update header - while (m_level && m_head->next[m_level] == m_stop) - --m_level; - - FreeNode(node); -} - -//============================================================================ -template -void TSkipList::UnlinkAll () { - - Node * ptr = m_head->next[0]; - while (ptr != m_stop) { - Node * next = ptr->next[0]; - FreeNode(ptr); - ptr = next; - } - - m_stop->prev = m_head; - for (unsigned index = 0; index < kMaxLevels; ++index) - m_head->next[index] = m_stop; - m_level = 0; -} diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.cpp b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.cpp deleted file mode 100644 index c05a93e3..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.cpp +++ /dev/null @@ -1,301 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.cpp -* -***/ - -#include "../Pch.h" -#pragma hdrstop - -#define SUBST_BLOCK SubstParsedData::SubstBlock - -/***************************************************************************** -* -* Internal functions -* -***/ - -//============================================================================ -template -bool IVarSubstitute ( - ARRAY(chartype) * dst, - const chartype src[], - unsigned varCount, - const chartype * varNames[], // [varCount] - const chartype * varValues[] // [varCount] -) { - ASSERT(dst); - ASSERT(src); - ASSERT(varNames); - ASSERT(varValues); - - dst->Reserve(StrLen(src) * 5/4); - - bool result = true; - while (*src) { - // Copy non-substituted strings and escape %% symbols - if ((*src != L'%') || (*++src == L'%')) { - dst->Push(*src++); - continue; - } - - // Find variable definition - const chartype * varStart = src; - const chartype * varEnd = StrChr(varStart, L'%'); - if (!varEnd) { - // Skip % character and continue - result = false; - continue; - } - - // Validate variable name length - chartype varBuffer[256]; - if (varEnd - varStart >= arrsize(varBuffer)) { - result = false; - src = varEnd + 1; - continue; - } - - // Copy variable name excluding trailing '%' - StrCopy(varBuffer, varStart, varEnd - varStart + 1); - src = varEnd + 1; - - // Find the variable value and perform substitution - bool found = false; - for (unsigned i = 0; i < varCount; ++i) { - if (StrCmp(varBuffer, varNames[i])) - continue; - dst->Add(varValues[i], StrLen(varValues[i])); - found = true; - break; - } - - // Check that variable definition exists - result = result && found; - } - - // Terminate string - dst->Push(0); - return result; -} - -//============================================================================ -template -bool IParseForSubst ( - SubstParsedData * dest, - const chartype src[] -) { - const chartype * current = src; - bool result = true; - while (*current) { - // Copy non-substituted strings and escape %% symbols - if ((*current != L'%') || (*++current == L'%')) { - current++; - continue; - } - - // Find variable definition - const chartype * varStart = current; - const chartype * varEnd = StrChr(varStart, L'%'); - if (!varEnd) { - // Skip % character and continue - result = false; - continue; - } - - // We've found a variable, copy the current data to a new object - if (current != src) { - int strLen = (current - src) - 1; - SUBST_BLOCK * block = new SUBST_BLOCK; - block->isVar = false; - block->strLen = strLen; - block->data = (chartype*)calloc((strLen + 1), sizeof(chartype)); - memcpy(block->data, src, strLen * sizeof(chartype)); - - dest->blocks.Add(block); - } - - // Validate variable name length - if (varEnd - varStart >= 256) { - result = false; - src = current = varEnd + 1; - continue; - } - - // Copy variable name excluding trailing '%' - int strLen = (varEnd - varStart); - SUBST_BLOCK * block = new SUBST_BLOCK; - block->isVar = true; - block->strLen = strLen; - block->data = (chartype*)calloc((strLen + 1), sizeof(chartype)); - memcpy(block->data, varStart, strLen * sizeof(chartype)); - - dest->blocks.Add(block); - - src = current = varEnd + 1; - } - - // Check and see if there's any data remaining - if (current != src) { - int strLen = (current - src); - SUBST_BLOCK * block = new SUBST_BLOCK; - block->isVar = false; - block->strLen = strLen; - block->data = (chartype*)calloc((strLen + 1), sizeof(chartype)); - memcpy(block->data, src, strLen * sizeof(chartype)); - - dest->blocks.Add(block); - } - - return result; -} - -//============================================================================ -template -bool IVarSubstPreParsed ( - ARRAY(chartype) * dst, - const SubstParsedData * src, - unsigned varCount, - const chartype * varNames[], // [varCount] - const chartype * varValues[] // [varCount] -) { - unsigned approxTotalSize = 0; - for (unsigned i = 0; i < src->blocks.Count(); ++i) { - approxTotalSize += src->blocks[i]->strLen; - } - - dst->Reserve(approxTotalSize * 5/4); - - bool foundAll = true; - for (unsigned blockIndex = 0; blockIndex < src->blocks.Count(); ++blockIndex) { - SUBST_BLOCK * block = src->blocks[blockIndex]; - if (block->isVar) { - bool found = false; - for (unsigned varIndex = 0; varIndex < varCount; ++varIndex) { - if (StrCmp(block->data, varNames[varIndex])) { - continue; - } - - dst->Add(varValues[varIndex], StrLen(varValues[varIndex])); - found = true; - break; - } - - foundAll &= found; - } - else { - dst->Add(block->data, block->strLen); - } - } - dst->Push(0); - - return foundAll; -} - - -/***************************************************************************** -* -* Exports -* -***/ - -//============================================================================ -bool ParseForSubst ( - SubstParsedData * dest, - const wchar_t src[] -) { - return IParseForSubst(dest, src); -} - -//============================================================================ -bool ParseForSubst ( - SubstParsedData * dest, - const char src[] -) { - return IParseForSubst(dest, src); -} - -//============================================================================ -bool VarSubstitute ( - ARRAY(wchar_t) * dst, - const wchar_t src[], - unsigned varCount, - const wchar_t * varNames[], // [varCount] - const wchar_t * varValues[] // [varCount] -) { - return IVarSubstitute(dst, src, varCount, varNames, varValues); -} - -//============================================================================ -bool VarSubstitute ( - ARRAY(char) * dst, - const char src[], - unsigned varCount, - const char * varNames[], // [varCount] - const char * varValues[] // [varCount] -) { - return IVarSubstitute(dst, src, varCount, varNames, varValues); -} - -//============================================================================ -bool VarSubstitute ( - ARRAY(wchar_t) * dst, - const SubstParsedData * src, - unsigned varCount, - const wchar_t * varNames[], // [varCount] - const wchar_t * varValues[] // [varCount] -) { - return IVarSubstPreParsed(dst, src, varCount, varNames, varValues); -} - -//============================================================================ -bool VarSubstitute ( - ARRAY(char) * dst, - const SubstParsedData * src, - unsigned varCount, - const char * varNames[], // [varCount] - const char * varValues[] // [varCount] -) { - return IVarSubstPreParsed(dst, src, varCount, varNames, varValues); -} diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h deleted file mode 100644 index 0490e76c..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h +++ /dev/null @@ -1,119 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h -* -***/ - -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSUBST_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h included more than once" -#endif -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSUBST_H - -template -struct SubstParsedData { - template - struct SubstBlock { - bool isVar; - char_type * data; - unsigned strLen; - - SubstBlock() - : isVar(false) - , data(nil) - { - } - - ~SubstBlock() { - free(data); - } - }; - - ARRAY(SubstBlock*) blocks; - - ~SubstParsedData() { - for (unsigned i = 0; i < blocks.Count(); ++i) { - SubstBlock * block = blocks[i]; - delete block; - } - } -}; - -bool ParseForSubst ( - SubstParsedData * dest, - const wchar_t src[] -); -bool ParseForSubst ( - SubstParsedData * dest, - const char src[] -); - -// Return value is for validation purposes only; it may be ignored -bool VarSubstitute ( - ARRAY(wchar_t) * dst, - const wchar_t src[], - unsigned varCount, - const wchar_t * varNames[], // [varCount] - const wchar_t * varValues[] // [varCount] -); -bool VarSubstitute ( - ARRAY(char) * dst, - const char src[], - unsigned varCount, - const char * varNames[], // [varCount] - const char * varValues[] // [varCount] -); -bool VarSubstitute ( - ARRAY(wchar_t) * dst, - const SubstParsedData * src, - unsigned varCount, - const wchar_t * varNames[], // [varCount] - const wchar_t * varValues[] // [varCount] -); -bool VarSubstitute ( - ARRAY(char) * dst, - const SubstParsedData * src, - unsigned varCount, - const char * varNames[], // [varCount] - const char * varValues[] // [varCount] -); diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTypes.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTypes.h deleted file mode 100644 index f383f432..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTypes.h +++ /dev/null @@ -1,57 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -Additional permissions under GNU GPL version 3 section 7 - -If you modify this Program, or any covered work, by linking or -combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, -NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent -JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK -(or a modified version of those libraries), -containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, -PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG -JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the -licensors of this Program grant you additional -permission to convey the resulting work. Corresponding Source for a -non-source form of such a combination shall include the source code for -the parts of OpenSSL and IJG JPEG Library used as well as that of the covered -work. - -You can contact Cyan Worlds, Inc. by email legal@cyan.com - or by snail mail at: - Cyan Worlds, Inc. - 14617 N Newport Hwy - Mead, WA 99021 - -*==LICENSE==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTypes.h -* -* -* By Eric Anderson (10/10/2005) -* Copyright 2005 Cyan Worlds, Inc. -* -***/ - -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTYPES_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTypes.h included more than once" -#endif -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTYPES_H - - diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxStr.cpp b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxStr.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxStr.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxStr.cpp index 768543e3..c375c701 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxStr.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxStr.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtStr.h" #ifdef HS_BUILD_FOR_UNIX diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxSync.cpp b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxSync.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxSync.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxSync.cpp index de4510ef..c43bfea2 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxSync.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxSync.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtSync.h" #ifdef HS_BUILD_FOR_UNIX diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxUuid.cpp b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxUuid.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp index ca4f3f7c..25601fe2 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxUuid.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop - +#include "../pnUtUuid.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/W32Int.h b/Sources/Plasma/NucleusLib/pnUtils/Win32/W32Int.h similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/W32Int.h rename to Sources/Plasma/NucleusLib/pnUtils/Win32/W32Int.h diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Addr.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Addr.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp index 4e7c8545..b043a71f 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Addr.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Dll.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Dll.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp index ff2a53d5..9c32e117 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Dll.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Misc.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Misc.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp index 841fc7cf..e6a9837b 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Misc.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" /***************************************************************************** * @@ -142,6 +141,7 @@ void CpuGetInfo ( uint32_t flags[2] = { 0, 0 }; cpuVendor[0] = 0; +#ifdef _MSC_VER _asm { // Detect if cpuid instruction is supported by attempting // to change the ID bit of EFLAGS @@ -188,6 +188,7 @@ void CpuGetInfo ( DONE: } +#endif // Decode capability flags const static struct CpuCap { diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Path.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Path.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Path.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Path.cpp index b81d199c..ccc846a6 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Path.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Path.cpp @@ -45,8 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" +#include "pnProduct/pnProduct.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Str.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Str.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Str.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Str.cpp index b7fc3b76..42edb140 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Str.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Str.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Sync.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Sync.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp index 17c96136..e5100e52 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Sync.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Time.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Time.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Time.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Time.cpp index cd4eea61..6f344434 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Time.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Time.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Uuid.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp similarity index 96% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Uuid.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp index c5a734b0..6c0b1c38 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Uuid.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp @@ -45,8 +45,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" +#include +#include #if 0 @@ -162,12 +163,12 @@ bool GuidIsNil (const Uuid & uuid) { const wchar_t * GuidToString (const Uuid & uuid, wchar_t * dst, unsigned chars) { wchar_t * src; RPC_STATUS s; - s = UuidToStringW( (GUID *) &uuid, (RPC_WSTR*)&src ); + s = UuidToStringW( (GUID *) &uuid, (unsigned short**)&src ); if (RPC_S_OK == s) StrCopy(dst, src, chars); else StrCopy(dst, L"", chars); - RpcStringFreeW( (RPC_WSTR *)&src ); + RpcStringFreeW( (unsigned short**)&src ); return dst; } diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.cpp index 6279e589..cc798f76 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtAddr.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.h similarity index 96% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.h index c31756c5..d0c28e9e 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.h @@ -45,11 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTADDR_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTADDR_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTADDR_H +#include "Pch.h" /***************************************************************************** * @@ -168,3 +167,4 @@ unsigned NetAddressGetLocal ( unsigned count, NetAddressNode addresses[] ); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAllIncludes.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAllIncludes.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h index b3b1cffa..96305333 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAllIncludes.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h @@ -70,9 +70,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnUtMisc.h" #include "pnUtCrypt.h" #include "pnUtSpareList.h" -#include "pnUtSubst.h" #include "pnUtRand.h" #include "pnUtBase64.h" -#include "pnUtSkipList.h" #endif // PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTALLINCLUDES_H diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtArray.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtArray.cpp index 52a74857..c7450c99 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtArray.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtArray.h" /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h index 14d97a77..38c32b8f 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h @@ -45,11 +45,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTARRAY_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTARRAY_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTARRAY_H +#include "Pch.h" +#include "pnUtSort.h" /**************************************************************************** * @@ -823,7 +823,7 @@ void TArray::AdjustSizeChunked (unsigned newAlloc, unsigned newCount) { // Process growing the allocation else - newAlloc = CalcAllocGrowth(newAlloc, this->m_alloc, &this->m_chunkSize); + newAlloc = this->CalcAllocGrowth(newAlloc, this->m_alloc, &this->m_chunkSize); // Perform the allocation this->AdjustSize(newAlloc, newCount); @@ -1081,3 +1081,4 @@ void TSortArray::Sort () { SortKey(elem1) > SortKey(elem2) ); } +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.cpp index 5f2a5c2a..09f10687 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtBase64.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.h similarity index 94% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.h index b2c49769..f6635ebe 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.h @@ -45,11 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBASE64_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBASE64_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBASE64_H +#include "Pch.h" /***************************************************************************** @@ -83,3 +82,4 @@ unsigned Base64Decode ( unsigned dstChars, uint8_t * dstData ); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.cpp index 270e83e6..1537c322 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtBigNum.h" #include #include diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.h similarity index 97% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.h index 675ab4bd..c6e6f94d 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.h @@ -45,11 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBIGNUM_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBIGNUM_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBIGNUM_H +#include "Pch.h" /***************************************************************************** * @@ -227,3 +226,4 @@ public: BN_sub(&m_number, &a.m_number, &b.m_number); } }; +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.cpp index 214c7b8d..5f71810b 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.cpp @@ -45,8 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtCmd.h" +#include "pnUtMisc.h" /***************************************************************************** @@ -61,7 +61,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define TOGGLES L"+-" #define ALL WHITESPACE FLAGS SEPARATORS TOGGLES +#if HS_BUILD_FOR_WIN32 static const unsigned kMaxTokenLength = MAX_PATH; +#else +static const unsigned kMaxTokenLength = 1024; +#endif struct CmdArgData { CmdArgDef def; diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.h similarity index 96% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.h index 59fadcf5..08c83364 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.h @@ -45,11 +45,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCMD_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCMD_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCMD_H +#include "Pch.h" +#include "pnUtArray.h" +#include "pnUtStr.h" /***************************************************************************** * @@ -142,3 +143,4 @@ public: ); }; +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCoreLib.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h similarity index 92% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCoreLib.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h index ff4a66f9..c5437947 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCoreLib.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCORELIB_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCoreLib.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCORELIB_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCORELIB_H #pragma warning(push, 0) @@ -58,3 +56,4 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStream.h" #pragma warning(pop) +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp index 1ec4a4ff..1b303595 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp @@ -45,8 +45,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtCrypt.h" +#include "pnUtStr.h" +#include "pnUtTime.h" #include #include @@ -361,13 +362,13 @@ void CryptHashPasswordChallenge ( const ShaDigest & namePassHash, ShaDigest * challengeHash ) { - #include +#pragma pack(push, 1) struct { uint32_t clientChallenge; uint32_t serverChallenge; ShaDigest namePassHash; } buffer; - #include +#pragma pack(pop) buffer.clientChallenge = clientChallenge; buffer.serverChallenge = serverChallenge; buffer.namePassHash = namePassHash; diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h similarity index 96% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h index ea08772e..fcce7340 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h @@ -45,11 +45,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCRYPT_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCRYPT_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCRYPT_H +#include "Pch.h" +#include "pnUtArray.h" /***************************************************************************** * @@ -180,3 +180,4 @@ void CryptDecrypt ( unsigned bytes, void * data ); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtHash.cpp index 62cf25f6..92cfb159 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.cpp @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop - +#include "pnUtHash.h" /**************************************************************************** * @@ -91,4 +89,4 @@ const uint32_t CHashValue::s_hashTable[] = { 0x4f23137b, 0x9dfd6434, 0xd1e25d94, 0xbad4c88a, 0x0746edf9, 0x8103a9aa, 0xc8c73617, 0xe0f2759a, 0x00161c79, 0xd4545360, 0x1763cc5b, 0x296361fa, 0xbc35858d, 0xdaed5e93, 0x0b9d0aed, 0x01c45a64, }; - \ No newline at end of file + diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h index b2237185..1f44c2d9 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h @@ -45,11 +45,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTHASH_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTHASH_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTHASH_H +#include "Pch.h" +#include "pnUtList.h" +#include "pnUtArray.h" +#include "pnUtMath.h" +#include "pnUtStr.h" /**************************************************************************** * @@ -534,7 +537,7 @@ const T * THashTable::Find (const K & key) const { unsigned hash = key.GetHash(); const LIST(T) & slotList = this->GetSlotList(hash); for (const T * curr = slotList.Head(); curr; curr = slotList.Next(curr)) - if ((GetHash(curr) == hash) && (*curr == key)) + if ((this->GetHash(curr) == hash) && (*curr == key)) return curr; return nil; } @@ -742,3 +745,4 @@ typedef THashKeyStr< wchar_t, THashKeyStrCmp > CHashKeyStr; typedef THashKeyStr< wchar_t, THashKeyStrCmpI > CHashKeyStrI; typedef THashKeyStr< char, THashKeyStrCmp > CHashKeyStrChar; typedef THashKeyStr< char, THashKeyStrCmpI > CHashKeyStrCharI; +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtList.cpp index 819dc6f2..7ca34e6d 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtList.h" /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtList.h index 2abbbf8d..f9a17bb1 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h @@ -45,11 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTLIST_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTLIST_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTLIST_H +#include "Pch.h" /**************************************************************************** * @@ -640,3 +639,4 @@ template void TListDyn::Initialize (int linkOffset) { this->SetLinkOffset(linkOffset); } +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp new file mode 100644 index 00000000..431ea740 --- /dev/null +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp @@ -0,0 +1,63 @@ +/*==LICENSE==* + +CyanWorlds.com Engine - MMOG client, server and tools +Copyright (C) 2011 Cyan Worlds, Inc. + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . + +Additional permissions under GNU GPL version 3 section 7 + +If you modify this Program, or any covered work, by linking or +combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK, +NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent +JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK +(or a modified version of those libraries), +containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA, +PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG +JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the +licensors of this Program grant you additional +permission to convey the resulting work. Corresponding Source for a +non-source form of such a combination shall include the source code for +the parts of OpenSSL and IJG JPEG Library used as well as that of the covered +work. + +You can contact Cyan Worlds, Inc. by email legal@cyan.com + or by snail mail at: + Cyan Worlds, Inc. + 14617 N Newport Hwy + Mead, WA 99021 + +*==LICENSE==*/ +/***************************************************************************** +* +* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.cpp +* +***/ + +#include "pnUtMath.h" + + +/***************************************************************************** +* +* Exported bit manipulation functions +* +***/ + +//=========================================================================== + +unsigned MathHighBitPos (uint32_t val) { + ASSERT(val); + double f = (double)val; + return (*((uint32_t *)&f + 1) >> 20) - 1023; +} diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h similarity index 88% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h index a73362af..7080bb83 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h @@ -45,24 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMATH_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMATH_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMATH_H - -/***************************************************************************** -* -* Calling conventions -* -***/ - -#ifdef _M_IX86 -#define MATHCALL __fastcall -#else -#define MATHCALL -#endif - +#include "Pch.h" /***************************************************************************** * @@ -70,8 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -unsigned MATHCALL MathLowBitPos (uint32_t val); -unsigned MATHCALL MathHighBitPos (uint32_t val); +unsigned MathHighBitPos (uint32_t val); //=========================================================================== inline unsigned MathBitCount (uint32_t val) { @@ -114,3 +99,4 @@ inline unsigned MathNextMultiplePow2 (unsigned val, unsigned multiple) { inline uint32_t MathNextPow2 (uint32_t val) { return MathIsPow2(val) ? val : 1 << (MathHighBitPos(val) + 1); } +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.cpp index 3b451fec..76ad8bd2 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtMisc.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.h similarity index 96% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.h index ea9d425f..5e400013 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.h @@ -45,11 +45,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMISC_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMISC_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMISC_H +#include "Pch.h" +#include "pnUtArray.h" /***************************************************************************** * @@ -164,3 +164,4 @@ const unsigned kCpuCapTsc = 1<<9; // time stamp counter #define CPU_SIGNATURE_FAMILY(sig) ((sig >> 8) & 0xf) #define CPU_SIGNATURE_MODEL(sig) ((sig >> 4) & 0xf) #define CPU_SIGNATURE_STEPPING(sig) (sig & 0xf) +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtPath.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtPath.cpp index c7d3b96a..77549696 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtPath.cpp @@ -45,8 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtPath.h" +#include "pnUtStr.h" /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtPath.h similarity index 97% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtPath.h index 47da6567..5eb8c9a4 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtPath.h @@ -45,11 +45,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPATH_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPATH_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPATH_H +#include "Pch.h" +#include "pnUtArray.h" /***************************************************************************** * @@ -323,3 +323,4 @@ void PathSplitEmail ( unsigned subDomainChars, // arrsize(subs[0]) --> 256 unsigned subDomainCount // arrsize(subs) --> 16 ); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPragma.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtPragma.h similarity index 92% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPragma.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtPragma.h index 6b99273e..0d16bcfa 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPragma.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtPragma.h @@ -45,11 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRAGMA_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPragma.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRAGMA_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRAGMA_H #pragma warning(disable: 4800) // 'type' : forcing value to bool 'true' or 'false' (performance warning) #pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h index a6852ac4..862970bd 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h @@ -45,11 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRIQ_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRIQ_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRIQ_H +#include "Pch.h" /**************************************************************************** * @@ -485,3 +484,4 @@ public: private: unsigned m_time; }; +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtRand.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtRand.cpp index 90fd78b2..4d30e7fe 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtRand.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtRand.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtRand.h similarity index 93% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtRand.h index 437a8664..5383d49d 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtRand.h @@ -45,11 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTRAND_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTRAND_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTRAND_H +#include "Pch.h" /***************************************************************************** * @@ -65,3 +64,4 @@ float RandFloat (); float RandFloat (float minVal, float maxVal); unsigned RandUnsigned (); unsigned RandUnsigned (unsigned minVal, unsigned maxVal); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtRef.h similarity index 96% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtRef.h index 2473c415..5b1f50f3 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtRef.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTREF_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTREF_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTREF_H @@ -179,3 +177,4 @@ protected: private: long m_ref; }; +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSort.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSort.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h index a26d8fb9..bd1752ec 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSort.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSORT_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSort.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSORT_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSORT_H @@ -239,3 +237,4 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *(addrOfIndex) = high - (ptr); \ \ } +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.cpp similarity index 97% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.cpp index 562bfafd..8bc75878 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtSpareList.h" /**************************************************************************** @@ -142,7 +141,7 @@ void CBaseSpareList::CleanUp (const char typeName[]) { #ifdef CLIENT { char buffer[256]; - StrPrintf(buffer, arrsize(buffer), "Memory leak: %s", typeName); + snprintf(buffer, arrsize(buffer), "Memory leak: %s", typeName); FATAL(buffer); } #else diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.h similarity index 95% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.h index 280c4b1c..ba660284 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.h @@ -45,11 +45,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSPARELIST_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSPARELIST_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSPARELIST_H +#include "Pch.h" +#include #ifdef HS_DEBUGGING @@ -145,3 +145,4 @@ template T * TSpareList::New () { return new(CBaseSpareList::Alloc(OBJECT_SIZE, typeid(T).name())) T; } +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp index d75b6d7b..016bb7b6 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtStr.h" /***************************************************************************** @@ -70,6 +69,25 @@ static uint32_t s_hashValue[] = { * Internal functions * ***/ +//=========================================================================== +template +static unsigned IStrLen (const chartype str[]) { + unsigned chars = 0; + for (; *str++; ++chars) + NULL_STMT; + return chars; +} + +//=========================================================================== +template +static void IStrCopy (chartype * dest, const chartype source[], unsigned chars) { + while ((chars > 1) && ((*dest = *source++) != 0)) { + --chars; + ++dest; + } + if (chars) + *dest = 0; +} //=========================================================================== template @@ -208,17 +226,6 @@ static int IStrCmpI (const chartype str1[], const chartype str2[], unsigned char return 0; } -//=========================================================================== -template -static void IStrCopy (chartype * dest, const chartype source[], unsigned chars) { - while ((chars > 1) && ((*dest = *source++) != 0)) { - --chars; - ++dest; - } - if (chars) - *dest = 0; -} - //=========================================================================== // returns StrLen(dest) template @@ -285,15 +292,6 @@ static chartype * IStrStrI (chartype source[], const chartype match[]) { return nil; } -//=========================================================================== -template -static unsigned IStrLen (const chartype str[]) { - unsigned chars = 0; - for (; *str++; ++chars) - NULL_STMT; - return chars; -} - //=========================================================================== template static void IStrLower (chartype * dest, unsigned chars) { @@ -522,7 +520,7 @@ const wchar_t * StrChrR (const wchar_t str[], wchar_t ch) { unsigned StrPrintf (char * dest, unsigned count, const char format[], ...) { va_list argList; va_start(argList, format); - int result = _vsnprintf((char *)dest, count, (const char *)format, argList); + int result = hsVsnprintf((char *)dest, count, (const char *)format, argList); va_end(argList); return IStrPrintfValidate(dest, count, result); } @@ -531,20 +529,20 @@ unsigned StrPrintf (char * dest, unsigned count, const char format[], ...) { unsigned StrPrintf (wchar_t * dest, unsigned count, const wchar_t format[], ...) { va_list argList; va_start(argList, format); - int result = _vsnwprintf(dest, count, format, argList); + int result = hsVsnwprintf(dest, count, format, argList); va_end(argList); return IStrPrintfValidate(dest, count, result); } //=========================================================================== unsigned StrPrintfV (char * dest, unsigned count, const char format[], va_list args) { - int result = _vsnprintf(dest, count, format, args); + int result = hsVsnprintf(dest, count, format, args); return IStrPrintfValidate(dest, count, result); } //=========================================================================== unsigned StrPrintfV (wchar_t * dest, unsigned count, const wchar_t format[], va_list args) { - int result = _vsnwprintf(dest, count, format, args); + int result = hsVsnwprintf(dest, count, format, args); return IStrPrintfValidate(dest, count, result); } diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h similarity index 97% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h index 538f0437..3ab23464 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h @@ -45,11 +45,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSTR_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSTR_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSTR_H +#include "Pch.h" +#include "pnUtArray.h" +#include /***************************************************************************** * @@ -154,3 +155,4 @@ bool StrTokenize (const char * source[], char * dest, unsigned chars, const char bool StrTokenize (const wchar_t * source[], wchar_t * dest, unsigned chars, const wchar_t whitespace[], unsigned maxWhitespaceSkipCount = (unsigned)-1); bool StrTokenize (const char * source[], ARRAY(char) * destArray, const char whitespace[], unsigned maxWhitespaceSkipCount = (unsigned)-1); bool StrTokenize (const wchar_t * source[], ARRAY(wchar_t) * destArray, const wchar_t whitespace[], unsigned maxWhitespaceSkipCount = (unsigned)-1); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSync.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h similarity index 93% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSync.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h index 3af3370b..750b5bb7 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSync.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h @@ -45,11 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSYNC_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSync.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSYNC_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSYNC_H +#include "Pch.h" /**************************************************************************** * @@ -105,9 +104,9 @@ public: #ifdef HS_BUILD_FOR_WIN32 typedef HANDLE EventHandle; -#else -# error "CEvent: Not implemented on this platform" -#endif +//#else +//# error "CEvent: Not implemented on this platform" +//#endif const unsigned kEventWaitForever = (unsigned)-1; @@ -131,4 +130,6 @@ public: const EventHandle & Handle () const { return m_handle; } }; +#endif // HS_BUILD_FOR_WIN32 +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp index 64f1104e..4f892520 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtTime.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h similarity index 95% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h index 6adebaef..6140683c 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h @@ -45,11 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTIME_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTIME_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTIME_H +#include "Pch.h" /***************************************************************************** * @@ -127,3 +126,4 @@ uint32_t TimeGetSecondsSince1970Utc (); static const uint64_t kTime1601To1970 = 11644473600 * kTimeIntervalsPerSecond; static const uint64_t kTime1601To2001 = 12622780800 * kTimeIntervalsPerSecond; +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtTls.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtTls.cpp index 5686cba8..730af543 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtTls.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtTls.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtTls.h similarity index 93% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtTls.h index 6e9e265c..815c22f6 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtTls.h @@ -45,11 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTLS_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTLS_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTLS_H +#include "Pch.h" /***************************************************************************** * @@ -70,3 +69,4 @@ void ThreadLocalSetValue (unsigned id, void * value); void ThreadAllowBlock (); void ThreadDenyBlock (); void ThreadAssertCanBlock (const char file[], int line); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp index d9997ffc..c5f31c32 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp @@ -45,8 +45,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtUuid.h" +#include "pnUtHash.h" +#include "pnUtStr.h" const Uuid kNilGuid; diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h similarity index 95% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h index ab58f1f1..875adcf9 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h @@ -45,11 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTUUID_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTUUID_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTUUID_H +#include "Pch.h" /***************************************************************************** * @@ -96,7 +95,7 @@ bool GuidFromHex (const uint8_t buf[], unsigned length, Uuid * uuid); * ***/ -#include +#pragma pack(push, 1) struct Uuid { union { uint32_t uint32_ts[4]; @@ -114,6 +113,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 - +#pragma pack(pop) +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtils.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtils.h index 7aa14fc2..cb1e601d 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtils.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtils.h @@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PNUTILS_H -#include "Private/pnUtAllIncludes.h" +#include "pnUtAllIncludes.h" #endif // PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PNUTILS_H diff --git a/Sources/Plasma/NucleusLib/pnUtilsExe/Pch.h b/Sources/Plasma/NucleusLib/pnUtilsExe/Pch.h index aceee762..32908b69 100644 --- a/Sources/Plasma/NucleusLib/pnUtilsExe/Pch.h +++ b/Sources/Plasma/NucleusLib/pnUtilsExe/Pch.h @@ -51,7 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILSEXE_PCH_H -#include "pnUtils/Pch.h" +#include "pnUtils/pnUtils.h" #include "Intern.h" #include diff --git a/Sources/Plasma/NucleusLib/pnUtilsExe/Private/pnUteTls.cpp b/Sources/Plasma/NucleusLib/pnUtilsExe/Private/pnUteTls.cpp index a2354b39..4001806b 100644 --- a/Sources/Plasma/NucleusLib/pnUtilsExe/Private/pnUteTls.cpp +++ b/Sources/Plasma/NucleusLib/pnUtilsExe/Private/pnUteTls.cpp @@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "../Pch.h" #pragma hdrstop +#if HS_BUILD_FOR_WIN32 /***************************************************************************** * @@ -105,3 +106,5 @@ void ThreadAssertCanBlock (const char file[], int line) { if (ThreadLocalGetValue(s_tlsNoBlock)) ErrorAssert(line, file, "This thread may not block"); } + +#endif diff --git a/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp b/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp index 9a4d2352..c7599db3 100644 --- a/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp +++ b/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp @@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "plResPatcher.h" +#include "hsResMgr.h" #include "plAgeLoader/plAgeLoader.h" #include "plCompression/plZlibStream.h" @@ -50,6 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnNetBase/pnNbError.h" #include "plNetGameLib/plNetGameLib.h" #include "plProgressMgr/plProgressMgr.h" +#include "plResMgr/plResManager.h" #include "plStatusLog/plStatusLog.h" ///////////////////////////////////////////////////////////////////////////// @@ -57,15 +59,28 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com class plResDownloadStream : public plZlibStream { plOperationProgress* fProgress; + char* fFilename; bool fIsZipped; public: plResDownloadStream(plOperationProgress* prog, const wchar_t* reqFile) - : fProgress(prog) + : fProgress(prog), fFilename(nil) { fIsZipped = wcscmp(plFileUtils::GetFileExt(reqFile), L"gz") == 0; } + ~plResDownloadStream() + { + if (fFilename) + delete[] fFilename; + } + + hsBool Open(const char* filename, const char* mode) + { + fFilename = hsStrcpy(filename); + return plZlibStream::Open(filename, mode); + } + uint32_t Write(uint32_t count, const void* buf) { fProgress->Increment((float)count); @@ -74,6 +89,9 @@ public: else return fOutput->Write(count, buf); } + + bool IsZipped() const { return fIsZipped; } + void Unlink() const { plFileUtils::RemoveFile(fFilename); } }; ///////////////////////////////////////////////////////////////////////////// @@ -86,15 +104,23 @@ static void FileDownloaded( { plResPatcher* patcher = (plResPatcher*)param; char* name = hsWStringToString(filename); + if (((plResDownloadStream*)writer)->IsZipped()) + plFileUtils::StripExt(name); // Kill off .gz writer->Close(); - delete writer; switch (result) { case kNetSuccess: PatcherLog(kStatus, " Download Complete: %s", name); + + // If this is a PRP, then we need to add it to the ResManager + if (stricmp(plFileUtils::GetFileExt(name), "prp") == 0) + ((plResManager*)hsgResMgr::ResMgr())->AddSinglePage(name); + + // Continue down the warpath patcher->IssueRequest(); delete[] name; + delete writer; return; case kNetErrFileNotFound: PatcherLog(kError, " Download Failed: %s not found", name); @@ -107,8 +133,10 @@ static void FileDownloaded( } // Failure case + ((plResDownloadStream*)writer)->Unlink(); patcher->Finish(false); delete[] name; + delete writer; } static void ManifestDownloaded( @@ -215,6 +243,10 @@ void plResPatcher::IssueRequest() PatcherLog(kMajorStatus, " Downloading file... %s", eapSucksString); xtl::format(title, L"Downloading... %s", plFileUtils::GetFileName(req.fFriendlyName.c_str())); + // If this is a PRP, we need to unload it from the ResManager + if (stricmp(plFileUtils::GetFileExt(eapSucksString), "prp") == 0) + ((plResManager*)hsgResMgr::ResMgr())->RemoveSinglePage(eapSucksString); + plFileUtils::EnsureFilePathExists(req.fFriendlyName.c_str()); plResDownloadStream* stream = new plResDownloadStream(fProgress, req.fFile.c_str()); if(stream->Open(eapSucksString, "wb")) diff --git a/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp b/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp index 75a44c55..91c61abc 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp @@ -61,7 +61,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #if HS_BUILD_FOR_WIN32 -# ifdef DX_OLD_SDK +# if defined(DX_OLD_SDK) || defined(__MINGW32__) # include # else # include diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp index 266b3de8..c5d0154e 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp @@ -438,9 +438,9 @@ void plArmatureModBase::AdjustLOD() hsPoint3 delta = ourPos - camPos; float distanceSquared = delta.MagnitudeSquared(); if (distanceSquared < fLODDistance * fLODDistance) - SetLOD(__max(0, fMinLOD)); + SetLOD(max(0, fMinLOD)); else if (distanceSquared < fLODDistance * fLODDistance * 4.0) - SetLOD(__max(1, fMinLOD)); + SetLOD(max(1, fMinLOD)); else SetLOD(2); } @@ -1095,7 +1095,7 @@ hsBool plArmatureMod::MsgReceive(plMessage* msg) plCorrectionMsg *corMsg = plCorrectionMsg::ConvertNoRef(msg); if (corMsg) { - hsMatrix44 &correction = corMsg->fWorldToLocal * GetTarget(0)->GetLocalToWorld(); + hsMatrix44 correction = corMsg->fWorldToLocal * GetTarget(0)->GetLocalToWorld(); if (fBoneRootAnimator) fBoneRootAnimator->SetCorrection(correction); } @@ -2663,14 +2663,14 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, char *str hsMatrix44 l2w = SO->GetLocalToWorld(); hsPoint3 worldPos = l2w.GetTranslate(); - char *opaque = IsOpaque() ? "yes" : "no"; + const char *opaque = IsOpaque() ? "yes" : "no"; sprintf(strBuf, "position(world): %.2f, %.2f, %.2f Opaque: %3s", worldPos.fX, worldPos.fY, worldPos.fZ, opaque); debugTxt.DrawString(x, y, strBuf); y += lineHeight; hsPoint3 kPos; - char *kinematic = "n.a."; + const char *kinematic = "n.a."; const char* frozen = "n.a."; if (fController) { diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp index bfbcdf25..e9d42b0e 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp @@ -104,7 +104,7 @@ void plArmatureBehavior::DumpDebug(int &x, int &y, int lineHeight, char *strBuf, float strength = GetStrength(); const char *onOff = strength > 0 ? "on" : "off"; char blendBar[11] = "||||||||||"; - int bars = (int)__min(10 * strength, 10); + int bars = (int)min(10 * strength, 10); blendBar[bars] = '\0'; if (fAnim) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp index c0b5fb80..27d6cfcb 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp @@ -330,8 +330,8 @@ void plAvBrainCritter::SightCone(float coneRad) fSightConeAngle = coneRad; // calculate the minimum dot product for the cone of sight (angle/2 vector dotted with straight ahead) - hsVector3 straightVector(1, 0, 0), viewVector(1, 0, 0); - hsQuat rotation(fSightConeAngle/2, &hsVector3(0, 1, 0)); + hsVector3 straightVector(1, 0, 0), viewVector(1, 0, 0), up(0, 1, 0); + hsQuat rotation(fSightConeAngle/2, &up); viewVector = hsVector3(rotation.Rotate(&viewVector)); viewVector.Normalize(); fSightConeDotMin = straightVector * viewVector; diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp index 884a0f68..59ab447b 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp @@ -183,7 +183,7 @@ public: // hsAssert(0, "fixme physx"); float oldSpeed = fabs(fSwimBrain->fCallbackAction->GetTurnStrength()); float thisInc = elapsed * incPerSec; - float newSpeed = __min(oldSpeed + thisInc, maxTurnSpeed); + float newSpeed = min(oldSpeed + thisInc, maxTurnSpeed); fSwimBrain->fCallbackAction->SetTurnStrength(newSpeed * fAvMod->GetKeyTurnStrength() + fAvMod->GetAnalogTurnStrength()); // the turn is actually applied during PhysicsUpdate } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp index 946721a2..c59b5f4f 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp @@ -48,9 +48,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plPhysicalControllerCore.h" // Generic geom utils. -hsBool LinearVelocity(hsVector3 &outputV, float elapsed, hsMatrix44 &prevMat, hsMatrix44 &curMat); -void AngularVelocity(float &outputV, float elapsed, hsMatrix44 &prevMat, hsMatrix44 &curMat); -float AngleRad2d (float x1, float y1, float x3, float y3); +static hsBool LinearVelocity(hsVector3 &outputV, float elapsed, hsMatrix44 &prevMat, hsMatrix44 &curMat); +static void AngularVelocity(float &outputV, float elapsed, hsMatrix44 &prevMat, hsMatrix44 &curMat); +static float AngleRad2d (float x1, float y1, float x3, float y3); inline hsVector3 GetYAxis(hsMatrix44 &mat) { return hsVector3(mat.fMap[1][0], mat.fMap[1][1], mat.fMap[1][2]); @@ -195,7 +195,7 @@ bool plWalkingController::EnableControlledFlight(bool status) fWaitingForGround = true; } else - fControlledFlight = __max(--fControlledFlight, 0); + fControlledFlight = max(--fControlledFlight, 0); return status; } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h b/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h index b63cfbf7..42a710fa 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h @@ -100,4 +100,4 @@ protected: // Don't try to trigger during this time. }; -#endif plAvLadderMod_INC +#endif //plAvLadderMod_INC diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp index ee937f5c..c6964bf9 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp @@ -314,7 +314,8 @@ void plAvTaskSeek::LeaveAge(plArmatureMod *avatar) hsBool plAvTaskSeek::IAnalyze(plArmatureMod *avatar) { avatar->GetPositionAndRotationSim(&fPosition, &fRotation); - fGoalVec.Set(&(hsScalarTriple)(fSeekPos - fPosition)); + hsScalarTriple tmp(fSeekPos - fPosition); + fGoalVec.Set(&tmp); hsVector3 normalizedGoalVec(fGoalVec); normalizedGoalVec.Normalize(); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp index 73b538ee..b271b04e 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTemplates.h" #include "hsStream.h" #include "hsResMgr.h" -#include "plGDispatch.h" +#include "plgDispatch.h" #include "pnKeyedObject/plKey.h" #include "pnKeyedObject/plFixedKey.h" #include "pnSceneObject/plSceneObject.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h b/Sources/Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h index 551af57c..38a0cd29 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h @@ -99,7 +99,7 @@ public: static void HandleSingleSDR(const plStateDataRecord *sdr, plClothingOutfit *clothing = nil, plClosetItem *closetItem = nil); static void PutSingleItemIntoSDR(plClosetItem *item, plStateDataRecord *sdr); - static const plClothingSDLModifier *plClothingSDLModifier::FindClothingSDLModifier(const plSceneObject *obj); + static const plClothingSDLModifier *FindClothingSDLModifier(const plSceneObject *obj); }; #endif // plClothingSDLModifier_inc diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp index 8fcbc8c7..f43af2ec 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp @@ -48,8 +48,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plArmatureMod.h" // for LOS enum type #include "plMatrixChannel.h" #include "hsTimer.h" -#include "plPhysx/plSimulationMgr.h" -#include "plPhysx/plPXPhysical.h" +#include "plPhysX/plSimulationMgr.h" +#include "plPhysX/plPXPhysical.h" #include "pnMessage/plSetNetGroupIDMsg.h" #define kSWIMRADIUS 1.1f #define kSWIMHEIGHT 2.8f diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h b/Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h index ddc2f21a..13cecd34 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h @@ -158,7 +158,7 @@ public: plPointBlend(plPointChannel *channelA, plPointChannel *channelB, plScalarChannel *channelBias); virtual ~plPointBlend(); - plAGChannel * plPointBlend::Remove(plAGChannel *srceToRemove); + plAGChannel * Remove(plAGChannel *srceToRemove); const plPointChannel * GetPointChannelA() const { return fPointA; } void SetPointChannelA(plPointChannel *the_PointA) { fPointA = the_PointA; } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h b/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h index ff6c66a5..e99c417a 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h @@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ///////////////////////////////////////////////////////////////////////////////////////// #include "pnModifier/plSingleModifier.h" // base class -#include "pnKeyedobject/plKey.h" // for the notification keys +#include "pnKeyedObject/plKey.h" // for the notification keys #include "hsTemplates.h" // for the array they're kept in ///////////////////////////////////////////////////////////////////////////////////////// @@ -125,4 +125,4 @@ protected: -#endif plSittingModifier_inc +#endif //plSittingModifier_inc diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp index 30dd34df..0b174439 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp @@ -136,7 +136,8 @@ void plSwimCircularCurrentRegion::GetCurrent(plPhysicalControllerCore *physical, } hsPoint3 center, pos; - center.Set(&fCurrentSO->GetLocalToWorld().GetTranslate()); + hsScalarTriple xlate = fCurrentSO->GetLocalToWorld().GetTranslate(); + center.Set(&xlate); plKey worldKey = physical->GetSubworld(); if (worldKey) @@ -254,7 +255,8 @@ void plSwimStraightCurrentRegion::GetCurrent(plPhysicalControllerCore *physical, hsPoint3 center, pos; hsVector3 current = fCurrentSO->GetLocalToWorld() * hsVector3(0.f, 1.f, 0.f); - center.Set(&fCurrentSO->GetLocalToWorld().GetTranslate()); + hsScalarTriple xlate = fCurrentSO->GetLocalToWorld().GetTranslate(); + center.Set(&xlate); physical->GetPositionSim(pos); plKey worldKey = physical->GetSubworld(); diff --git a/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp b/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp index 52476bf5..03f0f172 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp @@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -#ifndef isnan +#ifdef HS_BUILD_FOR_WIN32 #define isnan _isnan #endif diff --git a/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp b/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp index f98f93d1..61817a24 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp @@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -#ifndef isnan +#ifdef HS_BUILD_FOR_WIN32 #define isnan _isnan #endif diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp index 35145eaa..d5d3f9ab 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp +++ b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp @@ -117,7 +117,7 @@ typedef int (__stdcall * Pfunc1) (const DIDEVICEINSTANCE* device, void* pRef); plInputManager* plInputManager::fInstance = nil; -plInputManager::plInputManager( HWND hWnd ) : +plInputManager::plInputManager( hsWindowHndl hWnd ) : fDInputMgr(nil), fInterfaceMgr(nil) { @@ -178,7 +178,7 @@ void plInputManager::CreateInterfaceMod(plPipeline* p) fInterfaceMgr->Init(); } -void plInputManager::InitDInput(HINSTANCE hInst, HWND hWnd) +void plInputManager::InitDInput(hsWindowInst hInst, hsWindowHndl hWnd) { if (fUseDInput) { @@ -259,8 +259,9 @@ plKeyDef plInputManager::UntranslateKey(plKeyDef key, hsBool extended) return key; } - -void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM Lparam, HWND hWnd) + +#if HS_BUILD_FOR_WIN32 +void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM Lparam, hsWindowHndl hWnd) { if( !fhWnd ) fhWnd = hWnd; @@ -294,7 +295,7 @@ void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM break; BYTE scan = (BYTE)(Lparam >> 16); - UINT vkey = MapVirtualKey(scan, MAPVK_VSC_TO_VK); + UINT vkey = MapVirtualKey(scan, 1); //MAPVK_VSC_TO_VK bExtended = Lparam >> 24 & 1; hsBool bRepeat = ((Lparam >> 29) & 0xf) != 0; @@ -431,6 +432,7 @@ void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM } } +#endif //// Activate //////////////////////////////////////////////////////////////// // Handles what happens when the app (window) activates/deactivates diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h index 3ebde4e4..d7c701a7 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h +++ b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h @@ -62,7 +62,7 @@ private: static hsBool fUseDInput; public: plInputManager(); - plInputManager( HWND hWnd ); + plInputManager( hsWindowHndl hWnd ); ~plInputManager(); CLASSNAME_REGISTER( plInputManager ); @@ -70,7 +70,7 @@ public: void AddInputDevice(plInputDevice* pDev); - void InitDInput(HINSTANCE hInst, HWND hWnd); + void InitDInput(hsWindowInst hInst, hsWindowHndl hWnd); static void UseDInput(hsBool b) { fUseDInput = b; } void Update(); @@ -97,16 +97,19 @@ protected: bool fActive, fFirstActivated; float fMouseScale; - static uint8_t bRecenterMouse; - static HWND fhWnd; + static uint8_t bRecenterMouse; + static hsWindowHndl fhWnd; public: +#if HS_BUILD_FOR_WIN32 // event handlers void HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM Lparam, HWND hWnd); +#endif }; - +#if HS_BUILD_FOR_WIN32 // {049DE53E-23A2-4d43-BF68-36AC1B57E357} static const GUID PL_ACTION_GUID = { 0x49de53e, 0x23a2, 0x4d43, { 0xbf, 0x68, 0x36, 0xac, 0x1b, 0x57, 0xe3, 0x57 } }; +#endif #endif diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp index 3baaa7f4..cd095f80 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp +++ b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp @@ -109,7 +109,7 @@ plSceneInputInterface::plSceneInputInterface() { fPipe = nil; fSpawnPoint = nil; - GuidClear(&fAgeInstanceGuid); + fAgeInstanceGuid.Clear(); fInstance = this; SetEnabled( true ); // Always enabled } @@ -608,7 +608,8 @@ hsBool plSceneInputInterface::MsgReceive( plMessage *msg ) if (fBookMode == kBookOffered) { // and put our own dialog back up... - ISendOfferNotification(plNetClientMgr::GetInstance()->GetLocalPlayerKey(), 0, false); + plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + ISendOfferNotification(avKey, 0, false); //IManageIgnoredAvatars(fOffereeKey, false); fOffereeKey = nil; fBookMode = kNotOffering; @@ -627,7 +628,8 @@ hsBool plSceneInputInterface::MsgReceive( plMessage *msg ) // tell them to ignore us plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kDisableAvatarClickable); - pMsg->SetAvKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); + plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + pMsg->SetAvKey(avKey); pMsg->SetBCastFlag(plMessage::kNetPropagate); pMsg->SetBCastFlag(plMessage::kNetForce); pMsg->SetBCastFlag(plMessage::kLocalPropagate, false); @@ -754,7 +756,8 @@ hsBool plSceneInputInterface::MsgReceive( plMessage *msg ) if (fBookMode == kBookOffered) { // and put our own dialog back up... - ISendOfferNotification(plNetClientMgr::GetInstance()->GetLocalPlayerKey(), 0, false); + plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + ISendOfferNotification(avKey, 0, false); //IManageIgnoredAvatars(fOffereeKey, false); fBookMode = kOfferBook; fOffereeKey = nil; @@ -790,7 +793,7 @@ hsBool plSceneInputInterface::MsgReceive( plMessage *msg ) } else if ( mgrMsg->GetCommand() == plInputIfaceMgrMsg::kSetShareAgeInstanceGuid ) { - fAgeInstanceGuid = mgrMsg->GetAgeInstanceGuid(); + fAgeInstanceGuid = plUUID(mgrMsg->GetAgeInstanceGuid()); } } plVaultNotifyMsg* pVaultMsg = plVaultNotifyMsg::ConvertNoRef(msg); @@ -817,20 +820,21 @@ void plSceneInputInterface::ILinkOffereeToAge() info.SetAgeFilename(fOfferedAgeFile); info.SetAgeInstanceName(fOfferedAgeInstance); - bool isAgeInstanceGuidSet = !GuidIsNil(fAgeInstanceGuid); + bool isAgeInstanceGuidSet = fAgeInstanceGuid.IsSet(); plAgeLinkStruct link; if (isAgeInstanceGuidSet) { - info.SetAgeInstanceGuid(&plUUID(fAgeInstanceGuid)); + info.SetAgeInstanceGuid(&fAgeInstanceGuid); link.GetAgeInfo()->CopyFrom(&info); - GuidClear(&fAgeInstanceGuid); + fAgeInstanceGuid.Clear(); } else if (!VaultGetOwnedAgeLink(&info, &link)) { // We must have an owned copy of the age before we can offer it, so make one now - info.SetAgeInstanceGuid(&plUUID(GuidGenerate())); + plUUID guid(GuidGenerate()); + info.SetAgeInstanceGuid(&guid); std::string title; std::string desc; @@ -858,7 +862,8 @@ void plSceneInputInterface::ILinkOffereeToAge() VaultAgeLinkNode linkAcc(linkNode); if (linkAcc.volat) { if (VaultUnregisterOwnedAgeAndWait(link.GetAgeInfo())) { - link.GetAgeInfo()->SetAgeInstanceGuid(&plUUID(GuidGenerate())); + plUUID guid(GuidGenerate()); + link.GetAgeInfo()->SetAgeInstanceGuid(&guid); VaultRegisterOwnedAgeAndWait(&link); } } @@ -882,7 +887,8 @@ void plSceneInputInterface::ILinkOffereeToAge() if (!fPendingLink && stricmp(fOfferedAgeFile, kPersonalAgeFilename)) { // tell our local dialog to pop up again... - ISendOfferNotification(plNetClientMgr::GetInstance()->GetLocalPlayerKey(), 0, false); + plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + ISendOfferNotification(avKey, 0, false); // make them clickable again(in case they come back?) //IManageIgnoredAvatars(fOffereeKey, false); @@ -1041,7 +1047,8 @@ hsBool plSceneInputInterface::InterpretInputEvent( plInputEventMsg *pMsg ) { // and put our own dialog back up... ISendOfferNotification(fOffereeKey, -999, true); - ISendOfferNotification(plNetClientMgr::GetInstance()->GetLocalPlayerKey(), 0, false); + plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + ISendOfferNotification(avKey, 0, false); //IManageIgnoredAvatars(fOffereeKey, false); fBookMode = kOfferBook; fOffereeKey = nil; @@ -1138,7 +1145,8 @@ void plSceneInputInterface::ISendAvatarDisabledNotification(hsBool enabled) pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kEnableAvatarClickable); else pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kDisableAvatarClickable); - pMsg->SetAvKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); + plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + pMsg->SetAvKey(avKey); pMsg->SetBCastFlag(plMessage::kNetPropagate); pMsg->SetBCastFlag(plMessage::kNetForce); pMsg->SetBCastFlag(plMessage::kLocalPropagate, false); @@ -1236,4 +1244,4 @@ uint32_t plSceneInputInterface::SetCurrentCursorID(uint32_t id) void plSceneInputInterface::RequestAvatarTurnToPointLOS() { IRequestLOSCheck( plMouseDevice::Instance()->GetCursorX(), plMouseDevice::Instance()->GetCursorY(), ID_FIND_WALKABLE_GROUND ); -} \ No newline at end of file +} diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h index 77ae0488..02a0fd2f 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h +++ b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h @@ -51,7 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plInputInterface.h" #include "hsGeometry3.h" #include "pnKeyedObject/plKey.h" -#include "pnUtils/pnUtils.h" +#include "pnUUID/pnUUID.h" //// Class Definition //////////////////////////////////////////////////////// @@ -86,7 +86,7 @@ class plSceneInputInterface : public plInputInterface const char* fOfferedAgeFile; const char* fOfferedAgeInstance; const char* fSpawnPoint; - Uuid fAgeInstanceGuid; + plUUID fAgeInstanceGuid; struct clickableTest { clickableTest(plKey k) diff --git a/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h b/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h index 996c32b8..59da9b9c 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h @@ -45,8 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifndef PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNETCOMMMSGS_H -#define PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNETCOMMMSGS_H +#ifndef plNetCommMsgs_inc +#define plNetCommMsgs_inc #include "pnUtils/pnUtils.h" @@ -54,7 +54,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnMessage/plMessage.h" #include "pnNetProtocol/pnNetProtocol.h" - class plNetCommReplyMsg : public plMessage { public: enum EParamType { @@ -173,4 +172,4 @@ public: -#endif // PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNETCOMMMSGS_H +#endif // plNetCommMsgs_inc diff --git a/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp index 65d177ca..400204fc 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp @@ -788,7 +788,7 @@ void plResponderModifier::ILog(uint32_t color, const char* format, ...) char buf[256]; va_list args; va_start(args, format); - int numWritten = _vsnprintf(buf, sizeof(buf), format, args); + int numWritten = hsVsnprintf(buf, sizeof(buf), format, args); hsAssert(numWritten > 0, "Buffer too small"); va_end(args); diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp index 4550df92..b9dd262c 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp @@ -461,7 +461,8 @@ void plNetClientMgr::StartLinkInFX() plLinkEffectsTriggerMsg* lem = new plLinkEffectsTriggerMsg(); lem->SetLeavingAge(false); // linking in lem->SetLinkKey(fLocalPlayerKey); - lem->SetLinkInAnimKey(avMod->GetLinkInAnimKey()); + plKey animKey = avMod->GetLinkInAnimKey(); + lem->SetLinkInAnimKey(animKey); // indicate if we are invisible if (avMod && avMod->IsInStealthMode() && avMod->GetTarget(0)) @@ -1284,7 +1285,7 @@ void plNetClientMgr::QueueDisableNet (bool showDlg, const char str[]) { msg->Ref(); fDisableMsg = msg; IDisableNet(); -#endif; +#endif } void plNetClientMgr::IDisableNet () { diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp index b40734cc..dd8b66fb 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp @@ -163,7 +163,8 @@ void plNetClientMgr::ISendCCRPetition(plCCRPetitionMsg* petMsg) // write config info formatted like an ini file to a buffer hsRAMStream ram; - info.WriteTo( &plIniStreamConfigSource( &ram ) ); + plIniStreamConfigSource src(&ram); + info.WriteTo(&src); int size = ram.GetPosition(); ram.Rewind(); std::string buf; diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp index e02efb53..6a70b069 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp @@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include +#include #include "hsMatrix44.h" #include "hsGeometry3.h" #include "plNetClientMgr.h" diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp index 15591b68..558554d4 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp @@ -402,8 +402,8 @@ MSG_HANDLER_DEFN(plNetClientMsgHandler,plNetMsgVoice) int bufLen = m->GetVoiceDataLen(); const char* buf = m->GetVoiceData(); - BYTE flags = m->GetFlags(); - BYTE numFrames = m->GetNumFrames(); + uint8_t flags = m->GetFlags(); + uint8_t numFrames = m->GetNumFrames(); plKey key = NULL; // plKey key=hsgResMgr::ResMgr()->FindKey(m->ObjectInfo()->GetUoid()); diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp index cdcf7064..50a080a5 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp @@ -47,6 +47,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetTransport/plNetTransportMember.h" // OfferLinkToPlayer() #include "plgDispatch.h" +#include "pnMessage/plClientMsg.h" #include "pnMessage/plTimeMsg.h" #include "plMessage/plLinkToAgeMsg.h" #include "pnKeyedObject/plKey.h" @@ -159,8 +160,21 @@ void plNetLinkingMgr::NCAgeJoinerCallback ( void * notify, void * userState ) { - plNetLinkingMgr * lm = plNetLinkingMgr::GetInstance(); + NCAgeJoinerCompleteNotify* params = (NCAgeJoinerCompleteNotify*)notify; + + // Tell the user we failed to link. + // In the future, we might want to try graceful recovery (link back to Relto?) + if (!params->success) { + plNetClientMgr::StaticErrorMsg(params->msg); + hsMessageBox(params->msg, "Linking Error", hsMessageBoxNormal, hsMessageBoxIconError); +#ifdef PLASMA_EXTERNAL_RELEASE + plClientMsg* clientMsg = new plClientMsg(plClientMsg::kQuit); + clientMsg->Send(hsgResMgr::ResMgr()->FindKey(kClient_KEY)); +#endif + return; + } + plNetLinkingMgr * lm = plNetLinkingMgr::GetInstance(); switch (type) { case kAgeJoinerComplete: { ASSERT(joiner == s_ageJoiner); @@ -912,8 +926,10 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) //-------------------------------------------------------------------- // BASIC LINK. Link to a unique instance of the age, if no instance specified. case plNetCommon::LinkingRules::kBasicLink: - if (!info->HasAgeInstanceGuid()) - info->SetAgeInstanceGuid(&plUUID(GuidGenerate())); + if (!info->HasAgeInstanceGuid()) { + plUUID newuuid(GuidGenerate()); + info->SetAgeInstanceGuid(&newuuid); + } break; //-------------------------------------------------------------------- @@ -952,7 +968,8 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) info->SetAgeDescription(desc.c_str()); } if (!info->HasAgeInstanceGuid()) { - info->SetAgeInstanceGuid(&plUUID(GuidGenerate())); + plUUID newuuid(GuidGenerate()); + info->SetAgeInstanceGuid(&newuuid); } // register this as an owned age now before we link to it. @@ -992,7 +1009,8 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) } if (!info->HasAgeInstanceGuid()) { - info->SetAgeInstanceGuid(&plUUID(GuidGenerate())); + plUUID newuuid(GuidGenerate()); + info->SetAgeInstanceGuid(&newuuid); } VaultRegisterOwnedAge(link); @@ -1078,10 +1096,10 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) case hsFail: success = kLinkFailed; break; - case FALSE: + case false: success = kLinkDeferred; break; - case TRUE: + case true: success = kLinkImmediately; } diff --git a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp index 8cc3e22a..1684c5d0 100644 --- a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp @@ -485,7 +485,7 @@ static void INetCliAuthDeletePlayerCallback ( ENetError result, void * param ) { - unsigned playerInt = (unsigned)param; + uint32_t playerInt = (uint32_t)((uintptr_t)param); if (IS_NET_ERROR(result)) { LogMsg(kLogDebug, L"Delete player failed: %d %s", playerInt, NetErrorToString(result)); @@ -493,16 +493,16 @@ static void INetCliAuthDeletePlayerCallback ( else { LogMsg(kLogDebug, L"Player deleted: %d", playerInt); - unsigned currPlayer = s_player ? s_player->playerInt : 0; + uint32_t currPlayer = s_player ? s_player->playerInt : 0; - {for (unsigned i = 0; i < s_players.Count(); ++i) { + {for (uint32_t i = 0; i < s_players.Count(); ++i) { if (s_players[i].playerInt == playerInt) { s_players.DeleteUnordered(i); break; } }} - {for (unsigned i = 0; i < s_players.Count(); ++i) { + {for (uint32_t i = 0; i < s_players.Count(); ++i) { if (s_players[i].playerInt == currPlayer) { s_player = &s_players[i]; break; @@ -512,7 +512,7 @@ static void INetCliAuthDeletePlayerCallback ( plAccountUpdateMsg* updateMsg = new plAccountUpdateMsg(plAccountUpdateMsg::kDeletePlayer); updateMsg->SetPlayerInt(playerInt); - updateMsg->SetResult((unsigned)result); + updateMsg->SetResult((uint32_t)result); updateMsg->SetBCastFlag(plMessage::kBCastByExactType); updateMsg->Send(); } @@ -638,7 +638,7 @@ static void INetCliAuthUpgradeVisitorRequestCallback ( ENetError result, void * param ) { - unsigned playerInt = (unsigned)param; + uint32_t playerInt = (uint32_t)((uintptr_t)param); if (IS_NET_ERROR(result)) { LogMsg(kLogDebug, L"Upgrade visitor failed: %d %s", playerInt, NetErrorToString(result)); @@ -646,7 +646,7 @@ static void INetCliAuthUpgradeVisitorRequestCallback ( else { LogMsg(kLogDebug, L"Upgrade visitor succeeded: %d", playerInt); - {for (unsigned i = 0; i < s_players.Count(); ++i) { + {for (uint32_t i = 0; i < s_players.Count(); ++i) { if (s_players[i].playerInt == playerInt) { s_players[i].explorer = true; break; @@ -656,7 +656,7 @@ static void INetCliAuthUpgradeVisitorRequestCallback ( plAccountUpdateMsg* updateMsg = new plAccountUpdateMsg(plAccountUpdateMsg::kUpgradePlayer); updateMsg->SetPlayerInt(playerInt); - updateMsg->SetResult((unsigned)result); + updateMsg->SetResult((uint32_t)result); updateMsg->SetBCastFlag(plMessage::kBCastByExactType); updateMsg->Send(); } diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp index fedaa86d..fe37d8cc 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp @@ -169,7 +169,8 @@ void plAgeInfoStruct::CopyFrom(const NetAgeInfo & info) { StrToAnsi(tmp, info.ageDesc, arrsize(tmp)); SetAgeDescription(tmp); - SetAgeInstanceGuid(&plUUID(info.ageInstId)); + plUUID inst(info.ageInstId); + SetAgeInstanceGuid(&inst); SetAgeSequenceNumber(info.ageSequenceNumber); SetAgeLanguage(info.ageLanguage); } diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Intern.h b/Sources/Plasma/PubUtilLib/plNetGameLib/Intern.h index e9eb0575..11e43355 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Intern.h +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Intern.h @@ -225,7 +225,7 @@ enum ETransType { kNumTransTypes }; -static char * s_transTypes[] = { +static const char * s_transTypes[] = { // NglAuth.cpp "PingRequestTrans", "LoginRequestTrans", diff --git a/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp b/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp index de8d512f..2c67da25 100644 --- a/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp +++ b/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp @@ -47,6 +47,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetMessage/plNetMessage.h" #include "plNetClient/plNetClientMgr.h" #include +#include plNetTransport::~plNetTransport() { diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp index 233040eb..5393a404 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp @@ -395,7 +395,10 @@ void plPXPhysicalControllerCore::IMatchKinematicToController() kinPos.z = (NxReal)cPos.z; if (plSimulationMgr::fExtraProfile) SimLog("Match setting kinematic from %f,%f,%f to %f,%f,%f",prevKinPos.x,prevKinPos.y,prevKinPos.z,kinPos.x,kinPos.y,kinPos.z ); - fKinematicActor->moveGlobalPosition(kinPos); + if (fBehavingLikeAnimatedPhys && fKinematic) // if NX_BF_KINEMATIC && (avatar is on a ladder or something) + fKinematicActor->moveGlobalPosition(kinPos); + else + fKinematicActor->setGlobalPosition(kinPos); } } void plPXPhysicalControllerCore::UpdateControllerAndPhysicalRep() @@ -406,7 +409,7 @@ void plPXPhysicalControllerCore::UpdateControllerAndPhysicalRep() {//this means we are moving the controller and then synchnig the kin NxExtendedVec3 ControllerPos= fController->getPosition(); NxVec3 NewKinPos((NxReal)ControllerPos.x, (NxReal)ControllerPos.y, (NxReal)ControllerPos.z); - if (fEnabled && fKinematicActor->readBodyFlag(NX_BF_KINEMATIC)) + if (fEnabled || fKinematic) { if (plSimulationMgr::fExtraProfile) SimLog("Moving kinematic to %f,%f,%f",NewKinPos.x, NewKinPos.y, NewKinPos.z ); @@ -414,7 +417,7 @@ void plPXPhysicalControllerCore::UpdateControllerAndPhysicalRep() fKinematicActor->moveGlobalPosition(NewKinPos); } - else if (fEnabled) + else { if (plSimulationMgr::fExtraProfile) SimLog("Setting kinematic to %f,%f,%f", NewKinPos.x, NewKinPos.y, NewKinPos.z ); @@ -446,14 +449,14 @@ void plPXPhysicalControllerCore::MoveKinematicToController(hsPoint3& pos) newPos.x = (NxReal)pos.fX; newPos.y = (NxReal)pos.fY; newPos.z = (NxReal)pos.fZ+kPhysZOffset; - if (fEnabled && fKinematicActor->readBodyFlag(NX_BF_KINEMATIC)) + if (fBehavingLikeAnimatedPhys) { if (plSimulationMgr::fExtraProfile) SimLog("Moving kinematic from %f,%f,%f to %f,%f,%f",pos.fX,pos.fY,pos.fZ+kPhysZOffset,kinPos.x,kinPos.y,kinPos.z ); // use the position fKinematicActor->moveGlobalPosition(newPos); } - else if (fEnabled) + else { if (plSimulationMgr::fExtraProfile) SimLog("Setting kinematic from %f,%f,%f to %f,%f,%f",pos.fX,pos.fY,pos.fZ+kPhysZOffset,kinPos.x,kinPos.y,kinPos.z ); @@ -488,9 +491,9 @@ void plPXPhysicalControllerCore::ISetKinematicLoc(const hsMatrix44& l2w) // add z offset kPos.fZ += kPhysZOffset; // Update the physical position of kinematic - if (fEnabled && fKinematicActor->readBodyFlag(NX_BF_KINEMATIC)) + if (fBehavingLikeAnimatedPhys) fKinematicActor->moveGlobalPosition(plPXConvert::Point(kPos)); - else if (fEnabled) + else fKinematicActor->setGlobalPosition(plPXConvert::Point(kPos)); } void plPXPhysicalControllerCore::IGetPositionSim(hsPoint3& pos) const diff --git a/Sources/Plasma/PubUtilLib/plPipeline/hsFogControl.h b/Sources/Plasma/PubUtilLib/plPipeline/hsFogControl.h index 013b21f0..db16015a 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/hsFogControl.h +++ b/Sources/Plasma/PubUtilLib/plPipeline/hsFogControl.h @@ -148,4 +148,4 @@ public: }; #endif // Move up to FeatureLevel -#endif hsFogControl_inc +#endif //hsFogControl_inc diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp index 763f82be..d911f1a3 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp @@ -57,9 +57,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -#ifdef DX_OLD_SDK +#if defined(DX_OLD_SDK) || defined(__MINGW32__) #include - #define DXGetErrorString9 DXGetErrorString + #ifndef DXGetErrorString9 + #define DXGetErrorString9 DXGetErrorString + #endif + #ifdef __MINGW32__ // UGH! + #define DXGetErrorString DXGetErrorString9 + #endif #else #include #endif @@ -12023,6 +12028,7 @@ const char *plDXPipeline::IGetDXFormatName( D3DFORMAT format ) // This is obsolete as of DX8 void plDXPipeline::IFPUCheck() { +#ifdef _MSC_VER WORD wSave, wTemp; __asm fstcw wSave if (wSave & 0x300 || // Not single mode @@ -12039,6 +12045,7 @@ void plDXPipeline::IFPUCheck() fldcw wTemp } } +#endif } // PushPiggyBackLayer ///////////////////////////////////////////////////// diff --git a/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp b/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp index 69491d4a..484d7b0f 100644 --- a/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp +++ b/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp @@ -443,7 +443,7 @@ const wchar_t* plProfileManagerFull::GetProfilePath() plFileUtils::CreateDir(profilePath); wchar_t buff[256]; - swprintf(buff, 256, L"%02d-%02d-%04d_%02d-%02d//", + hsSnwprintf(buff, 256, L"%02d-%02d-%04d_%02d-%02d//", curTime.GetMonth(), curTime.GetDay(), curTime.GetYear(), @@ -460,7 +460,7 @@ const wchar_t* plProfileManagerFull::GetProfilePath() void plProfileManagerFull::ILogStats() { wchar_t statFilename[256]; - swprintf(statFilename, 256, L"%s%s.csv", GetProfilePath(), fLogAgeName.c_str()); + hsSnwprintf(statFilename, 256, L"%s%s.csv", GetProfilePath(), fLogAgeName.c_str()); bool exists = plFileUtils::FileExists(statFilename); diff --git a/Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt index 7ffc5080..d8629d8f 100644 --- a/Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt @@ -16,7 +16,7 @@ set(plStatusLog_HEADERS ) add_library(plStatusLog STATIC ${plStatusLog_SOURCES} ${plStatusLog_HEADERS}) -target_link_libraries(plStatusLog CoreLib plFile plUnifiedTime) +target_link_libraries(plStatusLog CoreLib plFile plUnifiedTime pnProduct) source_group("Source Files" FILES ${plStatusLog_SOURCES}) source_group("Header Files" FILES ${plStatusLog_HEADERS}) diff --git a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp index b7626041..ed1f488d 100644 --- a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp +++ b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp @@ -480,15 +480,15 @@ bool plStatusLog::IReOpen( void ) ext = L".elf"; #endif wchar_t fileToOpen[MAX_PATH]; - swprintf(fileToOpen, MAX_PATH, L"%s.0%s", fileNoExt, ext); + hsSnwprintf(fileToOpen, MAX_PATH, L"%s.0%s", fileNoExt, ext); if (!(fFlags & kDontRotateLogs)) { wchar_t work[MAX_PATH], work2[MAX_PATH]; - swprintf(work, MAX_PATH, L"%s.3%s",fileNoExt,ext); + hsSnwprintf(work, MAX_PATH, L"%s.3%s",fileNoExt,ext); plFileUtils::RemoveFile(work); - swprintf(work2, MAX_PATH, L"%s.2%s",fileNoExt,ext); + hsSnwprintf(work2, MAX_PATH, L"%s.2%s",fileNoExt,ext); plFileUtils::FileMove(work2, work); - swprintf(work, MAX_PATH, L"%s.1%s",fileNoExt,ext); + hsSnwprintf(work, MAX_PATH, L"%s.1%s",fileNoExt,ext); plFileUtils::FileMove(work, work2); plFileUtils::FileMove(fileToOpen, work); } @@ -541,7 +541,7 @@ void plStatusLog::IParseFileName(wchar_t* file, size_t fnsize, wchar_t* fileNoEx { const wchar_t *base = plStatusLogMgr::IGetBasePath(); if( wcslen( base ) != nil ) - swprintf( file, fnsize, L"%s%s%s", base, WPATH_SEPARATOR_STR, fFilename.c_str() ); + hsSnwprintf( file, fnsize, L"%s%s%s", base, WPATH_SEPARATOR_STR, fFilename.c_str() ); else wcscpy( file, fFilename.c_str() ); diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp index 9dcf9133..7f7132bf 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp @@ -285,7 +285,7 @@ static void VaultNodeFound ( //============================================================================ static void VaultNodeAddedDownloadCallback(ENetError result, void * param) { - unsigned childId = (unsigned)param; + unsigned childId = (unsigned)((uintptr_t)param); INotifyAfterDownload* notify = s_notifyAfterDownload.Find(childId); @@ -313,7 +313,7 @@ static void VaultNodeAddedDownloadCallback(ENetError result, void * param) { } //============================================================================ -static void __cdecl LogDumpProc ( +static void CDECL LogDumpProc ( void * , const wchar_t fmt[], ... @@ -1182,7 +1182,7 @@ RelVaultNode * RelVaultNode::GetParentNodeIncRef ( unsigned maxDepth ) { if (maxDepth == 0) - return false; + return nil; RelVaultNodeLink * link; link = state->parents.Head(); @@ -1208,7 +1208,7 @@ RelVaultNode * RelVaultNode::GetChildNodeIncRef ( unsigned maxDepth ) { if (maxDepth == 0) - return false; + return nil; RelVaultNodeLink * link; link = state->children.Head(); @@ -2831,7 +2831,7 @@ namespace _VaultRegisterOwnedAge { void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to create AgeLink (async)"); - delete param; + delete (_Params*)param; return; } @@ -2846,10 +2846,10 @@ namespace _VaultRegisterOwnedAge { RelVaultNode* agesIOwn = VaultGetAgesIOwnFolderIncRef(); RelVaultNode* plyrInfo = VaultGetPlayerInfoNodeIncRef(); VaultAddChildNode(agesIOwn->nodeId, node->nodeId, 0, (FVaultAddChildNodeCallback)_AddAgeLinkNode, nil); - VaultAddChildNode(node->nodeId, (uint32_t)p->fAgeInfoId, 0, (FVaultAddChildNodeCallback)_AddAgeInfoNode, nil); + VaultAddChildNode(node->nodeId, (uint32_t)((uintptr_t)p->fAgeInfoId), 0, (FVaultAddChildNodeCallback)_AddAgeInfoNode, nil); // Add our PlayerInfo to important places - if (RelVaultNode* rvnAgeInfo = VaultGetNodeIncRef((uint32_t)p->fAgeInfoId)) { + if (RelVaultNode* rvnAgeInfo = VaultGetNodeIncRef((uint32_t)((uintptr_t)p->fAgeInfoId))) { if (RelVaultNode* rvnAgeOwners = rvnAgeInfo->GetChildPlayerInfoListNodeIncRef(plVault::kAgeOwnersFolder, 1)) { VaultAddChildNode(rvnAgeOwners->nodeId, plyrInfo->nodeId, 0, (FVaultAddChildNodeCallback)_AddPlayerInfoNode, nil); rvnAgeOwners->DecRef(); @@ -2874,7 +2874,7 @@ namespace _VaultRegisterOwnedAge { void _DownloadCallback(ENetError result, void* param) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to download age vault (async)"); - delete param; + delete (_Params*)param; } else VaultCreateNode(plVault::kNodeType_AgeLink, (FVaultCreateNodeCallback)_CreateAgeLinkNode, nil, param); } @@ -3190,12 +3190,12 @@ namespace _VaultRegisterVisitAge { void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "RegisterVisitAge: Failed to create AgeLink (async)"); - delete param; + delete (_Params*)param; return; } _Params* p = (_Params*)param; - RelVaultNode* ageInfo = VaultGetNodeIncRef((uint32_t)p->fAgeInfoId); + RelVaultNode* ageInfo = VaultGetNodeIncRef((uint32_t)((uintptr_t)p->fAgeInfoId)); // Add ourselves to the Can Visit folder of the age if (RelVaultNode * playerInfo = VaultGetPlayerInfoNodeIncRef()) { @@ -3225,13 +3225,13 @@ namespace _VaultRegisterVisitAge { msg->Send(); //Don't leak memory - delete param; + delete (_Params*)param; } void _DownloadCallback(ENetError result, void* param) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "RegisterVisitAge: Failed to download age vault (async)"); - delete param; + delete (_Params*)param; return; } @@ -3242,7 +3242,7 @@ namespace _VaultRegisterVisitAge { void _InitAgeCallback(ENetError result, void* state, void* param, uint32_t ageVaultId, uint32_t ageInfoId) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "RegisterVisitAge: Failed to init age vault (async)"); - delete param; + delete (_Params*)param; return; } @@ -4422,7 +4422,7 @@ namespace _VaultCreateSubAge { } // Add the children to the right places - VaultAddChildNode(node->nodeId, (uint32_t)param, 0, nil, nil); + VaultAddChildNode(node->nodeId, (uint32_t)((uintptr_t)param), 0, nil, nil); if (RelVaultNode* saFldr = VaultGetAgeSubAgesFolderIncRef()) { VaultAddChildNode(saFldr->nodeId, node->nodeId, 0, nil, nil); saFldr->DecRef(); @@ -4782,15 +4782,15 @@ namespace _VaultCreateChildAge { void _CreateNodeCallback(ENetError result, void* state, void* param, RelVaultNode* node) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "CreateChildAge: Failed to create AgeLink (async)"); - delete param; + delete (_Params*)param; return; } _Params* p = (_Params*)param; // Add the children to the right places - VaultAddChildNode(node->nodeId, (uint32_t)p->fAgeInfoId, 0, nil, nil); - VaultAddChildNode((uint32_t)p->fChildAgesFldr, node->nodeId, 0, nil, nil); + VaultAddChildNode(node->nodeId, (uint32_t)((uintptr_t)p->fAgeInfoId), 0, nil, nil); + VaultAddChildNode((uint32_t)((uintptr_t)p->fChildAgesFldr), node->nodeId, 0, nil, nil); // Send the VaultNotify that the plNetLinkingMgr wants... plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); @@ -4799,13 +4799,13 @@ namespace _VaultCreateChildAge { msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); msg->Send(); - delete param; + delete (_Params*)param; } void _DownloadCallback(ENetError result, void* param) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "CreateChildAge: Failed to download age vault (async)"); - delete param; + delete (_Params*)param; return; } @@ -4820,7 +4820,7 @@ namespace _VaultCreateChildAge { void _InitAgeCallback(ENetError result, void* state, void* param, uint32_t ageVaultId, uint32_t ageInfoId) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "CreateChildAge: Failed to init age (async)"); - delete param; + delete (_Params*)param; return; } @@ -4888,7 +4888,7 @@ uint8_t VaultAgeFindOrCreateChildAgeLink( rvnAgeLink->DecRef(); rvnAgeInfo->DecRef(); - retval = TRUE; + retval = true; } else { _Params* p = new _Params; p->fChildAgesFldr = (void*)rvnChildAges->nodeId; @@ -4900,7 +4900,7 @@ uint8_t VaultAgeFindOrCreateChildAgeLink( nil, p ); - retval = FALSE; + retval = false; } temp->DecRef(); diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp index 2c31fd31..754b6288 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp @@ -466,7 +466,8 @@ bool VaultTextNoteNode::GetVisitInfo (plAgeInfoStruct * info) { if (StrLen(token) > 0) { Uuid guid; GuidFromString(token, &guid); - info->SetAgeInstanceGuid(&plUUID(guid)); + plUUID uuid(guid); + info->SetAgeInstanceGuid(&uuid); } } break; diff --git a/Sources/Tools/plResBrowser/plResBrowserWndProc.cpp b/Sources/Tools/plResBrowser/plResBrowserWndProc.cpp index b0e698f7..1db259e5 100644 --- a/Sources/Tools/plResBrowser/plResBrowserWndProc.cpp +++ b/Sources/Tools/plResBrowser/plResBrowserWndProc.cpp @@ -41,7 +41,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" #include "hsTemplates.h" -#include "afxres.h" #include "res/resource.h" #include #include diff --git a/Sources/Tools/plResBrowser/plResTreeView.cpp b/Sources/Tools/plResBrowser/plResTreeView.cpp index 31b6ca92..0c9ef72d 100644 --- a/Sources/Tools/plResBrowser/plResTreeView.cpp +++ b/Sources/Tools/plResBrowser/plResTreeView.cpp @@ -116,7 +116,7 @@ class plResDlgLoader : public plRegistryPageIterator, public plRegistryKeyIterat { TVITEM tvi = {0}; tvi.mask = TVIF_TEXT | TVIF_PARAM; - tvi.pszText = text ? (char*)text : ""; + tvi.pszText = text ? (char*)text : (char*)""; tvi.cchTextMax = text ? strlen(text) : 7; tvi.lParam = (LPARAM)info;