From 6f632e71b1905bb8a1893c8076c4bf2d9005d786 Mon Sep 17 00:00:00 2001 From: Dario Sassi Date: Fri, 5 Feb 2016 10:54:38 +0000 Subject: [PATCH] =?UTF-8?q?EgtExecutor=201.6l11=20:=20-=20in=20salvataggio?= =?UTF-8?q?=20foto=20aggiunta=20possibilit=C3=A0=20di=20riferimento=20a=20?= =?UTF-8?q?nome=20progetto=20corrente=20con=20%PRJTITLE%.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- EgtExecutor.rc | Bin 11710 -> 11710 bytes PhotoObj.cpp | 30 ++++++++++++++++++++++-------- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/EgtExecutor.rc b/EgtExecutor.rc index ae7008f80e1dd4c17776d790a14ebf48c35bbbb6..af60755c30adbf79c9cdaa5c4e76d5bd21420246 100644 GIT binary patch delta 97 zcmdlNy)SyhKQ>0g&HvflnHdcyf8^BN93bV#xcLyb0g%7>yxe7`$;Si>pi&M>Zj75( e34^8nvt4JJyh#!!6(Ci|0@mORGsi)xjvD~sBqC4% delta 97 zcmdlNy)SyhKQ=~#&HvflnHdcxf8^BN93bV#xcLyb0g%7>yxe7`$;Si>pi&M>Zj75( e34^8nvt4JJyh#!!6(Ci|0@mORGsi)xjvD~qq9RBD diff --git a/PhotoObj.cpp b/PhotoObj.cpp index d1f1728..c6da842 100644 --- a/PhotoObj.cpp +++ b/PhotoObj.cpp @@ -15,6 +15,7 @@ #include "stdafx.h" #include "PhotoObj.h" #include "/EgtDev/Include/EXeExecutor.h" +#include "/EgtDev/Include/EXeConst.h" #include "/EgtDev/Include/EGrScene.h" #include "/EgtDev/Include/EGkGdbConst.h" #include "/EgtDev/Include/EGkUserObjFactory.h" @@ -83,11 +84,21 @@ PhotoObj::Dump( string& sOut, bool bMM, const char* szNewLine) const bool PhotoObj::Save( STRVECTOR& vString) const { + // recupero nome del progetto corrente + string sFilePath ; + ExeGetCurrFilePath( sFilePath) ; + string sFileTitle = GetFileTitleEgt( sFilePath) ; + // sostituzione dell'eventuale riferimento al nome del progetto nella path + string sPath = m_sPath ; + string sDir = GetDirectory( sPath) ; + string sName = GetFileName( sPath) ; + ReplaceString( sName, sFileTitle, SUB_PROJECT_TITLE) ; + sPath = sDir + "\\" + sName ; try { vString.insert( vString.begin(), NKEY, "") ; if ( ! SetVal( KEY_NAME, m_sName, vString[0])) return false ; - if ( ! SetVal( KEY_PATH, m_sPath, vString[1])) + if ( ! SetVal( KEY_PATH, const_cast( sPath), vString[1])) return false ; if ( ! SetVal( KEY_ORIG, m_ptOri, vString[2])) return false ; @@ -125,16 +136,19 @@ PhotoObj::Load( const STRVECTOR& vString) // verifico l'esistenza della texture if ( ExeExistsTexture( m_sName)) return true ; - // carico la texture dalla path indicata - if ( ExistsFile( m_sPath)) { - return ExeLoadTexture( m_sName, m_sPath, 0, m_dDimX, m_dDimY, TXR_CLAMP) ; - } - // provo dalla path del progetto corrente + // recupero nome e direttorio del progetto corrente string sFilePath ; ExeGetCurrFilePath( sFilePath) ; - string sDir = GetDirectory( sFilePath) ; + string sFileDir = GetDirectory( sFilePath) ; + string sFileTitle = GetFileTitleEgt( sFilePath) ; + // sostituzione dell'eventuale riferimento al nome del progetto nella path + ReplaceString( m_sPath, SUB_PROJECT_TITLE, sFileTitle) ; + // carico la texture dalla path indicata + if ( ExistsFile( m_sPath)) + return ExeLoadTexture( m_sName, m_sPath, 0, m_dDimX, m_dDimY, TXR_CLAMP) ; + // provo dalla path del progetto corrente string sName = GetFileName( m_sPath) ; - return ExeLoadTexture( m_sName, sDir + "\\" + sName, 0, m_dDimX, m_dDimY, TXR_CLAMP) ; + return ExeLoadTexture( m_sName, sFileDir + "\\" + sName, 0, m_dDimX, m_dDimY, TXR_CLAMP) ; } //----------------------------------------------------------------------------