Browse Source

Merge pull request #407 from Deledrius/bink_removal_again

Bink Removal
Adam Johnson 10 years ago
parent
commit
69bc106576
  1. 2
      CMakeLists.txt
  2. 4
      Sources/Plasma/Apps/plClient/CMakeLists.txt
  3. 85
      Sources/Plasma/Apps/plClient/plClient.cpp
  4. 6
      Sources/Plasma/Apps/plClient/plClient.h
  5. 1
      Sources/Plasma/FeatureLib/CMakeLists.txt
  6. 9
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  7. 38
      Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp
  8. 8
      Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.h
  9. 17
      Sources/Plasma/FeatureLib/pfMoviePlayer/CMakeLists.txt
  10. 37
      Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp
  11. 101
      Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.h
  12. 5
      Sources/Plasma/FeatureLib/pfSurface/CMakeLists.txt
  13. 4
      Sources/Plasma/FeatureLib/pfSurface/pfSurfaceCreatable.h
  14. 2
      Sources/Plasma/NucleusLib/inc/plCreatableIndex.h
  15. 2
      Sources/Plasma/PubUtilLib/plMessage/plMovieMsg.h
  16. 4
      Sources/Plasma/PubUtilLib/plPipeline/CMakeLists.txt
  17. 2
      Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.h
  18. 129
      Sources/Plasma/PubUtilLib/plPipeline/plBinkPlayer.h
  19. 4
      Sources/Plasma/PubUtilLib/plSurface/CMakeLists.txt
  20. 21
      Sources/Tools/MaxConvert/hsMaterialConverter.cpp
  21. 1
      Sources/Tools/MaxConvert/hsMaterialConverter.h
  22. 1
      Sources/Tools/MaxConvert/plLayerConverter.cpp
  23. 3
      Sources/Tools/MaxMain/CMakeLists.txt
  24. 16
      cmake/FindBink.cmake

2
CMakeLists.txt

@ -49,8 +49,6 @@ if(WIN32)
find_package(DirectX REQUIRED)
endif(WIN32)
find_package(Bink) #TODO: Find Bink, but don't require it if plPipeline isn't built...
# Or better yet, just eliminate bink altogether
include(PrecompiledHeader) #Precompiled Header helper macros
# libCurl isn't smart enough to detect this for us, so we have to configure it ourselves

4
Sources/Plasma/Apps/plClient/CMakeLists.txt

@ -7,9 +7,6 @@ include_directories("../../NucleusLib")
include_directories("../../PubUtilLib/inc")
include_directories("../../PubUtilLib")
if(Bink_SDK_AVAILABLE)
include_directories(${Bink_INCLUDE_DIR})
endif()
include_directories(${OPENAL_INCLUDE_DIR})
include_directories(${OPENSSL_INCLUDE_DIR})
include_directories(${PYTHON_INCLUDE_DIR})
@ -85,6 +82,7 @@ target_link_libraries(plClient pfGameScoreMgr)
target_link_libraries(plClient pfJournalBook)
target_link_libraries(plClient pfLocalizationMgr)
target_link_libraries(plClient pfMessage)
target_link_libraries(plClient pfMoviePlayer)
target_link_libraries(plClient pfPython)
target_link_libraries(plClient pfSurface)
target_link_libraries(plClient plAgeDescription)

85
Sources/Plasma/Apps/plClient/plClient.cpp

