2020-10-18 08:40:57 +02:00
|
|
|
// Importer.cpp : Defines the entry point for the DLL application.
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "Importer.h"
|
2022-09-17 02:54:10 +02:00
|
|
|
#include "ImporterFactory.h"
|
2020-10-18 08:40:57 +02:00
|
|
|
|
|
|
|
class ImpGbsClassDesc :
|
|
|
|
public ClassDesc2
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
int IsPublic() { return TRUE; }
|
2022-09-17 02:54:10 +02:00
|
|
|
VOID* Create(BOOL Loading) { return new GiantsImporter; }
|
2020-10-18 08:40:57 +02:00
|
|
|
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()
|
2020-10-18 08:40:57 +02:00
|
|
|
{
|
2022-09-17 02:54:10 +02:00
|
|
|
return 2;
|
2020-10-18 08:40:57 +02:00
|
|
|
}
|
|
|
|
|
2022-09-17 02:54:10 +02:00
|
|
|
const MCHAR* GiantsImporter::Ext(int n)
|
2020-10-18 08:40:57 +02:00
|
|
|
{
|
|
|
|
switch (n)
|
|
|
|
{
|
|
|
|
case 0:
|
|
|
|
return _M("gbs");
|
2022-09-17 02:54:10 +02:00
|
|
|
case 1:
|
|
|
|
return _M("gb2");
|
2020-10-18 08:40:57 +02:00
|
|
|
default:
|
|
|
|
return (_M(""));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-09-17 02:54:10 +02:00
|
|
|
const MCHAR* GiantsImporter::LongDesc()
|
2020-10-18 08:40:57 +02:00
|
|
|
{
|
|
|
|
return _M("Long Description");
|
|
|
|
}
|
|
|
|
|
2022-09-17 02:54:10 +02:00
|
|
|
const MCHAR* GiantsImporter::ShortDesc()
|
2020-10-18 08:40:57 +02:00
|
|
|
{
|
|
|
|
return _M("Giants Model");
|
|
|
|
}
|
|
|
|
|
2022-09-17 02:54:10 +02:00
|
|
|
const MCHAR* GiantsImporter::AuthorName()
|
2020-10-18 08:40:57 +02:00
|
|
|
{
|
|
|
|
return _M("Author");
|
|
|
|
}
|
|
|
|
|
2022-09-17 02:54:10 +02:00
|
|
|
const MCHAR* GiantsImporter::CopyrightMessage()
|
2020-10-18 08:40:57 +02:00
|
|
|
{
|
|
|
|
return _M("Copyright");
|
|
|
|
}
|
|
|
|
|
2022-09-17 02:54:10 +02:00
|
|
|
const MCHAR* GiantsImporter::OtherMessage1()
|
2020-10-18 08:40:57 +02:00
|
|
|
{
|
|
|
|
return _M("OtherMessage1");
|
|
|
|
}
|
|
|
|
|
2022-09-17 02:54:10 +02:00
|
|
|
const MCHAR* GiantsImporter::OtherMessage2()
|
2020-10-18 08:40:57 +02:00
|
|
|
{
|
|
|
|
return _M("OtherMessage2");
|
|
|
|
}
|
|
|
|
|
2022-09-17 02:54:10 +02:00
|
|
|
UINT GiantsImporter::Version()
|
2020-10-18 08:40:57 +02:00
|
|
|
{
|
|
|
|
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)
|
2020-10-18 08:40:57 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-09-17 02:54:10 +02:00
|
|
|
int GiantsImporter::DoImport(const MCHAR* Name, ImpInterface* EI, Interface* I, BOOL suppressPrompts)
|
2020-10-18 08:40:57 +02:00
|
|
|
{
|
|
|
|
try
|
|
|
|
{
|
2022-09-17 02:54:10 +02:00
|
|
|
ImporterFactory::ImportFile(Name, EI, I, suppressPrompts);
|
2020-10-18 08:40:57 +02:00
|
|
|
}
|
|
|
|
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)
|
2020-10-18 08:40:57 +02:00
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|