git mv Code\Sandbox\Plugins Code/Editor/Plugins

Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
This commit is contained in:
Esteban Papp
2021-06-29 12:42:54 -07:00
parent e34e36cb35
commit 1696680240
215 changed files with 0 additions and 0 deletions
@@ -0,0 +1,50 @@
/*
* Copyright (c) Contributors to the Open 3D Engine Project
*
* SPDX-License-Identifier: Apache-2.0 OR MIT
*
*/
#include "ComponentEntityEditorPlugin_precompiled.h"
// All plugins suffer from the following warning:
// warning C4273: 'GetIEditor' : inconsistent dll linkage
// GetIEditor() is forward-declared using EDITOR_CORE_API, which without EDITOR_CORE set,
// results in dllimport rather than dllexport. This define ensure it's consistently and
// properly defined for export.
#define EDITOR_CORE
#include <platform.h>
#include <IEditor.h>
#include <Include/IPlugin.h>
#include <Include/IEditorClassFactory.h>
#include "ComponentEntityEditorPlugin.h"
#if AZ_TRAIT_OS_PLATFORM_APPLE || defined(AZ_PLATFORM_LINUX)
typedef HANDLE HINSTANCE;
#define DLL_PROCESS_ATTACH 1
#endif
IEditor* g_pEditor = nullptr;
//------------------------------------------------------------------
PLUGIN_API IPlugin* CreatePluginInstance(PLUGIN_INIT_PARAM* pInitParam)
{
g_pEditor = pInitParam->pIEditorInterface;
ISystem* pSystem = pInitParam->pIEditorInterface->GetSystem();
ModuleInitISystem(pSystem, "ComponentEntityEditorPlugin");
return new ComponentEntityEditorPlugin(g_pEditor);
}
//------------------------------------------------------------------
HINSTANCE g_hInstance = 0;
BOOL __stdcall DllMain(HINSTANCE hinstDLL, ULONG fdwReason, [[maybe_unused]] LPVOID lpvReserved)
{
if (fdwReason == DLL_PROCESS_ATTACH)
{
g_hInstance = hinstDLL;
}
return TRUE;
}