@ -111,7 +111,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plStatusLog/plStatusLog.h"
#include "plProgressMgr/plProgressMgr.h"
#include "plPipeline/plDTProgressMgr.h"
#include "plPipeline/plBinkPlayer.h"
#include "pfMoviePlayer/plMoviePlayer.h"
#include "plMessage/plMovieMsg.h"
#include "plSDL/plSDL.h"
@ -275,8 +275,7 @@ bool plClient::Shutdown()
IKillMovies();
plgAudioSys::Activate(false);
plBinkPlayer::DeInit();
//
// Get any proxies to commit suicide.
plProxyDrawMsg* nuke = new plProxyDrawMsg(plProxyDrawMsg::kAllTypes
| plProxyDrawMsg::kDestroy);
@ -826,78 +825,75 @@ bool plClient::IHandleMovieMsg(plMovieMsg* mov)
if (mov->GetFileName().IsEmpty())
return true;
int i;
i = fMovies.GetCount();
if( !(mov->GetCmd() & plMovieMsg::kMake) )
int i = fMovies.GetCount();
if (!(mov->GetCmd() & plMovieMsg::kMake))
{
for( i = 0; i < fMovies.GetCount(); i++ )
for (i = 0; i < fMovies.GetCount(); i++)
{
if (mov->GetFileName().CompareI(fMovies[i]->GetFileName()) == 0)
if (mov->GetFileName().CompareI(fMovies[i]->GetFileName().AsString()) == 0)
break;
}
}
if( i == fMovies.GetCount() )
if (i == fMovies.GetCount())
{
fMovies.Append(new plBinkPlayer);
fMovies.Append(new plMoviePlayer);
fMovies[i]->SetFileName(mov->GetFileName());
}
if( mov->GetCmd() & plMovieMsg::kAddCallbacks )
if (mov->GetCmd() & plMovieMsg::kAddCallbacks)
{
int j;
for( j = 0; j < mov->GetNumCallbacks(); j++ )
for (j = 0; j < mov->GetNumCallbacks(); j++)
fMovies[i]->AddCallback(mov->GetCallback(j));
}
if( mov->GetCmd() & plMovieMsg::kMove )
if (mov->GetCmd() & plMovieMsg::kMove)
fMovies[i]->SetPosition(mov->GetCenter());
if( mov->GetCmd() & plMovieMsg::kScale )
if (mov->GetCmd() & plMovieMsg::kScale)
fMovies[i]->SetScale(mov->GetScale());
if( mov->GetCmd() & plMovieMsg::kColorAndOpacity )
if (mov->GetCmd() & plMovieMsg::kColorAndOpacity)
fMovies[i]->SetColor(mov->GetColor());
if( mov->GetCmd() & plMovieMsg::kColor )
if (mov->GetCmd() & plMovieMsg::kColor)
{
hsColorRGBA c = fMovies[i]->GetColor();
c.Set(mov->GetColor().r, mov->GetColor().g, mov->GetColor().b, c.a);
fMovies[i]->SetColor(c);
}
if( mov->GetCmd() & plMovieMsg::kOpacity )
if (mov->GetCmd() & plMovieMsg::kOpacity)
{
hsColorRGBA c = fMovies[i]->GetColor();
c.a = mov->GetColor().a;
fMovies[i]->SetColor(c);
}
if( mov->GetCmd() & plMovieMsg::kFadeIn )
if (mov->GetCmd() & plMovieMsg::kFadeIn)
{
fMovies[i]->SetFadeFromColor(mov->GetFadeInColor());
fMovies[i]->SetFadeFromTime(mov->GetFadeInSecs());
}
if( mov->GetCmd() & plMovieMsg::kFadeOut )
if (mov->GetCmd() & plMovieMsg::kFadeOut)
{
fMovies[i]->SetFadeToColor(mov->GetFadeOutColor());
fMovies[i]->SetFadeToTime(mov->GetFadeOutSecs());
}
if( mov->GetCmd() & plMovieMsg::kVolume )
if (mov->GetCmd() & plMovieMsg::kVolume)
fMovies[i]->SetVolume(mov->GetVolume());
if( mov->GetCmd() & plMovieMsg::kStart )
fMovies[i]->Start(fPipeline, fWindowHndl);
if( mov->GetCmd() & plMovieMsg::kPause )
if (mov->GetCmd() & plMovieMsg::kStart)
fMovies[i]->Start();
if (mov->GetCmd() & plMovieMsg::kPause)
fMovies[i]->Pause(true);
if( mov->GetCmd() & plMovieMsg::kResume )
if (mov->GetCmd() & plMovieMsg::kResume)
fMovies[i]->Pause(false);
if( mov->GetCmd() & plMovieMsg::kStop )
if (mov->GetCmd() & plMovieMsg::kStop)
fMovies[i]->Stop();
// If a movie has lost its filename, it means something went horribly wrong
// with playing it and it has shutdown. Or we just stopped it. Either way,
// we need to clear it out of our list.
if (fMovies[i]->GetFileName().IsEmpty())
if (!fMovies[i]->GetFileName().IsValid())
{
delete fMovies[i];
fMovies.Remove(i);
}
return true;
}
@ -1440,11 +1436,7 @@ bool plClient::StartInit()
plgAudioSys::Activate(true);
plConst(float) delay(2.f);
//commenting out publisher splash for MORE
//IPlayIntroBink("avi/intro0.bik", delay, 0.f, 0.f, 1.f, 1.f, 0.75);
//if( GetDone() ) return false;
IPlayIntroBink("avi/intro1.bik", 0.f, 0.f, 0.f, 1.f, 1.f, 0.75);
IPlayIntroMovie("avi/CyanWorlds.avi", 0.f, 0.f, 0.f, 1.f, 1.f, 0.75);
if( GetDone() ) return false;
plgDispatch::Dispatch()->RegisterForExactType(plMovieMsg::Index(), GetKey());
@ -1836,10 +1828,9 @@ bool plClient::IDraw()
void plClient::IServiceMovies()
{
int i;
for( i = 0; i < fMovies.GetCount(); i++ )
for (i = 0; i < fMovies.GetCount(); i++)
{
hsAssert(!fMovies[i]->GetFileName().IsEmpty(), "Lost our movie");
if( !fMovies[i]->NextFrame() )
if (!fMovies[i]->NextFrame())
{
delete fMovies[i];
fMovies.Remove(i);
@ -1850,16 +1841,15 @@ void plClient::IServiceMovies()
void plClient::IKillMovies()
{
int i;
for( i = 0; i < fMovies.GetCount(); i++ )
for (int i = 0; i < fMovies.GetCount(); i++)
delete fMovies[i];
fMovies.Reset();
}
bool plClient::IPlayIntroBink(const char* movieName, float endDelay, float posX, float posY, float scaleX, float scaleY, float volume /* = 1.0 */)
bool plClient::IPlayIntroMovie(const char* movieName, float endDelay, float posX, float posY, float scaleX, float scaleY, float volume /* = 1.0 */)
{
SetQuitIntro(false);
plBinkPlayer player;
plMoviePlayer player;
player.SetPosition(posX, posY);
player.SetScale(scaleX, scaleY);
player.SetFileName(movieName);
@ -1868,14 +1858,14 @@ bool plClient::IPlayIntroBink(const char* movieName, float endDelay, float posX,
player.SetVolume(volume);
bool firstTry = true; // flag to make sure that we don't quit before we even start
if( player.Start(fPipeline, fWindowHndl) )
if (player.Start())
{
while( true )
while (true)
{
if( fInstance )
if (fInstance)
fInstance->fMessagePumpProc();
if( GetDone() )
if (GetDone())
return true;
if (firstTry)
{
@ -1884,20 +1874,21 @@ bool plClient::IPlayIntroBink(const char* movieName, float endDelay, float posX,
}
else
{
if( GetQuitIntro() )
if (GetQuitIntro())
return true;
}
bool done = false;
if( !fPipeline->BeginRender() )
if (!fPipeline->BeginRender())
{
fPipeline->ClearRenderTarget();
done = !player.NextFrame();
fPipeline->RenderScreenElements();
fPipeline->EndRender();
}
if( done )
if (done)
return true;
}
return true;

6
Sources/Plasma/Apps/plClient/plClient.h

@ -79,7 +79,7 @@ class plFontCache;
class plClientMsg;
class plLocation;
class plMovieMsg;
class plBinkPlayer;
class plMoviePlayer;
class plPreloaderMsg;
class plNetCommAuthMsg;
class plAgeLoaded2Msg;
@ -147,7 +147,7 @@ protected:
int fQuality;
bool fQuitIntro;
hsTArray<plBinkPlayer*> fMovies;
hsTArray<plMoviePlayer*> fMovies;
plMessagePumpProc fMessagePumpProc;
@ -186,7 +186,7 @@ protected:
void IProcessRenderRequests(hsTArray<plRenderRequest*>& reqs);
void IAddRenderRequest(plRenderRequest* req);
bool IPlayIntroBink(const char* movieName, float endDelay, float posX, float posY, float scaleX, float scaleY, float volume = 1.0);
bool IPlayIntroMovie(const char* movieName, float endDelay, float posX, float posY, float scaleX, float scaleY, float volume = 1.0);
bool IHandleMovieMsg(plMovieMsg* mov);
void IKillMovies();
void IServiceMovies();

1
Sources/Plasma/FeatureLib/CMakeLists.txt

@ -17,6 +17,7 @@ add_subdirectory(pfJournalBook)
# add_subdirectory(pfKI)
add_subdirectory(pfLocalizationMgr)
add_subdirectory(pfMessage)
add_subdirectory(pfMoviePlayer)
add_subdirectory(pfPatcher)
add_subdirectory(pfPython)
add_subdirectory(pfSurface)

9
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp

@ -3934,18 +3934,11 @@ PF_CONSOLE_GROUP( Movie ) // Defines a main command group
PF_CONSOLE_CMD( Movie,
Start,
"string filename",
"Start of movie with this filename" )
"Start movie with this filename" )
{
char* filename = params[0];
plMovieMsg* mov = new plMovieMsg(filename, plMovieMsg::kStart);
//#define MF_TEST_MOVIECALLBACKS
#ifdef MF_TEST_MOVIECALLBACKS
plMovieMsg* cb = new plMovieMsg("avi/intro0.bik", plMovieMsg::kStart);
mov->AddCallback(cb);
mov->SetCmd(mov->GetCmd() | plMovieMsg::kAddCallbacks);
#endif // MF_TEST_MOVIECALLBACKS
mov->Send();
PrintStringF(PrintString, "%s now playing", filename);

38
Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp

@ -78,7 +78,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plSurface/plLayer.h"
#include "plSurface/hsGMaterial.h"
#include "plAgeLoader/plAgeLoader.h"
#include "pfSurface/plLayerBink.h"
#include "pfSurface/plLayerAVI.h"
// So we can do image searches in our local age
#include "plNetClient/plNetClientMgr.h"
@ -1327,7 +1327,7 @@ void pfJournalBook::Show( bool startOpened /*= false */)
else
{
// it's a cover movie, not a decal, so we make a layer, thinking it's at 0,0 and a left map (which gives us the results we want)
plLayerBink *movieLayer = IMakeMovieLayer(fCoverDecals[i],0,0,mip,pfJournalDlgProc::kTagLeftDTMap,false);
plLayerAVI *movieLayer = IMakeMovieLayer(fCoverDecals[i],0,0,mip,pfJournalDlgProc::kTagLeftDTMap,false);
loadedMovie *movie = new loadedMovie;
movie->movieLayer = movieLayer;
movie->movieChunk = fCoverDecals[i];
@ -1397,7 +1397,7 @@ void pfJournalBook::Hide( void )
int i;
for( i = 0; i < fLoadedMovies.GetCount(); i++ )
{
plLayerBink *movie = fLoadedMovies[ i ]->movieLayer;
plLayerAVI *movie = fLoadedMovies[ i ]->movieLayer;
movie->GetKey()->UnRefObject();
delete fLoadedMovies[ i ];
}
@ -2477,7 +2477,7 @@ void pfJournalBook::IFreeSource( void )
for( i = 0; i < fLoadedMovies.GetCount(); i++ )
{
plLayerBink *movie = fLoadedMovies[ i ]->movieLayer;
plLayerAVI *movie = fLoadedMovies[ i ]->movieLayer;
movie->GetKey()->UnRefObject();
delete fLoadedMovies[ i ];
}
@ -2589,11 +2589,11 @@ void pfJournalBook::IRenderPage( uint32_t page, uint32_t whichDTMap, bool sup
{
// clear any exiting layers (movies) from the material
int i;
for( i = 0; i < material->GetNumLayers(); i++ ) // remove all plLayerBink layers
for( i = 0; i < material->GetNumLayers(); i++ ) // remove all plLayerMovie layers
{
plLayerInterface *matLayer = material->GetLayer(i);
plLayerBink *bink = plLayerBink::ConvertNoRef(matLayer);
if (bink) // if it was a bink layer
plLayerAVI *movie = plLayerAVI::ConvertNoRef(matLayer);
if (movie) // if it was a movie layer
{
plMatRefMsg* refMsg = new plMatRefMsg(material->GetKey(), plRefMsg::kOnRemove, i, plMatRefMsg::kLayer); // remove it
hsgResMgr::ResMgr()->SendRef(material->GetLayer(i)->GetKey(), refMsg, plRefFlags::kActiveRef);
@ -2788,7 +2788,7 @@ void pfJournalBook::IRenderPage( uint32_t page, uint32_t whichDTMap, bool sup
case pfEsHTMLChunk::kMovie:
movieAlreadyLoaded = (IMovieAlreadyLoaded(chunk) != nil); // have we already cached it?
plLayerBink *movieLayer = IMakeMovieLayer(chunk, x, y, (plMipmap*)dtMap, whichDTMap, suppressRendering);
plLayerAVI *movieLayer = IMakeMovieLayer(chunk, x, y, (plMipmap*)dtMap, whichDTMap, suppressRendering);
if (movieLayer)
{
// adjust the starting height of the movie if we are keeping it inline with the text
@ -2853,28 +2853,28 @@ void pfJournalBook::IRenderPage( uint32_t page, uint32_t whichDTMap, bool sup
void pfJournalBook::IMoveMovies( hsGMaterial *source, hsGMaterial *dest )
{
hsTArray<plLayerBink*> moviesOnPage;
hsTArray<plLayerAVI*> moviesOnPage;
if (source && dest)
{
// clear any exiting layers (movies) from the material and save them to our local array
int i;
for( i = 0; i < source->GetNumLayers(); i++ ) // remove all plLayerBink layers
for( i = 0; i < source->GetNumLayers(); i++ ) // remove all plLayerMovie layers
{
plLayerInterface *matLayer = source->GetLayer(i);
plLayerBink *bink = plLayerBink::ConvertNoRef(matLayer);
if (bink) // if it was a bink layer
plLayerAVI *movie = plLayerAVI::ConvertNoRef(matLayer);
if (movie) // if it was a movie layer
{
plMatRefMsg* refMsg = new plMatRefMsg(source->GetKey(), plRefMsg::kOnRemove, i, plMatRefMsg::kLayer); // remove it
hsgResMgr::ResMgr()->SendRef(source->GetLayer(i)->GetKey(), refMsg, plRefFlags::kActiveRef);
moviesOnPage.Append(bink);
moviesOnPage.Append(movie);
}
}
// clear the destination's movies (if it has any)
for( i = 0; i < dest->GetNumLayers(); i++ ) // remove all plLayerBink layers
for( i = 0; i < dest->GetNumLayers(); i++ ) // remove all plLayerMovie layers
{
plLayerInterface *matLayer = dest->GetLayer(i);
plLayerBink *bink = plLayerBink::ConvertNoRef(matLayer);
if (bink) // if it was a bink layer
plLayerAVI *movie = plLayerAVI::ConvertNoRef(matLayer);
if (movie) // if it was a movie layer
{
plMatRefMsg* refMsg = new plMatRefMsg(dest->GetKey(), plRefMsg::kOnRemove, i, plMatRefMsg::kLayer); // remove it
hsgResMgr::ResMgr()->SendRef(dest->GetLayer(i)->GetKey(), refMsg, plRefFlags::kActiveRef);
@ -3014,12 +3014,12 @@ pfJournalBook::loadedMovie *pfJournalBook::IGetMovieByIndex(uint8_t index)
return nil;
}
plLayerBink *pfJournalBook::IMakeMovieLayer(pfEsHTMLChunk *chunk, uint16_t x, uint16_t y, plMipmap *baseMipmap, uint32_t whichDTMap, bool dontRender)
plLayerAVI *pfJournalBook::IMakeMovieLayer(pfEsHTMLChunk *chunk, uint16_t x, uint16_t y, plMipmap *baseMipmap, uint32_t whichDTMap, bool dontRender)
{
// see if it's already loaded
loadedMovie *movie = IMovieAlreadyLoaded(chunk);
plLayer* layer = nil;
plLayerBink* movieLayer = nil;
plLayerAVI* movieLayer = nil;
uint16_t movieWidth=0,movieHeight=0;
if (movie)
{
@ -3041,7 +3041,7 @@ plLayerBink *pfJournalBook::IMakeMovieLayer(pfEsHTMLChunk *chunk, uint16_t x, ui
hsgResMgr::ResMgr()->NewKey(buff, layer, GetKey()->GetUoid().GetLocation());
buff = plFormat("{}_{}_m", GetKey()->GetName(), uniqueSuffix++);
movieLayer = new plLayerBink;
movieLayer = new plLayerAVI;
hsgResMgr::ResMgr()->NewKey(buff, movieLayer, GetKey()->GetUoid().GetLocation());
movieLayer->GetKey()->RefObject(); // we want to own a ref so we can nuke it at will

8
Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.h

@ -129,7 +129,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// tint=yes/no - Defines whether or not this decal is tinted //
// with the cover. Overridden by the tintfirst //
// option on the <cover> tag. Defaults to no //
// <movie> - Places a movie (.bik file) inline with the text. Options: //
// <movie> - Places a movie (.avi file) inline with the text. Options: //
// src=<movie name> - Selects the movie to be used. (nead search //
// methods here eventually) //
// align=left/right/center //
@ -188,7 +188,7 @@ class plLayerInterface;
class plMipmap;
class pfGUIProgressCtrl;
class hsGMaterial;
class plLayerBink;
class plLayerAVI;
class pfGUIMultiLineEditCtrl;
class pfJournalBook;
@ -453,7 +453,7 @@ class pfJournalBook : public hsKeyedObject
struct loadedMovie
{
pfEsHTMLChunk *movieChunk;
plLayerBink *movieLayer;
plLayerAVI *movieLayer;
};
friend class pfJournalDlgProc;
@ -574,7 +574,7 @@ class pfJournalBook : public hsKeyedObject
// Movie functions
loadedMovie *IMovieAlreadyLoaded(pfEsHTMLChunk *chunk);
loadedMovie *IGetMovieByIndex(uint8_t index);
plLayerBink *IMakeMovieLayer(pfEsHTMLChunk *chunk, uint16_t x, uint16_t y, plMipmap *baseMipmap, uint32_t whichDTMap, bool dontRender);
plLayerAVI *IMakeMovieLayer(pfEsHTMLChunk *chunk, uint16_t x, uint16_t y, plMipmap *baseMipmap, uint32_t whichDTMap, bool dontRender);
// Cover functions
plLayerInterface *IMakeBaseLayer(plMipmap *image);

17
Sources/Plasma/FeatureLib/pfMoviePlayer/CMakeLists.txt

@ -0,0 +1,17 @@
include_directories(../../CoreLib)
include_directories(../../NucleusLib)
include_directories(../../NucleusLib/inc)
include_directories(../../PubUtilLib)
set(pfMoviePlayer_SOURCES
plMoviePlayer.cpp
)
set(pfMoviePlayer_HEADERS
plMoviePlayer.h
)
add_library(pfMoviePlayer STATIC ${pfMoviePlayer_SOURCES} ${pfMoviePlayer_HEADERS})
source_group("Source Files" FILES ${pfMoviePlayer_SOURCES})
source_group("Header Files" FILES ${pfMoviePlayer_HEADERS})

37
Sources/Plasma/FeatureLib/pfSurface/plLayerBink.h → Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp

@ -40,26 +40,27 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#ifndef plLayerBink_inc
#define plLayerBink_inc
#include "plMoviePlayer.h"
#include "plLayerMovie.h"
#include "hsTimer.h"
class plLayerBink : public plLayerMovie
{
protected:
virtual int32_t ISecsToFrame(float secs) { return 0; }
virtual bool IInit() { return true; }
virtual bool IGetCurrentFrame() { return true; }
virtual bool IRelease() { return true; }
public:
plLayerBink() { }
virtual ~plLayerBink() { }
CLASSNAME_REGISTER( plLayerBink );
GETINTERFACE_ANY( plLayerBink, plLayerMovie );
plMoviePlayer::plMoviePlayer() :
fTimeScale(0),
fStartTime(0)
{
fScale.Set(1.0f, 1.0f);
}
};
int64_t plMoviePlayer::GetMovieTime() const
{
return ((int64_t) hsTimer::GetSeconds() * fTimeScale) - fStartTime;
}
#endif // plLayerBink_inc
bool plMoviePlayer::Stop()
{
for (int i = 0; i < fCallbacks.GetCount(); i++)
fCallbacks[i]->Send();
fCallbacks.Reset();
return false;
}

101
Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.h

@ -0,0 +1,101 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef _plMoviePlayer_inc
#define _plMoviePlayer_inc
#include "HeadSpin.h"
#include "plFileSystem.h"
#include "hsPoint2.h"
#include "hsColorRGBA.h"
#include "plMessage/plMovieMsg.h"
class plMoviePlayer
{
protected:
int64_t fTimeScale, fStartTime;
hsPoint2 fPosition, fScale;
plFileName fMoviePath;
int64_t GetMovieTime() const;
bool IOpenMovie() { return false; };
public:
plMoviePlayer();
~plMoviePlayer() {}
bool Start() { return false; }
bool Pause(bool on) { return false; }
bool Stop();
bool NextFrame() { return Stop(); }
void AddCallback(plMessage* msg) { hsRefCnt_SafeRef(msg); fCallbacks.Append(msg); }
uint32_t GetNumCallbacks() const { return 0; }
plMessage* GetCallback(int i) const { return nullptr; }
plFileName GetFileName() const { return fMoviePath; }
void SetFileName(const plFileName& filename) { fMoviePath = filename; }
void SetColor(const hsColorRGBA& c) { }
const hsColorRGBA GetColor() const { return hsColorRGBA(); }
void SetVolume(float v) { }
hsPoint2 GetPosition() const { return fPosition; }
void SetPosition(const hsPoint2& pos) { fPosition = pos; }
void SetPosition(float x, float y) { fPosition.Set(x, y); }
hsPoint2 GetScale() const { return fScale; }
void SetScale(const hsPoint2& scale) { fScale = scale; }
void SetScale(float x, float y) { fScale.Set(x, y); }
void SetFadeFromTime(float secs) { }
void SetFadeFromColor(hsColorRGBA c) { }
void SetFadeToTime(float secs) { }
void SetFadeToColor(hsColorRGBA c) { }
private:
hsTArray<plMessage*> fCallbacks;
};
#endif // _plMoviePlayer_inc

5
Sources/Plasma/FeatureLib/pfSurface/CMakeLists.txt

@ -3,10 +3,6 @@ include_directories(../../NucleusLib)
include_directories(../../NucleusLib/inc)
include_directories(../../PubUtilLib)
if(Bink_SDK_AVAILABLE)
include_directories(${Bink_INCLUDE_DIR})
endif()
if(WIN32)
include_directories(${DirectX_INCLUDE_DIR})
add_definitions(-DWIN32)
@ -28,7 +24,6 @@ set(pfSurface_HEADERS
plFadeOpacityMod.h
plGrabCubeMap.h
plLayerAVI.h
plLayerBink.h
plLayerMovie.h
)

4
Sources/Plasma/FeatureLib/pfSurface/pfSurfaceCreatable.h

@ -49,10 +49,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
REGISTER_NONCREATABLE( plLayerMovie );
#include "plLayerBink.h"
REGISTER_CREATABLE( plLayerBink );
#include "plLayerAVI.h"
REGISTER_CREATABLE( plLayerAVI );

2
Sources/Plasma/NucleusLib/inc/plCreatableIndex.h

@ -121,7 +121,7 @@ CLASS_INDEX_LIST_START
CLASS_INDEX(plLayerAnimation),
CLASS_INDEX(plLayerDepth),
CLASS_INDEX(plLayerMovie),
CLASS_INDEX(plLayerBink),
CLASS_INDEX(UNUSED_plLayerBink),
CLASS_INDEX(plLayerAVI),
CLASS_INDEX(plSound),
CLASS_INDEX(plWin32Sound),

2
Sources/Plasma/PubUtilLib/plMessage/plMovieMsg.h

@ -155,7 +155,7 @@ public:
plMovieMsg& SetScaleX(float x) { fScale.fX = x; return *this; }
plMovieMsg& SetScaleY(float y) { fScale.fY = y; return *this; }
// Include the movie folder, e.g. "avi/porno.bik"
// Include the movie folder, e.g. "avi/movie.avi"
// String is copied, not pointer copy.
plString GetFileName() const { return fFileName; }
plMovieMsg& SetFileName(const plString& name) { fFileName = name; return *this; }

4
Sources/Plasma/PubUtilLib/plPipeline/CMakeLists.txt

@ -4,9 +4,6 @@ include_directories("../../NucleusLib/inc")
include_directories("../../NucleusLib")
include_directories("../../PubUtilLib")
if(Bink_SDK_AVAILABLE)
include_directories(${Bink_INCLUDE_DIR})
endif()
if(WIN32)
include_directories(${DirectX_INCLUDE_DIR})
endif(WIN32)
@ -48,7 +45,6 @@ set(plPipeline_HEADERS
hsGColorizer.h
hsGDeviceRef.h
hsWinRef.h
plBinkPlayer.h
plCaptureRender.h
plCubicRenderTarget.h
plCubicRenderTargetModifier.h

2
Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.h

@ -171,7 +171,6 @@ class plParticleSpan;
class plCubicEnvironmap;
class plDXRenderTargetRef;
class plStatusLogDrawer;
class plBinkPlayer;
class plDXPipeline : public plPipeline
{
@ -537,7 +536,6 @@ protected:
// Plate management
friend class plDXPlateManager;
friend class plBinkPlayer;
void IDrawPlate( plPlate *plate );

129
Sources/Plasma/PubUtilLib/plPipeline/plBinkPlayer.h

@ -1,129 +0,0 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plBinkPlayer_inc
#define plBinkPlayer_inc
#include "HeadSpin.h"
#include "hsPoint2.h"
#include "hsTemplates.h"
struct D3DVertex;
class plDXPipeline;
struct IDirect3DTexture9;
class plMessage;
struct IDirectSound8;
class plBinkPlayer
{
public:
plBinkPlayer() { }
static bool Init( hsWindowHndl hWnd) { return true; }
static bool DeInit() { return true; }
static void SetForeGroundTrack(uint32_t t) { }
static void SetBackGroundTrack(uint32_t t) { }
static uint32_t GetForeGroundTrack() { }
static uint32_t GetBackGroundTrack() { }
void SetDefaults() { }
bool Start(plPipeline* pipe, hsWindowHndl hWnd) { return false; }
bool NextFrame() {
// we have reached the end
return Stop();
}
bool Pause(bool on) { return false; }
bool Stop() {
for (int i = 0; i < fCallbacks.GetCount(); i++)
fCallbacks[i]->Send();
fCallbacks.Reset();
fFileName = plString::Null;
return false;
}
void SetFileName(const plString& filename) {
fFileName = filename;
}
void SetColor(const hsColorRGBA& c) { }
void SetPosition(float x, float y) { }
void SetScale(float x, float y) { }
void SetVolume(float v) { }
void SetForeVolume(float v) { }
void SetBackVolume(float v) { }
void SetPosition(const hsPoint2& p) { }
void SetScale(const hsPoint2& s) { }
plString GetFileName() const { return fFileName; }
const hsColorRGBA GetColor() const { return hsColorRGBA(); }
const hsPoint2 GetPosition() const { return hsPoint2(); }
const hsPoint2 GetScale() const { return hsPoint2(); }
float GetBackVolume() const { return 0.0f; }
float GetForeVolume() const { return 0.0f; }
void AddCallback(plMessage* msg) { hsRefCnt_SafeRef(msg); fCallbacks.Append(msg); }
uint32_t GetNumCallbacks() const { return 0; }
plMessage* GetCallback(int i) const { return nil; }
void SetFadeFromTime(float secs) { }
void SetFadeFromColor(hsColorRGBA c) { }
void SetFadeToTime(float secs) { }
void SetFadeToColor(hsColorRGBA c) { }
float GetFadeFromTime() const { return 0.0f; }
hsColorRGBA GetFadeFromColor() const { return hsColorRGBA(); }
float GetFadeToTime() const { return 0.0f; }
hsColorRGBA GetFadeToColor() const { return hsColorRGBA(); }
private:
plString fFileName;
hsTArray<plMessage*> fCallbacks;
};
#endif // plBinkPlayer_inc

4
Sources/Plasma/PubUtilLib/plSurface/CMakeLists.txt

@ -3,10 +3,6 @@ include_directories("../../NucleusLib/inc")
include_directories("../../NucleusLib")
include_directories("../../PubUtilLib")
if(Bink_SDK_AVAILABLE)
include_directories(${Bink_INCLUDE_DIR})
endif()
set(plSurface_SOURCES
hsGMaterial.cpp
plGrassShaderMod.cpp

21
Sources/Tools/MaxConvert/hsMaterialConverter.cpp

@ -109,7 +109,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "MaxPlasmaMtls/Layers/plLayerTexBitmapPB.h"
#include "pfSurface/plLayerAVI.h"
#include "pfSurface/plLayerBink.h"
#include "MaxComponent/plLightMapComponent.h"
#include "plDrawable/plGeometrySpan.h"
@ -693,14 +692,6 @@ bool hsMaterialConverter::IsQTLayer(Texmap* texMap)
hsGuardEnd;
}
bool hsMaterialConverter::IsBinkLayer(Texmap* texMap)
{
hsGuardBegin("hsMaterialConverter::IsBinkLayer");
return false;
hsGuardEnd;
}
// MAXR3 broke GetCoordMapping, here's a work around which
// works for everything except "Texture - Planar from Object XYZ"
@ -1984,22 +1975,16 @@ static plLayerInterface* IProcessLayerMovie(plPassMtlBase* mtl, plLayerTex* layT
plAnimStealthNode* stealth = IGetEntireAnimation(mtl);
plString ext = fileName.GetFileExt();
bool isBink = (ext.CompareI("bik") == 0);
bool isAvi = (ext.CompareI("avi") == 0);
if (isBink || isAvi)
if (isAvi)
{
plFileName movieName = plFileName::Join("avi", fileName.GetFileName());
plLayerMovie* movieLayer = nil;
plString moviePostfix;
if (isBink)
{
movieLayer = new plLayerBink;
moviePostfix = "_bink";
}
else if (isAvi)
if (isAvi)
{
movieLayer = new plLayerAVI;
moviePostfix = "_avi";
@ -4139,7 +4124,7 @@ bool hsMaterialConverter::IIsAnimatedTexmap(Texmap* texmap)
if (hsControlConverter::Instance().GetControllerByName(texmap, TSTR("Opacity"), ctl))
return true;
if (HasAnimatedTextures(texmap) || IsAVILayer(texmap) || IsBinkLayer(texmap)|| IsQTLayer(texmap) || ITextureTransformIsAnimated(texmap))
if (HasAnimatedTextures(texmap) || IsAVILayer(texmap) || IsQTLayer(texmap) || ITextureTransformIsAnimated(texmap))
return true;
return false;

1
Sources/Tools/MaxConvert/hsMaterialConverter.h

@ -126,7 +126,6 @@ public:
static bool IsFireLayer(plMaxNode* node, Texmap* texMap);
static bool IsAVILayer(Texmap* texMap);
static bool IsQTLayer(Texmap* texMap);
static bool IsBinkLayer(Texmap* texMap);
// static bool IsEnvironMapped(plMaxNode *node);
// static bool IsPortal(plMaxNode* node);
static bool ForceNoUvsFlatten(plMaxNode* node);

1
Sources/Tools/MaxConvert/plLayerConverter.cpp

@ -100,7 +100,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plPipeline/plDynamicEnvMap.h"
#include "pfSurface/plLayerAVI.h"
#include "pfSurface/plLayerBink.h"
#include "MaxPlasmaMtls/Layers/plPlasmaMAXLayer.h"
#include "MaxPlasmaMtls/Layers/plLayerTex.h"

3
Sources/Tools/MaxMain/CMakeLists.txt

@ -93,9 +93,6 @@ target_link_libraries(MaxMain MaxExport)
target_link_libraries(MaxMain MaxPlasmaMtls)
target_link_libraries(MaxMain ${3dsm_LIBRARIES})
if(Bink_SDK_AVAILABLE)
target_link_libraries(MaxMain ${Bink_LIBRARIES})
endif()
target_link_libraries(MaxMain ${EXPAT_LIBRARY})
target_link_libraries(MaxMain ${DirectX_LIBRARIES})
target_link_libraries(MaxMain ${JPEG_LIBRARY})

16
cmake/FindBink.cmake

@ -1,16 +0,0 @@
find_path(Bink_INCLUDE_DIR bink.h
C:/BinkW32
)
find_library(Bink_LIBRARY NAMES binkw32
PATHS C:/BinkW32
)
if(Bink_INCLUDE_DIR AND Bink_LIBRARY)
set(Bink_SDK_AVAILABLE TRUE)
add_definitions(-DBINK_SDK_AVAILABLE)
else()
set(Bink_SDK_AVAILABLE FALSE)
endif()
set(Bink_LIBRARIES ${Bink_LIBRARY})
Loading…
Cancel
Save