Added: Output file dependencies for build_interface.

--HG--
branch : build_pipeline_v3
hg/feature/build_pipeline_v3
kaetemi 13 years ago
parent 5454f8a724
commit b2d9a2fa3d

@ -14,10 +14,6 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
// lightmap_optimizer
// ------------------
// the goal is to regroup lightmap of a level into lightmap with a higher level
#include "nel/misc/common.h"
#include "nel/misc/file.h"
#include "nel/misc/bitmap.h"
@ -273,6 +269,9 @@ int main(int nNbArg, char **ppArgs)
{
try
{
ToolLogger.writeDepend(tgaName, AllMapNames[i]); // Write depend before error can occur.
ToolLogger.writeDepend(uvName, AllMapNames[i]);
NLMISC::CBitmap *pBtmp = new NLMISC::CBitmap;
NLMISC::CIFile inFile;
inFile.open( AllMapNames[i] );
@ -430,6 +429,10 @@ int main(int nNbArg, char **ppArgs)
// Load existing uv file
CIFile iFile;
string filename = CPath::lookup (existingUVfilename, false);
ToolLogger.writeDepend(tgaName, existingUVfilename); // Write depend before error can occur.
ToolLogger.writeDepend(uvName, existingUVfilename);
if( (filename == "") || (!iFile.open(filename)) )
{
outString (string("ERROR : could not open file ") + existingUVfilename + "\n");

@ -34,11 +34,15 @@
// NeL includes
#include <nel/misc/file.h>
#include <nel/misc/string_common.h>
// Project includes
namespace PIPELINE {
#ifdef ERROR
#undef ERROR
#endif
enum EError
{
ERROR,
@ -105,11 +109,31 @@ public:
{
if (m_ErrorLog)
{
// TODO_ERROR_LOG
switch (type)
{
case ERROR:
fwrite("ERROR", 1, 5, m_ErrorLog);
break;
case WARNING:
fwrite("WARNING", 1, 7, m_ErrorLog);
break;
case MESSAGE:
fwrite("MESSAGE", 1, 7, m_ErrorLog);
break;
}
fwrite("\t", 1, 1, m_ErrorLog);
fwrite(path.c_str(), 1, path.length(), m_ErrorLog);
fwrite("\t", 1, 1, m_ErrorLog);
std::string time = NLMISC::toString(NLMISC::CTime::getSecondsSince1970());
fwrite(time.c_str(), 1, time.length(), m_ErrorLog);
fwrite("\t", 1, 1, m_ErrorLog);
fwrite(error.c_str(), 1, error.length(), m_ErrorLog);
fwrite("\n", 1, 1, m_ErrorLog);
fflush(m_ErrorLog);
}
}
/// inputFile can only be file. May be not-yet-existing file for expected input. Directories are handled on process level.
/// inputFile can only be file. May be not-yet-existing file for expected input. Directories are handled on process level. You should call this before calling writeError on inputFile, so the error is also linked from the outputFile.
void writeDepend(const std::string &outputFile, const std::string &inputFile)
{
if (m_DependLog)

Loading…
Cancel
Save