EgtExecutor 1.6l11 :

- in salvataggio foto aggiunta possibilità di riferimento a nome progetto corrente con %PRJTITLE%.
This commit is contained in:
Dario Sassi
2016-02-05 10:54:38 +00:00
parent 7ce38a145a
commit 6f632e71b1
2 changed files with 22 additions and 8 deletions
BIN
View File
Binary file not shown.
+22 -8
View File
@@ -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<const string&>( 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) ;
}
//----------------------------------------------------------------------------