Skip to content

Commit

Permalink
R21 + MSVC fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasRosenstein committed Dec 27, 2019
1 parent ec9ddfe commit aaa781f
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions source/Commands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ enum
ID_COMMAND_CONVERTCONTAINER = 1030971,
};

static Bool GetState(CommandData* dat, BaseDocument* doc, GeDialog* parentManager) {
#ifdef API_VERSION >= 21000
return dat->GetState(doc, parentManager);
#else
return data->GetState(doc);
#endif
}

/// ***************************************************************************
/// This function copies all branches of an object to another
/// object, assuming it can find matching branches.
Expand Down Expand Up @@ -229,9 +237,9 @@ class Null2ContainerCommand : public CommandData

// CommandData

virtual Bool Execute(BaseDocument* doc)
C4D_APIBRIDGE_COMMANDDATA_EXECUTE(doc)
{
if (!GetState(doc)) return false;
if (!::GetState(this, doc, C4D_APIBRIDGE_COMMANDDATA_GETPARENTMANAGER())) return false;

BaseObject* op = doc->GetActiveObject();
AliasTrans* at = nullptr; // @FUTURE_EXT_OP
Expand All @@ -252,7 +260,7 @@ class Null2ContainerCommand : public CommandData
return true;
}

virtual LONG GetState(BaseDocument* doc)
C4D_APIBRIDGE_COMMANDDATA_GETSTATE(doc)
{
if (!doc) return 0;
BaseObject* op = doc->GetActiveObject();
Expand Down Expand Up @@ -284,9 +292,9 @@ class Container2NullCommand : public CommandData

// CommandData

virtual Bool Execute(BaseDocument* doc)
C4D_APIBRIDGE_COMMANDDATA_EXECUTE(doc)
{
if (!GetState(doc)) return false;
if (!::GetState(this, doc, C4D_APIBRIDGE_COMMANDDATA_GETPARENTMANAGER())) return false;

BaseObject* op = doc->GetActiveObject();
AliasTrans* at = nullptr; // @FUTURE_EXT_OP
Expand All @@ -307,7 +315,7 @@ class Container2NullCommand : public CommandData
return true;
}

virtual LONG GetState(BaseDocument* doc)
C4D_APIBRIDGE_COMMANDDATA_GETSTATE(doc)
{
if (!doc) return 0;
BaseObject* op = doc->GetActiveObject();
Expand Down

0 comments on commit aaa781f

Please sign in to comment.