1
0
mirror of https://github.com/ncblakely/GiantsTools synced 2024-11-23 14:45:37 +01:00
GiantsTools/Plugins/imp_gbs/Importer.cpp

112 lines
2.1 KiB
C++
Raw Normal View History

// Importer.cpp : Defines the entry point for the DLL application.
//
#include "Importer.h"
2022-09-17 02:54:10 +02:00
#include "ImporterFactory.h"
class ImpGbsClassDesc :
public ClassDesc2
{
public:
int IsPublic() { return TRUE; }
2022-09-17 02:54:10 +02:00
VOID* Create(BOOL Loading) { return new GiantsImporter; }
const MCHAR* ClassName() { return _M("ClassName"); }
SClass_ID SuperClassID() { return SCENE_IMPORT_CLASS_ID; }
Class_ID ClassID() { return GIANTSIMP_CLASSID; }
const MCHAR* Category() { return _M(""); }
const MCHAR* InternalName() { return _M("GiantsImp"); }
HINSTANCE HInstance() { return hInstance; }
};
static ImpGbsClassDesc g_ImportCD;
ClassDesc* GetSceneImportDesc()
{
return &g_ImportCD;
}
void DisplayMessage(const char* msg)
{
MessageBoxA(GetActiveWindow(), msg, "GBS Import Error", MB_OK);
}
2022-09-17 02:54:10 +02:00
int GiantsImporter::ExtCount()
{
2022-09-17 02:54:10 +02:00
return 2;
}
2022-09-17 02:54:10 +02:00
const MCHAR* GiantsImporter::Ext(int n)
{
switch (n)
{
case 0:
return _M("gbs");
2022-09-17 02:54:10 +02:00
case 1:
return _M("gb2");
default:
return (_M(""));
}
}
2022-09-17 02:54:10 +02:00
const MCHAR* GiantsImporter::LongDesc()
{
return _M("Long Description");
}
2022-09-17 02:54:10 +02:00
const MCHAR* GiantsImporter::ShortDesc()
{
return _M("Giants Model");
}
2022-09-17 02:54:10 +02:00
const MCHAR* GiantsImporter::AuthorName()
{
return _M("Author");
}
2022-09-17 02:54:10 +02:00
const MCHAR* GiantsImporter::CopyrightMessage()
{
return _M("Copyright");
}
2022-09-17 02:54:10 +02:00
const MCHAR* GiantsImporter::OtherMessage1()
{
return _M("OtherMessage1");
}
2022-09-17 02:54:10 +02:00
const MCHAR* GiantsImporter::OtherMessage2()
{
return _M("OtherMessage2");
}
2022-09-17 02:54:10 +02:00
UINT GiantsImporter::Version()
{
return 100;
}
static BOOL CALLBACK AboutDlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
return FALSE;
}
2022-09-17 02:54:10 +02:00
VOID GiantsImporter::ShowAbout(HWND hWnd)
{
}
2022-09-17 02:54:10 +02:00
int GiantsImporter::DoImport(const MCHAR* Name, ImpInterface* EI, Interface* I, BOOL suppressPrompts)
{
try
{
2022-09-17 02:54:10 +02:00
ImporterFactory::ImportFile(Name, EI, I, suppressPrompts);
}
catch (const std::exception& e)
{
DisplayMessage(e.what());
}
return TRUE;
}
2022-09-17 02:54:10 +02:00
BOOL GiantsImporter::SupportsOptions(int Ext, DWORD Options)
{
return FALSE;
}