@@eezstreet Works like a charm for the filename, but gives out this error when trying to do the texture path: error C2664: 'tostring' : cannot convert parameter 1 from 'WStr' to 'const std::wstring &' It needs to be WStr though.
if( tex ) // write out a single 'skin'
{
// Once we have the filename we mangle it. We search for
// 'models' and if found we remove the filename to that part.
// Thus if we have "C:/quake3/baseq3/models/mapobjects/texture.tga"
// It becomes "models/mapobjects/texture.tga"
// otherwise we just leave it.
WStr mapname = ((BitmapTex *)tex)->GetMapName();
subname = _tcsstr( mapname, _T("models"));
//eezstreet UNICODE to ASCII fix
std::string output_file;
tostring(mapname, output_file);
std::string output_sub;
tostring(subname, output_sub);
if( !g_smart_paths || subname == NULL )
//fwrite( mapname, 68, 1, file ); // full texture filename
//eezstreet UNICODE to ASCII fix
fwrite(output_file.c_str(), 68, 1, file ); // full texture filename
else
//fwrite( subname, 68, 1, file ); // full texture filename
//eezstreet UNICODE to ASCII fix
fwrite( output_sub.c_str(), 68, 1, file ); // filename from 'models' on.
}