~ubuntu-branches/ubuntu/wily/opencollada/wily

« back to all changes in this revision

Viewing changes to COLLADAMax/src/COLLADAMaxDllEntry.cpp

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2015-05-14 17:23:27 UTC
  • Revision ID: package-import@ubuntu.com-20150514172327-f862u8envms01fra
Tags: upstream-0.1.0~20140703.ddf8f47+dfsg1
ImportĀ upstreamĀ versionĀ 0.1.0~20140703.ddf8f47+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2008-2009 NetAllied Systems GmbH
 
3
 
 
4
        This file is part of COLLADAMax.
 
5
 
 
6
    Portions of the code are:
 
7
    Copyright (c) 2005-2007 Feeling Software Inc.
 
8
    Copyright (c) 2005-2007 Sony Computer Entertainment America
 
9
    
 
10
    Based on the 3dsMax COLLADASW Tools:
 
11
    Copyright (c) 2005-2006 Autodesk Media Entertainment
 
12
        
 
13
    Licensed under the MIT Open Source License, 
 
14
    for details please see LICENSE file or the website
 
15
    http://www.opensource.org/licenses/mit-license.php
 
16
*/
 
17
 
 
18
 
 
19
#include "COLLADAMaxStableHeaders.h"
 
20
 
 
21
#include "COLLADAMaxColladaExporter.h"
 
22
#include "COLLADAMaxColladaImporter.h"
 
23
#include "COLLADAMaxGoogleWarehouse.h"
 
24
 
 
25
#include "COLLADAMaxColladaPlugin.h"
 
26
 
 
27
#include "COLLADAMaxVersionInfo.h"
 
28
 
 
29
HINSTANCE hInstance;
 
30
int controlsInit = FALSE;
 
31
 
 
32
#ifdef UNICODE
 
33
static const COLLADAMax::WideString LIBDESCRIPTION = L"OpenCOLLADA" + 
 
34
                (_tcslen(COLLADAMax::COLLADAPlugin::PLUGIN_VERSION_TCHAR) == 0 ? L"" : (COLLADAMax::WideString(L" ") + COLLADAMax::COLLADAPlugin::PLUGIN_VERSION_TCHAR))+
 
35
                (COLLADAMax::COLLADAPlugin::REVISION_STRING.empty() ? COLLADAMax::WideString(L"") : (COLLADAMax::WideString(L" ") + COLLADABU::StringUtils::toWideString(COLLADAMax::COLLADAPlugin::REVISION_STRING.c_str()) ));
 
36
#else
 
37
static const COLLADAMax::String LIBDESCRIPTION = "OpenCOLLADA" + 
 
38
                (_tcslen(COLLADAMax::COLLADAPlugin::PLUGIN_VERSION_TCHAR) == 0 ? "" : (COLLADAMax::String(" ") + COLLADAMax::COLLADAPlugin::PLUGIN_VERSION_TCHAR))+
 
39
                (COLLADAMax::COLLADAPlugin::REVISION_STRING.empty() ? "" : (COLLADAMax::String(" ") + COLLADAMax::COLLADAPlugin::REVISION_STRING));
 
40
#endif
 
41
 
 
42
BOOL WINAPI DllMain ( HINSTANCE hinstDLL, ULONG fdwReason, LPVOID UNUSED ( lpvReserved ) )
 
43
{
 
44
    switch ( fdwReason )
 
45
    {
 
46
 
 
47
    case DLL_PROCESS_ATTACH:
 
48
        hInstance = hinstDLL;
 
49
#if MAX_VERSION_MAJOR < 10
 
50
 
 
51
        InitCustomControls ( hInstance );
 
52
#endif // pre-Max 2008 only.
 
53
 
 
54
        break;
 
55
 
 
56
    case DLL_PROCESS_DETACH:
 
57
        break;
 
58
    }
 
59
 
 
60
    return TRUE;
 
61
}
 
62
 
 
63
extern "C" __declspec ( dllexport ) const TCHAR* LibDescription()
 
64
{
 
65
    return LIBDESCRIPTION.c_str();
 
66
}
 
67
 
 
68
extern "C" __declspec ( dllexport ) int LibNumberClasses()
 
69
{
 
70
        //return 2;
 
71
        return 3;
 
72
}
 
73
 
 
74
extern "C" __declspec ( dllexport ) ClassDesc* LibClassDesc ( int i )
 
75
{
 
76
    switch ( i )
 
77
    {
 
78
 
 
79
        case 0:
 
80
                return COLLADAMax::getCOLLADAExporterDesc();
 
81
        case 1:
 
82
                return COLLADAMax::getCOLLADAImporterDesc();
 
83
        case 2:
 
84
                return COLLADAMax::getGoogleWarehouseDesc();
 
85
 
 
86
    default:
 
87
        return 0;
 
88
    }
 
89
}
 
90
 
 
91
 
 
92
extern "C" __declspec ( dllexport ) ULONG LibVersion()
 
93
{
 
94
    return VERSION_3DSMAX;
 
95
}
 
96
 
 
97
 
 
98
// Let the plug-in register itself for deferred loading
 
99
extern "C" __declspec ( dllexport ) ULONG CanAutoDefer()
 
100
{
 
101
    return 0;
 
102
}
 
103
 
 
104
TCHAR* GetString ( int id )
 
105
{
 
106
    static TCHAR buf[ 1024 ];
 
107
    return ( hInstance  && LoadString ( hInstance, id, buf, sizeof ( buf ) ) ) ? buf : 0;
 
108
}