From 7344c98e6eb8466ac6b7e3fe86f7403d0d8ac935 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Thu, 2 Dec 2021 21:02:17 +0200 Subject: [PATCH] Add macOS to azure pipeline --- azure-pipelines.yml | 27 +++++++++++++++++++ nel/include/nel/misc/cdb_leaf.h | 4 +++ .../driver/opengl/mac/cocoa_event_emitter.cpp | 8 +++--- .../driver/opengl/mac/cocoa_event_emitter.h | 5 ++-- nel/src/misc/cdb_leaf.cpp | 19 +++++++++++++ 5 files changed, 57 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f4450accb..9c735531b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -135,3 +135,30 @@ jobs: # inputs: # targetPath: build.release/bin # artifactName: RyzomUbuntu18Release + - job: macOS11 + timeoutInMinutes: 120 + pool: + vmImage: 'macOS-11' + steps: + - checkout: self + fetchDepth: 0 + - task: Cache@2 + inputs: + key: 'hunter317-macOS11-rel"' + path: "$(Pipeline.Workspace)/.hunter/_Base/Cache" + - task: CMake@1 + inputs: + workingDirectory: build.release + cmakeArgs: '-GXcode -DCMAKE_CONFIGURATION_TYPES=Release -DHUNTER_ENABLED=ON -DHUNTER_STATUS_DEBUG=ON -DHUNTER_CONFIGURATION_TYPES=Release -DHUNTER_ROOT="$(Pipeline.Workspace)/.hunter" -DWITH_LIBXML2_ICONV=OFF -DFINAL_VERSION=OFF -DWITH_NEL_TESTS=OFF -DWITH_NEL_SAMPLES=OFF -DWITH_NEL_TOOLS=OFF -DWITH_RYZOM_TOOLS=OFF -DWITH_RYZOM_SERVER=OFF -DWITH_RYZOM_CLIENT=ON -DWITH_DRIVER_OPENGL=ON -DWITH_DRIVER_OPENAL=ON -DWITH_DRIVER_DIRECT3D=OFF -DWITH_DRIVER_XAUDIO2=OFF ..' + - task: Xcode@5 + inputs: + actions: 'build' + configuration: Release + sdk: macosx12.0 + xcWorkspacePath: 'build.release/RyzomCore.xcodeproj' + scheme: 'ALL_BUILD' + packageApp: false + #- task: PublishPipelineArtifact@1 + # inputs: + # targetPath: build.release/bin/ + # artifactName: RyzomClientMacOS11Release diff --git a/nel/include/nel/misc/cdb_leaf.h b/nel/include/nel/misc/cdb_leaf.h index dc734c434..3544fee8a 100644 --- a/nel/include/nel/misc/cdb_leaf.h +++ b/nel/include/nel/misc/cdb_leaf.h @@ -96,6 +96,7 @@ public: _Property = 0; _oldProperty = 0; _Type = UNKNOWN; + m_Nullable = false; _Changed = false; _LastChangeGC = 0; } @@ -235,6 +236,9 @@ private: /// property type EPropType _Type; + /// nullable + bool m_Nullable; + /// true if this value has changed bool _Changed; diff --git a/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp b/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp index 834331a3c..4d0b833b3 100644 --- a/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp +++ b/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.cpp @@ -152,7 +152,7 @@ static NLMISC::TKey virtualKeycodeToNelKey(unsigned short keycode) return NLMISC::KeyNOKEY; } -bool CCocoaEventEmitter::pasteTextFromClipboard(ucstring &text) +bool CCocoaEventEmitter::pasteTextFromClipboard(std::string &text) { NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; NSArray *classArray = [NSArray arrayWithObject:[NSString class]]; @@ -163,17 +163,17 @@ bool CCocoaEventEmitter::pasteTextFromClipboard(ucstring &text) { NSArray *objectsToPaste = [pasteboard readObjectsForClasses:classArray options:options]; NSString *nstext = [objectsToPaste objectAtIndex:0]; - text.fromUtf8([nstext UTF8String]); + text = [nstext UTF8String]; return true; } return false; } -bool CCocoaEventEmitter::copyTextToClipboard(const ucstring &text) +bool CCocoaEventEmitter::copyTextToClipboard(const std::string &text) { NSPasteboard *pasteboard = [NSPasteboard generalPasteboard]; [pasteboard clearContents]; - NSArray *copiedObjects = [NSArray arrayWithObject:[NSString stringWithUTF8String:text.toUtf8().c_str()]]; + NSArray *copiedObjects = [NSArray arrayWithObject:[NSString stringWithUTF8String:text.c_str()]]; [pasteboard writeObjects:copiedObjects]; return true; } diff --git a/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.h b/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.h index 5d3728f3c..e370e0db5 100644 --- a/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.h +++ b/nel/src/3d/driver/opengl/mac/cocoa_event_emitter.h @@ -21,6 +21,7 @@ #ifndef NL_COCOA_EVENT_EMITTER_H #define NL_COCOA_EVENT_EMITTER_H +#include #include "nel/misc/event_emitter.h" #include "nel/misc/event_server.h" #include "nel/misc/events.h" @@ -53,8 +54,8 @@ public: virtual void submitEvents(CEventServer& server, bool allWindows); bool handleQuitRequest(); - virtual bool copyTextToClipboard(const ucstring &text); - virtual bool pasteTextFromClipboard(ucstring &text); + virtual bool copyTextToClipboard(const std::string &text); + virtual bool pasteTextFromClipboard(std::string &text); }; } diff --git a/nel/src/misc/cdb_leaf.cpp b/nel/src/misc/cdb_leaf.cpp index f5bc50ac3..51a634c4f 100644 --- a/nel/src/misc/cdb_leaf.cpp +++ b/nel/src/misc/cdb_leaf.cpp @@ -51,6 +51,18 @@ namespace NLMISC{ //----------------------------------------------- void CCDBNodeLeaf::init( xmlNodePtr node, IProgressCallback &/* progressCallBack */, bool /* mapBanks */, CCDBBankHandler * /* bankHandler */ ) { + // Read nullable + CXMLAutoPtr nullable((const char*)xmlGetProp (node, (xmlChar*)"nullable")); + if ((const char *) nullable != NULL) + { + m_Nullable = (nullable.getDatas()[0] == '1'); + } + else + { + m_Nullable = false; + } + + // Read type CXMLAutoPtr type((const char*)xmlGetProp (node, (xmlChar*)"type")); nlassert((const char *) type != NULL); @@ -141,6 +153,13 @@ void CCDBNodeLeaf::readDelta(TGameCycle gc, CBitMemStream & f ) { // Read the Property Value according to the Property Type. uint64 recvd = 0; + + uint64 isNull = 0; + if (m_Nullable) + { + f.serial(isNull, 1); + } + uint bits; if (_Type == TEXT) bits = 32;