From a382752354a8657a5cde40d40bc48e2e1bb58c8e Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 18 Jan 2013 19:37:43 -0500 Subject: [PATCH] Fill out bink stub Max 2012 doesn't like getting a null from ClassDesc2::Create(). I can't blame it. --- Sources/Tools/MaxPlasmaMtls/plBinkBitmap.cpp | 35 +++++++++++++++++--- 1 file changed, 30 insertions(+), 5 deletions(-) diff --git a/Sources/Tools/MaxPlasmaMtls/plBinkBitmap.cpp b/Sources/Tools/MaxPlasmaMtls/plBinkBitmap.cpp index ae499a18..a6a77390 100644 --- a/Sources/Tools/MaxPlasmaMtls/plBinkBitmap.cpp +++ b/Sources/Tools/MaxPlasmaMtls/plBinkBitmap.cpp @@ -42,18 +42,43 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "hsWindows.h" + +#include #include #pragma hdrstop -class BinkClassDesc : public ClassDesc2 +/** Stubbed out BitmapIO instance for deprecated bink layers **/ +class plBinkBitmapIO : public BitmapIO { public: - int IsPublic() { return 1; } - void* Create(BOOL loading=FALSE) + int ExtCount() { return 1; } + const TCHAR* Ext(int n) { return _T("bik"); } + + const TCHAR* LongDesc() { return _T("DEAD: Bink File"); } + const TCHAR* ShortDesc() { return _T("Bink"); } + + const TCHAR* AuthorName() { return _T("Colin Bonstead"); } + const TCHAR* CopyrightMessage() { return _T("Copyright 2004, Cyan Inc."); } + unsigned int Version() { return 100; } + + int Capability() { return 0; } + DWORD EvaluateConfigure() { return 0; } + BOOL LoadConfigure(void* ptr) { return FALSE; } + BOOL SaveConfigure(void* ptr) { return FALSE; } + + BMMRES GetImageInfo(BitmapInfo* fbi) { return BMMRES_INTERNALERROR; } + BitmapStorage* Load(BitmapInfo* fbi, Bitmap* map, BMMRES* status) { return nullptr; } + void ShowAbout(HWND hWnd) { - hsAssert(false, "bink layers removed due to license issues"); - return nil; + hsMessageBoxWithOwner(hWnd, "Bink Layers removed due to license issues", "DEAD", hsMessageBoxNormal, MB_ICONEXCLAMATION); } +}; + +class BinkClassDesc : public ClassDesc2 +{ +public: + int IsPublic() { return 1; } + void* Create(BOOL loading=FALSE) { return static_cast(new plBinkBitmapIO); } const TCHAR* ClassName() { return "Bink"; } SClass_ID SuperClassID() { return BMM_IO_CLASS_ID; }