From 63faefebeaf8d2613844bdcf8473dc365a6f4e4b Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Mon, 13 Feb 2017 08:21:21 +0000 Subject: [PATCH] EgtExecutor 1.8b4 : - aggiunta a Exe e Lua funzione GetImage. --- EXE_Scene.cpp | 17 ++++++++++++++--- EgtExecutor.rc | Bin 15088 -> 15088 bytes LUA_Scene.cpp | 26 ++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/EXE_Scene.cpp b/EXE_Scene.cpp index 84b83a8..744834c 100644 --- a/EXE_Scene.cpp +++ b/EXE_Scene.cpp @@ -757,7 +757,7 @@ ExeExistsTexture( const string& sName) //----------------------------------------------------------------------------- bool -ExeGetTexturePixels( const std::string& sName, int& nWidth, int& nHeight) +ExeGetTexturePixels( const string& sName, int& nWidth, int& nHeight) { IEGrScene* pScene = GetCurrScene() ; VERIFY_SCENE( pScene, false) @@ -767,7 +767,7 @@ ExeGetTexturePixels( const std::string& sName, int& nWidth, int& nHeight) //----------------------------------------------------------------------------- bool -ExeGetTextureDimensions( const std::string& sName, double& dDimX, double& dDimY) +ExeGetTextureDimensions( const string& sName, double& dDimX, double& dDimY) { IEGrScene* pScene = GetCurrScene() ; VERIFY_SCENE( pScene, false) @@ -777,10 +777,21 @@ ExeGetTextureDimensions( const std::string& sName, double& dDimX, double& dDimY) //----------------------------------------------------------------------------- bool -ExeChangeTextureDimensions( const std::string& sName, double dDimX, double dDimY) +ExeChangeTextureDimensions( const string& sName, double dDimX, double dDimY) { IEGrScene* pScene = GetCurrScene() ; VERIFY_SCENE( pScene, false) // modifico le dimensioni della texture return pScene->ChangeTextureDimensions( sName, dDimX, dDimY) ; } + +//----------------------------------------------------------------------------- +bool +ExeGetImage( int nShowMode, Color colBackTop, Color colBackBottom, + int nWidth, int nHeight, const string& sFile) +{ + IEGrScene* pScene = GetCurrScene() ; + VERIFY_SCENE( pScene, false) + // creo e salvo una immagine della scena + return pScene->GetImage( nShowMode, false, false, colBackTop, colBackBottom, nWidth, nHeight, sFile) ; +} diff --git a/EgtExecutor.rc b/EgtExecutor.rc index e794e3184609fff8939ee9c895f9ac32127bfabc..de1edc4f6b2f2c62ff3ffd44978ee6ae107b5f62 100644 GIT binary patch delta 79 zcmexR`k{2gFE&P#&A-`PnSqoe*K!sx?>N)s4T4pSCX*exk~jAW*?>e(i-FY$N+HxV MD8kglDNT|90G!nul>h($ delta 79 zcmexR`k{2gFE&Qw&A-`PnSqoe*K!sx?>N)s4T4pS#*-bnk~jAW*?>e(i-FY$N+HxV MD8kglDNT|90Go*$jQ{`u diff --git a/LUA_Scene.cpp b/LUA_Scene.cpp index 9b7527f..1b7a916 100644 --- a/LUA_Scene.cpp +++ b/LUA_Scene.cpp @@ -189,6 +189,31 @@ LuaSetViewCenter( lua_State* L) return 1 ; } +//------------------------------------------------------------------------------- +static int +LuaGetImage( lua_State* L) +{ + // 6 argomenti : nShowMode, colBackTop, colBackBottom, nWidth, nHeight, sFile + int nShowMode ; + LuaCheckParam( L, 1, nShowMode) + Color colBackTop ; + LuaCheckParam( L, 2, colBackTop) + Color colBackBottom ; + LuaCheckParam( L, 3, colBackBottom) + int nWidth ; + LuaCheckParam( L, 4, nWidth) + int nHeight ; + LuaCheckParam( L, 5, nHeight) + string sFile ; + LuaCheckParam( L, 6, sFile) + LuaClearStack( L) ; + // creo e salvo una immagine della scena + bool bOk = ExeGetImage( nShowMode, colBackTop, colBackBottom, nWidth, nHeight, sFile) ; + // restituisco il risultato + LuaSetParam( L, bOk) ; + return 1 ; +} + //------------------------------------------------------------------------------- bool LuaInstallScene( LuaMgr& luaMgr) @@ -204,5 +229,6 @@ LuaInstallScene( LuaMgr& luaMgr) bOk = bOk && luaMgr.RegisterFunction( "EgtSetView", LuaSetView) ; bOk = bOk && luaMgr.RegisterFunction( "EgtSetGenericView", LuaSetGenericView) ; bOk = bOk && luaMgr.RegisterFunction( "EgtSetViewCenter", LuaSetViewCenter) ; + bOk = bOk && luaMgr.RegisterFunction( "EgtGetImage", LuaGetImage) ; return bOk ; }